crow 0.1.0

A pixel perfect 2D rendering engine
Documentation

Crow

A simple and fairly efficient pixel based 2D graphics library. crow is designed to be easy to use and should allow users to do nearly everything they want without requiring custom renderers or unsafe code.

Examples

use crow::{
    glutin::{Event, EventsLoop, WindowBuilder, WindowEvent},
    Context, DrawConfig, Texture,
};

fn main() {
    let mut ctx = Context::new(WindowBuilder::new(), EventsLoop::new()).unwrap();

    let texture = Texture::load(&mut ctx, "path/to/texture.png").expect("Unable to load texture");
    let mut surface = ctx.window_surface();

    let mut fin = false;
    loop {
        ctx.events_loop().poll_events(|event| match event {
            Event::WindowEvent {
                event: WindowEvent::CloseRequested,
                ..
            } => fin = true,
            _ => (),
        });

        ctx.clear_color(&mut surface, (0.4, 0.4, 0.8, 1.0)).unwrap();
        ctx.draw(&mut surface, &texture, (100, 150), &DrawConfig::default())
            .unwrap();

        ctx.finalize_frame().unwrap();

        if fin {
            break;
        }
    }
}

Features

  • basic pixel perfect rendering
  • image scaling
  • depth
  • color modulation
    • gray scale
    • invert colors
  • implement screenshots + getting texture data
  • flip textures
  • subtextures (spritesheets)
  • flip textures diagonally
  • different drawing modes
  • change draw to accept a generic target (allows for easy cameras/scaling etc etc)
  • actual error handling
  • custom renderer support