Cocos2d-x and XBOX One

ive got high hopes for this

1 Like

I am working with the ANGLE team at Microsoft to resolve the XBOX UWP issue. I will post to this thread when we have it working correctly.

4 Likes

Here is the response from the ANGLE team.

Hi all, the fix to this will be part of the future OS update that will bring UWP support to the general public, and may be part of future pre-release OS updates for developers.

In the meantime, please continue to use WARP for development, and then switch over to the hardware GPU when the OS update is released. Iā€™ll update and close this thread when a OS update is released that supports ANGLE using the hardware GPU.

Iā€™ve made some more progress. Video, sound, controllers, and even rumble now all work. Still waiting on the ANGLE fix, but things are looking promising.

Ran the Windows App Certification Kit (WACK) for the first time yesterday. Quite a lot of APIs are being used that shouldnā€™t. Havenā€™t dug deep into this yet, but I wanted to ask yā€™all first: Has anyone released a Win10 app yet using Cocos2d-x? I assume you had to pass certification to do so. But after running WACK, it looks like it canā€™t?

WACK links:
https://developer.microsoft.com/en-us/windows/develop/app-certification-kit

1 Like

64-bit libraries available. I hope to pull them down and test out in the next week or so, but if someone else wants to test, here you go. Hope itā€™ll get on the 3.12 milestone.

2 Likes

@stevetranby Are there any practical advantages to using 64-bit builds? Wouldnā€™t 32-bit builds work and run on everything now?

Probably not a whole lot other than eventually theyā€™ll likely make 64-bit a requirement (though admittedly probably not for a year or two). Iā€™m sure there are a few advantages and disadvantages. Iā€™m mostly just keeping this thread up-to-date. If the 64-bit version is fully working it just means that the cocos2d-x engine on Win10 is more complete, and thatā€™s all for now.

Sorry if I implied any grand step forward on the UWP front by replying.

The June Xbox One preview was released about a week ago. The Whatā€™s New page didnā€™t mention anything about ANGLE support, but I wanted to try it anyways. Guess what? GPU rendering now works! Iā€™m getting a solid 60 FPS now when using a Release build.

A few notes:

ā€¢ After updating to the newer Xbox preview build, I also needed to update to the latest Windows SDK preview (14366) to get it to deploy on the Xbox. It then needed to be paired again to Visual Studio. I also set the base SDK in Visual Studio to 14366.

ā€¢ I also had an issue with the ā€œlibvorbisā€, ā€œliboggā€ and ā€œliborbisfileā€ files being build/added correctly to the release build. Copying over these files from my Debug build seemed to fix it.

ā€¢ Built with Cocos2d-x 3.10. (Didnā€™t bother update it to 3.11.1 yet).

ā€¢ I had to disable scaling to get a full 1080p resolution. I added this to ā€œApp.xaml.cppā€

Windows::UI::ViewManagement::ApplicationViewScaling::TrySetDisableLayoutScaling(true);

ā€¢ The new preview build has mouse support on by default. So my ā€œApp.xaml.cppā€ has all this now. (Itā€™s a bit hacky. Let me know if anyone finds a better way to do this.)

bool result = Windows::UI::ViewManagement::ApplicationViewScaling::TrySetDisableLayoutScaling(true);
InitializeComponent();
auto deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;
if (deviceFamily != "Windows.Desktop") {
	RequiresPointerMode = Windows::UI::Xaml::ApplicationRequiresPointerMode::WhenRequested;
}
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
Resuming += ref new EventHandler<Object^>(this, &App::OnResuming);

ā€¢ It was thrilling to finally play my game on an Xbox One.

@stevetranby Ahh, gotcha. I was just making sure. Iā€™m thinking about just shipping a 32-bit only version. Mostly because itā€™s already working reliably.

3 Likes

@Rusty thanks for the update, Iā€™ll plan to test out tomorrow so hopefully everything builds fine so I can also see 60fps.

Could you guys share how you manage security certificate and also pairing with VS?

Thanks

Havenā€™t had much time to work on this until now.

This was experimental at first, but now I think I might be able to ship using UWP. My project was all a mess at first as I hacked away. Now Iā€™m cleaning it up a bit and putting my work under version control.

Still using Cocos2D-x 3.10 for now. (If itā€™s working, why fix it?)

Iā€™m now building to the latest (non-beta) Xbox One operating system. Previously this required a beta version, but last week the August 2016 update was released. Iā€™ve also updated ā€œVisual Studio 2015 update 3ā€ and Windows 10 SDK version 1.4.1.

The new build target is ā€œ14393ā€. I think that might be the Windows 10 Anniversary SDK?

I think everything is out of beta now?

Hereā€™s some info on the released SDK:

https://blogs.msdn.microsoft.com/visualstudio/2016/08/02/universal-windows-apps-targeting-windows-10-anniversary-sdk/

1 Like

Still working on this. This is my first time creating a UWP, so much of this is new to me.

Took me a while, but I eventually figured out how to disable the escape key from quitting. (See ā€œBackButtonListenerā€ in ā€œCCGLViewImpl-winrt.cppā€)

When the UWP version launches on the desktop it flashes white for a moment, then returns to black. Anyone know how to prevent this? or change the default color to black?

Iā€™ve figured out how to launch fullscreen on desktop:

Windows::UI::ViewManagement::ApplicationView::PreferredLaunchWindowingMode = Windows::UI::ViewManagement::ApplicationViewWindowingMode::FullScreen;

Also got the mouse pointer disabled now on desktop. But I canā€™t get it to start initially hidden. It only will hide once itā€™s moved.

Fixed the ā€œwhite screen at launchā€. Had to set the page background color in ā€œOpenGLESPage.xamlā€:

<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"
    Background="Black">

Ran into some minor quirky behavior. Looked into removing the small bits of XAML here and just be a pure C++ program. Seems possible. The ANGLE template files for ā€œOpenGL ES C++ā€ and ā€œOpenGL ES C++ & XAMLā€ are helping show what to change.

Has anyone else experienced slow launches on UWP Xbox apps?

It takes an extra 45 seconds for my apps to launch when they are first deployed my console. Subsequent launches take ~5 seconds. Itā€™s the same if reboot the console and then launch the app. ~50 seconds to launch. If I then quit the app and relaunch it: ~5 seconds.

Iā€™m using the Anniversary SDK on the Desktop and on my Xbox.

Itā€™s the same with even the template projects in Visual Studio 2015. Iā€™ve tried a few types of projects:

  • XAML vs. C++ Native
  • 32-bit vs. 64-bit
  • Release vs Debug

All of them have the additional ~45 seconds. Why might this be? Anyone else seeing this?

Think i found the slow launch answer: only happens in dev mode. Annoying to develop on, but wonā€™t affect players.

If cocos2d-x is working on XBOX, does it also mean that PlayStation (PS4) support is also possible.
Last info about it is here: http://discuss.cocos2d-x.org/t/ps4-xbox-one-and-metal-rendering-support-status/24762/7

The latest PS also supports VR which could be good cooperation with latest cocos2d VR abilities.

At this time, there is no efforts to being Cocos2d-x to PS4.

It is very possible to use Cocos2d-x on XBox One.

Via UWP or natively?
Can you point me to any Cocos2D-X games on XBone?
Not doubting, just curious and keen to see :slight_smile: