Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
459 stars 101 forks source link

Update raylib to the latest version #101

Closed oneearedrabbit closed 1 month ago

oneearedrabbit commented 1 month ago

This includes a fix from https://github.com/raysan5/raylib/pull/4012/ which resolves the emsdk "headers must be a relative path" error when building wasm32-emscripten target.

Before:

$ zig build -Dtarget=wasm32-emscripten --sysroot /.../emsdk/upstream/emscripten
thread 10031917 panic: sub_path is expected to be relative to the build root, but was this absolute path: '/.../emsdk/upstream/emscripten/cache/sysroot/include'. It is best avoid absolute paths, but if you must, it is supported by LazyPath.cwd_relative
...

After:

$ zig build 2d_camera -Dtarget=wasm32-emscripten --sysroot /.../emsdk/upstream/emscripten
steps [7/9] run /.../emsdk/upstream/emscripten/emcc... Now listening at http://0.0.0.0:6931/
INFO: Initializing raylib 5.1-dev
...
oneearedrabbit commented 1 month ago

Ah, thanks for updating the API! Just for my own education: do I need to update files manually next time, or is there a script that I can run?

Not-Nik commented 1 month ago

The header files need to be updated manually, but the zig files are update with the generate_functions.py script