Crate caper [] [src]

Minimalist game framework. Currently has systems for: - Rendering (glium) - Input (winit via volition) - Physics (nphysics) - Audio (rodio)

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;
use caper::utils::handle_fp_inputs;

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
        handle_fp_inputs(&mut game.input, &mut game.cam);

        // quit
        if game.input.keys_down.contains(&Key::Escape) { break; }
    }
}

Reexports

pub extern crate glium;
pub extern crate imgui;
pub extern crate ncollide;
pub extern crate nphysics3d;
pub extern crate nalgebra;
pub extern crate image;
pub extern crate volition as input;
pub extern crate impose as audio;

Modules

collision

Simple collision detection

game

Module represent another way of creating a game

lighting

Module for the lighting system

mesh

Module for procedurally generated meshes

persist

Module for saving and loading data

posteffect

Rendering post processing effects

renderer

A module for rendering items

shader

Module for dealing with shaders

texture

Module for utility functions for textures

types

All of the caper types

utils

Utility functions and macros

Macros

load_texture

Macro for including and loading a texture