minifb_wrapper

Crates.iominifb_wrapper
lib.rsminifb_wrapper
version0.1.3
sourcesrc
created_at2023-04-24 12:31:06.146707
updated_at2023-04-30 17:28:40.871212
descriptionA wrapper around minifb to make managing windows easier than ever
homepage
repositoryhttps://github.com/JamieH01/winwrap
max_upload_size
id847393
size14,968
Jamie (JamieH01)

documentation

README

A wrapper around minifb that makes opening and managing windows as straightforward as possible, and with hexidecimal RGB rather than raw u32.

This is an example code that will generate a UV coordinate map:

use miniwrap::*;

fn main() -> Result<(), WinErr> {
    let mut window = window!(?255, 255, "Window", "FFFFFF");

    //iterates with the value and position
    for (_, pos) in window.iter() {
        let r = to_hex2(pos.0 as u8).unwrap();
        let g = to_hex2(pos.1 as u8).unwrap();
        let string = format!("{r}{g}00");

        window.set(pos, &string)?;
    }

    //pressing escape will close the window
    loop {
        window.update();
    }    
}

Commit count: 16

cargo fmt