piston2d-gfx_graphics 0.2.0

A Gfx 2D back-end for the Piston game engine
docs.rs failed to build piston2d-gfx_graphics-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: piston2d-gfx_graphics-0.80.0

gfx_graphics Build Status

Maintainers: @Potpourri, @kvark, @bvssvni

The implementation of a piston-graphics back-end using Gfx.

To run example, type cargo run --example imagetest.

This is how it looks like:

let mut g2d = G2D::new(&mut device);
for e in EventIterator::new(&mut window, &event_settings) {
    use piston::event::RenderEvent;
    e.render(|_| {
        g2d.draw(&mut renderer, &frame, |c, g| {
            c.rgb(1.0, 1.0, 1.0).draw(g);
            c.rect(0.0, 0.0, 100.0, 100.0).rgb(1.0, 0.0, 0.0).draw(g);
            c.rect(50.0, 50.0, 100.0, 100.0).rgba(0.0, 1.0, 0.0, 0.3).draw(g);
            c.trans(100.0, 100.0).image(&image).draw(g);
        });

        device.submit(renderer.as_buffer());
        renderer.reset();
   });
}

screenshot

Dependency graph

dependencies

How to contribute