pub use crate::{c_void, error::*, stdinc::*};
#[derive(Debug)]
#[repr(transparent)]
pub struct SDL_Joystick(c_void);
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
#[allow(missing_docs)]
pub struct SDL_JoystickGUID {
pub data: [u8; 16],
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_JoystickID(pub i32);
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_JoystickType(pub i32);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_UNKNOWN: SDL_JoystickType = SDL_JoystickType(0);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_GAMECONTROLLER: SDL_JoystickType =
SDL_JoystickType(1);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_WHEEL: SDL_JoystickType = SDL_JoystickType(2);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_ARCADE_STICK: SDL_JoystickType =
SDL_JoystickType(3);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_FLIGHT_STICK: SDL_JoystickType =
SDL_JoystickType(4);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_DANCE_PAD: SDL_JoystickType = SDL_JoystickType(5);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_GUITAR: SDL_JoystickType = SDL_JoystickType(6);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_DRUM_KIT: SDL_JoystickType = SDL_JoystickType(7);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_ARCADE_PAD: SDL_JoystickType = SDL_JoystickType(8);
#[allow(missing_docs)]
pub const SDL_JOYSTICK_TYPE_THROTTLE: SDL_JoystickType = SDL_JoystickType(9);
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_JoystickPowerLevel(pub i32);
pub const SDL_JOYSTICK_POWER_UNKNOWN: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(-1);
pub const SDL_JOYSTICK_POWER_EMPTY: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(0);
pub const SDL_JOYSTICK_POWER_LOW: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(1);
pub const SDL_JOYSTICK_POWER_MEDIUM: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(2);
pub const SDL_JOYSTICK_POWER_FULL: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(3);
pub const SDL_JOYSTICK_POWER_WIRED: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(4);
pub const SDL_JOYSTICK_POWER_MAX: SDL_JoystickPowerLevel =
SDL_JoystickPowerLevel(5);
pub const SDL_JOYSTICK_AXIS_MAX: i16 = 32767;
pub const SDL_JOYSTICK_AXIS_MIN: i16 = -32768;
#[allow(missing_docs)]
pub const SDL_HAT_CENTERED: u8 = 0x00;
#[allow(missing_docs)]
pub const SDL_HAT_UP: u8 = 0x01;
#[allow(missing_docs)]
pub const SDL_HAT_RIGHT: u8 = 0x02;
#[allow(missing_docs)]
pub const SDL_HAT_DOWN: u8 = 0x04;
#[allow(missing_docs)]
pub const SDL_HAT_LEFT: u8 = 0x08;
#[allow(missing_docs)]
pub const SDL_HAT_RIGHTUP: u8 = SDL_HAT_RIGHT | SDL_HAT_UP;
#[allow(missing_docs)]
pub const SDL_HAT_RIGHTDOWN: u8 = SDL_HAT_RIGHT | SDL_HAT_DOWN;
#[allow(missing_docs)]
pub const SDL_HAT_LEFTUP: u8 = SDL_HAT_LEFT | SDL_HAT_UP;
#[allow(missing_docs)]
pub const SDL_HAT_LEFTDOWN: u8 = SDL_HAT_LEFT | SDL_HAT_DOWN;
extern "C" {
pub fn SDL_LockJoysticks();
pub fn SDL_UnlockJoysticks();
pub fn SDL_NumJoysticks() -> c_int;
pub fn SDL_JoystickNameForIndex(device_index: c_int) -> *const c_char;
pub fn SDL_JoystickGetDevicePlayerIndex(device_index: c_int) -> c_int;
pub fn SDL_JoystickGetDeviceGUID(device_index: c_int) -> SDL_JoystickGUID;
pub fn SDL_JoystickGetDeviceVendor(device_index: c_int) -> Uint16;
pub fn SDL_JoystickGetDeviceProduct(device_index: c_int) -> Uint16;
pub fn SDL_JoystickGetDeviceProductVersion(device_index: c_int) -> Uint16;
pub fn SDL_JoystickGetDeviceType(device_index: c_int) -> SDL_JoystickType;
pub fn SDL_JoystickGetDeviceInstanceID(device_index: c_int)
-> SDL_JoystickID;
pub fn SDL_JoystickOpen(device_index: c_int) -> *mut SDL_Joystick;
pub fn SDL_JoystickFromInstanceID(
instance_id: SDL_JoystickID,
) -> *mut SDL_Joystick;
pub fn SDL_JoystickFromPlayerIndex(player_index: c_int) -> *mut SDL_Joystick;
pub fn SDL_JoystickName(joystick: *mut SDL_Joystick) -> *const c_char;
pub fn SDL_JoystickGetPlayerIndex(joystick: *mut SDL_Joystick) -> c_int;
pub fn SDL_JoystickSetPlayerIndex(
joystick: *mut SDL_Joystick, player_index: c_int,
);
pub fn SDL_JoystickGetGUID(joystick: *mut SDL_Joystick) -> SDL_JoystickGUID;
pub fn SDL_JoystickGetVendor(joystick: *mut SDL_Joystick) -> Uint16;
pub fn SDL_JoystickGetProduct(joystick: *mut SDL_Joystick) -> Uint16;
pub fn SDL_JoystickGetProductVersion(joystick: *mut SDL_Joystick) -> Uint16;
pub fn SDL_JoystickGetType(joystick: *mut SDL_Joystick) -> SDL_JoystickType;
pub fn SDL_JoystickGetGUIDString(
guid: SDL_JoystickGUID, pszGUID: *mut c_char, cbGUID: c_int,
);
pub fn SDL_JoystickGetGUIDFromString(
pchGUID: *const c_char,
) -> SDL_JoystickGUID;
pub fn SDL_JoystickGetAttached(joystick: *mut SDL_Joystick) -> SDL_bool;
pub fn SDL_JoystickInstanceID(joystick: *mut SDL_Joystick) -> SDL_JoystickID;
pub fn SDL_JoystickNumAxes(joystick: *mut SDL_Joystick) -> c_int;
pub fn SDL_JoystickNumBalls(joystick: *mut SDL_Joystick) -> c_int;
pub fn SDL_JoystickNumHats(joystick: *mut SDL_Joystick) -> c_int;
pub fn SDL_JoystickNumButtons(joystick: *mut SDL_Joystick) -> c_int;
pub fn SDL_JoystickUpdate();
pub fn SDL_JoystickEventState(state: c_int) -> c_int;
pub fn SDL_JoystickGetAxis(
joystick: *mut SDL_Joystick, axis: c_int,
) -> Sint16;
pub fn SDL_JoystickGetAxisInitialState(
joystick: *mut SDL_Joystick, axis: c_int, state: *mut Sint16,
) -> SDL_bool;
pub fn SDL_JoystickGetHat(joystick: *mut SDL_Joystick, hat: c_int) -> u8;
pub fn SDL_JoystickGetBall(
joystick: *mut SDL_Joystick, ball: c_int, dx: *mut c_int, dy: *mut c_int,
) -> c_int;
pub fn SDL_JoystickGetButton(
joystick: *mut SDL_Joystick, button: c_int,
) -> Uint8;
pub fn SDL_JoystickRumble(
joystick: *mut SDL_Joystick, low_frequency_rumble: Uint16,
high_frequency_rumble: Uint16, duration_ms: Uint32,
) -> c_int;
pub fn SDL_JoystickClose(joystick: *mut SDL_Joystick);
pub fn SDL_JoystickCurrentPowerLevel(
joystick: *mut SDL_Joystick,
) -> SDL_JoystickPowerLevel;
}