Skip to content

Upgrade raylib bindings from 4.0 to 6.0 - #35

Open
WyoMurf wants to merge 6 commits into
chengchingwen:mainfrom
WyoMurf:main
Open

Upgrade raylib bindings from 4.0 to 6.0#35
WyoMurf wants to merge 6 commits into
chengchingwen:mainfrom
WyoMurf:main

Conversation

@WyoMurf

@WyoMurf WyoMurf commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • Regenerate api_reference/{raylib,raymath}_api.xml from real raylib 6.0 headers and bump Raylib_jll compat to 6.0
  • Fix hand-written ABI structs whose C layout changed between 4.0 and 6.0 (Mesh, Model, ModelAnimation, AudioStream, VrDeviceInfo), and add the new ones (ModelSkeleton, FilePathList, AutomationEvent, AutomationEventList, ModelAnimPose), registering them in the generator's typemap so functions referencing them actually bind (verified: 8 automation-event functions that would otherwise silently fail to generate now exist)
  • Update UpdateCamera/UpdateCamera! for the new required mode argument (SetCameraMode and its global camera state were removed upstream), and rework GetDroppedFiles on LoadDroppedFiles/UnloadDroppedFiles (ClearDroppedFiles was removed)
  • Update examples and tests for the same API changes; one test assertion was flipped after confirming via raylib's own rcamera.h source (both versions) that UpdateCamera is now genuinely a no-op with no window/input backend, unlike <=4.x's unconditional per-call recompute from persisted static state
  • raygui_api.xml/physac_api.xml intentionally left untouched — no updated source available for those (separate repos)

Verification

  • All changed/added struct sizes cross-checked against sizeof() compiled directly against the real raylib 6.0 C headers (not just "it loads")
  • UpdateCameraPro exercised directly to confirm the camera struct still marshals correctly through ccall
  • Package precompiles cleanly and the full test suite passes against Raylib_jll 6.0.1
  • Full function/struct/enum diff done between the old and newly-generated XML before making any changes, to scope exactly what needed hand-fixing vs. what the auto-generator already handles

Test plan

  • Pkg.instantiate() resolves Raylib_jll 6.0.1
  • using Raylib precompiles with no errors
  • Pkg.test() passes (7/7)
  • Struct ABI sizes match real C sizeof() for all new/changed structs
  • Maintainer review of the camera API migration (SetCameraMode removal) and example updates, since this is a user-visible breaking change

🤖 Generated with Claude Code

Steve Murphy and others added 6 commits August 19, 2026 10:36
Regenerate api_reference/{raylib,raymath}_api.xml from real raylib 6.0
headers and bump Raylib_jll compat to 6.0. Fix the hand-written ABI
structs that changed layout (Mesh, Model, ModelAnimation, AudioStream,
VrDeviceInfo) and add the new ones (ModelSkeleton, FilePathList,
AutomationEvent, AutomationEventList, ModelAnimPose), registering them
in the generator's typemap so functions referencing them actually bind.

Update UpdateCamera/UpdateCamera! for the new explicit mode argument
(SetCameraMode and its global state were removed upstream) and rework
GetDroppedFiles on LoadDroppedFiles/UnloadDroppedFiles (ClearDroppedFiles
removed). Update examples and tests for the same API changes; one test
assertion was flipped after confirming via raylib's own rcamera.h source
that UpdateCamera is now genuinely a no-op with no window/input backend,
unlike <=4.x's unconditional per-call recompute.

All struct ABI sizes verified against sizeof() on the real C headers;
package precompiles and the full test suite passes against Raylib_jll
6.0.1. raygui_api.xml/physac_api.xml left untouched (no updated source
available).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
LoadFileData's out-param changed from unsigned int* to int*; RayFileData
was still passing a Ref{Cuint}. LoadFontData gained a new trailing
int* glyphCount out-param; the font_sdf example was still calling it
with the old 6-arg form. Both found while auditing the remaining
changed-signature functions from the 4.0->6.0 diff for real usages.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Confirmed via `nm -D` on the actual Raylib_jll 6.0.1 libraylib.so that
zero physac symbols exist in the compiled library (unlike raygui, whose
functions are all still present and resolve). Every physac-bound
function was therefore binding successfully at load time but would
throw at the first real call, since dlsym has nothing to find -
dead weight, not just stale bindings.

Removes physac_api.xml, the PhysicsShapeType enum, and the
RayPhysics{VertexData,Shape,BodyData,ManifoldData} structs and their
typemap_dict entries. Nothing else in the repo referenced any of this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
raylib.com publishes an official, current architecture diagram at the
same path pattern for 6.0 (confirmed genuinely different from the 4.0
image, not a fallback) - use that instead of the stale 4.0 one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
raylib 6.0 has ~600 functions (up from ~487 in 4.0), pushing the
@autodocs-generated bindings.md page to ~780KiB - past Documenter
1.17's default 200KiB hard size_threshold, which fails the build
outright (not just a warning). Verified: docs build failed before
this change and succeeds after, confirmed against real Documenter
1.17.0 and Julia 1.12.

Also confirmed while investigating: the package still resolves and
its full test suite still passes on Julia 1.6 (Project.toml's declared
compat floor), tested directly rather than assumed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Generates api_reference/rlgl_api.xml (163 functions, 11 enums) from
raylib 6.0's rlgl.h via the same rlparser tool used for raylib_api.xml/
raymath_api.xml, and wires it into binding.jl's parser. Hand-writes
RayrlVertexBuffer/RayrlDrawCall/RayrlRenderBatch (matching the existing
pattern for ABI-sensitive structs) so the 3 render-batch-management
functions bind too - every other rlgl type was already covered by the
existing typemap_dict (Matrix, bool, plain numerics, pointers).

Primary motivation: exposes rlSetClipPlanes, previously unreachable
from Julia on any raylib version since this generator never parsed
rlgl.h at all.

Found and fixed a real latent bug in binding.jl's own custom
mini-XML-parser along the way: it treated every '<'/'>' character as
tag-structural even inside quoted attribute text. This never mattered
for raylib.h/raygui.h/raymath.h (none of their descriptions happen to
contain a literal '<'/'>'), but rlgl.h's comments do (e.g.
"Update->Draw->Reset"), which corrupted the parser's tag-boundary
stack and crashed the whole package load. Fixed by tracking
quoted-string state explicitly and gating the '<'/'>' handling on it.

Verified: all 163 functions + 11 enums bind (174 rl-prefixed symbols,
exact match, no silent gaps); existing test suite still passes 7/7
(parser fix doesn't affect the other 3 XML files); rlSetClipPlanes
called successfully inside a real BeginMode3D block in an actual
GPU-accelerated window, not just isdefined-checked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant