diff --git a/.gitignore b/.gitignore index 270f81832d..fff313d6a3 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ ipch/ *.opensdf SubmissionInfo Generated Files +AppPackages # Ignore files build by ndk and eclipse libs/ diff --git a/build/cocos2d-win8.1-universal.sln b/build/cocos2d-win8.1-universal.sln new file mode 100644 index 0000000000..49f4f7a93a --- /dev/null +++ b/build/cocos2d-win8.1-universal.sln @@ -0,0 +1,228 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{B3F299D4-B4CA-4F0B-8BE2-FB328483BC13}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Shared", "..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems", "{5D6F020F-7E72-4494-90A0-2DF11D235DF9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", "..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj", "{9335005F-678E-4E8E-9B84-50037216AEC8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.WindowsPhone", "..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.WindowsPhone\libcocos2d_8_1.WindowsPhone.vcxproj", "{22F3B9DF-1209-4574-8331-003966F562BF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-tests", "cpp-tests", "{572742C5-9322-4548-AB8B-96C3750A1B5D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests.Shared", "..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems", "{BE3A1791-5BCE-4CEA-92CD-0E2D86DDE27A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests.Windows", "..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Windows\cpp-tests.Windows.vcxproj", "{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests.WindowsPhone", "..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.WindowsPhone\cpp-tests.WindowsPhone.vcxproj", "{15247C71-5289-4913-B88F-E253CC353720}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{85630454-74EA-4B5B-9B62-0E459B4476CB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbox2d", "libbox2d", "{B3D1A3D5-9F54-43AF-9322-230B53242B78}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Shared", "..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems", "{4A3C6BA8-C227-498B-AA21-40BDA27B461F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Windows", "..\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj", "{3B26A12D-3A44-47EA-82D2-282660FC844D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.WindowsPhone", "..\external\Box2D\proj.win8.1-universal\libbox2d.WindowsPhone\libbox2d.WindowsPhone.vcxproj", "{22F798D8-BFFF-4754-996F-A5395343D5EC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libSpine", "libSpine", "{6FEB795C-C98C-4C8C-A88B-A35DEE205348}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems", "{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.WindowsPhone", "..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.WindowsPhone\libSpine.WindowsPhone.vcxproj", "{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-empty-test", "cpp-empty-test", "{B70EF25E-E352-4020-BCDF-388973E44637}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Shared", "..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems", "{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Windows", "..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Windows\HelloCpp.Windows.vcxproj", "{79A8FCDA-4B12-4DD1-B676-FF148D651638}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.WindowsPhone", "..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.WindowsPhone\HelloCpp.WindowsPhone.vcxproj", "{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4 + ..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems*{15247c71-5289-4913-b88f-e253cc353720}*SharedItemsImports = 4 + ..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9 + ..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4 + ..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9 + ..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4 + ..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9 + ..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems*{be3a1791-5bce-4cea-92cd-0e2d86dde27a}*SharedItemsImports = 9 + ..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9 + ..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4 + ..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{22f3b9df-1209-4574-8331-003966f562bf}*SharedItemsImports = 4 + ..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{22f798d8-bfff-4754-996f-a5395343d5ec}*SharedItemsImports = 4 + ..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4 + ..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems*{f2bae06b-caae-43ee-b21b-57fa48db04fa}*SharedItemsImports = 4 + ..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{396fe85e-bb05-4b92-bccb-f89aed4ea41a}*SharedItemsImports = 4 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|ARM = Release|ARM + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.ActiveCfg = Debug|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.Build.0 = Debug|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.ActiveCfg = Debug|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.Build.0 = Debug|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.ActiveCfg = Debug|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.Build.0 = Debug|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.ActiveCfg = Release|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.Build.0 = Release|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.ActiveCfg = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.Build.0 = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.ActiveCfg = Release|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.Build.0 = Release|x64 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.ActiveCfg = Debug|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.Build.0 = Debug|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.ActiveCfg = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.Build.0 = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|x64.ActiveCfg = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.ActiveCfg = Release|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.Build.0 = Release|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.ActiveCfg = Release|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.Build.0 = Release|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|x64.ActiveCfg = Release|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|ARM.ActiveCfg = Debug|ARM + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|ARM.Build.0 = Debug|ARM + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|ARM.Deploy.0 = Debug|ARM + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|Win32.ActiveCfg = Debug|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|Win32.Build.0 = Debug|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|Win32.Deploy.0 = Debug|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|x64.ActiveCfg = Debug|x64 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|x64.Build.0 = Debug|x64 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|x64.Deploy.0 = Debug|x64 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|ARM.ActiveCfg = Release|ARM + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|ARM.Build.0 = Release|ARM + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|ARM.Deploy.0 = Release|ARM + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|Win32.ActiveCfg = Release|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|Win32.Build.0 = Release|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|Win32.Deploy.0 = Release|Win32 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|x64.ActiveCfg = Release|x64 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|x64.Build.0 = Release|x64 + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|x64.Deploy.0 = Release|x64 + {15247C71-5289-4913-B88F-E253CC353720}.Debug|ARM.ActiveCfg = Debug|ARM + {15247C71-5289-4913-B88F-E253CC353720}.Debug|ARM.Build.0 = Debug|ARM + {15247C71-5289-4913-B88F-E253CC353720}.Debug|ARM.Deploy.0 = Debug|ARM + {15247C71-5289-4913-B88F-E253CC353720}.Debug|Win32.ActiveCfg = Debug|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Debug|Win32.Build.0 = Debug|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Debug|Win32.Deploy.0 = Debug|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Debug|x64.ActiveCfg = Debug|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Release|ARM.ActiveCfg = Release|ARM + {15247C71-5289-4913-B88F-E253CC353720}.Release|ARM.Build.0 = Release|ARM + {15247C71-5289-4913-B88F-E253CC353720}.Release|ARM.Deploy.0 = Release|ARM + {15247C71-5289-4913-B88F-E253CC353720}.Release|Win32.ActiveCfg = Release|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Release|Win32.Build.0 = Release|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Release|Win32.Deploy.0 = Release|Win32 + {15247C71-5289-4913-B88F-E253CC353720}.Release|x64.ActiveCfg = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.ActiveCfg = Debug|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.Build.0 = Debug|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.Build.0 = Debug|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.ActiveCfg = Debug|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.Build.0 = Debug|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.ActiveCfg = Release|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.Build.0 = Release|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.ActiveCfg = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.Build.0 = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.ActiveCfg = Release|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.Build.0 = Release|x64 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.ActiveCfg = Debug|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.Build.0 = Debug|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.ActiveCfg = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.Build.0 = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|x64.ActiveCfg = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.ActiveCfg = Release|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.Build.0 = Release|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.ActiveCfg = Release|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.Build.0 = Release|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|x64.ActiveCfg = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.ActiveCfg = Debug|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.Build.0 = Debug|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.ActiveCfg = Debug|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.Build.0 = Debug|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.ActiveCfg = Debug|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.Build.0 = Debug|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.ActiveCfg = Release|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.Build.0 = Release|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.ActiveCfg = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.ActiveCfg = Debug|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.Build.0 = Debug|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.Build.0 = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|x64.ActiveCfg = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.ActiveCfg = Release|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.Build.0 = Release|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.ActiveCfg = Release|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.Build.0 = Release|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|x64.ActiveCfg = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.ActiveCfg = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Build.0 = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Deploy.0 = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.ActiveCfg = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Build.0 = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Deploy.0 = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.ActiveCfg = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Build.0 = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Deploy.0 = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.ActiveCfg = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Build.0 = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Deploy.0 = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.ActiveCfg = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Build.0 = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Deploy.0 = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.ActiveCfg = Release|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Build.0 = Release|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Deploy.0 = Release|x64 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.ActiveCfg = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Build.0 = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Deploy.0 = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.ActiveCfg = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Build.0 = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Deploy.0 = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|x64.ActiveCfg = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.ActiveCfg = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Build.0 = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Deploy.0 = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.ActiveCfg = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Build.0 = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Deploy.0 = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5D6F020F-7E72-4494-90A0-2DF11D235DF9} = {B3F299D4-B4CA-4F0B-8BE2-FB328483BC13} + {9335005F-678E-4E8E-9B84-50037216AEC8} = {B3F299D4-B4CA-4F0B-8BE2-FB328483BC13} + {22F3B9DF-1209-4574-8331-003966F562BF} = {B3F299D4-B4CA-4F0B-8BE2-FB328483BC13} + {BE3A1791-5BCE-4CEA-92CD-0E2D86DDE27A} = {572742C5-9322-4548-AB8B-96C3750A1B5D} + {F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA} = {572742C5-9322-4548-AB8B-96C3750A1B5D} + {15247C71-5289-4913-B88F-E253CC353720} = {572742C5-9322-4548-AB8B-96C3750A1B5D} + {B3D1A3D5-9F54-43AF-9322-230B53242B78} = {85630454-74EA-4B5B-9B62-0E459B4476CB} + {4A3C6BA8-C227-498B-AA21-40BDA27B461F} = {B3D1A3D5-9F54-43AF-9322-230B53242B78} + {3B26A12D-3A44-47EA-82D2-282660FC844D} = {B3D1A3D5-9F54-43AF-9322-230B53242B78} + {22F798D8-BFFF-4754-996F-A5395343D5EC} = {B3D1A3D5-9F54-43AF-9322-230B53242B78} + {6FEB795C-C98C-4C8C-A88B-A35DEE205348} = {85630454-74EA-4B5B-9B62-0E459B4476CB} + {ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {6FEB795C-C98C-4C8C-A88B-A35DEE205348} + {F3550FE0-C795-44F6-8FEB-093EB68143AE} = {6FEB795C-C98C-4C8C-A88B-A35DEE205348} + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF} = {6FEB795C-C98C-4C8C-A88B-A35DEE205348} + {A3AD93E4-0B2F-4C58-9181-69BED2E42E3E} = {B70EF25E-E352-4020-BCDF-388973E44637} + {79A8FCDA-4B12-4DD1-B676-FF148D651638} = {B70EF25E-E352-4020-BCDF-388973E44637} + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A} = {B70EF25E-E352-4020-BCDF-388973E44637} + EndGlobalSection +EndGlobal diff --git a/build/wp8/Cocos2dShaderCompiler/Assets/logo.png b/build/wp8/Cocos2dShaderCompiler/Assets/logo.png new file mode 100644 index 0000000000..e26771cb33 Binary files /dev/null and b/build/wp8/Cocos2dShaderCompiler/Assets/logo.png differ diff --git a/build/wp8/Cocos2dShaderCompiler/Assets/smalllogo.png b/build/wp8/Cocos2dShaderCompiler/Assets/smalllogo.png new file mode 100644 index 0000000000..1eb0d9d528 Binary files /dev/null and b/build/wp8/Cocos2dShaderCompiler/Assets/smalllogo.png differ diff --git a/build/wp8/Cocos2dShaderCompiler/Assets/splashscreen.png b/build/wp8/Cocos2dShaderCompiler/Assets/splashscreen.png new file mode 100644 index 0000000000..d8ded7198a Binary files /dev/null and b/build/wp8/Cocos2dShaderCompiler/Assets/splashscreen.png differ diff --git a/build/wp8/Cocos2dShaderCompiler/Assets/storelogo.png b/build/wp8/Cocos2dShaderCompiler/Assets/storelogo.png new file mode 100644 index 0000000000..dcb672712c Binary files /dev/null and b/build/wp8/Cocos2dShaderCompiler/Assets/storelogo.png differ diff --git a/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj b/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj index 8d18b52516..da1d0cbfe5 100644 --- a/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj +++ b/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj @@ -234,6 +234,7 @@ + @@ -256,6 +257,7 @@ + @@ -287,7 +289,6 @@ - @@ -318,7 +319,6 @@ - @@ -432,6 +432,7 @@ + @@ -454,6 +455,7 @@ + @@ -485,7 +487,6 @@ - @@ -519,7 +520,6 @@ false - diff --git a/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj.filters b/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj.filters index e428ea0402..4bb30fa911 100644 --- a/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj.filters +++ b/build/wp8/Cocos2dShaderCompiler/Cocos2dShaderCompiler.vcxproj.filters @@ -94,9 +94,6 @@ libcoco2d\base - - libcoco2d\base - libcoco2d\base @@ -175,9 +172,6 @@ libcoco2d\base - - libcoco2d\base - libcoco2d\base @@ -583,6 +577,12 @@ libcoco2d\external\unzip + + libcoco2d\2d + + + libcoco2d\2d + @@ -615,9 +615,6 @@ libcoco2d\base - - libcoco2d\base - libcoco2d\base @@ -708,9 +705,6 @@ libcoco2d\base - - libcoco2d\base - libcoco2d\base @@ -1155,6 +1149,12 @@ libcoco2d\external\unzip + + libcoco2d\2d + + + libcoco2d\2d + diff --git a/build/wp8/Cocos2dShaderCompiler/ShaderCompiler.cpp b/build/wp8/Cocos2dShaderCompiler/ShaderCompiler.cpp index d8c1d9a538..6ea1183367 100644 --- a/build/wp8/Cocos2dShaderCompiler/ShaderCompiler.cpp +++ b/build/wp8/Cocos2dShaderCompiler/ShaderCompiler.cpp @@ -28,7 +28,6 @@ THE SOFTWARE. #include "CCPrecompiledShaders.h" using namespace Concurrency; -using namespace DirectX; using namespace Microsoft::WRL; using namespace Windows::Foundation; using namespace Windows::UI::Core; diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 98b0f54411..591d62fb20 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -195,7 +195,6 @@ void TextFieldTTF::insertText(const char * text, size_t len) if (len > 0) { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8 && CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) if (_delegate && _delegate->onTextFieldInsertText(this, insert.c_str(), len)) { // delegate doesn't want to insert text @@ -206,15 +205,6 @@ void TextFieldTTF::insertText(const char * text, size_t len) std::string sText(_inputText); sText.append(insert); setString(sText); -#else - size_t existlen = _inputText.length(); - if (_delegate && _delegate->onTextFieldInsertText(this, insert.c_str() + existlen, len - existlen)) - { - // delegate doesn't want to insert text - return; - } - setString(insert); -#endif } if ((int)insert.npos == pos) { diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems index 4be2a11b3a..aceead4b72 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems @@ -115,7 +115,6 @@ - @@ -146,7 +145,6 @@ - @@ -328,6 +326,7 @@ + @@ -359,6 +358,7 @@ + @@ -397,6 +397,7 @@ + @@ -420,6 +421,7 @@ + @@ -532,7 +534,6 @@ - @@ -559,13 +560,11 @@ false - CompileAsCpp + NotUsing - NotUsing - @@ -709,6 +708,7 @@ + Create @@ -742,7 +742,7 @@ - + @@ -780,6 +780,7 @@ + @@ -803,6 +804,7 @@ + @@ -867,8 +869,13 @@ + + Document + + + \ No newline at end of file diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters index b0806073d1..a01ad4cdf3 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters @@ -3,204 +3,6 @@ - - 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 @@ -261,186 +63,6 @@ 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 - cocosbuilder\Header Files @@ -1165,9 +787,6 @@ ui\UIWidgets - - base - platform\winrt @@ -1282,9 +901,6 @@ ui\Layouts - - 2d - extension\AssetsManager @@ -1300,207 +916,399 @@ extension\AssetsManager + + platform\winrt + + + ui\UIWidgets\EditBox + + + 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 + + + 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 + - - 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 @@ -1549,150 +1357,6 @@ 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 - cocosbuilder\Source Files @@ -2086,9 +1750,6 @@ ui\UIWidgets\EditBox - - ui\UIWidgets\EditBox - ui\UIWidgets\ScrollWidget @@ -2279,9 +1940,6 @@ ui\UIWidgets - - base - platform\winrt @@ -2342,9 +2000,6 @@ ui\Layouts - - 2d - extension\AssetsManager @@ -2360,6 +2015,360 @@ extension\AssetsManager + + platform\winrt + + + ui\UIWidgets\EditBox + + + 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 + + + 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 + @@ -2686,5 +2695,14 @@ renderer + + renderer + + + 2d + + + 2d + \ No newline at end of file diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj index a082a15791..547e6b214c 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj @@ -109,7 +109,7 @@ /Zm200 %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) Console @@ -127,7 +127,7 @@ /Zm200 %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) Console @@ -145,7 +145,7 @@ /Zm200 %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) Console @@ -163,7 +163,7 @@ /Zm200 %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) Console diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 4ff32be3ab..227dfe2796 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -155,9 +155,8 @@ bool Director::init(void) _renderer = new (std::nothrow) Renderer; -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) _console = new (std::nothrow) Console; -#endif + return true; } @@ -181,9 +180,8 @@ Director::~Director(void) delete _renderer; -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) delete _console; -#endif + CC_SAFE_RELEASE(_eventDispatcher); diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index b06e20daf9..fccc541c87 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -128,8 +128,7 @@ bool ComAudio::serialize(void* r) } if (strcmp(className, "CCBackgroundAudio") == 0) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) - // no MP3 support for CC_PLATFORM_WP8 +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) std::string::size_type pos = filePath.find(".mp3"); if (pos == filePath.npos) { diff --git a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems index 9a1fd46146..88cb6a4ae6 100644 --- a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems +++ b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems @@ -133,7 +133,4 @@ - - - \ No newline at end of file diff --git a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems.filters b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems.filters index 06321d9f79..e89ddb9cf3 100644 --- a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems.filters +++ b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Shared/libSpine.Shared.vcxitems.filters @@ -65,7 +65,4 @@ - - - \ No newline at end of file diff --git a/cocos/platform/win8.1-universal/Cocos2dRenderer.cpp b/cocos/platform/win8.1-universal/Cocos2dRenderer.cpp new file mode 100644 index 0000000000..e0c02e3ee8 --- /dev/null +++ b/cocos/platform/win8.1-universal/Cocos2dRenderer.cpp @@ -0,0 +1,85 @@ +/* +* 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" + +// 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(const int width, const int height, CoreDispatcher^ dispatcher, Panel^ panel) + : mApp(nullptr) + , mWidth(width) + , mHeight(height) + , m_dispatcher(dispatcher) + , m_panel(panel) +{ + mApp = new AppDelegate(); + auto director = cocos2d::Director::getInstance(); + + GLViewImpl* glview = GLViewImpl::create("Test Cpp"); + glview->setDispatcher(dispatcher); + glview->setPanel(panel); + glview->Create(static_cast(width), static_cast(height), DisplayOrientations::Landscape); + director->setOpenGLView(glview); + CCApplication::getInstance()->run(); +} + +Cocos2dRenderer::~Cocos2dRenderer() +{ + delete mApp; +} + +// Draws a basic triangle +void Cocos2dRenderer::Draw(GLsizei width, GLsizei height) +{ + if (width != mWidth || height != mHeight) + { + mWidth = width; + mHeight = height; + GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(static_cast(width), static_cast(height)); + } + + GLViewImpl::sharedOpenGLView()->ProcessEvents(); + GLViewImpl::sharedOpenGLView()->Render(); +} + +void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args) +{ + GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args); +} + +void Cocos2dRenderer::QueueKeyBoardEvent(cocos2d::Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e) +{ + //GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, e); +} + + diff --git a/cocos/platform/win8.1-universal/Cocos2dRenderer.h b/cocos/platform/win8.1-universal/Cocos2dRenderer.h new file mode 100644 index 0000000000..387445f6d5 --- /dev/null +++ b/cocos/platform/win8.1-universal/Cocos2dRenderer.h @@ -0,0 +1,47 @@ +/* +* 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(const int width, const int height, Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel); + ~Cocos2dRenderer(); + void Draw(GLsizei width, GLsizei height); + void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); + void QueueKeyBoardEvent(Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e); + + private: + + int mWidth; + int mHeight; + // The AppDelegate for the Cocos2D app + AppDelegate* mApp; + Platform::Agile m_dispatcher; + Platform::Agile m_panel; + }; +} \ No newline at end of file diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/OpenGLES.cpp b/cocos/platform/win8.1-universal/OpenGLES.cpp similarity index 83% rename from tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/OpenGLES.cpp rename to cocos/platform/win8.1-universal/OpenGLES.cpp index 793b91d83f..943b0856fc 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/OpenGLES.cpp +++ b/cocos/platform/win8.1-universal/OpenGLES.cpp @@ -1,5 +1,22 @@ -#include "pch.h" +/* +* 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; @@ -36,8 +53,13 @@ void OpenGLES::Initialize() // This can be used to configure D3D11. For example, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE could be used. // This would ask the graphics card to use D3D11 Feature Level 9_3 instead of Feature Level 11_0+. // On Windows Phone, this would allow the Phone Emulator to act more like the GPUs that are available on real Phone devices. +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE, + EGL_NONE, +#else EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_NONE, +#endif }; const EGLint contextAttributes[] = diff --git a/cocos/platform/win8.1-universal/OpenGLES.h b/cocos/platform/win8.1-universal/OpenGLES.h new file mode 100644 index 0000000000..ce9f2a9cdf --- /dev/null +++ b/cocos/platform/win8.1-universal/OpenGLES.h @@ -0,0 +1,52 @@ +/* +* 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(); + +private: + void Initialize(); + void Cleanup(); + +private: + EGLDisplay mEglDisplay; + EGLContext mEglContext; + EGLConfig mEglConfig; +}; diff --git a/cocos/platform/win8.1-universal/OpenGLESPage.xaml b/cocos/platform/win8.1-universal/OpenGLESPage.xaml new file mode 100644 index 0000000000..e5b62802a5 --- /dev/null +++ b/cocos/platform/win8.1-universal/OpenGLESPage.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml.cpp b/cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp similarity index 59% rename from tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml.cpp rename to cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp index 29392e8af4..c8ee9afb42 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml.cpp +++ b/cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp @@ -1,10 +1,40 @@ -#include "pch.h" +/* +* 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 cpp_tests; +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; OpenGLESPage::OpenGLESPage() : OpenGLESPage(nullptr) @@ -16,7 +46,8 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : mOpenGLES(openGLES), mRenderSurface(EGL_NO_SURFACE), mCustomRenderSurfaceSize(0,0), - mUseCustomRenderSurfaceSize(false) + mUseCustomRenderSurfaceSize(false), + m_coreInput(nullptr) { InitializeComponent(); @@ -31,7 +62,11 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : this->Loaded += ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded); -#if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height }; + +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync(); +#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(); @@ -39,7 +74,28 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false; #endif - mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height }; + // 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(this, &OpenGLESPage::OnPointerPressed); + m_coreInput->PointerMoved += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerMoved); + m_coreInput->PointerReleased += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerReleased); + + // Begin processing input messages as they're delivered. + m_coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit); + }); + + // Run task on a dedicated high priority background thread. + m_inputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced); + } OpenGLESPage::~OpenGLESPage() @@ -55,6 +111,32 @@ void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::Rou StartRenderLoop(); } +void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerPressed, e); + } +} + +void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerMoved, e); + } +} + +void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerReleased, e); + } +} + + + void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args) { if (args->Visible && mRenderSurface != EGL_NO_SURFACE) @@ -143,21 +225,29 @@ void OpenGLESPage::StartRenderLoop() return; } + auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher; + // Create a task for rendering that will be run on a background thread. - auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this](Windows::Foundation::IAsyncAction ^ action) + auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this, dispatcher](Windows::Foundation::IAsyncAction ^ action) { critical_section::scoped_lock lock(mRenderSurfaceCriticalSection); mOpenGLES->MakeCurrent(mRenderSurface); - HelloTriangleRenderer renderer; + + GLsizei panelWidth = 0; + GLsizei panelHeight = 0; + GetSwapChainPanelSize(&panelWidth, &panelHeight); + + if (m_renderer.get() == nullptr) + { + m_renderer = std::make_shared(panelWidth, panelHeight, dispatcher, swapChainPanel); + } while (action->Status == Windows::Foundation::AsyncStatus::Started) { - GLsizei panelWidth = 0; - GLsizei panelHeight = 0; - + GetSwapChainPanelSize(&panelWidth, &panelHeight); - renderer.Draw(panelWidth, panelHeight); + m_renderer.get()->Draw(panelWidth, panelHeight); // The call to eglSwapBuffers might not be successful (i.e. due to Device Lost) // If the call fails, then we must reinitialize EGL and the GL resources. @@ -165,6 +255,7 @@ void OpenGLESPage::StartRenderLoop() { // XAML objects like the SwapChainPanel must only be manipulated on the UI thread. swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]() + //swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]() { RecoverFromLostDevice(); }, CallbackContext::Any)); diff --git a/cocos/platform/win8.1-universal/OpenGLESPage.xaml.h b/cocos/platform/win8.1-universal/OpenGLESPage.xaml.h new file mode 100644 index 0000000000..d8ddccc63e --- /dev/null +++ b/cocos/platform/win8.1-universal/OpenGLESPage.xaml.h @@ -0,0 +1,71 @@ +/* +* 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 "OpenGLES.h" +#include "OpenGLESPage.g.h" +#include + +#include "Cocos2dRenderer.h" + +namespace cocos2d +{ + public ref class OpenGLESPage sealed + { + public: + OpenGLESPage(); + virtual ~OpenGLESPage(); + + internal: + OpenGLESPage(OpenGLES* openGLES); + + private: + void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); + void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e); + void GetSwapChainPanelSize(GLsizei* width, GLsizei* height); + void CreateRenderSurface(); + void DestroyRenderSurface(); + void RecoverFromLostDevice(); + void StartRenderLoop(); + void StopRenderLoop(); + + OpenGLES* mOpenGLES; + std::shared_ptr m_renderer; + + Windows::Foundation::Size mSwapChainPanelSize; + Concurrency::critical_section mSwapChainPanelSizeCriticalSection; + + Windows::Foundation::Size mCustomRenderSurfaceSize; + bool mUseCustomRenderSurfaceSize; + + EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page + Concurrency::critical_section mRenderSurfaceCriticalSection; + Windows::Foundation::IAsyncAction^ mRenderLoopWorker; + + // Track user input on a background worker thread. + Windows::Foundation::IAsyncAction^ m_inputLoopWorker; + Windows::UI::Core::CoreIndependentInputSource^ m_coreInput; + + // Independent input handling functions. + void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + }; +} diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/pch.cpp b/cocos/platform/win8.1-universal/pch.cpp similarity index 100% rename from tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/pch.cpp rename to cocos/platform/win8.1-universal/pch.cpp diff --git a/cocos/platform/win8.1-universal/pch.h b/cocos/platform/win8.1-universal/pch.h new file mode 100644 index 0000000000..2e511d964f --- /dev/null +++ b/cocos/platform/win8.1-universal/pch.h @@ -0,0 +1,14 @@ +// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "cocos2d.h" +#include "cocos-ext.h" + + diff --git a/cocos/platform/winrt/CCCommon.cpp b/cocos/platform/winrt/CCCommon.cpp index 4c8c2c6663..f38615b3ab 100644 --- a/cocos/platform/winrt/CCCommon.cpp +++ b/cocos/platform/winrt/CCCommon.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "platform/CCStdC.h" #include "CCWinRTUtils.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || defined(WP8_SHADER_COMPILER) #include "platform/wp8/CCGLViewImpl-wp8.h" #endif @@ -42,17 +42,9 @@ void MessageBox(const char * pszMsg, const char * pszTitle) // Create the message dialog and set its content Platform::String^ message = ref new Platform::String(CCUtf8ToUnicode(pszMsg, -1).c_str()); Platform::String^ title = ref new Platform::String(CCUtf8ToUnicode(pszTitle, -1).c_str()); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - Windows::UI::Popups::MessageDialog^ msg = ref new Windows::UI::Popups::MessageDialog(message, title); - // Set the command to be invoked when a user presses 'ESC' - msg->CancelCommandIndex = 1; - - // Show the message dialog - msg->ShowAsync(); -#else +#ifndef WP8_SHADER_COMPILER GLViewImpl::sharedOpenGLView()->ShowMessageBox(title, message); #endif - } diff --git a/cocos/platform/winrt/CCDevice.cpp b/cocos/platform/winrt/CCDevice.cpp index 2fd9823ef6..46b631ea4d 100644 --- a/cocos/platform/winrt/CCDevice.cpp +++ b/cocos/platform/winrt/CCDevice.cpp @@ -51,6 +51,7 @@ static Accelerometer^ sAccelerometer = nullptr; void Device::setAccelerometerEnabled(bool isEnabled) { +#ifndef WP8_SHADER_COMPILER static Windows::Foundation::EventRegistrationToken sToken; static bool sEnabled = false; @@ -91,7 +92,6 @@ void Device::setAccelerometerEnabled(bool isEnabled) acc.z = reading->AccelerationZ; acc.timestamp = 0; -#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 auto orientation = GLViewImpl::sharedOpenGLView()->getDeviceOrientation(); switch (orientation) @@ -121,14 +121,12 @@ void Device::setAccelerometerEnabled(bool isEnabled) acc.y = reading->AccelerationY; break; } -#endif -#ifndef WP8_SHADER_COMPILER std::shared_ptr event(new AccelerometerEvent(acc)); cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(event); -#endif }); } +#endif } void Device::setAccelerometerInterval(float interval) diff --git a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp index d5ecc8e138..4526c07091 100644 --- a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp +++ b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp @@ -24,7 +24,6 @@ THE SOFTWARE. ****************************************************************************/ #include "CCGLViewImpl-winrt.h" -#include "deprecated/CCSet.h" #include "base/ccMacros.h" #include "base/CCDirector.h" #include "base/CCTouch.h" @@ -40,7 +39,9 @@ using namespace Windows::Graphics::Display; using namespace Windows::UI::Input; using namespace Windows::UI::Core; using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Input; using namespace Windows::System; using namespace Windows::UI::ViewManagement; using namespace Windows::ApplicationModel; @@ -48,7 +49,6 @@ using namespace Windows::ApplicationModel::Core; using namespace Windows::ApplicationModel::Activation; using namespace Platform; using namespace Microsoft::WRL; -using namespace PhoneDirect3DXamlAppComponent; NS_CC_BEGIN @@ -79,8 +79,6 @@ GLViewImpl::GLViewImpl() , m_windowVisible(true) , m_width(0) , m_height(0) - , m_delegate(nullptr) - , m_messageBoxDelegate(nullptr) , m_orientation(DisplayOrientations::Landscape) { s_pEglView = this; @@ -116,6 +114,16 @@ bool GLViewImpl::Create(float width, float height, DisplayOrientations orientati return true; } +void GLViewImpl::setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher) +{ + m_dispatcher = dispatcher; +} + +void GLViewImpl::setPanel(Windows::UI::Xaml::Controls::Panel^ panel) +{ + m_panel = panel; +} + void GLViewImpl::setIMEKeyboardState(bool bOpen) @@ -124,44 +132,55 @@ void GLViewImpl::setIMEKeyboardState(bool bOpen) setIMEKeyboardState(bOpen, str); } +bool GLViewImpl::ShowMessageBox(Platform::String^ title, Platform::String^ message) +{ + if (m_dispatcher.Get()) + { + m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([title, message]() + { + // Show the message dialog + auto msg = ref new Windows::UI::Popups::MessageDialog(message, title); + // Set the command to be invoked when a user presses 'ESC' + msg->CancelCommandIndex = 1; + msg->ShowAsync(); + })); + + return true; + } + return false; +} + void GLViewImpl::setIMEKeyboardState(bool bOpen, std::string str) { - if(m_delegate) + if(bOpen) { - if(bOpen) + if (m_keyboard == nullptr) { - m_delegate->Invoke(Cocos2dEvent::ShowKeyboard, stringToPlatformString(str)); + m_keyboard = ref new KeyBoardWinRT(m_dispatcher.Get(), m_panel.Get()); } - else + m_keyboard->ShowKeyboard(PlatformStringFromString(str)); + } + else + { + if (m_keyboard != nullptr) { - m_delegate->Invoke(Cocos2dEvent::HideKeyboard, stringToPlatformString(str)); + m_keyboard->HideKeyboard(PlatformStringFromString(str)); } + m_keyboard = nullptr; } } -Platform::String^ GLViewImpl::stringToPlatformString(std::string strSrc) -{ - // to wide char - int strLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0); - wchar_t* wstr = new wchar_t[strLen + 1]; - memset(wstr, 0, strLen + 1); - MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, wstr, strLen); - Platform::String^ strDst = ref new Platform::String(wstr); - delete[] wstr; - return strDst; -} + void GLViewImpl::swapBuffers() { - //eglSwapBuffers(m_eglDisplay, m_eglSurface); + } bool GLViewImpl::isOpenGLReady() { return true; - // TODO: need to revisit this - //return (m_eglDisplay && m_orientation != DisplayOrientations::None); } void GLViewImpl::end() @@ -184,7 +203,7 @@ void GLViewImpl::OnBackKeyPress() std::string str; if(m_delegate) { - m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str)); + //m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str)); } } @@ -308,30 +327,6 @@ void GLViewImpl::OnRendering() } } - - -bool GLViewImpl::ShowMessageBox(Platform::String^ title, Platform::String^ message) -{ - if(m_messageBoxDelegate) - { - m_messageBoxDelegate->Invoke(title, message); - return true; - } - return false; -} - -bool GLViewImpl::OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler^ receiveHandler) -{ - if(m_editBoxDelegate) - { - m_editBoxDelegate->Invoke(strPlaceHolder, strText, maxLength, inputMode, inputFlag, receiveHandler); - return true; - } - return false; -} - - - // called by orientation change from WP8 XAML void GLViewImpl::UpdateOrientation(DisplayOrientations orientation) { @@ -345,9 +340,12 @@ void GLViewImpl::UpdateOrientation(DisplayOrientations orientation) // called by size change from WP8 XAML void GLViewImpl::UpdateForWindowSizeChange(float width, float height) { - m_width = width; - m_height = height; - UpdateWindowSize(); + if (width != m_width || height != m_height) + { + m_width = width; + m_height = height; + UpdateWindowSize(); + } } #if 0 @@ -371,18 +369,9 @@ void GLViewImpl::UpdateWindowSize() { float width, height; - if(m_orientation == DisplayOrientations::Landscape || m_orientation == DisplayOrientations::LandscapeFlipped) - { - width = m_height; - height = m_width; - } - else - { - width = m_width; - height = m_height; - } + width = m_width; + height = m_height; - UpdateOrientationMatrix(); //CCSize designSize = getDesignResolutionSize(); if(!m_initialized) @@ -403,45 +392,15 @@ void GLViewImpl::UpdateWindowSize() } } -const Mat4& GLViewImpl::getOrientationMatrix() const -{ - return m_orientationMatrix; -}; - - -void GLViewImpl::UpdateOrientationMatrix() -{ - kmMat4Identity(&m_orientationMatrix); - kmMat4Identity(&m_reverseOrientationMatrix); - switch(m_orientation) - { - case Windows::Graphics::Display::DisplayOrientations::PortraitFlipped: - kmMat4RotationZ(&m_orientationMatrix, static_cast(M_PI)); - kmMat4RotationZ(&m_reverseOrientationMatrix, static_cast(-M_PI)); - break; - - case Windows::Graphics::Display::DisplayOrientations::Landscape: - kmMat4RotationZ(&m_orientationMatrix, static_cast(-M_PI_2)); - kmMat4RotationZ(&m_reverseOrientationMatrix, static_cast(M_PI_2)); - break; - - case Windows::Graphics::Display::DisplayOrientations::LandscapeFlipped: - kmMat4RotationZ(&m_orientationMatrix, static_cast(M_PI_2)); - kmMat4RotationZ(&m_reverseOrientationMatrix, static_cast(-M_PI_2)); - break; - - default: - break; - } -} - cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p) { cocos2d::Vec2 returnValue; float x = p.X; float y = p.Y; + returnValue = Vec2(x, y); +#if 0 switch (m_orientation) { case DisplayOrientations::Portrait: @@ -458,6 +417,7 @@ cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p) returnValue = Vec2(m_height - y, x); break; } +#endif float zoomFactor = GLViewImpl::sharedOpenGLView()->getFrameZoomFactor(); if(zoomFactor > 0.0f) { @@ -473,48 +433,23 @@ cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p) Vec2 GLViewImpl::GetPoint(PointerEventArgs^ args) { return TransformToOrientation(args->CurrentPoint->Position); - } void GLViewImpl::setViewPortInPoints(float x , float y , float w , float h) { - switch(m_orientation) - { - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: - glViewport((GLint)(y * _scaleY + _viewPortRect.origin.y), - (GLint)(x * _scaleX + _viewPortRect.origin.x), - (GLsizei)(h * _scaleY), - (GLsizei)(w * _scaleX)); - break; - - default: - glViewport((GLint)(x * _scaleX + _viewPortRect.origin.x), - (GLint)(y * _scaleY + _viewPortRect.origin.y), - (GLsizei)(w * _scaleX), - (GLsizei)(h * _scaleY)); - } + glViewport((GLint) (x * _scaleX + _viewPortRect.origin.x), + (GLint) (y * _scaleY + _viewPortRect.origin.y), + (GLsizei) (w * _scaleX), + (GLsizei) (h * _scaleY)); } void GLViewImpl::setScissorInPoints(float x , float y , float w , float h) { - switch(m_orientation) - { - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: - glScissor((GLint)(y * _scaleX + _viewPortRect.origin.y), - (GLint)((_viewPortRect.size.width - ((x + w) * _scaleX)) + _viewPortRect.origin.x), - (GLsizei)(h * _scaleY), - (GLsizei)(w * _scaleX)); - break; - - default: - glScissor((GLint)(x * _scaleX + _viewPortRect.origin.x), - (GLint)(y * _scaleY + _viewPortRect.origin.y), - (GLsizei)(w * _scaleX), - (GLsizei)(h * _scaleY)); - } + glScissor((GLint) (x * _scaleX + _viewPortRect.origin.x), + (GLint) (y * _scaleY + _viewPortRect.origin.y), + (GLsizei) (w * _scaleX), + (GLsizei) (h * _scaleY)); } void GLViewImpl::QueueBackKeyPress() diff --git a/cocos/platform/winrt/CCGLViewImpl-winrt.h b/cocos/platform/winrt/CCGLViewImpl-winrt.h index e30672fb2a..33eac1cfbe 100644 --- a/cocos/platform/winrt/CCGLViewImpl-winrt.h +++ b/cocos/platform/winrt/CCGLViewImpl-winrt.h @@ -33,21 +33,16 @@ THE SOFTWARE. #include - +#include #include -#include #include #include - -#include -#include - +#include NS_CC_BEGIN class GLViewImpl; - class CC_DLL GLViewImpl : public GLView { public: @@ -59,20 +54,20 @@ public: virtual void swapBuffers(); virtual void setViewPortInPoints(float x , float y , float w , float h); virtual void setScissorInPoints(float x , float y , float w , float h); - const Mat4& getOrientationMatrix() const; - const Mat4& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;}; Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;}; Size getRenerTargetSize() const { return Size(m_width, m_height); } virtual void setIMEKeyboardState(bool bOpen); virtual void setIMEKeyboardState(bool bOpen, std::string str); - Platform::String^ stringToPlatformString(std::string strSrc); - void ShowKeyboard(Windows::Foundation::Rect r); - void HideKeyboard(Windows::Foundation::Rect r); - // WP8 XAML app - virtual bool Create(float width, float height, Windows::Graphics::Display::DisplayOrientations orientation); + virtual bool Create(float width, float height ,Windows::Graphics::Display::DisplayOrientations orientation); + + void setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher); + Windows::UI::Core::CoreDispatcher^ getDispatcher() {return m_dispatcher.Get();} + + void setPanel(Windows::UI::Xaml::Controls::Panel^ panel); + Windows::UI::Xaml::Controls::Panel^ getPanel() {return m_panel.Get();} void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args); void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args); @@ -89,14 +84,9 @@ public: void QueueBackKeyPress(); void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); - void GLViewImpl::QueueEvent(std::shared_ptr& event); - - void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) { m_delegate = delegate; }; - void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; }; - void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; }; + void QueueEvent(std::shared_ptr& event); bool ShowMessageBox(Platform::String^ title, Platform::String^ message); - bool OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler^ receiveHandler); int Run(); void Render(); @@ -116,9 +106,6 @@ public: static GLViewImpl* sharedOpenGLView(); void ProcessEvents(); - void AddPointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); - - protected: GLViewImpl(); @@ -144,8 +131,7 @@ private: void OnRendering(); void UpdateWindowSize(); - void UpdateOrientationMatrix(); - + cocos2d::Vec2 TransformToOrientation(Windows::Foundation::Point point); cocos2d::Vec2 GetPoint(Windows::UI::Core::PointerEventArgs^ args); @@ -162,20 +148,20 @@ private: bool m_lastPointValid; bool m_windowClosed; bool m_windowVisible; - Mat4 m_orientationMatrix; - Mat4 m_reverseOrientationMatrix; - bool m_running; bool m_initialized; - PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate; - PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; - PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate; + Cocos2dEventDelegate^ m_delegate; + Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; + Cocos2dEditBoxDelegate^ m_editBoxDelegate; std::queue> mInputEvents; std::mutex mMutex; + Platform::Agile m_dispatcher; + Platform::Agile m_panel; + KeyBoardWinRT^ m_keyboard; }; NS_CC_END diff --git a/cocos/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp index c4fb52b0b9..0771dc35ed 100644 --- a/cocos/platform/winrt/CCWinRTUtils.cpp +++ b/cocos/platform/winrt/CCWinRTUtils.cpp @@ -32,6 +32,11 @@ THE SOFTWARE. #include #include +#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8 +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +#endif + NS_CC_BEGIN using namespace Windows::Graphics::Display; @@ -153,6 +158,103 @@ std::string CC_DLL getDeviceIPAddresses() return result.str(); } +#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8 +Platform::Object^ findXamlElement(Platform::Object^ parent, Platform::String^ name) +{ + if (parent == nullptr || name == nullptr || name->Length() == 0) + { + return nullptr; + } + + FrameworkElement^ element = dynamic_cast(parent); + if (element == nullptr) + { + return nullptr; + } + + if (element->Name == name) + { + return element; + } + + Panel^ panel = dynamic_cast(element); + if (panel == nullptr) + { + return nullptr; + } + + int count = panel->Children->Size; + for (int i = 0; i < count; i++) + { + auto result = findXamlElement(panel->Children->GetAt(i), name); + if (result != nullptr) + { + return result; + } + } + + return nullptr; +} + + +bool removeXamlElement(Platform::Object^ parent, Platform::Object^ element) +{ + Panel^ panel = dynamic_cast(parent); + if (panel == nullptr) + { + return false; + } + + UIElement^ uiElement = dynamic_cast(element); + if (uiElement == nullptr) + { + return false; + } + + unsigned int index; + if (!panel->Children->IndexOf(uiElement, &index)) + { + return false; + } + + panel->Children->RemoveAt(index); + + return true; +} + +bool replaceXamlElement(Platform::Object^ parent, Platform::Object^ add, Platform::Object^ remove) +{ + Panel^ panel = dynamic_cast(parent); + if (panel == nullptr) + { + return false; + } + + UIElement^ addElement = dynamic_cast(add); + if (addElement == nullptr) + { + return false; + } + + UIElement^ removeElement = dynamic_cast(remove); + if (removeElement == nullptr) + { + return false; + } + + unsigned int index; + if (!panel->Children->IndexOf(removeElement, &index)) + { + return false; + } + + panel->Children->RemoveAt(index); + panel->Children->InsertAt(index, addElement); + + return true; +} +#endif + diff --git a/cocos/platform/winrt/CCWinRTUtils.h b/cocos/platform/winrt/CCWinRTUtils.h index 7d06c9d04f..19a229a233 100644 --- a/cocos/platform/winrt/CCWinRTUtils.h +++ b/cocos/platform/winrt/CCWinRTUtils.h @@ -40,6 +40,12 @@ NS_CC_BEGIN std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1); std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr); +#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8 +Platform::Object^ findXamlElement(Platform::Object^ parent, Platform::String^ name); +bool removeXamlElement(Platform::Object^ parent, Platform::Object^ element); +bool replaceXamlElement(Platform::Object^ parent, Platform::Object^ add, Platform::Object^ remove); +#endif + std::string PlatformStringToString(Platform::String^ s); Platform::String^ PlatformStringFromString(const std::string& s); diff --git a/cocos/platform/winrt/InputEvent.cpp b/cocos/platform/winrt/InputEvent.cpp index 1c647538a0..4a443d3dca 100644 --- a/cocos/platform/winrt/InputEvent.cpp +++ b/cocos/platform/winrt/InputEvent.cpp @@ -24,6 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "InputEvent.h" +#include "CCWinRTUtils.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 #include "CCGLViewImpl-wp8.h" @@ -35,9 +36,6 @@ THE SOFTWARE. NS_CC_BEGIN -using namespace PhoneDirect3DXamlAppComponent; - - AccelerometerEvent::AccelerometerEvent(const Acceleration& event) : m_event(event) { @@ -92,9 +90,11 @@ void KeyboardEvent::execute() { case Cocos2dKeyEvent::Text: { - char szUtf8[256] = { 0 }; - int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) m_text.Get()->Data(), -1, szUtf8, sizeof(szUtf8), NULL, NULL); - IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen - 1); + std::wstring w(m_text.Get()->Data()); + std::u16string s16(w.begin(),w.end()); + std::string utf8String; + StringUtils::UTF16ToUTF8(s16, utf8String); + IMEDispatcher::sharedDispatcher()->dispatchInsertText(utf8String.c_str(), utf8String.size()); break; } @@ -108,7 +108,6 @@ void KeyboardEvent::execute() IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); break; case Cocos2dKeyEvent::Enter: - //SetFocus(false); IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1); break; default: @@ -133,12 +132,27 @@ CustomInputEvent::CustomInputEvent(const std::function& fun) : m_fun(fun) { } + void CustomInputEvent::execute() { m_fun(); } +UIEditBoxEvent::UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler^ handle) + : m_sender(sender) + , m_text(text) + , m_handler(handle) +{ +} + +void UIEditBoxEvent::execute() +{ + if (m_handler.Get()) + { + m_handler.Get()->Invoke(m_sender.Get(), m_text.Get()); + } +} NS_CC_END diff --git a/cocos/platform/winrt/InputEvent.h b/cocos/platform/winrt/InputEvent.h index ed22daf21f..017c3b92fa 100644 --- a/cocos/platform/winrt/InputEvent.h +++ b/cocos/platform/winrt/InputEvent.h @@ -30,17 +30,13 @@ THE SOFTWARE. #include "InputEventTypes.h" #include - -namespace PhoneDirect3DXamlAppComponent -{ - public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text); - public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text); - public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler^ receiveHandler); - public delegate void Cocos2dOpenURLDelegate(Platform::String^ url); -} - NS_CC_BEGIN +public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text); +public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text); +public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler^ receiveHandler); +public delegate void Cocos2dOpenURLDelegate(Platform::String^ url); + enum PointerEventType { PointerPressed, @@ -83,12 +79,12 @@ class CC_DLL KeyboardEvent : public InputEvent { public: - KeyboardEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent type); - KeyboardEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent type, Platform::String^ text); + KeyboardEvent(Cocos2dKeyEvent type); + KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text); virtual void execute(); private: - PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent m_type; + Cocos2dKeyEvent m_type; Platform::Agile m_text; }; @@ -108,6 +104,19 @@ private: std::function m_fun; }; +class UIEditBoxEvent : public cocos2d::InputEvent +{ +public: + UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler^ handle); + + virtual void execute(); + +private: + Platform::Agile m_sender; + Platform::Agile m_text; + Platform::Agile^> m_handler; +}; + NS_CC_END #endif // #ifndef __INPUT_EVENT__ diff --git a/cocos/platform/winrt/InputEventTypes.h b/cocos/platform/winrt/InputEventTypes.h index 6d6f41bc94..a50aaff73a 100644 --- a/cocos/platform/winrt/InputEventTypes.h +++ b/cocos/platform/winrt/InputEventTypes.h @@ -27,8 +27,8 @@ THE SOFTWARE. #define __INPUT_EVENT_TYPES__ -namespace PhoneDirect3DXamlAppComponent -{ +NS_CC_BEGIN + public enum class Cocos2dEvent { @@ -46,7 +46,8 @@ public enum class Cocos2dKeyEvent : int Enter }; -} +NS_CC_END + #endif // #ifndef __INPUT_EVENT_TYPES__ diff --git a/cocos/platform/winrt/Keyboard-winrt.cpp b/cocos/platform/winrt/Keyboard-winrt.cpp new file mode 100644 index 0000000000..24c347aed9 --- /dev/null +++ b/cocos/platform/winrt/Keyboard-winrt.cpp @@ -0,0 +1,157 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +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 "Keyboard-winrt.h" + +using namespace cocos2d; +using namespace Platform; +using namespace Concurrency; +using namespace Windows::System; +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::Input; + +NS_CC_BEGIN + +KeyBoardWinRT::KeyBoardWinRT() +{ + +} + +KeyBoardWinRT::~KeyBoardWinRT() +{ + +} + +KeyBoardWinRT::KeyBoardWinRT(Windows::UI::Core::CoreDispatcher^ dispatcher, Windows::UI::Xaml::Controls::Panel^ panel) + : m_dispatcher(dispatcher) + , m_panel(panel) +{ + +} + +void KeyBoardWinRT::ShowKeyboard(Platform::String^ text) +{ + if (m_dispatcher.Get() && m_panel.Get()) + { + // run on main UI thread + m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, text]() + { + if (m_textBox == nullptr) + { + m_textBox = ref new TextBox(); + m_textBox->Opacity = 0.0; + m_textBox->Width = 1; + m_textBox->Height = 1; + m_textBox->AddHandler(UIElement::KeyDownEvent, ref new KeyEventHandler(this, &KeyBoardWinRT::OnKeyPressed), true); + m_textBox->AddHandler(UIElement::KeyUpEvent, ref new KeyEventHandler(this, &KeyBoardWinRT::OnKeyReleased), true); + m_textBox->TextChanged += ref new TextChangedEventHandler(this, &KeyBoardWinRT::OnTextChanged); +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + // Need to use InputScopeNameValue::Search to prevent auto-capitalize + m_textBox->InputScope = ref new InputScope(); + auto n = m_textBox->InputScope->Names; + n->Append(ref new InputScopeName(InputScopeNameValue::Search)); +#endif + m_panel.Get()->Children->Append(m_textBox); + } + m_textBox->SelectionLength = 0; + m_textBox->SelectionStart = 32768; + m_textBox->Focus(FocusState::Programmatic); + })); + } +} + +void KeyBoardWinRT::HideKeyboard(Platform::String^ text) +{ + if (m_dispatcher.Get() && m_panel.Get()) + { + // run on main UI thread + m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, text]() + { + if (m_textBox != nullptr) + { + unsigned int index; + if (m_panel->Children->IndexOf(m_textBox, &index)) + { + m_panel->Children->RemoveAt(index); + } + } + m_textBox = nullptr; + })); + } +} + +void KeyBoardWinRT::QueueKeyEvent(Cocos2dKeyEvent key) +{ + std::shared_ptr e(new cocos2d::KeyboardEvent(key)); + cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e); +} + +void KeyBoardWinRT::OnKeyPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args) +{ + switch (args->Key) + { + case VirtualKey::Escape: + QueueKeyEvent(Cocos2dKeyEvent::Escape); + args->Handled = true; + break; + case VirtualKey::Back: + QueueKeyEvent(Cocos2dKeyEvent::Back); + args->Handled = true; + break; + case VirtualKey::Enter: + QueueKeyEvent(Cocos2dKeyEvent::Enter); + args->Handled = true; + break; + default: + + break; + } +} + +void KeyBoardWinRT::OnTextChanged(Platform::Object^ sender, TextChangedEventArgs^ args) +{ + auto text = m_textBox->Text; + if (text) + { + std::shared_ptr e(new cocos2d::KeyboardEvent(Cocos2dKeyEvent::Text, text)); + cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e); + m_textBox->Text = L""; + } +} + + +void KeyBoardWinRT::OnKeyReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args) +{ + //m_textBox->Text = L""; +} + +NS_CC_END + diff --git a/cocos/platform/winrt/Keyboard-winrt.h b/cocos/platform/winrt/Keyboard-winrt.h new file mode 100644 index 0000000000..b12bc3ce33 --- /dev/null +++ b/cocos/platform/winrt/Keyboard-winrt.h @@ -0,0 +1,58 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#pragma once + +#include + +NS_CC_BEGIN + +ref class KeyBoardWinRT sealed +{ +public: + KeyBoardWinRT(); + virtual ~KeyBoardWinRT(); + + void ShowKeyboard(Platform::String^ text); + void HideKeyboard(Platform::String^ text); + +internal: + KeyBoardWinRT(Windows::UI::Core::CoreDispatcher^ dispatcher, Windows::UI::Xaml::Controls::Panel^ panel); + +private: + + void QueueKeyEvent(Cocos2dKeyEvent key); + void OnKeyPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args); + void OnKeyReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args); + void OnTextChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::TextChangedEventArgs^ args); + + Platform::Agile m_dispatcher; + Platform::Agile m_panel; + Windows::UI::Xaml::Controls::TextBox^ m_textBox; +}; + +NS_CC_END diff --git a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp index d0d5a5f61c..c3cd6ca388 100644 --- a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp +++ b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp @@ -35,7 +35,6 @@ using namespace DirectX; using namespace Microsoft::WRL; using namespace Windows::Foundation; using namespace Windows::UI::Core; -using namespace PhoneDirect3DXamlAppComponent; USING_NS_CC; @@ -151,7 +150,7 @@ void Cocos2dRenderer::OnCocos2dKeyEvent(Cocos2dKeyEvent event) } -void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) +void Cocos2dRenderer::SetXamlEventDelegate(Cocos2dEventDelegate^ delegate) { m_delegate = delegate; GLViewImpl* eglView = GLViewImpl::sharedOpenGLView(); @@ -161,7 +160,7 @@ void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2 } } -void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) +void Cocos2dRenderer::SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; GLViewImpl* eglView = GLViewImpl::sharedOpenGLView(); @@ -171,7 +170,7 @@ void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::C } } -void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) +void Cocos2dRenderer::SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; GLViewImpl* eglView = GLViewImpl::sharedOpenGLView(); @@ -181,7 +180,7 @@ void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Coco } } -void Cocos2dRenderer::SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate) +void Cocos2dRenderer::SetXamlOpenURLDelegate(Cocos2dOpenURLDelegate^ delegate) { m_openURLDelegate = delegate; Application* app = Application::getInstance(); diff --git a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h index 55e84b12cb..b1799312c0 100644 --- a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h +++ b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h @@ -41,11 +41,11 @@ public: void OnBackButton(); void OnKeyPressed(Platform::String^ text); - void OnCocos2dKeyEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent event); - void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate); - void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate); - void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate); - void SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate); + void OnCocos2dKeyEvent(cocos2d::Cocos2dKeyEvent event); + void SetXamlEventDelegate(cocos2d::Cocos2dEventDelegate^ delegate); + void SetXamlMessageBoxDelegate(cocos2d::Cocos2dMessageBoxDelegate^ delegate); + void SetXamlEditBoxDelegate(cocos2d::Cocos2dEditBoxDelegate^ delegate); + void SetXamlOpenURLDelegate(cocos2d::Cocos2dOpenURLDelegate^ delegate); Windows::Foundation::IAsyncAction^ OnSuspending(); void Connect(); @@ -59,10 +59,10 @@ private: bool m_loadingComplete; bool mInitialized; - PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate; - PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; - PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate; - PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ m_openURLDelegate; + cocos2d::Cocos2dEventDelegate^ m_delegate; + cocos2d::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; + cocos2d::Cocos2dEditBoxDelegate^ m_editBoxDelegate; + cocos2d::Cocos2dOpenURLDelegate^ m_openURLDelegate; // The AppDelegate for the Cocos2D app AppDelegate* mApp; diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp b/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp index 323d0b556d..7bfdf80366 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp +++ b/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "Direct3DContentProvider.h" #include "Direct3DInterop.h" -using namespace PhoneDirect3DXamlAppComponent; +using namespace cocos2d; Direct3DContentProvider::Direct3DContentProvider(Direct3DInterop^ controller) : m_controller(controller) diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.h b/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.h index 7a9d941074..830496c1f4 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.h +++ b/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.h @@ -37,7 +37,7 @@ class Direct3DContentProvider : public Microsoft::WRL::RuntimeClass< IDrawingSurfaceBackgroundContentProviderNative> { public: - Direct3DContentProvider(PhoneDirect3DXamlAppComponent::Direct3DInterop^ controller); + Direct3DContentProvider(cocos2d::Direct3DInterop^ controller); // IDrawingSurfaceContentProviderNative HRESULT STDMETHODCALLTYPE Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device); @@ -47,6 +47,6 @@ public: HRESULT STDMETHODCALLTYPE Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView); private: - PhoneDirect3DXamlAppComponent::Direct3DInterop^ m_controller; + cocos2d::Direct3DInterop^ m_controller; Microsoft::WRL::ComPtr m_host; }; diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp index e43b246088..53c14cdfaa 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp +++ b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp @@ -35,9 +35,8 @@ using namespace Windows::Phone::Graphics::Interop; using namespace Windows::Phone::Input::Interop; using namespace Windows::Graphics::Display; using namespace DirectX; -using namespace PhoneDirect3DXamlAppComponent; -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { Direct3DInterop::Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation) diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h index 6324dca1e9..ff87c60ca3 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h +++ b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h @@ -34,7 +34,7 @@ THE SOFTWARE. #include -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { public delegate void RequestAdditionalFrameHandler(); diff --git a/cocos/platform/wp8-xaml/cpp/EditBoxEvent.cpp b/cocos/platform/wp8-xaml/cpp/EditBoxEvent.cpp index 992dfe2d60..8837b68be9 100644 --- a/cocos/platform/wp8-xaml/cpp/EditBoxEvent.cpp +++ b/cocos/platform/wp8-xaml/cpp/EditBoxEvent.cpp @@ -26,9 +26,9 @@ THE SOFTWARE. using namespace Platform; -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { - EditBoxEvent::EditBoxEvent( Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler^ handle ): + EditBoxEvent::EditBoxEvent( Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler^ handle ): m_sender(sender), m_args(arg), m_handler(handle) diff --git a/cocos/platform/wp8-xaml/cpp/EditBoxEvent.h b/cocos/platform/wp8-xaml/cpp/EditBoxEvent.h index e9a7105baf..ddf206e034 100644 --- a/cocos/platform/wp8-xaml/cpp/EditBoxEvent.h +++ b/cocos/platform/wp8-xaml/cpp/EditBoxEvent.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { class EditBoxEvent : public cocos2d::InputEvent { diff --git a/cocos/platform/wp8-xaml/xaml/App.xaml b/cocos/platform/wp8-xaml/xaml/App.xaml index 02706a5450..4e5975de2a 100644 --- a/cocos/platform/wp8-xaml/xaml/App.xaml +++ b/cocos/platform/wp8-xaml/xaml/App.xaml @@ -1,5 +1,5 @@  - + diff --git a/cocos/platform/wp8-xaml/xaml/App.xaml.cs b/cocos/platform/wp8-xaml/xaml/App.xaml.cs index c97119aec5..3553e5f82f 100644 --- a/cocos/platform/wp8-xaml/xaml/App.xaml.cs +++ b/cocos/platform/wp8-xaml/xaml/App.xaml.cs @@ -7,9 +7,8 @@ using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.IO.IsolatedStorage; -using PhoneDirect3DXamlAppInterop.Resources; -namespace PhoneDirect3DXamlAppInterop +namespace cocos2d { public partial class App : Application { diff --git a/cocos/platform/wp8-xaml/xaml/EditBox.xaml b/cocos/platform/wp8-xaml/xaml/EditBox.xaml index 8a179c3ab4..a1259d3268 100644 --- a/cocos/platform/wp8-xaml/xaml/EditBox.xaml +++ b/cocos/platform/wp8-xaml/xaml/EditBox.xaml @@ -1,4 +1,4 @@ - 0) + { + m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text); + m_textBox.Text = ""; + } } // Called by the Cocos2d-x C++ engine to display a MessageBox @@ -181,7 +182,6 @@ namespace PhoneDirect3DXamlAppInterop m_textBox.TextChanged += OnTextChanged; DrawingSurfaceBackground.Children.Add(m_textBox); } - m_textBox.Text = text; m_textBox.SelectionLength = 0; m_textBox.SelectionStart = int.MaxValue; m_textBox.Focus(); diff --git a/cocos/platform/wp8/CCGLViewImpl-wp8.cpp b/cocos/platform/wp8/CCGLViewImpl-wp8.cpp index 1f4ef9d887..3f77cc1f73 100644 --- a/cocos/platform/wp8/CCGLViewImpl-wp8.cpp +++ b/cocos/platform/wp8/CCGLViewImpl-wp8.cpp @@ -49,7 +49,6 @@ using namespace Windows::ApplicationModel::Activation; using namespace Windows::Phone::UI::Core; using namespace Platform; using namespace Microsoft::WRL; -using namespace PhoneDirect3DXamlAppComponent; NS_CC_BEGIN diff --git a/cocos/platform/wp8/CCGLViewImpl-wp8.h b/cocos/platform/wp8/CCGLViewImpl-wp8.h index 706bbd7e3a..e48c9ce21d 100644 --- a/cocos/platform/wp8/CCGLViewImpl-wp8.h +++ b/cocos/platform/wp8/CCGLViewImpl-wp8.h @@ -95,9 +95,9 @@ public: void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); void GLViewImpl::QueueEvent(std::shared_ptr& event); - void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) { m_delegate = delegate; }; - void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; }; - void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; }; + void SetXamlEventDelegate(Cocos2dEventDelegate^ delegate) { m_delegate = delegate; }; + void SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; }; + void SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; }; bool ShowMessageBox(Platform::String^ title, Platform::String^ message); bool OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler^ receiveHandler); @@ -178,9 +178,9 @@ private: EGLDisplay m_eglDisplay; EGLContext m_eglContext; EGLSurface m_eglSurface; - PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate; - PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; - PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate; + Cocos2dEventDelegate^ m_delegate; + Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; + Cocos2dEditBoxDelegate^ m_editBoxDelegate; std::queue> mInputEvents; std::mutex mMutex; diff --git a/cocos/platform/wp8/shaders/precompiledshaders.h b/cocos/platform/wp8/shaders/precompiledshaders.h index a0a02c61c8..d93c40f9cf 100644 --- a/cocos/platform/wp8/shaders/precompiledshaders.h +++ b/cocos/platform/wp8/shaders/precompiledshaders.h @@ -69,7 +69,7 @@ const unsigned char s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -86,7 +86,7 @@ const unsigned char s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873[] = { 120, 116, 117, 114, 101, 48, 0, 0, 0, 0, 1, 0, 0, 0, 248, 3, 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 63, 88, 0, 0, 0, 0, + 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 11, 95, 74, 206, 145, 124, 32, 219, 67, 19, @@ -447,7 +447,7 @@ const unsigned char s_13E33F532157A58EC77EDE3B3112560A89D272B2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 10, 0, 0, 0, +241, 141, 0, 0, 10, 0, 0, 0, 67, 67, 95, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, @@ -456,7 +456,7 @@ const unsigned char s_13E33F532157A58EC77EDE3B3112560A89D272B2[] = { 116, 114, 105, 120, 0, 0, 0, 0, 0, 0, 0, 0, 204, 2, 0, 0, 164, 4, 0, 0, 0, 0, 0, 0, - 63, 88, 0, 0, 0, 0, 0, 0, +182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 127, 145, 81, 72, 216, 190, 16, 61, 245, 231, 235, 249, @@ -767,7 +767,7 @@ const unsigned char s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -800,7 +800,7 @@ const unsigned char s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE[] = { 116, 67, 111, 108, 111, 114, 0, 0, 0, 0, 3, 0, 0, 0, 208, 7, 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 63, 88, 0, 0, 0, 0, + 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 65, 106, 69, 173, 111, 248, 97, 165, 186, 90, @@ -1284,28 +1284,28 @@ const unsigned char s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 17, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 11, 0, 0, + 0, 241, 141, 0, 0, 11, 0, 0, 0, 67, 67, 95, 77, 86, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, 0, 0, 91, 139, 0, 0, -242, 141, 0, 0, 15, 0, 0, 0, +241, 141, 0, 0, 15, 0, 0, 0, 67, 67, 95, 78, 111, 114, 109, 97, 108, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 4, 0, 0, 0, 3, 0, 0, 0, 92, -139, 0, 0, 242, 141, 0, 0, 10, +139, 0, 0, 241, 141, 0, 0, 10, 0, 0, 0, 67, 67, 95, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 7, 0, 0, 0, 4, 0, 0, 0, 81, 139, 0, - 0, 242, 141, 0, 0, 26, 0, 0, + 0, 241, 141, 0, 0, 26, 0, 0, 0, 117, 95, 80, 111, 105, 110, 116, 76, 105, 103, 104, 116, 83, 111, 117, 114, 99, 101, 80, 111, 115, 105, 116, 105, 111, 110, 1, 0, 0, 0, 255, 255, 255, 255, 11, 0, 0, 0, 1, - 0, 0, 0, 81, 139, 0, 0, 242, + 0, 0, 0, 81, 139, 0, 0, 241, 141, 0, 0, 25, 0, 0, 0, 117, 95, 83, 112, 111, 116, 76, 105, 103, 104, 116, 83, 111, 117, 114, 99, 101, @@ -1462,7 +1462,7 @@ const unsigned char s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A[] = { 99, 111, 108, 111, 114, 0, 0, 0, 0, 16, 0, 0, 0, 236, 16, 0, 0, 124, 10, 0, 0, 0, 0, 0, - 0, 63, 88, 0, 0, 0, 0, 0, + 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 39, 224, 169, 185, 116, 156, 41, 157, 187, 9, 222, @@ -2413,7 +2413,7 @@ const unsigned char s_53938AB67AD93ABA0DDB87F3C9889304284E011E[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -2430,7 +2430,7 @@ const unsigned char s_53938AB67AD93ABA0DDB87F3C9889304284E011E[] = { 120, 116, 117, 114, 101, 48, 0, 0, 0, 0, 1, 0, 0, 0, 24, 4, 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 63, 88, 0, 0, 0, 0, + 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 200, 5, 103, 205, 248, 30, 69, 65, 32, 117, @@ -2795,7 +2795,7 @@ const unsigned char s_67837675F2BB48C0E926316F505FC1538228E0FA[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -2804,7 +2804,7 @@ const unsigned char s_67837675F2BB48C0E926316F505FC1538228E0FA[] = { 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 0, 0, 0, 0, 16, 4, 0, 0, 48, 5, 0, 0, - 0, 0, 0, 0, 63, 88, 0, 0, + 0, 0, 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 79, 226, 72, 124, 94, 252, 37, 157, @@ -3177,35 +3177,35 @@ const unsigned char s_77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 18, 0, 0, 0, 92, 139, - 0, 0, 242, 141, 0, 0, 11, 0, + 0, 0, 241, 141, 0, 0, 11, 0, 0, 0, 67, 67, 95, 77, 86, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, 0, 0, 91, 139, 0, - 0, 242, 141, 0, 0, 15, 0, 0, + 0, 241, 141, 0, 0, 15, 0, 0, 0, 67, 67, 95, 78, 111, 114, 109, 97, 108, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 4, 0, 0, 0, 3, 0, 0, 0, - 92, 139, 0, 0, 242, 141, 0, 0, + 92, 139, 0, 0, 241, 141, 0, 0, 10, 0, 0, 0, 67, 67, 95, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 7, 0, 0, 0, 4, 0, 0, 0, 81, 139, - 0, 0, 242, 141, 0, 0, 26, 0, + 0, 0, 241, 141, 0, 0, 26, 0, 0, 0, 117, 95, 80, 111, 105, 110, 116, 76, 105, 103, 104, 116, 83, 111, 117, 114, 99, 101, 80, 111, 115, 105, 116, 105, 111, 110, 1, 0, 0, 0, 255, 255, 255, 255, 11, 0, 0, 0, 1, 0, 0, 0, 81, 139, 0, 0, -242, 141, 0, 0, 25, 0, 0, 0, +241, 141, 0, 0, 25, 0, 0, 0, 117, 95, 83, 112, 111, 116, 76, 105, 103, 104, 116, 83, 111, 117, 114, 99, 101, 80, 111, 115, 105, 116, 105, 111, 110, 1, 0, 0, 0, 255, 255, 255, 255, 12, 0, 0, 0, 1, 0, 0, - 0, 82, 139, 0, 0, 242, 141, 0, + 0, 82, 139, 0, 0, 241, 141, 0, 0, 15, 0, 0, 0, 117, 95, 109, 97, 116, 114, 105, 120, 80, 97, 108, 101, 116, 116, 101, 180, 0, 0, 0, @@ -3968,7 +3968,7 @@ const unsigned char s_77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C[] = { 99, 111, 108, 111, 114, 0, 0, 0, 0, 17, 0, 0, 0, 236, 16, 0, 0, 232, 19, 0, 0, 0, 0, 0, - 0, 63, 88, 0, 0, 0, 0, 0, + 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 39, 224, 169, 185, 116, 156, 41, 157, 187, 9, 222, @@ -5220,7 +5220,7 @@ const unsigned char s_78250E25D1929D4A842050738140787BE42541C6[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -5245,7 +5245,7 @@ const unsigned char s_78250E25D1929D4A842050738140787BE42541C6[] = { 108, 112, 104, 97, 95, 118, 97, 108, 117, 101, 0, 0, 0, 0, 2, 0, 0, 0, 36, 5, 0, 0, 4, 5, - 0, 0, 0, 0, 0, 0, 63, 88, + 0, 0, 0, 0, 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 100, 113, 175, 29, 164, 71, @@ -5644,7 +5644,7 @@ const unsigned char s_7B67DD242152D35ACC079265FAD9D03DC98182DE[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 10, 0, 0, 0, +241, 141, 0, 0, 10, 0, 0, 0, 67, 67, 95, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, @@ -5660,7 +5660,7 @@ const unsigned char s_7B67DD242152D35ACC079265FAD9D03DC98182DE[] = { 67, 95, 84, 101, 120, 116, 117, 114, 101, 48, 0, 0, 0, 0, 1, 0, 0, 0, 248, 3, 0, 0, 0, 5, - 0, 0, 0, 0, 0, 0, 63, 88, + 0, 0, 0, 0, 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 11, 95, 74, 206, 145, 124, @@ -6020,7 +6020,7 @@ const unsigned char s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 12, 0, 0, + 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, @@ -6044,7 +6044,7 @@ const unsigned char s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D[] = { 99, 111, 108, 111, 114, 0, 0, 0, 0, 2, 0, 0, 0, 96, 4, 0, 0, 192, 4, 0, 0, 0, 0, 0, - 0, 63, 88, 0, 0, 0, 0, 0, + 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 157, 116, 105, 89, 118, 135, 249, 239, 42, 226, 184, @@ -6409,7 +6409,7 @@ const unsigned char s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 12, 0, 0, + 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, @@ -6425,7 +6425,7 @@ const unsigned char s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C[] = { 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 1, 0, 0, 0, 52, 3, 0, 0, 40, 4, 0, 0, 0, - 0, 0, 0, 63, 88, 0, 0, 0, + 0, 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 153, 8, 62, 201, 202, 170, 111, 182, 149, @@ -6734,7 +6734,7 @@ const unsigned char s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -6759,7 +6759,7 @@ const unsigned char s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5[] = { 111, 108, 111, 114, 0, 0, 0, 0, 2, 0, 0, 0, 240, 4, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, - 63, 88, 0, 0, 0, 0, 0, 0, +182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 134, 66, 128, 226, 107, 172, 247, 161, 241, 207, 89, 240, @@ -7151,7 +7151,7 @@ const unsigned char s_92BE325B516F887D2C928EDE20ADF428DB01C038[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 10, 0, 0, 0, +241, 141, 0, 0, 10, 0, 0, 0, 67, 67, 95, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, @@ -7176,7 +7176,7 @@ const unsigned char s_92BE325B516F887D2C928EDE20ADF428DB01C038[] = { 95, 118, 97, 108, 117, 101, 0, 0, 0, 0, 2, 0, 0, 0, 36, 5, 0, 0, 0, 5, 0, 0, 0, 0, - 0, 0, 63, 88, 0, 0, 0, 0, + 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 100, 113, 175, 29, 164, 71, 177, 78, 120, 99, @@ -7574,28 +7574,28 @@ const unsigned char s_93D31E1668075AE4941C53441D7A9D0DE8F76331[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 11, 0, 0, + 0, 241, 141, 0, 0, 11, 0, 0, 0, 67, 67, 95, 77, 86, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, 0, 0, 91, 139, 0, 0, -242, 141, 0, 0, 15, 0, 0, 0, +241, 141, 0, 0, 15, 0, 0, 0, 67, 67, 95, 78, 111, 114, 109, 97, 108, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 4, 0, 0, 0, 3, 0, 0, 0, 92, -139, 0, 0, 242, 141, 0, 0, 10, +139, 0, 0, 241, 141, 0, 0, 10, 0, 0, 0, 67, 67, 95, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 7, 0, 0, 0, 4, 0, 0, 0, 81, 139, 0, - 0, 242, 141, 0, 0, 26, 0, 0, + 0, 241, 141, 0, 0, 26, 0, 0, 0, 117, 95, 80, 111, 105, 110, 116, 76, 105, 103, 104, 116, 83, 111, 117, 114, 99, 101, 80, 111, 115, 105, 116, 105, 111, 110, 1, 0, 0, 0, 255, 255, 255, 255, 11, 0, 0, 0, 1, - 0, 0, 0, 81, 139, 0, 0, 242, + 0, 0, 0, 81, 139, 0, 0, 241, 141, 0, 0, 25, 0, 0, 0, 117, 95, 83, 112, 111, 116, 76, 105, 103, 104, 116, 83, 111, 117, 114, 99, 101, @@ -7744,7 +7744,7 @@ const unsigned char s_93D31E1668075AE4941C53441D7A9D0DE8F76331[] = { 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 15, 0, 0, 0, 200, 15, 0, 0, 216, 9, 0, 0, 0, - 0, 0, 0, 63, 88, 0, 0, 0, + 0, 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 136, 158, 207, 210, 174, 144, 71, 116, 248, @@ -8640,12 +8640,12 @@ const unsigned char s_A130FCE93CA2E5D68468367D88D1D7BE357912E5[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 92, 139, - 0, 0, 242, 141, 0, 0, 12, 0, + 0, 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 0, 0, 0, 82, 139, - 0, 0, 242, 141, 0, 0, 15, 0, + 0, 0, 241, 141, 0, 0, 15, 0, 0, 0, 117, 95, 109, 97, 116, 114, 105, 120, 80, 97, 108, 101, 116, 116, 101, 180, 0, 0, 0, 255, 255, 255, @@ -9277,7 +9277,7 @@ const unsigned char s_A130FCE93CA2E5D68468367D88D1D7BE357912E5[] = { 99, 111, 108, 111, 114, 0, 0, 0, 0, 3, 0, 0, 0, 96, 4, 0, 0, 192, 13, 0, 0, 0, 0, 0, - 0, 63, 88, 0, 0, 0, 0, 0, + 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 157, 116, 105, 89, 118, 135, 249, 239, 42, 226, 184, @@ -9930,7 +9930,7 @@ const unsigned char s_A2377A827972A5466DA8637681045D32DA8A817D[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 12, 0, 0, + 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, @@ -9954,7 +9954,7 @@ const unsigned char s_A2377A827972A5466DA8637681045D32DA8A817D[] = { 99, 111, 108, 111, 114, 0, 0, 0, 0, 2, 0, 0, 0, 96, 4, 0, 0, 144, 4, 0, 0, 0, 0, 0, - 0, 63, 88, 0, 0, 0, 0, 0, + 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 157, 116, 105, 89, 118, 135, 249, 239, 42, 226, 184, @@ -10314,7 +10314,7 @@ const unsigned char s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -10339,7 +10339,7 @@ const unsigned char s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86[] = { 111, 108, 111, 114, 0, 0, 0, 0, 2, 0, 0, 0, 240, 5, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, - 63, 88, 0, 0, 0, 0, 0, 0, +182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 223, 173, 203, 80, 172, 13, 170, 215, 168, 128, 228, 5, @@ -10761,7 +10761,7 @@ const unsigned char s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 92, 139, 0, 0, 242, 141, + 0, 0, 92, 139, 0, 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, @@ -10771,7 +10771,7 @@ const unsigned char s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893[] = { 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 0, 0, 0, 0, 204, 2, 0, 0, 144, 4, 0, 0, 0, 0, - 0, 0, 63, 88, 0, 0, 0, 0, + 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 127, 145, 81, 72, 216, 190, 16, 61, 245, 231, @@ -11077,17 +11077,17 @@ const unsigned char s_E2D56227712263272BD5218FEA117CD06180F81B[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, - 0, 0, 0, 92, 139, 0, 0, 242, + 0, 0, 0, 92, 139, 0, 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, - 0, 0, 0, 82, 139, 0, 0, 242, + 0, 0, 0, 82, 139, 0, 0, 241, 141, 0, 0, 7, 0, 0, 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 255, 255, 255, 255, 4, 0, 0, 0, 1, 0, 0, 0, 6, 20, - 0, 0, 242, 141, 0, 0, 11, 0, + 0, 0, 241, 141, 0, 0, 11, 0, 0, 0, 117, 95, 112, 111, 105, 110, 116, 83, 105, 122, 101, 0, 0, 0, 0, 255, 255, 255, 255, 5, 0, 0, @@ -11101,8 +11101,8 @@ const unsigned char s_E2D56227712263272BD5218FEA117CD06180F81B[] = { 117, 95, 112, 111, 105, 110, 116, 83, 105, 122, 101, 0, 0, 0, 0, 2, 0, 0, 0, 204, 2, 0, 0, 208, - 4, 0, 0, 0, 0, 0, 0, 63, - 88, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 182, +139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 127, 145, 81, 72, 216, 190, 16, 61, 245, 231, 235, 249, 125, @@ -11419,7 +11419,7 @@ const unsigned char s_F46558C274182079784898CF4968CF431593D5E2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, +241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, @@ -11452,7 +11452,7 @@ const unsigned char s_F46558C274182079784898CF4968CF431593D5E2[] = { 116, 67, 111, 108, 111, 114, 0, 0, 0, 0, 3, 0, 0, 0, 108, 6, 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 63, 88, 0, 0, 0, 0, + 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 47, 220, 115, 183, 137, 174, 141, 96, 204, 60, @@ -11891,7 +11891,7 @@ const unsigned char s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 12, 0, 0, + 0, 241, 141, 0, 0, 12, 0, 0, 0, 67, 67, 95, 77, 86, 80, 77, 97, 116, 114, 105, 120, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, @@ -11908,7 +11908,7 @@ const unsigned char s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6[] = { 101, 120, 116, 117, 114, 101, 48, 0, 0, 0, 0, 1, 0, 0, 0, 156, 3, 0, 0, 144, 4, 0, 0, 0, - 0, 0, 0, 63, 88, 0, 0, 0, + 0, 0, 0, 182, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 203, 117, 183, 110, 154, 52, 220, 70, 125, diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 2fa4b516fb..6aa05848ca 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -407,7 +407,9 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source } const GLchar *sources[] = { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + (type == GL_VERTEX_SHADER ? "precision mediump float;\n precision mediump int;\n" : "precision mediump float;\n precision mediump int;\n"), +#elif (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC) (type == GL_VERTEX_SHADER ? "precision highp float;\n precision highp int;\n" : "precision mediump float;\n precision mediump int;\n"), #endif "uniform mat4 CC_PMatrix;\n" @@ -551,7 +553,7 @@ bool GLProgram::link() _vertShader = _fragShader = 0; -#if DEBUG || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if DEBUG || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) glGetProgramiv(_program, GL_LINK_STATUS, &status); if (status == GL_FALSE) diff --git a/cocos/renderer/ccShader_Position_uColor-no-gl_PointSize.vert b/cocos/renderer/ccShader_Position_uColor-no-gl_PointSize.vert new file mode 100644 index 0000000000..a1408d12ca --- /dev/null +++ b/cocos/renderer/ccShader_Position_uColor-no-gl_PointSize.vert @@ -0,0 +1,43 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +const char* ccPosition_uColor_vert = STRINGIFY( + +attribute vec4 a_position; +uniform vec4 u_color; +uniform float u_pointSize; + +\n#ifdef GL_ES\n +varying lowp vec4 v_fragmentColor; +\n#else\n +varying vec4 v_fragmentColor; +\n#endif\n + +void main() +{ + gl_Position = CC_MVPMatrix * a_position; + v_fragmentColor = u_color; +} +); diff --git a/cocos/renderer/ccShaders.cpp b/cocos/renderer/ccShaders.cpp index 25f5f3ce71..1d66670420 100644 --- a/cocos/renderer/ccShaders.cpp +++ b/cocos/renderer/ccShaders.cpp @@ -31,7 +31,12 @@ THE SOFTWARE. NS_CC_BEGIN // #include "ccShader_Position_uColor.frag" + +#ifdef CC_NO_GL_POINTSIZE +#include "ccShader_Position_uColor-no-gl_PointSize.vert" +#else #include "ccShader_Position_uColor.vert" +#endif // #include "ccShader_PositionColor.frag" diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-stub.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-stub.cpp index 7e3899672c..ebe0a7eac7 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-stub.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-stub.cpp @@ -1,6 +1,6 @@ #include "UIEditBox.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID ) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS ) && (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID ) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS ) && (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) NS_CC_BEGIN diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp new file mode 100644 index 0000000000..0086e7eab0 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp @@ -0,0 +1,583 @@ +/**************************************************************************** +Copyright (c) 2014 cocos2d-x.org + +http://www.cocos2d-x.org + +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved + +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 "UIEditBoxImpl-winrt.h" +#include "UIEditBox.h" +#include "CCGLViewImpl-winrt.h" +#include "base/CCScriptSupport.h" +#include "base/ccUTF8.h" +#include "2d/CCLabel.h" +#include "CCWinRTUtils.h" + +using namespace Platform; +using namespace Concurrency; +using namespace Windows::System; +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::Input; +using namespace Windows::Foundation; +using namespace Windows::UI::ViewManagement; + +NS_CC_BEGIN + +namespace ui { + +EditBoxWinRT::EditBoxWinRT() +{ + +} + +EditBoxWinRT::~EditBoxWinRT() +{ + +} + +EditBoxWinRT::EditBoxWinRT(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, EditBox::InputMode inputMode, EditBox::InputFlag inputFlag, Windows::Foundation::EventHandler^ receiveHandler) +{ + m_dispatcher = cocos2d::GLViewImpl::sharedOpenGLView()->getDispatcher(); + m_panel = cocos2d::GLViewImpl::sharedOpenGLView()->getPanel(); + m_strText = strText; + m_strPlaceholder = strPlaceHolder; + m_inputMode = inputMode; + m_inputFlag = inputFlag; + m_receiveHandler = receiveHandler; + m_maxLength = maxLength; +} + + +void EditBoxWinRT::OpenXamlEditBox(Platform::String^ strText) +{ + if (m_dispatcher.Get() == nullptr || m_panel.Get() == nullptr) + { + return; + } + + // must create XAML element on main UI thread + m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, strText]() + { + critical_section::scoped_lock lock(m_criticalSection); + m_strText = strText; + auto item = findXamlElement(m_panel.Get(), "cocos2d_editbox"); + if (item != nullptr) + { + Controls::Button^ button = dynamic_cast(item); + if (button) + { + m_flyout = dynamic_cast(button->Flyout); + if (m_flyout) + { + if (m_inputFlag == EditBox::InputFlag::PASSWORD) + { + SetupPasswordBox(); + } + else + { + SetupTextBox(); + } + + auto doneButton = findXamlElement(m_flyout->Content, "cocos2d_editbox_done"); + if (doneButton != nullptr) + { + m_doneButton = dynamic_cast(doneButton); + m_doneToken = m_doneButton->Click += ref new RoutedEventHandler(this, &EditBoxWinRT::Done); + } + + auto cancelButton = findXamlElement(m_flyout->Content, "cocos2d_editbox_cancel"); + if (cancelButton != nullptr) + { + m_cancelButton = dynamic_cast(cancelButton); + m_cancelToken = m_cancelButton->Click += ref new RoutedEventHandler(this, &EditBoxWinRT::Cancel); + } + } + } + + if (m_flyout) + { + auto inputPane = InputPane::GetForCurrentView(); + m_hideKeyboardToken = inputPane->Hiding += ref new TypedEventHandler(this, &EditBoxWinRT::HideKeyboard); + + m_closedToken = m_flyout->Closed += ref new EventHandler(this, &EditBoxWinRT::Closed); + m_flyout->ShowAt(m_panel.Get()); + } + } + })); +} + +void EditBoxWinRT::Closed(Platform::Object^ sender, Platform::Object^ e) +{ + critical_section::scoped_lock lock(m_criticalSection); + RemoveControls(); +} + +void EditBoxWinRT::Done(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + QueueText(); + HideFlyout(); +} + +void EditBoxWinRT::Cancel(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + HideFlyout(); +} + +void EditBoxWinRT::HideKeyboard(Windows::UI::ViewManagement::InputPane^ inputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs^ args) +{ + // we don't want to hide the flyout when the user hide the keyboard + //HideFlyout(); +} + +void EditBoxWinRT::HideFlyout() +{ + critical_section::scoped_lock lock(m_criticalSection); + if (m_flyout) + { + m_flyout->Hide(); + } +} + +void EditBoxWinRT::RemoveControls() +{ + if (m_dispatcher.Get() && m_panel.Get()) + { + // run on main UI thread + m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]() + { + critical_section::scoped_lock lock(m_criticalSection); + + if (m_doneButton != nullptr) + { + m_doneButton->Click -= m_doneToken; + m_doneButton = nullptr; + } + + if (m_cancelButton != nullptr) + { + m_cancelButton->Click -= m_cancelToken; + m_cancelButton = nullptr; + } + + m_textBox = nullptr; + m_passwordBox = nullptr; + + if (m_flyout != nullptr) + { + m_flyout->Closed -= m_closedToken; + m_flyout = nullptr; + } + + auto inputPane = InputPane::GetForCurrentView(); + inputPane->Hiding -= m_hideKeyboardToken; + })); + } +} + +void EditBoxWinRT::RemoveTextBox() +{ + auto g = findXamlElement(m_flyout->Content, "cocos2d_editbox_grid"); + auto grid = dynamic_cast(g); + auto box = findXamlElement(m_flyout->Content, "cocos2d_editbox_textbox"); + + if (box) + { + removeXamlElement(grid, box); + } +} + +void EditBoxWinRT::SetupTextBox() +{ + RemoveTextBox(); + m_textBox = ref new TextBox; + m_textBox->Text = m_strText; + m_textBox->Name = "cocos2d_editbox_textbox"; + m_textBox->MinWidth = 200; + m_textBox->PlaceholderText = m_strPlaceholder; + m_textBox->Select(m_textBox->Text->Length(), 0); + m_textBox->MaxLength = m_maxLength < 0 ? 0 : m_maxLength; + SetInputScope(m_textBox, m_inputMode); + auto g = findXamlElement(m_flyout->Content, "cocos2d_editbox_grid"); + auto grid = dynamic_cast(g); + grid->Children->InsertAt(0, m_textBox); +} + +void EditBoxWinRT::SetupPasswordBox() +{ + RemoveTextBox(); + m_passwordBox = ref new PasswordBox(); + m_passwordBox->Password = m_strText; + m_passwordBox->MinWidth = 200; + m_passwordBox->Name = "cocos2d_editbox_textbox"; + m_passwordBox->SelectAll(); + m_passwordBox->PlaceholderText = m_strPlaceholder; + m_passwordBox->MaxLength = m_maxLength < 0 ? 0 : m_maxLength; + auto g = findXamlElement(m_flyout->Content, "cocos2d_editbox_grid"); + auto grid = dynamic_cast(g); + grid->Children->InsertAt(0, m_passwordBox); +} + + + +void EditBoxWinRT::SetInputScope(TextBox^ box, EditBox::InputMode inputMode) +{ + // TextBox.SetInputScope + InputScope^ inputScope = ref new InputScope(); + InputScopeName^ name = ref new InputScopeName(); + + switch (inputMode) + { + case EditBox::InputMode::ANY: + name->NameValue = InputScopeNameValue::Default; + break; + case EditBox::InputMode::EMAIL_ADDRESS: + name->NameValue = InputScopeNameValue::EmailSmtpAddress; + break; + case EditBox::InputMode::NUMERIC: + name->NameValue = InputScopeNameValue::Number; + break; + case EditBox::InputMode::PHONE_NUMBER: + name->NameValue = InputScopeNameValue::TelephoneNumber; + break; + case EditBox::InputMode::URL: + name->NameValue = InputScopeNameValue::Url; + break; + case EditBox::InputMode::DECIMAL: + name->NameValue = InputScopeNameValue::Number; + break; + case EditBox::InputMode::SINGLE_LINE: + name->NameValue = InputScopeNameValue::Default; + break; + default: + name->NameValue = InputScopeNameValue::Default; + break; + } + + box->InputScope = nullptr; + inputScope->Names->Append(name); + box->InputScope = inputScope; +} + +void EditBoxWinRT::QueueText() +{ + critical_section::scoped_lock lock(m_criticalSection); + if ((m_passwordBox == nullptr) && (m_textBox == nullptr)) + { + return; + } + + m_strText = m_inputFlag == EditBox::InputFlag::PASSWORD ? m_passwordBox->Password : m_textBox->Text; + std::shared_ptr e(new UIEditBoxEvent(this, m_strText, m_receiveHandler)); + cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e); +} + + + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new UIEditBoxImplWinrt(pEditBox); +} + +UIEditBoxImplWinrt::UIEditBoxImplWinrt( EditBox* pEditText ) + : EditBoxImpl(pEditText) + , m_pLabel(NULL) + , m_pLabelPlaceHolder(NULL) + , m_eEditBoxInputMode(EditBox::InputMode::SINGLE_LINE) + , m_eEditBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) + , m_eKeyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) + , m_colText(Color3B::WHITE) + , m_colPlaceHolder(Color3B::GRAY) + , m_nMaxLength(-1) +{ + +} + +UIEditBoxImplWinrt::~UIEditBoxImplWinrt() +{ + +} + +void UIEditBoxImplWinrt::openKeyboard() +{ + if (_delegate != NULL) + { + _delegate->editBoxEditingDidBegin(_editBox); + } + + EditBox* pEditBox = this->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + ScriptEvent event(kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } + + std::string placeHolder = m_pLabelPlaceHolder->getString(); + if (placeHolder.length() == 0) + placeHolder = "Enter value"; + + char pText[100]= {0}; + std::string text = getText(); + if (text.length()) + strncpy(pText, text.c_str(), 100); + + + if (!m_editBoxWinrt) + { + Windows::Foundation::EventHandler^ receiveHandler = ref new Windows::Foundation::EventHandler( + [this](Platform::Object^ sender, Platform::String^ arg) + { + setText(PlatformStringTostring(arg).c_str()); + if (_delegate != NULL) { + _delegate->editBoxTextChanged(_editBox, getText()); + _delegate->editBoxEditingDidEnd(_editBox); + _delegate->editBoxReturn(_editBox); + } + }); + + m_editBoxWinrt = ref new EditBoxWinRT(stringToPlatformString(placeHolder), stringToPlatformString(getText()), m_nMaxLength, m_eEditBoxInputMode, m_eEditBoxInputFlag, receiveHandler); + } + + m_editBoxWinrt->OpenXamlEditBox(stringToPlatformString(getText())); +} + +bool UIEditBoxImplWinrt::initWithSize( const Size& size ) +{ + //! int fontSize = getFontSizeAccordingHeightJni(size.height-12); + m_pLabel = Label::createWithSystemFont("", "", size.height-12); + // align the text vertically center + m_pLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); + m_pLabel->setPosition(Vec2(5.0, size.height / 2.0f)); + m_pLabel->setColor(m_colText); + _editBox->addChild(m_pLabel); + + m_pLabelPlaceHolder = Label::createWithSystemFont("", "", size.height-12); + // align the text vertically center + m_pLabelPlaceHolder->setAnchorPoint(Vec2(0.0f, 0.5f)); + m_pLabelPlaceHolder->setPosition(Vec2(5.0f, size.height / 2.0f)); + m_pLabelPlaceHolder->setVisible(false); + m_pLabelPlaceHolder->setColor(m_colPlaceHolder); + _editBox->addChild(m_pLabelPlaceHolder); + + m_EditSize = size; + return true; +} + +void UIEditBoxImplWinrt::setFont( const char* pFontName, int fontSize ) +{ + if(m_pLabel != NULL) { + m_pLabel->setSystemFontName(pFontName); + m_pLabel->setSystemFontSize(fontSize); + } + + if(m_pLabelPlaceHolder != NULL) { + m_pLabelPlaceHolder->setSystemFontName(pFontName); + m_pLabelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void UIEditBoxImplWinrt::setFontColor( const Color3B& color ) +{ + m_colText = color; + m_pLabel->setColor(color); +} + +void UIEditBoxImplWinrt::setPlaceholderFont( const char* pFontName, int fontSize ) +{ + if(m_pLabelPlaceHolder != NULL) { + m_pLabelPlaceHolder->setSystemFontName(pFontName); + m_pLabelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void UIEditBoxImplWinrt::setPlaceholderFontColor( const Color3B& color ) +{ + m_colPlaceHolder = color; + m_pLabelPlaceHolder->setColor(color); +} + +void UIEditBoxImplWinrt::setInputMode( EditBox::InputMode inputMode ) +{ + m_eEditBoxInputMode = inputMode; +} + +void UIEditBoxImplWinrt::setInputFlag(EditBox::InputFlag inputFlag ) +{ + m_eEditBoxInputFlag = inputFlag; +} + +void UIEditBoxImplWinrt::setMaxLength( int maxLength ) +{ + m_nMaxLength = maxLength; +} + +int UIEditBoxImplWinrt::getMaxLength() +{ + return m_nMaxLength; +} + +void UIEditBoxImplWinrt::setReturnType( EditBox::KeyboardReturnType returnType ) +{ + m_eKeyboardReturnType = returnType; +} + +bool UIEditBoxImplWinrt::isEditing() +{ + return false; +} + +void UIEditBoxImplWinrt::setText( const char* pText ) +{ + if (pText != NULL) + { + m_strText = pText; + + if (m_strText.length() > 0) + { + m_pLabelPlaceHolder->setVisible(false); + + std::string strToShow; + + if (EditBox::InputFlag::PASSWORD == m_eEditBoxInputFlag) + { + long length = cc_utf8_strlen(m_strText.c_str(), -1); + for (long i = 0; i < length; i++) + { + strToShow.append("*"); + } + } + else + { + strToShow = m_strText; + } + + //! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), m_EditSize.width, m_EditSize.height-12); + //! m_pLabel->setString(strWithEllipsis.c_str()); + m_pLabel->setString(strToShow.c_str()); + } + else + { + m_pLabelPlaceHolder->setVisible(true); + m_pLabel->setString(""); + } + + } +} + +const char* UIEditBoxImplWinrt::getText( void ) +{ + return m_strText.c_str(); +} + +void UIEditBoxImplWinrt::setPlaceHolder( const char* pText ) +{ + if (pText != NULL) + { + m_strPlaceHolder = pText; + if (m_strPlaceHolder.length() > 0 && m_strText.length() == 0) + { + m_pLabelPlaceHolder->setVisible(true); + } + + m_pLabelPlaceHolder->setString(m_strPlaceHolder.c_str()); + } +} + +void UIEditBoxImplWinrt::setPosition( const Vec2& pos ) +{ + +} + +void UIEditBoxImplWinrt::setVisible( bool visible ) +{ + +} + +void UIEditBoxImplWinrt::setContentSize( const Size& size ) +{ + +} + +void UIEditBoxImplWinrt::setAnchorPoint( const Vec2& anchorPoint ) +{ + +} + +void UIEditBoxImplWinrt::visit( void ) +{ + +} + +void UIEditBoxImplWinrt::doAnimationWhenKeyboardMove( float duration, float distance ) +{ + +} + +void UIEditBoxImplWinrt::closeKeyboard() +{ + +} + +void UIEditBoxImplWinrt::onEnter( void ) +{ + +} + +Platform::String^ UIEditBoxImplWinrt::stringToPlatformString( std::string strSrc ) +{ + // to wide char + int nStrLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0); + wchar_t* pWStr = new wchar_t[nStrLen + 1]; + memset(pWStr, 0, nStrLen + 1); + MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, pWStr, nStrLen); + Platform::String^ strDst = ref new Platform::String(pWStr); + delete[] pWStr; + return strDst; +} + +std::string UIEditBoxImplWinrt::PlatformStringTostring( Platform::String^ strSrc ) +{ + const wchar_t* pWStr = strSrc->Data(); + int nStrLen = WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, NULL, 0, NULL, NULL); + char* pStr = new char[nStrLen + 1]; + memset(pStr, 0, nStrLen + 1); + WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, pStr, nStrLen, NULL, NULL); ; + + std::string strDst = std::string(pStr); + + delete[] pStr; + return strDst; +} + +} + +NS_CC_END + +#endif // WP8 diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.h b/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.h new file mode 100644 index 0000000000..68cb26e739 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.h @@ -0,0 +1,146 @@ +/**************************************************************************** +Copyright (c) 2014 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +#ifndef __UIEditBoxIMPLWINRT_H__ +#define __UIEditBoxIMPLWINRT_H__ + +#include "platform/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + +#include "UIEditBoxImpl.h" + +NS_CC_BEGIN + +namespace ui { + class EditBox; + + ref class EditBoxWinRT sealed + { + public: + EditBoxWinRT(); + virtual ~EditBoxWinRT(); + internal: + + EditBoxWinRT(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, EditBox::InputMode inputMode, EditBox::InputFlag inputFlag, Windows::Foundation::EventHandler^ receiveHandler); + void OpenXamlEditBox(Platform::String^ strText); + + private: + Windows::UI::Xaml::Controls::Control^ CreateTextBox(int maxLength); + Windows::UI::Xaml::Controls::Control^ CreatePasswordBox(int maxLength); + void SetInputScope(Windows::UI::Xaml::Controls::TextBox^ box, EditBox::InputMode inputMode); + + void EditBoxWinRT::SetupTextBox(); + void EditBoxWinRT::SetupPasswordBox(); + void EditBoxWinRT::RemoveTextBox(); + void RemoveControls(); + void QueueText(); + + void Done(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void Cancel(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void Closed(Platform::Object^ sender, Platform::Object^ e); + void HideKeyboard(Windows::UI::ViewManagement::InputPane^ inputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs^ args); + void HideFlyout(); + + Platform::Agile m_dispatcher; + Platform::Agile m_panel; + Windows::Foundation::EventHandler^ m_receiveHandler; + + Windows::UI::Xaml::Controls::TextBox^ m_textBox; + Windows::UI::Xaml::Controls::PasswordBox^ m_passwordBox; + Windows::UI::Xaml::Controls::Flyout^ m_flyout; + Windows::UI::Xaml::Controls::Button^ m_doneButton; + Windows::UI::Xaml::Controls::Button^ m_cancelButton; + + Windows::Foundation::EventRegistrationToken m_doneToken; + Windows::Foundation::EventRegistrationToken m_cancelToken; + Windows::Foundation::EventRegistrationToken m_closedToken; + Windows::Foundation::EventRegistrationToken m_hideKeyboardToken; + + Concurrency::critical_section m_criticalSection; + + Platform::String^ m_strText; + Platform::String^ m_strPlaceholder; + EditBox::InputMode m_inputMode; + EditBox::InputFlag m_inputFlag; + int m_maxLength; + }; + + class CC_GUI_DLL UIEditBoxImplWinrt : public EditBoxImpl + { + public: + UIEditBoxImplWinrt(EditBox* pEditText); + virtual ~UIEditBoxImplWinrt(); + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color3B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color3B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + virtual void visit(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + virtual void onEnter(void); + private: + Platform::String^ stringToPlatformString(std::string strSrc); + std::string PlatformStringTostring(Platform::String^ strSrc); + private: + + EditBoxWinRT^ m_editBoxWinrt; + + Label* m_pLabel; + Label* m_pLabelPlaceHolder; + EditBox::InputMode m_eEditBoxInputMode; + EditBox::InputFlag m_eEditBoxInputFlag; + (EditBox::KeyboardReturnType m_eKeyboardReturnType; + + std::string m_strText; + std::string m_strPlaceHolder; + + Color3B m_colText; + Color3B m_colPlaceHolder; + + int m_nMaxLength; + Size m_EditSize; + }; +} + +NS_CC_END + +#endif //CC_PLATFORM_WINRT + +#endif diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/App.xaml b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/App.xaml new file mode 100644 index 0000000000..2da0ff79d0 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/App.xaml @@ -0,0 +1,13 @@ + + + + + cpp_tests + + + diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/App.xaml.cpp b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/App.xaml.cpp new file mode 100644 index 0000000000..f4365b88c5 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/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.win8.1-universal/HelloCpp.Shared/App.xaml.h b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/App.xaml.h new file mode 100644 index 0000000000..1309c610d7 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/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.win8.1-universal/HelloCpp.Shared/Cocos2dRenderer.cpp b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/Cocos2dRenderer.cpp new file mode 100644 index 0000000000..e0c02e3ee8 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/Cocos2dRenderer.cpp @@ -0,0 +1,85 @@ +/* +* 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" + +// 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(const int width, const int height, CoreDispatcher^ dispatcher, Panel^ panel) + : mApp(nullptr) + , mWidth(width) + , mHeight(height) + , m_dispatcher(dispatcher) + , m_panel(panel) +{ + mApp = new AppDelegate(); + auto director = cocos2d::Director::getInstance(); + + GLViewImpl* glview = GLViewImpl::create("Test Cpp"); + glview->setDispatcher(dispatcher); + glview->setPanel(panel); + glview->Create(static_cast(width), static_cast(height), DisplayOrientations::Landscape); + director->setOpenGLView(glview); + CCApplication::getInstance()->run(); +} + +Cocos2dRenderer::~Cocos2dRenderer() +{ + delete mApp; +} + +// Draws a basic triangle +void Cocos2dRenderer::Draw(GLsizei width, GLsizei height) +{ + if (width != mWidth || height != mHeight) + { + mWidth = width; + mHeight = height; + GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(static_cast(width), static_cast(height)); + } + + GLViewImpl::sharedOpenGLView()->ProcessEvents(); + GLViewImpl::sharedOpenGLView()->Render(); +} + +void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args) +{ + GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args); +} + +void Cocos2dRenderer::QueueKeyBoardEvent(cocos2d::Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e) +{ + //GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, e); +} + + diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/Cocos2dRenderer.h b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/Cocos2dRenderer.h new file mode 100644 index 0000000000..387445f6d5 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/Cocos2dRenderer.h @@ -0,0 +1,47 @@ +/* +* 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(const int width, const int height, Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel); + ~Cocos2dRenderer(); + void Draw(GLsizei width, GLsizei height); + void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); + void QueueKeyBoardEvent(Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e); + + private: + + int mWidth; + int mHeight; + // The AppDelegate for the Cocos2D app + AppDelegate* mApp; + Platform::Agile m_dispatcher; + Platform::Agile m_panel; + }; +} \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems new file mode 100644 index 0000000000..466b128576 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems @@ -0,0 +1,62 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + e956c24b-f04e-47bf-bf00-746681ae1301 + {a3ad93e4-0b2f-4c58-9181-69bed2e42e3e} + HelloCpp + + + + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) + + + + + Designer + + + + + $(MSBuildThisFileDirectory)App.xaml + + + + + $(MSBuildThisFileDirectory)OpenGLESPage.xaml + + + + + + $(MSBuildThisFileDirectory)App.xaml + + + Create + + + + $(MSBuildThisFileDirectory)OpenGLESPage.xaml + + + + + + + + <_CustomResource Include="$(MSBuildThisFileDirectory)..\..\Resources\**\*"> + Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + true + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems.filters b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems.filters new file mode 100644 index 0000000000..5d1f7e30da --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems.filters @@ -0,0 +1,42 @@ + + + + + + + + + Classes + + + Classes + + + + + + + + + + + {38ad799c-8c3c-44a2-8e41-516c8f62f556} + + + + + Classes + + + Classes + + + Classes + + + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLES.cpp b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLES.cpp new file mode 100644 index 0000000000..943b0856fc --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLES.cpp @@ -0,0 +1,175 @@ +/* +* 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 displayAttributes[] = + { + // This can be used to configure D3D11. For example, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE could be used. + // This would ask the graphics card to use D3D11 Feature Level 9_3 instead of Feature Level 11_0+. + // On Windows Phone, this would allow the Phone Emulator to act more like the GPUs that are available on real Phone devices. +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE, + EGL_NONE, +#else + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_NONE, +#endif + }; + + const EGLint contextAttributes[] = + { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + + // eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in 'displayAttributes' to configure D3D11. + PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast(eglGetProcAddress("eglGetPlatformDisplayEXT")); + if (!eglGetPlatformDisplayEXT) + { + throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT"); + } + + mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes); + if (mEglDisplay == EGL_NO_DISPLAY) + { + throw Exception::CreateException(E_FAIL, L"Failed to get default EGL display"); + } + + if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) + { + throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL"); + } + + EGLint numConfigs = 0; + if (eglGetConfigs(mEglDisplay, NULL, 0, &numConfigs) == EGL_FALSE) + { + throw Exception::CreateException(E_FAIL, L"Failed to get EGLConfig count"); + } + + if (eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) + { + 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; + + // 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), NULL); + 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.win8.1-universal/HelloCpp.Shared/OpenGLES.h b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLES.h new file mode 100644 index 0000000000..ce9f2a9cdf --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLES.h @@ -0,0 +1,52 @@ +/* +* 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(); + +private: + void Initialize(); + void Cleanup(); + +private: + EGLDisplay mEglDisplay; + EGLContext mEglContext; + EGLConfig mEglConfig; +}; diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml new file mode 100644 index 0000000000..e5b62802a5 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml.cpp b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml.cpp similarity index 58% rename from tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml.cpp rename to templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml.cpp index abd0e9b475..c8ee9afb42 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml.cpp +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml.cpp @@ -1,10 +1,40 @@ -#include "pch.h" +/* +* 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 cpp_tests; +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; OpenGLESPage::OpenGLESPage() : OpenGLESPage(nullptr) @@ -16,7 +46,8 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : mOpenGLES(openGLES), mRenderSurface(EGL_NO_SURFACE), mCustomRenderSurfaceSize(0,0), - mUseCustomRenderSurfaceSize(false) + mUseCustomRenderSurfaceSize(false), + m_coreInput(nullptr) { InitializeComponent(); @@ -31,7 +62,11 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : this->Loaded += ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded); -#if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height }; + +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync(); +#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(); @@ -39,7 +74,28 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false; #endif - mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height }; + // 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(this, &OpenGLESPage::OnPointerPressed); + m_coreInput->PointerMoved += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerMoved); + m_coreInput->PointerReleased += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerReleased); + + // Begin processing input messages as they're delivered. + m_coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit); + }); + + // Run task on a dedicated high priority background thread. + m_inputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced); + } OpenGLESPage::~OpenGLESPage() @@ -55,6 +111,32 @@ void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::Rou StartRenderLoop(); } +void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerPressed, e); + } +} + +void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerMoved, e); + } +} + +void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerReleased, e); + } +} + + + void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args) { if (args->Visible && mRenderSurface != EGL_NO_SURFACE) @@ -101,7 +183,7 @@ void OpenGLESPage::CreateRenderSurface() // The render surface will be automatically scaled to fit the entire window. Using a // smaller sized render surface can result in a performance gain. // - //mCustomRenderSurfaceSize = Size(340, 400); + //mCustomRenderSurfaceSize = Size(800, 600); //mUseCustomRenderSurfaceSize = true; mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, mUseCustomRenderSurfaceSize ? &mCustomRenderSurfaceSize : nullptr); @@ -143,21 +225,29 @@ void OpenGLESPage::StartRenderLoop() return; } + auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher; + // Create a task for rendering that will be run on a background thread. - auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this](Windows::Foundation::IAsyncAction ^ action) + auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this, dispatcher](Windows::Foundation::IAsyncAction ^ action) { critical_section::scoped_lock lock(mRenderSurfaceCriticalSection); mOpenGLES->MakeCurrent(mRenderSurface); - HelloTriangleRenderer renderer; + + GLsizei panelWidth = 0; + GLsizei panelHeight = 0; + GetSwapChainPanelSize(&panelWidth, &panelHeight); + + if (m_renderer.get() == nullptr) + { + m_renderer = std::make_shared(panelWidth, panelHeight, dispatcher, swapChainPanel); + } while (action->Status == Windows::Foundation::AsyncStatus::Started) { - GLsizei panelWidth = 0; - GLsizei panelHeight = 0; - + GetSwapChainPanelSize(&panelWidth, &panelHeight); - renderer.Draw(panelWidth, panelHeight); + m_renderer.get()->Draw(panelWidth, panelHeight); // The call to eglSwapBuffers might not be successful (i.e. due to Device Lost) // If the call fails, then we must reinitialize EGL and the GL resources. @@ -165,6 +255,7 @@ void OpenGLESPage::StartRenderLoop() { // XAML objects like the SwapChainPanel must only be manipulated on the UI thread. swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]() + //swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]() { RecoverFromLostDevice(); }, CallbackContext::Any)); diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml.h b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml.h new file mode 100644 index 0000000000..d8ddccc63e --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/OpenGLESPage.xaml.h @@ -0,0 +1,71 @@ +/* +* 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 "OpenGLES.h" +#include "OpenGLESPage.g.h" +#include + +#include "Cocos2dRenderer.h" + +namespace cocos2d +{ + public ref class OpenGLESPage sealed + { + public: + OpenGLESPage(); + virtual ~OpenGLESPage(); + + internal: + OpenGLESPage(OpenGLES* openGLES); + + private: + void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); + void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e); + void GetSwapChainPanelSize(GLsizei* width, GLsizei* height); + void CreateRenderSurface(); + void DestroyRenderSurface(); + void RecoverFromLostDevice(); + void StartRenderLoop(); + void StopRenderLoop(); + + OpenGLES* mOpenGLES; + std::shared_ptr m_renderer; + + Windows::Foundation::Size mSwapChainPanelSize; + Concurrency::critical_section mSwapChainPanelSizeCriticalSection; + + Windows::Foundation::Size mCustomRenderSurfaceSize; + bool mUseCustomRenderSurfaceSize; + + EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page + Concurrency::critical_section mRenderSurfaceCriticalSection; + Windows::Foundation::IAsyncAction^ mRenderLoopWorker; + + // Track user input on a background worker thread. + Windows::Foundation::IAsyncAction^ m_inputLoopWorker; + Windows::UI::Core::CoreIndependentInputSource^ m_coreInput; + + // Independent input handling functions. + void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + }; +} diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/pch.cpp b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/pch.cpp new file mode 100644 index 0000000000..bcb5590be1 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/pch.h b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/pch.h new file mode 100644 index 0000000000..2e511d964f --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Shared/pch.h @@ -0,0 +1,14 @@ +// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "cocos2d.h" +#include "cocos-ext.h" + + diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/Logo.scale-100.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/Logo.scale-100.png new file mode 100644 index 0000000000..e26771cb33 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/Logo.scale-100.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/SmallLogo.scale-100.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000000..1eb0d9d528 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/SmallLogo.scale-100.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/SplashScreen.scale-100.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000000..d8ded7198a Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/SplashScreen.scale-100.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/StoreLogo.scale-100.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000000..dcb672712c Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Assets/StoreLogo.scale-100.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj new file mode 100644 index 0000000000..9426841b54 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj @@ -0,0 +1,192 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + {79a8fcda-4b12-4dd1-b676-ff148d651638} + cocos2d + en-US + 12.0 + true + Windows Store + 8.1 + + + + Application + true + v120 + + + Application + true + v120 + + + Application + true + v120 + + + Application + false + true + v120 + + + Application + false + true + v120 + + + Application + false + true + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HelloCpp.Windows_TemporaryKey.pfx + True + x86 + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + Designer + + + + + + + + + + + + {9335005f-678e-4e8e-9b84-50037216aec8} + + + {f3550fe0-c795-44f6-8feb-093eb68143ae} + + + {3b26a12d-3a44-47ea-82d2-282660fc844d} + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj.filters b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj.filters new file mode 100644 index 0000000000..3cdafaeec0 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj.filters @@ -0,0 +1,29 @@ + + + + + {1a9fa652-867e-41d2-8588-962f108d2d8f} + bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png + + + + + + + + + + + Assets + + + Assets + + + Assets + + + Assets + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows_TemporaryKey.pfx b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows_TemporaryKey.pfx new file mode 100644 index 0000000000..5ad010651a Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows_TemporaryKey.pfx differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Package.appxmanifest b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Package.appxmanifest new file mode 100644 index 0000000000..6418109719 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.Windows/Package.appxmanifest @@ -0,0 +1,30 @@ + + + + + HelloCpp.Windows + dalestam + Assets\StoreLogo.png + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Logo.scale-240.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Logo.scale-240.png new file mode 100644 index 0000000000..76921ca997 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Logo.scale-240.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SmallLogo.scale-240.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SmallLogo.scale-240.png new file mode 100644 index 0000000000..316630124f Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SmallLogo.scale-240.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SplashScreen.scale-240.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SplashScreen.scale-240.png new file mode 100644 index 0000000000..b0b6bc08e5 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SplashScreen.scale-240.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Square71x71Logo.scale-240.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Square71x71Logo.scale-240.png new file mode 100644 index 0000000000..cfa54bee03 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Square71x71Logo.scale-240.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/StoreLogo.scale-240.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/StoreLogo.scale-240.png new file mode 100644 index 0000000000..47e084b593 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/StoreLogo.scale-240.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/WideLogo.scale-240.png b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/WideLogo.scale-240.png new file mode 100644 index 0000000000..6249d29db0 Binary files /dev/null and b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/WideLogo.scale-240.png differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj new file mode 100644 index 0000000000..7e8ae34bb4 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj @@ -0,0 +1,144 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Release + ARM + + + Release + Win32 + + + + {396fe85e-bb05-4b92-bccb-f89aed4ea41a} + cocos2d + en-US + 12.0 + true + Windows Phone + 8.1 + + + + Application + true + v120_wp81 + + + Application + true + v120_wp81 + + + Application + false + true + v120_wp81 + + + Application + false + true + v120_wp81 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + arm + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;%(AdditionalIncludeDirectories) + + + + + Designer + + + + + + + + + + + + + {22f3b9df-1209-4574-8331-003966f562bf} + + + {cc1da216-a80d-4be4-b309-acb6af313aff} + + + {22f798d8-bfff-4754-996f-a5395343d5ec} + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj.filters b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj.filters new file mode 100644 index 0000000000..eb71f325ca --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {c8beb60d-689b-4aaa-9749-99bd3e2dcf75} + bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Package.appxmanifest b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Package.appxmanifest new file mode 100644 index 0000000000..eb4bab30a4 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.WindowsPhone/Package.appxmanifest @@ -0,0 +1,33 @@ + + + + + + HelloCpp.WindowsPhone + dalestam + Assets\StoreLogo.png + + + 6.3.1 + 6.3.1 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln new file mode 100644 index 0000000000..d0d8a4e3d5 --- /dev/null +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln @@ -0,0 +1,181 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HelloCpp", "HelloCpp", "{36AFDE04-D127-4D84-9730-D84E3E51EAA7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Shared", "HelloCpp.Shared\HelloCpp.Shared.vcxitems", "{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Windows", "HelloCpp.Windows\HelloCpp.Windows.vcxproj", "{79A8FCDA-4B12-4DD1-B676-FF148D651638}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.WindowsPhone", "HelloCpp.WindowsPhone\HelloCpp.WindowsPhone.vcxproj", "{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{80DA05C1-6532-4D2A-8606-EF02079B1373}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{F13CB4F7-BEE5-4368-A815-A971797387D8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbox2d", "libbox2d", "{626C3EB8-F53B-41D0-BEA8-44EACAA1228C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libSpine", "libSpine", "{D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Shared", "..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems", "{4A3C6BA8-C227-498B-AA21-40BDA27B461F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Windows", "..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj", "{3B26A12D-3A44-47EA-82D2-282660FC844D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.WindowsPhone", "..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.WindowsPhone\libbox2d.WindowsPhone.vcxproj", "{22F798D8-BFFF-4754-996F-A5395343D5EC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems", "{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.WindowsPhone", "..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.WindowsPhone\libSpine.WindowsPhone.vcxproj", "{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Shared", "..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems", "{5D6F020F-7E72-4494-90A0-2DF11D235DF9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", "..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj", "{9335005F-678E-4E8E-9B84-50037216AEC8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.WindowsPhone", "..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.WindowsPhone\libcocos2d_8_1.WindowsPhone.vcxproj", "{22F3B9DF-1209-4574-8331-003966F562BF}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4 + HelloCpp.Shared\HelloCpp.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9 + ..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4 + ..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9 + HelloCpp.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4 + ..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9 + ..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9 + ..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4 + ..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{22f3b9df-1209-4574-8331-003966f562bf}*SharedItemsImports = 4 + ..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{22f798d8-bfff-4754-996f-a5395343d5ec}*SharedItemsImports = 4 + ..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4 + HelloCpp.Shared\HelloCpp.Shared.vcxitems*{396fe85e-bb05-4b92-bccb-f89aed4ea41a}*SharedItemsImports = 4 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|ARM = Release|ARM + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.ActiveCfg = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Build.0 = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Deploy.0 = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.ActiveCfg = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Build.0 = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Deploy.0 = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.ActiveCfg = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Build.0 = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Deploy.0 = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.ActiveCfg = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Build.0 = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Deploy.0 = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.ActiveCfg = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Build.0 = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Deploy.0 = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.ActiveCfg = Release|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Build.0 = Release|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Deploy.0 = Release|x64 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.ActiveCfg = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Build.0 = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Deploy.0 = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.ActiveCfg = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Build.0 = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Deploy.0 = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|x64.ActiveCfg = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.ActiveCfg = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Build.0 = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Deploy.0 = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.ActiveCfg = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Build.0 = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Deploy.0 = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|x64.ActiveCfg = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.ActiveCfg = Debug|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.Build.0 = Debug|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.Build.0 = Debug|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.ActiveCfg = Debug|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.Build.0 = Debug|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.ActiveCfg = Release|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.Build.0 = Release|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.ActiveCfg = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.Build.0 = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.ActiveCfg = Release|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.Build.0 = Release|x64 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.ActiveCfg = Debug|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.Build.0 = Debug|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.ActiveCfg = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.Build.0 = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|x64.ActiveCfg = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.ActiveCfg = Release|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.Build.0 = Release|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.ActiveCfg = Release|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.Build.0 = Release|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|x64.ActiveCfg = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.ActiveCfg = Debug|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.Build.0 = Debug|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.ActiveCfg = Debug|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.Build.0 = Debug|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.ActiveCfg = Debug|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.Build.0 = Debug|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.ActiveCfg = Release|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.Build.0 = Release|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.ActiveCfg = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.ActiveCfg = Debug|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.Build.0 = Debug|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.Build.0 = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|x64.ActiveCfg = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.ActiveCfg = Release|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.Build.0 = Release|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.ActiveCfg = Release|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.Build.0 = Release|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|x64.ActiveCfg = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.ActiveCfg = Debug|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.Build.0 = Debug|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.ActiveCfg = Debug|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.Build.0 = Debug|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.ActiveCfg = Debug|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.Build.0 = Debug|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.ActiveCfg = Release|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.Build.0 = Release|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.ActiveCfg = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.Build.0 = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.ActiveCfg = Release|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.Build.0 = Release|x64 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.ActiveCfg = Debug|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.Build.0 = Debug|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.ActiveCfg = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.Build.0 = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|x64.ActiveCfg = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.ActiveCfg = Release|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.Build.0 = Release|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.ActiveCfg = Release|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.Build.0 = Release|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A3AD93E4-0B2F-4C58-9181-69BED2E42E3E} = {36AFDE04-D127-4D84-9730-D84E3E51EAA7} + {79A8FCDA-4B12-4DD1-B676-FF148D651638} = {36AFDE04-D127-4D84-9730-D84E3E51EAA7} + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A} = {36AFDE04-D127-4D84-9730-D84E3E51EAA7} + {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} = {F13CB4F7-BEE5-4368-A815-A971797387D8} + {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} = {F13CB4F7-BEE5-4368-A815-A971797387D8} + {4A3C6BA8-C227-498B-AA21-40BDA27B461F} = {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} + {3B26A12D-3A44-47EA-82D2-282660FC844D} = {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} + {22F798D8-BFFF-4754-996F-A5395343D5EC} = {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} + {ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} + {F3550FE0-C795-44F6-8FEB-093EB68143AE} = {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF} = {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} + {5D6F020F-7E72-4494-90A0-2DF11D235DF9} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + {9335005F-678E-4E8E-9B84-50037216AEC8} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + {22F3B9DF-1209-4574-8331-003966F562BF} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + EndGlobalSection +EndGlobal diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml b/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml index 02706a5450..4e5975de2a 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml +++ b/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml @@ -1,5 +1,5 @@  - + diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs b/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs index c97119aec5..3553e5f82f 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs @@ -7,9 +7,8 @@ using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.IO.IsolatedStorage; -using PhoneDirect3DXamlAppInterop.Resources; -namespace PhoneDirect3DXamlAppInterop +namespace cocos2d { public partial class App : Application { diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/EditBox.xaml b/templates/cpp-template-default/proj.wp8-xaml/App/EditBox.xaml index 8a179c3ab4..a1259d3268 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/EditBox.xaml +++ b/templates/cpp-template-default/proj.wp8-xaml/App/EditBox.xaml @@ -1,4 +1,4 @@ -{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - PhoneDirect3DXamlAppInterop - PhoneDirect3DXamlAppInterop + cocos2d + HelloCpp WindowsPhone v8.0 $(TargetFrameworkVersion) @@ -19,9 +19,9 @@ true true - PhoneDirect3DXamlAppInterop_$(Configuration)_$(Platform).xap + HelloCpp_$(Configuration)_$(Platform).xap Properties\AppManifest.xml - PhoneDirect3DXamlAppInterop.App + cocos2d.App true 11.0 true diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/LocalizedStrings.cs b/templates/cpp-template-default/proj.wp8-xaml/App/LocalizedStrings.cs index a7c1f23777..4c0d4ba292 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/LocalizedStrings.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/LocalizedStrings.cs @@ -1,6 +1,6 @@ -using PhoneDirect3DXamlAppInterop.Resources; +using cocos2d.Resources; -namespace PhoneDirect3DXamlAppInterop +namespace cocos2d { /// /// Provides access to string resources. diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml b/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml index 53fca91bdb..fa08ba79d6 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml +++ b/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml @@ -1,5 +1,5 @@  0) + { + m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text); + m_textBox.Text = ""; + } } // Called by the Cocos2d-x C++ engine to display a MessageBox @@ -181,7 +182,6 @@ namespace PhoneDirect3DXamlAppInterop m_textBox.TextChanged += OnTextChanged; DrawingSurfaceBackground.Children.Add(m_textBox); } - m_textBox.Text = text; m_textBox.SelectionLength = 0; m_textBox.SelectionStart = int.MaxValue; m_textBox.Focus(); diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/Properties/AssemblyInfo.cs b/templates/cpp-template-default/proj.wp8-xaml/App/Properties/AssemblyInfo.cs index 1b6c5d6478..c5921e1749 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/Properties/AssemblyInfo.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("PhoneDirect3DXamlAppInterop")] +[assembly: AssemblyTitle("cocos2d")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PhoneDirect3DXamlAppInterop")] +[assembly: AssemblyProduct("cocos2d")] [assembly: AssemblyCopyright("Copyright © 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/Properties/WMAppManifest.xml b/templates/cpp-template-default/proj.wp8-xaml/App/Properties/WMAppManifest.xml index 8622bf45fc..4c40163d98 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/Properties/WMAppManifest.xml +++ b/templates/cpp-template-default/proj.wp8-xaml/App/Properties/WMAppManifest.xml @@ -1,30 +1,35 @@  - + Assets\ApplicationIcon.png - - - - - + + + + + - + - + Assets\Tiles\FlipCycleTileSmall.png 0 Assets\Tiles\FlipCycleTileMedium.png - PhoneDirect3DXamlAppInterop - - - - - + HelloCpp + + + + + + + + + + diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs b/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs index bf26a41d6e..733f693ea6 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs @@ -8,7 +8,8 @@ // //------------------------------------------------------------------------------ -namespace PhoneDirect3DXamlAppInterop.Resources { +namespace cocos2d.Resources +{ using System; diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj index 001e96c4c4..a5da28a426 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj @@ -20,7 +20,7 @@ {60ec6889-c3c4-45ad-a006-47d9ee689212} - PhoneDirect3DXamlAppComponent + cocos2d en-US 11.0 true diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.cpp b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.cpp index d0d5a5f61c..c3cd6ca388 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.cpp +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.cpp @@ -35,7 +35,6 @@ using namespace DirectX; using namespace Microsoft::WRL; using namespace Windows::Foundation; using namespace Windows::UI::Core; -using namespace PhoneDirect3DXamlAppComponent; USING_NS_CC; @@ -151,7 +150,7 @@ void Cocos2dRenderer::OnCocos2dKeyEvent(Cocos2dKeyEvent event) } -void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) +void Cocos2dRenderer::SetXamlEventDelegate(Cocos2dEventDelegate^ delegate) { m_delegate = delegate; GLViewImpl* eglView = GLViewImpl::sharedOpenGLView(); @@ -161,7 +160,7 @@ void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2 } } -void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) +void Cocos2dRenderer::SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; GLViewImpl* eglView = GLViewImpl::sharedOpenGLView(); @@ -171,7 +170,7 @@ void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::C } } -void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) +void Cocos2dRenderer::SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; GLViewImpl* eglView = GLViewImpl::sharedOpenGLView(); @@ -181,7 +180,7 @@ void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Coco } } -void Cocos2dRenderer::SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate) +void Cocos2dRenderer::SetXamlOpenURLDelegate(Cocos2dOpenURLDelegate^ delegate) { m_openURLDelegate = delegate; Application* app = Application::getInstance(); diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.h b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.h index 55e84b12cb..b1799312c0 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.h +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.h @@ -41,11 +41,11 @@ public: void OnBackButton(); void OnKeyPressed(Platform::String^ text); - void OnCocos2dKeyEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent event); - void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate); - void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate); - void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate); - void SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate); + void OnCocos2dKeyEvent(cocos2d::Cocos2dKeyEvent event); + void SetXamlEventDelegate(cocos2d::Cocos2dEventDelegate^ delegate); + void SetXamlMessageBoxDelegate(cocos2d::Cocos2dMessageBoxDelegate^ delegate); + void SetXamlEditBoxDelegate(cocos2d::Cocos2dEditBoxDelegate^ delegate); + void SetXamlOpenURLDelegate(cocos2d::Cocos2dOpenURLDelegate^ delegate); Windows::Foundation::IAsyncAction^ OnSuspending(); void Connect(); @@ -59,10 +59,10 @@ private: bool m_loadingComplete; bool mInitialized; - PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate; - PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; - PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate; - PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ m_openURLDelegate; + cocos2d::Cocos2dEventDelegate^ m_delegate; + cocos2d::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; + cocos2d::Cocos2dEditBoxDelegate^ m_editBoxDelegate; + cocos2d::Cocos2dOpenURLDelegate^ m_openURLDelegate; // The AppDelegate for the Cocos2D app AppDelegate* mApp; diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.cpp b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.cpp index 323d0b556d..7bfdf80366 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.cpp +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "Direct3DContentProvider.h" #include "Direct3DInterop.h" -using namespace PhoneDirect3DXamlAppComponent; +using namespace cocos2d; Direct3DContentProvider::Direct3DContentProvider(Direct3DInterop^ controller) : m_controller(controller) diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.h b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.h index 7a9d941074..830496c1f4 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.h +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.h @@ -37,7 +37,7 @@ class Direct3DContentProvider : public Microsoft::WRL::RuntimeClass< IDrawingSurfaceBackgroundContentProviderNative> { public: - Direct3DContentProvider(PhoneDirect3DXamlAppComponent::Direct3DInterop^ controller); + Direct3DContentProvider(cocos2d::Direct3DInterop^ controller); // IDrawingSurfaceContentProviderNative HRESULT STDMETHODCALLTYPE Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device); @@ -47,6 +47,6 @@ public: HRESULT STDMETHODCALLTYPE Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView); private: - PhoneDirect3DXamlAppComponent::Direct3DInterop^ m_controller; + cocos2d::Direct3DInterop^ m_controller; Microsoft::WRL::ComPtr m_host; }; diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.cpp b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.cpp index e43b246088..53c14cdfaa 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.cpp +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.cpp @@ -35,9 +35,8 @@ using namespace Windows::Phone::Graphics::Interop; using namespace Windows::Phone::Input::Interop; using namespace Windows::Graphics::Display; using namespace DirectX; -using namespace PhoneDirect3DXamlAppComponent; -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { Direct3DInterop::Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation) diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.h b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.h index 6324dca1e9..ff87c60ca3 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.h +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/Direct3DInterop.h @@ -34,7 +34,7 @@ THE SOFTWARE. #include -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { public delegate void RequestAdditionalFrameHandler(); diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.cpp b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.cpp index 992dfe2d60..8837b68be9 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.cpp +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.cpp @@ -26,9 +26,9 @@ THE SOFTWARE. using namespace Platform; -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { - EditBoxEvent::EditBoxEvent( Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler^ handle ): + EditBoxEvent::EditBoxEvent( Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler^ handle ): m_sender(sender), m_args(arg), m_handler(handle) diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.h b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.h index e9a7105baf..ddf206e034 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.h +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/src/EditBoxEvent.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include -namespace PhoneDirect3DXamlAppComponent +namespace cocos2d { class EditBoxEvent : public cocos2d::InputEvent { diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/LocalizedStrings.cs b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/LocalizedStrings.cs index a7c1f23777..4c0d4ba292 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/LocalizedStrings.cs +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/LocalizedStrings.cs @@ -1,6 +1,6 @@ -using PhoneDirect3DXamlAppInterop.Resources; +using cocos2d.Resources; -namespace PhoneDirect3DXamlAppInterop +namespace cocos2d { /// /// Provides access to string resources. diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/AssemblyInfo.cs b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/AssemblyInfo.cs index 1b6c5d6478..c5921e1749 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/AssemblyInfo.cs +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("PhoneDirect3DXamlAppInterop")] +[assembly: AssemblyTitle("cocos2d")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PhoneDirect3DXamlAppInterop")] +[assembly: AssemblyProduct("cocos2d")] [assembly: AssemblyCopyright("Copyright © 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml index e2147a3eeb..19fddcbe1d 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml @@ -1,30 +1,35 @@  - + Assets\ApplicationIcon.png - - - - - + + + + + - + - + Assets\Tiles\FlipCycleTileSmall.png 0 Assets\Tiles\FlipCycleTileMedium.png - PhoneDirect3DXamlAppInterop - - - - - + cpp-empty-test + + + + + + + + + + diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs index daa745fe09..efb4f0a46c 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace PhoneDirect3DXamlAppInterop.Resources { +namespace cocos2d.Resources { using System; @@ -39,7 +39,7 @@ namespace PhoneDirect3DXamlAppInterop.Resources { public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhoneDirect3DXamlAppInterop.Resources.AppResources", typeof(AppResources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cocos2d.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj index f744a086b5..c2d094717f 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj @@ -9,8 +9,8 @@ {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - PhoneDirect3DXamlAppInterop - PhoneDirect3DXamlAppInterop + cocos2d + cpp-empty-test WindowsPhone v8.0 $(TargetFrameworkVersion) @@ -19,9 +19,9 @@ true true - PhoneDirect3DXamlAppInterop_$(Configuration)_$(Platform).xap + cpp-empty-test_$(Configuration)_$(Platform).xap Properties\AppManifest.xml - PhoneDirect3DXamlAppInterop.App + cocos2d.App true 11.0 true diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-testComponent/cpp-empty-testComponent.vcxproj b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-testComponent/cpp-empty-testComponent.vcxproj index 17bf7f73e5..59257abbd7 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-testComponent/cpp-empty-testComponent.vcxproj +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-testComponent/cpp-empty-testComponent.vcxproj @@ -20,7 +20,7 @@ {f5d665f8-ae19-4f3f-99a7-230a1e8305d2} - PhoneDirect3DXamlAppComponent + cocos2d en-US 11.0 true diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml new file mode 100644 index 0000000000..c423584a2e --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml @@ -0,0 +1,13 @@ + + + + + HelloCpp + + + diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml.cpp b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml.cpp new file mode 100644 index 0000000000..f4365b88c5 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/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/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml.h b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/App.xaml.h new file mode 100644 index 0000000000..1309c610d7 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/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/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems new file mode 100644 index 0000000000..f5282cc2e7 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems @@ -0,0 +1,63 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + e956c24b-f04e-47bf-bf00-746681ae1301 + {a3ad93e4-0b2f-4c58-9181-69bed2e42e3e} + cocos2d + + + + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) + + + + + Designer + + + + + $(MSBuildThisFileDirectory)..\..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml + + + Create + + + + + $(MSBuildThisFileDirectory)App.xaml + + + + + $(MSBuildThisFileDirectory)..\..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml + + + + + + + $(MSBuildThisFileDirectory)App.xaml + + + + + + + + + + <_CustomResource Include="$(MSBuildThisFileDirectory)..\..\Resources\**\*"> + Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + true + + + + + + + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems.filters b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems.filters new file mode 100644 index 0000000000..b94069d87c --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Shared/HelloCpp.Shared.vcxitems.filters @@ -0,0 +1,43 @@ + + + + + + + Classes + + + Classes + + + + + + + + + + + + {38ad799c-8c3c-44a2-8e41-516c8f62f556} + + + + + Classes + + + Classes + + + Classes + + + + + + + + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/Logo.scale-100.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/Logo.scale-100.png new file mode 100644 index 0000000000..e26771cb33 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/Logo.scale-100.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/SmallLogo.scale-100.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000000..1eb0d9d528 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/SmallLogo.scale-100.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/SplashScreen.scale-100.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000000..d8ded7198a Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/SplashScreen.scale-100.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/StoreLogo.scale-100.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000000..dcb672712c Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Assets/StoreLogo.scale-100.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj new file mode 100644 index 0000000000..0e6958580e --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj @@ -0,0 +1,264 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + {79a8fcda-4b12-4dd1-b676-ff148d651638} + cocos2d + en-US + 12.0 + true + Windows Store + 8.1 + + + + Application + true + v120 + + + Application + true + v120 + + + Application + true + v120 + + + Application + false + true + v120 + + + Application + false + true + v120 + + + Application + false + true + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HelloCpp.Windows_TemporaryKey.pfx + True + x86 + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + echo "Copying Windows 8.1 Universal App CPP template files" +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + echo "Copying Windows 8.1 Universal App CPP template files" +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + echo "Copying Windows 8.1 Universal App CPP template files" +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + echo "Copying Windows 8.1 Universal App CPP template files" +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + echo "Copying Windows 8.1 Universal App CPP template files" +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + echo "Copying Windows 8.1 Universal App CPP template files" +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq +xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq + + + + + Designer + + + + + + + + + + + + {9335005f-678e-4e8e-9b84-50037216aec8} + + + {f3550fe0-c795-44f6-8feb-093eb68143ae} + + + {3b26a12d-3a44-47ea-82d2-282660fc844d} + + + + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj.filters b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj.filters new file mode 100644 index 0000000000..3cdafaeec0 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows.vcxproj.filters @@ -0,0 +1,29 @@ + + + + + {1a9fa652-867e-41d2-8588-962f108d2d8f} + bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png + + + + + + + + + + + Assets + + + Assets + + + Assets + + + Assets + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows_TemporaryKey.pfx b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows_TemporaryKey.pfx new file mode 100644 index 0000000000..5ad010651a Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/HelloCpp.Windows_TemporaryKey.pfx differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Package.appxmanifest b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Package.appxmanifest new file mode 100644 index 0000000000..6418109719 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.Windows/Package.appxmanifest @@ -0,0 +1,30 @@ + + + + + HelloCpp.Windows + dalestam + Assets\StoreLogo.png + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Logo.scale-240.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Logo.scale-240.png new file mode 100644 index 0000000000..76921ca997 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Logo.scale-240.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SmallLogo.scale-240.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SmallLogo.scale-240.png new file mode 100644 index 0000000000..316630124f Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SmallLogo.scale-240.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SplashScreen.scale-240.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SplashScreen.scale-240.png new file mode 100644 index 0000000000..b0b6bc08e5 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/SplashScreen.scale-240.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Square71x71Logo.scale-240.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Square71x71Logo.scale-240.png new file mode 100644 index 0000000000..cfa54bee03 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/Square71x71Logo.scale-240.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/StoreLogo.scale-240.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/StoreLogo.scale-240.png new file mode 100644 index 0000000000..47e084b593 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/StoreLogo.scale-240.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/WideLogo.scale-240.png b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/WideLogo.scale-240.png new file mode 100644 index 0000000000..6249d29db0 Binary files /dev/null and b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Assets/WideLogo.scale-240.png differ diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj new file mode 100644 index 0000000000..897cf401d5 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj @@ -0,0 +1,144 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Release + ARM + + + Release + Win32 + + + + {396fe85e-bb05-4b92-bccb-f89aed4ea41a} + cocos2d + en-US + 12.0 + true + Windows Phone + 8.1 + + + + Application + true + v120_wp81 + + + Application + true + v120_wp81 + + + Application + false + true + v120_wp81 + + + Application + false + true + v120_wp81 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + arm + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) + + + + + Designer + + + + + + + + + + + + + {22f3b9df-1209-4574-8331-003966f562bf} + + + {cc1da216-a80d-4be4-b309-acb6af313aff} + + + {22f798d8-bfff-4754-996f-a5395343d5ec} + + + + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj.filters b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj.filters new file mode 100644 index 0000000000..eb71f325ca --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/HelloCpp.WindowsPhone.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {c8beb60d-689b-4aaa-9749-99bd3e2dcf75} + bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Package.appxmanifest b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Package.appxmanifest new file mode 100644 index 0000000000..eb4bab30a4 --- /dev/null +++ b/tests/cpp-empty-test/proj.win8.1-universal/HelloCpp.WindowsPhone/Package.appxmanifest @@ -0,0 +1,33 @@ + + + + + + HelloCpp.WindowsPhone + dalestam + Assets\StoreLogo.png + + + 6.3.1 + 6.3.1 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index 1d07655c0a..6a6479a148 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -116,7 +116,7 @@ bool AppDelegate::applicationDidFinishLaunching() fileUtils->setSearchPaths(searchPaths); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) // a bug in DirectX 11 level9-x on the device prevents ResolutionPolicy::NO_BORDER from working correctly glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL); #else diff --git a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp index 65681042a1..c139d0c917 100644 --- a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -13,7 +13,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #define MUSIC_FILE "music.mid" -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #define MUSIC_FILE "background.wav" #elif (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX ) #define MUSIC_FILE "background.ogg" diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index d49c7897fd..e4d73f8725 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -44,7 +44,7 @@ g_guisTests[] = } }, #endif - #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) { "EditBox Test", [](Ref* sender) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index c00944cd14..967e3f1a81 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -25,7 +25,7 @@ #include "UIWebViewTest/UIWebViewTest.h" #endif #include "UIScale9SpriteTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #include "UIEditBoxTest.h" #endif @@ -45,7 +45,7 @@ static const char* s_testArray[] = "UIButtonIgnoreContentSizeTest", "UIButtonTitleEffectTest", -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) "UIEditBoxTest", #endif "UICheckBoxTest", @@ -412,7 +412,7 @@ Scene *UISceneManager::currentUIScene() return UIS9Flip::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIS9ChangeAnchorPoint: return UIS9ChangeAnchorPoint::sceneWithTitle(s_testArray[_currentUISceneId]); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) case kUIEditBoxTest: return UIEditBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); #endif diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index cc49fb4f40..66ab43958f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -41,7 +41,7 @@ enum kUIButtonTextOnly, kUIButtonIgnoreContentSizeTest, kUIButtonTitleEffectTest, -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) kUIEditBoxTest, #endif kUICheckBoxTest, diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 2a20d6a19d..afe5aa48ee 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -48,13 +48,8 @@ Controller g_aTestNames[] = { { "Chipmunk", []() { return new ChipmunkAccelTouchTestScene(); } }, { "Click and Move", [](){return new ClickAndMoveTestScene(); } }, { "Configuration", []() { return new ConfigurationTestScene(); } }, -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) { "Console", []() { return new ConsoleTestScene(); } }, - -#endif -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) { "Curl", []() { return new CurlTestScene(); } }, -#endif { "Current Language", []() { return new CurrentLanguageTestScene(); } }, { "EventDispatcher", []() { return new EventDispatcherTestScene(); } }, { "Effects - Advanced", []() { return new EffectAdvanceScene(); } }, diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml index e7d31aea9d..2da0ff79d0 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml @@ -1,8 +1,8 @@  diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.cpp b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.cpp index ecdc3bc361..f4365b88c5 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.cpp +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.cpp @@ -1,7 +1,7 @@ -#include "pch.h" +#include "App.xaml.h" #include "OpenGLESPage.xaml.h" -using namespace cpp_tests; +using namespace cocos2d; App::App() { diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.h b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.h index 135590b547..1309c610d7 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.h +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/App.xaml.h @@ -4,7 +4,7 @@ #include "OpenGLES.h" #include "openglespage.xaml.h" -namespace cpp_tests +namespace cocos2d { ref class App sealed { diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/HelloTriangleRenderer.cpp b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/HelloTriangleRenderer.cpp deleted file mode 100644 index 2e6700d0bc..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/HelloTriangleRenderer.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// Based on Hello_Triangle.c from -// Book: OpenGL(R) ES 2.0 Programming Guide -// Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner -// ISBN-10: 0321502795 -// ISBN-13: 9780321502797 -// Publisher: Addison-Wesley Professional -// URLs: http://safari.informit.com/9780321563835 -// http://www.opengles-book.com - -// -// This file is used by the template to render a basic scene using GL. -// - -#include "pch.h" -#include "HelloTriangleRenderer.h" - -// These are used by the shader compilation methods. -#include -#include -#include - -using namespace Platform; - -using namespace cpp_tests; - -#define STRING(s) #s - -GLuint CompileShader(GLenum type, const std::string &source) -{ - GLuint shader = glCreateShader(type); - - const char *sourceArray[1] = { source.c_str() }; - glShaderSource(shader, 1, sourceArray, NULL); - glCompileShader(shader); - - GLint compileResult; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compileResult); - - if (compileResult == 0) - { - GLint infoLogLength; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLength); - - std::vector infoLog(infoLogLength); - glGetShaderInfoLog(shader, (GLsizei)infoLog.size(), NULL, infoLog.data()); - - std::wstring errorMessage = std::wstring(L"Shader compilation failed: "); - errorMessage += std::wstring(infoLog.begin(), infoLog.end()); - - throw Exception::CreateException(E_FAIL, ref new Platform::String(errorMessage.c_str())); - } - - return shader; -} - -GLuint CompileProgram(const std::string &vsSource, const std::string &fsSource) -{ - GLuint program = glCreateProgram(); - - if (program == 0) - { - throw Exception::CreateException(E_FAIL, L"Program creation failed"); - } - - GLuint vs = CompileShader(GL_VERTEX_SHADER, vsSource); - GLuint fs = CompileShader(GL_FRAGMENT_SHADER, fsSource); - - if (vs == 0 || fs == 0) - { - glDeleteShader(fs); - glDeleteShader(vs); - glDeleteProgram(program); - return 0; - } - - glAttachShader(program, vs); - glDeleteShader(vs); - - glAttachShader(program, fs); - glDeleteShader(fs); - - glLinkProgram(program); - - GLint linkStatus; - glGetProgramiv(program, GL_LINK_STATUS, &linkStatus); - - if (linkStatus == 0) - { - GLint infoLogLength; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength); - - std::vector infoLog(infoLogLength); - glGetProgramInfoLog(program, (GLsizei)infoLog.size(), NULL, infoLog.data()); - - std::wstring errorMessage = std::wstring(L"Program link failed: "); - errorMessage += std::wstring(infoLog.begin(), infoLog.end()); - - throw Exception::CreateException(E_FAIL, ref new Platform::String(errorMessage.c_str())); - } - - return program; -} - -HelloTriangleRenderer::HelloTriangleRenderer() : - mProgram(0) -{ - // Vertex Shader source - const std::string vs = STRING - ( - attribute vec4 vPosition; - void main() - { - gl_Position = vPosition; - } - ); - - // Fragment Shader source - const std::string fs = STRING - ( - precision mediump float; - void main() - { - gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); - } - ); - - // CompileProgram will throw if it fails, so we don't need to check for success. - mProgram = CompileProgram(vs, fs); -} - -HelloTriangleRenderer::~HelloTriangleRenderer() -{ - if (mProgram != 0) - { - glDeleteProgram(mProgram); - mProgram = 0; - } -} - -// Draws a basic triangle -void HelloTriangleRenderer::Draw(GLsizei width, GLsizei height) -{ - glViewport(0, 0, width, height); - - GLfloat vertices[] = - { - 0.0f, 0.5f, 0.0f, - -0.5f, -0.5f, 0.0f, - 0.5f, -0.5f, 0.0f, - }; - - glClear(GL_COLOR_BUFFER_BIT); - - glUseProgram(mProgram); - - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vertices); - glEnableVertexAttribArray(0); - - glDrawArrays(GL_TRIANGLES, 0, 3); -} - diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/HelloTriangleRenderer.h b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/HelloTriangleRenderer.h deleted file mode 100644 index 410f5a2a54..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/HelloTriangleRenderer.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "pch.h" - -namespace cpp_tests -{ - class HelloTriangleRenderer - { - public: - HelloTriangleRenderer(); - ~HelloTriangleRenderer(); - void Draw(GLsizei width, GLsizei height); - - private: - GLuint mProgram; - }; -} \ No newline at end of file diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/OpenGLES.h b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/OpenGLES.h deleted file mode 100644 index 2190e23c57..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/OpenGLES.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -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(); - -private: - void Initialize(); - void Cleanup(); - -private: - EGLDisplay mEglDisplay; - EGLContext mEglContext; - EGLConfig mEglConfig; -}; diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems index 581da1b3de..3e22b9eb51 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems @@ -4,7 +4,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) true {be3a1791-5bce-4cea-92cd-0e2d86dde27a} - cpp_tests + cocos2d cpp-tests.Shared f6ae64be-127a-4f7d-ad15-53a0fddb7f41 @@ -14,6 +14,17 @@ + + Designer + + + + + $(MSBuildThisFileDirectory)..\..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml + + + Create + @@ -194,7 +205,15 @@ - + + $(MSBuildThisFileDirectory)App.xaml + + + + + $(MSBuildThisFileDirectory)..\..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml + + @@ -443,30 +462,26 @@ - - - - Create - - - - - $(MSBuildThisFileDirectory)App.xaml - - - $(MSBuildThisFileDirectory)App.xaml - - - - - Designer - - + + + + + <_CustomResource Include="$(MSBuildThisFileDirectory)..\..\Resources\**\*"> + Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + true + + + + + + + + \ No newline at end of file diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters index 46fafd09d3..af02131873 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters @@ -1,9 +1,8 @@  - + - - - + + Classes\ActionManagerTest @@ -16,9 +15,6 @@ Classes - - Classes - Classes @@ -748,11 +744,15 @@ Classes\ExtensionsTest\AssetsManagerExTest + + + + + + Classes\UITest\CocostudioGUISceneTest\UITextFieldTest + - - - Classes\ActionManagerTest @@ -1272,9 +1272,6 @@ Classes\UITest\CocostudioGUISceneTest\UITextFieldTest - - Classes\UITest\CocostudioGUISceneTest\UITextFieldTest - Classes\UITest\CocostudioGUISceneTest\UITextTest @@ -1293,16 +1290,14 @@ Classes\ExtensionsTest\AssetsManagerExTest + + + + - - - - - - {f391ec0c-7b86-4c69-a813-4408c0c29d10} @@ -1647,4 +1642,10 @@ {2c5dd382-6534-4369-b33c-6b18995e6576} + + + + + + \ No newline at end of file diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/pch.h b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/pch.h deleted file mode 100644 index 4bdade37c9..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/pch.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -// OpenGL ES includes -#include -#include - -// EGL includes -#include -#include -#include -#include - -#include "OpenGLES.h" -#include "HelloTriangleRenderer.h" -#include "App.xaml.h" - -#include "cocos2d.h" -#include "cocos-ext.h" \ No newline at end of file diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/logo.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/logo.png new file mode 100644 index 0000000000..e26771cb33 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/logo.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/smalllogo.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/smalllogo.png new file mode 100644 index 0000000000..1eb0d9d528 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/smalllogo.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/splashscreen.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/splashscreen.png new file mode 100644 index 0000000000..d8ded7198a Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/splashscreen.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/storelogo.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/storelogo.png new file mode 100644 index 0000000000..dcb672712c Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Assets/storelogo.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml deleted file mode 100644 index 47d2da5797..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml.h b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml.h deleted file mode 100644 index 3d9bd57996..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/OpenGLESPage.xaml.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include "OpenGLESPage.g.h" - -namespace cpp_tests -{ - public ref class OpenGLESPage sealed - { - public: - OpenGLESPage(); - virtual ~OpenGLESPage(); - - internal: - OpenGLESPage(OpenGLES* openGLES); - - private: - void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); - void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e); - void GetSwapChainPanelSize(GLsizei* width, GLsizei* height); - void CreateRenderSurface(); - void DestroyRenderSurface(); - void RecoverFromLostDevice(); - void StartRenderLoop(); - void StopRenderLoop(); - - OpenGLES* mOpenGLES; - - Windows::Foundation::Size mSwapChainPanelSize; - Concurrency::critical_section mSwapChainPanelSizeCriticalSection; - - Windows::Foundation::Size mCustomRenderSurfaceSize; - bool mUseCustomRenderSurfaceSize; - - EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page - Concurrency::critical_section mRenderSurfaceCriticalSection; - Windows::Foundation::IAsyncAction^ mRenderLoopWorker; - }; -} diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Package.appxmanifest b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Package.appxmanifest index c33b43b0d4..de82696e65 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Package.appxmanifest +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/Package.appxmanifest @@ -1,39 +1,32 @@  - - - - + + cpp-tests.Windows dalestam Assets\StoreLogo.png - 6.3.0 6.3.0 - - + - - - - - - + + + + + + + + + + + + + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj index df1b1bffab..7dc8e25af2 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj @@ -28,7 +28,7 @@ {f2bae06b-caae-43ee-b21b-57fa48db04fa} - cpp_tests + cocos2d en-US 12.0 true @@ -99,11 +99,13 @@ pch.h $(IntDir)pch.pch - ../../Classes;%(AdditionalIncludeDirectories) + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) /bigobj /Zm200 %(AdditionalOptions) 4453;28204;%(DisableSpecificWarnings) pch.h pch.h + CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -114,11 +116,13 @@ pch.h $(IntDir)pch.pch - ../../Classes;%(AdditionalIncludeDirectories) + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) /bigobj /Zm200 %(AdditionalOptions) 4453;28204;%(DisableSpecificWarnings) pch.h pch.h + CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -129,11 +133,13 @@ pch.h $(IntDir)pch.pch - ../../Classes;%(AdditionalIncludeDirectories) + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) /bigobj /Zm200 %(AdditionalOptions) 4453;28204;%(DisableSpecificWarnings) pch.h pch.h + CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -148,19 +154,6 @@ - - - - - - OpenGLESPage.xaml - - - - - OpenGLESPage.xaml - - {9335005f-678e-4e8e-9b84-50037216aec8} diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj.filters b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj.filters index 1605ce7930..c6285c8d61 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj.filters +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj.filters @@ -5,9 +5,6 @@ 3744285b-cd16-4f7f-b639-92c82877e0e1 bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png - - dll; - Assets @@ -21,19 +18,16 @@ Assets - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/logo.scale-240.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/logo.scale-240.png new file mode 100644 index 0000000000..76921ca997 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/logo.scale-240.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/smallLogo.scale-240.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/smallLogo.scale-240.png new file mode 100644 index 0000000000..316630124f Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/smallLogo.scale-240.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/splashscreen.scale-240.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/splashscreen.scale-240.png new file mode 100644 index 0000000000..b0b6bc08e5 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/splashscreen.scale-240.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/square71x71logo.scale-240.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/square71x71logo.scale-240.png new file mode 100644 index 0000000000..cfa54bee03 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/square71x71logo.scale-240.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/storeLogo.scale-240.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/storeLogo.scale-240.png new file mode 100644 index 0000000000..47e084b593 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/storeLogo.scale-240.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/wideLogo.scale-240.png b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/wideLogo.scale-240.png new file mode 100644 index 0000000000..6249d29db0 Binary files /dev/null and b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Assets/wideLogo.scale-240.png differ diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml deleted file mode 100644 index 47d2da5797..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml.h b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml.h deleted file mode 100644 index 3d9bd57996..0000000000 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/OpenGLESPage.xaml.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include "OpenGLESPage.g.h" - -namespace cpp_tests -{ - public ref class OpenGLESPage sealed - { - public: - OpenGLESPage(); - virtual ~OpenGLESPage(); - - internal: - OpenGLESPage(OpenGLES* openGLES); - - private: - void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); - void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e); - void GetSwapChainPanelSize(GLsizei* width, GLsizei* height); - void CreateRenderSurface(); - void DestroyRenderSurface(); - void RecoverFromLostDevice(); - void StartRenderLoop(); - void StopRenderLoop(); - - OpenGLES* mOpenGLES; - - Windows::Foundation::Size mSwapChainPanelSize; - Concurrency::critical_section mSwapChainPanelSizeCriticalSection; - - Windows::Foundation::Size mCustomRenderSurfaceSize; - bool mUseCustomRenderSurfaceSize; - - EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page - Concurrency::critical_section mRenderSurfaceCriticalSection; - Windows::Foundation::IAsyncAction^ mRenderLoopWorker; - }; -} diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Package.appxmanifest b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Package.appxmanifest index 3fa1ac495c..e819a6cfa1 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Package.appxmanifest +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/Package.appxmanifest @@ -1,42 +1,32 @@  - - - - - + + cpp-tests.WindowsPhone dalestam Assets\StoreLogo.png - 6.3.1 6.3.1 - - + - - - - - - - + + + + + + + + + + + + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj index 5485f28228..581f8bcb6b 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj @@ -20,7 +20,7 @@ {15247c71-5289-4913-b88f-e253cc353720} - cpp_tests + cocos2d en-US 12.0 true @@ -76,13 +76,17 @@ false - ../../Classes;%(AdditionalIncludeDirectories) + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) /Zm200 %(AdditionalOptions) /Zm200 %(AdditionalOptions) pch.h pch.h 4056;4996;%(DisableSpecificWarnings) 4056;4996;%(DisableSpecificWarnings) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + Use + Use @@ -92,13 +96,17 @@ false - ../../Classes;%(AdditionalIncludeDirectories) + ../../Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) /Zm200 %(AdditionalOptions) /Zm200 %(AdditionalOptions) pch.h pch.h 4056;4996;%(DisableSpecificWarnings) 4056;4996;%(DisableSpecificWarnings) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + Use + Use @@ -118,19 +126,6 @@ Designer - - - - - - OpenGLESPage.xaml - - - - - OpenGLESPage.xaml - - {22f3b9df-1209-4574-8331-003966f562bf} diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj.filters b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj.filters index a91455b91f..b978e2a74f 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj.filters +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj.filters @@ -5,18 +5,6 @@ $guid2$ bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png - - dll; - - - - - - - - - - diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/LocalizedStrings.cs b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/LocalizedStrings.cs index a7c1f23777..4c0d4ba292 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/LocalizedStrings.cs +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/LocalizedStrings.cs @@ -1,6 +1,6 @@ -using PhoneDirect3DXamlAppInterop.Resources; +using cocos2d.Resources; -namespace PhoneDirect3DXamlAppInterop +namespace cocos2d { /// /// Provides access to string resources. diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/AssemblyInfo.cs b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/AssemblyInfo.cs index 1b6c5d6478..c5921e1749 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/AssemblyInfo.cs +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("PhoneDirect3DXamlAppInterop")] +[assembly: AssemblyTitle("cocos2d")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PhoneDirect3DXamlAppInterop")] +[assembly: AssemblyProduct("cocos2d")] [assembly: AssemblyCopyright("Copyright © 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml index 33ee5c4b57..2c57048df9 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml @@ -1,7 +1,7 @@  - + Assets\ApplicationIcon.png @@ -11,10 +11,10 @@ - + - + Assets\Tiles\FlipCycleTileSmall.png 0 diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs index daa745fe09..997d9d472b 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs @@ -8,7 +8,8 @@ // //------------------------------------------------------------------------------ -namespace PhoneDirect3DXamlAppInterop.Resources { +namespace cocos2d.Resources +{ using System; @@ -39,7 +40,7 @@ namespace PhoneDirect3DXamlAppInterop.Resources { public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhoneDirect3DXamlAppInterop.Resources.AppResources", typeof(AppResources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cocos2d.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj index 203e3e5187..9cd3486c02 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj @@ -9,8 +9,8 @@ {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - PhoneDirect3DXamlAppInterop - PhoneDirect3DXamlAppInterop + cocos2d + cpp-tests WindowsPhone v8.0 $(TargetFrameworkVersion) @@ -19,9 +19,9 @@ true true - PhoneDirect3DXamlAppInterop_$(Configuration)_$(Platform).xap + cpp-tests_$(Configuration)_$(Platform).xap Properties\AppManifest.xml - PhoneDirect3DXamlAppInterop.App + cocos2d.App true 11.0 true diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index d7cd694fdf..112cdec6b3 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -20,7 +20,7 @@ {86b2c23c-3a6c-4c4e-ab0e-16a8cc1523e9} - PhoneDirect3DXamlAppComponent + cocos2d en-US 11.0 true