Crates.io | infuse |
lib.rs | infuse |
version | 0.6.0 |
source | src |
created_at | 2019-06-28 07:07:50.43379 |
updated_at | 2022-02-04 18:51:08.864402 |
description | Minimalist wasm based webgl renderer |
homepage | https://github.com/shockham/infuse |
repository | https://github.com/shockham/infuse |
max_upload_size | |
id | 144245 |
size | 13,029 |
Minimalist wasm based webgl renderer.
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(())
}
This can be done easily using cargo-generate.
cargo install cargo-generate
cargo generate --git https://github.com/shockham/infuse-template.git
yarn install
yarn run serve