Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
If you are developing for Xbox, version v.0 is the only version available on console and is included with the GDK installer. The GameInput v.1 API is currently for PC only and distributed via the Microsoft.GameInput NuGet package.
GameInput is a living API that will continue to evolve over time as new features are added, and unneeded/oudated ones are removed. The most recent version of GameInput can be found in the official NuGet package. This package will always contain the latest GameInput header, binaries, and redistributable to be included with your title.
Upgrading to a newer version of GameInput is designed to be quick and painless. Furthermore, regardless of the API described in the latest GameInput header, binary and functional compatibility is maintained for applications compiled against earlier versions of GameInput. In this model, shipped games can enjoy improvements in GameInput and can be transitioned to the latest version of GameInput, if necessary, to take advantage of new features.
Upgrading Runtime and API Version
Different versions of GameInput have similar-looking names and methods but are distinctly versioned with different UUIDs and (starting with GameInput API v.1) being defined in a unique namespace (for example, GameInput::v1). These interfaces are implemented by the same underlying objects in GameInput, and you can QueryInterface to switch between versions, allowing you to mix API usage in your game if so desired.
If you are upgrading from GameInput v.0 where the API was defined in the global namespace, you may find that adding a using namespace GameInput::v1
statement helps reduce the number of GameInput call sites that have to be updated for adoption of the v.1 API.
In addition to the runtime version checks, conditional compilation is possible by checking for the GAMEINPUT_API_VERSION
processor define. This define corresponds to the GameInput API version currently in use (as well as the GameInput major version). The v.0 API did not feature this definition, so if you would like to conditionally test for this version, you could add the following snippet after your GameInput header include.
#ifndef GAMEINPUT_API_VERSION
#define GAMEINPUT_API_VERSION 0
#endif
Upgrading Runtime Only
GameInput allows you to get the latest bugfixes without forcing you to update your API usage. To do so, simply install the GameInput redistributable bundled in the latest Microsoft.GameInput NuGet package. As GameInput remains binary compatible with older versions of the API, you are able to continue using your existing header with the new runtime.