Cocos2d-x and XBOX One

Cocos2d-x and XBOX One
0.0 0


There are a few requirements, nothing major though.

  1. Sign up as a Windows developer. One-time fee.
    Individuals - $19 USD
    Companies - $99 USD

  2. Get a retail Xbox One. Any kind will work.
    $250 for an Xbox One S on Amazon.

  3. Windows 10 PC

  4. Install Microsoft Visual Studio 2015 w/ Update 3
    Community version should work

After that, follow this setup guide: Getting Started with Xbox One.

It’ll walk you through installing the required SDKs, setting up the Xbox in developer mode, pairing visual studio with the xbox, etc.

Once you have a project deployed on the Xbox, getting a cocos2d-x project running should be pretty simple. You’re basically repeating the steps in the setup guide, but in a Cocos2d-x project.

  1. Create a Cocos2d-x project.
  2. Open the created Windows 10 solution.
  3. Change the build to x64.
  4. In project properties go to the Debugging tab, select Remote Machine in the Debugger to open the drop-down list.
  5. Type the IP address or hostname of the console into the Machine Name field.
  6. Select Universal (Unencrypted Protocol) in the Authentication Type field.
  7. Build and run


Update: I’ve now submitted my first game for UWP certification on Xbox. Expected turn around time is 3 days. :crossed_fingers:

Like with my other games, I used SDL2 for the game controller logic. Everything else is Cocos2d-x including the audio engine. I used the SimpleAudioEngine, which worked pretty well. Although I was disappointed to find SimpleAudioEngine for UWP didn’t support panning.

NOTE: Even if this game passes cert on the first try, I’m not sure I’ll release it this month. Working on a simultaneous release with other platforms.


Interesting about your use of SDL. Makes sense. Their controller support is good. Do you do some kind of minimal SDL compile to just include controller support? That way you don’t have the weight of the entire engine in your builds?


SDL2 is a very modular system. You can initialize just the sub-systems you want. For this project I just initialize JOYSTICK, GAMECONTROLLER, and HAPTIC. This way it’s quite light-weight.

    log("SDL_Init error");
    log("Could not initialize SDL: %s.", SDL_GetError());
} else {
    log("SDL_Init success");

I’m very comfortable with using SDL2 in conjunction with cocos2d-x, so it was any easy way to go for me. If Cocos2d-x support controllers for UWP apps, I’m sure that would be easier for others.


Wow. Thanks. The way they do it seems straightforward.



Could you paste sample code how to connect SDL controller code with cocos2d-x?



My SDL2 controller code isn’t wired into cocos2d-x, just my game code.

If you’re interested in learning about SDL2, this is the tutorial I used.

However, it might be easier to just patch Cocos2d-x to add controller support. EventController already supports mobile and desktop I think? /cc @slackmoehrle


I think 3.16 brings more controller support.

Edit: maybe I am wrong I don’t see mention of it in release notes. I thought that I read that controller support had added platforms besides iOS and Android.


I see this commit the 3.16 branch adding code for a game controller test for win32.

EDIT: Also I see that Win32 and Linux support was merged in here.


glfw use of controller was pretty straight forward as well


Update: Failed my first pass at certification. There aren’t many requirements I think for UWP cert, but Microsoft requires any game on Xbox to sign in and use Xbox Live. You don’t have to use the services like leaderboards, but you have to sign in.

My particular issue was that I didn’t block gameplay until the user had sign in. Pretty easy to fix and resubmit.

Here’s the report on the failure I got. Helpful for anyone else looking to ship on Xbox:


App Policies: 10.13.5 Xbox Live Active User and Gamertag

Because your game uses Xbox Live, it must:
· Create at least one active user and sign the user into Xbox.
· Display the user’s Xbox gamertag as the primary display and profile name.
Please add this behavior and resubmit your game.

Steps to Reproduce:

  1. Launch the app.
  2. Notice that the gameplay should be blocked until signing the user into Xbox Live services. However, your app is still playable by cancelling/skipping Xbox Live login.

You can view the Xbox Live documentation for more information. Your game may not appear in the Creators Collection until this has been resolved.
Tested Devices: Windows 10 Xbox


passsed cert

Update: Passed certification!

Still planning on launching this game sometime next month when the other platforms are ready.

Something surprising and quite nice: the Xbox Live SDK is now open source. I found their leaderboards example in the samples useful too.


@rusty congrats!! Maybe it is time for me to buy an Xbox one!



Thank you.
Do you have any experience with Kinect?
What is preferred way to connect cocos2d-x, Xbox and Kinect?



Microsoft announced yesterday that they’re significantly increasing the resources available on Xbox for UWP games in the fall update.

  • 6 CPU cores - up from 4
  • 5GB of RAM - up from 1GB
  • Full GPU Access - up from 45%

The announcement also states the full GPU access is for DirectX 12 games. I’m not sure if there will be an increase for DirectX 11. Cocos2d-x uses ANGLE to convert it’s OpenGL ES calls into DirectX 11, so I’m not sure if the GPU improvement will affect Cocos2d-x games.

For me, the most significant change will be the increase to RAM.

@slackmoehrle Thank you! Looking forward to sharing the game soon.

@CrazyHappyGame According to this list of not supported features on Xbox, only some of the Kinect works.

Xbox Universal Windows Apps don’t support skeletal tracking. Xbox provides support for using the infrared, depth, and color feeds from Kinect.


This is good news any way you slice it!


Ok, first Xbox One game released! Train Bandit is now live on Xbox One. I made a new thread for it here.


Update on the Xbox One launch.

Train Bandit is live on the Xbox One Store. I’ve received a couple nice emails from Xbox One players. (Which is nice!)

Also, I’m seeing a few mysterious crashes. I’m not sure why they are happening and I’ve not seen any of them myself. But I wanted to post this here for anyone else running into similar issues. This crash info is all from Microsoft dev dashboard. (Which is also quite nice!)

UPDATE: Looks like the crashes were my fault. Fixed in an update.


@rusty how are you making out? How may we be of service?


Following up on the mysterious crashes, they might have been all related to another bug that I fixed. Still trying to independently verify, but everything seems to be going solid now. :crossed_fingers: