26 stable releases

3.3.2 Mar 6, 2024
3.3.1 Mar 5, 2024
2.15.1 Mar 10, 2024
2.8.1 Feb 25, 2024
1.0.1 Feb 23, 2024

#271 in Rendering

Download history 424/week @ 2024-02-18 451/week @ 2024-02-25 1642/week @ 2024-03-03 636/week @ 2024-03-10 20/week @ 2024-03-17 151/week @ 2024-03-31

258 downloads per month

MIT/Apache

79KB
2.5K SLoC

ezwin: A Minimal native Win32 window library

NOTICE: Further development will be done as the witer crate

Crates.io Version Discord

use ezwin::prelude::*;

fn main() {
  // Configure
  let settings = WindowSettings::default();

  // Build
  let window = Window::new(settings).unwrap();

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

Goals

The main goal of ezwin is to have a simple, easy-to-use API. The target audience is developers looking to create a window quickly, easily, and idiomatically. I aim to have feature-parity with winit eventually as a secondary goal.

Cross-platform support is highly unlikely, but pull requests are welcomed if anyone else wants to tackle it.

I would like to eventually transition from using windows to windows-sys to benefit from better compile times, as the wrappers included in the former are redundant for this crate.

Documentation

Documentation is a work-in-progress as the crate evolves. Don't expect much here yet, so if you have any questions, either:

  • Make a post in the Discussions tab on GitHub
  • Send a message over Discord
  • Dive into the codebase yourself

Cargo Features

  • rwh_05 / rwh_06: use the appropriate version of raw-window-handle. rwh_06 is the default.

Examples

You can find examples in the examples folder. You can also see the vulkano branch of foxy-rs/foxy, which as of the time of writing is utilizing ezwin, but is subject to change.

Contact Me

You can get in contact through the discord linked at the top, or post in the Discussions tab on GitHub.

FAQ

Q: Why not winit?

A: While winit is the best choice for pretty much everyone, I found that multithreading the windows message pump could lead to performance gains (unsubstantiated). Additionally, I was simply not satisfied with the way the winit API looks and feels. If you are perfectly satisfied with what winit offers, then I recommend you stick with it.

Q: What happened to the 3.0 version?

A: As this project is in flux, there was a temporary 3.0 version that was implemented which strayed from my vision of the crate. I regret publishing that version, and have since yanked each of them off of crates.io. In the future, I intend to be far more deliberate and considerate over what gets published rather than willy-nilly publishing the next big features.

⚠️ Warning ⚠️

This project is still hilariously incomplete. I am only one student, after all.

ko-fi

Dependencies

~141MB
~2.5M SLoC