From bd5eb89cc0557c3863448b04785fa46acccd1f03 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 8 Aug 2017 21:44:32 +1000 Subject: [PATCH] Use XInput 9.1 which does not need an installer and works on most windows platforms. Move the linking to irrlicht cmake. --- CMakeLists.txt | 2 +- lib/irrlicht/CMakeLists.txt | 2 +- lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e1c9fcb1..552f04ac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -473,7 +473,7 @@ if(USE_WIIUSE) endif() if(MSVC OR MINGW) - target_link_libraries(supertuxkart iphlpapi.lib xinput) + target_link_libraries(supertuxkart iphlpapi.lib) add_custom_command(TARGET supertuxkart POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/dependencies/dll" diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt index c7d649612..545e857ca 100644 --- a/lib/irrlicht/CMakeLists.txt +++ b/lib/irrlicht/CMakeLists.txt @@ -570,5 +570,5 @@ if(ENABLE_WAYLAND_DEVICE) endif() if(WIN32) - target_link_libraries(stkirrlicht imm32) + target_link_libraries(stkirrlicht imm32 XINPUT9_1_0.LIB) endif() diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp index 04d568a36..a2834c7ab 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp @@ -20,6 +20,10 @@ #include #include #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) +// This define will switch to use XInput 9.1, which does not +// require an installer and works on most windows platforms. +// See https://blogs.msdn.microsoft.com/chuckw/2012/04/25/xinput-and-windows-8/ +#define _WIN32_WINNT 0x0601 #include #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #define DIRECTINPUT_VERSION 0x0800