GDExtension for voro++
Find a file
rodolpheh 1fe287dce6
All checks were successful
/ linux (emscripten, Web, web) (push) Successful in 5m13s
/ linux (zig, Linux, use_llvm=true --use_zig, linux) (push) Successful in 25m29s
Use scons cache and enable for Zig build
2024-10-29 13:55:53 +00:00
.forgejo/workflows Use scons cache and enable for Zig build 2024-10-29 13:55:53 +00:00
.zed Add nixfmt to Zed for convenience 2024-10-20 23:20:41 +01:00
demo Make some elements disabled depending on what's happening 2024-10-25 09:14:48 +01:00
godot-cpp@1cce4d15ab Dump all work so far 2024-10-14 22:49:20 +01:00
src Add volume and use it to change mass 2024-10-23 22:25:23 +01:00
voro@2cb6cefc69 Dump all work so far 2024-10-14 22:49:20 +01:00
.clang-format Dump all work so far 2024-10-14 22:49:20 +01:00
.gitignore Use scons cache and enable for Zig build 2024-10-29 13:55:53 +00:00
.gitmodules Add hacked-in Zig build 2024-10-20 12:46:23 +01:00
CREDITS.md Dump all work so far 2024-10-14 22:49:20 +01:00
flake.lock Add hacked-in Zig build 2024-10-20 12:46:23 +01:00
flake.nix Rewrite the flake and use nixfmt on it 2024-10-20 23:08:39 +01:00
README.md Add Zig instructions 2024-10-20 23:20:25 +01:00
Sconstruct Use scons cache and enable for Zig build 2024-10-29 13:55:53 +00:00

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