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

# IGameInputReading::GetTouchContactCount

> Retrieves the number of contacts on a touch surface in an input reading.

Retrieves the number of contacts on a touch surface in an input reading.

## Syntax

```cpp theme={null}
uint32_t GetTouchContactCount(
    uint32_t surfaceIndex
);
```

### Parameters

*surfaceIndex*   \_In\_\
Type: uint32\_t

Index of the touch surface. Must be less than the value returned by [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md).

### Return value

Type: uint32\_t

The number of contacts on the touch surface in this reading. Returns 0 if the reading doesn't contain touch data or if *surfaceIndex* isn't a valid surface index.

## Remarks

Use this method to size the array that's passed to [IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md). Calling `GetTouchSurfaceState` with a null contact array also returns the number of contacts. To allocate an array that's large enough for any reading, use the `maxContactCount` member of [GameInputTouchSurfaceInfo](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputtouchsurfaceinfo).

Readings that contain touch data include `GameInputKindTouch` in [IGameInputReading::GetInputKind](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind.md).

> [!NOTE]
>
> Touch support depends on the device and the platform.

## Requirements

**Header:** GameInput.h

**Library:** gameinput.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Overview of GameInput](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputReading](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)\
[IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)\
[IGameInputDevice::GetTouchSurfaceInfo](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfaceinfo.md)\
[GameInputTouchContact](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputtouchcontact)

## Version History

| Version | Changes |
| - | - |
| **v4** | Introduced. |


## Related topics

- [IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)
- [IGameInputReading::GetTouchCount (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputreading/methods/igameinputreading_gettouchcount.md)
- [IGameInputReading::GetTouchState (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputreading/methods/igameinputreading_gettouchstate.md)
- [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md)
- [IGameInputReading::GetSystemButtonState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getsystembuttonstate.md)
