winit_app 
Winit App Starter Project
[dependencies]
winit_app = "0.31.2"
This Rust library winit_app represents the code to get started with winit Rust windowing library.
(To see more details about winit see here at - https://github.com/rust-windowing/winit )
This project can be used as a start quick launching pad based on the winit library.
Usage
use winit::{event::WindowEvent, window::WindowAttributes};
use winit_app::{AppWindowEvent, Application};
fn launch_app() -> Result<(), Box<dyn std::error::Error>> {
let winit_app = Application::new();
winit_app.run(
WindowAttributes::default().with_title("Sample"),
|app_window_event| match app_window_event {
AppWindowEvent::NewWindow(_window) => {
}
AppWindowEvent::OnWindowEvent(event, event_loop) => match event {
WindowEvent::CloseRequested => {
event_loop.exit();
}
_ => {
}
},
},
)?;
Ok(())
}
Credits
- Winit Documentation and Examples
https://docs.rs/winit/latest/winit/