Crate witer

source ·
Expand description

witer (window iterator, “wit-er”) is an iterator-based Win32 window library built in Rust.

§Example

use witer::prelude::*;

// Build
let window = Window::builder()
  .with_title("My App")
  .with_size(LogicalSize::new(800.0, 500.0))
  .build()?;

// Run
for message in &window {
  if let Message::Key { .. } = message {
    println!("{message:?}");
  }
}

Please note that the window will wait to process new messages until the end of each cycle of the loop, despite being on a separate thread. This keeps the window in sync with the main thread to prevent things such as input lag.

Re-exports§

Modules§

Macros§