Skip to main content

SDL_MouseMotionTransformCallback

Type Alias SDL_MouseMotionTransformCallback 

Source
pub type SDL_MouseMotionTransformCallback = Option<unsafe extern "C" fn(userdata: *mut c_void, timestamp: Uint64, window: *mut SDL_Window, mouseID: SDL_MouseID, x: *mut f32, y: *mut f32)>;
Expand description

A callback used to transform mouse motion delta from raw values.

This is called during SDL’s handling of platform mouse events to scale the values of the resulting motion delta.

Parameter: userdata what was passed as userdata to SDL_SetRelativeMouseTransform(). Parameter: timestamp the associated time at which this mouse motion event was received. Parameter: window the associated window to which this mouse motion event was addressed. Parameter: mouseID the associated mouse from which this mouse motion event was emitted. Parameter: x pointer to a variable that will be treated as the resulting x-axis motion. Parameter: y pointer to a variable that will be treated as the resulting y-axis motion.

Thread Safety: This callback is called by SDL’s internal mouse input processing procedure, which may be a thread separate from the main event loop that is run at realtime priority. Stalling this thread with too much work in the callback can therefore potentially freeze the entire system. Care should be taken with proper synchronization practices when adding other side effects beyond mutation of the x and y values.

Available Since: This datatype is available since SDL 3.4.0.

See Also: SDL_SetRelativeMouseTransform

Aliased Type§

pub enum SDL_MouseMotionTransformCallback {
    None,
    Some(unsafe extern "C" fn(*mut c_void, u64, *mut SDL_Window, u32, *mut f32, *mut f32)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*mut c_void, u64, *mut SDL_Window, u32, *mut f32, *mut f32))

Some value of type T.