#screen #pixel #window #graphics #simple

minpixwin

Create a window to render pixels to with minimal effort

1 unstable release

0.1.2 Sep 12, 2021
0.1.1 Sep 12, 2021
0.1.0 Sep 12, 2021

#15 in #pixels

Download history 3/week @ 2024-02-16 14/week @ 2024-02-23 6/week @ 2024-03-01 44/week @ 2024-03-29 14/week @ 2024-04-05

58 downloads per month

MPL-2.0 license

9KB
60 lines

minpixwin

minimize effort to render a pixel array to screen

very tiny wrapping of the neat pixels, winit crates

example use

add resolver = "2" to your Cargo.toml

draw a red rectangle

use minpixwin::Screen;

Screen::new(100, 100, move |buf| {
    for (index, pixel) in buf.chunks_exact_mut(4).enumerate() {
        let p = [255u8, 0u8, 0u8, 255u8];
        pixel.copy_from_slice(&p);
    };
});

TODO: this may not work on your platform, and assumes the default texture format winit creates is 32bit rgba, etc. ymmv

Dependencies

~6–19MB
~283K SLoC