pub struct App { /* private fields */ }Expand description
Unified cross-platform application runtime orchestrating platform events, reactivity, layout, and rendering.
Implementations§
Source§impl App
Core lifecycle, event dispatch, and frame rendering pipeline for App.
impl App
Core lifecycle, event dispatch, and frame rendering pipeline for App.
Sourcepub fn new(config: AppConfig) -> Result<Self, PlatformError>
pub fn new(config: AppConfig) -> Result<Self, PlatformError>
Sourcepub fn headless(config: AppConfig) -> Result<Self, PlatformError>
pub fn headless(config: AppConfig) -> Result<Self, PlatformError>
Sourcepub fn with_platform(
config: AppConfig,
platform: Box<dyn PlatformBackend>,
) -> Result<Self, PlatformError>
pub fn with_platform( config: AppConfig, platform: Box<dyn PlatformBackend>, ) -> Result<Self, PlatformError>
Sourcepub fn display_refresh_rate_hz(&self) -> f32
pub fn display_refresh_rate_hz(&self) -> f32
Sourcepub fn update_display_refresh_rate_hz(&mut self, hz: f32)
pub fn update_display_refresh_rate_hz(&mut self, hz: f32)
Updates the detected native hardware display refresh rate reported by an OS or browser host.
§Arguments
&Self- Mutable application.f32- Measured or queried display refresh rate in Hertz.
Sourcepub fn report_host_refresh_rate(&mut self, measured_hz: f32)
pub fn report_host_refresh_rate(&mut self, measured_hz: f32)
Reports live host VSync / requestAnimationFrame cadence when the scene is idle so telemetry reflects the real display rate.
§Arguments
&Self- Mutable application.f32- Measured host presentation cadence in Hertz.
Sourcepub fn is_ime_active(&self) -> bool
pub fn is_ime_active(&self) -> bool
Sourcepub fn last_frame_damage(&self) -> DamageRegion
pub fn last_frame_damage(&self) -> DamageRegion
Sourcepub fn set_fps_limit(&mut self, limit: Option<u32>)
pub fn set_fps_limit(&mut self, limit: Option<u32>)
Configures the cross-platform maximum frame rate (None = unlimited maximum FPS, the default).
§Arguments
&Self- Mutable application.Option<u32>- Target FPS cap (Some(1..=1000)orNonefor uncapped maximum FPS).
Sourcepub fn attach_game_host(&mut self, host: GameEngineHost)
pub fn attach_game_host(&mut self, host: GameEngineHost)
Registers a GameEngineHost so all incoming OS/Web WindowEvents are automatically forwarded to its InputState.
§Arguments
&Self- Mutable application.GameEngineHost- Game engine host handle to attach.
Sourcepub fn has_active_animations(&self) -> bool
pub fn has_active_animations(&self) -> bool
Sourcepub fn platform_kind(&self) -> PlatformKind
pub fn platform_kind(&self) -> PlatformKind
Sourcepub fn platform_capabilities(&self) -> PlatformCapabilities
pub fn platform_capabilities(&self) -> PlatformCapabilities
Sourcepub fn raw_window_handle(&self) -> RawWindowHandle
pub fn raw_window_handle(&self) -> RawWindowHandle
Sourcepub fn set_render_mode(&mut self, mode: RenderMode)
pub fn set_render_mode(&mut self, mode: RenderMode)
Dynamically switches the rendering pipeline mode (Auto, Software, Hardware, Hybrid).
§Arguments
&Self- Mutable app.RenderMode- Target render mode.
Sourcepub fn queue_window_command(&mut self, command: WindowCommand)
pub fn queue_window_command(&mut self, command: WindowCommand)
Queues a WindowCommand for immediate dispatch on the next frame tick.
§Arguments
&Self- Mutable app.WindowCommand- Command to queue.
Sourcepub fn set_exact_physical_viewport(
&mut self,
phys_w: u32,
phys_h: u32,
scale: f32,
)
pub fn set_exact_physical_viewport( &mut self, phys_w: u32, phys_h: u32, scale: f32, )
Sets exact physical pixel surface dimensions and DPI scale without truncating fractional logical sizes.
§Arguments
&Self- Mutable app.u32- Exact physical surface width in device pixels.u32- Exact physical surface height in device pixels.f32- Active display DPI scale factor.
Sourcepub fn dispatch_window_event(&mut self, event: WindowEvent)
pub fn dispatch_window_event(&mut self, event: WindowEvent)
Processes a single incoming WindowEvent, updating state, hit-testing, and dispatching UI callbacks.
§Arguments
&Self- Mutable app.WindowEvent- Event received from the OS or test harness.
Sourcepub fn step_frame(&mut self) -> Result<FrameStats, PlatformError>
pub fn step_frame(&mut self) -> Result<FrameStats, PlatformError>
Sourcepub fn step_game_frame(
&mut self,
dt_secs: f32,
) -> Result<FrameStats, PlatformError>
pub fn step_game_frame( &mut self, dt_secs: f32, ) -> Result<FrameStats, PlatformError>
Sourcepub fn run_frames(
&mut self,
max_frames: Option<u64>,
) -> Result<FrameStats, PlatformError>
pub fn run_frames( &mut self, max_frames: Option<u64>, ) -> Result<FrameStats, PlatformError>
Sourcepub fn cancel_all_active_pointers(&mut self)
pub fn cancel_all_active_pointers(&mut self)
Cancels all active pointer/touch contacts and resets transient gesture, drag, and pressed UI state.
§Arguments
&Self- Mutable app.
Sourcepub fn reconcile_active_touch_ids(&mut self, live_ids: &[u64])
pub fn reconcile_active_touch_ids(&mut self, live_ids: &[u64])
Reconciles active touch contacts against the OS ground-truth live pointer ID list, pruning any stale/missed touches.
§Arguments
&Self- Mutable app.&[u64]- Currently active OS touch pointer identifiers.