Crate bottomless_pit

Source
Expand description

§Bottomless-pit

Bottomless-pit is a simple 2D game engine that is still a work in progress. This library is inspired slightly by Raylib and other rust based game engines like GGEZ. All Bottomless-pit does currently is handle keyboard and mouse input while also providing a simple way to draw objects to the screen. The shape and texutre renderer is written in house, but the text rendering is powered by glyphon.

To get started start by implmenting the Game trait on any struct you like

use bottomless_pit::Game;
use bottomless_pit::engine_handle::{Engine, EngineBuilder};
use bottomless_pit::render::RenderInformation;

fn main() {
    let engine = EngineBuilder::new()
        .build()
        .expect("Failed to create the engine!");
    let game = CoolGame::new(&mut engine);

    engine.run(game);
}

struct CoolGame {
    // put whatever you want here
}

impl CoolGame {
    pub fn new(engine_handle: &mut Engine) {
        // you can even load assets before the game opens
    }
}

impl Game for CoolGame {
    fn render<'o>(&'o mut self, mut render_handle: RenderHandle<'o>) {
        // render what ever you want
    }
    fn update(&mut self, engine_handle: &mut Engine) {
        // this is where all your logic should go
    }
}

Modules§

buffer
The buffer struct indended for things like input buffers
camera
This contains a simple 2D camera that can be used to transform the world.
colour
The colour struct module
engine_handle
Contains both the Engine and the Engine builder Both of these are crucial to using the engine as the builder lets you customize the engine at the start, and the Engine gives you access to all the crucial logic functions
input
Contains Both the MouseKey and Key Enums for input
material
Contains the Material and MaterialBuilder struct which are needed for anything to be rendered
matrix_math
contains several functions that help with doing matrix arithmetic
render
Bottomles Pit supports multipass rendering. This means you can go through multiple render passes within the Game::render function. This can be used to render to a texture then render to the screen. The RenderHandle is used to create render passes and then within the passes the Renderer is used to actually interface with materials and other objects that render.
resource
Contains the code for the loading of all assets and ResourceId
shader
Contains everything you need to make some cool shaders including the Shader and UniformData types.
text
Contains the Text Struct used for text widgets and the TextRender which is needed for rendering Text widgets
texture
Cointains the interface into the texture cache and by extension accsss the texture interface
vectors
Generic implmentation of 2D Vectors

Macros§

vec2

Traits§

Game
The Trait needed for structs to be used in with the Engine