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

# XGameStreamingGetAssociatedFrame

> XGameStreamingGetAssociatedFrame

# XGameStreamingGetAssociatedFrame

<Info>**사용되지 않음.** 이 API는 2604 GDK 릴리스 기준으로 사용되지 않으며 향후 GDK 릴리스에서 제거될 예정입니다. 대체 API는 없습니다. 지연 시간을 고려한 게임 플레이 조정을 위해 타이틀은 대신 [XGameStreamingGetStreamAddedLatency](/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency)를 사용해야 합니다.</Info>

특정 입력 판독값에서 프레임 파이프라인 토큰을 가져옵니다.

## 구문

```cpp theme={null}
HRESULT XGameStreamingGetAssociatedFrame(  
         IGameInputReading* gamepadReading,  
         D3D12XBOX_FRAME_PIPELINE_TOKEN* framePipelineToken  
)  
```

### 매개 변수

*gamepadReading*   \_In\_\
형식: IGameInputReading\*

쿼리되는 게임패드 판독값입니다.

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

플레이어가 입력했을 때 클라이언트 장치에 표시되었던 프레임과 연결된 프레임 파이프라인 토큰입니다. 이 파이프라인 토큰은 게임에서 렌더링하여 클라이언트 장치로 전송된 시점의 PresentX 호출에 해당합니다.

### 반환값

형식: HRESULT

성공하면 **S\_OK** 를 반환합니다. 그렇지 않으면 오류 코드를 반환합니다.

#### 잠재적 오류

| 오류 코드                                        | 오류 값       | 오류 원인                                                                                                                                                    |
| -------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_GAMESTREAMING\_NOT\_INITIALIZED           | 0x89245400 | XGameStreaming 런타임이 초기화되지 않았습니다. 다른 API를 호출하기 전에 [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize)를 호출합니다. |
| E\_GAMESTREAMING\_NO\_DATA                   | 0x89245402 | 요청된 데이터를 사용할 수 없습니다. 데이터는 나중에 사용할 수 있을 수도 있습니다.                                                                                                          |
| E\_GAMESTREAMING\_NOT\_STREAMING\_CONTROLLER | 0x89245404 | 현재 판독값이 스트리밍 컨트롤러에서 온 것이 아닙니다.                                                                                                                           |

## 설명

플레이어가 게임을 스트리밍하고 있을 때, 게임이 입력을 받을 당시 플레이어 장치에 어떤 특정 프레임이 표시되었는지에 따라 게임 동작을 변경해야 하는 경우 `XGameStreamingGetAssociatedFrame`을 활용할 수 있습니다.

이렇게 하면 게임은 현재 프레임이 아닌, 입력 당시 플레이어가 본 프레임을 기반으로 시뮬레이션 결정을 내릴 수 있습니다.

`XGameStreamingGetAssociatedFrame`은 새 입력 판독값이 생성될 때 표시되는 프레임에 대한 정보만 게임에 제공할 수 있습니다. 플레이어가 입력을 하지 않은 상태에서 무엇이 표시되고 있었는지 게임이 판별해야 하는 경우, 게임은 [XGameStreamingGetLastFrameDisplayed](/reference/system/xgamestreaming/functions/xgamestreaminggetlastframedisplayed)를 활용해야 합니다.

## 예제

```C++ theme={null}
// In this example, when processing input, the game would like to pass along the frame 
// that was being displayed to the player at the time of input 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)
{
    IGameInputReading* reading;
    if (SUCCEEDED(g_gameInput->GetCurrentReading(GameInputKindGamepad, g_gamepad, &reading)))
    {
        D3D12XBOX_FRAME_PIPELINE_TOKEN framePipelineToken = D3D12XBOX_FRAME_PIPELINE_TOKEN_NULL;        

        if SUCCEEDED(XGameStreamingGetAssociatedFrame(&reading, &framePipelineToken)) 
        {
            SimulateBasedOnInputAndFrameDisplayed(reading, framePipelineToken);
        }
        else 
        {
            // simulate based on current frame
            SimulateBasedOnInput(reading);
        }

        reading->Release();
    }
}

```

## 요구 사항

**헤더:** xgamestreaming.h

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

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

## 개념 설명서

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

## 함께 보기

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


## Related topics

- [XGameStreamingGetLastFrameDisplayed](/ko/reference/system/xgamestreaming/functions/xgamestreaminggetlastframedisplayed.md)
- [게임 스트리밍 지연 시간 보정 심층 분석](/ko/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive.md)
- [XGameStreaming](/ko/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingGetStreamAddedLatency](/ko/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency.md)
- [XGameStreamingGetClients](/ko/reference/system/xgamestreaming/functions/xgamestreaminggetclients.md)
