Crate caper [] [src]

Small game framework. Currently has systems for: - Rendering (glium) - Input (glutin) - Physics (nphysics) - Audio (rodio)

Note: This is being used for/was created with specific game in mind so might not be ideal for use with everything.

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; }
    }
}

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;

Modules

audio

Module for the audio system

collision

Simple collision detection

game

Module represent another way of creating a game

input

Module for input handing

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