infuse

Crates.ioinfuse
lib.rsinfuse
version0.6.0
sourcesrc
created_at2019-06-28 07:07:50.43379
updated_at2022-02-04 18:51:08.864402
descriptionMinimalist wasm based webgl renderer
homepagehttps://github.com/shockham/infuse
repositoryhttps://github.com/shockham/infuse
max_upload_size
id144245
size13,029
shockham (shockham)

documentation

https://docs.rs/infuse

README

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

Commit count: 33

cargo fmt