| .forgejo/workflows | ||
| .zed | ||
| demo | ||
| godot-cpp@1cce4d15ab | ||
| src | ||
| voro@2cb6cefc69 | ||
| .clang-format | ||
| .gitignore | ||
| .gitmodules | ||
| CREDITS.md | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| Sconstruct | ||
GD Voro
Godot extension to use voro++
It does not aim to be a 1-on-1 binding to voro++ yet, just experimenting with building a GDExtension for WebAssembly and do something that looks cool with it. There might be some evolution later.
Build
Dependencies
You will need:
- SCons
- A C++ compiler (Zig is supported, more below)
- Emscripten
All that should be properly setup for SCons to be able to find it.
Alternatively, if you're using Nix (Linux & Mac), and if you have enabled Nix flakes, you can open a shell with the needed dependencies with:
nix develop
Build the extension
Use scons to build the extension. It will automatically copy the resulting library into the demo/bin folder and you can test the result by opening the demo project with Godot. You can also specify a target and a platform. For example:
scons platform=web target=template_release
Build with Zig
The Sconstruct file in this repository (badly) hacks in support for Zig build. There are still issues with the wasm32 backend which fails to build so this one should use the classic compiler (emscripten). Otherwise it is possible to cross-compile the extension for Windows (tested), Linux (tested), and MacOS (untested yet). For this, just use the --use-zig argument when building. Depending on the platform you're building for the script might tell you that you need to enable other parameters:
# For Linux
scons platform=linux target=release use_llvm=true --use_zig
# For Windows
scons platform=windows target=release use_clang_cl=true use_mingw=true --use_zig
If you're using Nix, you will need to bring the shell with Zig with the following:
nix develop #zig
Develop
clangd
To have clangd recognise the libraries and provide you with proper auto-complete and static analysis, you need to generate the compile_commands.json file.
This can be done with the following:
scons compiledb=true