#webgl #renderer #minimalist

infuse

Minimalist wasm based webgl renderer

9 releases (5 breaking)

0.6.0 Feb 4, 2022
0.5.0 Jun 29, 2020
0.4.0 Jul 31, 2019
0.3.1 Jul 27, 2019
0.1.1 Jun 30, 2019

#765 in WebAssembly

45 downloads per month

MIT license

11KB
236 lines

infuse

crates.io version Build status Documentation

Minimalist wasm based webgl renderer.

Example usage:

use wasm_bindgen::prelude::*;

mod renderer;
use renderer::{RenderItem, Renderer};

#[wasm_bindgen(start)]
pub fn start() -> Result<(), JsValue> {
    let renderer = Renderer::new()?;

    let render_item = RenderItem::new(
        vec![-0.7, -0.7, 0.0, 0.7, -0.7, 0.0, 0.0, 0.7, 0.0],
        "default".into(),
    );

    let render_items = vec![render_item];

    renderer.draw(render_items)?;

    Ok(())
}

Project creation:

This can be done easily using cargo-generate.

  • Install cargo-generate with:
cargo install cargo-generate
  • Create a new project with:
cargo generate --git https://github.com/shockham/infuse-template.git
  • Install the deps:
yarn install
  • Serve the app:
yarn run serve

License

Dependencies

~8.5MB
~169K SLoC