Skip to main content

Crate aetna_web

Crate aetna_web 

Source
Expand description

Browser host for Aetna wasm apps.

Write normal UI code against aetna_core::prelude::*, then call start_with from your wasm crate’s #[wasm_bindgen(start)] entry point. The host opens a wgpu surface against a canvas in the page and drives the app through winit’s browser event loop.

The default configuration expects a <canvas id="aetna_canvas">. Use start_with_config when embedding into a page with a different canvas id.

aetna-winit-wgpu is the equivalent reusable native host.

Structs§

WebHandle
Browser redraw handle.
WebHostConfig
Browser host configuration.

Constants§

DEFAULT_CANVAS_ID
Default canvas element id used by WebHostConfig::default.
VIEWPORT
Default logical viewport. Sized to feel reasonable both as a winit window and as a browser canvas. Browsers can override this by resizing the canvas; the runner reacts to winit::Resized.

Functions§

start_with
start_with_config