| Crates.io | minifb_wrapper |
| lib.rs | minifb_wrapper |
| version | 0.1.3 |
| created_at | 2023-04-24 12:31:06.146707+00 |
| updated_at | 2023-04-30 17:28:40.871212+00 |
| description | A wrapper around minifb to make managing windows easier than ever |
| homepage | |
| repository | https://github.com/JamieH01/winwrap |
| max_upload_size | |
| id | 847393 |
| size | 14,968 |
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();
}
}