Struct sdl2_sys::SDL_VirtualJoystickDesc
source · #[repr(C)]pub struct SDL_VirtualJoystickDesc {Show 18 fields
pub version: Uint16,
pub type_: Uint16,
pub naxes: Uint16,
pub nbuttons: Uint16,
pub nhats: Uint16,
pub vendor_id: Uint16,
pub product_id: Uint16,
pub padding: Uint16,
pub button_mask: Uint32,
pub axis_mask: Uint32,
pub name: *const c_char,
pub userdata: *mut c_void,
pub Update: Option<unsafe extern "C" fn(userdata: *mut c_void)>,
pub SetPlayerIndex: Option<unsafe extern "C" fn(userdata: *mut c_void, player_index: c_int)>,
pub Rumble: Option<unsafe extern "C" fn(userdata: *mut c_void, low_frequency_rumble: Uint16, high_frequency_rumble: Uint16) -> c_int>,
pub RumbleTriggers: Option<unsafe extern "C" fn(userdata: *mut c_void, left_rumble: Uint16, right_rumble: Uint16) -> c_int>,
pub SetLED: Option<unsafe extern "C" fn(userdata: *mut c_void, red: Uint8, green: Uint8, blue: Uint8) -> c_int>,
pub SendEffect: Option<unsafe extern "C" fn(userdata: *mut c_void, data: *const c_void, size: c_int) -> c_int>,
}
Expand description
The structure that defines an extended virtual joystick description
The caller must zero the structure and then initialize the version with SDL_VIRTUAL_JOYSTICK_DESC_VERSION
before passing it to SDL_JoystickAttachVirtualEx()
All other elements of this structure are optional and can be left 0.
\sa SDL_JoystickAttachVirtualEx
Fields§
§version: Uint16
< SDL_VIRTUAL_JOYSTICK_DESC_VERSION
type_: Uint16
< SDL_JoystickType
naxes: Uint16
< the number of axes on this joystick
< the number of buttons on this joystick
nhats: Uint16
< the number of hats on this joystick
vendor_id: Uint16
< the USB vendor ID of this joystick
product_id: Uint16
< the USB product ID of this joystick
padding: Uint16
< unused
< A mask of which buttons are valid for this controller e.g. (1 << SDL_CONTROLLER_BUTTON_A)
axis_mask: Uint32
< A mask of which axes are valid for this controller e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX)
name: *const c_char
< the name of the joystick
userdata: *mut c_void
< User data pointer passed to callbacks
Update: Option<unsafe extern "C" fn(userdata: *mut c_void)>
< Called when the joystick state should be updated
SetPlayerIndex: Option<unsafe extern "C" fn(userdata: *mut c_void, player_index: c_int)>
< Called when the player index is set
Rumble: Option<unsafe extern "C" fn(userdata: *mut c_void, low_frequency_rumble: Uint16, high_frequency_rumble: Uint16) -> c_int>
< Implements SDL_JoystickRumble()
RumbleTriggers: Option<unsafe extern "C" fn(userdata: *mut c_void, left_rumble: Uint16, right_rumble: Uint16) -> c_int>
< Implements SDL_JoystickRumbleTriggers()
SetLED: Option<unsafe extern "C" fn(userdata: *mut c_void, red: Uint8, green: Uint8, blue: Uint8) -> c_int>
< Implements SDL_JoystickSetLED()
SendEffect: Option<unsafe extern "C" fn(userdata: *mut c_void, data: *const c_void, size: c_int) -> c_int>
< Implements SDL_JoystickSendEffect()
Trait Implementations§
source§impl Clone for SDL_VirtualJoystickDesc
impl Clone for SDL_VirtualJoystickDesc
source§fn clone(&self) -> SDL_VirtualJoystickDesc
fn clone(&self) -> SDL_VirtualJoystickDesc
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more