Windows 8 Metro version upgrade to cocos2d-x 2.0

Andriy Chaika wrote:

I did not have possibility to wait untill official port so I tried to do my own bycicle. The code is avaliable: https://github.com/seagullua/cocos2d-x . As I ported only pieces of code which our game uses only 80% of cocos2d-x was ported. However, it can be compiled with ARM and passes WACK. Maybe for someone it will be useful untill the Microsoft introduces their port.
Hi! I tried to compile your solution, and as result became many errors. Here is log of errors. Can you help me to compile projects?

I am very sorry that haven’t cheched everything before commit.
So I updated the demo project and posted a manual how to make it work.

https://github.com/seagullua/cocos2d-x/blob/win8metro/How%20to%20compile.mdown

If some problems still occur, please tell may as I have probably forgotten to write something.

I am really excited about the support of WP8, too!
Hope the progress go smoothly, then we will have more chance to dig more market!
Looking forward the merging coming sooner!:slight_smile:

Andriy Chaika wrote:

I am very sorry that haven’t cheched everything before commit.
So I updated the demo project and posted a manual how to make it work.
>
https://github.com/seagullua/cocos2d-x/blob/win8metro/How%20to%20compile.mdown
>
If some problems still occur, please tell may as I have probably forgotten to write something.

Andriy, have you considered committing your changes back into the main branch of cocos2dx? I don’t know how far along the “official” support of Windows 8 Metro is, but I see that many people are waiting for this feature to become available so every little bit would help. :slight_smile:

Ben

Ben Ward wrote:

Andriy Chaika wrote:
> I am very sorry that haven’t cheched everything before commit.
> So I updated the demo project and posted a manual how to make it work.
>
> https://github.com/seagullua/cocos2d-x/blob/win8metro/How%20to%20compile.mdown
>
> If some problems still occur, please tell may as I have probably forgotten to write something.
>
Andriy, have you considered committing your changes back into the main branch of cocos2dx? I don’t know how far along the “official” support of Windows 8 Metro is, but I see that many people are waiting for this feature to become available so every little bit would help. :slight_smile:
>
Ben

There are two problems. The first is it is a big difference between win8 family and ordinary cocos2dx as the cocos2dx is based on OpenGL in contrast to cocos2dx-win8 which is based on DirectX. As a result, a big refactor in the cocos2dx should be done to make it possible to support both OpenGL and DirectX. Zhe Wang have said in this topic that this refactor is planed for cocos2dx 3.0.

The other problem is that I haven’t done all the work so I can’t even merge with existing cocos2d-x for windows. I am very busy now, so if I will have time and official port of Microsoft won’t be introduced till then I will try to finish my port.

Andriy Chaika wrote:

If some problems still occur, please tell may as I have probably forgotten to write something.

Compiled and running. But I got an error on sharedOpenGLView: (Action: Closing the app)

CCEGLView* CCEGLView::sharedOpenGLView()
{
assert(s_pMainWindow);
return s_pMainWindow;
}

Some Images are missed too:




Andriy Chaika wrote:

If some problems still occur, please tell may as I have probably forgotten to write something.

Compiled and running. But I got a triggered breakpoint on sharedOpenGLView: (Action: Closing the app)

CCEGLView* CCEGLView::sharedOpenGLView()
{
assert(s_pMainWindow);
return s_pMainWindow;
}

Some Images are missed too:




P. E. wrote:

Andriy Chaika wrote:
> If some problems still occur, please tell may as I have probably forgotten to write something.
>
Compiled and running. But I got a triggered breakpoint on sharedOpenGLView: (Action: Closing the app)
CCEGLView* CCEGLView::sharedOpenGLView()
{
assert(s_pMainWindow);
return s_pMainWindow;
}

This is the way the VC shows that assertion assert(s_pMainWindow); failed.

  1. Are you trying to compile your own game or demo project?
  2. Can you show the call stack?
  1. No sorry.
void DirectXRender::OnPointerMoved( *In* Windows::UI::Core::CoreWindow\^ sender, *In* Windows::UI::Core::PointerEventArgs\^ args ) { cocos2d::CCEGLView\* view = cocos2d::CCEGLView::sharedOpenGLView(); and than comes Windows::Foundation::TypeEventHandler…..

Maybe I did something wrong during the Installation? Andriy Chaika, what are you mean?

I have understood what is the problem. Windows Store Apps does not support exiting. The system decides which app to close on it own. Thus, there is no method of closing app from itself. As a result, exit button won’t work. So do not pay attention as everything is OK.

Andriy Chaika wrote:

I have understood what is the problem. Windows Store Apps does not support exiting. The system decides which app to close on it own. Thus, there is no method of closing app from itself. As a result, exit button won’t work. So do not pay attention as everything is OK.

Ok. But I have to ’released some memory and other stuff during closing the app.
How can I detect it?

It the matter. When the user switches to other window the program is going to background so no resources should be released. When the program if closed by system the destructor of AppDelegate should be called so you can manage which actions will be done at the shutdown. All other resources will be released automaticaly as the program is closed. I know this is not very good from the side of development but I have no idea know how to deal with it.

The only thing to remeber is that we can not manualy close the app.

The Only way to close your app manually is to take the top edge of the screen and put it at the bottom of the screen, as you should do with all the other Win8 apps. The behavior of apps is unified, it’s the way Windows see future apps.

There is only 3 states in an app:
**Starting
**Paused (when it’s not opened/snapped/filled)
*Closed (and you should release everything here because it will be killed !)

An app is closed when system needs memory, or there’s too many apps launched, or as I describe earlier.

You can notice that when being closed, an app is at least 5 seconds at paused state.
So if it was already paused, it just close, otherwise it’s paused a while.

That’s better to release big resources at pause to avoid untimely closing.

I think it will be great we (Cocos2D-x forum) has a source example for correct behavior of this three status too. Maybe somebody has one and want share it?

Do you have any plans to release more stable version for Windows 8 ARM? Thanks!

Sergey Neskin wrote:

Do you have any plans to release more stable version for Windows 8 ARM? Thanks!

I do not have possibility to test ARM version on the device.
If you have one tell me and we will decide how to do it.

Any update regarding the wp8 or de win8 version![](?

Thx guys, keep the good work)

Pedro Kayatt wrote:

Any update regarding the wp8 or de win8 version![](?

Thx guys, keep the good work)
QiMa’s version for WP8 is really good. Probably not everything is working since the tests won’t compile. But helloworld works and that’s enough for my project; I was able to transition my project without too much trouble. However the IDE settings were horribly incorrect for compiling. I’m working from a two week old version, so hopefully this has been corrected. There is the Win32 configuration; I wonder if it will compile under that even though the projects all say WP.

I’m using lihex’s Cocos2d-x ver1 port for metro for Win8. It’s pretty good as well, but you have to keep your code optimized and stick with version 1 CC. It appears to be not optimized for the ULV in my ultrabook but works great on my non-ULV Win8 macbook. There seems to be no more activity on lihex’s v1 port; hopefully ver 2 is in the works.

Quite some time ago since this thread was started - any news on a new version for wp8 / win8?

thanks a lot
Marco