Scroll to navigation

SDL_MouseMotionTransformCallback(3type) SDL3 DATATYPES SDL_MouseMotionTransformCallback(3type)

NAME

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

SYNOPSIS

#include <SDL3/SDL_mouse.h>
typedef void (SDLCALL *SDL_MouseMotionTransformCallback)( void *userdata, Uint64 timestamp, SDL_Window *window, SDL_MouseID mouseID, float *x, float *y);

DESCRIPTION

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

FUNCTION PARAMETERS

what was passed as userdata to SDL_SetRelativeMouseTransform().

the associated time at which this mouse motion event was received.
the associated window to which this mouse motion event was addressed.
the associated mouse from which this mouse motion event was emitted.
pointer to a variable that will be treated as the resulting x-axis motion.
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.

AVAILABILITY

This datatype is available since SDL 3.4.0.

SEE ALSO

SDL_SetRelativeMouseTransform(3)

SDL 3.3.0 Simple Directmedia Layer