No description
Find a file
2023-10-17 09:45:04 -07:00
src Requerying the inner window for the new size 2023-10-17 09:45:04 -07:00
.gitignore Committing Cargo.lock 2023-08-31 10:08:37 -07:00
Cargo.lock winit 0.29 2023-09-02 15:31:43 +02:00
Cargo.toml winit 0.29 2023-09-02 15:31:43 +02:00
README.md Initial commit. 2023-06-27 09:21:38 -07:00

appit

An opinionated wrapper for winit that provides a trait-based approach to implementing multi-window applications.

This crate's main type is WindowBehavior, a trait that provides functions for nearly every winit::event::WindowEvent. This allows you to implement exactly which events you wish to respond to, and ignore the rest without a large match statement.

This crate also keeps track of the redraw state of the window, and allows scheduling redraws in the future.

use appit::WindowBehavior;

struct MyWindow;

impl WindowBehavior for MyWindow {
    type Context = ();

    fn initialize(_window: &mut appit::RunningWindow, _context: Self::Context) -> Self {
        Self
    }

    fn redraw(&mut self, window: &mut appit::RunningWindow) {
        println!("Should redraw");
    }
}

fn main() {
    MyWindow::run()
}

Why not use this crate?

  • Very new, largely untested.
  • Not all platforms support threads, and a single-window, single-thread code path is not supported yet.