92
CHANGELOG
|
@ -1,3 +1,95 @@
|
|||
cocos2d-x-3.16 Oct.9 2017
|
||||
[NEW] Add RadialGradientLayer
|
||||
[NEW] Web: Add GLProgramState and upgrade web shader usage APIs
|
||||
|
||||
[REFINE] 3rd: use prebuilt bullet
|
||||
[REFINE] CameraBackgroundBrush: use VAO/VBO to improve performance
|
||||
[REFINE] Color4F: add arithmentic operators
|
||||
[REFINE] LayerMultiplex: add `LayerMultiplex::switch(int, bool)` to not clean up previous layer after switching to a new layer
|
||||
[REFINE] ListView: add padding options
|
||||
[REFINE] FileUtils: add more async functions
|
||||
[REFINE] ImageView: add `ImageView::setBlendFunc()` to change blend function
|
||||
[REFINE] PageView: allow customizing opacity of indicator nodes
|
||||
[REFINE] ParticleSystem: add `ParticleSystem::setSourcePositionCompatible(bool)` to set source position instead of position
|
||||
[REFINE] RichText: image tag supports sprite frame
|
||||
[REFINE] RichText: support horizontal alignment
|
||||
[REFINE] ScrollView: add `ScrollView::setSwallowTouches(bool)`
|
||||
[REFINE] ScrollView: dispatch more useful events and add more getters
|
||||
[REFINE] Spine: support ETC1
|
||||
[REFINE] WebView: can set opacity
|
||||
[REFINE] Android: update to support Android Studio 2.3.3
|
||||
[REFINE] Android: add `Cocos2dxActivity.setEnableVirtualButton(boolean)` to control whether the hide virtual button or not
|
||||
[REFINE] iOS: more stable delta time between frames
|
||||
[REFINE] Engine: fix many warning issues
|
||||
[REFINE] Engine: exclude fps image in release mode
|
||||
[REFINE] Engine: add function for calculating md5 hash from Data
|
||||
[REFINE] Windows 10 metro mode, Windows Phone and Tizen are not supported
|
||||
[REFINE] Web: Text wrapping supports more languages
|
||||
[REFINE] Web: upgrade Spine to v3.5.35 and support Spine skeleton batching
|
||||
[REFINE] Web: improve Editbox user experience
|
||||
[REFINE] Web: improve screen adaptation for games inside iframe
|
||||
[REFINE] Web: use imagePool to reduce image cache memory usage in WebGL mode
|
||||
[REFINE] Web: ParticleSystem: Mark changeColor only if needed
|
||||
[REFINE] Web: use default scheduler to control action manager
|
||||
[REFINE] Web: remove accelerometer event listener by default
|
||||
[REFINE] Web: use arraybuffer responseType in BinaryLoader
|
||||
|
||||
[FIX] Application: openURL() can not open URLs that have `&` character on linux
|
||||
[FIX] Audio: may crash if play, stop frequently on Mac/Android
|
||||
[FIX] Audio: may crash if switch to background with effect playing and switch to foreground again on Android
|
||||
[FIX] Audio: may freeze app on iOS/Mac
|
||||
[FIX] Audio: may crash if have multiple audio tracks running at the same time and frequently call `_play2d(AudioCache *cache, int audioID)` on iOS/Mac
|
||||
[FIX] Audio: can not mute audio while a ring or a call is comming on Android
|
||||
[FIX] Audio: audio loops get evently cut
|
||||
[FIX] Button: scale9 effect may wrong
|
||||
[FIX] Director: will dispatch `EVENT_BEFORE_DRAW` before drawing a frame
|
||||
[FIX] Downloader: task may be suspend and not been executed on Android
|
||||
[FIX] Downloader: may crash if downloading large file on iOS/Mac
|
||||
[FIX] EditBox: may not show cursor and input text on Android
|
||||
[FIX] EditBox: may not show any character when type on keyboard on Android
|
||||
[FIX] EditBox: fix spacing and alignment on Windows
|
||||
[FIX] EditBox: text is larger and mis-aligned on Android
|
||||
[FIX] EventDispatcher: `pauseEventListenersForTarget()` can not work correctly if invoked in event callback
|
||||
[FIX] FileUtils: `listFiles` and `listFilesRecursively` can not work correctly if the path include unicode charater on Windows
|
||||
[FIX] FileUtils: getFileSize() always return -1 on Android
|
||||
[FIX] FontAtlas: may cause crash when back from background on Android
|
||||
[FIX] FontAtlas: memory leak in `FontAtlas::prepareLetterDefinitions()`
|
||||
[FIX] HttpClient: may cause crash if used in non network environment on Android
|
||||
[FIX] ImageView: scale9 effect may wrong
|
||||
[FIX] Label: line height is reset when call `FontAtlasCache::purgeCachedData()`
|
||||
[FIX] Label: memory leak in `Label::setFontAtlas()`
|
||||
[FIX] Label: wrong effect of shrink overflow clamp on iOS
|
||||
[FIX] Physics: crash if calling `PhysicsWorld::setDebugDrawMask(false)` right after `Scene::initWithPhysics()`
|
||||
[FIX] Scheduler: can not work correctly if reschedule with same key in callback
|
||||
[FIX] Sprite: `Sprite::setTexture()` will reset program state
|
||||
[FIX] Studio: revert Studio reader and flatbuffer
|
||||
[FIX] TextField: crash when text exceeds content with enabled cursor
|
||||
[FIX] Transition: TransitionCrossFade is darker than it should
|
||||
[FIX] Widget: wrong layout in scaled widget
|
||||
[FIX] Android: app will crash at the first time launching by clicking app icon
|
||||
[FIX] Android: compiling error built with Android Studio for x86
|
||||
[FIX] Android: can not creat EGL context if the device doesn't support 24bit depth buffer
|
||||
[FIX] Android: may stop response to touch event
|
||||
[FIX] Android: can not use previous OBB file when APK version changed
|
||||
[FIX] iOS: can not use cocos console compile and run in release mode on iOS with Xcode 8.3+
|
||||
[FIX] iOS: FileUtils will cause compiling error on iOS 11
|
||||
[FIX] Desktop: `GLViewImpl::getMonitorSize()` may return zero
|
||||
[FIX] Apple: may crash if there are more than 10 touches
|
||||
[FIX] JSB: add chipmunk binding for `cpSpace::segmentQuery()`
|
||||
[FIX] JSB: XMLHTTPRequest memory leak if CC_ENABLE_GC_FOR_NATIVE_OBJECTS is enabled
|
||||
[FIX] JSB: WebView doesn't support https
|
||||
[FIX] Lua: export `cocos2d::utils::findChild()`
|
||||
[FIX] Lua: LuaObjcBridge return wrong type when return type is bool
|
||||
[FIX] Lua: will crash if lua file is encrypted and it has BOM header
|
||||
[FIX] Lua: iskindof() return wrong result
|
||||
[FIX] Lua: crash if run on iOS simulator with Xcode 8.0+
|
||||
[FIX] Web: memory leak in action manager
|
||||
[FIX] Web: local resources loading failed
|
||||
[FIX] Web: infinite call stack in ArmatureWebGLRenderCmd
|
||||
[FIX] Web: label stroke effect
|
||||
[FIX] Web: ProgressTimer vertex is not updated when changing transform
|
||||
[FIX] Web: DrawNode canvas displayedOpacity rendering
|
||||
|
||||
cocos2d-x-3.15.1 May.27 2017
|
||||
|
||||
[REFINE] Add optimization codes for huawei devices
|
||||
|
|
57
README.md
|
@ -4,14 +4,14 @@
|
|||
cocos2d-x
|
||||
=========
|
||||
|
||||
| |iOS|Mac|Linux|Win32|Android|Tizen|
|
||||
| ----|----|----- | ---|----|------|---|
|
||||
|v3|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=ios)](http://45.56.80.45:8080/job/daily-build-v3/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=mac)](http://45.56.80.45:8080/job/daily-build-v3/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=linux)](http://45.56.80.45:8080/job/daily-build-v3/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=win32_bak)](http://45.56.80.45:8080/job/daily-build-v3/node=win32_bak)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=android)](http://45.56.80.45:8080/job/daily-build-v3/node=android)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=tizen-daily-build/node=tizen_mac)](http://45.56.80.45:8080/job/tizen-daily-build/node=tizen_mac/)|
|
||||
| |iOS|Mac|Linux|Win32|Android|
|
||||
| ----|----|----- | ---|----|------|
|
||||
|v3|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=ios)](http://45.56.80.45:8080/job/daily-build-v3/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=mac)](http://45.56.80.45:8080/job/daily-build-v3/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=linux)](http://45.56.80.45:8080/job/daily-build-v3/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=win32_bak)](http://45.56.80.45:8080/job/daily-build-v3/node=win32_bak)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=android)](http://45.56.80.45:8080/job/daily-build-v3/node=android)
|
||||
|
||||
|
||||
[cocos2d-x][1] is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications.
|
||||
It is based on [cocos2d-iphone][2], but instead of using Objective-C, it uses C++.
|
||||
It works on iOS, Android, Tizen, Windows Phone and Store Apps, OS X, Windows, Linux and Web platforms.
|
||||
It works on iOS, Android, OS X, Windows, Linux and Web platforms.
|
||||
|
||||
**Cocos2d-x Framework Architecture**:
|
||||
|
||||
|
@ -75,17 +75,6 @@ You can also create a JS project or Lua project with `-l js` or `-l lua`.
|
|||
|
||||
$ cocos run -p mac
|
||||
|
||||
### Build and run a new project for Tizen ###
|
||||
|
||||
There are two ways to build and run Tizen project:
|
||||
|
||||
* use cocos console(can not work on 32-bit Windows currently)
|
||||
```
|
||||
cocos run -p tizen
|
||||
```
|
||||
* use Tizen IDE, can refer to [this doc](http://cocos2d-x.org/docs/installation/Tizen/index.html ) for detail usage
|
||||
|
||||
|
||||
### Build and run a new project for Linux ###
|
||||
|
||||
If you never run cocos2d-x on Linux, you need to install all dependencies by the
|
||||
|
@ -107,20 +96,6 @@ Run
|
|||
|
||||
$ cocos run -p win32
|
||||
|
||||
### Build and run new project for Windows 8.1/10.0 and Windows Phone 8.1/10.0 ###
|
||||
|
||||
$ cocos new MyGame -p com.your_company.mygame -l cpp -d projects
|
||||
|
||||
* Visual Studio 2013 Update 4 or later is required for Windows 8.1 Universal Apps
|
||||
|
||||
* Visual Studio 2015 (Release version) and Windows 10.0 (Release version) are required for Windows 10.0 Universal Windows Platform (UWP) Apps. RC versions of Visual Studio and Windows 10 are no longer supported.
|
||||
|
||||
Starting with Cocos2d-x v3.3, you can create Windows 8.1 Universal Apps (Windows Store and Windows Phone 8.1).
|
||||
Starting with Cocos2d-x v3.8 you can create Windows 10.0 UWP Apps (Windows Store and Windows Phone 10.0).
|
||||
Starting with Cocos2d-x v3.6 there will no longer be support for Windows Phone 8.0.
|
||||
|
||||
See more info on how to install and create games on Windows RT (Windows and Windows Phone 8.1) at http://msopentech.github.io/cocos2d-x/
|
||||
|
||||
### Build and run new project for web ###
|
||||
|
||||
Only JS project can be published to web platforms, so you will need to create a JS project first:
|
||||
|
@ -182,18 +157,14 @@ Build Requirements
|
|||
* or Ubuntu 12.10+, CMake 2.6+
|
||||
* or Windows 7+, VS 2013+
|
||||
* Python 2.7.5
|
||||
* NDK r11+ is required to build Android games
|
||||
* Android Studio 2.3+ to build Android games
|
||||
* Tizen SDK 2.3+ is required to build Tizen games
|
||||
* Windows Phone/Store 10.0 VS 2015
|
||||
* NDK r11+ is required to build Android games(tested with r14)
|
||||
* Android Studio 2.3.3+ to build Android games(tested with 2.3.3)
|
||||
* JRE or JDK 1.6+ is required for web publishing
|
||||
|
||||
Runtime Requirements
|
||||
--------------------
|
||||
* iOS 7.0+ for iPhone / iPad games
|
||||
* Android 2.3.3+ for Android games
|
||||
* Tizen 2.3+ or 2.4+ for Tizen games
|
||||
* Windows 10.0 for Windows Phone/Store 10.0 games
|
||||
* iOS 6.0+ for iPhone / iPad games
|
||||
* Android 2.3.3+ for Android
|
||||
* OS X v10.9+ for Mac games
|
||||
* Windows 7+ for Win games
|
||||
* Modern browsers and IE 9+ for web games
|
||||
|
@ -249,23 +220,15 @@ $ bin/lua-empty-test/lua-empty-test
|
|||
|
||||
Open the `cocos2d-x/build/cocos2d-win32.sln`
|
||||
|
||||
* For Windows 10.0 Universal Windows Platform (UWP) Apps (Phone and Store)
|
||||
|
||||
Open the `cocos2d-x/build/cocos2d-win10.sln`
|
||||
|
||||
* For Android
|
||||
|
||||
```
|
||||
$ cd cocos2d-x/build
|
||||
$ python ./android-build.py cpp-empty-test -p 13
|
||||
$ python ./android-build.py cpp-empty-test -p 14
|
||||
$ adb install ../tests/cpp-empty-test/proj.android/bin/CppEmptyTest-debug.apk
|
||||
```
|
||||
|
||||
Then click item on Android device to run tests. Available value of `-p` is the API level, cocos2d-x supports from level 13.
|
||||
|
||||
* For Tizen
|
||||
|
||||
Please refer to this [guide](http://cocos2d-x.org/docs/installation/Tizen/index.html ).
|
||||
Then click item on Android device to run tests. Available value of `-p` is the API level, cocos2d-x supports from level 14.
|
||||
|
||||
Learning Resources
|
||||
--------------------------------
|
||||
|
|
|
@ -1,138 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.22823.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{17093B03-00CA-402F-981A-D8C84B2922B5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win10\libSpine.vcxproj", "{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj-win10\libbox2d.vcxproj", "{0C32D479-46D5-46C3-9AA9-0A8FF8320516}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\libcocos2d_win10\libcocos2d.vcxproj", "{07C2895D-720C-487D-B7B4-12C293EA533F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\cpp-empty-test\proj.win10\cpp-empty-test.vcxproj", "{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win10\cpp-tests.vcxproj", "{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet", "..\external\bullet\proj.win10\libbullet.vcxproj", "{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librecast", "..\external\recast\proj.win10\librecast.vcxproj", "{F551524D-8A70-4B2F-A7C2-28AE61150022}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x64.Build.0 = Debug|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x86.Build.0 = Debug|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|ARM.Build.0 = Release|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x64.ActiveCfg = Release|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x64.Build.0 = Release|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x86.ActiveCfg = Release|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x86.Build.0 = Release|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x64.Build.0 = Debug|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x86.Build.0 = Debug|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|ARM.Build.0 = Release|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x64.ActiveCfg = Release|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x64.Build.0 = Release|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x86.ActiveCfg = Release|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x86.Build.0 = Release|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x64.Build.0 = Debug|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|ARM.Build.0 = Release|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x64.ActiveCfg = Release|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x64.Build.0 = Release|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x86.Build.0 = Release|Win32
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x86.Build.0 = Debug|Win32
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|ARM.Build.0 = Release|ARM
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x64.Build.0 = Release|x64
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x64.Deploy.0 = Release|x64
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x86.ActiveCfg = Release|Win32
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x86.Build.0 = Release|Win32
|
||||
{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x86.Deploy.0 = Release|Win32
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x86.Build.0 = Debug|Win32
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|ARM.Build.0 = Release|ARM
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x64.Build.0 = Release|x64
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x64.Deploy.0 = Release|x64
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x86.ActiveCfg = Release|Win32
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x86.Build.0 = Release|Win32
|
||||
{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x86.Deploy.0 = Release|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x64.Build.0 = Debug|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x86.Build.0 = Debug|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|ARM.Build.0 = Release|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x64.ActiveCfg = Release|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x64.Build.0 = Release|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x86.ActiveCfg = Release|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x86.Build.0 = Release|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x64.Build.0 = Debug|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x86.Build.0 = Debug|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|ARM.Build.0 = Release|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x64.ActiveCfg = Release|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x64.Build.0 = Release|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x86.ActiveCfg = Release|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8} = {17093B03-00CA-402F-981A-D8C84B2922B5}
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516} = {17093B03-00CA-402F-981A-D8C84B2922B5}
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893} = {17093B03-00CA-402F-981A-D8C84B2922B5}
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022} = {17093B03-00CA-402F-981A-D8C84B2922B5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -2,21 +2,100 @@
|
|||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
|
||||
- [Cocos2d-x 3.15.1 Release Notes](#cocos2d-x-3151-release-notes)
|
||||
- [Cocos2d-x 3.16 Release Notes](#cocos2d-x-316-release-notes)
|
||||
- [Misc Information](#misc-information)
|
||||
- [v3.15.1](#v3151)
|
||||
- [v3.16](#v316)
|
||||
- [Highlights](#highlights)
|
||||
- [Highlights in detail](#highlights-in-detail)
|
||||
- [Better support [`creator_to_cocos2dx`][1]](#better-support-creator_to_cocos2dx1)
|
||||
- [LayerRaidalGradient](#layerraidalgradient)
|
||||
- [Lua app crashed on iOS simulator with Xcode 8.0+](#lua-app-crashed-on-ios-simulator-with-xcode-80)
|
||||
- [Cocos Studio](#cocos-studio)
|
||||
- [Improve compiling speed](#improve-compiling-speed)
|
||||
- [Remove some platforms support](#remove-some-platforms-support)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# Cocos2d-x 3.15.1 Release Notes #
|
||||
# Cocos2d-x 3.16 Release Notes #
|
||||
|
||||
# Misc Information
|
||||
|
||||
* [Full Changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)
|
||||
|
||||
# v3.15.1
|
||||
# v3.16
|
||||
|
||||
Android tool version tested in this version:
|
||||
|
||||
- Android Studio 2.3.3
|
||||
- NDK r14
|
||||
|
||||
## Highlights
|
||||
|
||||
* add optimization codes for Huawei devices
|
||||
- better support [`creator_to_cocos2dx`][1] creator plugin
|
||||
- add __LayerRadiaGradientLayer__
|
||||
- update to support Android Studio 2.3.3
|
||||
- fix the issue that lua projects will crash on iOS simulator with Xcode 8.0+
|
||||
- revert CocosStudio reader and flatbuffer
|
||||
- fix compling error with iOS 11
|
||||
- use prebuit bullet to improve compiling speed
|
||||
- remove supporting of Windows 10 metro, Windows Phones and Tizen
|
||||
- update to Spine v3.5.35 and support skeleton batching in web engine
|
||||
|
||||
## Highlights in detail
|
||||
|
||||
### Better support [`creator_to_cocos2dx`][1]
|
||||
|
||||
[`creator_to_cocos2dx`][1] is a [Cocos Creator][2] plugin that will export Scene information created by [Cocos Creator][2] for cocos2d-x C++/Lua projects. We mention it as __plugin__ following.
|
||||
|
||||
With this plugin, you can use [Cocos Creator][2] as Scene editor for cocos2d-x. Curretly, the plugin supports [these features](3), and will continue to add more features. As you can see, RichText img tag support only works in cocos2d-x v3.16+ because of cocos2d-x's limitation. So cocos2d-x will continue to be improved to support more [Cocos Creator][2] features.
|
||||
|
||||
More detail information and usage please refer to plugin's [the README][1]. You are appreciated if you can use it and give feedback.
|
||||
|
||||
![][4]
|
||||
__Scene effect in cocos creator__
|
||||
|
||||
![][5]
|
||||
__Scene effect in cocos2d-x__
|
||||
|
||||
### LayerRaidalGradient
|
||||
|
||||
LayerRadialGradient is similar to LayerColor, but will only draw color in a circle.
|
||||
|
||||
![][6]
|
||||
|
||||
### Lua app crashed on iOS simulator with Xcode 8.0+
|
||||
|
||||
After updating to Xcode 8.0+, lua projects will crash on iOS simulator. It is a bug of luagit. In this version, the bug it is fixed. You can just update [luajit][7] if you don't want to update cocos2d-x.
|
||||
|
||||
### Fix compiling error with iOS 11
|
||||
|
||||
Before cocos2d-x v3.16, `CCFileUtils` uses `system()` to remove a directory. iOS 11 remove `system`, so will cause compiling error with iOS 11. This version fixes this issue. The corresponding PR for this issue is [here](https://github.com/cocos2d/cocos2d-x/pull/17921), you can apply this PR to fix it if you don't want to upgrade to v3.16.
|
||||
|
||||
### Cocos Studio
|
||||
|
||||
coocs2d-x v3.15 updates flatbuffer, which breaks compatibility of Cocos Studio. In this version, we revert flatbuffer and Cocos Studio reader.
|
||||
|
||||
If you don't want to update cocos2d-x, you can replace flatbuffer and Cocos Studio reader shift in this version.
|
||||
|
||||
### Improve compiling speed
|
||||
|
||||
As bullet is not needed for most developers, so we use prebuilt bullet. It will speed up compiling speed, and we will continue to use more prebuilt 3rd party libraries, such as 3d particles, Box2D and so on to speed up compiling speed.
|
||||
|
||||
We also fix many warnings too in this version. As some warnings are imported by 3rd party libaries, so we can not treat warnings as error, but we will continue to achieve it.
|
||||
|
||||
### Remove some platforms support
|
||||
|
||||
As we are lack of human resources, so we remove some platforms.
|
||||
|
||||
MS maintians Win10 related platform, but it doesn't continue to maintain it. So we remove it. Which means cocos2d-x based games can not run on Win10 metro mode and Windows Phones, but you can run it in Win32 mode.
|
||||
|
||||
Tizen platform is removed too because of huaman resources.
|
||||
|
||||
|
||||
[1]: https://github.com/cocos2d/creator_to_cocos2dx
|
||||
[2]: http://cocos2d-x.org/creator
|
||||
[3]: https://github.com/cocos2d/creator_to_cocos2dx#limitations
|
||||
[4]: https://raw.githubusercontent.com/minggo/Pictures/master/creator-ui-effect.png
|
||||
[5]: https://raw.githubusercontent.com/minggo/Pictures/master/cocos2dx-ui-effect.png
|
||||
[6]: https://raw.githubusercontent.com/minggo/Pictures/master/layerradialgradient.png
|
||||
[7]: https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/tree/v3/lua/luajit/prebuilt/ios "luajit.a"
|
||||
|
|
|
@ -2,13 +2,101 @@
|
|||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
|
||||
- [v3.15.1](#v3151)
|
||||
- [新特性](#%E6%96%B0%E7%89%B9%E6%80%A7)
|
||||
- [Cocos2d-x 3.16 Release Notes](#cocos2d-x-316-release-notes)
|
||||
- [改动列表](#%E6%94%B9%E5%8A%A8%E5%88%97%E8%A1%A8)
|
||||
- [v3.16](#v316)
|
||||
- [特性](#%E7%89%B9%E6%80%A7)
|
||||
- [特性介绍](#%E7%89%B9%E6%80%A7%E4%BB%8B%E7%BB%8D)
|
||||
- [更好地支持 [`creator_to_cocos2dx`][1]](#%E6%9B%B4%E5%A5%BD%E5%9C%B0%E6%94%AF%E6%8C%81-creator_to_cocos2dx1)
|
||||
- [LayerRaidalGradient](#layerraidalgradient)
|
||||
- [Lua工程在Xcode 8.0+模拟器崩溃问题](#lua%E5%B7%A5%E7%A8%8B%E5%9C%A8xcode-80%E6%A8%A1%E6%8B%9F%E5%99%A8%E5%B4%A9%E6%BA%83%E9%97%AE%E9%A2%98)
|
||||
- [修复iOS 11编译错误](#%E4%BF%AE%E5%A4%8Dios-11%E7%BC%96%E8%AF%91%E9%94%99%E8%AF%AF)
|
||||
- [Cocos Studio](#cocos-studio)
|
||||
- [提高编译速度](#%E6%8F%90%E9%AB%98%E7%BC%96%E8%AF%91%E9%80%9F%E5%BA%A6)
|
||||
- [去除支持一些平台](#%E5%8E%BB%E9%99%A4%E6%94%AF%E6%8C%81%E4%B8%80%E4%BA%9B%E5%B9%B3%E5%8F%B0)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# v3.15.1
|
||||
# Cocos2d-x 3.16 Release Notes #
|
||||
|
||||
## 新特性
|
||||
# 改动列表
|
||||
|
||||
* 增加了针对华为设备的优化代码
|
||||
* [Full Changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)
|
||||
|
||||
# v3.16
|
||||
|
||||
该版本使用如下的Android工具链进行测试:
|
||||
|
||||
- Android Studio 2.3.3
|
||||
- NDK r14
|
||||
|
||||
## 特性
|
||||
|
||||
- 更好地支持 [`creator_to_cocos2dx`][1] 这个Cocos Creator的插件
|
||||
- 新增 __LayerRadiaGradientLayer__
|
||||
- 支持__Android Studio 2.3.3__
|
||||
- 修复lua工程在Xcode 8.0+模拟器崩溃问题
|
||||
- 回退CocosStudio的reader和flatbuffer
|
||||
- 修复iOS 11编译错误
|
||||
- 使用bullet的预编译库以加快编译速度
|
||||
- 去除Windows 10 metor模式、Windows Phone和Tizen的支持
|
||||
- Web引擎更新Spine runtime到v3.5.35
|
||||
|
||||
## 特性介绍
|
||||
|
||||
### 更好地支持 [`creator_to_cocos2dx`][1]
|
||||
|
||||
[`creator_to_cocos2dx`][1]是一个[Cocos Creator][2]的插件。该插件用于导出Creator创建的场景内容给cocos2d-x的C++/Lua工程使用。下文的__插件__就是指这个插件。
|
||||
|
||||
通过使用该插件,可以把[Cocos Creator][2]当成cocos2d-x的场景编辑器。该插件目前支持[这些特性](3),会持续支持其他新的特性。有些特性只在v3.16+版本支持,比如RichText img标签。
|
||||
|
||||
插件的详细使用方法可以参考插件仓库的[the READE][1],欢迎使用并给与反馈。
|
||||
|
||||
![][4]
|
||||
__Scene effect in cocos creator__
|
||||
|
||||
![][5]
|
||||
__Scene effect in cocos2d-x__
|
||||
|
||||
### LayerRaidalGradient
|
||||
|
||||
LayerRadialGradien和LayerColor类似,它会在制定的圆里绘制颜色,效果如下:
|
||||
|
||||
![][6]
|
||||
|
||||
### Lua工程在Xcode 8.0+模拟器崩溃问题
|
||||
|
||||
v3.16版本之前,Lua工程在Xcode 8.0+模拟器会崩溃。这是luajit本身的一个bug,v3.16版本修复了这个问题。如果不想更新引擎,也可以直接更新[luajit][7]。
|
||||
|
||||
### 修复iOS 11编译错误
|
||||
|
||||
v3.16版本之前,`CCFileUtils`使用`system()`函数来删除目录。iOS 11删除了`system`,因此导致了编译错误。改版本修复了这个问题。对应的PR链接在[这里](https://github.com/cocos2d/cocos2d-x/pull/17921),如果不想更新引擎的话,可以参考该PR的改动合并以修复这个问题。
|
||||
|
||||
### Cocos Studio
|
||||
|
||||
v3.15更新了flatbuffer,破坏了Cocos Studio reader的兼容性。该版本回退了flatbuffer和Cocos Studio的reader。
|
||||
|
||||
如果不想更新引擎的话,可以手动从改版本或者v3.15之前的版本拷贝flatbuffer和Cocos Studio的reader。
|
||||
|
||||
### 提高编译速度
|
||||
|
||||
大部分的项目不需要bullet,因此这个版本使用bullet的预编译库以加快编译速度。后续还会继续使用更多预编译库,比如Box2D,3D粒子系统等以加快编译速度。
|
||||
|
||||
该版本同时修复了大量的warning,后续版本也会持续修复warning。
|
||||
|
||||
### 去除支持一些平台
|
||||
|
||||
由于人力资源问题,改版本删除了一些平台的支持。
|
||||
|
||||
Windows 10的metro模式和Windows Phone平台一直是微软的员工在负责维护了,但是他们决定不再继续维护了,而我们人力资源不足,因此去除支持这两个平台。不过在Windows 10仍然可以使用Win32工程。
|
||||
|
||||
同样由于人力资源问题,该版本去除了Tizen平台的支持。
|
||||
|
||||
|
||||
[1]: https://github.com/cocos2d/creator_to_cocos2dx
|
||||
[2]: http://cocos2d-x.org/creator
|
||||
[3]: https://github.com/cocos2d/creator_to_cocos2dx#limitations
|
||||
[4]: https://raw.githubusercontent.com/minggo/Pictures/master/creator-ui-effect.png
|
||||
[5]: https://raw.githubusercontent.com/minggo/Pictures/master/cocos2dx-ui-effect.png
|
||||
[6]: https://raw.githubusercontent.com/minggo/Pictures/master/layerradialgradient.png
|
||||
[7]: https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/tree/v3/lua/luajit/prebuilt/ios "luajit.a"
|
|
@ -8,7 +8,6 @@
|
|||
"README.cmake",
|
||||
"README.md",
|
||||
"build/android-build.py",
|
||||
"build/cocos2d-win10.sln",
|
||||
"build/cocos2d-win32.sln",
|
||||
"build/cocos2d_libs.xcodeproj/project.pbxproj",
|
||||
"build/cocos2d_tests.xcodeproj/project.pbxproj",
|
||||
|
|
|
@ -11,12 +11,7 @@
|
|||
"proj.win32/PROJECT_NAME.vcxproj.filters",
|
||||
"proj.win32/PROJECT_NAME.vcxproj.user",
|
||||
"proj.win32/PROJECT_NAME.sln",
|
||||
"proj.ios_mac/PROJECT_NAME.xcodeproj",
|
||||
"proj.win10/PROJECT_NAME.sln",
|
||||
"proj.win10/App/PROJECT_NAME.vcxproj",
|
||||
"proj.win10/App/PROJECT_NAME.vcxproj.filters",
|
||||
"proj.win10/App/PROJECT_NAME_TemporaryKey.pfx",
|
||||
"proj.tizen/shared/res/PROJECT_NAME.png"
|
||||
"proj.ios_mac/PROJECT_NAME.xcodeproj"
|
||||
]
|
||||
},
|
||||
"project_replace_project_name":{
|
||||
|
@ -38,13 +33,7 @@
|
|||
"proj.ios_mac/ios/main.m",
|
||||
"proj.ios_mac/ios/Prefix.pch",
|
||||
"proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj",
|
||||
"proj.win10/PROJECT_NAME.sln",
|
||||
"proj.win10/App/PROJECT_NAME.vcxproj",
|
||||
"proj.win10/App/PROJECT_NAME.vcxproj.filters",
|
||||
"proj.win10/App/Package.appxmanifest",
|
||||
"CMakeLists.txt",
|
||||
"proj.tizen/.project",
|
||||
"proj.tizen/tizen-manifest.xml"
|
||||
"CMakeLists.txt"
|
||||
]
|
||||
},
|
||||
"project_replace_package_name":{
|
||||
|
@ -52,8 +41,7 @@
|
|||
"files":[
|
||||
"proj.android/AndroidManifest.xml",
|
||||
"proj.android-studio/app/build.gradle",
|
||||
"proj.android-studio/app/AndroidManifest.xml",
|
||||
"proj.tizen/tizen-manifest.xml"
|
||||
"proj.android-studio/app/AndroidManifest.xml"
|
||||
]
|
||||
},
|
||||
"project_replace_mac_bundleid": {
|
||||
|
@ -95,11 +83,6 @@
|
|||
"file_path": "proj.android-studio/app/AndroidManifest.xml",
|
||||
"pattern": "android:screenOrientation=\\\".*\\\"",
|
||||
"replace_string": "android:screenOrientation=\"portrait\""
|
||||
},
|
||||
{
|
||||
"file_path": "proj.win10/App/Package.appxmanifest",
|
||||
"pattern": "Rotation Preference=\\\"landscape",
|
||||
"replace_string": "Rotation Preference=\"portrait"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<Application
|
||||
x:Class="CocosAppWinRT.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:CocosAppWinRT"
|
||||
xmlns:localData="using:Shared">
|
||||
|
||||
<Application.Resources>
|
||||
|
||||
<x:String x:Key="AppName">HelloCpp</x:String>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -1,122 +0,0 @@
|
|||
#include "App.xaml.h"
|
||||
#include "OpenGLESPage.xaml.h"
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Windows::ApplicationModel;
|
||||
using namespace Windows::ApplicationModel::Activation;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::UI::Xaml::Media::Animation;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Interop;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
using namespace cocos2d;
|
||||
using namespace CocosAppWinRT;
|
||||
|
||||
App::App()
|
||||
{
|
||||
InitializeComponent();
|
||||
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
|
||||
Resuming += ref new EventHandler<Object^>(this, &App::OnResuming);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
|
||||
{
|
||||
// if our app is prelaunched do nothing
|
||||
// see https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/handle-app-prelaunch
|
||||
if (e->PrelaunchActivated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == nullptr)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and associate it with
|
||||
// a SuspensionManager key
|
||||
rootFrame = ref new Frame();
|
||||
|
||||
rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
|
||||
|
||||
if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
|
||||
{
|
||||
// TODO: Restore the saved session state only when appropriate, scheduling the
|
||||
// final launch steps after the restore is complete
|
||||
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window::Current->Content = rootFrame;
|
||||
// Ensure the current window is active
|
||||
}
|
||||
|
||||
if (rootFrame->Content == nullptr)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame->Content = mPage = ref new OpenGLESPage(&mOpenGLES);
|
||||
}
|
||||
// Ensure the current window is active
|
||||
Window::Current->Activate();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
|
||||
{
|
||||
(void)sender; // Unused parameter
|
||||
(void)e; // Unused parameter
|
||||
|
||||
if (mPage)
|
||||
{
|
||||
mPage->SetVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being resumed.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the resume request.</param>
|
||||
/// <param name="args">Details about the resume request.</param>
|
||||
void App::OnResuming(Object ^sender, Object ^args)
|
||||
{
|
||||
(void)sender; // Unused parameter
|
||||
(void)args; // Unused parameter
|
||||
|
||||
if (mPage)
|
||||
{
|
||||
mPage->SetVisibility(true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
|
||||
{
|
||||
throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "app.g.h"
|
||||
#include "OpenGLES.h"
|
||||
#include "OpenGLESPage.xaml.h"
|
||||
|
||||
namespace CocosAppWinRT
|
||||
{
|
||||
ref class App sealed
|
||||
{
|
||||
public:
|
||||
App();
|
||||
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
|
||||
|
||||
private:
|
||||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
|
||||
void OnResuming(Platform::Object ^sender, Platform::Object ^args);
|
||||
void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
|
||||
|
||||
OpenGLESPage^ mPage;
|
||||
OpenGLES mOpenGLES;
|
||||
};
|
||||
}
|
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.1 KiB |
|
@ -1,152 +0,0 @@
|
|||
/*
|
||||
* 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 "platform/winrt/CCGLViewImpl-winrt.h"
|
||||
#include "platform/CCApplication.h"
|
||||
#include "renderer/CCTextureCache.h"
|
||||
|
||||
// These are used by the shader compilation methods.
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Windows::UI::Core;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::Graphics::Display;
|
||||
using namespace cocos2d;
|
||||
|
||||
Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, DisplayOrientations orientation, CoreDispatcher^ dispatcher, Panel^ panel)
|
||||
: m_app(nullptr)
|
||||
, m_width(width)
|
||||
, m_height(height)
|
||||
, m_dpi(dpi)
|
||||
, m_dispatcher(dispatcher)
|
||||
, m_panel(panel)
|
||||
, m_orientation(orientation)
|
||||
{
|
||||
m_app = new AppDelegate();
|
||||
}
|
||||
|
||||
Cocos2dRenderer::~Cocos2dRenderer()
|
||||
{
|
||||
delete m_app;
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::Resume()
|
||||
{
|
||||
auto director = cocos2d::Director::getInstance();
|
||||
auto glview = director->getOpenGLView();
|
||||
|
||||
if (!glview)
|
||||
{
|
||||
GLViewImpl* glview = GLViewImpl::create("Test Cpp");
|
||||
glview->setDispatcher(m_dispatcher.Get());
|
||||
glview->setPanel(m_panel.Get());
|
||||
glview->Create(static_cast<float>(m_width), static_cast<float>(m_height), m_dpi, m_orientation);
|
||||
director->setOpenGLView(glview);
|
||||
CCApplication::getInstance()->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
Application::getInstance()->applicationWillEnterForeground();
|
||||
cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND);
|
||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::Pause()
|
||||
{
|
||||
if (Director::getInstance()->getOpenGLView()) {
|
||||
Application::getInstance()->applicationDidEnterBackground();
|
||||
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
|
||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
|
||||
}
|
||||
}
|
||||
|
||||
bool Cocos2dRenderer::AppShouldExit()
|
||||
{
|
||||
return GLViewImpl::sharedOpenGLView()->AppShouldExit();
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::DeviceLost()
|
||||
{
|
||||
Pause();
|
||||
|
||||
auto director = cocos2d::Director::getInstance();
|
||||
if (director->getOpenGLView()) {
|
||||
cocos2d::GL::invalidateStateCache();
|
||||
cocos2d::GLProgramCache::getInstance()->reloadDefaultGLPrograms();
|
||||
cocos2d::DrawPrimitives::init();
|
||||
cocos2d::VolatileTextureMgr::reloadAllTextures();
|
||||
|
||||
cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED);
|
||||
director->getEventDispatcher()->dispatchEvent(&recreatedEvent);
|
||||
director->setGLDefaultValues();
|
||||
|
||||
Application::getInstance()->applicationWillEnterForeground();
|
||||
cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND);
|
||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi, DisplayOrientations orientation)
|
||||
{
|
||||
auto glView = GLViewImpl::sharedOpenGLView();
|
||||
|
||||
if (orientation != m_orientation)
|
||||
{
|
||||
m_orientation = orientation;
|
||||
glView->UpdateOrientation(orientation);
|
||||
}
|
||||
|
||||
if (width != m_width || height != m_height)
|
||||
{
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
glView->UpdateForWindowSizeChange(static_cast<float>(width), static_cast<float>(height));
|
||||
}
|
||||
|
||||
if (dpi != m_dpi)
|
||||
{
|
||||
m_dpi = dpi;
|
||||
glView->SetDPI(m_dpi);
|
||||
}
|
||||
|
||||
glView->ProcessEvents();
|
||||
glView->Render();
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args)
|
||||
{
|
||||
GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args);
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::QueueBackButtonEvent()
|
||||
{
|
||||
GLViewImpl::sharedOpenGLView()->QueueBackKeyPress();
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::QueueKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args)
|
||||
{
|
||||
GLViewImpl::sharedOpenGLView()->QueueWinRTKeyboardEvent(type, args);
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* 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 <agile.h>
|
||||
|
||||
|
||||
|
||||
|
||||
class AppDelegate;
|
||||
|
||||
class Cocos2dRenderer
|
||||
{
|
||||
public:
|
||||
Cocos2dRenderer(int width, int height, float dpi,
|
||||
Windows::Graphics::Display::DisplayOrientations orientation,
|
||||
Windows::UI::Core::CoreDispatcher^ dispatcher, Windows::UI::Xaml::Controls::Panel^ panel);
|
||||
~Cocos2dRenderer();
|
||||
void Draw(GLsizei width, GLsizei height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation);
|
||||
void QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void QueueKeyboardEvent(cocos2d::WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args);
|
||||
void QueueBackButtonEvent();
|
||||
void Pause();
|
||||
void Resume();
|
||||
void DeviceLost();
|
||||
bool AppShouldExit();
|
||||
|
||||
private:
|
||||
|
||||
int m_width;
|
||||
int m_height;
|
||||
float m_dpi;
|
||||
|
||||
// The AppDelegate for the Cocos2D app
|
||||
AppDelegate* m_app;
|
||||
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
|
||||
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
|
||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
||||
};
|
|
@ -1,255 +0,0 @@
|
|||
/*
|
||||
* 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() :
|
||||
mEglDisplay(EGL_NO_DISPLAY),
|
||||
mEglContext(EGL_NO_CONTEXT),
|
||||
mEglConfig(nullptr)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
OpenGLES::~OpenGLES()
|
||||
{
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
void OpenGLES::Initialize()
|
||||
{
|
||||
const EGLint configAttributes[] =
|
||||
{
|
||||
EGL_RED_SIZE, 8,
|
||||
EGL_GREEN_SIZE, 8,
|
||||
EGL_BLUE_SIZE, 8,
|
||||
EGL_ALPHA_SIZE, 8,
|
||||
EGL_DEPTH_SIZE, 8,
|
||||
EGL_STENCIL_SIZE, 8,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
const EGLint contextAttributes[] =
|
||||
{
|
||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
const EGLint defaultDisplayAttributes[] =
|
||||
{
|
||||
// These are the default display attributes, used to request ANGLE's D3D11 renderer.
|
||||
// eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+.
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
|
||||
// EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
|
||||
// Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
|
||||
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||
|
||||
// EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call
|
||||
// the IDXGIDevice3::Trim method on behalf of the application when it gets suspended.
|
||||
// Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement.
|
||||
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
const EGLint fl9_3DisplayAttributes[] =
|
||||
{
|
||||
// These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3.
|
||||
// These attributes are used if the call to eglInitialize fails with the default display attributes.
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
|
||||
EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
|
||||
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
const EGLint warpDisplayAttributes[] =
|
||||
{
|
||||
// These attributes can be used to request D3D11 WARP.
|
||||
// They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes.
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
|
||||
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
EGLConfig config = NULL;
|
||||
|
||||
// eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11.
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
|
||||
if (!eglGetPlatformDisplayEXT)
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
|
||||
}
|
||||
|
||||
//
|
||||
// To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying
|
||||
// parameters passed to eglGetPlatformDisplayEXT:
|
||||
// 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+.
|
||||
// 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again
|
||||
// using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3.
|
||||
// 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again
|
||||
// using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer.
|
||||
//
|
||||
|
||||
// This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details.
|
||||
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes);
|
||||
if (mEglDisplay == EGL_NO_DISPLAY)
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
|
||||
}
|
||||
|
||||
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
|
||||
{
|
||||
// This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on some mobile devices).
|
||||
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes);
|
||||
if (mEglDisplay == EGL_NO_DISPLAY)
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
|
||||
}
|
||||
|
||||
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
|
||||
{
|
||||
// This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU.
|
||||
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes);
|
||||
if (mEglDisplay == EGL_NO_DISPLAY)
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
|
||||
}
|
||||
|
||||
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
|
||||
{
|
||||
// If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EGLint numConfigs = 0;
|
||||
if ((eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0))
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig");
|
||||
}
|
||||
|
||||
mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttributes);
|
||||
if (mEglContext == EGL_NO_CONTEXT)
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to create EGL context");
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLES::Cleanup()
|
||||
{
|
||||
if (mEglDisplay != EGL_NO_DISPLAY && mEglContext != EGL_NO_CONTEXT)
|
||||
{
|
||||
eglDestroyContext(mEglDisplay, mEglContext);
|
||||
mEglContext = EGL_NO_CONTEXT;
|
||||
}
|
||||
|
||||
if (mEglDisplay != EGL_NO_DISPLAY)
|
||||
{
|
||||
eglTerminate(mEglDisplay);
|
||||
mEglDisplay = EGL_NO_DISPLAY;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLES::Reset()
|
||||
{
|
||||
Cleanup();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurfaceSize, const float* resolutionScale)
|
||||
{
|
||||
if (!panel)
|
||||
{
|
||||
throw Exception::CreateException(E_INVALIDARG, L"SwapChainPanel parameter is invalid");
|
||||
}
|
||||
|
||||
if (renderSurfaceSize != nullptr && resolutionScale != nullptr)
|
||||
{
|
||||
throw Exception::CreateException(E_INVALIDARG, L"A size and a scale can't both be specified");
|
||||
}
|
||||
|
||||
EGLSurface surface = EGL_NO_SURFACE;
|
||||
|
||||
const EGLint surfaceAttributes[] =
|
||||
{
|
||||
// EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above).
|
||||
// If you have compilation issues with it then please update your Visual Studio templates.
|
||||
EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
// Create a PropertySet and initialize with the EGLNativeWindowType.
|
||||
PropertySet^ surfaceCreationProperties = ref new PropertySet();
|
||||
surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel);
|
||||
|
||||
// If a render surface size is specified, add it to the surface creation properties
|
||||
if (renderSurfaceSize != nullptr)
|
||||
{
|
||||
surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize));
|
||||
}
|
||||
|
||||
// If a resolution scale is specified, add it to the surface creation properties
|
||||
if (resolutionScale != nullptr)
|
||||
{
|
||||
surfaceCreationProperties->Insert(ref new String(EGLRenderResolutionScaleProperty), PropertyValue::CreateSingle(*resolutionScale));
|
||||
}
|
||||
|
||||
surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast<IInspectable*>(surfaceCreationProperties), surfaceAttributes);
|
||||
if (surface == EGL_NO_SURFACE)
|
||||
{
|
||||
throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface");
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void OpenGLES::GetSurfaceDimensions(const EGLSurface surface, EGLint* width, EGLint* height)
|
||||
{
|
||||
eglQuerySurface(mEglDisplay, surface, EGL_WIDTH, width);
|
||||
eglQuerySurface(mEglDisplay, surface, EGL_HEIGHT, height);
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* 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 <GLES3/gl3.h>
|
||||
|
||||
// EGL includes
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
#include <angle_windowsstore.h>
|
||||
|
||||
class OpenGLES
|
||||
{
|
||||
public:
|
||||
OpenGLES();
|
||||
~OpenGLES();
|
||||
|
||||
EGLSurface CreateSurface(Windows::UI::Xaml::Controls::SwapChainPanel^ panel, const Windows::Foundation::Size* renderSurfaceSize, const float* renderResolutionScale);
|
||||
void GetSurfaceDimensions(const EGLSurface surface, EGLint *width, EGLint *height);
|
||||
void DestroySurface(const EGLSurface surface);
|
||||
void MakeCurrent(const EGLSurface surface);
|
||||
EGLBoolean SwapBuffers(const EGLSurface surface);
|
||||
void Reset();
|
||||
void Cleanup();
|
||||
|
||||
private:
|
||||
void Initialize();
|
||||
|
||||
private:
|
||||
EGLDisplay mEglDisplay;
|
||||
EGLContext mEglContext;
|
||||
EGLConfig mEglConfig;
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
<Page
|
||||
x:Class="CocosAppWinRT.OpenGLESPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:CocosAppWinRT"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<SwapChainPanel x:Name="swapChainPanel">
|
||||
<Canvas x:Name="cocos2d_canvas" Visibility="Collapsed" />
|
||||
</SwapChainPanel>
|
||||
</Page>
|
|
@ -1,468 +0,0 @@
|
|||
/*
|
||||
* 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 CocosAppWinRT;
|
||||
using namespace cocos2d;
|
||||
using namespace Platform;
|
||||
using namespace Concurrency;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Graphics::Display;
|
||||
using namespace Windows::System::Threading;
|
||||
using namespace Windows::UI::Core;
|
||||
using namespace Windows::UI::Input;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
|
||||
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900
|
||||
using namespace Windows::Phone::UI::Input;
|
||||
#endif
|
||||
|
||||
OpenGLESPage::OpenGLESPage() :
|
||||
OpenGLESPage(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
|
||||
mOpenGLES(openGLES),
|
||||
mRenderSurface(EGL_NO_SURFACE),
|
||||
mCoreInput(nullptr),
|
||||
mDpi(0.0f),
|
||||
mDeviceLost(false),
|
||||
mCursorVisible(true),
|
||||
mVisible(false),
|
||||
mOrientation(DisplayOrientations::Landscape)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Windows::UI::Core::CoreWindow^ window = Windows::UI::Xaml::Window::Current->CoreWindow;
|
||||
|
||||
window->VisibilityChanged +=
|
||||
ref new Windows::Foundation::TypedEventHandler<Windows::UI::Core::CoreWindow^, Windows::UI::Core::VisibilityChangedEventArgs^>(this, &OpenGLESPage::OnVisibilityChanged);
|
||||
|
||||
window->KeyDown += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &OpenGLESPage::OnKeyPressed);
|
||||
|
||||
window->KeyUp += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &OpenGLESPage::OnKeyReleased);
|
||||
|
||||
window->CharacterReceived += ref new TypedEventHandler<CoreWindow^, CharacterReceivedEventArgs^>(this, &OpenGLESPage::OnCharacterReceived);
|
||||
|
||||
|
||||
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
|
||||
|
||||
currentDisplayInformation->OrientationChanged +=
|
||||
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &OpenGLESPage::OnOrientationChanged);
|
||||
|
||||
mOrientation = currentDisplayInformation->CurrentOrientation;
|
||||
|
||||
this->Loaded +=
|
||||
ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded);
|
||||
|
||||
#if _MSC_VER >= 1900
|
||||
if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
|
||||
{
|
||||
Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync();
|
||||
}
|
||||
|
||||
if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
|
||||
{
|
||||
HardwareButtons::BackPressed += ref new EventHandler<BackPressedEventArgs^>(this, &OpenGLESPage::OnBackButtonPressed);
|
||||
}
|
||||
#else
|
||||
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
||||
Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync();
|
||||
HardwareButtons::BackPressed += ref new EventHandler<BackPressedEventArgs^>(this, &OpenGLESPage::OnBackButtonPressed);
|
||||
#else
|
||||
// Disable all pointer visual feedback for better performance when touching.
|
||||
// This is not supported on Windows Phone applications.
|
||||
auto pointerVisualizationSettings = Windows::UI::Input::PointerVisualizationSettings::GetForCurrentView();
|
||||
pointerVisualizationSettings->IsContactFeedbackEnabled = false;
|
||||
pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CreateInput();
|
||||
}
|
||||
|
||||
void OpenGLESPage::CreateInput()
|
||||
{
|
||||
// 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.
|
||||
mCoreInput = 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.
|
||||
mCoreInput->PointerPressed += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerPressed);
|
||||
mCoreInput->PointerMoved += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerMoved);
|
||||
mCoreInput->PointerReleased += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerReleased);
|
||||
mCoreInput->PointerWheelChanged += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerWheelChanged);
|
||||
|
||||
if (GLViewImpl::sharedOpenGLView() && !GLViewImpl::sharedOpenGLView()->isCursorVisible())
|
||||
{
|
||||
mCoreInput->PointerCursor = nullptr;
|
||||
}
|
||||
|
||||
// Begin processing input messages as they're delivered.
|
||||
mCoreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
|
||||
});
|
||||
|
||||
// Run task on a dedicated high priority background thread.
|
||||
mInputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
|
||||
}
|
||||
|
||||
OpenGLESPage::~OpenGLESPage()
|
||||
{
|
||||
StopRenderLoop();
|
||||
DestroyRenderSurface();
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
|
||||
{
|
||||
// The SwapChainPanel has been created and arranged in the page layout, so EGL can be initialized.
|
||||
CreateRenderSurface();
|
||||
StartRenderLoop();
|
||||
mVisible = true;
|
||||
}
|
||||
|
||||
void OpenGLESPage::CreateRenderSurface()
|
||||
{
|
||||
if (mOpenGLES && mRenderSurface == EGL_NO_SURFACE)
|
||||
{
|
||||
// The app can configure the SwapChainPanel which may boost performance.
|
||||
// By default, this template uses the default configuration.
|
||||
mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, nullptr, nullptr);
|
||||
|
||||
// You can configure the SwapChainPanel to render at a lower resolution and be scaled up to
|
||||
// the swapchain panel size. This scaling is often free on mobile hardware.
|
||||
//
|
||||
// One way to configure the SwapChainPanel is to specify precisely which resolution it should render at.
|
||||
// Size customRenderSurfaceSize = Size(800, 600);
|
||||
// mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, &customRenderSurfaceSize, nullptr);
|
||||
//
|
||||
// Another way is to tell the SwapChainPanel to render at a certain scale factor compared to its size.
|
||||
// e.g. if the SwapChainPanel is 1920x1280 then setting a factor of 0.5f will make the app render at 960x640
|
||||
// float customResolutionScale = 0.5f;
|
||||
// mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, nullptr, &customResolutionScale);
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::DestroyRenderSurface()
|
||||
{
|
||||
if (mOpenGLES)
|
||||
{
|
||||
mOpenGLES->DestroySurface(mRenderSurface);
|
||||
}
|
||||
mRenderSurface = EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
void OpenGLESPage::RecoverFromLostDevice()
|
||||
{
|
||||
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
|
||||
DestroyRenderSurface();
|
||||
mOpenGLES->Reset();
|
||||
CreateRenderSurface();
|
||||
std::unique_lock<std::mutex> locker(mSleepMutex);
|
||||
mDeviceLost = false;
|
||||
mSleepCondition.notify_one();
|
||||
}
|
||||
|
||||
void OpenGLESPage::TerminateApp()
|
||||
{
|
||||
{
|
||||
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
|
||||
|
||||
if (mOpenGLES)
|
||||
{
|
||||
mOpenGLES->DestroySurface(mRenderSurface);
|
||||
mOpenGLES->Cleanup();
|
||||
}
|
||||
}
|
||||
Windows::UI::Xaml::Application::Current->Exit();
|
||||
}
|
||||
|
||||
void OpenGLESPage::StartRenderLoop()
|
||||
{
|
||||
// If the render loop is already running then do not start another thread.
|
||||
if (mRenderLoopWorker != nullptr && mRenderLoopWorker->Status == Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
|
||||
mDpi = currentDisplayInformation->LogicalDpi;
|
||||
|
||||
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, dispatcher](Windows::Foundation::IAsyncAction ^ action)
|
||||
{
|
||||
mOpenGLES->MakeCurrent(mRenderSurface);
|
||||
|
||||
GLsizei panelWidth = 0;
|
||||
GLsizei panelHeight = 0;
|
||||
mOpenGLES->GetSurfaceDimensions(mRenderSurface, &panelWidth, &panelHeight);
|
||||
|
||||
if (mRenderer.get() == nullptr)
|
||||
{
|
||||
mRenderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, mDpi, mOrientation, dispatcher, swapChainPanel);
|
||||
}
|
||||
|
||||
mRenderer->Resume();
|
||||
|
||||
while (action->Status == Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
if (!mVisible)
|
||||
{
|
||||
mRenderer->Pause();
|
||||
}
|
||||
|
||||
// wait until app is visible again or thread is cancelled
|
||||
while (!mVisible)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mSleepMutex);
|
||||
mSleepCondition.wait(lock);
|
||||
|
||||
if (action->Status != Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
return; // thread was cancelled. Exit thread
|
||||
}
|
||||
|
||||
if (mVisible)
|
||||
{
|
||||
mRenderer->Resume();
|
||||
}
|
||||
else // spurious wake up
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
mOpenGLES->GetSurfaceDimensions(mRenderSurface, &panelWidth, &panelHeight);
|
||||
mRenderer.get()->Draw(panelWidth, panelHeight, mDpi, mOrientation);
|
||||
|
||||
// Recreate input dispatch
|
||||
if (GLViewImpl::sharedOpenGLView() && mCursorVisible != GLViewImpl::sharedOpenGLView()->isCursorVisible())
|
||||
{
|
||||
CreateInput();
|
||||
mCursorVisible = GLViewImpl::sharedOpenGLView()->isCursorVisible();
|
||||
}
|
||||
|
||||
if (mRenderer->AppShouldExit())
|
||||
{
|
||||
// run on main UI thread
|
||||
swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new DispatchedHandler([=]()
|
||||
{
|
||||
TerminateApp();
|
||||
}));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
EGLBoolean result = GL_FALSE;
|
||||
{
|
||||
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
|
||||
result = mOpenGLES->SwapBuffers(mRenderSurface);
|
||||
}
|
||||
|
||||
if (result != GL_TRUE)
|
||||
{
|
||||
// The call to eglSwapBuffers was not be successful (i.e. due to Device Lost)
|
||||
// If the call fails, then we must reinitialize EGL and the GL resources.
|
||||
mRenderer->Pause();
|
||||
mDeviceLost = true;
|
||||
|
||||
// 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([=]()
|
||||
{
|
||||
RecoverFromLostDevice();
|
||||
}, CallbackContext::Any));
|
||||
|
||||
// wait until OpenGL is reset or thread is cancelled
|
||||
while (mDeviceLost)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mSleepMutex);
|
||||
mSleepCondition.wait(lock);
|
||||
|
||||
if (action->Status != Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
return; // thread was cancelled. Exit thread
|
||||
}
|
||||
|
||||
if (!mDeviceLost)
|
||||
{
|
||||
mOpenGLES->MakeCurrent(mRenderSurface);
|
||||
// restart cocos2d-x
|
||||
mRenderer->DeviceLost();
|
||||
}
|
||||
else // spurious wake up
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Run task on a dedicated high priority background thread.
|
||||
mRenderLoopWorker = Windows::System::Threading::ThreadPool::RunAsync(workItemHandler, Windows::System::Threading::WorkItemPriority::High, Windows::System::Threading::WorkItemOptions::TimeSliced);
|
||||
}
|
||||
|
||||
void OpenGLESPage::StopRenderLoop()
|
||||
{
|
||||
if (mRenderLoopWorker)
|
||||
{
|
||||
mRenderLoopWorker->Cancel();
|
||||
std::unique_lock<std::mutex> locker(mSleepMutex);
|
||||
mSleepCondition.notify_one();
|
||||
mRenderLoopWorker = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse;
|
||||
if (mRenderer)
|
||||
{
|
||||
mRenderer->QueuePointerEvent(isMouseEvent ? PointerEventType::MousePressed : PointerEventType::PointerPressed, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse;
|
||||
if (mRenderer)
|
||||
{
|
||||
mRenderer->QueuePointerEvent(isMouseEvent ? PointerEventType::MouseMoved : PointerEventType::PointerMoved, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse;
|
||||
|
||||
if (mRenderer)
|
||||
{
|
||||
mRenderer->QueuePointerEvent(isMouseEvent ? PointerEventType::MouseReleased : PointerEventType::PointerReleased, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerWheelChanged(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse;
|
||||
if (mRenderer && isMouseEvent)
|
||||
{
|
||||
mRenderer->QueuePointerEvent(PointerEventType::MouseWheelChanged, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnKeyPressed(CoreWindow^ sender, KeyEventArgs^ e)
|
||||
{
|
||||
//log("OpenGLESPage::OnKeyPressed %d", e->VirtualKey);
|
||||
if (mRenderer)
|
||||
{
|
||||
mRenderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyPressed, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnCharacterReceived(CoreWindow^ sender, CharacterReceivedEventArgs^ e)
|
||||
{
|
||||
#if 0
|
||||
if (!e->KeyStatus.WasKeyDown)
|
||||
{
|
||||
log("OpenGLESPage::OnCharacterReceived %d", e->KeyCode);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnKeyReleased(CoreWindow^ sender, KeyEventArgs^ e)
|
||||
{
|
||||
//log("OpenGLESPage::OnKeyReleased %d", e->VirtualKey);
|
||||
if (mRenderer)
|
||||
{
|
||||
mRenderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyReleased, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OpenGLESPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
|
||||
{
|
||||
mOrientation = sender->CurrentOrientation;
|
||||
}
|
||||
|
||||
void OpenGLESPage::SetVisibility(bool isVisible)
|
||||
{
|
||||
if (isVisible && mRenderSurface != EGL_NO_SURFACE)
|
||||
{
|
||||
if (!mVisible)
|
||||
{
|
||||
std::unique_lock<std::mutex> locker(mSleepMutex);
|
||||
mVisible = true;
|
||||
mSleepCondition.notify_one();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args)
|
||||
{
|
||||
if (args->Visible && mRenderSurface != EGL_NO_SURFACE)
|
||||
{
|
||||
SetVisibility(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900
|
||||
/*
|
||||
We set args->Handled = true to prevent the app from quitting when the back button is pressed.
|
||||
This is because this back button event happens on the XAML UI thread and not the cocos2d-x UI thread.
|
||||
We need to give the game developer a chance to decide to exit the app depending on where they
|
||||
are in their game. They can receive the back button event by listening for the
|
||||
EventKeyboard::KeyCode::KEY_ESCAPE event.
|
||||
|
||||
The default behavior is to exit the app if the EventKeyboard::KeyCode::KEY_ESCAPE event
|
||||
is not handled by the game.
|
||||
*/
|
||||
void OpenGLESPage::OnBackButtonPressed(Object^ sender, BackPressedEventArgs^ args)
|
||||
{
|
||||
if (mRenderer)
|
||||
{
|
||||
mRenderer->QueueBackButtonEvent();
|
||||
args->Handled = true;
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* 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 <memory>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
#include "Cocos2dRenderer.h"
|
||||
|
||||
namespace CocosAppWinRT
|
||||
{
|
||||
public ref class OpenGLESPage sealed
|
||||
{
|
||||
public:
|
||||
OpenGLESPage();
|
||||
virtual ~OpenGLESPage();
|
||||
void SetVisibility(bool isVisible);
|
||||
|
||||
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);
|
||||
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900
|
||||
void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args);
|
||||
#endif
|
||||
void CreateRenderSurface();
|
||||
void DestroyRenderSurface();
|
||||
void RecoverFromLostDevice();
|
||||
void TerminateApp();
|
||||
void StartRenderLoop();
|
||||
void StopRenderLoop();
|
||||
|
||||
void CreateInput();
|
||||
|
||||
OpenGLES* mOpenGLES;
|
||||
std::shared_ptr<Cocos2dRenderer> mRenderer;
|
||||
|
||||
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^ mInputLoopWorker;
|
||||
Windows::UI::Core::CoreIndependentInputSource^ mCoreInput;
|
||||
|
||||
// Independent touch and pen 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);
|
||||
void OnPointerWheelChanged(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
||||
|
||||
// Independent keyboard handling functions.
|
||||
void OnKeyPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
|
||||
void OnKeyReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
|
||||
|
||||
void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args);
|
||||
|
||||
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||
|
||||
float mDpi;
|
||||
bool mDeviceLost;
|
||||
bool mVisible;
|
||||
bool mCursorVisible;
|
||||
Windows::Graphics::Display::DisplayOrientations mOrientation;
|
||||
|
||||
std::mutex mSleepMutex;
|
||||
std::condition_variable mSleepCondition;
|
||||
};
|
||||
}
|
|
@ -1,299 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{187d3e60-961a-41ee-bc18-c510a431d22e}</ProjectGuid>
|
||||
<RootNamespace>CocosAppWinRT</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<ApplicationTypeRevision>8.2</ApplicationTypeRevision>
|
||||
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_platform.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_app.props" />
|
||||
<Import Project="resources.props" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_platform.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_app.props" />
|
||||
<Import Project="resources.props" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_platform.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_app.props" />
|
||||
<Import Project="resources.props" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_platform.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_app.props" />
|
||||
<Import Project="resources.props" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_platform.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_app.props" />
|
||||
<Import Project="resources.props" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_platform.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10.props" />
|
||||
<Import Project="..\..\cocos2d\cocos\2d\win10_props\cocos2d_win10_app.props" />
|
||||
<Import Project="resources.props" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<PackageCertificateKeyFile>HelloCpp_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
<PackageCertificateThumbprint>0EF4E4C6521D76BFF4B15FBF03FDBBD95F9710F4</PackageCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj /Zm200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204;4251</DisableSpecificWarnings>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\Classes;$(EngineRoot)cocos\audio\include;Cocos2dEngine;Generated Files\Cocos2dEngine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<PreprocessorDefinitions>COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj /Zm200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204;4251</DisableSpecificWarnings>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\Classes;$(EngineRoot)cocos\audio\include;Cocos2dEngine;Generated Files\Cocos2dEngine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj /Zm200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204;4251</DisableSpecificWarnings>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\Classes;$(EngineRoot)cocos\audio\include;Cocos2dEngine;Generated Files\Cocos2dEngine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<PreprocessorDefinitions>COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj /Zm200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204;4251</DisableSpecificWarnings>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\Classes;$(EngineRoot)cocos\audio\include;Cocos2dEngine;Generated Files\Cocos2dEngine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj /Zm200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204;4251</DisableSpecificWarnings>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\Classes;$(EngineRoot)cocos\audio\include;Cocos2dEngine;Generated Files\Cocos2dEngine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<PreprocessorDefinitions>COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj /Zm200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204;4251</DisableSpecificWarnings>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\Classes;$(EngineRoot)cocos\audio\include;Cocos2dEngine;Generated Files\Cocos2dEngine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Classes\AppDelegate.h" />
|
||||
<ClInclude Include="..\..\Classes\HelloWorldScene.h" />
|
||||
<ClInclude Include="App.xaml.h">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Cocos2dEngine\Cocos2dRenderer.h" />
|
||||
<ClInclude Include="Cocos2dEngine\OpenGLES.h" />
|
||||
<ClInclude Include="Cocos2dEngine\OpenGLESPage.xaml.h">
|
||||
<DependentUpon>Cocos2dEngine\OpenGLESPage.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="HelloCpp_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Classes\AppDelegate.cpp" />
|
||||
<ClCompile Include="..\..\Classes\HelloWorldScene.cpp" />
|
||||
<ClCompile Include="App.xaml.cpp">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Cocos2dEngine\Cocos2dRenderer.cpp" />
|
||||
<ClCompile Include="Cocos2dEngine\OpenGLES.cpp" />
|
||||
<ClCompile Include="Cocos2dEngine\OpenGLESPage.xaml.cpp">
|
||||
<DependentUpon>Cocos2dEngine\OpenGLESPage.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Cocos2dEngine\OpenGLESPage.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\cocos2d\cocos\2d\libcocos2d_win10\libcocos2d.vcxproj">
|
||||
<Project>{07c2895d-720c-487d-b7b4-12c293ea533f}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\cocos2d\cocos\editor-support\spine\proj.win10\libSpine.vcxproj">
|
||||
<Project>{4b3ba10a-941f-4e08-8a50-8a7fcb822bb8}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\cocos2d\external\Box2D\proj-win10\libbox2d.vcxproj">
|
||||
<Project>{0c32d479-46d5-46c3-9aa9-0a8ff8320516}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\cocos2d\external\bullet\proj.win10\libbullet.vcxproj">
|
||||
<Project>{ecee1119-ce2e-4f7e-83a8-1932ea48e893}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\cocos2d\external\recast\proj.win10\librecast.vcxproj">
|
||||
<Project>{f551524d-8a70-4b2f-a7c2-28ae61150022}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="WindowsMobile, Version=10.0.10240.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Image Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Image Include="Assets\StoreLogo.png" />
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,99 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Common">
|
||||
<UniqueIdentifier>187d3e60-961a-41ee-bc18-c510a431d22e</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Assets">
|
||||
<UniqueIdentifier>f8868b9a-1bec-48df-b4b6-294815dc7a5d</UniqueIdentifier>
|
||||
<Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Cocos2dEngine">
|
||||
<UniqueIdentifier>{6b9ca606-5a38-4479-a7ec-01bdfeda67bc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Classes">
|
||||
<UniqueIdentifier>{a18967bc-4fa1-4c67-bf7e-3f9c8b6a1129}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="App.xaml.cpp" />
|
||||
<ClCompile Include="Cocos2dEngine\Cocos2dRenderer.cpp">
|
||||
<Filter>Cocos2dEngine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Cocos2dEngine\OpenGLES.cpp">
|
||||
<Filter>Cocos2dEngine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="Cocos2dEngine\OpenGLESPage.xaml.cpp" />
|
||||
<ClCompile Include="..\..\Classes\AppDelegate.cpp">
|
||||
<Filter>Classes</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Classes\HelloWorldScene.cpp">
|
||||
<Filter>Classes</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="App.xaml.h" />
|
||||
<ClInclude Include="Cocos2dEngine\Cocos2dRenderer.h">
|
||||
<Filter>Cocos2dEngine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Cocos2dEngine\OpenGLES.h">
|
||||
<Filter>Cocos2dEngine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Cocos2dEngine\OpenGLESPage.xaml.h" />
|
||||
<ClInclude Include="..\..\Classes\AppDelegate.h">
|
||||
<Filter>Classes</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Classes\HelloWorldScene.h">
|
||||
<Filter>Classes</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="HelloCpp_TemporaryKey.pfx" />
|
||||
<None Include="$(AngleBinPath)libEGL.dll" />
|
||||
<None Include="$(AngleBinPath)libGLESv2.dll" />
|
||||
<None Include="$(ZLibBinPath)zlib.dll" />
|
||||
<None Include="$(SQLiteBinPath)sqlite3.dll" />
|
||||
<None Include="$(OggBinPath)libogg.dll" />
|
||||
<None Include="$(OggBinPath)libvorbis.dll" />
|
||||
<None Include="$(OggBinPath)libvorbisfile.dll" />
|
||||
<None Include="$(CurlBinPath)libcurl.dll" />
|
||||
<None Include="$(CurlBinPath)libeay32.dll" />
|
||||
<None Include="$(CurlBinPath)ssleay32.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Cocos2dEngine\OpenGLESPage.xaml">
|
||||
<Filter>Cocos2dEngine</Filter>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\SplashScreen.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\StoreLogo.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
|
||||
<Identity Name="A2488D1E-A992-4F30-97A0-6C68D4046731" Publisher="CN=dalestam" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="1547cf35-0745-41a4-b988-3534afbe2f39" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>HelloCpp</DisplayName>
|
||||
<PublisherDisplayName>"Microsoft Open Technologies, Inc."</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10069.0" MaxVersionTested="10.0.10069.0" />
|
||||
</Dependencies>
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="HelloCpp.App">
|
||||
<uap:VisualElements DisplayName="HelloCpp" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="HelloCpp" BackgroundColor="#464646">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo" />
|
||||
<uap:ShowOn Tile="wide310x150Logo" />
|
||||
</uap:ShowNameOnTiles>
|
||||
</uap:DefaultTile>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
<uap:InitialRotationPreference>
|
||||
<uap:Rotation Preference="landscape" />
|
||||
<uap:Rotation Preference="landscapeFlipped" />
|
||||
</uap:InitialRotationPreference>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
|
@ -1 +0,0 @@
|
|||
#include "pch.h"
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// pch.h
|
||||
// Header for standard system include files.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <collection.h>
|
||||
#include <ppltasks.h>
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "cocos-ext.h"
|
||||
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
|
||||
<ItemGroup>
|
||||
<_CustomResource Include="..\..\Resources\**\*">
|
||||
<Link>Assets\Resources\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</_CustomResource>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_CollectCustomResources" BeforeTargets="AssignTargetPaths">
|
||||
<Message Text="Adding resource: %(_CustomResource.Identity) -> %(_CustomResource.Link)" />
|
||||
<ItemGroup>
|
||||
<None Include="@(_CustomResource)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.22823.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{B2F1FF1B-005C-490E-999E-17BD4B720B5C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\cocos2d\external\Box2D\proj-win10\libbox2d.vcxproj", "{0C32D479-46D5-46C3-9AA9-0A8FF8320516}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos2d\cocos\editor-support\spine\proj.win10\libSpine.vcxproj", "{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\libcocos2d_win10\libcocos2d.vcxproj", "{07C2895D-720C-487D-B7B4-12C293EA533F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "App\HelloCpp.vcxproj", "{187D3E60-961A-41EE-BC18-C510A431D22E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librecast", "..\cocos2d\external\recast\proj.win10\librecast.vcxproj", "{F551524D-8A70-4B2F-A7C2-28AE61150022}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x64.Build.0 = Debug|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x86.Build.0 = Debug|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|ARM.Build.0 = Release|ARM
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x64.ActiveCfg = Release|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x64.Build.0 = Release|x64
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x86.ActiveCfg = Release|Win32
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x86.Build.0 = Release|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x64.Build.0 = Debug|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x86.Build.0 = Debug|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|ARM.Build.0 = Release|ARM
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x64.ActiveCfg = Release|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x64.Build.0 = Release|x64
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x86.ActiveCfg = Release|Win32
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x86.Build.0 = Release|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x64.Build.0 = Debug|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|ARM.Build.0 = Release|ARM
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x64.ActiveCfg = Release|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x64.Build.0 = Release|x64
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x86.Build.0 = Release|Win32
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|x64.Build.0 = Debug|x64
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|x86.Build.0 = Debug|Win32
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|ARM.Build.0 = Release|ARM
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|x64.ActiveCfg = Release|x64
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|x64.Build.0 = Release|x64
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|x64.Deploy.0 = Release|x64
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|x86.ActiveCfg = Release|Win32
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|x86.Build.0 = Release|Win32
|
||||
{187D3E60-961A-41EE-BC18-C510A431D22E}.Release|x86.Deploy.0 = Release|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x64.Build.0 = Debug|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x86.Build.0 = Debug|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|ARM.Build.0 = Release|ARM
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x64.ActiveCfg = Release|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x64.Build.0 = Release|x64
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x86.ActiveCfg = Release|Win32
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x86.Build.0 = Release|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x64.Build.0 = Debug|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Debug|x86.Build.0 = Debug|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|ARM.Build.0 = Release|ARM
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x64.ActiveCfg = Release|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x64.Build.0 = Release|x64
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x86.ActiveCfg = Release|Win32
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{0C32D479-46D5-46C3-9AA9-0A8FF8320516} = {B2F1FF1B-005C-490E-999E-17BD4B720B5C}
|
||||
{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8} = {B2F1FF1B-005C-490E-999E-17BD4B720B5C}
|
||||
{ECEE1119-CE2E-4F7E-83A8-1932EA48E893} = {B2F1FF1B-005C-490E-999E-17BD4B720B5C}
|
||||
{F551524D-8A70-4B2F-A7C2-28AE61150022} = {B2F1FF1B-005C-490E-999E-17BD4B720B5C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -6,7 +6,7 @@ var ccbjs = "";
|
|||
// so the respath will modify to res,
|
||||
if (!cc.sys.isNative)
|
||||
{
|
||||
if (cc.game.config[cc.game.CONFIG_KEY.engineDir] !== "frameworks/cocos2d-html5") {
|
||||
if (cc.game.config && cc.game.config[cc.game.CONFIG_KEY.engineDir] !== "frameworks/cocos2d-html5") {
|
||||
ccbjs = "../../js-tests/resjs/";
|
||||
}
|
||||
else
|
||||
|
|