Crates.io | cafe_core |
lib.rs | cafe_core |
version | 0.1.2 |
source | src |
created_at | 2023-09-03 14:46:09.723725 |
updated_at | 2023-09-05 04:09:58.838009 |
description | Game frameworks made on top of SDL2 and OpenGL |
homepage | |
repository | https://codeberg.org/cafe/cafe |
max_upload_size | |
id | 962280 |
size | 1,980,785 |
Cafe is game engine/framework, build on top of independent modules:
The other modules i don't started even in C, so i'll start from scratch in Rust:
Example code:
extern crate cafe;
use cafe::{Game, CafeBuilder, Render};
use cafe::render::render2D::Render2D;
pub struct MyGame {}
impl Game for MyGame {
type Render = Render2D;
fn new() -> Self {
MyGame {}
}
fn setup(&mut self, _settings: &mut GameSettings) {}
fn run(&mut self, _dt: f32, render: &mut Self::Render) -> bool {
render.begin();
render.clear();
render.end();
true
}
}
fn main() {
let cafe = CafeBuilder::new("Hello Game", 640, 380)
.resizable(true)
.build::<MyGame>()
.unwrap();
cafe.run();
}