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

§nbuttons: Uint16

< 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

§button_mask: Uint32

< 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

source§

fn clone(&self) -> SDL_VirtualJoystickDesc

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for SDL_VirtualJoystickDesc

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.