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

# XInputOnGameInputInitialize

> XInputOnGameInputInitialize

Initialize the XInput wrapper API.

## Syntax

```cpp theme={null}
HRESULT XInputOnGameInputInitialize(  
)  
```

### Parameters

### Return value

Type: HRESULT

Function's result.

## Remarks

To use this function, you must define the `XINPUT_ON_GAMEINPUT_EXPLICIT_INITIALIZATION` macro. By default, XInput is initialized in the background, and this causes the first call to an XInput function to take significantly more time, because it's bundled with the initialization work. `XINPUT_ON_GAMEINPUT_EXPLICIT_INITIALIZATION` gives you finer control over the initialization and uninitialization of XInput. To learn more and see the benefits of explicit initialization, read [Porting from XInput to GameInput](https://docs.xbox.com/build/core-features/common/input/porting/input-porting-xinput.md#optimizingSection).

## Requirements

**Header:** XInputOnGameInput.h

**Library:** xgameruntime.lib

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

## See also

[Port XInput to GameInput](https://docs.xbox.com/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/reference/input/xinputongameinput/xinputongameinput_members.md)\
[XInputOnGameInputUninitialize](https://docs.xbox.com/reference/input/xinputongameinput/functions/xinputongameinputuninitialize.md)


## Related topics

- [XInputOnGameInputUninitialize](https://docs.xbox.com/reference/input/xinputongameinput/functions/xinputongameinputuninitialize.md)
- [XInputOnGameInput (API contents)](https://docs.xbox.com/reference/input/xinputongameinput/xinputongameinput_members.md)
- [Porting from XInput to GameInput](https://docs.xbox.com/build/core-features/common/input/porting/input-porting-xinput.md)
- [GameInput fundamentals](https://docs.xbox.com/build/core-features/common/input/overviews/input-fundamentals.md)
- [Force feedback on GameInput](https://docs.xbox.com/build/core-features/common/input/advanced/input-forcefeedback.md)
