Crates.io | tekenen |
lib.rs | tekenen |
version | 0.0.5 |
source | src |
created_at | 2023-07-22 16:24:40.629525 |
updated_at | 2023-08-06 20:22:19.033237 |
description | Simple library for drawing pixels in memory. |
homepage | |
repository | https://github.com/Fritz179/tekenen |
max_upload_size | |
id | 923326 |
size | 105,795 |
Simple library for drawing pixels in memory.
IMPORTANT: This library is work in progress, everything is subject to change, use this library at your own risk.
use tekenen::{Tekenen, colors};
use tekenen::platform::{Platform, PlatformTrait, Event, IntervalDecision};
fn main() {
let mut window = Platform::new(800, 600).unwrap();
let mut tek = Tekenen::new(800, 600);
Platform::set_interval(move || {
while let Some(event) = window.read_events() {
match event {
Event::Quit => {
return IntervalDecision::Stop
},
_ => { }
}
}
tek.background(colors::GRAY);
window.display_pixels(tek.get_pixels());
IntervalDecision::Repeat
}, 60)
}