tekenen

Crates.iotekenen
lib.rstekenen
version0.0.5
sourcesrc
created_at2023-07-22 16:24:40.629525
updated_at2023-08-06 20:22:19.033237
descriptionSimple library for drawing pixels in memory.
homepage
repositoryhttps://github.com/Fritz179/tekenen
max_upload_size
id923326
size105,795
Fritz_179 (Fritz179)

documentation

https://docs.rs/tekenen

README

Tekenen

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.

Basic Example

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)
}
Commit count: 22

cargo fmt