pub struct Scheduler {Show 14 fields
pub focused: Option<u64>,
pub size: (u32, u32),
pub pointer_pos_px: Option<(f32, f32)>,
pub held_keys: HashSet<PhysicalKey>,
pub window_focused: bool,
pub touch_points: Vec<(u64, f32, f32)>,
pub mouse_primary: bool,
pub mouse_secondary: bool,
pub mouse_middle: bool,
pub gamepads: Vec<GamepadPad>,
pub scale: f32,
pub cursor_override: Option<CursorIcon>,
pub cursor_grab: CursorGrabMode,
pub fullscreen_request: Option<bool>,
/* private fields */
}Fields§
§focused: Option<u64>§size: (u32, u32)§pointer_pos_px: Option<(f32, f32)>Last known mouse pointer position in physical px, updated on mouse move/press/release without passing through focus dispatch.
held_keys: HashSet<PhysicalKey>Polled physical keys currently down, layout-independent
positions (see PhysicalKey). The platform runner maintains
this from raw KeyboardInput events without passing through
focus dispatch; games reconcile their event-staged held sets
against it every frame (GML keyboard_check parity). Cleared
on window focus loss (no key-ups arrive across an alt-tab).
window_focused: boolWindow focus as of the last platform event. false drops every
held key on the game side.
touch_points: Vec<(u64, f32, f32)>Live touch contacts in physical px: (touch id, x, y) per
finger currently down. Written by the platform runners from
raw WindowEvent::Touch (Started/Moved/Ended-Cancelled), read
by games through feed_polled-style staging snapshots
(GML device_mouse_x_to_gui(i) parity: stable per-finger slot
ids, positions sampled every tick while held).
mouse_primary: boolPolled mouse-button levels, same source as held_keys
(GML mouse_check_button parity; repairs a missed button-up
when the release lands outside the window).
mouse_secondary: bool§mouse_middle: bool§gamepads: Vec<GamepadPad>The connected gamepads, polled like the keys and the mouse levels: the buttons that are down and the live axis values, one entry per pad.
scale: f32The window’s DPI scale factor: physical px per logical px. 1.0 on
a display that reports no scaling. The pointer’s positions are physical
px, so a game that maps them into its own space divides by this.
cursor_override: Option<CursorIcon>App-requested cursor override. When Some, the platform
applies it instead of the hover-derived icon: games hide the
OS pointer here (CursorIcon::Hidden) while drawing their own
crosshair, GML window_set_cursor(cr_none) parity. None
restores hover behavior. Set during composition (any view can
write it; last write per frame wins), consumed by the runner
after frame().
cursor_grab: CursorGrabModeApp-requested pointer confinement, declared per frame like
cursor_override: a game steering with the mouse sets
CursorGrabMode::Confined
while the pointer is its input, so the mouse stops at the
window edge instead of escaping and freezing the control. The
field is reset to None after every frame(), so a game that
stops asking - a paused match, a closed editor - releases the
pointer the same frame.
fullscreen_request: Option<bool>App-requested borderless fullscreen, taken by the runner when it next
looks rather than declared per frame like cursor_grab.
A switch rather than a state, and the difference matters: the game asks
on the frame the player flips the setting, so a window the player
resized themselves is left alone by the next frame re-asserting it. The
runner consumes the request, so it is None again once it has been
applied. Games ask through Scheduler::request_fullscreen; shells
read it back with repose_app::Runtime::take_fullscreen_request.
Implementations§
Source§impl Scheduler
impl Scheduler
pub fn new() -> Self
Sourcepub fn request_fullscreen(&mut self, fullscreen: bool)
pub fn request_fullscreen(&mut self, fullscreen: bool)
Ask the runner for borderless fullscreen on or off.
The app’s side of the request: the runner consumes it when it next looks, so this is asked once, on the frame the player changes their mind, rather than asserted every frame. A game has no other way to reach the window — the closure the shell calls is handed a scheduler and a render context, and neither is the window.
Sourcepub fn enter_scope(&mut self, key: &str)
pub fn enter_scope(&mut self, key: &str)
Enter a named scope. Subsequent id() calls within this scope
will allocate from the scope’s local counter, producing packed
(scope_id << 32) | local_id values that are stable across sibling
recompositions. Nested scopes push; exit_scope pops.
Sourcepub fn exit_scope(&mut self)
pub fn exit_scope(&mut self)
Exit the innermost scope. No-op if the stack is empty or the top does not match (defensive: never corrupt an outer scope).
Sourcepub fn scope_guard<'a>(&'a mut self, key: &str) -> SchedulerScopeGuard<'a>
pub fn scope_guard<'a>(&'a mut self, key: &str) -> SchedulerScopeGuard<'a>
RAII scope entry: pops on drop, so a panicking scope body cannot leave the scheduler stuck in the wrong scope (which previously leaked outer IDs into the global sequence).
Sourcepub fn scope_guard_raw(&mut self, key: &str) -> SchedulerScopeGuardRaw
pub fn scope_guard_raw(&mut self, key: &str) -> SchedulerScopeGuardRaw
Panic-safe scope entry that does NOT hold a borrow: the guarded body
(including nested scope!) can keep using the Scheduler. Used by
the scope! macro.
pub fn id(&mut self) -> u64
pub fn id_count(&self) -> u64
Sourcepub fn is_held(&self, key: PhysicalKey) -> bool
pub fn is_held(&self, key: PhysicalKey) -> bool
True while the named physical key is in the polled snapshot.
Sourcepub fn snapshot_id(&self) -> u64
pub fn snapshot_id(&self) -> u64
Snapshot the current ID counter (before executing a scope body) so the delta can be computed after the body returns.
Sourcepub fn advance_id(&mut self, count: u32)
pub fn advance_id(&mut self, count: u32)
Advance the ID counter by count without assigning IDs.
Used by the scope! macro to reserve IDs for a cached scope subtree.
Sourcepub fn ids_used_since(&self, prev_id: u64) -> u32
pub fn ids_used_since(&self, prev_id: u64) -> u32
Number of IDs assigned since prev_id (the value returned by
snapshot_id() before executing a scope body).