oa::ui::sdl_events::convert_sdl_event

Convert one SDL3 event into a UiEvent. pixel_scale_x / pixel_scale_y convert logical SDL coordinates to physical pixels. Obtain them with window_pixel_scale before calling this. Returns None for SDL events that have no UI representation (timers, audio device changes, etc.).

FnRust public API

Function Documentation

pub fn convert_sdl_event( ev: &Event, pixel_scale_x: f32, pixel_scale_y: f32 ) -> Option<UiEvent>
Convert one SDL3 event into a UiEvent. pixel_scale_x / pixel_scale_y convert logical SDL coordinates to physical pixels. Obtain them with window_pixel_scale before calling this. Returns None for SDL events that have no UI representation (timers, audio device changes, etc.).