Crates.io | minpixwin |
lib.rs | minpixwin |
version | 0.1.2 |
source | src |
created_at | 2021-09-12 12:27:32.852435 |
updated_at | 2021-09-12 13:00:15.946704 |
description | Create a window to render pixels to with minimal effort |
homepage | |
repository | https://github.com/abjorck/minpixwin |
max_upload_size | |
id | 450068 |
size | 25,297 |
minimize effort to render a pixel array to screen
very tiny wrapping of the neat pixels, winit
crates
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