Skip to main content

smudge_platform/
lib.rs

1//! Window creation, event translation and frame presentation for desktop and
2//! web targets.
3//!
4//! This crate is the only place that talks to the operating system's windowing
5//! layer. It owns the run loop and hands each frame to the chosen renderer.
6
7#![forbid(unsafe_code)]
8
9#[cfg(not(target_arch = "wasm32"))]
10mod clipboard;
11mod error;
12mod events;
13#[cfg(feature = "gpu")]
14mod gpu;
15mod present;
16mod renderer;
17mod window;
18
19pub use error::PlatformError;
20pub use present::{PresentStats, PresentStatsHandle};
21pub use renderer::{RENDERER_ENVIRONMENT, RendererChoice};
22pub use window::{EventHook, FrameHook, WindowOptions, run, run_with};
23
24/// The GPU adapter a window presents through, as plain strings.
25///
26/// The platform reports one through [`PresentStatsHandle::adapter`] when it
27/// sets the GPU presentation path up.
28#[cfg(feature = "gpu")]
29pub use smudge_gpu::AdapterSummary;