Caper
Small game framework using rust. Currently has systems for:
Example of a basis for a game:
extern crate caper;
use ;
use Game;
use gen_cube;
use Ui;
use Key;
Check out the examples and run with:
cargo run --example transforms
Small game framework using rust. Currently has systems for:
Example of a basis for a game:
extern crate caper;
use caper::types::{ RenderItemBuilder, TransformBuilder };
use caper::game::Game;
use caper::mesh::gen_cube;
use caper::imgui::Ui;
use caper::input::Key;
fn main() {
// crate an instance of the game struct
let mut game = Game::new();
// define some items to be rendered
game.add_render_item(
RenderItemBuilder::default()
.vertices(gen_cube())
.instance_transforms(vec![
TransformBuilder::default()
.pos((-0.5, 0.0, -5.0))
.build()
.unwrap()
])
.build()
.unwrap());
loop {
// run the engine update
game.update(|_:&Ui|{ });
// update the first person inputs
game.input.handle_fp_inputs(&mut game.cam_state);
// quit
if game.input.keys_down.contains(&Key::Escape) { break; }
}
}
Check out the examples and run with:
cargo run --example transforms