@@ -86,6 +86,8 @@ namespace
8686
8787#if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION == 1)
8888using namespace GameInput ::v1;
89+ #elif defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION == 2)
90+ using namespace GameInput ::v2;
8991#endif
9092
9193// ======================================================================================
@@ -145,11 +147,11 @@ class GamePad::Impl
145147 {
146148 if (mGameInput )
147149 {
148- #if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION = = 1)
150+ #if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION > = 1)
149151 if (!mGameInput ->UnregisterCallback (mDeviceToken ))
150- #else
152+ #else
151153 if (!mGameInput ->UnregisterCallback (mDeviceToken , UINT64_MAX))
152- #endif
154+ #endif
153155 {
154156 DebugTrace (" ERROR: GameInput::UnregisterCallback [gamepad] failed" );
155157 }
@@ -197,7 +199,7 @@ class GamePad::Impl
197199 if (reading->GetGamepadState (&pad))
198200 {
199201 state.connected = true ;
200- #if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION = = 1)
202+ #if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION > = 1)
201203 state.packet = reading->GetTimestamp ();
202204 #else
203205 state.packet = reading->GetSequenceNumber (GameInputKindGamepad);
@@ -245,7 +247,7 @@ class GamePad::Impl
245247 {
246248 if (device->GetDeviceStatus () & GameInputDeviceConnected)
247249 {
248- #if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION = = 1)
250+ #if defined(GAMEINPUT_API_VERSION) && (GAMEINPUT_API_VERSION > = 1)
249251 const GameInputDeviceInfo* deviceInfo = nullptr ;
250252 device->GetDeviceInfo (&deviceInfo);
251253 #else
@@ -425,7 +427,7 @@ void GamePad::RegisterEvents(HANDLE ctrlChanged) noexcept
425427}
426428
427429_Success_ (return )
428- bool GamePad::GetDevice(int player, _Outptr_ IGameInputDevice * *device) noexcept
430+ bool GamePad::GetDevice(int player, _Outptr_ GameInputDevice_t * *device) noexcept
429431{
430432 return pImpl->GetDevice (player, device);
431433}
0 commit comments