#terminal-graphics #rendering-engine #terminal #graphics #multi-platform #web-gpu #desktop

sugarloaf

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

23 releases

0.0.36 Mar 14, 2024
0.0.34 Jan 7, 2024
0.0.33 Dec 18, 2023
0.0.28 Nov 29, 2023
0.0.12 Jul 21, 2023

#9 in Rendering engine

Download history 37/week @ 2024-01-06 2/week @ 2024-01-13 22/week @ 2024-02-17 223/week @ 2024-02-24 33/week @ 2024-03-02 153/week @ 2024-03-09 41/week @ 2024-03-16 278/week @ 2024-03-23 34/week @ 2024-03-30 8/week @ 2024-04-06 3/week @ 2024-04-13

325 downloads per month
Used in 3 crates (2 directly)

MIT license

8MB
10K SLoC

Sugarloaf

Sugarloaf is Rio rendering engine, desgined to be multiplatform. It is based on WebGPU, Rust library for Desktops and WebAssembly for Web (JavaScript). This project is created and maintaned 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.

Dependencies

~15–50MB
~651K SLoC