> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::GetTouchSurfaceInfo

> 입력 장치의 터치 표면에 대한 정보를 가져옵니다.

입력 장치의 터치 표면에 대한 정보를 가져옵니다.

## 구문

```cpp theme={null}
HRESULT GetTouchSurfaceInfo(
    uint32_t surfaceIndex,
    GameInputTouchSurfaceInfo* info
);
```

### 매개변수

*surfaceIndex*\
형식: uint32\_t

터치 표면의 0부터 시작하는 인덱스입니다. [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md)가 반환하는 값보다 작아야 합니다.

*info*   \_Out\_\
형식: [GameInputTouchSurfaceInfo](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputtouchsurfaceinfo)\*

터치 표면에 대한 정보를 받습니다.

### 반환값

형식: HRESULT

성공하면 `S_OK`를 반환합니다. *surfaceIndex*가 장치의 터치 표면 수보다 크거나 같으면 `E_BOUNDS`를 반환하며, 이 경우 *info*는 0으로 채워집니다.

## 설명

반환된 정보는 표면이 보고할 수 있는 최대 동시 접촉 수, 장치 단위로 나타낸 표면의 크기, 터치패드나 터치스크린과 같은 표면의 유형을 설명합니다. [IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)가 보고하는 접촉 위치는 이 크기를 기준으로 하므로, 이를 사용하여 접촉 위치를 정규화할 수 있습니다.

이 정보는 장치 개체의 수명 동안 변경되지 않습니다.

다음 예제는 장치의 각 터치 표면에서 첫 번째 접촉의 위치를 \[0, 1) 범위로 정규화합니다.

```cpp theme={null}
void ProcessTouch(IGameInputDevice* device, IGameInputReading* reading) noexcept
{
    const uint32_t surfaceCount = device->GetTouchSurfaceCount();
    for (uint32_t surfaceIndex = 0; surfaceIndex < surfaceCount; ++surfaceIndex)
    {
        GameInputTouchSurfaceInfo info = {};
        if (FAILED(device->GetTouchSurfaceInfo(surfaceIndex, &info)) ||
            info.padWidth == 0 || info.padHeight == 0)
        {
            continue;
        }

        GameInputTouchContact contact = {};
        if (reading->GetTouchSurfaceState(surfaceIndex, 1, &contact) == 1)
        {
            const float x = static_cast<float>(contact.padX) / info.padWidth;
            const float y = static_cast<float>(contact.padY) / info.padHeight;
            // Use the normalized position (x, y) of the contact.
        }
    }
}
```

> [!NOTE]
>
> 터치 지원은 장치와 플랫폼에 따라 다릅니다.

## 요구 사항

**헤더:** GameInput.h

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

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

## 함께 보기

[GameInput 개요](https://docs.xbox.com/ko/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[GameInputTouchSurfaceInfo](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputtouchsurfaceinfo)\
[IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md)\
[IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)

## 버전 기록

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


## Related topics

- [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md)
- [IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)
- [IGameInputReading::GetTouchContactCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchcontactcount.md)
- [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)
- [IGameInputDevice::GetInputReportInfo](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportinfo.md)
