mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-03 02:17:39 +00:00
Added checks for GameInput.h to the build system
This commit is contained in:
parent
ae076bdc2a
commit
a38cd7a067
6 changed files with 47 additions and 53 deletions
|
@ -1870,14 +1870,23 @@ elseif(WINDOWS)
|
|||
#include <windows.h>
|
||||
#include <xinput.h>
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_H)
|
||||
check_c_source_compiles("
|
||||
#define COBJMACROS
|
||||
#include <windows.gaming.input.h>
|
||||
__x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2 *s2;
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_WINDOWS_GAMING_INPUT_H)
|
||||
endif()
|
||||
|
||||
# headers needed elsewhere
|
||||
check_c_source_compiles("
|
||||
#define COBJMACROS
|
||||
#include <windows.gaming.input.h>
|
||||
static __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2 *s2;
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_WINDOWS_GAMING_INPUT_H
|
||||
)
|
||||
check_c_source_compiles("
|
||||
#include <stdbool.h>
|
||||
#define COBJMACROS
|
||||
#include <GameInput.h>
|
||||
// Requires Windows SDK version 10.0.26100.0 or newer
|
||||
static GameInputSystemButtons s = GameInputSystemButtonNone;
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_GAMEINPUT_H
|
||||
)
|
||||
check_include_file(dxgi1_6.h HAVE_DXGI1_6_H)
|
||||
check_include_file(tpcshrd.h HAVE_TPCSHRD_H)
|
||||
check_include_file(roapi.h HAVE_ROAPI_H)
|
||||
|
@ -2084,9 +2093,13 @@ elseif(WINDOWS)
|
|||
set(SDL_JOYSTICK_XINPUT 1)
|
||||
set(HAVE_XINPUT TRUE)
|
||||
endif()
|
||||
if(HAVE_WINDOWS_GAMING_INPUT_H)
|
||||
set(SDL_JOYSTICK_WGI 1)
|
||||
endif()
|
||||
endif()
|
||||
if(HAVE_WINDOWS_GAMING_INPUT_H)
|
||||
set(SDL_JOYSTICK_WGI 1)
|
||||
endif()
|
||||
if(HAVE_GAMEINPUT_H)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/gdk/*.c")
|
||||
set(SDL_JOYSTICK_GAMEINPUT 1)
|
||||
endif()
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
|
||||
|
|
|
@ -232,6 +232,7 @@
|
|||
#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
|
||||
#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
|
||||
#cmakedefine HAVE_WINDOWS_GAMING_INPUT_H @HAVE_WINDOWS_GAMING_INPUT_H@
|
||||
#cmakedefine HAVE_GAMEINPUT_H @HAVE_GAMEINPUT_H@
|
||||
#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
|
||||
#cmakedefine HAVE_DXGI1_6_H @HAVE_DXGI1_6_H@
|
||||
|
||||
|
@ -294,25 +295,26 @@
|
|||
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
|
||||
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
|
||||
#cmakedefine SDL_INPUT_WSCONS @SDL_INPUT_WSCONS@
|
||||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
||||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
||||
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
|
||||
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
|
||||
#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
|
||||
#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
|
||||
#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
|
||||
#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
|
||||
#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@
|
||||
#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@
|
||||
#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
||||
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
|
||||
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
|
||||
#cmakedefine SDL_JOYSTICK_GAMEINPUT @SDL_JOYSTICK_GAMEINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
||||
#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@
|
||||
#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
|
||||
#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
|
||||
#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
|
||||
#cmakedefine SDL_JOYSTICK_N3DS @SDL_JOYSTICK_N3DS@
|
||||
#cmakedefine SDL_JOYSTICK_PS2 @SDL_JOYSTICK_PS2@
|
||||
#cmakedefine SDL_JOYSTICK_PSP @SDL_JOYSTICK_PSP@
|
||||
#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
|
||||
#cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@
|
||||
#cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@
|
||||
#cmakedefine SDL_JOYSTICK_PSP @SDL_JOYSTICK_PSP@
|
||||
#cmakedefine SDL_JOYSTICK_PS2 @SDL_JOYSTICK_PS2@
|
||||
#cmakedefine SDL_JOYSTICK_N3DS @SDL_JOYSTICK_N3DS@
|
||||
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
|
||||
#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
|
||||
#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
|
||||
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
|
||||
#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
|
||||
|
|
|
@ -100,6 +100,9 @@ typedef unsigned int uintptr_t;
|
|||
#define HAVE_AUDIOCLIENT_H 1
|
||||
#define HAVE_TPCSHRD_H 1
|
||||
#define HAVE_SENSORSAPI_H 1
|
||||
#if defined(__has_include) && __has_include(<GameInput.h>)
|
||||
#define HAVE_GAMEINPUT_H 1
|
||||
#endif
|
||||
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||
# if !__has_include(<immintrin.h>)
|
||||
|
@ -233,7 +236,9 @@ typedef unsigned int uintptr_t;
|
|||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DINPUT 1
|
||||
/*#define SDL_JOYSTICK_GAMEINPUT 1*/
|
||||
#ifdef HAVE_GAMEINPUT_H
|
||||
#define SDL_JOYSTICK_GAMEINPUT 1
|
||||
#endif
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
#ifndef SDL_PLATFORM_WINRT
|
||||
#define SDL_JOYSTICK_RAWINPUT 1
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#define HAVE_AUDIOCLIENT_H 1
|
||||
#define HAVE_TPCSHRD_H 1
|
||||
#define HAVE_SENSORSAPI_H 1
|
||||
#define HAVE_GAMEINPUT_H 1
|
||||
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||
# if !__has_include(<immintrin.h>)
|
||||
|
@ -164,25 +165,14 @@
|
|||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DINPUT 1
|
||||
#define SDL_JOYSTICK_GAMEINPUT 1
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
#define SDL_JOYSTICK_RAWINPUT 1
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#ifdef HAVE_WINDOWS_GAMING_INPUT_H
|
||||
#define SDL_JOYSTICK_WGI 1
|
||||
#endif
|
||||
#define SDL_JOYSTICK_XINPUT 1
|
||||
#define SDL_HAPTIC_DINPUT 1
|
||||
|
||||
/* Native GameInput: */
|
||||
/*#define SDL_JOYSTICK_GAMEINPUT 1*/
|
||||
#if defined(SDL_JOYSTICK_GAMEINPUT) && (defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_DINPUT))
|
||||
#error "GameInput cannot co-exist, choose one."
|
||||
#endif /* defined(SDL_JOYSTICK_GAMEINPUT) && (defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_DINPUT)) */
|
||||
#if defined(SDL_JOYSTICK_GAMEINPUT) && SDL_JOYSTICK_GAMEINPUT
|
||||
/* TODO: Implement proper haptics for GameInput! */
|
||||
#define SDL_HAPTIC_DUMMY 1
|
||||
#endif /* defined(SDL_JOYSTICK_GAMEINPUT) && SDL_JOYSTICK_GAMEINPUT */
|
||||
|
||||
/* Enable the sensor driver */
|
||||
#ifdef HAVE_SENSORSAPI_H
|
||||
#define SDL_SENSOR_WINDOWS 1
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#define HAVE_AUDIOCLIENT_H 1
|
||||
/*#define HAVE_TPCSHRD_H 1*/
|
||||
/*#define HAVE_SENSORSAPI_H 1*/
|
||||
#define HAVE_GAMEINPUT_H 1
|
||||
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||
# if !__has_include(<immintrin.h>)
|
||||
|
@ -162,25 +163,12 @@
|
|||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
/*#define SDL_JOYSTICK_DINPUT 1*/
|
||||
/*#define SDL_JOYSTICK_HIDAPI 1*/
|
||||
/*#define SDL_JOYSTICK_RAWINPUT 1*/
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#ifdef HAVE_WINDOWS_GAMING_INPUT_H
|
||||
#define SDL_JOYSTICK_WGI 1
|
||||
#endif
|
||||
/* This is XInputOnGameInput for GDK platforms: */
|
||||
/*#define SDL_JOYSTICK_XINPUT 1*/
|
||||
/* Native GameInput: */
|
||||
#define SDL_JOYSTICK_GAMEINPUT 1
|
||||
#if defined(SDL_JOYSTICK_GAMEINPUT) && (defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_DINPUT))
|
||||
#error "GameInput cannot co-exist, choose one."
|
||||
#endif /* defined(SDL_JOYSTICK_GAMEINPUT) && (defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_DINPUT)) */
|
||||
#if defined(SDL_JOYSTICK_GAMEINPUT) && SDL_JOYSTICK_GAMEINPUT
|
||||
/* TODO: Implement proper haptics for GameInput! */
|
||||
#define SDL_HAPTIC_DUMMY 1
|
||||
#endif /* defined(SDL_JOYSTICK_GAMEINPUT) && SDL_JOYSTICK_GAMEINPUT */
|
||||
/*#define SDL_HAPTIC_DINPUT 1*/
|
||||
|
||||
/* Enable the sensor driver */
|
||||
#ifdef HAVE_SENSORSAPI_H
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
#if defined(__has_include) && __has_include(<GameInput.h>)
|
||||
#define HAVE_GAMEINPUT_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GAMEINPUT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue