SteamAPI_Init function to initialize the API. Optionally, you can call SteamAPI_RestartAppIfNecessary to relaunch the app through Steam if necessary. Initializing the XBOX Game Development Kit (GDK) is a bit more involved, because there isn’t a unified app used to launch the game and communicate with the different gaming services like there is on Steam.
To start using the APIs in the XBOX Game Development Kit (GDK), you need to use the following steps.
- Add a MicrosoftGame.config file to your project.
- Initialize the Gaming Runtime service.
- Initialize the XBOX Services API to make calls to XBOX Live for user identity, cloud saves, achievements, and more.
- Sign the user in to XBOX Live. Store the handle and XBOX User ID (XUID) that was returned after a successful sign-in for future use.
On Steam, you have access to the user’s Steam ID and all the APIs at load time, because the Steam launcher automatically injects the user’s account information when games are launched from their service. The XBOX Live APIs are used by games across multiple launchers, so you don’t get this for free. You need to manually sign the user in at launch.
XTaskQueue because that’s automatically created for you if you leave it blank.
Sign the user in to XBOX Live
Use the XUserAddAsync API to sign a user in to XBOX Live. If this is the first time they’re signing in to your game, they’re given a list of privileges that your game is requesting. They’ll need to explicitly authorize these privileges to access their XBOX Live account. After they’re successfully signed in, you can use theXUserHandle reference that you passed into the XUserAddResult function. It can be used to obtain information about that XBOX Live user, such as their gamertag, gamer photo, sign-in state, age group, and privileges.
After the user signs in for the first time, they should be able to successfully sign in silently (that is, with no action required on their part) if they don’t need to resolve a UI prompt (such as a new privacy agreement) since they last launched the game. However, you’ll still need to make these API calls to gain identity access.
An XblContextHandle will be needed to call XBOX Live APIs. You can use the XblContextCreateHandle function to get an XblContextHandle by using an XUserHandle.