joystick: Convert HasLED() into a generic GetCapabilities() function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 4b41435..ce12613 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -944,7 +944,7 @@ SDL_JoystickHasLED(SDL_Joystick *joystick)
SDL_LockJoysticks();
- result = joystick->driver->HasLED(joystick);
+ result = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_LED) != 0;
SDL_UnlockJoysticks();
diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h
index 79ba178..e897c44 100644
--- a/src/joystick/SDL_sysjoystick.h
+++ b/src/joystick/SDL_sysjoystick.h
@@ -121,6 +121,9 @@ struct _SDL_Joystick
#define SDL_HARDWARE_BUS_USB 0x03
#define SDL_HARDWARE_BUS_BLUETOOTH 0x05
+/* Joystick capability flags for GetCapabilities() */
+#define SDL_JOYCAP_LED 0x01
+
/* Macro to combine a USB vendor ID and product ID into a single Uint32 value */
#define MAKE_VIDPID(VID, PID) (((Uint32)(VID))<<16|(PID))
@@ -164,8 +167,10 @@ typedef struct _SDL_JoystickDriver
int (*Rumble)(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
int (*RumbleTriggers)(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble);
+ /* Capability detection */
+ Uint32 (*GetCapabilities)(SDL_Joystick *joystick);
+
/* LED functionality */
- SDL_bool (*HasLED)(SDL_Joystick *joystick);
int (*SetLED)(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
/* General effects */
diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c
index a4efdc1..4bbe8c8 100644
--- a/src/joystick/android/SDL_sysjoystick.c
+++ b/src/joystick/android/SDL_sysjoystick.c
@@ -616,10 +616,10 @@ ANDROID_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint1
return SDL_Unsupported();
}
-static SDL_bool
-ANDROID_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+ANDROID_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -719,7 +719,7 @@ SDL_JoystickDriver SDL_ANDROID_JoystickDriver =
ANDROID_JoystickOpen,
ANDROID_JoystickRumble,
ANDROID_JoystickRumbleTriggers,
- ANDROID_JoystickHasLED,
+ ANDROID_JoystickGetCapabilities,
ANDROID_JoystickSetLED,
ANDROID_JoystickSendEffect,
ANDROID_JoystickSetSensorsEnabled,
diff --git a/src/joystick/bsd/SDL_bsdjoystick.c b/src/joystick/bsd/SDL_bsdjoystick.c
index c0fa395..8c5bbcb 100644
--- a/src/joystick/bsd/SDL_bsdjoystick.c
+++ b/src/joystick/bsd/SDL_bsdjoystick.c
@@ -777,10 +777,10 @@ BSD_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out)
return SDL_FALSE;
}
-static SDL_bool
-BSD_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+BSD_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -814,7 +814,7 @@ SDL_JoystickDriver SDL_BSD_JoystickDriver =
BSD_JoystickOpen,
BSD_JoystickRumble,
BSD_JoystickRumbleTriggers,
- BSD_JoystickHasLED,
+ BSD_JoystickGetCapabilities,
BSD_JoystickSetLED,
BSD_JoystickSendEffect,
BSD_JoystickSetSensorsEnabled,
diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c
index d377183..ee02891 100644
--- a/src/joystick/darwin/SDL_iokitjoystick.c
+++ b/src/joystick/darwin/SDL_iokitjoystick.c
@@ -939,10 +939,10 @@ DARWIN_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16
return SDL_Unsupported();
}
-static SDL_bool
-DARWIN_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+DARWIN_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -1111,7 +1111,7 @@ SDL_JoystickDriver SDL_DARWIN_JoystickDriver =
DARWIN_JoystickOpen,
DARWIN_JoystickRumble,
DARWIN_JoystickRumbleTriggers,
- DARWIN_JoystickHasLED,
+ DARWIN_JoystickGetCapabilities,
DARWIN_JoystickSetLED,
DARWIN_JoystickSendEffect,
DARWIN_JoystickSetSensorsEnabled,
diff --git a/src/joystick/dummy/SDL_sysjoystick.c b/src/joystick/dummy/SDL_sysjoystick.c
index c6947c7..830c47c 100644
--- a/src/joystick/dummy/SDL_sysjoystick.c
+++ b/src/joystick/dummy/SDL_sysjoystick.c
@@ -95,10 +95,10 @@ DUMMY_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16
return SDL_Unsupported();
}
-static SDL_bool
-DUMMY_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+DUMMY_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -153,7 +153,7 @@ SDL_JoystickDriver SDL_DUMMY_JoystickDriver =
DUMMY_JoystickOpen,
DUMMY_JoystickRumble,
DUMMY_JoystickRumbleTriggers,
- DUMMY_JoystickHasLED,
+ DUMMY_JoystickGetCapabilities,
DUMMY_JoystickSetLED,
DUMMY_JoystickSendEffect,
DUMMY_JoystickSetSensorsEnabled,
diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c
index bbd481d..b5b8b75 100644
--- a/src/joystick/emscripten/SDL_sysjoystick.c
+++ b/src/joystick/emscripten/SDL_sysjoystick.c
@@ -414,10 +414,10 @@ EMSCRIPTEN_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out)
return SDL_FALSE;
}
-static SDL_bool
-EMSCRIPTEN_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+EMSCRIPTEN_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -451,7 +451,7 @@ SDL_JoystickDriver SDL_EMSCRIPTEN_JoystickDriver =
EMSCRIPTEN_JoystickOpen,
EMSCRIPTEN_JoystickRumble,
EMSCRIPTEN_JoystickRumbleTriggers,
- EMSCRIPTEN_JoystickHasLED,
+ EMSCRIPTEN_JoystickGetCapabilities,
EMSCRIPTEN_JoystickSetLED,
EMSCRIPTEN_JoystickSendEffect,
EMSCRIPTEN_JoystickSetSensorsEnabled,
diff --git a/src/joystick/haiku/SDL_haikujoystick.cc b/src/joystick/haiku/SDL_haikujoystick.cc
index 687dd49..24132bb 100644
--- a/src/joystick/haiku/SDL_haikujoystick.cc
+++ b/src/joystick/haiku/SDL_haikujoystick.cc
@@ -271,9 +271,9 @@ extern "C"
return SDL_FALSE;
}
- static SDL_bool HAIKU_JoystickHasLED(SDL_Joystick *joystick)
+ static Uint32 HAIKU_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int HAIKU_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
@@ -305,7 +305,7 @@ extern "C"
HAIKU_JoystickOpen,
HAIKU_JoystickRumble,
HAIKU_JoystickRumbleTriggers,
- HAIKU_JoystickHasLED,
+ HAIKU_JoystickGetCapabilities,
HAIKU_JoystickSetLED,
HAIKU_JoystickSendEffect,
HAIKU_JoystickSetSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_gamecube.c b/src/joystick/hidapi/SDL_hidapi_gamecube.c
index 21b217f..9fc3ff7 100644
--- a/src/joystick/hidapi/SDL_hidapi_gamecube.c
+++ b/src/joystick/hidapi/SDL_hidapi_gamecube.c
@@ -464,10 +464,10 @@ HIDAPI_DriverGameCube_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joys
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverGameCube_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverGameCube_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -532,7 +532,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverGameCube =
HIDAPI_DriverGameCube_OpenJoystick,
HIDAPI_DriverGameCube_RumbleJoystick,
HIDAPI_DriverGameCube_RumbleJoystickTriggers,
- HIDAPI_DriverGameCube_HasJoystickLED,
+ HIDAPI_DriverGameCube_GetJoystickCapabilities,
HIDAPI_DriverGameCube_SetJoystickLED,
HIDAPI_DriverGameCube_SendJoystickEffect,
HIDAPI_DriverGameCube_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_luna.c b/src/joystick/hidapi/SDL_hidapi_luna.c
index 3734a98..48de69f 100644
--- a/src/joystick/hidapi/SDL_hidapi_luna.c
+++ b/src/joystick/hidapi/SDL_hidapi_luna.c
@@ -132,10 +132,10 @@ HIDAPI_DriverLuna_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverLuna_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverLuna_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -441,7 +441,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverLuna =
HIDAPI_DriverLuna_OpenJoystick,
HIDAPI_DriverLuna_RumbleJoystick,
HIDAPI_DriverLuna_RumbleJoystickTriggers,
- HIDAPI_DriverLuna_HasJoystickLED,
+ HIDAPI_DriverLuna_GetJoystickCapabilities,
HIDAPI_DriverLuna_SetJoystickLED,
HIDAPI_DriverLuna_SendJoystickEffect,
HIDAPI_DriverLuna_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c
index 95ee894..7bd2434 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps4.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps4.c
@@ -598,10 +598,10 @@ HIDAPI_DriverPS4_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverPS4_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverPS4_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- return SDL_TRUE;
+ return SDL_JOYCAP_LED;
}
static int
@@ -935,7 +935,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4 =
HIDAPI_DriverPS4_OpenJoystick,
HIDAPI_DriverPS4_RumbleJoystick,
HIDAPI_DriverPS4_RumbleJoystickTriggers,
- HIDAPI_DriverPS4_HasJoystickLED,
+ HIDAPI_DriverPS4_GetJoystickCapabilities,
HIDAPI_DriverPS4_SetJoystickLED,
HIDAPI_DriverPS4_SendJoystickEffect,
HIDAPI_DriverPS4_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c
index e64c562..ff8fc66 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps5.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps5.c
@@ -663,10 +663,10 @@ HIDAPI_DriverPS5_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverPS5_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverPS5_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- return SDL_TRUE;
+ return SDL_JOYCAP_LED;
}
static int
@@ -1098,7 +1098,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS5 =
HIDAPI_DriverPS5_OpenJoystick,
HIDAPI_DriverPS5_RumbleJoystick,
HIDAPI_DriverPS5_RumbleJoystickTriggers,
- HIDAPI_DriverPS5_HasJoystickLED,
+ HIDAPI_DriverPS5_GetJoystickCapabilities,
HIDAPI_DriverPS5_SetJoystickLED,
HIDAPI_DriverPS5_SendJoystickEffect,
HIDAPI_DriverPS5_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_stadia.c b/src/joystick/hidapi/SDL_hidapi_stadia.c
index 4180f51..f6ddd35 100644
--- a/src/joystick/hidapi/SDL_hidapi_stadia.c
+++ b/src/joystick/hidapi/SDL_hidapi_stadia.c
@@ -126,10 +126,10 @@ HIDAPI_DriverStadia_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joysti
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverStadia_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverStadia_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -315,7 +315,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverStadia =
HIDAPI_DriverStadia_OpenJoystick,
HIDAPI_DriverStadia_RumbleJoystick,
HIDAPI_DriverStadia_RumbleJoystickTriggers,
- HIDAPI_DriverStadia_HasJoystickLED,
+ HIDAPI_DriverStadia_GetJoystickCapabilities,
HIDAPI_DriverStadia_SetJoystickLED,
HIDAPI_DriverStadia_SendJoystickEffect,
HIDAPI_DriverStadia_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_steam.c b/src/joystick/hidapi/SDL_hidapi_steam.c
index 3131011..1b0e76d 100644
--- a/src/joystick/hidapi/SDL_hidapi_steam.c
+++ b/src/joystick/hidapi/SDL_hidapi_steam.c
@@ -1095,11 +1095,11 @@ HIDAPI_DriverSteam_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystic
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverSteam_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverSteam_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
/* You should use the full Steam Input API for LED support */
- return SDL_FALSE;
+ return 0;
}
static int
@@ -1293,7 +1293,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteam =
HIDAPI_DriverSteam_OpenJoystick,
HIDAPI_DriverSteam_RumbleJoystick,
HIDAPI_DriverSteam_RumbleJoystickTriggers,
- HIDAPI_DriverSteam_HasJoystickLED,
+ HIDAPI_DriverSteam_GetJoystickCapabilities,
HIDAPI_DriverSteam_SetJoystickLED,
HIDAPI_DriverSteam_SendJoystickEffect,
HIDAPI_DriverSteam_SetSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index daf61b8..a12aa26 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -1106,11 +1106,11 @@ HIDAPI_DriverSwitch_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joysti
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverSwitch_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverSwitch_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- /* Doesn't have an RGB LED, so don't return true here */
- return SDL_FALSE;
+ /* Doesn't have an RGB LED, so don't return SDL_JOYCAP_LED here */
+ return 0;
}
static int
@@ -1557,7 +1557,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch =
HIDAPI_DriverSwitch_OpenJoystick,
HIDAPI_DriverSwitch_RumbleJoystick,
HIDAPI_DriverSwitch_RumbleJoystickTriggers,
- HIDAPI_DriverSwitch_HasJoystickLED,
+ HIDAPI_DriverSwitch_GetJoystickCapabilities,
HIDAPI_DriverSwitch_SetJoystickLED,
HIDAPI_DriverSwitch_SendJoystickEffect,
HIDAPI_DriverSwitch_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c
index 054cd44..13911ff 100644
--- a/src/joystick/hidapi/SDL_hidapi_xbox360.c
+++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c
@@ -203,11 +203,11 @@ HIDAPI_DriverXbox360_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joyst
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverXbox360_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverXbox360_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- /* Doesn't have an RGB LED, so don't return true here */
- return SDL_FALSE;
+ /* Doesn't have an RGB LED, so don't return SDL_JOYCAP_LED here */
+ return 0;
}
static int
@@ -346,7 +346,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360 =
HIDAPI_DriverXbox360_OpenJoystick,
HIDAPI_DriverXbox360_RumbleJoystick,
HIDAPI_DriverXbox360_RumbleJoystickTriggers,
- HIDAPI_DriverXbox360_HasJoystickLED,
+ HIDAPI_DriverXbox360_GetJoystickCapabilities,
HIDAPI_DriverXbox360_SetJoystickLED,
HIDAPI_DriverXbox360_SendJoystickEffect,
HIDAPI_DriverXbox360_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360w.c b/src/joystick/hidapi/SDL_hidapi_xbox360w.c
index 78e4579..9603e32 100644
--- a/src/joystick/hidapi/SDL_hidapi_xbox360w.c
+++ b/src/joystick/hidapi/SDL_hidapi_xbox360w.c
@@ -173,11 +173,11 @@ HIDAPI_DriverXbox360W_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joys
return SDL_Unsupported();
}
-static SDL_bool
-HIDAPI_DriverXbox360W_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverXbox360W_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
- /* Doesn't have an RGB LED, so don't return true here */
- return SDL_FALSE;
+ /* Doesn't have an RGB LED, so don't return SDL_JOYCAP_LED here */
+ return 0;
}
static int
@@ -343,7 +343,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360W =
HIDAPI_DriverXbox360W_OpenJoystick,
HIDAPI_DriverXbox360W_RumbleJoystick,
HIDAPI_DriverXbox360W_RumbleJoystickTriggers,
- HIDAPI_DriverXbox360W_HasJoystickLED,
+ HIDAPI_DriverXbox360W_GetJoystickCapabilities,
HIDAPI_DriverXbox360W_SetJoystickLED,
HIDAPI_DriverXbox360W_SendJoystickEffect,
HIDAPI_DriverXbox360W_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c
index ad80b6c..a967405 100644
--- a/src/joystick/hidapi/SDL_hidapi_xboxone.c
+++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c
@@ -422,12 +422,17 @@ HIDAPI_DriverXboxOne_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joyst
return HIDAPI_DriverXboxOne_UpdateRumble(device);
}
-static SDL_bool
-HIDAPI_DriverXboxOne_HasJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
+static Uint32
+HIDAPI_DriverXboxOne_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context;
+ Uint32 result = 0;
+
+ if (ctx->has_color_led) {
+ result |= SDL_JOYCAP_LED;
+ }
- return ctx->has_color_led;
+ return result;
}
static int
@@ -1126,7 +1131,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXboxOne =
HIDAPI_DriverXboxOne_OpenJoystick,
HIDAPI_DriverXboxOne_RumbleJoystick,
HIDAPI_DriverXboxOne_RumbleJoystickTriggers,
- HIDAPI_DriverXboxOne_HasJoystickLED,
+ HIDAPI_DriverXboxOne_GetJoystickCapabilities,
HIDAPI_DriverXboxOne_SetJoystickLED,
HIDAPI_DriverXboxOne_SendJoystickEffect,
HIDAPI_DriverXboxOne_SetJoystickSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c
index 91865ad..87f9108 100644
--- a/src/joystick/hidapi/SDL_hidapijoystick.c
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c
@@ -894,15 +894,15 @@ HIDAPI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16
return result;
}
-static SDL_bool
-HIDAPI_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+HIDAPI_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- SDL_bool result = SDL_FALSE;
+ Uint32 result = 0;
if (joystick->hwdata) {
SDL_HIDAPI_Device *device = joystick->hwdata->device;
- result = device->driver->HasJoystickLED(device, joystick);
+ result = device->driver->GetJoystickCapabilities(device, joystick);
}
return result;
@@ -1042,7 +1042,7 @@ SDL_JoystickDriver SDL_HIDAPI_JoystickDriver =
HIDAPI_JoystickOpen,
HIDAPI_JoystickRumble,
HIDAPI_JoystickRumbleTriggers,
- HIDAPI_JoystickHasLED,
+ HIDAPI_JoystickGetCapabilities,
HIDAPI_JoystickSetLED,
HIDAPI_JoystickSendEffect,
HIDAPI_JoystickSetSensorsEnabled,
diff --git a/src/joystick/hidapi/SDL_hidapijoystick_c.h b/src/joystick/hidapi/SDL_hidapijoystick_c.h
index ff44aad..282b149 100644
--- a/src/joystick/hidapi/SDL_hidapijoystick_c.h
+++ b/src/joystick/hidapi/SDL_hidapijoystick_c.h
@@ -97,7 +97,7 @@ typedef struct _SDL_HIDAPI_DeviceDriver
SDL_bool (*OpenJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick);
int (*RumbleJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
int (*RumbleJoystickTriggers)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble);
- SDL_bool (*HasJoystickLED)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick);
+ Uint32 (*GetJoystickCapabilities)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick);
int (*SetJoystickLED)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
int (*SendJoystickEffect)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size);
int (*SetJoystickSensorsEnabled)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled);
diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m
index 74cb39b..e15df71 100644
--- a/src/joystick/iphoneos/SDL_mfijoystick.m
+++ b/src/joystick/iphoneos/SDL_mfijoystick.m
@@ -1326,28 +1326,30 @@ IOS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 ri
#endif
}
-static SDL_bool
-IOS_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+IOS_JoystickGetCapabilities(SDL_Joystick *joystick)
{
+ Uint32 result = 0;
+
#ifdef ENABLE_MFI_LIGHT
@autoreleasepool {
SDL_JoystickDeviceItem *device = joystick->hwdata;
if (device == NULL) {
- return SDL_FALSE;
+ return 0;
}
if (@available(macos 11.0, iOS 14.0, tvOS 14.0, *)) {
GCController *controller = device->controller;
GCDeviceLight *light = controller.light;
if (light) {
- return SDL_TRUE;
+ result |= SDL_JOYCAP_LED;
}
}
}
#endif /* ENABLE_MFI_LIGHT */
- return SDL_FALSE;
+ return result;
}
static int
@@ -1751,7 +1753,7 @@ SDL_JoystickDriver SDL_IOS_JoystickDriver =
IOS_JoystickOpen,
IOS_JoystickRumble,
IOS_JoystickRumbleTriggers,
- IOS_JoystickHasLED,
+ IOS_JoystickGetCapabilities,
IOS_JoystickSetLED,
IOS_JoystickSendEffect,
IOS_JoystickSetSensorsEnabled,
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c
index 9172165..f049248 100644
--- a/src/joystick/linux/SDL_sysjoystick.c
+++ b/src/joystick/linux/SDL_sysjoystick.c
@@ -1190,10 +1190,10 @@ LINUX_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16
return SDL_Unsupported();
}
-static SDL_bool
-LINUX_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+LINUX_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -1790,7 +1790,7 @@ SDL_JoystickDriver SDL_LINUX_JoystickDriver =
LINUX_JoystickOpen,
LINUX_JoystickRumble,
LINUX_JoystickRumbleTriggers,
- LINUX_JoystickHasLED,
+ LINUX_JoystickGetCapabilities,
LINUX_JoystickSetLED,
LINUX_JoystickSendEffect,
LINUX_JoystickSetSensorsEnabled,
diff --git a/src/joystick/os2/SDL_os2joystick.c b/src/joystick/os2/SDL_os2joystick.c
index abdfcca..6ade26a 100644
--- a/src/joystick/os2/SDL_os2joystick.c
+++ b/src/joystick/os2/SDL_os2joystick.c
@@ -472,9 +472,9 @@ static int OS2_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble
return SDL_Unsupported();
}
-static SDL_bool OS2_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32 OS2_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int OS2_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
@@ -777,7 +777,7 @@ SDL_JoystickDriver SDL_OS2_JoystickDriver =
OS2_JoystickOpen,
OS2_JoystickRumble,
OS2_JoystickRumbleTriggers,
- OS2_JoystickHasLED,
+ OS2_JoystickGetCapabilities,
OS2_JoystickSetLED,
OS2_JoystickSendEffect,
OS2_JoystickSetSensorsEnabled,
diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c
index bea3f61..a3b9bc5 100644
--- a/src/joystick/psp/SDL_sysjoystick.c
+++ b/src/joystick/psp/SDL_sysjoystick.c
@@ -209,9 +209,9 @@ PSP_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 ri
return SDL_Unsupported();
}
-static SDL_bool PSP_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32 PSP_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -311,7 +311,7 @@ SDL_JoystickDriver SDL_PSP_JoystickDriver =
PSP_JoystickOpen,
PSP_JoystickRumble,
PSP_JoystickRumbleTriggers,
- PSP_JoystickHasLED,
+ PSP_JoystickGetCapabilities,
PSP_JoystickSetLED,
PSP_JoystickSendEffect,
PSP_JoystickSetSensorsEnabled,
diff --git a/src/joystick/virtual/SDL_virtualjoystick.c b/src/joystick/virtual/SDL_virtualjoystick.c
index 2971efc..2d16457 100644
--- a/src/joystick/virtual/SDL_virtualjoystick.c
+++ b/src/joystick/virtual/SDL_virtualjoystick.c
@@ -345,10 +345,10 @@ VIRTUAL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint1
}
-static SDL_bool
-VIRTUAL_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+VIRTUAL_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
@@ -442,7 +442,7 @@ SDL_JoystickDriver SDL_VIRTUAL_JoystickDriver =
VIRTUAL_JoystickOpen,
VIRTUAL_JoystickRumble,
VIRTUAL_JoystickRumbleTriggers,
- VIRTUAL_JoystickHasLED,
+ VIRTUAL_JoystickGetCapabilities,
VIRTUAL_JoystickSetLED,
VIRTUAL_JoystickSendEffect,
VIRTUAL_JoystickSetSensorsEnabled,
diff --git a/src/joystick/vita/SDL_sysjoystick.c b/src/joystick/vita/SDL_sysjoystick.c
index 1704c31..1d80207 100644
--- a/src/joystick/vita/SDL_sysjoystick.c
+++ b/src/joystick/vita/SDL_sysjoystick.c
@@ -365,11 +365,11 @@ VITA_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left, Uint16 right)
return SDL_Unsupported();
}
-static SDL_bool
-VITA_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+VITA_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- // always return true for now
- return SDL_TRUE;
+ // always return LED supported for now
+ return SDL_JOYCAP_LED;
}
@@ -409,7 +409,7 @@ SDL_JoystickDriver SDL_VITA_JoystickDriver =
VITA_JoystickRumble,
VITA_JoystickRumbleTriggers,
- VITA_JoystickHasLED,
+ VITA_JoystickGetCapabilities,
VITA_JoystickSetLED,
VITA_JoystickSendEffect,
VITA_JoystickSetSensorsEnabled,
diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c
index 8f01474..43a5b49 100644
--- a/src/joystick/windows/SDL_dinputjoystick.c
+++ b/src/joystick/windows/SDL_dinputjoystick.c
@@ -924,6 +924,12 @@ SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble,
return 0;
}
+Uint32
+SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick)
+{
+ return 0;
+}
+
static Uint8
TranslatePOV(DWORD value)
{
@@ -1168,6 +1174,12 @@ SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble,
return SDL_Unsupported();
}
+Uint32
+SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick)
+{
+ return 0;
+}
+
void
SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick)
{
diff --git a/src/joystick/windows/SDL_dinputjoystick_c.h b/src/joystick/windows/SDL_dinputjoystick_c.h
index 68a4c30..9cbfa29 100644
--- a/src/joystick/windows/SDL_dinputjoystick_c.h
+++ b/src/joystick/windows/SDL_dinputjoystick_c.h
@@ -25,6 +25,7 @@ extern void SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext);
extern SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version);
extern int SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice);
extern int SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
+extern Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick);
extern void SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick);
extern void SDL_DINPUT_JoystickClose(SDL_Joystick * joystick);
extern void SDL_DINPUT_JoystickQuit(void);
diff --git a/src/joystick/windows/SDL_mmjoystick.c b/src/joystick/windows/SDL_mmjoystick.c
index 613c406..d288af0 100644
--- a/src/joystick/windows/SDL_mmjoystick.c
+++ b/src/joystick/windows/SDL_mmjoystick.c
@@ -334,9 +334,9 @@ WINMM_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16
return SDL_Unsupported();
}
-static SDL_bool WINMM_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32 WINMM_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -500,7 +500,7 @@ SDL_JoystickDriver SDL_WINMM_JoystickDriver =
WINMM_JoystickOpen,
WINMM_JoystickRumble,
WINMM_JoystickRumbleTriggers,
- WINMM_JoystickHasLED,
+ WINMM_JoystickGetCapabilities,
WINMM_JoystickSetLED,
WINMM_JoystickSendEffect,
WINMM_JoystickSetSensorsEnabled,
diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c
index 2210b19..d66fe00 100644
--- a/src/joystick/windows/SDL_rawinputjoystick.c
+++ b/src/joystick/windows/SDL_rawinputjoystick.c
@@ -1277,10 +1277,10 @@ RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint
#endif
}
-static SDL_bool
-RAWINPUT_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -1928,7 +1928,7 @@ SDL_JoystickDriver SDL_RAWINPUT_JoystickDriver =
RAWINPUT_JoystickOpen,
RAWINPUT_JoystickRumble,
RAWINPUT_JoystickRumbleTriggers,
- RAWINPUT_JoystickHasLED,
+ RAWINPUT_JoystickGetCapabilities,
RAWINPUT_JoystickSetLED,
RAWINPUT_JoystickSendEffect,
RAWINPUT_JoystickSetSensorsEnabled,
diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c
index 6d7e1d7..475b6cd 100644
--- a/src/joystick/windows/SDL_windows_gaming_input.c
+++ b/src/joystick/windows/SDL_windows_gaming_input.c
@@ -665,10 +665,10 @@ WGI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 ri
}
}
-static SDL_bool
-WGI_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+WGI_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ return 0;
}
static int
@@ -876,7 +876,7 @@ SDL_JoystickDriver SDL_WGI_JoystickDriver =
WGI_JoystickOpen,
WGI_JoystickRumble,
WGI_JoystickRumbleTriggers,
- WGI_JoystickHasLED,
+ WGI_JoystickGetCapabilities,
WGI_JoystickSetLED,
WGI_JoystickSendEffect,
WGI_JoystickSetSensorsEnabled,
diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c
index 6fcd0a4..b81ae12 100644
--- a/src/joystick/windows/SDL_windowsjoystick.c
+++ b/src/joystick/windows/SDL_windowsjoystick.c
@@ -658,10 +658,14 @@ WINDOWS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint1
return SDL_Unsupported();
}
-static SDL_bool
-WINDOWS_JoystickHasLED(SDL_Joystick *joystick)
+static Uint32
+WINDOWS_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- return SDL_FALSE;
+ if (joystick->hwdata->bXInputDevice) {
+ return SDL_XINPUT_JoystickGetCapabilities(joystick);
+ } else {
+ return SDL_DINPUT_JoystickGetCapabilities(joystick);
+ }
}
static int
@@ -758,7 +762,7 @@ SDL_JoystickDriver SDL_WINDOWS_JoystickDriver =
WINDOWS_JoystickOpen,
WINDOWS_JoystickRumble,
WINDOWS_JoystickRumbleTriggers,
- WINDOWS_JoystickHasLED,
+ WINDOWS_JoystickGetCapabilities,
WINDOWS_JoystickSetLED,
WINDOWS_JoystickSendEffect,
WINDOWS_JoystickSetSensorsEnabled,
diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c
index c109f7c..350cace 100644
--- a/src/joystick/windows/SDL_xinputjoystick.c
+++ b/src/joystick/windows/SDL_xinputjoystick.c
@@ -503,6 +503,12 @@ SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble,
return 0;
}
+Uint32
+SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick * joystick)
+{
+ return 0;
+}
+
void
SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick)
{
@@ -579,6 +585,12 @@ SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble,
return SDL_Unsupported();
}
+Uint32
+SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick * joystick)
+{
+ return 0;
+}
+
void
SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick)
{
diff --git a/src/joystick/windows/SDL_xinputjoystick_c.h b/src/joystick/windows/SDL_xinputjoystick_c.h
index 5ae3e84..3ca9e1b 100644
--- a/src/joystick/windows/SDL_xinputjoystick_c.h
+++ b/src/joystick/windows/SDL_xinputjoystick_c.h
@@ -27,6 +27,7 @@ extern int SDL_XINPUT_JoystickInit(void);
extern void SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext);
extern int SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice);
extern int SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
+extern Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick * joystick);
extern void SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick);
extern void SDL_XINPUT_JoystickClose(SDL_Joystick * joystick);
extern void SDL_XINPUT_JoystickQuit(void);