sugarloaf

Crates.iosugarloaf
lib.rssugarloaf
version0.1.1
sourcesrc
created_at2023-04-21 14:38:27.700936
updated_at2024-06-16 11:20:27.044324
descriptionSugarloaf is Rio rendering engine, designed to be multiplatform. It is based on WebGPU, Rust library for Desktops and WebAssembly for Web (JavaScript). This project is created and maintained for Rio terminal purposes but feel free to use it.
homepage
repositoryhttps://github.com/raphamorim/rio/tree/main/sugarloaf
max_upload_size
id845356
size8,301,967
Raphael Amorim (raphamorim)

documentation

https://docs.rs/crate/sugarloaf/latest

README

Sugarloaf

Sugarloaf is Rio rendering engine, designed to be multiplatform. It is based on WebGPU, Rust library for Desktops and WebAssembly for Web (JavaScript). This project is created and maintained for Rio terminal purposes but feel free to use it.

Desktop rect

cargo run --example rect

Desktop text

cargo run --example text

Examples

Demo sugarloaf 1 Demo Sugarloaf wasm
Demo Rect Demo sugarloaf 3
Demo sugarloaf 4 Demo sugarloaf 5
Demo sugarloaf 6

WASM Tests

Setup

Install wasm-bindgen-cli globally: cargo install wasm-bindgen-cli. wasm-bindgen-cli provides a test runner harness.

Running Tests

Run (in the root sugarloaf directory):

CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner cargo test --target wasm32-unknown-unknown -p sugarloaf --tests

Flag explanation:

  • CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner: Tells Cargo to use the test harness provided by wasm-bindgen-cli.
  • -p sugarloaf: Only run tests in the sugarloaf directory.
  • --tests: Only run tests; do not build examples. Many (possibly all) of the examples in sugarloaf/examples currently do not compile to WASM because they use networking.
Commit count: 1964

cargo fmt