minpixwin

Crates.iominpixwin
lib.rsminpixwin
version0.1.2
sourcesrc
created_at2021-09-12 12:27:32.852435
updated_at2021-09-12 13:00:15.946704
descriptionCreate a window to render pixels to with minimal effort
homepage
repositoryhttps://github.com/abjorck/minpixwin
max_upload_size
id450068
size25,297
A Björck (abjorck)

documentation

README

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

Commit count: 5

cargo fmt