retroglyph_window/winit/mod.rs
1//! Everything winit-specific in this crate: the event loop, event translation, and the windowed
2//! app drivers.
3//!
4//! A driver for another windowing library (SDL2, tao, a custom loop) would be a sibling module
5//! with the same shape: create a window, translate its events into
6//! [`Event`](retroglyph_core::event::Event)s pushed onto [`WindowBackend`](crate::backend::WindowBackend),
7//! and call [`Presenter::present`](crate::presenter::Presenter::present) once per frame.
8
9/// [`EventLoopError`], the opaque wrapper around winit's own event-loop error.
10mod error;
11/// The winit event loop, `WindowConfig`, and the `run_windowed`/`run_app` drivers.
12pub mod run;
13/// winit-event -> retroglyph-event converters.
14pub mod translate;
15/// wasm32-only DPR/viewport/pointer-rescaling helpers used internally by `run`.
16mod web;
17
18pub use error::EventLoopError;
19pub use run::{
20 EventProxy, EventProxyClosed, WindowConfig, run_app, run_app_on, run_app_with_proxy,
21 run_app_with_typed_proxy, run_windowed, run_windowed_with_proxy, run_windowed_with_typed_proxy,
22};
23pub use windowed::{Windowed, WindowedLaunchError};
24
25/// [`Windowed`], the [`Launch`](retroglyph_core::app::Launch) wrapper pairing a windowed
26/// backend's `PresenterBuilder` with a window title.
27mod windowed;