Unified · Split
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | <plist version="1.0"> |
| 4 | 4 | <dict> |
| 5 | 5 | <key>BuildMachineOSBuild</key> |
| 6 | − <string>18G87</string> | |
| 6 | + <string>19E287</string> | |
| 7 | 7 | <key>CFBundleDevelopmentRegion</key> |
| 8 | 8 | <string>English</string> |
| 9 | 9 | <key>CFBundleExecutable</key> |
| @@ -27,17 +27,19 @@ · 17 unmodified lines | ||
| 27 | 27 | <key>DTCompiler</key> |
| 28 | 28 | <string>com.apple.compilers.llvm.clang.1_0</string> |
| 29 | 29 | <key>DTPlatformBuild</key> |
| 30 | − <string>11C504</string> | |
| 30 | + <string>12C33</string> | |
| 31 | + <key>DTPlatformName</key> | |
| 32 | + <string>macosx</string> | |
| 31 | 33 | <key>DTPlatformVersion</key> |
| 32 | − <string>GM</string> | |
| 34 | + <string>11.1</string> | |
| 33 | 35 | <key>DTSDKBuild</key> |
| 34 | − <string>19B90</string> | |
| 36 | + <string>20C63</string> | |
| 35 | 37 | <key>DTSDKName</key> |
| 36 | − <string>macosx10.15</string> | |
| 38 | + <string>macosx11.1</string> | |
| 37 | 39 | <key>DTXcode</key> |
| 38 | − <string>1130</string> | |
| 40 | + <string>1230</string> | |
| 39 | 41 | <key>DTXcodeBuild</key> |
| 40 | − <string>11C504</string> | |
| 42 | + <string>12C33</string> | |
| 41 | 43 | <key>LSMinimumSystemVersion</key> |
| 42 | 44 | <string>10.6</string> |
| 43 | 45 | </dict> |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | </data> |
| 11 | 11 | <key>Resources/Info.plist</key> |
| 12 | 12 | <data> |
| 13 | − eqy0vvISpY1m2UE2zzwN5nsOg00= | |
| 13 | + tGFoM6QHKngffYbWA76aPn/ESNM= | |
| 14 | 14 | </data> |
| 15 | 15 | <key>Resources/LICENSE-bsd.txt</key> |
| 16 | 16 | <data> |
| @@ -46,11 +46,11 @@ · 29 unmodified lines | ||
| 46 | 46 | <dict> |
| 47 | 47 | <key>hash</key> |
| 48 | 48 | <data> |
| 49 | − eqy0vvISpY1m2UE2zzwN5nsOg00= | |
| 49 | + tGFoM6QHKngffYbWA76aPn/ESNM= | |
| 50 | 50 | </data> |
| 51 | 51 | <key>hash2</key> |
| 52 | 52 | <data> |
| 53 | − URtZhZZMVQ0W8AnIoo1VF2mkN9aBvt5La1el7xY0mGU= | |
| 53 | + fgTFYKM0llbznibqeBwDi/6Y3eVW0HtYW+1EdComD7E= | |
| 54 | 54 | </data> |
| 55 | 55 | </dict> |
| 56 | 56 | <key>Resources/LICENSE-bsd.txt</key> |
Binary file not shown.
| @@ -59,6 +59,8 @@ · 58 unmodified lines | ||
| 59 | 59 | #include "SDL_timer.h" |
| 60 | 60 | #include "SDL_version.h" |
| 61 | 61 | #include "SDL_video.h" |
| 62 | +#include "SDL_locale.h" | |
| 63 | +#include "SDL_misc.h" | |
| 62 | 64 | |
| 63 | 65 | #include "begin_code.h" |
| 64 | 66 | /* Set up for C function definitions, even when using C++ */ |
| @@ -53,6 +53,8 @@ assert can have unique static variables associated with it. · 52 unmodified lines | ||
| 53 | 53 | #define SDL_TriggerBreakpoint() __debugbreak() |
| 54 | 54 | #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) |
| 55 | 55 | #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) |
| 56 | +#elif ( defined(__APPLE__) && defined(__arm64__) ) /* this might work on other ARM targets, but this is a known quantity... */ | |
| 57 | + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) | |
| 56 | 58 | #elif defined(__386__) && defined(__WATCOMC__) |
| 57 | 59 | #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } |
| 58 | 60 | #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) |
| @@ -125,6 +125,8 @@ · 124 unmodified lines | ||
| 125 | 125 | #define HAVE_SQRTF 1 |
| 126 | 126 | #define HAVE_TAN 1 |
| 127 | 127 | #define HAVE_TANF 1 |
| 128 | +#define HAVE_TRUNC 1 | |
| 129 | +#define HAVE_TRUNCF 1 | |
| 128 | 130 | #define HAVE_SIGACTION 1 |
| 129 | 131 | #define HAVE_SETJMP 1 |
| 130 | 132 | #define HAVE_NANOSLEEP 1 |
| @@ -139,10 +141,16 @@ · 8 unmodified lines | ||
| 139 | 141 | #define SDL_AUDIO_DRIVER_DUMMY 1 |
| 140 | 142 | |
| 141 | 143 | /* Enable various input drivers */ |
| 144 | +#define SDL_JOYSTICK_HIDAPI 1 | |
| 142 | 145 | #define SDL_JOYSTICK_IOKIT 1 |
| 143 | −#define SDL_JOYSTICK_HIDAPI 1 | |
| 146 | +#define SDL_JOYSTICK_VIRTUAL 1 | |
| 144 | 147 | #define SDL_HAPTIC_IOKIT 1 |
| 145 | 148 | |
| 149 | +/* The MFI controller support requires ARC Objective C runtime */ | |
| 150 | +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__) | |
| 151 | +#define SDL_JOYSTICK_MFI 1 | |
| 152 | +#endif | |
| 153 | + | |
| 146 | 154 | /* Enable the dummy sensor driver */ |
| 147 | 155 | #define SDL_SENSOR_DUMMY 1 |
| 148 | 156 | |
| @@ -195,7 +203,7 @@ · 46 unmodified lines | ||
| 195 | 203 | #endif |
| 196 | 204 | |
| 197 | 205 | /* Metal only supported on 64-bit architectures with 10.11+ */ |
| 198 | −#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) | |
| 206 | +#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) | |
| 199 | 207 | #define SDL_PLATFORM_SUPPORTS_METAL 1 |
| 200 | 208 | #else |
| 201 | 209 | #define SDL_PLATFORM_SUPPORTS_METAL 0 |
| @@ -246,10 +246,33 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); · 245 unmodified lines | ||
| 246 | 246 | * \return Pointer to newly-allocated block, NULL if out of memory. |
| 247 | 247 | * |
| 248 | 248 | * \sa SDL_SIMDAlignment |
| 249 | + * \sa SDL_SIMDRealloc | |
| 249 | 250 | * \sa SDL_SIMDFree |
| 250 | 251 | */ |
| 251 | 252 | extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); |
| 252 | 253 | |
| 254 | +/** | |
| 255 | + * \brief Reallocate memory obtained from SDL_SIMDAlloc | |
| 256 | + * | |
| 257 | + * It is not valid to use this function on a pointer from anything but | |
| 258 | + * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, | |
| 259 | + * SDL_malloc, memalign, new[], etc. | |
| 260 | + * | |
| 261 | + * \param mem The pointer obtained from SDL_SIMDAlloc. This function also | |
| 262 | + * accepts NULL, at which point this function is the same as | |
| 263 | + * calling SDL_realloc with a NULL pointer. | |
| 264 | + * \param len The length, in bytes, of the block to allocated. The actual | |
| 265 | + * allocated block might be larger due to padding, etc. Passing 0 | |
| 266 | + * will return a non-NULL pointer, assuming the system isn't out of | |
| 267 | + * memory. | |
| 268 | + * \return Pointer to newly-reallocated block, NULL if out of memory. | |
| 269 | + * | |
| 270 | + * \sa SDL_SIMDAlignment | |
| 271 | + * \sa SDL_SIMDAlloc | |
| 272 | + * \sa SDL_SIMDFree | |
| 273 | + */ | |
| 274 | +extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len); | |
| 275 | + | |
| 253 | 276 | /** |
| 254 | 277 | * \brief Deallocate memory obtained from SDL_SIMDAlloc |
| 255 | 278 | * |
| @@ -260,6 +283,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); · 4 unmodified lines | ||
| 260 | 283 | * However, SDL_SIMDFree(NULL) is a legal no-op. |
| 261 | 284 | * |
| 262 | 285 | * \sa SDL_SIMDAlloc |
| 286 | + * \sa SDL_SIMDRealloc | |
| 263 | 287 | */ |
| 264 | 288 | extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); |
| 265 | 289 | |
| @@ -37,9 +37,45 @@ extern "C" { · 36 unmodified lines | ||
| 37 | 37 | #endif |
| 38 | 38 | |
| 39 | 39 | /* Public functions */ |
| 40 | −/* SDL_SetError() unconditionally returns -1. */ | |
| 40 | + | |
| 41 | + | |
| 42 | +/** | |
| 43 | + * \brief Set the error message for the current thread | |
| 44 | + * | |
| 45 | + * \return -1, there is no error handling for this function | |
| 46 | + */ | |
| 41 | 47 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); |
| 48 | + | |
| 49 | +/** | |
| 50 | + * \brief Get the last error message that was set | |
| 51 | + * | |
| 52 | + * SDL API functions may set error messages and then succeed, so you should | |
| 53 | + * only use the error value if a function fails. | |
| 54 | + * | |
| 55 | + * This returns a pointer to a static buffer for convenience and should not | |
| 56 | + * be called by multiple threads simultaneously. | |
| 57 | + * | |
| 58 | + * \return a pointer to the last error message that was set | |
| 59 | + */ | |
| 42 | 60 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); |
| 61 | + | |
| 62 | +/** | |
| 63 | + * \brief Get the last error message that was set for the current thread | |
| 64 | + * | |
| 65 | + * SDL API functions may set error messages and then succeed, so you should | |
| 66 | + * only use the error value if a function fails. | |
| 67 | + * | |
| 68 | + * \param errstr A buffer to fill with the last error message that was set | |
| 69 | + * for the current thread | |
| 70 | + * \param maxlen The size of the buffer pointed to by the errstr parameter | |
| 71 | + * | |
| 72 | + * \return errstr | |
| 73 | + */ | |
| 74 | +extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); | |
| 75 | + | |
| 76 | +/** | |
| 77 | + * \brief Clear the error message for the current thread | |
| 78 | + */ | |
| 43 | 79 | extern DECLSPEC void SDLCALL SDL_ClearError(void); |
| 44 | 80 | |
| 45 | 81 | /** |
| @@ -85,6 +85,8 @@ typedef enum · 84 unmodified lines | ||
| 85 | 85 | Called on Android in onResume() |
| 86 | 86 | */ |
| 87 | 87 | |
| 88 | + SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */ | |
| 89 | + | |
| 88 | 90 | /* Display events */ |
| 89 | 91 | SDL_DISPLAYEVENT = 0x150, /**< Display state change */ |
| 90 | 92 | |
| @@ -123,6 +125,10 @@ typedef enum · 32 unmodified lines | ||
| 123 | 125 | SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ |
| 124 | 126 | SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ |
| 125 | 127 | SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ |
| 128 | + SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */ | |
| 129 | + SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ | |
| 130 | + SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ | |
| 131 | + SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ | |
| 126 | 132 | |
| 127 | 133 | /* Touch events */ |
| 128 | 134 | SDL_FINGERDOWN = 0x700, |
| @@ -413,6 +419,33 @@ typedef struct SDL_ControllerDeviceEvent · 284 unmodified lines | ||
| 413 | 419 | Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ |
| 414 | 420 | } SDL_ControllerDeviceEvent; |
| 415 | 421 | |
| 422 | +/** | |
| 423 | + * \brief Game controller touchpad event structure (event.ctouchpad.*) | |
| 424 | + */ | |
| 425 | +typedef struct SDL_ControllerTouchpadEvent | |
| 426 | +{ | |
| 427 | + Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ | |
| 428 | + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ | |
| 429 | + SDL_JoystickID which; /**< The joystick instance id */ | |
| 430 | + Sint32 touchpad; /**< The index of the touchpad */ | |
| 431 | + Sint32 finger; /**< The index of the finger on the touchpad */ | |
| 432 | + float x; /**< Normalized in the range 0...1 with 0 being on the left */ | |
| 433 | + float y; /**< Normalized in the range 0...1 with 0 being at the top */ | |
| 434 | + float pressure; /**< Normalized in the range 0...1 */ | |
| 435 | +} SDL_ControllerTouchpadEvent; | |
| 436 | + | |
| 437 | +/** | |
| 438 | + * \brief Game controller sensor event structure (event.csensor.*) | |
| 439 | + */ | |
| 440 | +typedef struct SDL_ControllerSensorEvent | |
| 441 | +{ | |
| 442 | + Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ | |
| 443 | + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ | |
| 444 | + SDL_JoystickID which; /**< The joystick instance id */ | |
| 445 | + Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ | |
| 446 | + float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ | |
| 447 | +} SDL_ControllerSensorEvent; | |
| 448 | + | |
| 416 | 449 | /** |
| 417 | 450 | * \brief Audio device event structure (event.adevice.*) |
| 418 | 451 | */ |
| @@ -557,33 +590,35 @@ typedef struct SDL_SysWMEvent · 138 unmodified lines | ||
| 557 | 590 | */ |
| 558 | 591 | typedef union SDL_Event |
| 559 | 592 | { |
| 560 | − Uint32 type; /**< Event type, shared with all events */ | |
| 561 | − SDL_CommonEvent common; /**< Common event data */ | |
| 562 | − SDL_DisplayEvent display; /**< Display event data */ | |
| 563 | − SDL_WindowEvent window; /**< Window event data */ | |
| 564 | − SDL_KeyboardEvent key; /**< Keyboard event data */ | |
| 565 | − SDL_TextEditingEvent edit; /**< Text editing event data */ | |
| 566 | − SDL_TextInputEvent text; /**< Text input event data */ | |
| 567 | − SDL_MouseMotionEvent motion; /**< Mouse motion event data */ | |
| 568 | − SDL_MouseButtonEvent button; /**< Mouse button event data */ | |
| 569 | − SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ | |
| 570 | − SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ | |
| 571 | − SDL_JoyBallEvent jball; /**< Joystick ball event data */ | |
| 572 | − SDL_JoyHatEvent jhat; /**< Joystick hat event data */ | |
| 573 | − SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ | |
| 574 | − SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ | |
| 575 | − SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ | |
| 576 | − SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ | |
| 577 | − SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ | |
| 578 | − SDL_AudioDeviceEvent adevice; /**< Audio device event data */ | |
| 579 | − SDL_SensorEvent sensor; /**< Sensor event data */ | |
| 580 | − SDL_QuitEvent quit; /**< Quit request event data */ | |
| 581 | − SDL_UserEvent user; /**< Custom event data */ | |
| 582 | − SDL_SysWMEvent syswm; /**< System dependent window event data */ | |
| 583 | − SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ | |
| 584 | − SDL_MultiGestureEvent mgesture; /**< Gesture event data */ | |
| 585 | − SDL_DollarGestureEvent dgesture; /**< Gesture event data */ | |
| 586 | − SDL_DropEvent drop; /**< Drag and drop event data */ | |
| 593 | + Uint32 type; /**< Event type, shared with all events */ | |
| 594 | + SDL_CommonEvent common; /**< Common event data */ | |
| 595 | + SDL_DisplayEvent display; /**< Display event data */ | |
| 596 | + SDL_WindowEvent window; /**< Window event data */ | |
| 597 | + SDL_KeyboardEvent key; /**< Keyboard event data */ | |
| 598 | + SDL_TextEditingEvent edit; /**< Text editing event data */ | |
| 599 | + SDL_TextInputEvent text; /**< Text input event data */ | |
| 600 | + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ | |
| 601 | + SDL_MouseButtonEvent button; /**< Mouse button event data */ | |
| 602 | + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ | |
| 603 | + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ | |
| 604 | + SDL_JoyBallEvent jball; /**< Joystick ball event data */ | |
| 605 | + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ | |
| 606 | + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ | |
| 607 | + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ | |
| 608 | + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ | |
| 609 | + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ | |
| 610 | + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ | |
| 611 | + SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */ | |
| 612 | + SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */ | |
| 613 | + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ | |
| 614 | + SDL_SensorEvent sensor; /**< Sensor event data */ | |
| 615 | + SDL_QuitEvent quit; /**< Quit request event data */ | |
| 616 | + SDL_UserEvent user; /**< Custom event data */ | |
| 617 | + SDL_SysWMEvent syswm; /**< System dependent window event data */ | |
| 618 | + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ | |
| 619 | + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ | |
| 620 | + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ | |
| 621 | + SDL_DropEvent drop; /**< Drag and drop event data */ | |
| 587 | 622 | |
| 588 | 623 | /* This is necessary for ABI compatibility between Visual C++ and GCC |
| 589 | 624 | Visual C++ will respect the push pack pragma and use 52 bytes for |
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include "SDL_stdinc.h" |
| 32 | 32 | #include "SDL_error.h" |
| 33 | 33 | #include "SDL_rwops.h" |
| 34 | +#include "SDL_sensor.h" | |
| 34 | 35 | #include "SDL_joystick.h" |
| 35 | 36 | |
| 36 | 37 | #include "begin_code.h" |
| @@ -64,7 +65,9 @@ typedef enum · 27 unmodified lines | ||
| 64 | 65 | SDL_CONTROLLER_TYPE_XBOXONE, |
| 65 | 66 | SDL_CONTROLLER_TYPE_PS3, |
| 66 | 67 | SDL_CONTROLLER_TYPE_PS4, |
| 67 | − SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO | |
| 68 | + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, | |
| 69 | + SDL_CONTROLLER_TYPE_VIRTUAL, | |
| 70 | + SDL_CONTROLLER_TYPE_PS5 | |
| 68 | 71 | } SDL_GameControllerType; |
| 69 | 72 | |
| 70 | 73 | typedef enum |
| @@ -170,7 +173,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID · 99 unmodified lines | ||
| 170 | 173 | * |
| 171 | 174 | * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available |
| 172 | 175 | */ |
| 173 | −extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); | |
| 176 | +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller); | |
| 174 | 177 | |
| 175 | 178 | /** |
| 176 | 179 | * Is the joystick on this index supported by the game controller interface? |
| @@ -245,19 +248,26 @@ extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController · 68 unmodified lines | ||
| 245 | 248 | * Get the USB vendor ID of an opened controller, if available. |
| 246 | 249 | * If the vendor ID isn't available this function returns 0. |
| 247 | 250 | */ |
| 248 | −extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); | |
| 251 | +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller); | |
| 249 | 252 | |
| 250 | 253 | /** |
| 251 | 254 | * Get the USB product ID of an opened controller, if available. |
| 252 | 255 | * If the product ID isn't available this function returns 0. |
| 253 | 256 | */ |
| 254 | −extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); | |
| 257 | +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller); | |
| 255 | 258 | |
| 256 | 259 | /** |
| 257 | 260 | * Get the product version of an opened controller, if available. |
| 258 | 261 | * If the product version isn't available this function returns 0. |
| 259 | 262 | */ |
| 260 | −extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); | |
| 263 | +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller); | |
| 264 | + | |
| 265 | +/** | |
| 266 | + * Get the serial number of an opened controller, if available. | |
| 267 | + * | |
| 268 | + * Returns the serial number of the controller, or NULL if it is not available. | |
| 269 | + */ | |
| 270 | +extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); | |
| 261 | 271 | |
| 262 | 272 | /** |
| 263 | 273 | * Returns SDL_TRUE if the controller has been opened and currently connected, |
| @@ -328,6 +338,12 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL · 64 unmodified lines | ||
| 328 | 338 | SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, |
| 329 | 339 | SDL_GameControllerAxis axis); |
| 330 | 340 | |
| 341 | +/** | |
| 342 | + * Return whether a game controller has a given axis | |
| 343 | + */ | |
| 344 | +extern DECLSPEC SDL_bool SDLCALL | |
| 345 | +SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); | |
| 346 | + | |
| 331 | 347 | /** |
| 332 | 348 | * Get the current state of an axis control on a game controller. |
| 333 | 349 | * |
| @@ -337,8 +353,7 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, · 3 unmodified lines | ||
| 337 | 353 | * The axis indices start at index 0. |
| 338 | 354 | */ |
| 339 | 355 | extern DECLSPEC Sint16 SDLCALL |
| 340 | −SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, | |
| 341 | − SDL_GameControllerAxis axis); | |
| 356 | +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); | |
| 342 | 357 | |
| 343 | 358 | /** |
| 344 | 359 | * The list of buttons available from a controller |
| @@ -361,6 +376,12 @@ typedef enum · 16 unmodified lines | ||
| 361 | 376 | SDL_CONTROLLER_BUTTON_DPAD_DOWN, |
| 362 | 377 | SDL_CONTROLLER_BUTTON_DPAD_LEFT, |
| 363 | 378 | SDL_CONTROLLER_BUTTON_DPAD_RIGHT, |
| 379 | + SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */ | |
| 380 | + SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */ | |
| 381 | + SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */ | |
| 382 | + SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */ | |
| 383 | + SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */ | |
| 384 | + SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ | |
| 364 | 385 | SDL_CONTROLLER_BUTTON_MAX |
| 365 | 386 | } SDL_GameControllerButton; |
| 366 | 387 | |
| @@ -381,6 +402,11 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL · 14 unmodified lines | ||
| 381 | 402 | SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, |
| 382 | 403 | SDL_GameControllerButton button); |
| 383 | 404 | |
| 405 | +/** | |
| 406 | + * Return whether a game controller has a given button | |
| 407 | + */ | |
| 408 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, | |
| 409 | + SDL_GameControllerButton button); | |
| 384 | 410 | |
| 385 | 411 | /** |
| 386 | 412 | * Get the current state of a button on a game controller. |
| @@ -391,7 +417,68 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga · 4 unmodified lines | ||
| 391 | 417 | SDL_GameControllerButton button); |
| 392 | 418 | |
| 393 | 419 | /** |
| 394 | − * Trigger a rumble effect | |
| 420 | + * Get the number of touchpads on a game controller. | |
| 421 | + */ | |
| 422 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); | |
| 423 | + | |
| 424 | +/** | |
| 425 | + * Get the number of supported simultaneous fingers on a touchpad on a game controller. | |
| 426 | + */ | |
| 427 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); | |
| 428 | + | |
| 429 | +/** | |
| 430 | + * Get the current state of a finger on a touchpad on a game controller. | |
| 431 | + */ | |
| 432 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); | |
| 433 | + | |
| 434 | +/** | |
| 435 | + * Return whether a game controller has a particular sensor. | |
| 436 | + * | |
| 437 | + * \param gamecontroller The controller to query | |
| 438 | + * \param type The type of sensor to query | |
| 439 | + * | |
| 440 | + * \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise. | |
| 441 | + */ | |
| 442 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type); | |
| 443 | + | |
| 444 | +/** | |
| 445 | + * Set whether data reporting for a game controller sensor is enabled | |
| 446 | + * | |
| 447 | + * \param gamecontroller The controller to update | |
| 448 | + * \param type The type of sensor to enable/disable | |
| 449 | + * \param enabled Whether data reporting should be enabled | |
| 450 | + * | |
| 451 | + * \return 0 or -1 if an error occurred. | |
| 452 | + */ | |
| 453 | +extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled); | |
| 454 | + | |
| 455 | +/** | |
| 456 | + * Query whether sensor data reporting is enabled for a game controller | |
| 457 | + * | |
| 458 | + * \param gamecontroller The controller to query | |
| 459 | + * \param type The type of sensor to query | |
| 460 | + * | |
| 461 | + * \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. | |
| 462 | + */ | |
| 463 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type); | |
| 464 | + | |
| 465 | +/** | |
| 466 | + * Get the current state of a game controller sensor. | |
| 467 | + * | |
| 468 | + * The number of values and interpretation of the data is sensor dependent. | |
| 469 | + * See SDL_sensor.h for the details for each type of sensor. | |
| 470 | + * | |
| 471 | + * \param gamecontroller The controller to query | |
| 472 | + * \param type The type of sensor to query | |
| 473 | + * \param data A pointer filled with the current sensor state | |
| 474 | + * \param num_values The number of values to write to data | |
| 475 | + * | |
| 476 | + * \return 0 or -1 if an error occurred. | |
| 477 | + */ | |
| 478 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values); | |
| 479 | + | |
| 480 | +/** | |
| 481 | + * Start a rumble effect | |
| 395 | 482 | * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. |
| 396 | 483 | * |
| 397 | 484 | * \param gamecontroller The controller to vibrate |
| @@ -399,10 +486,44 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga · 1 unmodified line | ||
| 399 | 486 | * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF |
| 400 | 487 | * \param duration_ms The duration of the rumble effect, in milliseconds |
| 401 | 488 | * |
| 402 | − * \return 0, or -1 if rumble isn't supported on this joystick | |
| 489 | + * \return 0, or -1 if rumble isn't supported on this controller | |
| 403 | 490 | */ |
| 404 | 491 | extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); |
| 405 | 492 | |
| 493 | +/** | |
| 494 | + * Start a rumble effect in the game controller's triggers | |
| 495 | + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. | |
| 496 | + * | |
| 497 | + * \param gamecontroller The controller to vibrate | |
| 498 | + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF | |
| 499 | + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF | |
| 500 | + * \param duration_ms The duration of the rumble effect, in milliseconds | |
| 501 | + * | |
| 502 | + * \return 0, or -1 if rumble isn't supported on this controller | |
| 503 | + */ | |
| 504 | +extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); | |
| 505 | + | |
| 506 | +/** | |
| 507 | + * Return whether a controller has an LED | |
| 508 | + * | |
| 509 | + * \param gamecontroller The controller to query | |
| 510 | + * | |
| 511 | + * \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED | |
| 512 | + */ | |
| 513 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller); | |
| 514 | + | |
| 515 | +/** | |
| 516 | + * Update a controller's LED color. | |
| 517 | + * | |
| 518 | + * \param gamecontroller The controller to update | |
| 519 | + * \param red The intensity of the red LED | |
| 520 | + * \param green The intensity of the green LED | |
| 521 | + * \param blue The intensity of the blue LED | |
| 522 | + * | |
| 523 | + * \return 0, or -1 if this controller does not have a modifiable LED | |
| 524 | + */ | |
| 525 | +extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue); | |
| 526 | + | |
| 406 | 527 | /** |
| 407 | 528 | * Close a controller previously opened with SDL_GameControllerOpen(). |
| 408 | 529 | */ |
| @@ -336,6 +336,14 @@ typedef struct _SDL_Haptic SDL_Haptic; · 335 unmodified lines | ||
| 336 | 336 | */ |
| 337 | 337 | #define SDL_HAPTIC_SPHERICAL 2 |
| 338 | 338 | |
| 339 | +/** | |
| 340 | + * \brief Use this value to play an effect on the steering wheel axis. This | |
| 341 | + * provides better compatibility across platforms and devices as SDL will guess | |
| 342 | + * the correct axis. | |
| 343 | + * \sa SDL_HapticDirection | |
| 344 | + */ | |
| 345 | +#define SDL_HAPTIC_STEERING_AXIS 3 | |
| 346 | + | |
| 339 | 347 | /* @} *//* Direction encodings */ |
| 340 | 348 | |
| 341 | 349 | /* @} *//* Haptic features */ |
| @@ -444,6 +452,7 @@ typedef struct _SDL_Haptic SDL_Haptic; · 102 unmodified lines | ||
| 444 | 452 | * \sa SDL_HAPTIC_POLAR |
| 445 | 453 | * \sa SDL_HAPTIC_CARTESIAN |
| 446 | 454 | * \sa SDL_HAPTIC_SPHERICAL |
| 455 | + * \sa SDL_HAPTIC_STEERING_AXIS | |
| 447 | 456 | * \sa SDL_HapticEffect |
| 448 | 457 | * \sa SDL_HapticNumAxes |
| 449 | 458 | */ |
| @@ -314,6 +314,17 @@ extern "C" { · 313 unmodified lines | ||
| 314 | 314 | */ |
| 315 | 315 | #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" |
| 316 | 316 | |
| 317 | +/** | |
| 318 | + * \brief A variable controlling whether relative mouse motion is affected by renderer scaling | |
| 319 | + * | |
| 320 | + * This variable can be set to the following values: | |
| 321 | + * "0" - Relative motion is unaffected by DPI or renderer's logical size | |
| 322 | + * "1" - Relative motion is scaled according to DPI scaling and logical size | |
| 323 | + * | |
| 324 | + * By default relative mouse deltas are affected by DPI and renderer scaling | |
| 325 | + */ | |
| 326 | +#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" | |
| 327 | + | |
| 317 | 328 | /** |
| 318 | 329 | * \brief A variable controlling whether relative mouse mode is implemented using mouse warping |
| 319 | 330 | * |
| @@ -358,7 +369,9 @@ extern "C" { · 38 unmodified lines | ||
| 358 | 369 | #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" |
| 359 | 370 | |
| 360 | 371 | /** |
| 361 | − * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. | |
| 372 | + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. | |
| 373 | + * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're | |
| 374 | + * seeing if "true" causes more problems than it solves in modern times. | |
| 362 | 375 | * |
| 363 | 376 | */ |
| 364 | 377 | #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" |
| @@ -480,6 +493,7 @@ extern "C" { · 115 unmodified lines | ||
| 480 | 493 | * XboxOne |
| 481 | 494 | * PS3 |
| 482 | 495 | * PS4 |
| 496 | + * PS5 | |
| 483 | 497 | * SwitchPro |
| 484 | 498 | * |
| 485 | 499 | * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) |
| @@ -590,6 +604,17 @@ extern "C" { · 104 unmodified lines | ||
| 590 | 604 | */ |
| 591 | 605 | #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" |
| 592 | 606 | |
| 607 | +/** | |
| 608 | + * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. | |
| 609 | + * | |
| 610 | + * This variable can be set to the following values: | |
| 611 | + * "0" - HIDAPI driver is not used | |
| 612 | + * "1" - HIDAPI driver is used | |
| 613 | + * | |
| 614 | + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI | |
| 615 | + */ | |
| 616 | +#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" | |
| 617 | + | |
| 593 | 618 | /** |
| 594 | 619 | * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. |
| 595 | 620 | * |
| @@ -634,10 +659,23 @@ extern "C" { · 38 unmodified lines | ||
| 634 | 659 | * "0" - HIDAPI driver is not used |
| 635 | 660 | * "1" - HIDAPI driver is used |
| 636 | 661 | * |
| 637 | − * The default is the value of SDL_HINT_JOYSTICK_HIDAPI | |
| 662 | + * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI | |
| 638 | 663 | */ |
| 639 | 664 | #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" |
| 640 | 665 | |
| 666 | + /** | |
| 667 | + * \brief A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated | |
| 668 | + * data from XInput. | |
| 669 | + * | |
| 670 | + * This variable can be set to the following values: | |
| 671 | + * "0" - HIDAPI Xbox driver will only use HIDAPI data | |
| 672 | + * "1" - HIDAPI Xbox driver will also pull data from XInput, providing better trigger axes, guide button | |
| 673 | + * presses, and rumble support | |
| 674 | + * | |
| 675 | + * The default is "1". This hint applies to any joysticks opened after setting the hint. | |
| 676 | + */ | |
| 677 | +#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT" | |
| 678 | + | |
| 641 | 679 | /** |
| 642 | 680 | * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. |
| 643 | 681 | * |
| @@ -660,6 +698,35 @@ extern "C" { · 16 unmodified lines | ||
| 660 | 698 | */ |
| 661 | 699 | #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" |
| 662 | 700 | |
| 701 | + /** | |
| 702 | + * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. | |
| 703 | + * | |
| 704 | + * This variable can be set to the following values: | |
| 705 | + * "0" - RAWINPUT drivers are not used | |
| 706 | + * "1" - RAWINPUT drivers are used (the default) | |
| 707 | + * | |
| 708 | + */ | |
| 709 | +#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" | |
| 710 | + | |
| 711 | + /** | |
| 712 | + * \brief A variable controlling whether a separate thread should be used | |
| 713 | + * for handling joystick detection and raw input messages on Windows | |
| 714 | + * | |
| 715 | + * This variable can be set to the following values: | |
| 716 | + * "0" - A separate thread is not used (the default) | |
| 717 | + * "1" - A separate thread is used for handling raw input messages | |
| 718 | + * | |
| 719 | + */ | |
| 720 | +#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" | |
| 721 | + | |
| 722 | + /** | |
| 723 | + * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. | |
| 724 | + * | |
| 725 | + * This variable can be set to the following values: | |
| 726 | + * "0" - Return unfiltered joystick axis values (the default) | |
| 727 | + * "1" - Return axis values with deadzones taken into account | |
| 728 | + */ | |
| 729 | +#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" | |
| 663 | 730 | |
| 664 | 731 | /** |
| 665 | 732 | * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. |
| @@ -730,6 +797,42 @@ extern "C" { · 64 unmodified lines | ||
| 730 | 797 | */ |
| 731 | 798 | #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" |
| 732 | 799 | |
| 800 | +/** | |
| 801 | +* \brief A string specifying additional information to use with SDL_SetThreadPriority. | |
| 802 | +* | |
| 803 | +* By default SDL_SetThreadPriority will make appropriate system changes in order to | |
| 804 | +* apply a thread priority. For example on systems using pthreads the scheduler policy | |
| 805 | +* is changed automatically to a policy that works well with a given priority. | |
| 806 | +* Code which has specific requirements can override SDL's default behavior with this hint. | |
| 807 | +* | |
| 808 | +* pthread hint values are "current", "other", "fifo" and "rr". | |
| 809 | +* Currently no other platform hint values are defined but may be in the future. | |
| 810 | +* | |
| 811 | +* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro | |
| 812 | +* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME | |
| 813 | +* after calling SDL_SetThreadPriority(). | |
| 814 | +*/ | |
| 815 | +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" | |
| 816 | + | |
| 817 | +/** | |
| 818 | + * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. | |
| 819 | + * | |
| 820 | + * On some platforms, like Linux, a realtime priority thread may be subject to restrictions | |
| 821 | + * that require special handling by the application. This hint exists to let SDL know that | |
| 822 | + * the app is prepared to handle said restrictions. | |
| 823 | + * | |
| 824 | + * On Linux, SDL will apply the following configuration to any thread that becomes realtime: | |
| 825 | + * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, | |
| 826 | + * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. | |
| 827 | + * * Exceeding this limit will result in the kernel sending SIGKILL to the app, | |
| 828 | + * * Refer to the man pages for more information. | |
| 829 | + * | |
| 830 | + * This variable can be set to the following values: | |
| 831 | + * "0" - default platform specific behaviour | |
| 832 | + * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy | |
| 833 | + */ | |
| 834 | +#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" | |
| 835 | + | |
| 733 | 836 | /** |
| 734 | 837 | * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) |
| 735 | 838 | */ |
| @@ -968,6 +1071,18 @@ extern "C" { · 232 unmodified lines | ||
| 968 | 1071 | */ |
| 969 | 1072 | #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" |
| 970 | 1073 | |
| 1074 | +/** | |
| 1075 | + * \brief A variable to control whether SDL will pause audio in background | |
| 1076 | + * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") | |
| 1077 | + * | |
| 1078 | + * The variable can be set to the following values: | |
| 1079 | + * "0" - Non paused. | |
| 1080 | + * "1" - Paused. (default) | |
| 1081 | + * | |
| 1082 | + * The value should be set before SDL is initialized. | |
| 1083 | + */ | |
| 1084 | +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" | |
| 1085 | + | |
| 971 | 1086 | /** |
| 972 | 1087 | * \brief A variable to control whether the return key on the soft keyboard |
| 973 | 1088 | * should hide the soft keyboard on Android and iOS. |
| @@ -994,10 +1109,26 @@ extern "C" { · 20 unmodified lines | ||
| 994 | 1109 | */ |
| 995 | 1110 | #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" |
| 996 | 1111 | |
| 1112 | +/** | |
| 1113 | + * \brief Disable giving back control to the browser automatically | |
| 1114 | + * when running with asyncify | |
| 1115 | + * | |
| 1116 | + * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations | |
| 1117 | + * such as refreshing the screen or polling events. | |
| 1118 | + * | |
| 1119 | + * This hint only applies to the emscripten platform | |
| 1120 | + * | |
| 1121 | + * The variable can be set to the following values: | |
| 1122 | + * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) | |
| 1123 | + * "1" - Enable emscripten_sleep calls (the default) | |
| 1124 | + */ | |
| 1125 | +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" | |
| 1126 | + | |
| 997 | 1127 | /** |
| 998 | 1128 | * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. |
| 999 | 1129 | * |
| 1000 | − * This hint only applies to Unix-like platforms. | |
| 1130 | + * This hint only applies to Unix-like platforms, and should set before | |
| 1131 | + * any calls to SDL_Init() | |
| 1001 | 1132 | * |
| 1002 | 1133 | * The variable can be set to the following values: |
| 1003 | 1134 | * "0" - SDL will install a SIGINT and SIGTERM handler, and when it |
| @@ -1171,6 +1302,32 @@ extern "C" { · 167 unmodified lines | ||
| 1171 | 1302 | #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" |
| 1172 | 1303 | |
| 1173 | 1304 | |
| 1305 | +/** | |
| 1306 | + * \brief A variable controlling whether SDL updates joystick state when getting input events | |
| 1307 | + * | |
| 1308 | + * This variable can be set to the following values: | |
| 1309 | + * | |
| 1310 | + * "0" - You'll call SDL_JoystickUpdate() manually | |
| 1311 | + * "1" - SDL will automatically call SDL_JoystickUpdate() (default) | |
| 1312 | + * | |
| 1313 | + * This hint can be toggled on and off at runtime. | |
| 1314 | + */ | |
| 1315 | +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" | |
| 1316 | + | |
| 1317 | + | |
| 1318 | +/** | |
| 1319 | + * \brief A variable controlling whether SDL updates sensor state when getting input events | |
| 1320 | + * | |
| 1321 | + * This variable can be set to the following values: | |
| 1322 | + * | |
| 1323 | + * "0" - You'll call SDL_SensorUpdate() manually | |
| 1324 | + * "1" - SDL will automatically call SDL_SensorUpdate() (default) | |
| 1325 | + * | |
| 1326 | + * This hint can be toggled on and off at runtime. | |
| 1327 | + */ | |
| 1328 | +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" | |
| 1329 | + | |
| 1330 | + | |
| 1174 | 1331 | /** |
| 1175 | 1332 | * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. |
| 1176 | 1333 | * |
| @@ -1258,7 +1415,7 @@ extern "C" { · 81 unmodified lines | ||
| 1258 | 1415 | */ |
| 1259 | 1416 | #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" |
| 1260 | 1417 | |
| 1261 | −/* | |
| 1418 | +/** | |
| 1262 | 1419 | * \brief Override for SDL_GetDisplayUsableBounds() |
| 1263 | 1420 | * |
| 1264 | 1421 | * If set, this hint will override the expected results for |
| @@ -1272,6 +1429,63 @@ extern "C" { · 7 unmodified lines | ||
| 1272 | 1429 | */ |
| 1273 | 1430 | #define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" |
| 1274 | 1431 | |
| 1432 | +/** | |
| 1433 | + * \brief Specify an application name for an audio device. | |
| 1434 | + * | |
| 1435 | + * Some audio backends (such as PulseAudio) allow you to describe your audio | |
| 1436 | + * stream. Among other things, this description might show up in a system | |
| 1437 | + * control panel that lets the user adjust the volume on specific audio | |
| 1438 | + * streams instead of using one giant master volume slider. | |
| 1439 | + * | |
| 1440 | + * This hints lets you transmit that information to the OS. The contents of | |
| 1441 | + * this hint are used while opening an audio device. You should use a string | |
| 1442 | + * that describes your program ("My Game 2: The Revenge") | |
| 1443 | + * | |
| 1444 | + * Setting this to "" or leaving it unset will have SDL use a reasonable | |
| 1445 | + * default: probably the application's name or "SDL Application" if SDL | |
| 1446 | + * doesn't have any better information. | |
| 1447 | + * | |
| 1448 | + * On targets where this is not supported, this hint does nothing. | |
| 1449 | + */ | |
| 1450 | +#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" | |
| 1451 | + | |
| 1452 | +/** | |
| 1453 | + * \brief Specify an application name for an audio device. | |
| 1454 | + * | |
| 1455 | + * Some audio backends (such as PulseAudio) allow you to describe your audio | |
| 1456 | + * stream. Among other things, this description might show up in a system | |
| 1457 | + * control panel that lets the user adjust the volume on specific audio | |
| 1458 | + * streams instead of using one giant master volume slider. | |
| 1459 | + * | |
| 1460 | + * This hints lets you transmit that information to the OS. The contents of | |
| 1461 | + * this hint are used while opening an audio device. You should use a string | |
| 1462 | + * that describes your what your program is playing ("audio stream" is | |
| 1463 | + * probably sufficient in many cases, but this could be useful for something | |
| 1464 | + * like "team chat" if you have a headset playing VoIP audio separately). | |
| 1465 | + * | |
| 1466 | + * Setting this to "" or leaving it unset will have SDL use a reasonable | |
| 1467 | + * default: "audio stream" or something similar. | |
| 1468 | + * | |
| 1469 | + * On targets where this is not supported, this hint does nothing. | |
| 1470 | + */ | |
| 1471 | +#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" | |
| 1472 | + | |
| 1473 | + | |
| 1474 | +/** | |
| 1475 | + * \brief Override for SDL_GetPreferredLocales() | |
| 1476 | + * | |
| 1477 | + * If set, this will be favored over anything the OS might report for the | |
| 1478 | + * user's preferred locales. Changing this hint at runtime will not generate | |
| 1479 | + * a SDL_LOCALECHANGED event (but if you can change the hint, you can push | |
| 1480 | + * your own event, if you want). | |
| 1481 | + * | |
| 1482 | + * The format of this hint is a comma-separated list of language and locale, | |
| 1483 | + * combined with an underscore, as is a common format: "en_GB". Locale is | |
| 1484 | + * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" | |
| 1485 | + */ | |
| 1486 | +#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" | |
| 1487 | + | |
| 1488 | + | |
| 1275 | 1489 | /** |
| 1276 | 1490 | * \brief An enumeration of hint priorities |
| 1277 | 1491 | */ |
| @@ -105,6 +105,12 @@ typedef enum · 104 unmodified lines | ||
| 105 | 105 | SDL_JOYSTICK_POWER_MAX |
| 106 | 106 | } SDL_JoystickPowerLevel; |
| 107 | 107 | |
| 108 | +/* Set max recognized G-force from accelerometer | |
| 109 | + See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed | |
| 110 | + */ | |
| 111 | +#define SDL_IPHONE_MAX_GFORCE 5.0 | |
| 112 | + | |
| 113 | + | |
| 108 | 114 | /* Function prototypes */ |
| 109 | 115 | |
| 110 | 116 | /** |
| @@ -199,51 +205,92 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID · 88 unmodified lines | ||
| 199 | 205 | */ |
| 200 | 206 | extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); |
| 201 | 207 | |
| 208 | +/** | |
| 209 | + * Attaches a new virtual joystick. | |
| 210 | + * Returns the joystick's device index, or -1 if an error occurred. | |
| 211 | + */ | |
| 212 | +extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, | |
| 213 | + int naxes, | |
| 214 | + int nbuttons, | |
| 215 | + int nhats); | |
| 216 | + | |
| 217 | +/** | |
| 218 | + * Detaches a virtual joystick | |
| 219 | + * Returns 0 on success, or -1 if an error occurred. | |
| 220 | + */ | |
| 221 | +extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); | |
| 222 | + | |
| 223 | +/** | |
| 224 | + * Indicates whether or not a virtual-joystick is at a given device index. | |
| 225 | + */ | |
| 226 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); | |
| 227 | + | |
| 228 | +/** | |
| 229 | + * Set values on an opened, virtual-joystick's controls. | |
| 230 | + * Please note that values set here will not be applied until the next | |
| 231 | + * call to SDL_JoystickUpdate, which can either be called directly, | |
| 232 | + * or can be called indirectly through various other SDL APIS, | |
| 233 | + * including, but not limited to the following: SDL_PollEvent, | |
| 234 | + * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent. | |
| 235 | + * | |
| 236 | + * Returns 0 on success, -1 on error. | |
| 237 | + */ | |
| 238 | +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); | |
| 239 | +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); | |
| 240 | +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); | |
| 241 | + | |
| 202 | 242 | /** |
| 203 | 243 | * Return the name for this currently opened joystick. |
| 204 | 244 | * If no name can be found, this function returns NULL. |
| 205 | 245 | */ |
| 206 | −extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); | |
| 246 | +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); | |
| 207 | 247 | |
| 208 | 248 | /** |
| 209 | 249 | * Get the player index of an opened joystick, or -1 if it's not available |
| 210 | 250 | * |
| 211 | 251 | * For XInput controllers this returns the XInput user index. |
| 212 | 252 | */ |
| 213 | −extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); | |
| 253 | +extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); | |
| 214 | 254 | |
| 215 | 255 | /** |
| 216 | 256 | * Set the player index of an opened joystick |
| 217 | 257 | */ |
| 218 | −extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); | |
| 258 | +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); | |
| 219 | 259 | |
| 220 | 260 | /** |
| 221 | 261 | * Return the GUID for this opened joystick |
| 222 | 262 | */ |
| 223 | −extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); | |
| 263 | +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); | |
| 224 | 264 | |
| 225 | 265 | /** |
| 226 | 266 | * Get the USB vendor ID of an opened joystick, if available. |
| 227 | 267 | * If the vendor ID isn't available this function returns 0. |
| 228 | 268 | */ |
| 229 | −extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); | |
| 269 | +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); | |
| 230 | 270 | |
| 231 | 271 | /** |
| 232 | 272 | * Get the USB product ID of an opened joystick, if available. |
| 233 | 273 | * If the product ID isn't available this function returns 0. |
| 234 | 274 | */ |
| 235 | −extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); | |
| 275 | +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); | |
| 236 | 276 | |
| 237 | 277 | /** |
| 238 | 278 | * Get the product version of an opened joystick, if available. |
| 239 | 279 | * If the product version isn't available this function returns 0. |
| 240 | 280 | */ |
| 241 | −extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); | |
| 281 | +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); | |
| 282 | + | |
| 283 | +/** | |
| 284 | + * Get the serial number of an opened joystick, if available. | |
| 285 | + * | |
| 286 | + * Returns the serial number of the joystick, or NULL if it is not available. | |
| 287 | + */ | |
| 288 | +extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); | |
| 242 | 289 | |
| 243 | 290 | /** |
| 244 | 291 | * Get the type of an opened joystick. |
| 245 | 292 | */ |
| 246 | −extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); | |
| 293 | +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); | |
| 247 | 294 | |
| 248 | 295 | /** |
| 249 | 296 | * Return a string representation for this guid. pszGUID must point to at least 33 bytes |
| @@ -259,17 +306,17 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha · 9 unmodified lines | ||
| 259 | 306 | /** |
| 260 | 307 | * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. |
| 261 | 308 | */ |
| 262 | −extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); | |
| 309 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); | |
| 263 | 310 | |
| 264 | 311 | /** |
| 265 | 312 | * Get the instance ID of an opened joystick or -1 if the joystick is invalid. |
| 266 | 313 | */ |
| 267 | −extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); | |
| 314 | +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); | |
| 268 | 315 | |
| 269 | 316 | /** |
| 270 | 317 | * Get the number of general axis controls on a joystick. |
| 271 | 318 | */ |
| 272 | −extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); | |
| 319 | +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); | |
| 273 | 320 | |
| 274 | 321 | /** |
| 275 | 322 | * Get the number of trackballs on a joystick. |
| @@ -277,17 +324,17 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); · 1 unmodified line | ||
| 277 | 324 | * Joystick trackballs have only relative motion events associated |
| 278 | 325 | * with them and their state cannot be polled. |
| 279 | 326 | */ |
| 280 | −extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); | |
| 327 | +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); | |
| 281 | 328 | |
| 282 | 329 | /** |
| 283 | 330 | * Get the number of POV hats on a joystick. |
| 284 | 331 | */ |
| 285 | −extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); | |
| 332 | +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); | |
| 286 | 333 | |
| 287 | 334 | /** |
| 288 | 335 | * Get the number of buttons on a joystick. |
| 289 | 336 | */ |
| 290 | −extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); | |
| 337 | +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); | |
| 291 | 338 | |
| 292 | 339 | /** |
| 293 | 340 | * Update the current state of the open joysticks. |
| @@ -317,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); · 23 unmodified lines | ||
| 317 | 364 | * |
| 318 | 365 | * The axis indices start at index 0. |
| 319 | 366 | */ |
| 320 | −extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, | |
| 367 | +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, | |
| 321 | 368 | int axis); |
| 322 | 369 | |
| 323 | 370 | /** |
| @@ -329,7 +376,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, · 5 unmodified lines | ||
| 329 | 376 | * |
| 330 | 377 | * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. |
| 331 | 378 | */ |
| 332 | −extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, | |
| 379 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, | |
| 333 | 380 | int axis, Sint16 *state); |
| 334 | 381 | |
| 335 | 382 | /** |
| @@ -363,7 +410,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * · 27 unmodified lines | ||
| 363 | 410 | * - ::SDL_HAT_LEFTUP |
| 364 | 411 | * - ::SDL_HAT_LEFTDOWN |
| 365 | 412 | */ |
| 366 | −extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, | |
| 413 | +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, | |
| 367 | 414 | int hat); |
| 368 | 415 | |
| 369 | 416 | /** |
| @@ -373,7 +420,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, · 3 unmodified lines | ||
| 373 | 420 | * |
| 374 | 421 | * The ball indices start at index 0. |
| 375 | 422 | */ |
| 376 | −extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, | |
| 423 | +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, | |
| 377 | 424 | int ball, int *dx, int *dy); |
| 378 | 425 | |
| 379 | 426 | /** |
| @@ -381,11 +428,11 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, · 1 unmodified line | ||
| 381 | 428 | * |
| 382 | 429 | * The button indices start at index 0. |
| 383 | 430 | */ |
| 384 | −extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, | |
| 431 | +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, | |
| 385 | 432 | int button); |
| 386 | 433 | |
| 387 | 434 | /** |
| 388 | − * Trigger a rumble effect | |
| 435 | + * Start a rumble effect | |
| 389 | 436 | * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. |
| 390 | 437 | * |
| 391 | 438 | * \param joystick The joystick to vibrate |
| @@ -395,17 +442,51 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, · 3 unmodified lines | ||
| 395 | 442 | * |
| 396 | 443 | * \return 0, or -1 if rumble isn't supported on this joystick |
| 397 | 444 | */ |
| 398 | −extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); | |
| 445 | +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); | |
| 446 | + | |
| 447 | +/** | |
| 448 | + * Start a rumble effect in the joystick's triggers | |
| 449 | + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. | |
| 450 | + * | |
| 451 | + * \param joystick The joystick to vibrate | |
| 452 | + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF | |
| 453 | + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF | |
| 454 | + * \param duration_ms The duration of the rumble effect, in milliseconds | |
| 455 | + * | |
| 456 | + * \return 0, or -1 if trigger rumble isn't supported on this joystick | |
| 457 | + */ | |
| 458 | +extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); | |
| 459 | + | |
| 460 | +/** | |
| 461 | + * Return whether a joystick has an LED | |
| 462 | + * | |
| 463 | + * \param joystick The joystick to query | |
| 464 | + * | |
| 465 | + * \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED | |
| 466 | + */ | |
| 467 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); | |
| 468 | + | |
| 469 | +/** | |
| 470 | + * Update a joystick's LED color. | |
| 471 | + * | |
| 472 | + * \param joystick The joystick to update | |
| 473 | + * \param red The intensity of the red LED | |
| 474 | + * \param green The intensity of the green LED | |
| 475 | + * \param blue The intensity of the blue LED | |
| 476 | + * | |
| 477 | + * \return 0, or -1 if this joystick does not have a modifiable LED | |
| 478 | + */ | |
| 479 | +extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); | |
| 399 | 480 | |
| 400 | 481 | /** |
| 401 | 482 | * Close a joystick previously opened with SDL_JoystickOpen(). |
| 402 | 483 | */ |
| 403 | −extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); | |
| 484 | +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); | |
| 404 | 485 | |
| 405 | 486 | /** |
| 406 | 487 | * Return the battery level of this joystick |
| 407 | 488 | */ |
| 408 | −extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); | |
| 489 | +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); | |
| 409 | 490 | |
| 410 | 491 | /* Ends C function definitions when using C++ */ |
| 411 | 492 | #ifdef __cplusplus |
| @@ -88,9 +88,11 @@ typedef enum · 87 unmodified lines | ||
| 88 | 88 | SDLK_GREATER = '>', |
| 89 | 89 | SDLK_QUESTION = '?', |
| 90 | 90 | SDLK_AT = '@', |
| 91 | + | |
| 91 | 92 | /* |
| 92 | 93 | Skip uppercase letters |
| 93 | 94 | */ |
| 95 | + | |
| 94 | 96 | SDLK_LEFTBRACKET = '[', |
| 95 | 97 | SDLK_BACKSLASH = '\\', |
| 96 | 98 | SDLK_RIGHTBRACKET = ']', |
| @@ -336,13 +338,13 @@ typedef enum · 239 unmodified lines | ||
| 336 | 338 | KMOD_NUM = 0x1000, |
| 337 | 339 | KMOD_CAPS = 0x2000, |
| 338 | 340 | KMOD_MODE = 0x4000, |
| 339 | − KMOD_RESERVED = 0x8000 | |
| 340 | −} SDL_Keymod; | |
| 341 | + KMOD_RESERVED = 0x8000, | |
| 341 | 342 | |
| 342 | −#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) | |
| 343 | −#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) | |
| 344 | −#define KMOD_ALT (KMOD_LALT|KMOD_RALT) | |
| 345 | −#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) | |
| 343 | + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, | |
| 344 | + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, | |
| 345 | + KMOD_ALT = KMOD_LALT | KMOD_RALT, | |
| 346 | + KMOD_GUI = KMOD_LGUI | KMOD_RGUI | |
| 347 | +} SDL_Keymod; | |
| 346 | 348 | |
| 347 | 349 | #endif /* SDL_keycode_h_ */ |
| 348 | 350 | |
| @@ -0,0 +1,101 @@ | ||
| 1 | +/* | |
| 2 | + Simple DirectMedia Layer | |
| 3 | + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> | |
| 4 | + | |
| 5 | + This software is provided 'as-is', without any express or implied | |
| 6 | + warranty. In no event will the authors be held liable for any damages | |
| 7 | + arising from the use of this software. | |
| 8 | + | |
| 9 | + Permission is granted to anyone to use this software for any purpose, | |
| 10 | + including commercial applications, and to alter it and redistribute it | |
| 11 | + freely, subject to the following restrictions: | |
| 12 | + | |
| 13 | + 1. The origin of this software must not be misrepresented; you must not | |
| 14 | + claim that you wrote the original software. If you use this software | |
| 15 | + in a product, an acknowledgment in the product documentation would be | |
| 16 | + appreciated but is not required. | |
| 17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
| 18 | + misrepresented as being the original software. | |
| 19 | + 3. This notice may not be removed or altered from any source distribution. | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * \file SDL_locale.h | |
| 24 | + * | |
| 25 | + * Include file for SDL locale services | |
| 26 | + */ | |
| 27 | + | |
| 28 | +#ifndef _SDL_locale_h | |
| 29 | +#define _SDL_locale_h | |
| 30 | + | |
| 31 | +#include "SDL_stdinc.h" | |
| 32 | +#include "SDL_error.h" | |
| 33 | + | |
| 34 | +#include "begin_code.h" | |
| 35 | +/* Set up for C function definitions, even when using C++ */ | |
| 36 | +#ifdef __cplusplus | |
| 37 | +/* *INDENT-OFF* */ | |
| 38 | +extern "C" { | |
| 39 | +/* *INDENT-ON* */ | |
| 40 | +#endif | |
| 41 | + | |
| 42 | + | |
| 43 | +typedef struct SDL_Locale | |
| 44 | +{ | |
| 45 | + const char *language; /**< A language name, like "en" for English. */ | |
| 46 | + const char *country; /**< A country, like "US" for America. Can be NULL. */ | |
| 47 | +} SDL_Locale; | |
| 48 | + | |
| 49 | +/** | |
| 50 | + * \brief Report the user's preferred locale. | |
| 51 | + * | |
| 52 | + * This returns an array of SDL_Locale structs, the final item zeroed out. | |
| 53 | + * When the caller is done with this array, it should call SDL_free() on | |
| 54 | + * the returned value; all the memory involved is allocated in a single | |
| 55 | + * block, so a single SDL_free() will suffice. | |
| 56 | + * | |
| 57 | + * Returned language strings are in the format xx, where 'xx' is an ISO-639 | |
| 58 | + * language specifier (such as "en" for English, "de" for German, etc). | |
| 59 | + * Country strings are in the format YY, where "YY" is an ISO-3166 country | |
| 60 | + * code (such as "US" for the United States, "CA" for Canada, etc). Country | |
| 61 | + * might be NULL if there's no specific guidance on them (so you might get | |
| 62 | + * { "en", "US" } for American English, but { "en", NULL } means "English | |
| 63 | + * language, generically"). Language strings are never NULL, except to | |
| 64 | + * terminate the array. | |
| 65 | + * | |
| 66 | + * Please note that not all of these strings are 2 characters; some are | |
| 67 | + * three or more. | |
| 68 | + * | |
| 69 | + * The returned list of locales are in the order of the user's preference. | |
| 70 | + * For example, a German citizen that is fluent in US English and knows | |
| 71 | + * enough Japanese to navigate around Tokyo might have a list like: | |
| 72 | + * { "de", "en_US", "jp", NULL }. Someone from England might prefer British | |
| 73 | + * English (where "color" is spelled "colour", etc), but will settle for | |
| 74 | + * anything like it: { "en_GB", "en", NULL }. | |
| 75 | + * | |
| 76 | + * This function returns NULL on error, including when the platform does not | |
| 77 | + * supply this information at all. | |
| 78 | + * | |
| 79 | + * This might be a "slow" call that has to query the operating system. It's | |
| 80 | + * best to ask for this once and save the results. However, this list can | |
| 81 | + * change, usually because the user has changed a system preference outside | |
| 82 | + * of your program; SDL will send an SDL_LOCALECHANGED event in this case, | |
| 83 | + * if possible, and you can call this function again to get an updated copy | |
| 84 | + * of preferred locales. | |
| 85 | + * | |
| 86 | + * \return array of locales, terminated with a locale with a NULL language | |
| 87 | + * field. Will return NULL on error. | |
| 88 | + */ | |
| 89 | +extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); | |
| 90 | + | |
| 91 | +/* Ends C function definitions when using C++ */ | |
| 92 | +#ifdef __cplusplus | |
| 93 | +/* *INDENT-OFF* */ | |
| 94 | +} | |
| 95 | +/* *INDENT-ON* */ | |
| 96 | +#endif | |
| 97 | +#include "close_code.h" | |
| 98 | + | |
| 99 | +#endif /* _SDL_locale_h */ | |
| 100 | + | |
| 101 | +/* vi: set ts=4 sw=4 expandtab: */ | |
| @@ -55,18 +55,13 @@ typedef void *SDL_MetalView; · 54 unmodified lines | ||
| 55 | 55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its |
| 56 | 56 | * own. It is up to user code to do that. |
| 57 | 57 | * |
| 58 | − * The returned handle can be casted directly to a NSView or UIView, and the | |
| 59 | − * CAMetalLayer can be accessed from the view's 'layer' property. | |
| 58 | + * The returned handle can be casted directly to a NSView or UIView. | |
| 59 | + * To access the backing CAMetalLayer, call SDL_Metal_GetLayer(). | |
| 60 | 60 | * |
| 61 | − * \code | |
| 62 | − * SDL_MetalView metalview = SDL_Metal_CreateView(window); | |
| 63 | − * UIView *uiview = (__bridge UIView *)metalview; | |
| 64 | − * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; | |
| 65 | − * // [...] | |
| 66 | − * SDL_Metal_DestroyView(metalview); | |
| 67 | − * \endcode | |
| 61 | + * \note \a window must be created with the SDL_WINDOW_METAL flag. | |
| 68 | 62 | * |
| 69 | 63 | * \sa SDL_Metal_DestroyView |
| 64 | + * \sa SDL_Metal_GetLayer | |
| 70 | 65 | */ |
| 71 | 66 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); |
| 72 | 67 | |
| @@ -80,6 +75,37 @@ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); · 7 unmodified lines | ||
| 80 | 75 | */ |
| 81 | 76 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); |
| 82 | 77 | |
| 78 | +/** | |
| 79 | + * \brief Get a pointer to the backing CAMetalLayer for the given view. | |
| 80 | + * | |
| 81 | + * \sa SDL_MetalCreateView | |
| 82 | + */ | |
| 83 | +extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); | |
| 84 | + | |
| 85 | +/** | |
| 86 | + * \brief Get the size of a window's underlying drawable in pixels (for use | |
| 87 | + * with setting viewport, scissor & etc). | |
| 88 | + * | |
| 89 | + * \param window SDL_Window from which the drawable size should be queried | |
| 90 | + * \param w Pointer to variable for storing the width in pixels, | |
| 91 | + * may be NULL | |
| 92 | + * \param h Pointer to variable for storing the height in pixels, | |
| 93 | + * may be NULL | |
| 94 | + * | |
| 95 | + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI | |
| 96 | + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a | |
| 97 | + * platform with high-DPI support (Apple calls this "Retina"), and not disabled | |
| 98 | + * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. | |
| 99 | + * | |
| 100 | + * \note On macOS high-DPI support must be enabled for an application by | |
| 101 | + * setting NSHighResolutionCapable to true in its Info.plist. | |
| 102 | + * | |
| 103 | + * \sa SDL_GetWindowSize() | |
| 104 | + * \sa SDL_CreateWindow() | |
| 105 | + */ | |
| 106 | +extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, | |
| 107 | + int *h); | |
| 108 | + | |
| 83 | 109 | /* @} *//* Metal support functions */ |
| 84 | 110 | |
| 85 | 111 | /* Ends C function definitions when using C++ */ |
| @@ -0,0 +1,75 @@ | ||
| 1 | +/* | |
| 2 | + Simple DirectMedia Layer | |
| 3 | + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> | |
| 4 | + | |
| 5 | + This software is provided 'as-is', without any express or implied | |
| 6 | + warranty. In no event will the authors be held liable for any damages | |
| 7 | + arising from the use of this software. | |
| 8 | + | |
| 9 | + Permission is granted to anyone to use this software for any purpose, | |
| 10 | + including commercial applications, and to alter it and redistribute it | |
| 11 | + freely, subject to the following restrictions: | |
| 12 | + | |
| 13 | + 1. The origin of this software must not be misrepresented; you must not | |
| 14 | + claim that you wrote the original software. If you use this software | |
| 15 | + in a product, an acknowledgment in the product documentation would be | |
| 16 | + appreciated but is not required. | |
| 17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
| 18 | + misrepresented as being the original software. | |
| 19 | + 3. This notice may not be removed or altered from any source distribution. | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * \file SDL_misc.h | |
| 24 | + * | |
| 25 | + * \brief Include file for SDL API functions that don't fit elsewhere. | |
| 26 | + */ | |
| 27 | + | |
| 28 | +#ifndef SDL_misc_h_ | |
| 29 | +#define SDL_misc_h_ | |
| 30 | + | |
| 31 | +#include "SDL_stdinc.h" | |
| 32 | + | |
| 33 | +#include "begin_code.h" | |
| 34 | + | |
| 35 | +/* Set up for C function definitions, even when using C++ */ | |
| 36 | +#ifdef __cplusplus | |
| 37 | +extern "C" { | |
| 38 | +#endif | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * \brief Open an URL / URI in the browser or other | |
| 42 | + * | |
| 43 | + * Open a URL in a separate, system-provided application. How this works will | |
| 44 | + * vary wildly depending on the platform. This will likely launch what | |
| 45 | + * makes sense to handle a specific URL's protocol (a web browser for http://, | |
| 46 | + * etc), but it might also be able to launch file managers for directories | |
| 47 | + * and other things. | |
| 48 | + * | |
| 49 | + * What happens when you open a URL varies wildly as well: your game window | |
| 50 | + * may lose focus (and may or may not lose focus if your game was fullscreen | |
| 51 | + * or grabbing input at the time). On mobile devices, your app will likely | |
| 52 | + * move to the background or your process might be paused. Any given platform | |
| 53 | + * may or may not handle a given URL. | |
| 54 | + * | |
| 55 | + * If this is unimplemented (or simply unavailable) for a platform, this will | |
| 56 | + * fail with an error. A successful result does not mean the URL loaded, just | |
| 57 | + * that we launched something to handle it (or at least believe we did). | |
| 58 | + * | |
| 59 | + * All this to say: this function can be useful, but you should definitely | |
| 60 | + * test it on every platform you target. | |
| 61 | + * | |
| 62 | + * \param url A valid URL to open. | |
| 63 | + * \return 0 on success, or -1 on error. | |
| 64 | + */ | |
| 65 | +extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); | |
| 66 | + | |
| 67 | +/* Ends C function definitions when using C++ */ | |
| 68 | +#ifdef __cplusplus | |
| 69 | +} | |
| 70 | +#endif | |
| 71 | +#include "close_code.h" | |
| 72 | + | |
| 73 | +#endif /* SDL_misc_h_ */ | |
| 74 | + | |
| 75 | +/* vi: set ts=4 sw=4 expandtab: */ | |
| @@ -188,18 +188,22 @@ typedef enum · 187 unmodified lines | ||
| 188 | 188 | SDL_PIXELFORMAT_RGB332 = |
| 189 | 189 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, |
| 190 | 190 | SDL_PACKEDLAYOUT_332, 8, 1), |
| 191 | − SDL_PIXELFORMAT_RGB444 = | |
| 191 | + SDL_PIXELFORMAT_XRGB4444 = | |
| 192 | 192 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, |
| 193 | 193 | SDL_PACKEDLAYOUT_4444, 12, 2), |
| 194 | − SDL_PIXELFORMAT_BGR444 = | |
| 194 | + SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444, | |
| 195 | + SDL_PIXELFORMAT_XBGR4444 = | |
| 195 | 196 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, |
| 196 | 197 | SDL_PACKEDLAYOUT_4444, 12, 2), |
| 197 | − SDL_PIXELFORMAT_RGB555 = | |
| 198 | + SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444, | |
| 199 | + SDL_PIXELFORMAT_XRGB1555 = | |
| 198 | 200 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, |
| 199 | 201 | SDL_PACKEDLAYOUT_1555, 15, 2), |
| 200 | − SDL_PIXELFORMAT_BGR555 = | |
| 202 | + SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555, | |
| 203 | + SDL_PIXELFORMAT_XBGR1555 = | |
| 201 | 204 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, |
| 202 | 205 | SDL_PACKEDLAYOUT_1555, 15, 2), |
| 206 | + SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555, | |
| 203 | 207 | SDL_PIXELFORMAT_ARGB4444 = |
| 204 | 208 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, |
| 205 | 209 | SDL_PACKEDLAYOUT_4444, 16, 2), |
| @@ -236,15 +240,17 @@ typedef enum · 30 unmodified lines | ||
| 236 | 240 | SDL_PIXELFORMAT_BGR24 = |
| 237 | 241 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, |
| 238 | 242 | 24, 3), |
| 239 | − SDL_PIXELFORMAT_RGB888 = | |
| 243 | + SDL_PIXELFORMAT_XRGB8888 = | |
| 240 | 244 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, |
| 241 | 245 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| 246 | + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, | |
| 242 | 247 | SDL_PIXELFORMAT_RGBX8888 = |
| 243 | 248 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, |
| 244 | 249 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| 245 | − SDL_PIXELFORMAT_BGR888 = | |
| 250 | + SDL_PIXELFORMAT_XBGR8888 = | |
| 246 | 251 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, |
| 247 | 252 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| 253 | + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, | |
| 248 | 254 | SDL_PIXELFORMAT_BGRX8888 = |
| 249 | 255 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, |
| 250 | 256 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| @@ -1,2 +1,2 @@ | ||
| 1 | −#define SDL_REVISION "hg-13609:34cc7d3b69d3" | |
| 2 | −#define SDL_REVISION_NUMBER 13609 | |
| 1 | +#define SDL_REVISION "hg-14525:e52d96ea04fc" | |
| 2 | +#define SDL_REVISION_NUMBER 14525 | |
| @@ -96,15 +96,7 @@ typedef struct SDL_RWops · 95 unmodified lines | ||
| 96 | 96 | #if defined(__ANDROID__) |
| 97 | 97 | struct |
| 98 | 98 | { |
| 99 | − void *fileNameRef; | |
| 100 | − void *inputStreamRef; | |
| 101 | − void *readableByteChannelRef; | |
| 102 | − void *readMethod; | |
| 103 | − void *assetFileDescriptorRef; | |
| 104 | − long position; | |
| 105 | − long size; | |
| 106 | − long offset; | |
| 107 | − int fd; | |
| 99 | + void *asset; | |
| 108 | 100 | } androidio; |
| 109 | 101 | #elif defined(__WIN32__) |
| 110 | 102 | struct |
| @@ -78,14 +78,16 @@ typedef enum · 77 unmodified lines | ||
| 78 | 78 | * Accelerometer sensor |
| 79 | 79 | * |
| 80 | 80 | * The accelerometer returns the current acceleration in SI meters per |
| 81 | − * second squared. This includes gravity, so a device at rest will have | |
| 82 | − * an acceleration of SDL_STANDARD_GRAVITY straight down. | |
| 81 | + * second squared. This measurement includes the force of gravity, so | |
| 82 | + * a device at rest will have an value of SDL_STANDARD_GRAVITY away | |
| 83 | + * from the center of the earth. | |
| 83 | 84 | * |
| 84 | 85 | * values[0]: Acceleration on the x axis |
| 85 | 86 | * values[1]: Acceleration on the y axis |
| 86 | 87 | * values[2]: Acceleration on the z axis |
| 87 | 88 | * |
| 88 | − * For phones held in portrait mode, the axes are defined as follows: | |
| 89 | + * For phones held in portrait mode and game controllers held in front of you, | |
| 90 | + * the axes are defined as follows: | |
| 89 | 91 | * -X ... +X : left ... right |
| 90 | 92 | * -Y ... +Y : bottom ... top |
| 91 | 93 | * -Z ... +Z : farther ... closer |
| @@ -105,22 +107,36 @@ typedef enum · 13 unmodified lines | ||
| 105 | 107 | * see positive rotation on that axis when it appeared to be rotating |
| 106 | 108 | * counter-clockwise. |
| 107 | 109 | * |
| 108 | − * values[0]: Angular speed around the x axis | |
| 109 | − * values[1]: Angular speed around the y axis | |
| 110 | − * values[2]: Angular speed around the z axis | |
| 110 | + * values[0]: Angular speed around the x axis (pitch) | |
| 111 | + * values[1]: Angular speed around the y axis (yaw) | |
| 112 | + * values[2]: Angular speed around the z axis (roll) | |
| 111 | 113 | * |
| 112 | − * For phones held in portrait mode, the axes are defined as follows: | |
| 114 | + * For phones held in portrait mode and game controllers held in front of you, | |
| 115 | + * the axes are defined as follows: | |
| 113 | 116 | * -X ... +X : left ... right |
| 114 | 117 | * -Y ... +Y : bottom ... top |
| 115 | 118 | * -Z ... +Z : farther ... closer |
| 116 | 119 | * |
| 117 | − * The axis data is not changed when the phone is rotated. | |
| 120 | + * The axis data is not changed when the phone or controller is rotated. | |
| 118 | 121 | * |
| 119 | 122 | * \sa SDL_GetDisplayOrientation() |
| 120 | 123 | */ |
| 121 | 124 | |
| 122 | 125 | /* Function prototypes */ |
| 123 | 126 | |
| 127 | +/** | |
| 128 | + * Locking for multi-threaded access to the sensor API | |
| 129 | + * | |
| 130 | + * If you are using the sensor API or handling events from multiple threads | |
| 131 | + * you should use these locking functions to protect access to the sensors. | |
| 132 | + * | |
| 133 | + * In particular, you are guaranteed that the sensor list won't change, so | |
| 134 | + * the API functions that take a sensor index will be valid, and sensor | |
| 135 | + * events will not be delivered. | |
| 136 | + */ | |
| 137 | +extern DECLSPEC void SDLCALL SDL_LockSensors(void); | |
| 138 | +extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); | |
| 139 | + | |
| 124 | 140 | /** |
| 125 | 141 | * \brief Count the number of sensors attached to the system right now |
| 126 | 142 | */ |
| @@ -30,6 +30,12 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #include "SDL_config.h" |
| 32 | 32 | |
| 33 | +#ifdef __APPLE__ | |
| 34 | +#ifndef _DARWIN_C_SOURCE | |
| 35 | +#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */ | |
| 36 | +#endif | |
| 37 | +#endif | |
| 38 | + | |
| 33 | 39 | #ifdef HAVE_SYS_TYPES_H |
| 34 | 40 | #include <sys/types.h> |
| 35 | 41 | #endif |
| @@ -413,6 +419,8 @@ extern DECLSPEC int SDLCALL SDL_islower(int x); · 377 unmodified lines | ||
| 413 | 419 | extern DECLSPEC int SDLCALL SDL_toupper(int x); |
| 414 | 420 | extern DECLSPEC int SDLCALL SDL_tolower(int x); |
| 415 | 421 | |
| 422 | +extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); | |
| 423 | + | |
| 416 | 424 | extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); |
| 417 | 425 | |
| 418 | 426 | #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) |
| @@ -463,6 +471,8 @@ extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar · 44 unmodified lines | ||
| 463 | 471 | |
| 464 | 472 | extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); |
| 465 | 473 | extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); |
| 474 | +extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); | |
| 475 | +extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len); | |
| 466 | 476 | |
| 467 | 477 | extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); |
| 468 | 478 | extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); |
| @@ -529,6 +539,8 @@ extern DECLSPEC double SDLCALL SDL_fabs(double x); · 60 unmodified lines | ||
| 529 | 539 | extern DECLSPEC float SDLCALL SDL_fabsf(float x); |
| 530 | 540 | extern DECLSPEC double SDLCALL SDL_floor(double x); |
| 531 | 541 | extern DECLSPEC float SDLCALL SDL_floorf(float x); |
| 542 | +extern DECLSPEC double SDLCALL SDL_trunc(double x); | |
| 543 | +extern DECLSPEC float SDLCALL SDL_truncf(float x); | |
| 532 | 544 | extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); |
| 533 | 545 | extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); |
| 534 | 546 | extern DECLSPEC double SDLCALL SDL_log(double x); |
| @@ -575,6 +587,17 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, · 40 unmodified lines | ||
| 575 | 587 | /* force builds using Clang's static analysis tools to use literal C runtime |
| 576 | 588 | here, since there are possibly tests that are ineffective otherwise. */ |
| 577 | 589 | #if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) |
| 590 | + | |
| 591 | +/* The analyzer knows about strlcpy even when the system doesn't provide it */ | |
| 592 | +#ifndef HAVE_STRLCPY | |
| 593 | +size_t strlcpy(char* dst, const char* src, size_t size); | |
| 594 | +#endif | |
| 595 | + | |
| 596 | +/* The analyzer knows about strlcat even when the system doesn't provide it */ | |
| 597 | +#ifndef HAVE_STRLCAT | |
| 598 | +size_t strlcat(char* dst, const char* src, size_t size); | |
| 599 | +#endif | |
| 600 | + | |
| 578 | 601 | #define SDL_malloc malloc |
| 579 | 602 | #define SDL_calloc calloc |
| 580 | 603 | #define SDL_realloc realloc |
| @@ -583,16 +606,23 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, · 2 unmodified lines | ||
| 583 | 606 | #define SDL_memcpy memcpy |
| 584 | 607 | #define SDL_memmove memmove |
| 585 | 608 | #define SDL_memcmp memcmp |
| 586 | −#define SDL_strlen strlen | |
| 587 | 609 | #define SDL_strlcpy strlcpy |
| 588 | 610 | #define SDL_strlcat strlcat |
| 611 | +#define SDL_strlen strlen | |
| 612 | +#define SDL_wcslen wcslen | |
| 613 | +#define SDL_wcslcpy wcslcpy | |
| 614 | +#define SDL_wcslcat wcslcat | |
| 589 | 615 | #define SDL_strdup strdup |
| 616 | +#define SDL_wcsdup wcsdup | |
| 590 | 617 | #define SDL_strchr strchr |
| 591 | 618 | #define SDL_strrchr strrchr |
| 592 | 619 | #define SDL_strstr strstr |
| 620 | +#define SDL_wcsstr wcsstr | |
| 593 | 621 | #define SDL_strtokr strtok_r |
| 594 | 622 | #define SDL_strcmp strcmp |
| 623 | +#define SDL_wcscmp wcscmp | |
| 595 | 624 | #define SDL_strncmp strncmp |
| 625 | +#define SDL_wcsncmp wcsncmp | |
| 596 | 626 | #define SDL_strcasecmp strcasecmp |
| 597 | 627 | #define SDL_strncasecmp strncasecmp |
| 598 | 628 | #define SDL_sscanf sscanf |
| @@ -80,7 +80,9 @@ typedef struct SDL_Surface · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | /** information needed for surfaces requiring locks */ |
| 82 | 82 | int locked; /**< Read-only */ |
| 83 | − void *lock_data; /**< Read-only */ | |
| 83 | + | |
| 84 | + /** list of BlitMap that hold a reference to this surface */ | |
| 85 | + void *list_blitmap; /**< Private */ | |
| 84 | 86 | |
| 85 | 87 | /** clipping information */ |
| 86 | 88 | SDL_Rect clip_rect; /**< Read-only */ |
| @@ -235,6 +237,13 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW · 148 unmodified lines | ||
| 235 | 237 | extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, |
| 236 | 238 | int flag); |
| 237 | 239 | |
| 240 | +/** | |
| 241 | + * \brief Returns whether the surface is RLE enabled | |
| 242 | + * | |
| 243 | + * \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled | |
| 244 | + */ | |
| 245 | +extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); | |
| 246 | + | |
| 238 | 247 | /** |
| 239 | 248 | * \brief Sets the color key (transparent pixel) in a blittable surface. |
| 240 | 249 | * |
| @@ -123,6 +123,7 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); · 122 unmodified lines | ||
| 123 | 123 | /** |
| 124 | 124 | \brief Return API level of the current device |
| 125 | 125 | |
| 126 | + API level 30: Android 11 | |
| 126 | 127 | API level 29: Android 10 |
| 127 | 128 | API level 28: Android 9 |
| 128 | 129 | API level 27: Android 8.1 |
| @@ -198,6 +199,14 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); · 69 unmodified lines | ||
| 198 | 199 | */ |
| 199 | 200 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); |
| 200 | 201 | |
| 202 | +/** | |
| 203 | + \brief Request permissions at runtime. | |
| 204 | + | |
| 205 | + This blocks the calling thread until the permission is granted or | |
| 206 | + denied. Returns SDL_TRUE if the permission was granted. | |
| 207 | + */ | |
| 208 | +extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission); | |
| 209 | + | |
| 201 | 210 | #endif /* __ANDROID__ */ |
| 202 | 211 | |
| 203 | 212 | /* Platform specific functions for WinRT */ |
| @@ -106,6 +106,11 @@ typedef void *EGLSurface; · 105 unmodified lines | ||
| 106 | 106 | #if defined(SDL_VIDEO_DRIVER_VIVANTE) |
| 107 | 107 | #include "SDL_egl.h" |
| 108 | 108 | #endif |
| 109 | + | |
| 110 | +#if defined(SDL_VIDEO_DRIVER_OS2) | |
| 111 | +#define INCL_WIN | |
| 112 | +#include <os2.h> | |
| 113 | +#endif | |
| 109 | 114 | #endif /* SDL_PROTOTYPES_ONLY */ |
| 110 | 115 | |
| 111 | 116 | |
| @@ -186,6 +191,16 @@ struct SDL_SysWMmsg · 74 unmodified lines | ||
| 186 | 191 | int dummy; |
| 187 | 192 | /* No Vivante window events yet */ |
| 188 | 193 | } vivante; |
| 194 | +#endif | |
| 195 | +#if defined(SDL_VIDEO_DRIVER_OS2) | |
| 196 | + struct | |
| 197 | + { | |
| 198 | + BOOL fFrame; /**< TRUE if hwnd is a frame window */ | |
| 199 | + HWND hwnd; /**< The window receiving the message */ | |
| 200 | + ULONG msg; /**< The message identifier */ | |
| 201 | + MPARAM mp1; /**< The first first message parameter */ | |
| 202 | + MPARAM mp2; /**< The second first message parameter */ | |
| 203 | + } os2; | |
| 189 | 204 | #endif |
| 190 | 205 | /* Can't have an empty union */ |
| 191 | 206 | int dummy; |
| @@ -280,6 +295,14 @@ struct SDL_SysWMinfo · 88 unmodified lines | ||
| 280 | 295 | } android; |
| 281 | 296 | #endif |
| 282 | 297 | |
| 298 | +#if defined(SDL_VIDEO_DRIVER_OS2) | |
| 299 | + struct | |
| 300 | + { | |
| 301 | + HWND hwnd; /**< The window handle */ | |
| 302 | + HWND hwndFrame; /**< The frame window handle */ | |
| 303 | + } os2; | |
| 304 | +#endif | |
| 305 | + | |
| 283 | 306 | #if defined(SDL_VIDEO_DRIVER_VIVANTE) |
| 284 | 307 | struct |
| 285 | 308 | { |
| @@ -54,6 +54,11 @@ typedef unsigned int SDL_TLSID; · 53 unmodified lines | ||
| 54 | 54 | /** |
| 55 | 55 | * The SDL thread priority. |
| 56 | 56 | * |
| 57 | + * SDL will make system changes as necessary in order to apply the thread priority. | |
| 58 | + * Code which attempts to control thread state related to priority should be aware | |
| 59 | + * that calling SDL_SetThreadPriority may alter such state. | |
| 60 | + * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. | |
| 61 | + * | |
| 57 | 62 | * \note On many systems you require special privileges to set high or time critical priority. |
| 58 | 63 | */ |
| 59 | 64 | typedef enum { |
| @@ -59,7 +59,7 @@ typedef struct SDL_version · 58 unmodified lines | ||
| 59 | 59 | */ |
| 60 | 60 | #define SDL_MAJOR_VERSION 2 |
| 61 | 61 | #define SDL_MINOR_VERSION 0 |
| 62 | −#define SDL_PATCHLEVEL 12 | |
| 62 | +#define SDL_PATCHLEVEL 14 | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * \brief Macro to determine SDL version program was compiled against. |
| @@ -118,7 +118,8 @@ typedef enum · 117 unmodified lines | ||
| 118 | 118 | SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ |
| 119 | 119 | SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ |
| 120 | 120 | SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ |
| 121 | − SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ | |
| 121 | + SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */ | |
| 122 | + SDL_WINDOW_METAL = 0x20000000 /**< window usable for Metal view */ | |
| 122 | 123 | } SDL_WindowFlags; |
| 123 | 124 | |
| 124 | 125 | /** |
| @@ -174,7 +175,9 @@ typedef enum · 49 unmodified lines | ||
| 174 | 175 | typedef enum |
| 175 | 176 | { |
| 176 | 177 | SDL_DISPLAYEVENT_NONE, /**< Never used */ |
| 177 | − SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */ | |
| 178 | + SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */ | |
| 179 | + SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */ | |
| 180 | + SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */ | |
| 178 | 181 | } SDL_DisplayEventID; |
| 179 | 182 | |
| 180 | 183 | typedef enum |
| @@ -484,7 +487,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); · 303 unmodified lines | ||
| 484 | 487 | * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, |
| 485 | 488 | * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, |
| 486 | 489 | * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, |
| 487 | − * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. | |
| 490 | + * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN | |
| 491 | + * ::SDL_WINDOW_METAL. | |
| 488 | 492 | * |
| 489 | 493 | * \return The created window, or NULL if window creation failed. |
| 490 | 494 | * |
| @@ -503,6 +507,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); · 12 unmodified lines | ||
| 503 | 507 | * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, |
| 504 | 508 | * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. |
| 505 | 509 | * |
| 510 | + * If SDL_WINDOW_METAL is specified on an OS that does not support Metal, | |
| 511 | + * SDL_CreateWindow() will fail. | |
| 512 | + * | |
| 506 | 513 | * \note On non-Apple devices, SDL requires you to either not link to the |
| 507 | 514 | * Vulkan loader or link to a dynamic library version. This limitation |
| 508 | 515 | * may be removed in a future version of SDL. |
| @@ -204,10 +204,9 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); · 203 unmodified lines | ||
| 204 | 204 | * |
| 205 | 205 | * \sa SDL_Vulkan_CreateSurface() |
| 206 | 206 | */ |
| 207 | −extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( | |
| 208 | − SDL_Window *window, | |
| 209 | − unsigned int *pCount, | |
| 210 | − const char **pNames); | |
| 207 | +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, | |
| 208 | + unsigned int *pCount, | |
| 209 | + const char **pNames); | |
| 211 | 210 | |
| 212 | 211 | /** |
| 213 | 212 | * \brief Create a Vulkan rendering surface for a window. |
| @@ -238,10 +237,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( · 24 unmodified lines | ||
| 238 | 237 | * |
| 239 | 238 | * \sa SDL_Vulkan_GetInstanceExtensions() |
| 240 | 239 | */ |
| 241 | −extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface( | |
| 242 | − SDL_Window *window, | |
| 243 | − VkInstance instance, | |
| 244 | − VkSurfaceKHR* surface); | |
| 240 | +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, | |
| 241 | + VkInstance instance, | |
| 242 | + VkSurfaceKHR* surface); | |
| 245 | 243 | |
| 246 | 244 | /** |
| 247 | 245 | * \brief Get the size of a window's underlying drawable in pixels (for use |
| @@ -51,15 +51,11 @@ · 50 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | /* Some compilers use a special export keyword */ |
| 53 | 53 | #ifndef DECLSPEC |
| 54 | −# if defined(__WIN32__) || defined(__WINRT__) | |
| 55 | −# ifdef __BORLANDC__ | |
| 56 | −# ifdef BUILD_SDL | |
| 57 | −# define DECLSPEC | |
| 58 | −# else | |
| 59 | −# define DECLSPEC __declspec(dllimport) | |
| 60 | −# endif | |
| 61 | −# else | |
| 54 | +# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) | |
| 55 | +# ifdef DLL_EXPORT | |
| 62 | 56 | # define DECLSPEC __declspec(dllexport) |
| 57 | +# else | |
| 58 | +# define DECLSPEC | |
| 63 | 59 | # endif |
| 64 | 60 | # elif defined(__OS2__) |
| 65 | 61 | # ifdef BUILD_SDL |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | <plist version="1.0"> |
| 4 | 4 | <dict> |
| 5 | 5 | <key>BuildMachineOSBuild</key> |
| 6 | − <string>18G87</string> | |
| 6 | + <string>19E287</string> | |
| 7 | 7 | <key>CFBundleDevelopmentRegion</key> |
| 8 | 8 | <string>English</string> |
| 9 | 9 | <key>CFBundleExecutable</key> |
| @@ -19,7 +19,7 @@ · 9 unmodified lines | ||
| 19 | 19 | <key>CFBundlePackageType</key> |
| 20 | 20 | <string>FMWK</string> |
| 21 | 21 | <key>CFBundleShortVersionString</key> |
| 22 | − <string>2.0.12</string> | |
| 22 | + <string>2.0.14</string> | |
| 23 | 23 | <key>CFBundleSignature</key> |
| 24 | 24 | <string>SDLX</string> |
| 25 | 25 | <key>CFBundleSupportedPlatforms</key> |
| @@ -27,21 +27,23 @@ · 1 unmodified line | ||
| 27 | 27 | <string>MacOSX</string> |
| 28 | 28 | </array> |
| 29 | 29 | <key>CFBundleVersion</key> |
| 30 | − <string>2.0.12</string> | |
| 30 | + <string>2.0.14</string> | |
| 31 | 31 | <key>DTCompiler</key> |
| 32 | 32 | <string>com.apple.compilers.llvm.clang.1_0</string> |
| 33 | 33 | <key>DTPlatformBuild</key> |
| 34 | − <string>11C504</string> | |
| 34 | + <string>12C33</string> | |
| 35 | + <key>DTPlatformName</key> | |
| 36 | + <string>macosx</string> | |
| 35 | 37 | <key>DTPlatformVersion</key> |
| 36 | − <string>GM</string> | |
| 38 | + <string>11.1</string> | |
| 37 | 39 | <key>DTSDKBuild</key> |
| 38 | − <string>19B90</string> | |
| 40 | + <string>20C63</string> | |
| 39 | 41 | <key>DTSDKName</key> |
| 40 | − <string>macosx10.15</string> | |
| 42 | + <string>macosx11.1</string> | |
| 41 | 43 | <key>DTXcode</key> |
| 42 | − <string>1130</string> | |
| 44 | + <string>1230</string> | |
| 43 | 45 | <key>DTXcodeBuild</key> |
| 44 | − <string>11C504</string> | |
| 46 | + <string>12C33</string> | |
| 45 | 47 | <key>LSMinimumSystemVersion</key> |
| 46 | 48 | <string>10.6</string> |
| 47 | 49 | </dict> |
Binary file not shown.
Binary file not shown.
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | <dict> |
| 7 | 7 | <key>Resources/Info.plist</key> |
| 8 | 8 | <data> |
| 9 | − sC07CBQyns8khV3Fh/hh4E2hc74= | |
| 9 | + HzcsMReVY4hkAmRRhq33mT4RJKI= | |
| 10 | 10 | </data> |
| 11 | 11 | <key>Resources/License.txt</key> |
| 12 | 12 | <data> |
| @@ -18,7 +18,7 @@ · 5 unmodified lines | ||
| 18 | 18 | </data> |
| 19 | 19 | <key>Resources/default.metallib</key> |
| 20 | 20 | <data> |
| 21 | − dF9gKJnv0WdQs57PRAzLo+EyGAA= | |
| 21 | + 4BwgaOSOLU3sjhjYkfLYp8Bg0y0= | |
| 22 | 22 | </data> |
| 23 | 23 | </dict> |
| 24 | 24 | <key>files2</key> |
| @@ -27,7 +27,7 @@ · 2 unmodified lines | ||
| 27 | 27 | <dict> |
| 28 | 28 | <key>cdhash</key> |
| 29 | 29 | <data> |
| 30 | − CEGTuNjduzlouV6B5JJVr1uRoeM= | |
| 30 | + N5FKSaB7CEeZTK1MpiD7f6uGGVA= | |
| 31 | 31 | </data> |
| 32 | 32 | <key>requirement</key> |
| 33 | 33 | <string>identifier "org.libsdl.hidapi" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = EH385AYQ6F</string> |
| @@ -36,22 +36,22 @@ · 2 unmodified lines | ||
| 36 | 36 | <dict> |
| 37 | 37 | <key>hash</key> |
| 38 | 38 | <data> |
| 39 | − y6Zw1zugKvy7YINfHUZioLU3h7c= | |
| 39 | + hL2Z/I5g7jY5xbcFEk6Ga+GmxcM= | |
| 40 | 40 | </data> |
| 41 | 41 | <key>hash2</key> |
| 42 | 42 | <data> |
| 43 | − GRE94BY3eDOjtR9EDg6HtLEJAZjYaNV+dq4yfaEVj+U= | |
| 43 | + dALaYlcvTZd9nHYy4IFogyrazbSCCRfnK4kfYHGPqFc= | |
| 44 | 44 | </data> |
| 45 | 45 | </dict> |
| 46 | 46 | <key>Headers/SDL_assert.h</key> |
| 47 | 47 | <dict> |
| 48 | 48 | <key>hash</key> |
| 49 | 49 | <data> |
| 50 | − aeaMLHO4nr+PB14hBzqp6ZOQMqU= | |
| 50 | + FwT1P3mJzGKC9r+NdzApvnBKWB0= | |
| 51 | 51 | </data> |
| 52 | 52 | <key>hash2</key> |
| 53 | 53 | <data> |
| 54 | − BvLXUx+Vfr2uygauOVYH8TxUkdOjRrpuC51187UhoCU= | |
| 54 | + P97E6oE7Pm/2Rd/sQI2lfnboN3OaLWfA4fzXc4lHSW0= | |
| 55 | 55 | </data> |
| 56 | 56 | </dict> |
| 57 | 57 | <key>Headers/SDL_atomic.h</key> |
| @@ -124,11 +124,11 @@ · 66 unmodified lines | ||
| 124 | 124 | <dict> |
| 125 | 125 | <key>hash</key> |
| 126 | 126 | <data> |
| 127 | − eUkWGkQu50iG57VqjB5oIXhaYRk= | |
| 127 | + SHf9CRjVPeSLNjgX8CeWX+2/rsc= | |
| 128 | 128 | </data> |
| 129 | 129 | <key>hash2</key> |
| 130 | 130 | <data> |
| 131 | − hTGa2AD+GTxusg3MsUIzA+xmRIFpgR39xsv51vn/Jl0= | |
| 131 | + Dtby/5f29Me3435yhYtoV4qaQ3H+EsDpI5y4/pcdqJY= | |
| 132 | 132 | </data> |
| 133 | 133 | </dict> |
| 134 | 134 | <key>Headers/SDL_copying.h</key> |
| @@ -146,11 +146,11 @@ · 11 unmodified lines | ||
| 146 | 146 | <dict> |
| 147 | 147 | <key>hash</key> |
| 148 | 148 | <data> |
| 149 | − /DTS3Ju22TmH5Qrr4Sy4TfDdlcc= | |
| 149 | + jOEMD49pYqDQfHy0/1TAdRrVxfE= | |
| 150 | 150 | </data> |
| 151 | 151 | <key>hash2</key> |
| 152 | 152 | <data> |
| 153 | − pPVS8mDMD17ThwISdh+NEXGOqQkOOClFoU0ylYgDNSM= | |
| 153 | + /vC2r34hQj6+BZw4xJx8YzwMKL2petqQQgALn+fcGCE= | |
| 154 | 154 | </data> |
| 155 | 155 | </dict> |
| 156 | 156 | <key>Headers/SDL_endian.h</key> |
| @@ -168,22 +168,22 @@ · 11 unmodified lines | ||
| 168 | 168 | <dict> |
| 169 | 169 | <key>hash</key> |
| 170 | 170 | <data> |
| 171 | − MfehpP3RFEj2g4Ya0noqc1o7ANo= | |
| 171 | + pVWfxt+odr3djRqt8D/U421+dQo= | |
| 172 | 172 | </data> |
| 173 | 173 | <key>hash2</key> |
| 174 | 174 | <data> |
| 175 | − FZWI2OlYvburZIDQeeG29DzMz8n8hzO6bavXGDWoHhk= | |
| 175 | + YKlzVmZ1dgucRXZyWU9kvIjT9QZBohKxz49iLQ/PPQE= | |
| 176 | 176 | </data> |
| 177 | 177 | </dict> |
| 178 | 178 | <key>Headers/SDL_events.h</key> |
| 179 | 179 | <dict> |
| 180 | 180 | <key>hash</key> |
| 181 | 181 | <data> |
| 182 | − K/UpbzGqq8vPXCNo//37Qod99bU= | |
| 182 | + ZbHbHB/Ul2errIm2JWrlpAdNRws= | |
| 183 | 183 | </data> |
| 184 | 184 | <key>hash2</key> |
| 185 | 185 | <data> |
| 186 | − ndL6QYSkZleJN4Va0neG0C1cytQi6sN2YRBZNqg0KGU= | |
| 186 | + 8IArXBgjLvjES7thc1V43MvhO7Vb1LBLs6JOjsrlJh8= | |
| 187 | 187 | </data> |
| 188 | 188 | </dict> |
| 189 | 189 | <key>Headers/SDL_filesystem.h</key> |
| @@ -201,11 +201,11 @@ · 11 unmodified lines | ||
| 201 | 201 | <dict> |
| 202 | 202 | <key>hash</key> |
| 203 | 203 | <data> |
| 204 | − NFgER0ImxgFpfHkU677BWPYc1GI= | |
| 204 | + cfhsBlcRvEtWKc7G4aMmbPpicsw= | |
| 205 | 205 | </data> |
| 206 | 206 | <key>hash2</key> |
| 207 | 207 | <data> |
| 208 | − uL37yJVC28sdz6PATtGqouLdEcxEJK+cVHlIRBGmwwA= | |
| 208 | + +n9L1zsAncG84IBpXnfpWrr9WLtT6eQTKvlt/rRx+tQ= | |
| 209 | 209 | </data> |
| 210 | 210 | </dict> |
| 211 | 211 | <key>Headers/SDL_gesture.h</key> |
| @@ -223,33 +223,33 @@ · 11 unmodified lines | ||
| 223 | 223 | <dict> |
| 224 | 224 | <key>hash</key> |
| 225 | 225 | <data> |
| 226 | − wk25QquiIctB15MmzqnMjxB/do8= | |
| 226 | + M0Oo9dh3zLva6qpGJhBbgAxAIuY= | |
| 227 | 227 | </data> |
| 228 | 228 | <key>hash2</key> |
| 229 | 229 | <data> |
| 230 | − I7Ll6omnZd3Ts2S7kk9GcMTrNm87SSEgWoaYSRt/7pU= | |
| 230 | + Nef5r8Bidx1FeTffn9+uzNZMlwxu1J37V4LOzOibxx4= | |
| 231 | 231 | </data> |
| 232 | 232 | </dict> |
| 233 | 233 | <key>Headers/SDL_hints.h</key> |
| 234 | 234 | <dict> |
| 235 | 235 | <key>hash</key> |
| 236 | 236 | <data> |
| 237 | − YZsN5gTIhrJaMZKJcecfJMMmtDA= | |
| 237 | + jwczm7PFpNtkpk+MVF5/nQLW3lk= | |
| 238 | 238 | </data> |
| 239 | 239 | <key>hash2</key> |
| 240 | 240 | <data> |
| 241 | − KIBaC8gbu2WOY1Rzn/x1o+Jpzkjn7smhdgOeihrp6sU= | |
| 241 | + DspQuSafuzDVaWlSssNURH+EYXHSzkOPBmkGAazI2Vo= | |
| 242 | 242 | </data> |
| 243 | 243 | </dict> |
| 244 | 244 | <key>Headers/SDL_joystick.h</key> |
| 245 | 245 | <dict> |
| 246 | 246 | <key>hash</key> |
| 247 | 247 | <data> |
| 248 | − K9z1CAW/nstv8ExYHSHZVkzB6rA= | |
| 248 | + deLFMyhUMO8CeyYVlUw8yBlzhr0= | |
| 249 | 249 | </data> |
| 250 | 250 | <key>hash2</key> |
| 251 | 251 | <data> |
| 252 | − Begpgo8SYC3bsrdRQTUPXZys5hlvqFyHVNPcrnD9DAY= | |
| 252 | + 9g7sjmJ50vOHOSM9pbbGUQq2AiqAnL0v1fxMPlP/6xo= | |
| 253 | 253 | </data> |
| 254 | 254 | </dict> |
| 255 | 255 | <key>Headers/SDL_keyboard.h</key> |
| @@ -267,11 +267,11 @@ · 11 unmodified lines | ||
| 267 | 267 | <dict> |
| 268 | 268 | <key>hash</key> |
| 269 | 269 | <data> |
| 270 | − gMeCtdre9A0i6YsiBcA9UYyFU2M= | |
| 270 | + ewKk66pjiNXqr4IUEygJVneU0Z0= | |
| 271 | 271 | </data> |
| 272 | 272 | <key>hash2</key> |
| 273 | 273 | <data> |
| 274 | − 7q8a96GCxzmM/IeuC5Qe6HdURJ/tkw7ZE+w1EB05MMU= | |
| 274 | + VWe104GsR/Yu3UNF98pUhJ59QWxv+Es2POzyWIepBiU= | |
| 275 | 275 | </data> |
| 276 | 276 | </dict> |
| 277 | 277 | <key>Headers/SDL_loadso.h</key> |
| @@ -285,6 +285,17 @@ · 7 unmodified lines | ||
| 285 | 285 | bpcu/Ms5CE5EHVV1zXIfWghw8JM8qB2114xfsIUBPeE= |
| 286 | 286 | </data> |
| 287 | 287 | </dict> |
| 288 | + <key>Headers/SDL_locale.h</key> | |
| 289 | + <dict> | |
| 290 | + <key>hash</key> | |
| 291 | + <data> | |
| 292 | + JCF6SSXRcv6uAPICgwmTq+WsVZs= | |
| 293 | + </data> | |
| 294 | + <key>hash2</key> | |
| 295 | + <data> | |
| 296 | + SYFN/L2S2pKTNZQe4dGUKTPTFXbqXZlZ3Vyl4y5wZ8s= | |
| 297 | + </data> | |
| 298 | + </dict> | |
| 288 | 299 | <key>Headers/SDL_log.h</key> |
| 289 | 300 | <dict> |
| 290 | 301 | <key>hash</key> |
| @@ -322,11 +333,22 @@ · 31 unmodified lines | ||
| 322 | 333 | <dict> |
| 323 | 334 | <key>hash</key> |
| 324 | 335 | <data> |
| 325 | − +yP6KnkkIHTzx9DFENBYpSeBGxo= | |
| 336 | + S2Es8N4Cya7az5FTs0mqtd840zA= | |
| 337 | + </data> | |
| 338 | + <key>hash2</key> | |
| 339 | + <data> | |
| 340 | + 9AgZbEiRMt0j2ui++nJaH+EXz9UF6LtVeljtZkAvvtY= | |
| 341 | + </data> | |
| 342 | + </dict> | |
| 343 | + <key>Headers/SDL_misc.h</key> | |
| 344 | + <dict> | |
| 345 | + <key>hash</key> | |
| 346 | + <data> | |
| 347 | + lfv6FBriF6FMZ/f1IZWpmQGVgl8= | |
| 326 | 348 | </data> |
| 327 | 349 | <key>hash2</key> |
| 328 | 350 | <data> |
| 329 | − cXX+1NaoCsHFAkNJVN9Rv1I0x0OGxoD3lCc/NwVROeA= | |
| 351 | + r4QO2p4KtTCZoipQ78v0Gt34pzm6GzLKdZq3E2gQopA= | |
| 330 | 352 | </data> |
| 331 | 353 | </dict> |
| 332 | 354 | <key>Headers/SDL_mouse.h</key> |
| @@ -454,11 +476,11 @@ · 121 unmodified lines | ||
| 454 | 476 | <dict> |
| 455 | 477 | <key>hash</key> |
| 456 | 478 | <data> |
| 457 | − U6CRAlpSfGNDzBGXdbi4oftVkwU= | |
| 479 | + dk4R8c81l+WVpQ9ueWDS2SGuXkA= | |
| 458 | 480 | </data> |
| 459 | 481 | <key>hash2</key> |
| 460 | 482 | <data> |
| 461 | − DgjII2f8X5emc/fKsW0hur9MGpTs8qpaTHe/NC7WdGE= | |
| 483 | + AQ9Th5IdVLO2XfkpMUuZAqxtYQXaQiiiHQVjTJyRq2g= | |
| 462 | 484 | </data> |
| 463 | 485 | </dict> |
| 464 | 486 | <key>Headers/SDL_platform.h</key> |
| @@ -520,22 +542,22 @@ · 55 unmodified lines | ||
| 520 | 542 | <dict> |
| 521 | 543 | <key>hash</key> |
| 522 | 544 | <data> |
| 523 | − 1KfSJfNX9fAfNlqo2OLxSfHQaik= | |
| 545 | + iU+5ESGi01zqZHfc1A01ki4Zn7M= | |
| 524 | 546 | </data> |
| 525 | 547 | <key>hash2</key> |
| 526 | 548 | <data> |
| 527 | − Ol01NFpqQ+/WDQIfZbVpxwfJcyE/qtzCAcFRXVg63rY= | |
| 549 | + gV6XVMtohzA/afDeM0m9gF5UKNeZuub0W7GgLf3Tde8= | |
| 528 | 550 | </data> |
| 529 | 551 | </dict> |
| 530 | 552 | <key>Headers/SDL_rwops.h</key> |
| 531 | 553 | <dict> |
| 532 | 554 | <key>hash</key> |
| 533 | 555 | <data> |
| 534 | − DLm3FArKEgTtJ69RUmMmUvF0NsI= | |
| 556 | + FWcGz9/xlaBkrR1vdvYvDibFPhg= | |
| 535 | 557 | </data> |
| 536 | 558 | <key>hash2</key> |
| 537 | 559 | <data> |
| 538 | − FIL6cT/Y+0AXFs3GF9EJ3m2pbkmMJxT/I+LuZP4/JrU= | |
| 560 | + OWI95ONgZvdn/FBJfMHV1BQWKQjx5LBN7MYuXwAadgg= | |
| 539 | 561 | </data> |
| 540 | 562 | </dict> |
| 541 | 563 | <key>Headers/SDL_scancode.h</key> |
| @@ -553,11 +575,11 @@ · 11 unmodified lines | ||
| 553 | 575 | <dict> |
| 554 | 576 | <key>hash</key> |
| 555 | 577 | <data> |
| 556 | − EcpSAJiYDO/cjeNM+RnMZqS0YxA= | |
| 578 | + fWxFA0VH6Upp0rnLDNjYwdQoNo8= | |
| 557 | 579 | </data> |
| 558 | 580 | <key>hash2</key> |
| 559 | 581 | <data> |
| 560 | − 3AJeHmC8LkxLBbEqDgnH1ZoBbA/CJTYIHue3x3QGH5M= | |
| 582 | + g7kU4VylxQdFQFJ0q6E8IDlwjPXm9V+b6C0sl7nyHTM= | |
| 561 | 583 | </data> |
| 562 | 584 | </dict> |
| 563 | 585 | <key>Headers/SDL_shape.h</key> |
| @@ -575,55 +597,55 @@ · 11 unmodified lines | ||
| 575 | 597 | <dict> |
| 576 | 598 | <key>hash</key> |
| 577 | 599 | <data> |
| 578 | − 46ybx+QpfwpESkH8Xav5guh0r4M= | |
| 600 | + gQt/KOamYUdYNDOXy8DQl4d4g/Y= | |
| 579 | 601 | </data> |
| 580 | 602 | <key>hash2</key> |
| 581 | 603 | <data> |
| 582 | − TKLKiytwHa5ijCd36Ae7yHX/bbBWqdvrnOhaF9fXa0E= | |
| 604 | + JflF60zLtw8xzJHCvaQupBJh0cX70rk5Ow9flHG1H7k= | |
| 583 | 605 | </data> |
| 584 | 606 | </dict> |
| 585 | 607 | <key>Headers/SDL_surface.h</key> |
| 586 | 608 | <dict> |
| 587 | 609 | <key>hash</key> |
| 588 | 610 | <data> |
| 589 | − NSvhegMe7ESmcxEgC8EuZ0sCyFU= | |
| 611 | + soHlBb+6gw5DX7D4eGnXPgMf9hs= | |
| 590 | 612 | </data> |
| 591 | 613 | <key>hash2</key> |
| 592 | 614 | <data> |
| 593 | − hdB72Dx/gaTq5sKpPDO+vN3gXHXsE7YxL8z2CoykY8o= | |
| 615 | + Zpk6jryT2LeN31f2DNTqmLmCqsLW6VNL1Uh7HNGOwAI= | |
| 594 | 616 | </data> |
| 595 | 617 | </dict> |
| 596 | 618 | <key>Headers/SDL_system.h</key> |
| 597 | 619 | <dict> |
| 598 | 620 | <key>hash</key> |
| 599 | 621 | <data> |
| 600 | − 3tHnp+2bdRcZ3HH7EKLtOcbMlWQ= | |
| 622 | + AeUGw4yk0HbPBoADm4adPJ9zhpQ= | |
| 601 | 623 | </data> |
| 602 | 624 | <key>hash2</key> |
| 603 | 625 | <data> |
| 604 | − ZwR9c/Bto10ts3gyJZgBeZEDkcfYBxbXqZYho1rDulI= | |
| 626 | + A1opmWFefAqbN5ZOZF+g6pVtvaHimbbPFEoIvB/nV1c= | |
| 605 | 627 | </data> |
| 606 | 628 | </dict> |
| 607 | 629 | <key>Headers/SDL_syswm.h</key> |
| 608 | 630 | <dict> |
| 609 | 631 | <key>hash</key> |
| 610 | 632 | <data> |
| 611 | − erik9ElULmnUObLiWoB7Acm7yxA= | |
| 633 | + P+DsBmujckIowwmwg/Jf22RguSo= | |
| 612 | 634 | </data> |
| 613 | 635 | <key>hash2</key> |
| 614 | 636 | <data> |
| 615 | − ibGK7TlbnYmiziw5PqTjpt2BBso8MswXLRDpkK5z6l0= | |
| 637 | + OyDQPPG7RIPQKz2a1dz+Lye0HoqfZmfrn6onDHVr1ds= | |
| 616 | 638 | </data> |
| 617 | 639 | </dict> |
| 618 | 640 | <key>Headers/SDL_thread.h</key> |
| 619 | 641 | <dict> |
| 620 | 642 | <key>hash</key> |
| 621 | 643 | <data> |
| 622 | − 3tGB/eQF+z1hhlWNiw4xuJ6c0NA= | |
| 644 | + bN9PvUNyNE5PSLQzjdF4b38bzRY= | |
| 623 | 645 | </data> |
| 624 | 646 | <key>hash2</key> |
| 625 | 647 | <data> |
| 626 | − 7WhLanB12mw0SlTjQFEZzDejcHmHtq/wBtc7oujsSSQ= | |
| 648 | + MymOftu/SUBMl4mrBetXv06hTmexfmEwWFuvGoMdmT8= | |
| 627 | 649 | </data> |
| 628 | 650 | </dict> |
| 629 | 651 | <key>Headers/SDL_timer.h</key> |
| @@ -663,44 +685,44 @@ · 33 unmodified lines | ||
| 663 | 685 | <dict> |
| 664 | 686 | <key>hash</key> |
| 665 | 687 | <data> |
| 666 | − b6EyC2Ch21VSDMFN7yDMyWWcFlM= | |
| 688 | + RSdRqJyF1tcOcqxUxRwdBTSOEY8= | |
| 667 | 689 | </data> |
| 668 | 690 | <key>hash2</key> |
| 669 | 691 | <data> |
| 670 | − eFEfLZ0ETPSOf07Q8df4EYSnDqnqLlOPpwOerY9THqI= | |
| 692 | + N1pAIZBW75CmWCZEignmSql74epXayoRYcUDCl+e8P0= | |
| 671 | 693 | </data> |
| 672 | 694 | </dict> |
| 673 | 695 | <key>Headers/SDL_video.h</key> |
| 674 | 696 | <dict> |
| 675 | 697 | <key>hash</key> |
| 676 | 698 | <data> |
| 677 | − GxMAhvV6KHWAeC+Mez8bzUxrj+8= | |
| 699 | + hfCVsrcC7zpSyACVMur9HiR3hP8= | |
| 678 | 700 | </data> |
| 679 | 701 | <key>hash2</key> |
| 680 | 702 | <data> |
| 681 | − CiuTAL3gby9Z42HvOP7StKXDCpbx45n+pfe3zGw3NE0= | |
| 703 | + ZsbVBgoJdTY1nJXyOHKv9ZN0R0gFTPSDh/f59ARpNqY= | |
| 682 | 704 | </data> |
| 683 | 705 | </dict> |
| 684 | 706 | <key>Headers/SDL_vulkan.h</key> |
| 685 | 707 | <dict> |
| 686 | 708 | <key>hash</key> |
| 687 | 709 | <data> |
| 688 | − 0R0iBIIZHeiqfvyj+3+sbtepfwo= | |
| 710 | + Hd6qVU8OT67v88A0rMVhZpceGQg= | |
| 689 | 711 | </data> |
| 690 | 712 | <key>hash2</key> |
| 691 | 713 | <data> |
| 692 | − ZUl2Z6rj4rI2+mitJQB2d+4hTIuTIzVf0fr7KM9hgKw= | |
| 714 | + rD48rqfdCs8UEGgpQilcPwZo50sH0NXKds0uYKXnkc8= | |
| 693 | 715 | </data> |
| 694 | 716 | </dict> |
| 695 | 717 | <key>Headers/begin_code.h</key> |
| 696 | 718 | <dict> |
| 697 | 719 | <key>hash</key> |
| 698 | 720 | <data> |
| 699 | − X5W7FQnJRFgap/lN9Nfhm9SNYRE= | |
| 721 | + FIsc5DtgzxDC8gsUo9TXzt1xH7I= | |
| 700 | 722 | </data> |
| 701 | 723 | <key>hash2</key> |
| 702 | 724 | <data> |
| 703 | − hW/el0zmgHMXlKjkKTyoRPhoPu8ZQvpsljXvK9tXzPg= | |
| 725 | + BFECI+R+tzd3mfhBzGnocaBUwoRCqnuITqApxi6pc7E= | |
| 704 | 726 | </data> |
| 705 | 727 | </dict> |
| 706 | 728 | <key>Headers/close_code.h</key> |
| @@ -718,11 +740,11 @@ · 11 unmodified lines | ||
| 718 | 740 | <dict> |
| 719 | 741 | <key>hash</key> |
| 720 | 742 | <data> |
| 721 | − sC07CBQyns8khV3Fh/hh4E2hc74= | |
| 743 | + HzcsMReVY4hkAmRRhq33mT4RJKI= | |
| 722 | 744 | </data> |
| 723 | 745 | <key>hash2</key> |
| 724 | 746 | <data> |
| 725 | − hYHPEldddc/Esgtnkp9sv1UExiAdPCcgJLF3QFJI2Ak= | |
| 747 | + uxXlzWLUJvw0jtalQpV/AuYjmwBhNOdWqO8HCdMqAY4= | |
| 726 | 748 | </data> |
| 727 | 749 | </dict> |
| 728 | 750 | <key>Resources/License.txt</key> |
| @@ -751,11 +773,11 @@ · 22 unmodified lines | ||
| 751 | 773 | <dict> |
| 752 | 774 | <key>hash</key> |
| 753 | 775 | <data> |
| 754 | − dF9gKJnv0WdQs57PRAzLo+EyGAA= | |
| 776 | + 4BwgaOSOLU3sjhjYkfLYp8Bg0y0= | |
| 755 | 777 | </data> |
| 756 | 778 | <key>hash2</key> |
| 757 | 779 | <data> |
| 758 | − A5lFX3lFIAtu4Lxgjh7TXdIVDe0n6G1iPofA+3H+xMA= | |
| 780 | + bs9aWIr93QMzHkPmqydkE8toDd+BGAITxZX+AC17FSk= | |
| 759 | 781 | </data> |
| 760 | 782 | </dict> |
| 761 | 783 | </dict> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -59,6 +59,8 @@ · 58 unmodified lines | ||
| 59 | 59 | #include "SDL_timer.h" |
| 60 | 60 | #include "SDL_version.h" |
| 61 | 61 | #include "SDL_video.h" |
| 62 | +#include "SDL_locale.h" | |
| 63 | +#include "SDL_misc.h" | |
| 62 | 64 | |
| 63 | 65 | #include "begin_code.h" |
| 64 | 66 | /* Set up for C function definitions, even when using C++ */ |
| @@ -53,6 +53,8 @@ assert can have unique static variables associated with it. · 52 unmodified lines | ||
| 53 | 53 | #define SDL_TriggerBreakpoint() __debugbreak() |
| 54 | 54 | #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) |
| 55 | 55 | #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) |
| 56 | +#elif ( defined(__APPLE__) && defined(__arm64__) ) /* this might work on other ARM targets, but this is a known quantity... */ | |
| 57 | + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) | |
| 56 | 58 | #elif defined(__386__) && defined(__WATCOMC__) |
| 57 | 59 | #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } |
| 58 | 60 | #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) |
| @@ -84,6 +84,7 @@ typedef unsigned int uintptr_t; · 83 unmodified lines | ||
| 84 | 84 | #define HAVE_XINPUT_H 1 |
| 85 | 85 | #define HAVE_MMDEVICEAPI_H 1 |
| 86 | 86 | #define HAVE_AUDIOCLIENT_H 1 |
| 87 | +#define HAVE_SENSORSAPI_H | |
| 87 | 88 | |
| 88 | 89 | /* This is disabled by default to avoid C runtime dependencies and manifest requirements */ |
| 89 | 90 | #ifdef HAVE_LIBC |
| @@ -133,6 +134,8 @@ typedef unsigned int uintptr_t; · 43 unmodified lines | ||
| 133 | 134 | #define HAVE_STRNCMP 1 |
| 134 | 135 | #define HAVE__STRICMP 1 |
| 135 | 136 | #define HAVE__STRNICMP 1 |
| 137 | +#define HAVE__WCSICMP 1 | |
| 138 | +#define HAVE__WCSNICMP 1 | |
| 136 | 139 | #define HAVE_ACOS 1 |
| 137 | 140 | #define HAVE_ACOSF 1 |
| 138 | 141 | #define HAVE_ASIN 1 |
| @@ -172,6 +175,8 @@ typedef unsigned int uintptr_t; · 33 unmodified lines | ||
| 172 | 175 | #define HAVE_VSSCANF 1 |
| 173 | 176 | #define HAVE_SCALBN 1 |
| 174 | 177 | #define HAVE_SCALBNF 1 |
| 178 | +#define HAVE_TRUNC 1 | |
| 179 | +#define HAVE_TRUNCF 1 | |
| 175 | 180 | #endif |
| 176 | 181 | /* This function is available with at least the VC++ 2008 C runtime library */ |
| 177 | 182 | #if _MSC_VER >= 1400 |
| @@ -186,6 +191,20 @@ typedef unsigned int uintptr_t; · 8 unmodified lines | ||
| 186 | 191 | #define HAVE_STDDEF_H 1 |
| 187 | 192 | #endif |
| 188 | 193 | |
| 194 | +/* Check to see if we have Windows 10 build environment */ | |
| 195 | +#if _MSC_VER >= 1911 /* Visual Studio 15.3 */ | |
| 196 | +#include <sdkddkver.h> | |
| 197 | +#if _WIN32_WINNT >= 0x0601 /* Windows 7 */ | |
| 198 | +#define SDL_WINDOWS7_SDK | |
| 199 | +#endif | |
| 200 | +#if _WIN32_WINNT >= 0x0602 /* Windows 8 */ | |
| 201 | +#define SDL_WINDOWS8_SDK | |
| 202 | +#endif | |
| 203 | +#if _WIN32_WINNT >= 0x0A00 /* Windows 10 */ | |
| 204 | +#define SDL_WINDOWS10_SDK | |
| 205 | +#endif | |
| 206 | +#endif /* _MSC_VER >= 1911 */ | |
| 207 | + | |
| 189 | 208 | /* Enable various audio drivers */ |
| 190 | 209 | #define SDL_AUDIO_DRIVER_WASAPI 1 |
| 191 | 210 | #define SDL_AUDIO_DRIVER_DSOUND 1 |
| @@ -195,13 +214,20 @@ typedef unsigned int uintptr_t; · 3 unmodified lines | ||
| 195 | 214 | |
| 196 | 215 | /* Enable various input drivers */ |
| 197 | 216 | #define SDL_JOYSTICK_DINPUT 1 |
| 198 | −#define SDL_JOYSTICK_XINPUT 1 | |
| 199 | 217 | #define SDL_JOYSTICK_HIDAPI 1 |
| 218 | +#ifndef __WINRT__ | |
| 219 | +#define SDL_JOYSTICK_RAWINPUT 1 | |
| 220 | +#endif | |
| 221 | +#define SDL_JOYSTICK_VIRTUAL 1 | |
| 222 | +#ifdef SDL_WINDOWS10_SDK | |
| 223 | +#define SDL_JOYSTICK_WGI 1 | |
| 224 | +#endif | |
| 225 | +#define SDL_JOYSTICK_XINPUT 1 | |
| 200 | 226 | #define SDL_HAPTIC_DINPUT 1 |
| 201 | 227 | #define SDL_HAPTIC_XINPUT 1 |
| 202 | 228 | |
| 203 | −/* Enable the dummy sensor driver */ | |
| 204 | −#define SDL_SENSOR_DUMMY 1 | |
| 229 | +/* Enable the sensor driver */ | |
| 230 | +#define SDL_SENSOR_WINDOWS 1 | |
| 205 | 231 | |
| 206 | 232 | /* Enable various shared object loading systems */ |
| 207 | 233 | #define SDL_LOADSO_WINDOWS 1 |
| @@ -219,8 +245,8 @@ typedef unsigned int uintptr_t; · 11 unmodified lines | ||
| 219 | 245 | #ifndef SDL_VIDEO_RENDER_D3D |
| 220 | 246 | #define SDL_VIDEO_RENDER_D3D 1 |
| 221 | 247 | #endif |
| 222 | −#ifndef SDL_VIDEO_RENDER_D3D11 | |
| 223 | −#define SDL_VIDEO_RENDER_D3D11 0 | |
| 248 | +#ifdef SDL_WINDOWS7_SDK | |
| 249 | +#define SDL_VIDEO_RENDER_D3D11 1 | |
| 224 | 250 | #endif |
| 225 | 251 | |
| 226 | 252 | /* Enable OpenGL support */ |
| @@ -258,3 +284,5 @@ typedef unsigned int uintptr_t; · 31 unmodified lines | ||
| 258 | 284 | #endif |
| 259 | 285 | |
| 260 | 286 | #endif /* SDL_config_windows_h_ */ |
| 287 | + | |
| 288 | +/* vi: set ts=4 sw=4 expandtab: */ | |
| @@ -246,10 +246,33 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); · 245 unmodified lines | ||
| 246 | 246 | * \return Pointer to newly-allocated block, NULL if out of memory. |
| 247 | 247 | * |
| 248 | 248 | * \sa SDL_SIMDAlignment |
| 249 | + * \sa SDL_SIMDRealloc | |
| 249 | 250 | * \sa SDL_SIMDFree |
| 250 | 251 | */ |
| 251 | 252 | extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); |
| 252 | 253 | |
| 254 | +/** | |
| 255 | + * \brief Reallocate memory obtained from SDL_SIMDAlloc | |
| 256 | + * | |
| 257 | + * It is not valid to use this function on a pointer from anything but | |
| 258 | + * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, | |
| 259 | + * SDL_malloc, memalign, new[], etc. | |
| 260 | + * | |
| 261 | + * \param mem The pointer obtained from SDL_SIMDAlloc. This function also | |
| 262 | + * accepts NULL, at which point this function is the same as | |
| 263 | + * calling SDL_realloc with a NULL pointer. | |
| 264 | + * \param len The length, in bytes, of the block to allocated. The actual | |
| 265 | + * allocated block might be larger due to padding, etc. Passing 0 | |
| 266 | + * will return a non-NULL pointer, assuming the system isn't out of | |
| 267 | + * memory. | |
| 268 | + * \return Pointer to newly-reallocated block, NULL if out of memory. | |
| 269 | + * | |
| 270 | + * \sa SDL_SIMDAlignment | |
| 271 | + * \sa SDL_SIMDAlloc | |
| 272 | + * \sa SDL_SIMDFree | |
| 273 | + */ | |
| 274 | +extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len); | |
| 275 | + | |
| 253 | 276 | /** |
| 254 | 277 | * \brief Deallocate memory obtained from SDL_SIMDAlloc |
| 255 | 278 | * |
| @@ -260,6 +283,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); · 4 unmodified lines | ||
| 260 | 283 | * However, SDL_SIMDFree(NULL) is a legal no-op. |
| 261 | 284 | * |
| 262 | 285 | * \sa SDL_SIMDAlloc |
| 286 | + * \sa SDL_SIMDRealloc | |
| 263 | 287 | */ |
| 264 | 288 | extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); |
| 265 | 289 | |
| @@ -37,9 +37,45 @@ extern "C" { · 36 unmodified lines | ||
| 37 | 37 | #endif |
| 38 | 38 | |
| 39 | 39 | /* Public functions */ |
| 40 | −/* SDL_SetError() unconditionally returns -1. */ | |
| 40 | + | |
| 41 | + | |
| 42 | +/** | |
| 43 | + * \brief Set the error message for the current thread | |
| 44 | + * | |
| 45 | + * \return -1, there is no error handling for this function | |
| 46 | + */ | |
| 41 | 47 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); |
| 48 | + | |
| 49 | +/** | |
| 50 | + * \brief Get the last error message that was set | |
| 51 | + * | |
| 52 | + * SDL API functions may set error messages and then succeed, so you should | |
| 53 | + * only use the error value if a function fails. | |
| 54 | + * | |
| 55 | + * This returns a pointer to a static buffer for convenience and should not | |
| 56 | + * be called by multiple threads simultaneously. | |
| 57 | + * | |
| 58 | + * \return a pointer to the last error message that was set | |
| 59 | + */ | |
| 42 | 60 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); |
| 61 | + | |
| 62 | +/** | |
| 63 | + * \brief Get the last error message that was set for the current thread | |
| 64 | + * | |
| 65 | + * SDL API functions may set error messages and then succeed, so you should | |
| 66 | + * only use the error value if a function fails. | |
| 67 | + * | |
| 68 | + * \param errstr A buffer to fill with the last error message that was set | |
| 69 | + * for the current thread | |
| 70 | + * \param maxlen The size of the buffer pointed to by the errstr parameter | |
| 71 | + * | |
| 72 | + * \return errstr | |
| 73 | + */ | |
| 74 | +extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); | |
| 75 | + | |
| 76 | +/** | |
| 77 | + * \brief Clear the error message for the current thread | |
| 78 | + */ | |
| 43 | 79 | extern DECLSPEC void SDLCALL SDL_ClearError(void); |
| 44 | 80 | |
| 45 | 81 | /** |
| @@ -85,6 +85,8 @@ typedef enum · 84 unmodified lines | ||
| 85 | 85 | Called on Android in onResume() |
| 86 | 86 | */ |
| 87 | 87 | |
| 88 | + SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */ | |
| 89 | + | |
| 88 | 90 | /* Display events */ |
| 89 | 91 | SDL_DISPLAYEVENT = 0x150, /**< Display state change */ |
| 90 | 92 | |
| @@ -123,6 +125,10 @@ typedef enum · 32 unmodified lines | ||
| 123 | 125 | SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ |
| 124 | 126 | SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ |
| 125 | 127 | SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ |
| 128 | + SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */ | |
| 129 | + SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ | |
| 130 | + SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ | |
| 131 | + SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ | |
| 126 | 132 | |
| 127 | 133 | /* Touch events */ |
| 128 | 134 | SDL_FINGERDOWN = 0x700, |
| @@ -413,6 +419,33 @@ typedef struct SDL_ControllerDeviceEvent · 284 unmodified lines | ||
| 413 | 419 | Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ |
| 414 | 420 | } SDL_ControllerDeviceEvent; |
| 415 | 421 | |
| 422 | +/** | |
| 423 | + * \brief Game controller touchpad event structure (event.ctouchpad.*) | |
| 424 | + */ | |
| 425 | +typedef struct SDL_ControllerTouchpadEvent | |
| 426 | +{ | |
| 427 | + Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ | |
| 428 | + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ | |
| 429 | + SDL_JoystickID which; /**< The joystick instance id */ | |
| 430 | + Sint32 touchpad; /**< The index of the touchpad */ | |
| 431 | + Sint32 finger; /**< The index of the finger on the touchpad */ | |
| 432 | + float x; /**< Normalized in the range 0...1 with 0 being on the left */ | |
| 433 | + float y; /**< Normalized in the range 0...1 with 0 being at the top */ | |
| 434 | + float pressure; /**< Normalized in the range 0...1 */ | |
| 435 | +} SDL_ControllerTouchpadEvent; | |
| 436 | + | |
| 437 | +/** | |
| 438 | + * \brief Game controller sensor event structure (event.csensor.*) | |
| 439 | + */ | |
| 440 | +typedef struct SDL_ControllerSensorEvent | |
| 441 | +{ | |
| 442 | + Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ | |
| 443 | + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ | |
| 444 | + SDL_JoystickID which; /**< The joystick instance id */ | |
| 445 | + Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ | |
| 446 | + float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ | |
| 447 | +} SDL_ControllerSensorEvent; | |
| 448 | + | |
| 416 | 449 | /** |
| 417 | 450 | * \brief Audio device event structure (event.adevice.*) |
| 418 | 451 | */ |
| @@ -557,33 +590,35 @@ typedef struct SDL_SysWMEvent · 138 unmodified lines | ||
| 557 | 590 | */ |
| 558 | 591 | typedef union SDL_Event |
| 559 | 592 | { |
| 560 | − Uint32 type; /**< Event type, shared with all events */ | |
| 561 | − SDL_CommonEvent common; /**< Common event data */ | |
| 562 | − SDL_DisplayEvent display; /**< Display event data */ | |
| 563 | − SDL_WindowEvent window; /**< Window event data */ | |
| 564 | − SDL_KeyboardEvent key; /**< Keyboard event data */ | |
| 565 | − SDL_TextEditingEvent edit; /**< Text editing event data */ | |
| 566 | − SDL_TextInputEvent text; /**< Text input event data */ | |
| 567 | − SDL_MouseMotionEvent motion; /**< Mouse motion event data */ | |
| 568 | − SDL_MouseButtonEvent button; /**< Mouse button event data */ | |
| 569 | − SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ | |
| 570 | − SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ | |
| 571 | − SDL_JoyBallEvent jball; /**< Joystick ball event data */ | |
| 572 | − SDL_JoyHatEvent jhat; /**< Joystick hat event data */ | |
| 573 | − SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ | |
| 574 | − SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ | |
| 575 | − SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ | |
| 576 | − SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ | |
| 577 | − SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ | |
| 578 | − SDL_AudioDeviceEvent adevice; /**< Audio device event data */ | |
| 579 | − SDL_SensorEvent sensor; /**< Sensor event data */ | |
| 580 | − SDL_QuitEvent quit; /**< Quit request event data */ | |
| 581 | − SDL_UserEvent user; /**< Custom event data */ | |
| 582 | − SDL_SysWMEvent syswm; /**< System dependent window event data */ | |
| 583 | − SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ | |
| 584 | − SDL_MultiGestureEvent mgesture; /**< Gesture event data */ | |
| 585 | − SDL_DollarGestureEvent dgesture; /**< Gesture event data */ | |
| 586 | − SDL_DropEvent drop; /**< Drag and drop event data */ | |
| 593 | + Uint32 type; /**< Event type, shared with all events */ | |
| 594 | + SDL_CommonEvent common; /**< Common event data */ | |
| 595 | + SDL_DisplayEvent display; /**< Display event data */ | |
| 596 | + SDL_WindowEvent window; /**< Window event data */ | |
| 597 | + SDL_KeyboardEvent key; /**< Keyboard event data */ | |
| 598 | + SDL_TextEditingEvent edit; /**< Text editing event data */ | |
| 599 | + SDL_TextInputEvent text; /**< Text input event data */ | |
| 600 | + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ | |
| 601 | + SDL_MouseButtonEvent button; /**< Mouse button event data */ | |
| 602 | + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ | |
| 603 | + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ | |
| 604 | + SDL_JoyBallEvent jball; /**< Joystick ball event data */ | |
| 605 | + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ | |
| 606 | + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ | |
| 607 | + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ | |
| 608 | + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ | |
| 609 | + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ | |
| 610 | + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ | |
| 611 | + SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */ | |
| 612 | + SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */ | |
| 613 | + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ | |
| 614 | + SDL_SensorEvent sensor; /**< Sensor event data */ | |
| 615 | + SDL_QuitEvent quit; /**< Quit request event data */ | |
| 616 | + SDL_UserEvent user; /**< Custom event data */ | |
| 617 | + SDL_SysWMEvent syswm; /**< System dependent window event data */ | |
| 618 | + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ | |
| 619 | + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ | |
| 620 | + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ | |
| 621 | + SDL_DropEvent drop; /**< Drag and drop event data */ | |
| 587 | 622 | |
| 588 | 623 | /* This is necessary for ABI compatibility between Visual C++ and GCC |
| 589 | 624 | Visual C++ will respect the push pack pragma and use 52 bytes for |
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include "SDL_stdinc.h" |
| 32 | 32 | #include "SDL_error.h" |
| 33 | 33 | #include "SDL_rwops.h" |
| 34 | +#include "SDL_sensor.h" | |
| 34 | 35 | #include "SDL_joystick.h" |
| 35 | 36 | |
| 36 | 37 | #include "begin_code.h" |
| @@ -64,7 +65,9 @@ typedef enum · 27 unmodified lines | ||
| 64 | 65 | SDL_CONTROLLER_TYPE_XBOXONE, |
| 65 | 66 | SDL_CONTROLLER_TYPE_PS3, |
| 66 | 67 | SDL_CONTROLLER_TYPE_PS4, |
| 67 | − SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO | |
| 68 | + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, | |
| 69 | + SDL_CONTROLLER_TYPE_VIRTUAL, | |
| 70 | + SDL_CONTROLLER_TYPE_PS5 | |
| 68 | 71 | } SDL_GameControllerType; |
| 69 | 72 | |
| 70 | 73 | typedef enum |
| @@ -170,7 +173,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID · 99 unmodified lines | ||
| 170 | 173 | * |
| 171 | 174 | * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available |
| 172 | 175 | */ |
| 173 | −extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); | |
| 176 | +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller); | |
| 174 | 177 | |
| 175 | 178 | /** |
| 176 | 179 | * Is the joystick on this index supported by the game controller interface? |
| @@ -245,19 +248,26 @@ extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController · 68 unmodified lines | ||
| 245 | 248 | * Get the USB vendor ID of an opened controller, if available. |
| 246 | 249 | * If the vendor ID isn't available this function returns 0. |
| 247 | 250 | */ |
| 248 | −extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); | |
| 251 | +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller); | |
| 249 | 252 | |
| 250 | 253 | /** |
| 251 | 254 | * Get the USB product ID of an opened controller, if available. |
| 252 | 255 | * If the product ID isn't available this function returns 0. |
| 253 | 256 | */ |
| 254 | −extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); | |
| 257 | +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller); | |
| 255 | 258 | |
| 256 | 259 | /** |
| 257 | 260 | * Get the product version of an opened controller, if available. |
| 258 | 261 | * If the product version isn't available this function returns 0. |
| 259 | 262 | */ |
| 260 | −extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); | |
| 263 | +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller); | |
| 264 | + | |
| 265 | +/** | |
| 266 | + * Get the serial number of an opened controller, if available. | |
| 267 | + * | |
| 268 | + * Returns the serial number of the controller, or NULL if it is not available. | |
| 269 | + */ | |
| 270 | +extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); | |
| 261 | 271 | |
| 262 | 272 | /** |
| 263 | 273 | * Returns SDL_TRUE if the controller has been opened and currently connected, |
| @@ -328,6 +338,12 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL · 64 unmodified lines | ||
| 328 | 338 | SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, |
| 329 | 339 | SDL_GameControllerAxis axis); |
| 330 | 340 | |
| 341 | +/** | |
| 342 | + * Return whether a game controller has a given axis | |
| 343 | + */ | |
| 344 | +extern DECLSPEC SDL_bool SDLCALL | |
| 345 | +SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); | |
| 346 | + | |
| 331 | 347 | /** |
| 332 | 348 | * Get the current state of an axis control on a game controller. |
| 333 | 349 | * |
| @@ -337,8 +353,7 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, · 3 unmodified lines | ||
| 337 | 353 | * The axis indices start at index 0. |
| 338 | 354 | */ |
| 339 | 355 | extern DECLSPEC Sint16 SDLCALL |
| 340 | −SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, | |
| 341 | − SDL_GameControllerAxis axis); | |
| 356 | +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); | |
| 342 | 357 | |
| 343 | 358 | /** |
| 344 | 359 | * The list of buttons available from a controller |
| @@ -361,6 +376,12 @@ typedef enum · 16 unmodified lines | ||
| 361 | 376 | SDL_CONTROLLER_BUTTON_DPAD_DOWN, |
| 362 | 377 | SDL_CONTROLLER_BUTTON_DPAD_LEFT, |
| 363 | 378 | SDL_CONTROLLER_BUTTON_DPAD_RIGHT, |
| 379 | + SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */ | |
| 380 | + SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */ | |
| 381 | + SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */ | |
| 382 | + SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */ | |
| 383 | + SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */ | |
| 384 | + SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ | |
| 364 | 385 | SDL_CONTROLLER_BUTTON_MAX |
| 365 | 386 | } SDL_GameControllerButton; |
| 366 | 387 | |
| @@ -381,6 +402,11 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL · 14 unmodified lines | ||
| 381 | 402 | SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, |
| 382 | 403 | SDL_GameControllerButton button); |
| 383 | 404 | |
| 405 | +/** | |
| 406 | + * Return whether a game controller has a given button | |
| 407 | + */ | |
| 408 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, | |
| 409 | + SDL_GameControllerButton button); | |
| 384 | 410 | |
| 385 | 411 | /** |
| 386 | 412 | * Get the current state of a button on a game controller. |
| @@ -391,7 +417,68 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga · 4 unmodified lines | ||
| 391 | 417 | SDL_GameControllerButton button); |
| 392 | 418 | |
| 393 | 419 | /** |
| 394 | − * Trigger a rumble effect | |
| 420 | + * Get the number of touchpads on a game controller. | |
| 421 | + */ | |
| 422 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); | |
| 423 | + | |
| 424 | +/** | |
| 425 | + * Get the number of supported simultaneous fingers on a touchpad on a game controller. | |
| 426 | + */ | |
| 427 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); | |
| 428 | + | |
| 429 | +/** | |
| 430 | + * Get the current state of a finger on a touchpad on a game controller. | |
| 431 | + */ | |
| 432 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); | |
| 433 | + | |
| 434 | +/** | |
| 435 | + * Return whether a game controller has a particular sensor. | |
| 436 | + * | |
| 437 | + * \param gamecontroller The controller to query | |
| 438 | + * \param type The type of sensor to query | |
| 439 | + * | |
| 440 | + * \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise. | |
| 441 | + */ | |
| 442 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type); | |
| 443 | + | |
| 444 | +/** | |
| 445 | + * Set whether data reporting for a game controller sensor is enabled | |
| 446 | + * | |
| 447 | + * \param gamecontroller The controller to update | |
| 448 | + * \param type The type of sensor to enable/disable | |
| 449 | + * \param enabled Whether data reporting should be enabled | |
| 450 | + * | |
| 451 | + * \return 0 or -1 if an error occurred. | |
| 452 | + */ | |
| 453 | +extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled); | |
| 454 | + | |
| 455 | +/** | |
| 456 | + * Query whether sensor data reporting is enabled for a game controller | |
| 457 | + * | |
| 458 | + * \param gamecontroller The controller to query | |
| 459 | + * \param type The type of sensor to query | |
| 460 | + * | |
| 461 | + * \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. | |
| 462 | + */ | |
| 463 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type); | |
| 464 | + | |
| 465 | +/** | |
| 466 | + * Get the current state of a game controller sensor. | |
| 467 | + * | |
| 468 | + * The number of values and interpretation of the data is sensor dependent. | |
| 469 | + * See SDL_sensor.h for the details for each type of sensor. | |
| 470 | + * | |
| 471 | + * \param gamecontroller The controller to query | |
| 472 | + * \param type The type of sensor to query | |
| 473 | + * \param data A pointer filled with the current sensor state | |
| 474 | + * \param num_values The number of values to write to data | |
| 475 | + * | |
| 476 | + * \return 0 or -1 if an error occurred. | |
| 477 | + */ | |
| 478 | +extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values); | |
| 479 | + | |
| 480 | +/** | |
| 481 | + * Start a rumble effect | |
| 395 | 482 | * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. |
| 396 | 483 | * |
| 397 | 484 | * \param gamecontroller The controller to vibrate |
| @@ -399,10 +486,44 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga · 1 unmodified line | ||
| 399 | 486 | * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF |
| 400 | 487 | * \param duration_ms The duration of the rumble effect, in milliseconds |
| 401 | 488 | * |
| 402 | − * \return 0, or -1 if rumble isn't supported on this joystick | |
| 489 | + * \return 0, or -1 if rumble isn't supported on this controller | |
| 403 | 490 | */ |
| 404 | 491 | extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); |
| 405 | 492 | |
| 493 | +/** | |
| 494 | + * Start a rumble effect in the game controller's triggers | |
| 495 | + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. | |
| 496 | + * | |
| 497 | + * \param gamecontroller The controller to vibrate | |
| 498 | + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF | |
| 499 | + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF | |
| 500 | + * \param duration_ms The duration of the rumble effect, in milliseconds | |
| 501 | + * | |
| 502 | + * \return 0, or -1 if rumble isn't supported on this controller | |
| 503 | + */ | |
| 504 | +extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); | |
| 505 | + | |
| 506 | +/** | |
| 507 | + * Return whether a controller has an LED | |
| 508 | + * | |
| 509 | + * \param gamecontroller The controller to query | |
| 510 | + * | |
| 511 | + * \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED | |
| 512 | + */ | |
| 513 | +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller); | |
| 514 | + | |
| 515 | +/** | |
| 516 | + * Update a controller's LED color. | |
| 517 | + * | |
| 518 | + * \param gamecontroller The controller to update | |
| 519 | + * \param red The intensity of the red LED | |
| 520 | + * \param green The intensity of the green LED | |
| 521 | + * \param blue The intensity of the blue LED | |
| 522 | + * | |
| 523 | + * \return 0, or -1 if this controller does not have a modifiable LED | |
| 524 | + */ | |
| 525 | +extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue); | |
| 526 | + | |
| 406 | 527 | /** |
| 407 | 528 | * Close a controller previously opened with SDL_GameControllerOpen(). |
| 408 | 529 | */ |
| @@ -336,6 +336,14 @@ typedef struct _SDL_Haptic SDL_Haptic; · 335 unmodified lines | ||
| 336 | 336 | */ |
| 337 | 337 | #define SDL_HAPTIC_SPHERICAL 2 |
| 338 | 338 | |
| 339 | +/** | |
| 340 | + * \brief Use this value to play an effect on the steering wheel axis. This | |
| 341 | + * provides better compatibility across platforms and devices as SDL will guess | |
| 342 | + * the correct axis. | |
| 343 | + * \sa SDL_HapticDirection | |
| 344 | + */ | |
| 345 | +#define SDL_HAPTIC_STEERING_AXIS 3 | |
| 346 | + | |
| 339 | 347 | /* @} *//* Direction encodings */ |
| 340 | 348 | |
| 341 | 349 | /* @} *//* Haptic features */ |
| @@ -444,6 +452,7 @@ typedef struct _SDL_Haptic SDL_Haptic; · 102 unmodified lines | ||
| 444 | 452 | * \sa SDL_HAPTIC_POLAR |
| 445 | 453 | * \sa SDL_HAPTIC_CARTESIAN |
| 446 | 454 | * \sa SDL_HAPTIC_SPHERICAL |
| 455 | + * \sa SDL_HAPTIC_STEERING_AXIS | |
| 447 | 456 | * \sa SDL_HapticEffect |
| 448 | 457 | * \sa SDL_HapticNumAxes |
| 449 | 458 | */ |
| @@ -314,6 +314,17 @@ extern "C" { · 313 unmodified lines | ||
| 314 | 314 | */ |
| 315 | 315 | #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" |
| 316 | 316 | |
| 317 | +/** | |
| 318 | + * \brief A variable controlling whether relative mouse motion is affected by renderer scaling | |
| 319 | + * | |
| 320 | + * This variable can be set to the following values: | |
| 321 | + * "0" - Relative motion is unaffected by DPI or renderer's logical size | |
| 322 | + * "1" - Relative motion is scaled according to DPI scaling and logical size | |
| 323 | + * | |
| 324 | + * By default relative mouse deltas are affected by DPI and renderer scaling | |
| 325 | + */ | |
| 326 | +#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" | |
| 327 | + | |
| 317 | 328 | /** |
| 318 | 329 | * \brief A variable controlling whether relative mouse mode is implemented using mouse warping |
| 319 | 330 | * |
| @@ -358,7 +369,9 @@ extern "C" { · 38 unmodified lines | ||
| 358 | 369 | #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" |
| 359 | 370 | |
| 360 | 371 | /** |
| 361 | − * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. | |
| 372 | + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. | |
| 373 | + * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're | |
| 374 | + * seeing if "true" causes more problems than it solves in modern times. | |
| 362 | 375 | * |
| 363 | 376 | */ |
| 364 | 377 | #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" |
| @@ -480,6 +493,7 @@ extern "C" { · 115 unmodified lines | ||
| 480 | 493 | * XboxOne |
| 481 | 494 | * PS3 |
| 482 | 495 | * PS4 |
| 496 | + * PS5 | |
| 483 | 497 | * SwitchPro |
| 484 | 498 | * |
| 485 | 499 | * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) |
| @@ -590,6 +604,17 @@ extern "C" { · 104 unmodified lines | ||
| 590 | 604 | */ |
| 591 | 605 | #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" |
| 592 | 606 | |
| 607 | +/** | |
| 608 | + * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. | |
| 609 | + * | |
| 610 | + * This variable can be set to the following values: | |
| 611 | + * "0" - HIDAPI driver is not used | |
| 612 | + * "1" - HIDAPI driver is used | |
| 613 | + * | |
| 614 | + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI | |
| 615 | + */ | |
| 616 | +#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" | |
| 617 | + | |
| 593 | 618 | /** |
| 594 | 619 | * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. |
| 595 | 620 | * |
| @@ -634,10 +659,23 @@ extern "C" { · 38 unmodified lines | ||
| 634 | 659 | * "0" - HIDAPI driver is not used |
| 635 | 660 | * "1" - HIDAPI driver is used |
| 636 | 661 | * |
| 637 | − * The default is the value of SDL_HINT_JOYSTICK_HIDAPI | |
| 662 | + * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI | |
| 638 | 663 | */ |
| 639 | 664 | #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" |
| 640 | 665 | |
| 666 | + /** | |
| 667 | + * \brief A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated | |
| 668 | + * data from XInput. | |
| 669 | + * | |
| 670 | + * This variable can be set to the following values: | |
| 671 | + * "0" - HIDAPI Xbox driver will only use HIDAPI data | |
| 672 | + * "1" - HIDAPI Xbox driver will also pull data from XInput, providing better trigger axes, guide button | |
| 673 | + * presses, and rumble support | |
| 674 | + * | |
| 675 | + * The default is "1". This hint applies to any joysticks opened after setting the hint. | |
| 676 | + */ | |
| 677 | +#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT" | |
| 678 | + | |
| 641 | 679 | /** |
| 642 | 680 | * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. |
| 643 | 681 | * |
| @@ -660,6 +698,35 @@ extern "C" { · 16 unmodified lines | ||
| 660 | 698 | */ |
| 661 | 699 | #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" |
| 662 | 700 | |
| 701 | + /** | |
| 702 | + * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. | |
| 703 | + * | |
| 704 | + * This variable can be set to the following values: | |
| 705 | + * "0" - RAWINPUT drivers are not used | |
| 706 | + * "1" - RAWINPUT drivers are used (the default) | |
| 707 | + * | |
| 708 | + */ | |
| 709 | +#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" | |
| 710 | + | |
| 711 | + /** | |
| 712 | + * \brief A variable controlling whether a separate thread should be used | |
| 713 | + * for handling joystick detection and raw input messages on Windows | |
| 714 | + * | |
| 715 | + * This variable can be set to the following values: | |
| 716 | + * "0" - A separate thread is not used (the default) | |
| 717 | + * "1" - A separate thread is used for handling raw input messages | |
| 718 | + * | |
| 719 | + */ | |
| 720 | +#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" | |
| 721 | + | |
| 722 | + /** | |
| 723 | + * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. | |
| 724 | + * | |
| 725 | + * This variable can be set to the following values: | |
| 726 | + * "0" - Return unfiltered joystick axis values (the default) | |
| 727 | + * "1" - Return axis values with deadzones taken into account | |
| 728 | + */ | |
| 729 | +#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" | |
| 663 | 730 | |
| 664 | 731 | /** |
| 665 | 732 | * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. |
| @@ -730,6 +797,42 @@ extern "C" { · 64 unmodified lines | ||
| 730 | 797 | */ |
| 731 | 798 | #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" |
| 732 | 799 | |
| 800 | +/** | |
| 801 | +* \brief A string specifying additional information to use with SDL_SetThreadPriority. | |
| 802 | +* | |
| 803 | +* By default SDL_SetThreadPriority will make appropriate system changes in order to | |
| 804 | +* apply a thread priority. For example on systems using pthreads the scheduler policy | |
| 805 | +* is changed automatically to a policy that works well with a given priority. | |
| 806 | +* Code which has specific requirements can override SDL's default behavior with this hint. | |
| 807 | +* | |
| 808 | +* pthread hint values are "current", "other", "fifo" and "rr". | |
| 809 | +* Currently no other platform hint values are defined but may be in the future. | |
| 810 | +* | |
| 811 | +* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro | |
| 812 | +* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME | |
| 813 | +* after calling SDL_SetThreadPriority(). | |
| 814 | +*/ | |
| 815 | +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" | |
| 816 | + | |
| 817 | +/** | |
| 818 | + * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. | |
| 819 | + * | |
| 820 | + * On some platforms, like Linux, a realtime priority thread may be subject to restrictions | |
| 821 | + * that require special handling by the application. This hint exists to let SDL know that | |
| 822 | + * the app is prepared to handle said restrictions. | |
| 823 | + * | |
| 824 | + * On Linux, SDL will apply the following configuration to any thread that becomes realtime: | |
| 825 | + * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, | |
| 826 | + * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. | |
| 827 | + * * Exceeding this limit will result in the kernel sending SIGKILL to the app, | |
| 828 | + * * Refer to the man pages for more information. | |
| 829 | + * | |
| 830 | + * This variable can be set to the following values: | |
| 831 | + * "0" - default platform specific behaviour | |
| 832 | + * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy | |
| 833 | + */ | |
| 834 | +#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" | |
| 835 | + | |
| 733 | 836 | /** |
| 734 | 837 | * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) |
| 735 | 838 | */ |
| @@ -968,6 +1071,18 @@ extern "C" { · 232 unmodified lines | ||
| 968 | 1071 | */ |
| 969 | 1072 | #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" |
| 970 | 1073 | |
| 1074 | +/** | |
| 1075 | + * \brief A variable to control whether SDL will pause audio in background | |
| 1076 | + * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") | |
| 1077 | + * | |
| 1078 | + * The variable can be set to the following values: | |
| 1079 | + * "0" - Non paused. | |
| 1080 | + * "1" - Paused. (default) | |
| 1081 | + * | |
| 1082 | + * The value should be set before SDL is initialized. | |
| 1083 | + */ | |
| 1084 | +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" | |
| 1085 | + | |
| 971 | 1086 | /** |
| 972 | 1087 | * \brief A variable to control whether the return key on the soft keyboard |
| 973 | 1088 | * should hide the soft keyboard on Android and iOS. |
| @@ -994,10 +1109,26 @@ extern "C" { · 20 unmodified lines | ||
| 994 | 1109 | */ |
| 995 | 1110 | #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" |
| 996 | 1111 | |
| 1112 | +/** | |
| 1113 | + * \brief Disable giving back control to the browser automatically | |
| 1114 | + * when running with asyncify | |
| 1115 | + * | |
| 1116 | + * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations | |
| 1117 | + * such as refreshing the screen or polling events. | |
| 1118 | + * | |
| 1119 | + * This hint only applies to the emscripten platform | |
| 1120 | + * | |
| 1121 | + * The variable can be set to the following values: | |
| 1122 | + * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) | |
| 1123 | + * "1" - Enable emscripten_sleep calls (the default) | |
| 1124 | + */ | |
| 1125 | +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" | |
| 1126 | + | |
| 997 | 1127 | /** |
| 998 | 1128 | * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. |
| 999 | 1129 | * |
| 1000 | − * This hint only applies to Unix-like platforms. | |
| 1130 | + * This hint only applies to Unix-like platforms, and should set before | |
| 1131 | + * any calls to SDL_Init() | |
| 1001 | 1132 | * |
| 1002 | 1133 | * The variable can be set to the following values: |
| 1003 | 1134 | * "0" - SDL will install a SIGINT and SIGTERM handler, and when it |
| @@ -1171,6 +1302,32 @@ extern "C" { · 167 unmodified lines | ||
| 1171 | 1302 | #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" |
| 1172 | 1303 | |
| 1173 | 1304 | |
| 1305 | +/** | |
| 1306 | + * \brief A variable controlling whether SDL updates joystick state when getting input events | |
| 1307 | + * | |
| 1308 | + * This variable can be set to the following values: | |
| 1309 | + * | |
| 1310 | + * "0" - You'll call SDL_JoystickUpdate() manually | |
| 1311 | + * "1" - SDL will automatically call SDL_JoystickUpdate() (default) | |
| 1312 | + * | |
| 1313 | + * This hint can be toggled on and off at runtime. | |
| 1314 | + */ | |
| 1315 | +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" | |
| 1316 | + | |
| 1317 | + | |
| 1318 | +/** | |
| 1319 | + * \brief A variable controlling whether SDL updates sensor state when getting input events | |
| 1320 | + * | |
| 1321 | + * This variable can be set to the following values: | |
| 1322 | + * | |
| 1323 | + * "0" - You'll call SDL_SensorUpdate() manually | |
| 1324 | + * "1" - SDL will automatically call SDL_SensorUpdate() (default) | |
| 1325 | + * | |
| 1326 | + * This hint can be toggled on and off at runtime. | |
| 1327 | + */ | |
| 1328 | +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" | |
| 1329 | + | |
| 1330 | + | |
| 1174 | 1331 | /** |
| 1175 | 1332 | * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. |
| 1176 | 1333 | * |
| @@ -1258,7 +1415,7 @@ extern "C" { · 81 unmodified lines | ||
| 1258 | 1415 | */ |
| 1259 | 1416 | #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" |
| 1260 | 1417 | |
| 1261 | −/* | |
| 1418 | +/** | |
| 1262 | 1419 | * \brief Override for SDL_GetDisplayUsableBounds() |
| 1263 | 1420 | * |
| 1264 | 1421 | * If set, this hint will override the expected results for |
| @@ -1272,6 +1429,63 @@ extern "C" { · 7 unmodified lines | ||
| 1272 | 1429 | */ |
| 1273 | 1430 | #define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" |
| 1274 | 1431 | |
| 1432 | +/** | |
| 1433 | + * \brief Specify an application name for an audio device. | |
| 1434 | + * | |
| 1435 | + * Some audio backends (such as PulseAudio) allow you to describe your audio | |
| 1436 | + * stream. Among other things, this description might show up in a system | |
| 1437 | + * control panel that lets the user adjust the volume on specific audio | |
| 1438 | + * streams instead of using one giant master volume slider. | |
| 1439 | + * | |
| 1440 | + * This hints lets you transmit that information to the OS. The contents of | |
| 1441 | + * this hint are used while opening an audio device. You should use a string | |
| 1442 | + * that describes your program ("My Game 2: The Revenge") | |
| 1443 | + * | |
| 1444 | + * Setting this to "" or leaving it unset will have SDL use a reasonable | |
| 1445 | + * default: probably the application's name or "SDL Application" if SDL | |
| 1446 | + * doesn't have any better information. | |
| 1447 | + * | |
| 1448 | + * On targets where this is not supported, this hint does nothing. | |
| 1449 | + */ | |
| 1450 | +#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" | |
| 1451 | + | |
| 1452 | +/** | |
| 1453 | + * \brief Specify an application name for an audio device. | |
| 1454 | + * | |
| 1455 | + * Some audio backends (such as PulseAudio) allow you to describe your audio | |
| 1456 | + * stream. Among other things, this description might show up in a system | |
| 1457 | + * control panel that lets the user adjust the volume on specific audio | |
| 1458 | + * streams instead of using one giant master volume slider. | |
| 1459 | + * | |
| 1460 | + * This hints lets you transmit that information to the OS. The contents of | |
| 1461 | + * this hint are used while opening an audio device. You should use a string | |
| 1462 | + * that describes your what your program is playing ("audio stream" is | |
| 1463 | + * probably sufficient in many cases, but this could be useful for something | |
| 1464 | + * like "team chat" if you have a headset playing VoIP audio separately). | |
| 1465 | + * | |
| 1466 | + * Setting this to "" or leaving it unset will have SDL use a reasonable | |
| 1467 | + * default: "audio stream" or something similar. | |
| 1468 | + * | |
| 1469 | + * On targets where this is not supported, this hint does nothing. | |
| 1470 | + */ | |
| 1471 | +#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" | |
| 1472 | + | |
| 1473 | + | |
| 1474 | +/** | |
| 1475 | + * \brief Override for SDL_GetPreferredLocales() | |
| 1476 | + * | |
| 1477 | + * If set, this will be favored over anything the OS might report for the | |
| 1478 | + * user's preferred locales. Changing this hint at runtime will not generate | |
| 1479 | + * a SDL_LOCALECHANGED event (but if you can change the hint, you can push | |
| 1480 | + * your own event, if you want). | |
| 1481 | + * | |
| 1482 | + * The format of this hint is a comma-separated list of language and locale, | |
| 1483 | + * combined with an underscore, as is a common format: "en_GB". Locale is | |
| 1484 | + * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" | |
| 1485 | + */ | |
| 1486 | +#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" | |
| 1487 | + | |
| 1488 | + | |
| 1275 | 1489 | /** |
| 1276 | 1490 | * \brief An enumeration of hint priorities |
| 1277 | 1491 | */ |
| @@ -105,6 +105,12 @@ typedef enum · 104 unmodified lines | ||
| 105 | 105 | SDL_JOYSTICK_POWER_MAX |
| 106 | 106 | } SDL_JoystickPowerLevel; |
| 107 | 107 | |
| 108 | +/* Set max recognized G-force from accelerometer | |
| 109 | + See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed | |
| 110 | + */ | |
| 111 | +#define SDL_IPHONE_MAX_GFORCE 5.0 | |
| 112 | + | |
| 113 | + | |
| 108 | 114 | /* Function prototypes */ |
| 109 | 115 | |
| 110 | 116 | /** |
| @@ -199,51 +205,92 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID · 88 unmodified lines | ||
| 199 | 205 | */ |
| 200 | 206 | extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); |
| 201 | 207 | |
| 208 | +/** | |
| 209 | + * Attaches a new virtual joystick. | |
| 210 | + * Returns the joystick's device index, or -1 if an error occurred. | |
| 211 | + */ | |
| 212 | +extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, | |
| 213 | + int naxes, | |
| 214 | + int nbuttons, | |
| 215 | + int nhats); | |
| 216 | + | |
| 217 | +/** | |
| 218 | + * Detaches a virtual joystick | |
| 219 | + * Returns 0 on success, or -1 if an error occurred. | |
| 220 | + */ | |
| 221 | +extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); | |
| 222 | + | |
| 223 | +/** | |
| 224 | + * Indicates whether or not a virtual-joystick is at a given device index. | |
| 225 | + */ | |
| 226 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); | |
| 227 | + | |
| 228 | +/** | |
| 229 | + * Set values on an opened, virtual-joystick's controls. | |
| 230 | + * Please note that values set here will not be applied until the next | |
| 231 | + * call to SDL_JoystickUpdate, which can either be called directly, | |
| 232 | + * or can be called indirectly through various other SDL APIS, | |
| 233 | + * including, but not limited to the following: SDL_PollEvent, | |
| 234 | + * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent. | |
| 235 | + * | |
| 236 | + * Returns 0 on success, -1 on error. | |
| 237 | + */ | |
| 238 | +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); | |
| 239 | +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); | |
| 240 | +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); | |
| 241 | + | |
| 202 | 242 | /** |
| 203 | 243 | * Return the name for this currently opened joystick. |
| 204 | 244 | * If no name can be found, this function returns NULL. |
| 205 | 245 | */ |
| 206 | −extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); | |
| 246 | +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); | |
| 207 | 247 | |
| 208 | 248 | /** |
| 209 | 249 | * Get the player index of an opened joystick, or -1 if it's not available |
| 210 | 250 | * |
| 211 | 251 | * For XInput controllers this returns the XInput user index. |
| 212 | 252 | */ |
| 213 | −extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); | |
| 253 | +extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); | |
| 214 | 254 | |
| 215 | 255 | /** |
| 216 | 256 | * Set the player index of an opened joystick |
| 217 | 257 | */ |
| 218 | −extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); | |
| 258 | +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); | |
| 219 | 259 | |
| 220 | 260 | /** |
| 221 | 261 | * Return the GUID for this opened joystick |
| 222 | 262 | */ |
| 223 | −extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); | |
| 263 | +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); | |
| 224 | 264 | |
| 225 | 265 | /** |
| 226 | 266 | * Get the USB vendor ID of an opened joystick, if available. |
| 227 | 267 | * If the vendor ID isn't available this function returns 0. |
| 228 | 268 | */ |
| 229 | −extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); | |
| 269 | +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); | |
| 230 | 270 | |
| 231 | 271 | /** |
| 232 | 272 | * Get the USB product ID of an opened joystick, if available. |
| 233 | 273 | * If the product ID isn't available this function returns 0. |
| 234 | 274 | */ |
| 235 | −extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); | |
| 275 | +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); | |
| 236 | 276 | |
| 237 | 277 | /** |
| 238 | 278 | * Get the product version of an opened joystick, if available. |
| 239 | 279 | * If the product version isn't available this function returns 0. |
| 240 | 280 | */ |
| 241 | −extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); | |
| 281 | +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); | |
| 282 | + | |
| 283 | +/** | |
| 284 | + * Get the serial number of an opened joystick, if available. | |
| 285 | + * | |
| 286 | + * Returns the serial number of the joystick, or NULL if it is not available. | |
| 287 | + */ | |
| 288 | +extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); | |
| 242 | 289 | |
| 243 | 290 | /** |
| 244 | 291 | * Get the type of an opened joystick. |
| 245 | 292 | */ |
| 246 | −extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); | |
| 293 | +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); | |
| 247 | 294 | |
| 248 | 295 | /** |
| 249 | 296 | * Return a string representation for this guid. pszGUID must point to at least 33 bytes |
| @@ -259,17 +306,17 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha · 9 unmodified lines | ||
| 259 | 306 | /** |
| 260 | 307 | * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. |
| 261 | 308 | */ |
| 262 | −extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); | |
| 309 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); | |
| 263 | 310 | |
| 264 | 311 | /** |
| 265 | 312 | * Get the instance ID of an opened joystick or -1 if the joystick is invalid. |
| 266 | 313 | */ |
| 267 | −extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); | |
| 314 | +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); | |
| 268 | 315 | |
| 269 | 316 | /** |
| 270 | 317 | * Get the number of general axis controls on a joystick. |
| 271 | 318 | */ |
| 272 | −extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); | |
| 319 | +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); | |
| 273 | 320 | |
| 274 | 321 | /** |
| 275 | 322 | * Get the number of trackballs on a joystick. |
| @@ -277,17 +324,17 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); · 1 unmodified line | ||
| 277 | 324 | * Joystick trackballs have only relative motion events associated |
| 278 | 325 | * with them and their state cannot be polled. |
| 279 | 326 | */ |
| 280 | −extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); | |
| 327 | +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); | |
| 281 | 328 | |
| 282 | 329 | /** |
| 283 | 330 | * Get the number of POV hats on a joystick. |
| 284 | 331 | */ |
| 285 | −extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); | |
| 332 | +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); | |
| 286 | 333 | |
| 287 | 334 | /** |
| 288 | 335 | * Get the number of buttons on a joystick. |
| 289 | 336 | */ |
| 290 | −extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); | |
| 337 | +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); | |
| 291 | 338 | |
| 292 | 339 | /** |
| 293 | 340 | * Update the current state of the open joysticks. |
| @@ -317,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); · 23 unmodified lines | ||
| 317 | 364 | * |
| 318 | 365 | * The axis indices start at index 0. |
| 319 | 366 | */ |
| 320 | −extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, | |
| 367 | +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, | |
| 321 | 368 | int axis); |
| 322 | 369 | |
| 323 | 370 | /** |
| @@ -329,7 +376,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, · 5 unmodified lines | ||
| 329 | 376 | * |
| 330 | 377 | * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. |
| 331 | 378 | */ |
| 332 | −extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, | |
| 379 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, | |
| 333 | 380 | int axis, Sint16 *state); |
| 334 | 381 | |
| 335 | 382 | /** |
| @@ -363,7 +410,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * · 27 unmodified lines | ||
| 363 | 410 | * - ::SDL_HAT_LEFTUP |
| 364 | 411 | * - ::SDL_HAT_LEFTDOWN |
| 365 | 412 | */ |
| 366 | −extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, | |
| 413 | +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, | |
| 367 | 414 | int hat); |
| 368 | 415 | |
| 369 | 416 | /** |
| @@ -373,7 +420,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, · 3 unmodified lines | ||
| 373 | 420 | * |
| 374 | 421 | * The ball indices start at index 0. |
| 375 | 422 | */ |
| 376 | −extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, | |
| 423 | +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, | |
| 377 | 424 | int ball, int *dx, int *dy); |
| 378 | 425 | |
| 379 | 426 | /** |
| @@ -381,11 +428,11 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, · 1 unmodified line | ||
| 381 | 428 | * |
| 382 | 429 | * The button indices start at index 0. |
| 383 | 430 | */ |
| 384 | −extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, | |
| 431 | +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, | |
| 385 | 432 | int button); |
| 386 | 433 | |
| 387 | 434 | /** |
| 388 | − * Trigger a rumble effect | |
| 435 | + * Start a rumble effect | |
| 389 | 436 | * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. |
| 390 | 437 | * |
| 391 | 438 | * \param joystick The joystick to vibrate |
| @@ -395,17 +442,51 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, · 3 unmodified lines | ||
| 395 | 442 | * |
| 396 | 443 | * \return 0, or -1 if rumble isn't supported on this joystick |
| 397 | 444 | */ |
| 398 | −extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); | |
| 445 | +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); | |
| 446 | + | |
| 447 | +/** | |
| 448 | + * Start a rumble effect in the joystick's triggers | |
| 449 | + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. | |
| 450 | + * | |
| 451 | + * \param joystick The joystick to vibrate | |
| 452 | + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF | |
| 453 | + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF | |
| 454 | + * \param duration_ms The duration of the rumble effect, in milliseconds | |
| 455 | + * | |
| 456 | + * \return 0, or -1 if trigger rumble isn't supported on this joystick | |
| 457 | + */ | |
| 458 | +extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); | |
| 459 | + | |
| 460 | +/** | |
| 461 | + * Return whether a joystick has an LED | |
| 462 | + * | |
| 463 | + * \param joystick The joystick to query | |
| 464 | + * | |
| 465 | + * \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED | |
| 466 | + */ | |
| 467 | +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); | |
| 468 | + | |
| 469 | +/** | |
| 470 | + * Update a joystick's LED color. | |
| 471 | + * | |
| 472 | + * \param joystick The joystick to update | |
| 473 | + * \param red The intensity of the red LED | |
| 474 | + * \param green The intensity of the green LED | |
| 475 | + * \param blue The intensity of the blue LED | |
| 476 | + * | |
| 477 | + * \return 0, or -1 if this joystick does not have a modifiable LED | |
| 478 | + */ | |
| 479 | +extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); | |
| 399 | 480 | |
| 400 | 481 | /** |
| 401 | 482 | * Close a joystick previously opened with SDL_JoystickOpen(). |
| 402 | 483 | */ |
| 403 | −extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); | |
| 484 | +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); | |
| 404 | 485 | |
| 405 | 486 | /** |
| 406 | 487 | * Return the battery level of this joystick |
| 407 | 488 | */ |
| 408 | −extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); | |
| 489 | +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); | |
| 409 | 490 | |
| 410 | 491 | /* Ends C function definitions when using C++ */ |
| 411 | 492 | #ifdef __cplusplus |
| @@ -88,9 +88,11 @@ typedef enum · 87 unmodified lines | ||
| 88 | 88 | SDLK_GREATER = '>', |
| 89 | 89 | SDLK_QUESTION = '?', |
| 90 | 90 | SDLK_AT = '@', |
| 91 | + | |
| 91 | 92 | /* |
| 92 | 93 | Skip uppercase letters |
| 93 | 94 | */ |
| 95 | + | |
| 94 | 96 | SDLK_LEFTBRACKET = '[', |
| 95 | 97 | SDLK_BACKSLASH = '\\', |
| 96 | 98 | SDLK_RIGHTBRACKET = ']', |
| @@ -336,13 +338,13 @@ typedef enum · 239 unmodified lines | ||
| 336 | 338 | KMOD_NUM = 0x1000, |
| 337 | 339 | KMOD_CAPS = 0x2000, |
| 338 | 340 | KMOD_MODE = 0x4000, |
| 339 | − KMOD_RESERVED = 0x8000 | |
| 340 | −} SDL_Keymod; | |
| 341 | + KMOD_RESERVED = 0x8000, | |
| 341 | 342 | |
| 342 | −#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) | |
| 343 | −#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) | |
| 344 | −#define KMOD_ALT (KMOD_LALT|KMOD_RALT) | |
| 345 | −#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) | |
| 343 | + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, | |
| 344 | + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, | |
| 345 | + KMOD_ALT = KMOD_LALT | KMOD_RALT, | |
| 346 | + KMOD_GUI = KMOD_LGUI | KMOD_RGUI | |
| 347 | +} SDL_Keymod; | |
| 346 | 348 | |
| 347 | 349 | #endif /* SDL_keycode_h_ */ |
| 348 | 350 | |
| @@ -0,0 +1,101 @@ | ||
| 1 | +/* | |
| 2 | + Simple DirectMedia Layer | |
| 3 | + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> | |
| 4 | + | |
| 5 | + This software is provided 'as-is', without any express or implied | |
| 6 | + warranty. In no event will the authors be held liable for any damages | |
| 7 | + arising from the use of this software. | |
| 8 | + | |
| 9 | + Permission is granted to anyone to use this software for any purpose, | |
| 10 | + including commercial applications, and to alter it and redistribute it | |
| 11 | + freely, subject to the following restrictions: | |
| 12 | + | |
| 13 | + 1. The origin of this software must not be misrepresented; you must not | |
| 14 | + claim that you wrote the original software. If you use this software | |
| 15 | + in a product, an acknowledgment in the product documentation would be | |
| 16 | + appreciated but is not required. | |
| 17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
| 18 | + misrepresented as being the original software. | |
| 19 | + 3. This notice may not be removed or altered from any source distribution. | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * \file SDL_locale.h | |
| 24 | + * | |
| 25 | + * Include file for SDL locale services | |
| 26 | + */ | |
| 27 | + | |
| 28 | +#ifndef _SDL_locale_h | |
| 29 | +#define _SDL_locale_h | |
| 30 | + | |
| 31 | +#include "SDL_stdinc.h" | |
| 32 | +#include "SDL_error.h" | |
| 33 | + | |
| 34 | +#include "begin_code.h" | |
| 35 | +/* Set up for C function definitions, even when using C++ */ | |
| 36 | +#ifdef __cplusplus | |
| 37 | +/* *INDENT-OFF* */ | |
| 38 | +extern "C" { | |
| 39 | +/* *INDENT-ON* */ | |
| 40 | +#endif | |
| 41 | + | |
| 42 | + | |
| 43 | +typedef struct SDL_Locale | |
| 44 | +{ | |
| 45 | + const char *language; /**< A language name, like "en" for English. */ | |
| 46 | + const char *country; /**< A country, like "US" for America. Can be NULL. */ | |
| 47 | +} SDL_Locale; | |
| 48 | + | |
| 49 | +/** | |
| 50 | + * \brief Report the user's preferred locale. | |
| 51 | + * | |
| 52 | + * This returns an array of SDL_Locale structs, the final item zeroed out. | |
| 53 | + * When the caller is done with this array, it should call SDL_free() on | |
| 54 | + * the returned value; all the memory involved is allocated in a single | |
| 55 | + * block, so a single SDL_free() will suffice. | |
| 56 | + * | |
| 57 | + * Returned language strings are in the format xx, where 'xx' is an ISO-639 | |
| 58 | + * language specifier (such as "en" for English, "de" for German, etc). | |
| 59 | + * Country strings are in the format YY, where "YY" is an ISO-3166 country | |
| 60 | + * code (such as "US" for the United States, "CA" for Canada, etc). Country | |
| 61 | + * might be NULL if there's no specific guidance on them (so you might get | |
| 62 | + * { "en", "US" } for American English, but { "en", NULL } means "English | |
| 63 | + * language, generically"). Language strings are never NULL, except to | |
| 64 | + * terminate the array. | |
| 65 | + * | |
| 66 | + * Please note that not all of these strings are 2 characters; some are | |
| 67 | + * three or more. | |
| 68 | + * | |
| 69 | + * The returned list of locales are in the order of the user's preference. | |
| 70 | + * For example, a German citizen that is fluent in US English and knows | |
| 71 | + * enough Japanese to navigate around Tokyo might have a list like: | |
| 72 | + * { "de", "en_US", "jp", NULL }. Someone from England might prefer British | |
| 73 | + * English (where "color" is spelled "colour", etc), but will settle for | |
| 74 | + * anything like it: { "en_GB", "en", NULL }. | |
| 75 | + * | |
| 76 | + * This function returns NULL on error, including when the platform does not | |
| 77 | + * supply this information at all. | |
| 78 | + * | |
| 79 | + * This might be a "slow" call that has to query the operating system. It's | |
| 80 | + * best to ask for this once and save the results. However, this list can | |
| 81 | + * change, usually because the user has changed a system preference outside | |
| 82 | + * of your program; SDL will send an SDL_LOCALECHANGED event in this case, | |
| 83 | + * if possible, and you can call this function again to get an updated copy | |
| 84 | + * of preferred locales. | |
| 85 | + * | |
| 86 | + * \return array of locales, terminated with a locale with a NULL language | |
| 87 | + * field. Will return NULL on error. | |
| 88 | + */ | |
| 89 | +extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); | |
| 90 | + | |
| 91 | +/* Ends C function definitions when using C++ */ | |
| 92 | +#ifdef __cplusplus | |
| 93 | +/* *INDENT-OFF* */ | |
| 94 | +} | |
| 95 | +/* *INDENT-ON* */ | |
| 96 | +#endif | |
| 97 | +#include "close_code.h" | |
| 98 | + | |
| 99 | +#endif /* _SDL_locale_h */ | |
| 100 | + | |
| 101 | +/* vi: set ts=4 sw=4 expandtab: */ | |
| @@ -55,18 +55,13 @@ typedef void *SDL_MetalView; · 54 unmodified lines | ||
| 55 | 55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its |
| 56 | 56 | * own. It is up to user code to do that. |
| 57 | 57 | * |
| 58 | − * The returned handle can be casted directly to a NSView or UIView, and the | |
| 59 | − * CAMetalLayer can be accessed from the view's 'layer' property. | |
| 58 | + * The returned handle can be casted directly to a NSView or UIView. | |
| 59 | + * To access the backing CAMetalLayer, call SDL_Metal_GetLayer(). | |
| 60 | 60 | * |
| 61 | − * \code | |
| 62 | − * SDL_MetalView metalview = SDL_Metal_CreateView(window); | |
| 63 | − * UIView *uiview = (__bridge UIView *)metalview; | |
| 64 | − * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; | |
| 65 | − * // [...] | |
| 66 | − * SDL_Metal_DestroyView(metalview); | |
| 67 | − * \endcode | |
| 61 | + * \note \a window must be created with the SDL_WINDOW_METAL flag. | |
| 68 | 62 | * |
| 69 | 63 | * \sa SDL_Metal_DestroyView |
| 64 | + * \sa SDL_Metal_GetLayer | |
| 70 | 65 | */ |
| 71 | 66 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); |
| 72 | 67 | |
| @@ -80,6 +75,37 @@ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); · 7 unmodified lines | ||
| 80 | 75 | */ |
| 81 | 76 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); |
| 82 | 77 | |
| 78 | +/** | |
| 79 | + * \brief Get a pointer to the backing CAMetalLayer for the given view. | |
| 80 | + * | |
| 81 | + * \sa SDL_MetalCreateView | |
| 82 | + */ | |
| 83 | +extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); | |
| 84 | + | |
| 85 | +/** | |
| 86 | + * \brief Get the size of a window's underlying drawable in pixels (for use | |
| 87 | + * with setting viewport, scissor & etc). | |
| 88 | + * | |
| 89 | + * \param window SDL_Window from which the drawable size should be queried | |
| 90 | + * \param w Pointer to variable for storing the width in pixels, | |
| 91 | + * may be NULL | |
| 92 | + * \param h Pointer to variable for storing the height in pixels, | |
| 93 | + * may be NULL | |
| 94 | + * | |
| 95 | + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI | |
| 96 | + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a | |
| 97 | + * platform with high-DPI support (Apple calls this "Retina"), and not disabled | |
| 98 | + * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. | |
| 99 | + * | |
| 100 | + * \note On macOS high-DPI support must be enabled for an application by | |
| 101 | + * setting NSHighResolutionCapable to true in its Info.plist. | |
| 102 | + * | |
| 103 | + * \sa SDL_GetWindowSize() | |
| 104 | + * \sa SDL_CreateWindow() | |
| 105 | + */ | |
| 106 | +extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, | |
| 107 | + int *h); | |
| 108 | + | |
| 83 | 109 | /* @} *//* Metal support functions */ |
| 84 | 110 | |
| 85 | 111 | /* Ends C function definitions when using C++ */ |
| @@ -0,0 +1,75 @@ | ||
| 1 | +/* | |
| 2 | + Simple DirectMedia Layer | |
| 3 | + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> | |
| 4 | + | |
| 5 | + This software is provided 'as-is', without any express or implied | |
| 6 | + warranty. In no event will the authors be held liable for any damages | |
| 7 | + arising from the use of this software. | |
| 8 | + | |
| 9 | + Permission is granted to anyone to use this software for any purpose, | |
| 10 | + including commercial applications, and to alter it and redistribute it | |
| 11 | + freely, subject to the following restrictions: | |
| 12 | + | |
| 13 | + 1. The origin of this software must not be misrepresented; you must not | |
| 14 | + claim that you wrote the original software. If you use this software | |
| 15 | + in a product, an acknowledgment in the product documentation would be | |
| 16 | + appreciated but is not required. | |
| 17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
| 18 | + misrepresented as being the original software. | |
| 19 | + 3. This notice may not be removed or altered from any source distribution. | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * \file SDL_misc.h | |
| 24 | + * | |
| 25 | + * \brief Include file for SDL API functions that don't fit elsewhere. | |
| 26 | + */ | |
| 27 | + | |
| 28 | +#ifndef SDL_misc_h_ | |
| 29 | +#define SDL_misc_h_ | |
| 30 | + | |
| 31 | +#include "SDL_stdinc.h" | |
| 32 | + | |
| 33 | +#include "begin_code.h" | |
| 34 | + | |
| 35 | +/* Set up for C function definitions, even when using C++ */ | |
| 36 | +#ifdef __cplusplus | |
| 37 | +extern "C" { | |
| 38 | +#endif | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * \brief Open an URL / URI in the browser or other | |
| 42 | + * | |
| 43 | + * Open a URL in a separate, system-provided application. How this works will | |
| 44 | + * vary wildly depending on the platform. This will likely launch what | |
| 45 | + * makes sense to handle a specific URL's protocol (a web browser for http://, | |
| 46 | + * etc), but it might also be able to launch file managers for directories | |
| 47 | + * and other things. | |
| 48 | + * | |
| 49 | + * What happens when you open a URL varies wildly as well: your game window | |
| 50 | + * may lose focus (and may or may not lose focus if your game was fullscreen | |
| 51 | + * or grabbing input at the time). On mobile devices, your app will likely | |
| 52 | + * move to the background or your process might be paused. Any given platform | |
| 53 | + * may or may not handle a given URL. | |
| 54 | + * | |
| 55 | + * If this is unimplemented (or simply unavailable) for a platform, this will | |
| 56 | + * fail with an error. A successful result does not mean the URL loaded, just | |
| 57 | + * that we launched something to handle it (or at least believe we did). | |
| 58 | + * | |
| 59 | + * All this to say: this function can be useful, but you should definitely | |
| 60 | + * test it on every platform you target. | |
| 61 | + * | |
| 62 | + * \param url A valid URL to open. | |
| 63 | + * \return 0 on success, or -1 on error. | |
| 64 | + */ | |
| 65 | +extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); | |
| 66 | + | |
| 67 | +/* Ends C function definitions when using C++ */ | |
| 68 | +#ifdef __cplusplus | |
| 69 | +} | |
| 70 | +#endif | |
| 71 | +#include "close_code.h" | |
| 72 | + | |
| 73 | +#endif /* SDL_misc_h_ */ | |
| 74 | + | |
| 75 | +/* vi: set ts=4 sw=4 expandtab: */ | |
| @@ -188,18 +188,22 @@ typedef enum · 187 unmodified lines | ||
| 188 | 188 | SDL_PIXELFORMAT_RGB332 = |
| 189 | 189 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, |
| 190 | 190 | SDL_PACKEDLAYOUT_332, 8, 1), |
| 191 | − SDL_PIXELFORMAT_RGB444 = | |
| 191 | + SDL_PIXELFORMAT_XRGB4444 = | |
| 192 | 192 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, |
| 193 | 193 | SDL_PACKEDLAYOUT_4444, 12, 2), |
| 194 | − SDL_PIXELFORMAT_BGR444 = | |
| 194 | + SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444, | |
| 195 | + SDL_PIXELFORMAT_XBGR4444 = | |
| 195 | 196 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, |
| 196 | 197 | SDL_PACKEDLAYOUT_4444, 12, 2), |
| 197 | − SDL_PIXELFORMAT_RGB555 = | |
| 198 | + SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444, | |
| 199 | + SDL_PIXELFORMAT_XRGB1555 = | |
| 198 | 200 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, |
| 199 | 201 | SDL_PACKEDLAYOUT_1555, 15, 2), |
| 200 | − SDL_PIXELFORMAT_BGR555 = | |
| 202 | + SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555, | |
| 203 | + SDL_PIXELFORMAT_XBGR1555 = | |
| 201 | 204 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, |
| 202 | 205 | SDL_PACKEDLAYOUT_1555, 15, 2), |
| 206 | + SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555, | |
| 203 | 207 | SDL_PIXELFORMAT_ARGB4444 = |
| 204 | 208 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, |
| 205 | 209 | SDL_PACKEDLAYOUT_4444, 16, 2), |
| @@ -236,15 +240,17 @@ typedef enum · 30 unmodified lines | ||
| 236 | 240 | SDL_PIXELFORMAT_BGR24 = |
| 237 | 241 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, |
| 238 | 242 | 24, 3), |
| 239 | − SDL_PIXELFORMAT_RGB888 = | |
| 243 | + SDL_PIXELFORMAT_XRGB8888 = | |
| 240 | 244 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, |
| 241 | 245 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| 246 | + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, | |
| 242 | 247 | SDL_PIXELFORMAT_RGBX8888 = |
| 243 | 248 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, |
| 244 | 249 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| 245 | − SDL_PIXELFORMAT_BGR888 = | |
| 250 | + SDL_PIXELFORMAT_XBGR8888 = | |
| 246 | 251 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, |
| 247 | 252 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| 253 | + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, | |
| 248 | 254 | SDL_PIXELFORMAT_BGRX8888 = |
| 249 | 255 | SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, |
| 250 | 256 | SDL_PACKEDLAYOUT_8888, 24, 4), |
| @@ -1,2 +1,2 @@ | ||
| 1 | −#define SDL_REVISION "hg-13609:34cc7d3b69d3" | |
| 2 | −#define SDL_REVISION_NUMBER 13609 | |
| 1 | +#define SDL_REVISION "hg-14525:e52d96ea04fc" | |
| 2 | +#define SDL_REVISION_NUMBER 14525 | |
| @@ -96,15 +96,7 @@ typedef struct SDL_RWops · 95 unmodified lines | ||
| 96 | 96 | #if defined(__ANDROID__) |
| 97 | 97 | struct |
| 98 | 98 | { |
| 99 | − void *fileNameRef; | |
| 100 | − void *inputStreamRef; | |
| 101 | − void *readableByteChannelRef; | |
| 102 | − void *readMethod; | |
| 103 | − void *assetFileDescriptorRef; | |
| 104 | − long position; | |
| 105 | − long size; | |
| 106 | − long offset; | |
| 107 | − int fd; | |
| 99 | + void *asset; | |
| 108 | 100 | } androidio; |
| 109 | 101 | #elif defined(__WIN32__) |
| 110 | 102 | struct |
| @@ -78,14 +78,16 @@ typedef enum · 77 unmodified lines | ||
| 78 | 78 | * Accelerometer sensor |
| 79 | 79 | * |
| 80 | 80 | * The accelerometer returns the current acceleration in SI meters per |
| 81 | − * second squared. This includes gravity, so a device at rest will have | |
| 82 | − * an acceleration of SDL_STANDARD_GRAVITY straight down. | |
| 81 | + * second squared. This measurement includes the force of gravity, so | |
| 82 | + * a device at rest will have an value of SDL_STANDARD_GRAVITY away | |
| 83 | + * from the center of the earth. | |
| 83 | 84 | * |
| 84 | 85 | * values[0]: Acceleration on the x axis |
| 85 | 86 | * values[1]: Acceleration on the y axis |
| 86 | 87 | * values[2]: Acceleration on the z axis |
| 87 | 88 | * |
| 88 | − * For phones held in portrait mode, the axes are defined as follows: | |
| 89 | + * For phones held in portrait mode and game controllers held in front of you, | |
| 90 | + * the axes are defined as follows: | |
| 89 | 91 | * -X ... +X : left ... right |
| 90 | 92 | * -Y ... +Y : bottom ... top |
| 91 | 93 | * -Z ... +Z : farther ... closer |
| @@ -105,22 +107,36 @@ typedef enum · 13 unmodified lines | ||
| 105 | 107 | * see positive rotation on that axis when it appeared to be rotating |
| 106 | 108 | * counter-clockwise. |
| 107 | 109 | * |
| 108 | − * values[0]: Angular speed around the x axis | |
| 109 | − * values[1]: Angular speed around the y axis | |
| 110 | − * values[2]: Angular speed around the z axis | |
| 110 | + * values[0]: Angular speed around the x axis (pitch) | |
| 111 | + * values[1]: Angular speed around the y axis (yaw) | |
| 112 | + * values[2]: Angular speed around the z axis (roll) | |
| 111 | 113 | * |
| 112 | − * For phones held in portrait mode, the axes are defined as follows: | |
| 114 | + * For phones held in portrait mode and game controllers held in front of you, | |
| 115 | + * the axes are defined as follows: | |
| 113 | 116 | * -X ... +X : left ... right |
| 114 | 117 | * -Y ... +Y : bottom ... top |
| 115 | 118 | * -Z ... +Z : farther ... closer |
| 116 | 119 | * |
| 117 | − * The axis data is not changed when the phone is rotated. | |
| 120 | + * The axis data is not changed when the phone or controller is rotated. | |
| 118 | 121 | * |
| 119 | 122 | * \sa SDL_GetDisplayOrientation() |
| 120 | 123 | */ |
| 121 | 124 | |
| 122 | 125 | /* Function prototypes */ |
| 123 | 126 | |
| 127 | +/** | |
| 128 | + * Locking for multi-threaded access to the sensor API | |
| 129 | + * | |
| 130 | + * If you are using the sensor API or handling events from multiple threads | |
| 131 | + * you should use these locking functions to protect access to the sensors. | |
| 132 | + * | |
| 133 | + * In particular, you are guaranteed that the sensor list won't change, so | |
| 134 | + * the API functions that take a sensor index will be valid, and sensor | |
| 135 | + * events will not be delivered. | |
| 136 | + */ | |
| 137 | +extern DECLSPEC void SDLCALL SDL_LockSensors(void); | |
| 138 | +extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); | |
| 139 | + | |
| 124 | 140 | /** |
| 125 | 141 | * \brief Count the number of sensors attached to the system right now |
| 126 | 142 | */ |
| @@ -30,6 +30,12 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #include "SDL_config.h" |
| 32 | 32 | |
| 33 | +#ifdef __APPLE__ | |
| 34 | +#ifndef _DARWIN_C_SOURCE | |
| 35 | +#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */ | |
| 36 | +#endif | |
| 37 | +#endif | |
| 38 | + | |
| 33 | 39 | #ifdef HAVE_SYS_TYPES_H |
| 34 | 40 | #include <sys/types.h> |
| 35 | 41 | #endif |
| @@ -413,6 +419,8 @@ extern DECLSPEC int SDLCALL SDL_islower(int x); · 377 unmodified lines | ||
| 413 | 419 | extern DECLSPEC int SDLCALL SDL_toupper(int x); |
| 414 | 420 | extern DECLSPEC int SDLCALL SDL_tolower(int x); |
| 415 | 421 | |
| 422 | +extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); | |
| 423 | + | |
| 416 | 424 | extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); |
| 417 | 425 | |
| 418 | 426 | #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) |
| @@ -463,6 +471,8 @@ extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar · 44 unmodified lines | ||
| 463 | 471 | |
| 464 | 472 | extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); |
| 465 | 473 | extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); |
| 474 | +extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); | |
| 475 | +extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len); | |
| 466 | 476 | |
| 467 | 477 | extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); |
| 468 | 478 | extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); |
| @@ -529,6 +539,8 @@ extern DECLSPEC double SDLCALL SDL_fabs(double x); · 60 unmodified lines | ||
| 529 | 539 | extern DECLSPEC float SDLCALL SDL_fabsf(float x); |
| 530 | 540 | extern DECLSPEC double SDLCALL SDL_floor(double x); |
| 531 | 541 | extern DECLSPEC float SDLCALL SDL_floorf(float x); |
| 542 | +extern DECLSPEC double SDLCALL SDL_trunc(double x); | |
| 543 | +extern DECLSPEC float SDLCALL SDL_truncf(float x); | |
| 532 | 544 | extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); |
| 533 | 545 | extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); |
| 534 | 546 | extern DECLSPEC double SDLCALL SDL_log(double x); |
| @@ -575,6 +587,17 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, · 40 unmodified lines | ||
| 575 | 587 | /* force builds using Clang's static analysis tools to use literal C runtime |
| 576 | 588 | here, since there are possibly tests that are ineffective otherwise. */ |
| 577 | 589 | #if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) |
| 590 | + | |
| 591 | +/* The analyzer knows about strlcpy even when the system doesn't provide it */ | |
| 592 | +#ifndef HAVE_STRLCPY | |
| 593 | +size_t strlcpy(char* dst, const char* src, size_t size); | |
| 594 | +#endif | |
| 595 | + | |
| 596 | +/* The analyzer knows about strlcat even when the system doesn't provide it */ | |
| 597 | +#ifndef HAVE_STRLCAT | |
| 598 | +size_t strlcat(char* dst, const char* src, size_t size); | |
| 599 | +#endif | |
| 600 | + | |
| 578 | 601 | #define SDL_malloc malloc |
| 579 | 602 | #define SDL_calloc calloc |
| 580 | 603 | #define SDL_realloc realloc |
| @@ -583,16 +606,23 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, · 2 unmodified lines | ||
| 583 | 606 | #define SDL_memcpy memcpy |
| 584 | 607 | #define SDL_memmove memmove |
| 585 | 608 | #define SDL_memcmp memcmp |
| 586 | −#define SDL_strlen strlen | |
| 587 | 609 | #define SDL_strlcpy strlcpy |
| 588 | 610 | #define SDL_strlcat strlcat |
| 611 | +#define SDL_strlen strlen | |
| 612 | +#define SDL_wcslen wcslen | |
| 613 | +#define SDL_wcslcpy wcslcpy | |
| 614 | +#define SDL_wcslcat wcslcat | |
| 589 | 615 | #define SDL_strdup strdup |
| 616 | +#define SDL_wcsdup wcsdup | |
| 590 | 617 | #define SDL_strchr strchr |
| 591 | 618 | #define SDL_strrchr strrchr |
| 592 | 619 | #define SDL_strstr strstr |
| 620 | +#define SDL_wcsstr wcsstr | |
| 593 | 621 | #define SDL_strtokr strtok_r |
| 594 | 622 | #define SDL_strcmp strcmp |
| 623 | +#define SDL_wcscmp wcscmp | |
| 595 | 624 | #define SDL_strncmp strncmp |
| 625 | +#define SDL_wcsncmp wcsncmp | |
| 596 | 626 | #define SDL_strcasecmp strcasecmp |
| 597 | 627 | #define SDL_strncasecmp strncasecmp |
| 598 | 628 | #define SDL_sscanf sscanf |
| @@ -80,7 +80,9 @@ typedef struct SDL_Surface · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | /** information needed for surfaces requiring locks */ |
| 82 | 82 | int locked; /**< Read-only */ |
| 83 | − void *lock_data; /**< Read-only */ | |
| 83 | + | |
| 84 | + /** list of BlitMap that hold a reference to this surface */ | |
| 85 | + void *list_blitmap; /**< Private */ | |
| 84 | 86 | |
| 85 | 87 | /** clipping information */ |
| 86 | 88 | SDL_Rect clip_rect; /**< Read-only */ |
| @@ -235,6 +237,13 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW · 148 unmodified lines | ||
| 235 | 237 | extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, |
| 236 | 238 | int flag); |
| 237 | 239 | |
| 240 | +/** | |
| 241 | + * \brief Returns whether the surface is RLE enabled | |
| 242 | + * | |
| 243 | + * \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled | |
| 244 | + */ | |
| 245 | +extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); | |
| 246 | + | |
| 238 | 247 | /** |
| 239 | 248 | * \brief Sets the color key (transparent pixel) in a blittable surface. |
| 240 | 249 | * |
| @@ -123,6 +123,7 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); · 122 unmodified lines | ||
| 123 | 123 | /** |
| 124 | 124 | \brief Return API level of the current device |
| 125 | 125 | |
| 126 | + API level 30: Android 11 | |
| 126 | 127 | API level 29: Android 10 |
| 127 | 128 | API level 28: Android 9 |
| 128 | 129 | API level 27: Android 8.1 |
| @@ -198,6 +199,14 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); · 69 unmodified lines | ||
| 198 | 199 | */ |
| 199 | 200 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); |
| 200 | 201 | |
| 202 | +/** | |
| 203 | + \brief Request permissions at runtime. | |
| 204 | + | |
| 205 | + This blocks the calling thread until the permission is granted or | |
| 206 | + denied. Returns SDL_TRUE if the permission was granted. | |
| 207 | + */ | |
| 208 | +extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission); | |
| 209 | + | |
| 201 | 210 | #endif /* __ANDROID__ */ |
| 202 | 211 | |
| 203 | 212 | /* Platform specific functions for WinRT */ |
| @@ -106,6 +106,11 @@ typedef void *EGLSurface; · 105 unmodified lines | ||
| 106 | 106 | #if defined(SDL_VIDEO_DRIVER_VIVANTE) |
| 107 | 107 | #include "SDL_egl.h" |
| 108 | 108 | #endif |
| 109 | + | |
| 110 | +#if defined(SDL_VIDEO_DRIVER_OS2) | |
| 111 | +#define INCL_WIN | |
| 112 | +#include <os2.h> | |
| 113 | +#endif | |
| 109 | 114 | #endif /* SDL_PROTOTYPES_ONLY */ |
| 110 | 115 | |
| 111 | 116 | |
| @@ -186,6 +191,16 @@ struct SDL_SysWMmsg · 74 unmodified lines | ||
| 186 | 191 | int dummy; |
| 187 | 192 | /* No Vivante window events yet */ |
| 188 | 193 | } vivante; |
| 194 | +#endif | |
| 195 | +#if defined(SDL_VIDEO_DRIVER_OS2) | |
| 196 | + struct | |
| 197 | + { | |
| 198 | + BOOL fFrame; /**< TRUE if hwnd is a frame window */ | |
| 199 | + HWND hwnd; /**< The window receiving the message */ | |
| 200 | + ULONG msg; /**< The message identifier */ | |
| 201 | + MPARAM mp1; /**< The first first message parameter */ | |
| 202 | + MPARAM mp2; /**< The second first message parameter */ | |
| 203 | + } os2; | |
| 189 | 204 | #endif |
| 190 | 205 | /* Can't have an empty union */ |
| 191 | 206 | int dummy; |
| @@ -280,6 +295,14 @@ struct SDL_SysWMinfo · 88 unmodified lines | ||
| 280 | 295 | } android; |
| 281 | 296 | #endif |
| 282 | 297 | |
| 298 | +#if defined(SDL_VIDEO_DRIVER_OS2) | |
| 299 | + struct | |
| 300 | + { | |
| 301 | + HWND hwnd; /**< The window handle */ | |
| 302 | + HWND hwndFrame; /**< The frame window handle */ | |
| 303 | + } os2; | |
| 304 | +#endif | |
| 305 | + | |
| 283 | 306 | #if defined(SDL_VIDEO_DRIVER_VIVANTE) |
| 284 | 307 | struct |
| 285 | 308 | { |
| @@ -54,6 +54,11 @@ typedef unsigned int SDL_TLSID; · 53 unmodified lines | ||
| 54 | 54 | /** |
| 55 | 55 | * The SDL thread priority. |
| 56 | 56 | * |
| 57 | + * SDL will make system changes as necessary in order to apply the thread priority. | |
| 58 | + * Code which attempts to control thread state related to priority should be aware | |
| 59 | + * that calling SDL_SetThreadPriority may alter such state. | |
| 60 | + * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. | |
| 61 | + * | |
| 57 | 62 | * \note On many systems you require special privileges to set high or time critical priority. |
| 58 | 63 | */ |
| 59 | 64 | typedef enum { |
| @@ -59,7 +59,7 @@ typedef struct SDL_version · 58 unmodified lines | ||
| 59 | 59 | */ |
| 60 | 60 | #define SDL_MAJOR_VERSION 2 |
| 61 | 61 | #define SDL_MINOR_VERSION 0 |
| 62 | −#define SDL_PATCHLEVEL 12 | |
| 62 | +#define SDL_PATCHLEVEL 14 | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * \brief Macro to determine SDL version program was compiled against. |
| @@ -118,7 +118,8 @@ typedef enum · 117 unmodified lines | ||
| 118 | 118 | SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ |
| 119 | 119 | SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ |
| 120 | 120 | SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ |
| 121 | − SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ | |
| 121 | + SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */ | |
| 122 | + SDL_WINDOW_METAL = 0x20000000 /**< window usable for Metal view */ | |
| 122 | 123 | } SDL_WindowFlags; |
| 123 | 124 | |
| 124 | 125 | /** |
| @@ -174,7 +175,9 @@ typedef enum · 49 unmodified lines | ||
| 174 | 175 | typedef enum |
| 175 | 176 | { |
| 176 | 177 | SDL_DISPLAYEVENT_NONE, /**< Never used */ |
| 177 | − SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */ | |
| 178 | + SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */ | |
| 179 | + SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */ | |
| 180 | + SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */ | |
| 178 | 181 | } SDL_DisplayEventID; |
| 179 | 182 | |
| 180 | 183 | typedef enum |
| @@ -484,7 +487,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); · 303 unmodified lines | ||
| 484 | 487 | * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, |
| 485 | 488 | * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, |
| 486 | 489 | * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, |
| 487 | − * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. | |
| 490 | + * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN | |
| 491 | + * ::SDL_WINDOW_METAL. | |
| 488 | 492 | * |
| 489 | 493 | * \return The created window, or NULL if window creation failed. |
| 490 | 494 | * |
| @@ -503,6 +507,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); · 12 unmodified lines | ||
| 503 | 507 | * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, |
| 504 | 508 | * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. |
| 505 | 509 | * |
| 510 | + * If SDL_WINDOW_METAL is specified on an OS that does not support Metal, | |
| 511 | + * SDL_CreateWindow() will fail. | |
| 512 | + * | |
| 506 | 513 | * \note On non-Apple devices, SDL requires you to either not link to the |
| 507 | 514 | * Vulkan loader or link to a dynamic library version. This limitation |
| 508 | 515 | * may be removed in a future version of SDL. |
| @@ -204,10 +204,9 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); · 203 unmodified lines | ||
| 204 | 204 | * |
| 205 | 205 | * \sa SDL_Vulkan_CreateSurface() |
| 206 | 206 | */ |
| 207 | −extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( | |
| 208 | − SDL_Window *window, | |
| 209 | − unsigned int *pCount, | |
| 210 | − const char **pNames); | |
| 207 | +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, | |
| 208 | + unsigned int *pCount, | |
| 209 | + const char **pNames); | |
| 211 | 210 | |
| 212 | 211 | /** |
| 213 | 212 | * \brief Create a Vulkan rendering surface for a window. |
| @@ -238,10 +237,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( · 24 unmodified lines | ||
| 238 | 237 | * |
| 239 | 238 | * \sa SDL_Vulkan_GetInstanceExtensions() |
| 240 | 239 | */ |
| 241 | −extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface( | |
| 242 | − SDL_Window *window, | |
| 243 | − VkInstance instance, | |
| 244 | − VkSurfaceKHR* surface); | |
| 240 | +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, | |
| 241 | + VkInstance instance, | |
| 242 | + VkSurfaceKHR* surface); | |
| 245 | 243 | |
| 246 | 244 | /** |
| 247 | 245 | * \brief Get the size of a window's underlying drawable in pixels (for use |
| @@ -51,15 +51,11 @@ · 50 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | /* Some compilers use a special export keyword */ |
| 53 | 53 | #ifndef DECLSPEC |
| 54 | −# if defined(__WIN32__) || defined(__WINRT__) | |
| 55 | −# ifdef __BORLANDC__ | |
| 56 | −# ifdef BUILD_SDL | |
| 57 | −# define DECLSPEC | |
| 58 | −# else | |
| 59 | −# define DECLSPEC __declspec(dllimport) | |
| 60 | −# endif | |
| 61 | −# else | |
| 54 | +# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) | |
| 55 | +# ifdef DLL_EXPORT | |
| 62 | 56 | # define DECLSPEC __declspec(dllexport) |
| 57 | +# else | |
| 58 | +# define DECLSPEC | |
| 63 | 59 | # endif |
| 64 | 60 | # elif defined(__OS2__) |
| 65 | 61 | # ifdef BUILD_SDL |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.