pub struct InputPacket {
pub raw: RenderInput,
pub cursor_outside_window: bool,
pub viewport: (f32, f32),
}Expand description
One frame’s sampled window input, taken beside the backend right after the draw (whose event pump produced it) and consumed by the input system. In serial execution it is deposited and consumed within the same tick; the pipelined driver ships it across the thread boundary instead.
Fields§
§raw: RenderInputThe raw sampled input state.
cursor_outside_window: boolWhether the cursor has left the window.
viewport: (f32, f32)Logical window size, for UI hit-testing and overlay layout.
Implementations§
Source§impl InputPacket
impl InputPacket
Sourcepub fn sample(backend: &mut dyn RenderBackend) -> Self
pub fn sample(backend: &mut dyn RenderBackend) -> Self
Sample the backend’s accumulated input, cursor containment, and logical size into one packet. Called right after the draw so the frame’s event pump is reflected.
Sourcepub fn merge_from(&mut self, newer: InputPacket)
pub fn merge_from(&mut self, newer: InputPacket)
Fold a newer packet onto this one without losing edges: one-frame pulses OR together, deltas accumulate, positions and held states take the newer value. Only needed when a consumer misses a frame (startup, a stall); steady state is one packet per tick.
Trait Implementations§
Source§impl Clone for InputPacket
impl Clone for InputPacket
Source§fn clone(&self) -> InputPacket
fn clone(&self) -> InputPacket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more