#webgl #wasi #opengl

wasm-bus-webgl

WebAssembly WebGL 接口

4 个稳定版本

1.0.3 2022 年 3 月 26 日

#871 in 图形 API

MIT/Apache

125KB
3K SLoC

WASM WebGL

tokera.sh 上使用 WebGL 的 WASM Bus

示例

use wasm_bus_webgl::prelude::*;

fn main() -> Result<(), WebGlError> {
    let context = WebGl::new()?;

    context.clear_color(0.0, 0.0, 0.4, 1.0);
    context.clear(BufferBit::Color);

    std::thread::sleep(std::time::Duration::from_secs(4));

    Ok(())
}

测试

您可以通过将程序上传到 wapm.io 并转到 Tokera Shell 来测试您的 WASI 程序。

https://tokera.sh

依赖项

~3.5–5.5MB
~96K SLoC