Function create_window

Source
pub fn create_window(
    event_loop: &ActiveEventLoop,
    options: WindowOptions,
) -> Result<Window, OsError>
Expand description

Creates a window from an [ActiveEventLoop] during normal application resume.

Normal windows with requested sizes are capped to 70% of the primary (or first available) monitor in logical pixels. Native overlays retain their exact target rectangle and skip this clamp.

§Errors

Returns winit’s platform error when native creation fails.

§Examples

use ailloli_ui_winit::{create_window, WindowOptions};
use winit::event_loop::ActiveEventLoop;
fn open(loop_: &ActiveEventLoop) -> Result<winit::window::Window, winit::error::OsError> {
    create_window(loop_, WindowOptions::default())
}