mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
SDL_GetJoysticks() follows the SDL_GetStringRule
This commit is contained in:
parent
b32c9615a7
commit
4961af4569
7 changed files with 15 additions and 20 deletions
|
|
@ -823,7 +823,7 @@ Rather than iterating over joysticks using device index, there is a new function
|
|||
{
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == 0) {
|
||||
int i, num_joysticks;
|
||||
SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks);
|
||||
const SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks);
|
||||
if (joysticks) {
|
||||
for (i = 0; i < num_joysticks; ++i) {
|
||||
SDL_JoystickID instance_id = joysticks[i];
|
||||
|
|
@ -833,7 +833,6 @@ Rather than iterating over joysticks using device index, there is a new function
|
|||
SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n",
|
||||
instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorForID(instance_id), SDL_GetJoystickProductForID(instance_id));
|
||||
}
|
||||
SDL_free(joysticks);
|
||||
}
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue