1 unstable release
0.1.2 | Sep 12, 2021 |
---|---|
0.1.1 |
|
0.1.0 |
|
#10 in #pixels
21 downloads per month
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
~278K SLoC