> ## 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.

# XGameStreamingGetLastFrameDisplayed

> XGameStreamingGetLastFrameDisplayed

# XGameStreamingGetLastFrameDisplayed

<Info>**非推奨。** この API は 2604 GDK リリース以降非推奨となっており、今後の GDK リリースで削除されます。代替 API はありません。タイトルはレイテンシを考慮したゲームプレイ調整のために代わりに [XGameStreamingGetStreamAddedLatency](/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency) を使用してください。</Info>

ストリーミング クライアントの画面で最後に表示されたフレームのフレーム パイプライン トークンを取得します。

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetLastFrameDisplayed(  
         XGameStreamingClientId client,  
         D3D12XBOX_FRAME_PIPELINE_TOKEN* framePipelineToken  
)  
```

### Parameters

*client*   \_In\_\
型: XGameStreamingClientId

照会するストリーミング クライアント デバイスの ID。

*framePipelineToken*   \_Out\_\
型: D3D12XBOX\_FRAME\_PIPELINE\_TOKEN\*

クライアント デバイスに最後に表示されたフレーム パイプライン トークン。

### Return value

型: HRESULT

成功した場合は **S\_OK** を返します。それ以外の場合はエラー コードを返します。

#### 想定されるエラー

| エラー コード                                  | エラー値       | エラーの理由                                                                                                                                                     |
| ---------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_GAMESTREAMING\_NOT\_INITIALIZED       | 0x89245400 | XGameStreaming ランタイムが初期化されていません。他の API を呼び出す前に [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize) を呼び出してください。 |
| E\_GAMESTREAMING\_CLIENT\_NOT\_CONNECTED | 0x89245401 | 指定されたクライアントが接続されていません。                                                                                                                                     |
| E\_GAMESTREAMING\_NO\_DATA               | 0x89245402 | 要求されたデータは利用できません。データは後で利用可能になる場合があります。                                                                                                                     |

## Remarks

プレイヤーがゲームをストリーミング中に、特定のフレームがユーザーの画面に表示されたことの確認に基づいてゲームの動作を変更する必要がある場合、`XGameStreamingGetLastFrameDisplayed` を利用できます。

ゲームがこれを利用する例として、以下のようなケースがあります。

* 視覚的なタイマーの期限が切れ、プレイヤーが期限までにアクションを行わなかった。
* 適切なウィンドウ内でアクションが行われなかった。
* プレイヤーが動作を続けて範囲外に移動し、リカバリーのためのアクションを行わなかった。

`XGameStreamingGetLastFrameDisplayed` は、アクションが行われるべきだったのに行われなかった状況を判定する際に使用します。プレイヤーによって入力が **行われた** ときに何が表示されていたかをゲームが判定する必要がある場合は、[XGameStreamingGetAssociatedFrame](/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe) を利用してください。

## Example

```C++ theme={null}
// In this example, when processing input, the game would like to pass along the last frame 
// that was being displayed to the player so that their simulation engine can take that into account.
 

// The framePipelineToken was initially captured at the callback of WaitFrameEventX

void Game::Update(DX::StepTimer const& timer)
{
    ...

    D3D12XBOX_FRAME_PIPELINE_TOKEN framePipelineToken = D3D12XBOX_FRAME_PIPELINE_TOKEN_NULL;
    if SUCCEEDED(XGameStreamingGetLastFrameDisplayed(clientId, &framePipelineToken)
    {
        SimulateBasedOnLastFrameDisplayed(framePipelineToken);
    }
    else 
    {
        // don't have last token, potentially simulate based on current frame

        SimulateBasedOnCurrentFrame();
    }

    
      
    ...
}

```

## Requirements

**ヘッダー:** xgamestreaming.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [Game streaming latency compensation deep dive](/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive)

## See also

[XGameStreamingGetAssociatedFrame](/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members#Latency)\
[Game Streaming Latency Compensation Overview](/build/core-features/common/game-streaming/game-streaming-latency-compensation-overview)


## Related topics

- [XGameStreamingGetAssociatedFrame](/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe.md)
- [ゲーム ストリーミング レイテンシー補正の詳細](/ja-jp/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive.md)
- [XGameStreaming](/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [GetLastXmaFrameBitPosition](/ja-jp/reference/audio/xma2defs/functions/getlastxmaframebitposition.md)
