Skip to main content

Crate repame_shell

Crate repame_shell 

Source
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_center is center + offset. Canvas, GPU batch, and picks derive from these fields together.
GamepadId
Opaque gamepad handle. Backend-local index, stable for the connection lifetime. Survives across frames; invalid after GamepadEvent::Disconnected.
GamepadPoller
Gamepad polling on the shared platform backend. Events feed ReposeRuntime::handle_gamepad (UI nav) and rt.gamepads (gameplay).
MotionPoller
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_gamepad the same events GamepadPoller drains.
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.
RetainedRoot
RumbleBridge
Routes HapticBus motors to ReposeRuntime::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.
ShortcutEdges
Sim
Fixed-step sim state. Game registers systems, feeds wall time with step, reads world for the snapshot.
SimTime
Sim time, advanced once per fixed step.
SpriteInstance
One batched sprite. uv is in atlas texels normalized to 0..1.
Staging

Enums§

GamepadEvent
PickEvent

Constants§

RUMBLE_REFRESH
Upload again once this much of RUMBLE_UPLOAD_MS has 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§

ShellHooks
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 f on the first user gesture on this page.
run_desktop
Desktop entry point. Mounts root with title and size. The root closure owns stepping and requests frames for continuity. The closure receives the live repose_core::runtime::Scheduler each frame, whose held_keys / window_focused / mouse_* fields are the single polled hardware snapshot (GML keyboard_check / mouse_check_button parity).
shared_edges
shortcut_handler
take_shortcut_edges
user_gesture_seen
Whether a user gesture has been seen.

Type Aliases§

SharedEdges