puffpuff

Next-generation HashLink & WebGPU backend for OpenFL and HaxeFlixel.
https://github.com/rayzor-blade/PuffPuff

To install, run:

haxelib install puffpuff 0.1.1 

See using Haxelib in Haxelib documentation for more information.

README.md

RayDE

PuffPuff

PuffPuff is a high-performance, lightweight multimedia engine replacement for Lime – targeting the HashLink (ash / hl / hl/c) runtime.

Install

haxelib install puffpuff

Add -lib puffpuff to your build and compile for HashLink. Run the bytecode with HashLink (1.15) or with Ash. HashLink has no JIT virtual machine on ARM processors (Apple silicon, Linux aarch64), so use Ash there. For HashLink, also add -D ash_future_stock to the build, and make the folder with the .hl file visible to the library loader (on Linux, LD_LIBRARY_PATH=. hl app.hl). Haxelib installs the other libraries it needs (hlwgpu, hlwindow, hlavi, ash-future, ash-simd, hashlink). It also bundles blinc_abi, which does text shaping, and the build copies it next to the .hl file.

PuffPuff is tested on macOS (Apple silicon) and Linux (x86_64, Intel graphics). The bundled blinc_abi also covers Linux aarch64, macOS x86_64 and Windows, which are untested.

Use with OpenFL and HaxeFlixel

PuffPuff replaces Lime's backend and renders with WebGPU. OpenFL support is on the wgpu branch of OpenFL, behind the openfl_wgpu define, and HaxeFlixel needs a small matching change. Build both with -D openfl_wgpu.

Build options

OptionEffect
-D puffpuff_no_default_fontDon't bundle the default Arimo fonts.
-D puffpuff_no_hdllDon't warn when blinc_abi.hdll isn't found. You supply it.
-D puffpuff_httpAllow remote URLs in HTTPRequest. This needs HashLink's ssl library at load time.
PUFFPUFF_NATIVE_DIREnvironment variable. A directory with a blinc_abi.hdll to use instead of the bundled one.

Testing without a window

tools/snapshot/run.sh Scene.hx renders a scene offscreen and writes a PNG to .puffpuff/snapshots. Most scenes in tools/snapshot/scenes check pixels, so they double as tests. On Linux this still needs a running display server (Wayland or X).

Benchmarks

How PuffPuff is measured, how it compares with OpenFL's native text path, and how to reproduce it: docs/benchmarks.

Attribution & License

PuffPuff is licensed under the MIT License. The lime.* compatibility layer implements the Lime API surface (Copyright (c) OpenFL Contributors, MIT License) backed by hlwindow (xwindow), hlwgpu (xgpu), hlavi (xavi), ash-future, ash-simd, and blinc_abi.

Contributors
darmie
rayzor
Version
0.1.1
Published
2 weeks ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂