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§
pub use window::data::CursorMode;
pub use window::data::Flow;
pub use window::data::Fullscreen;
pub use window::data::LogicalPosition;
pub use window::data::LogicalSize;
pub use window::data::PhysicalPosition;
pub use window::data::PhysicalSize;
pub use window::data::Position;
pub use window::data::Size;
pub use window::data::Theme;
pub use window::data::Visibility;
pub use window::input::key::Key;
pub use window::input::mouse::MouseButton;
pub use window::input::state::ButtonState;
pub use window::input::state::KeyState;
pub use window::input::state::RawKeyState;
pub use window::input::Input;
pub use window::message::LoopMessage;
pub use window::message::Message;
pub use window::message::RawInputMessage;
pub use window::settings::WindowBuilder;
pub use window::settings::WindowSettings;
pub use window::Window;
pub use rwh_06 as raw_window_handle;