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

# XInputGetState

> XInputGetState

# XInputGetState

지정된 컨트롤러의 현재 상태를 검색합니다.

<a id="syntaxSection" />

## 구문

```cpp theme={null}
DWORD XInputGetState(  
         DWORD dwUserIndex,  
         XINPUT_STATE * pState  
)  
```

<a id="parametersSection" />

### 매개변수

*dwUserIndex*   \_In\_\
형식: DWORD

장치와 연결된 게이머의 인덱스입니다. 값은 0에서 `XUSER_MAX_COUNT - 1` 범위입니다.

*pState*   \_Out\_\
형식: [XINPUT\_STATE](/reference/input/xinputongameinput/structs/xinput_state)\*

컨트롤러의 현재 상태를 받는 [XINPUT\_STATE](/reference/input/xinputongameinput/structs/xinput_state) 객체에 대한 포인터입니다.

<a id="retvalSection" />

### 반환값

형식: DWORD

함수가 성공하면 `ERROR_SUCCESS`를 반환합니다.

컨트롤러가 연결되어 있지 않으면 함수는 `ERROR_DEVICE_NOT_CONNECTED`를 반환합니다.

함수가 실패하면 WinError.h에 정의된 오류 코드를 반환합니다.

<a id="remarksSection" />

## 설명

이 함수는 왼쪽 트리거와 오른쪽 트리거를 별도로 보고합니다. DirectInput에서는 두 트리거가 동일한 축을 공유했습니다.

[XInputGetStateWithToken](/reference/input/xinputongameinput/functions/xinputgetstatewithtoken) 함수는 유사하지만, 나중에 PIX에서 분석할 수 있도록 특정 입력 리딩을 그래픽 프레임과 연결할 수 있도록 호출자가 D3DX 프레임 파이프라인 토큰을 제공하도록 허용합니다.

자세한 내용은 [XInputOnGameInput 래퍼](/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection)를 참조하세요.

<a id="requirementsSection" />

## 요구 사항

**헤더:** XInputOnGameInput.h

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

**지원 플랫폼:** XBOX One 제품군 콘솔 및 XBOX Series 콘솔

<a id="seealsoSection" />

## 참고 항목

[XInput에서 GameInput으로 이식](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputGetStateWithToken](/ko/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md)
- [XInputEnable](/ko/reference/input/xinputongameinput/functions/xinputenable.md)
- [XINPUT_STATE](/ko/reference/input/xinputongameinput/structs/xinput_state.md)
- [XInput에서 GameInput으로 포팅](/ko/build/core-features/common/input/porting/input-porting-xinput.md)
- [XInputOnGameInput](/ko/reference/input/xinputongameinput/xinputongameinput_members.md)
