This is a Go port of the C layout library (Clay).
- Be entirely Go (no Cgo)
- Idiomatic Go public API
- No unsafe in the public API
- Be fast
Clay includes multiple prebuilt renderers:
- Ebitengine - hajimehoshi/ebiten
- Raylib - gen2brain/raylib-go
- SDL2 - veandco/go-sdl2
- SDL3 - Zyko0/go-sdl3
- Software - golang.org/x/image
Clay's C source (clay.h) is compiled to WebAssembly with clang and translated to Go with
wasm2go. The Go types and bindings in clay.go are
generated from clang's AST of clay.h. To update clay, replace clay.h and run:
go generateThis requires a clang that can target WebAssembly, like wasi-sdk.
It is looked up in tools/wasi-sdk, $WASI_SDK_PATH, or PATH; set CLANG to override.
This project is governed by the zlib/libpng license, the same license as clay, which it contains and generates code from. See LICENSE for full description.