Function SDL_JoystickOpen

pub unsafe extern "C" fn SDL_JoystickOpen(
    device_index: i32,
) -> *mut _SDL_Joystick
Available on crate feature dep_sdl2 only.
Expand description

Open a joystick for use.

The device_index argument refers to the N’th joystick presently recognized by SDL on the system. It is NOT the same as the instance ID used to identify the joystick in future events. See SDL_JoystickInstanceID() for more details about instance IDs.

The joystick subsystem must be initialized before a joystick can be opened for use.

\param device_index the index of the joystick to query \returns a joystick identifier or NULL if an error occurred; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_JoystickClose \sa SDL_JoystickInstanceID