> ## 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>**사용되지 않음(Deprecated).** 이 API는 2604 GDK 릴리스부터 사용되지 않으며 향후 GDK 릴리스에서 제거될 예정입니다. 대체 API는 없습니다. 지연 시간을 고려한 게임 플레이 조정에는 [XGameStreamingGetStreamAddedLatency](/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency)를 대신 사용해야 합니다.</Info>

스트리밍 클라이언트의 화면에 가장 최근에 표시된 프레임의 프레임 파이프라인 토큰을 가져옵니다.

## 구문

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

### 매개 변수

*client*   \_In\_\
형식: XGameStreamingClientId

쿼리 대상 스트리밍 클라이언트 장치의 ID입니다.

*framePipelineToken*   \_Out\_\
형식: D3D12XBOX\_FRAME\_PIPELINE\_TOKEN\*

클라이언트 장치에 마지막으로 표시된 프레임 파이프라인 토큰입니다.

### 반환 값

형식: 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 | 요청한 데이터를 사용할 수 없습니다. 데이터는 나중에 사용할 수 있게 될 수 있습니다.                                                                                                         |

## 설명

플레이어가 게임을 스트리밍할 때, 특정 프레임이 사용자의 화면에 표시되었음을 확인한 뒤 게임 동작을 변경해야 하는 경우 `XGameStreamingGetLastFrameDisplayed`를 활용할 수 있습니다.

게임에서 이를 활용할 수 있는 예로는 다음과 같은 경우가 있습니다.

* 시각적 타이머가 만료되었지만 플레이어가 만료 전에 아무 동작도 하지 않은 경우.
* 적절한 시간 창 내에 동작이 이루어지지 않은 경우.
* 플레이어가 경계를 벗어난 상태에서 계속 움직였고 복구를 위한 동작을 취하지 않은 경우.

`XGameStreamingGetLastFrameDisplayed`는 동작이 이루어졌어야 하지만 이루어지지 않은 시점을 파악하려는 경우에 사용해야 합니다. 게임이 플레이어가 입력을 **수행했을 때** 무엇이 표시되고 있었는지 판단해야 하는 경우에는 [XGameStreamingGetAssociatedFrame](/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe)을 사용해야 합니다.

## 예제

```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();
    }

    
      
    ...
}

```

## 요구 사항

**헤더:** xgamestreaming.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 개념 문서

* [게임 스트리밍 지연 보정 심층 분석](/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive)

## 함께 보기

[XGameStreamingGetAssociatedFrame](/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members#Latency)\
[게임 스트리밍 지연 보정 개요](/build/core-features/common/game-streaming/game-streaming-latency-compensation-overview)


## Related topics

- [XGameStreamingGetAssociatedFrame](/ko/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe.md)
- [게임 스트리밍 지연 시간 보정 심층 분석](/ko/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive.md)
- [XGameStreaming](/ko/reference/system/xgamestreaming/xgamestreaming_members.md)
- [GDK용 Unity C# API 래퍼](/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [GetLastXmaFrameBitPosition](/ko/reference/audio/xma2defs/functions/getlastxmaframebitposition.md)
