Crates.io | kaffee |
lib.rs | kaffee |
version | 0.3.0-rc.1 |
source | src |
created_at | 2022-08-14 19:47:53.047928 |
updated_at | 2023-07-06 15:49:00.899268 |
description | Small 2D framework |
homepage | |
repository | https://github.com/chickenbreeder/kaffee |
max_upload_size | |
id | 645547 |
size | 89,128 |
This is an attempt at designing a simple 2D graphics API on top of wgpu, inspired by macroquad. You should probably not use this (yet).
use kaffee::prelude::*;
struct GameState;
impl EventHandler for GameState {
fn init(&mut self, _: &mut GfxContext) {}
fn input(&mut self) {}
fn update(&mut self, _: f32) {}
fn redraw(&mut self, g: &mut GfxContext) {
g.clear_color(Color::BLACK);
g.draw_quad(-0.5, -0.5, 1., Color::RED);
}
}
fn main() {
pollster::block_on(App::new(GameState {})).run();
}
Apache License, Version 2.0