Use XInput 9.1 which does not need an installer and works on most

windows platforms. Move the linking to irrlicht cmake.
This commit is contained in:
hiker 2017-08-08 21:44:32 +10:00
parent 620d1f34c1
commit bd5eb89cc0
3 changed files with 6 additions and 2 deletions

View File

@ -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"

View File

@ -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()

View File

@ -20,6 +20,10 @@
#include <regstr.h>
#include <winuser.h>
#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 <Xinput.h>
#ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#define DIRECTINPUT_VERSION 0x0800