This guide describes the process of updating the bundled raylib version and regenerating the Nim wrappers.
-
Edit
update_bindings.nims:- Update the
RayLatestCommitconstant to the desired raylib commit hash
- Update the
-
Run the update task:
nim update update_bindings.nims
This fetches the specified raylib version in
raylib/(a git repository tracking raysan5/raylib) and copies the sources tosrc/raylib/ -
Build the parser, mangler and wrapper tools:
nim buildTools update_bindings.nims
Some C symbols in raylib conflict with each other. To fix these clashes:
-
Run the mangling script
nim mangle update_bindings.nims
This modifies the raylib C source files in
src/raylib/(the bundled sources), renaming symbols that would otherwise cause collisions. -
Manually adjust
rlglheader The API generator cannot correctly process#if definedconditional sections inrlgl.h. You must preprocess the file inraylib/src/manually:(cd raylib && echo "" >> src/rlgl.h && { unifdef -UGRAPHICS_API_OPENGL_ES2 -DGRAPHICS_API_OPENGL_33 src/rlgl.h > src/rlgl.h.tmp || [ $? -le 1 ]; } && mv -f src/rlgl.h.tmp src/rlgl.h)
- Generate new JSON definitions:
This creates updated JSON files in
nim genApi update_bindings.nims
tools/wrapper/api/for raylib, rcamera, raymath, and rlgl.
- CRITICAL STEP: Before generating wrappers, read
manual/review_guide.mdand follow its steps carefully! - Generate updated Nim wrappers:
This creates updated
nim genWrappers update_bindings.nims
.nimfiles insrc/based on the new JSON definitions and configuration files.
Generate updated HTML documentation:
nim docs update_bindings.nims-
Run tests to ensure functionality isn't broken:
nimble test -
Check for any compiler warnings or errors