> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud Aware API calls

> Cloud Aware API calls

Use this topic to detect if your Cloud Aware title is capable of streaming so that you can [optimize your game](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game) for XBOX Game Streaming.

## Set up your game for streaming

During game initialization, ensure that you've set up the game streaming component by using `XGameStreamingInitialize` as shown in the following code.

```C++ theme={null}

// Initialize the game streaming component
XGameStreamingInitialize();

```

To detect if there are any active streaming clients that are currently connected, use `XGameStreamingIsStreaming` as shown in the following code.

```C++ theme={null}
 if (XGameStreamingIsStreaming())
 {
     // The game is currently streaming to at least one device
     // Enable any customizations that might be useful when running from the cloud
 }
```

## Manage the connection state

If there are any active streaming clients, your game has a point-in-time understanding of those clients when using `XGameStreamingIsStreaming`. To receive notification when a streaming client connects or disconnects from your game, use [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged).

## Reference API documentation

* [XGameStreaming (API contents)](/reference/system/xgamestreaming/xgamestreaming_members)
  * Functions
    * [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)

## See also

[XGameStreaming (API contents)](/reference/system/xgamestreaming/xgamestreaming_members#connection-state)
[Optimizing your game](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game)


## Related topics

- [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
- [Optimizing your game for XBOX Game Streaming](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XBOX Cloud Gaming touch and streaming support](/build/core-features/common/game-streaming/index.md)
- [Getting started with touch](/build/core-features/common/game-streaming/game-streaming-getting-started-with-touch.md)
