Expand description
App wiring: Repose platform runners, host helpers, and the portal.
Games provide the root view; the run_* runners mount only, and stepping
stays game-side via Sim::step. RetainedRoot keeps the mounted view
alive across frames, and GamepadPoller drains hardware events from the
shared platform backend into the UI nav and the game’s own pad state.
Around that sit the helpers a host game needs once: Staging as the one
per-frame input snapshot (held keys, edges, clicks, aim, touches, pads),
on_first_user_gesture for the browser’s autoplay rule, RumbleBridge
for haptics, PadBank and PadMotion for pads and their motion,
apply_scheduler_levels for scheduler priority, Quit for the
platform-specific exit, and the shared shortcut edges.
portal is the part a hosted game cannot do without: ads with deadlines,
cloud-save push and pull, host pause, lifecycle mute, and the Suspend
gate that decides whether the clock runs this frame. It is a module of its
own because those rules are worth reading in one place.
Re-exports§
pub use portal::AdKind;pub use portal::AdOutcome;pub use portal::GameState;pub use portal::PortalHost;pub use portal::PortalReport;pub use portal::Suspend;
Modules§
- portal
- Portal integration: ads, cloud saves, host pause, lifecycle mute and the host-facing gameplay notices, in one place.
Structs§
- Camera2d
- 2D orthographic camera. Owned by the UI (signals), copied into the
snapshot per frame.
effective_centeriscenter + offset. Canvas, GPU batch, and picks derive from these fields together. - Gamepad
Id - Opaque gamepad handle. Backend-local index, stable for the connection
lifetime. Survives across frames; invalid after
GamepadEvent::Disconnected. - Gamepad
Poller - Gamepad polling on the shared platform backend. Events feed
ReposeRuntime::handle_gamepad(UI nav) andrt.gamepads(gameplay). - Motion
Poller - Motion-sensor polling on top of the shared platform backend. Sensor nodes
are separate evdev nodes from the pad, so readings are routed back to pads
by name; feed
MotionPoller::feed_gamepadthe same eventsGamepadPollerdrains. - PadBank
- PadBridge
- PadMotion
- One pad’s motion, ready for
MotionTracker. Holds its own copy of the reading so it stays a plain value the sim can carry between frames. - Quit
- A quit request, latched so a browser shell can park instead of exiting.
- Retained
Root - Rumble
Bridge - Routes
HapticBusmotors toReposeRuntime::request_rumble. Uploads only on change and on refresh, and stops devices the bus dropped, since the bus stops mentioning a device rather than zeroing it. - Shortcut
Edges - Sim
- Fixed-step sim state. Game registers systems,
feeds wall time with
step, readsworldfor the snapshot. - SimTime
- Sim time, advanced once per fixed step.
- Sprite
Instance - One batched sprite.
uvis in atlas texels normalized to 0..1. - Staging
Enums§
Constants§
- RUMBLE_
REFRESH - Upload again once this much of
RUMBLE_UPLOAD_MShas elapsed, which keeps a held effect alive without restarting it every frame. - RUMBLE_
UPLOAD_ MS - Length of each rumble upload. The backend sends a fresh force-feedback effect per call, so uploads are spaced out rather than repeated per frame.
- TRIGGER_
HELD
Traits§
- Shell
Hooks - Per-frame hooks the game implements.
Functions§
- apply_
scheduler_ levels - game_
shortcut_ map - install_
game_ shortcuts - Compose the game map + edges handler once in the root view (mount-once under the hood: safe to call every frame on desktop, web, and Android-with-keyboard alike). One call per game; no per-key duplication at call sites.
- install_
handler_ into - Install only the action handler into long-lived
edges(tests and headless compose without a runner use this path). - install_
map - Overwrite the process-global default shortcut map (tests and headless compose without a runner use this path).
- on_
first_ user_ gesture - Run
fon the first user gesture on this page. - run_
desktop - Desktop entry point. Mounts
rootwith title and size. The root closure owns stepping and requests frames for continuity. The closure receives the liverepose_core::runtime::Schedulereach frame, whoseheld_keys/window_focused/mouse_*fields are the single polled hardware snapshot (GMLkeyboard_check/mouse_check_buttonparity). - shared_
edges - shortcut_
handler - take_
shortcut_ edges - user_
gesture_ seen - Whether a user gesture has been seen.