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

# IGameInput::GetNextReading

> IGameInput::GetNextReading

# IGameInput::GetNextReading

선택적으로 필터링된 입력 스트림에서 참조 판독 값을 기준으로 다음으로 사용 가능한 [IGameInputReading](/reference/input/gameinput/interfaces/igameinputreading/igameinputreading) 인터페이스를 검색합니다.

## 구문

```cpp theme={null}
HRESULT GetNextReading(
    IGameInputReading* referenceReading,
    GameInputKind inputKind,
    IGameInputDevice* device,
    IGameInputReading** reading
);
```

### 매개변수

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

현재 [IGameInputReading](/reference/input/gameinput/interfaces/igameinputreading/igameinputreading)입니다. 반환되는 `IGameInputReading` 인터페이스는 이 참조 판독 값 다음의 판독 값입니다.

*inputKind*   \_In\_\
형식: [GameInputKind](/reference/input/gameinput/enums/gameinputkind)

다음 판독 값을 가져올 입력 유형에 대한 필터입니다. `GameInputKind` 인터페이스는 플래그 변수입니다. 여러 `GameInputKind` 상수로 필터링하기 위해 여러 값을 결합할 수 있습니다. 여러 입력 종류가 지정된 경우, 지정된 입력 종류 중 적어도 하나를 포함하는 판독 값이 일치하여 반환됩니다.

*device*   \_In\_opt\_\
형식: IGameInputDevice\*

다음 판독 값을 가져올 특정 장치에 대한 필터입니다.

*reading*   \_COM\_Outptr\_\
형식: IGameInputReading\*\*

`referenceReading` 입력 다음에 순차적으로 오는 반환된 `IGameInputReading` 인터페이스입니다.

### 반환값

형식: HRESULT

함수 결과.

## 설명

`GetNextReading` 및 `GetPreviousReading` 메서드는 앱이 입력 기록을 판독 값 단위로 순회할 수 있게 합니다.

`referenceReading` 다음에 판독 값이 없거나, 연결이 끊긴 장치에 대한 장치 필터가 제공되거나, 너무 많은 시간이 경과하여 참조 판독 값과 반환될 판독 값이 입력 스트림 기록 버퍼에서 벗어난 경우 `NULL` 값과 실패 `HRESULT`를 반환합니다. 입력 스트림이 기록 버퍼에서 각 장치로부터 0.5초 분량의 판독 값을 유지하므로, 입력을 지속적으로 처리하는 앱에서 경과 시간 오류는 드뭅니다.

다음 코드 예제는 특정 장치로부터 모든 게임패드 상태를 폴링하는 방법을 보여줍니다.

```cpp theme={null}
Microsoft::WRL::ComPtr<IGameInput> gameInput;
Microsoft::WRL::ComPtr<IGameInputDevice> gamepad;
Microsoft::WRL::ComPtr<IGameInputReading> prevReading;

void PollGamepadInput() noexcept
{
    if (!prevReading)
    {
        if (SUCCEEDED(gameInput->GetCurrentReading(
            GameInputKindGamepad,
            nullptr,
            &prevReading)))
        {
            prevReading->GetDevice(&gamepad);

            // Application-specific code to process the initial reading.
        }
    }

    else
    {
        Microsoft::WRL::ComPtr<IGameInputReading> nextReading;
        HRESULT hr = gameInput->GetNextReading(
            prevReading.Get(),
            GameInputKindGamepad,
            gamepad.Get(),
            &nextReading);

        if (SUCCEEDED(hr))
        {
            // Application-specific code to process the next reading.

            prevReading = nextReading;
        }

        else if (hr != GAMEINPUT_E_READING_NOT_FOUND)
        {
            gamepad = nullptr;
            prevReading = nullptr;
        }
    }
}
```

## 요구 사항

**헤더:** GameInput.h

[GameInput 개요](/build/core-features/common/input/overviews/input-overview)\
[IGameInput\_GetCurrentReading](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_getcurrentreading)\
[IGameInput\_GetPreviousReading](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_getpreviousreading)\
[IGameInput](/reference/input/gameinput/interfaces/igameinput/igameinput)

## 버전 기록

| 버전     | 변경 사항 |
| ------ | ----- |
| **v0** | 도입됨.  |


## Related topics

- [IGameInput::GetCurrentReading](/ko/reference/input/gameinput/interfaces/igameinput/methods/igameinput_getcurrentreading.md)
- [IGameInput::GetPreviousReading](/ko/reference/input/gameinput/interfaces/igameinput/methods/igameinput_getpreviousreading.md)
- [IGameInput::GetTemporalReading](/ko/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_gettemporalreading.md)
- [IGameInputReading::GetInputKind](/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind.md)
- [IGameInputReading::GetDevice](/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getdevice.md)
