Upgrade raylib bindings from 4.0 to 6.0 - #35
Open
WyoMurf wants to merge 6 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
api_reference/{raylib,raymath}_api.xmlfrom real raylib 6.0 headers and bumpRaylib_jllcompat to 6.0Mesh,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)UpdateCamera/UpdateCamera!for the new requiredmodeargument (SetCameraModeand its global camera state were removed upstream), and reworkGetDroppedFilesonLoadDroppedFiles/UnloadDroppedFiles(ClearDroppedFileswas removed)rcamera.hsource (both versions) thatUpdateCamerais now genuinely a no-op with no window/input backend, unlike <=4.x's unconditional per-call recompute from persisted static stateraygui_api.xml/physac_api.xmlintentionally left untouched — no updated source available for those (separate repos)Verification
sizeof()compiled directly against the real raylib 6.0 C headers (not just "it loads")UpdateCameraProexercised directly to confirm the camera struct still marshals correctly throughccallRaylib_jll6.0.1Test plan
Pkg.instantiate()resolvesRaylib_jll6.0.1using Raylibprecompiles with no errorsPkg.test()passes (7/7)sizeof()for all new/changed structsSetCameraModeremoval) and example updates, since this is a user-visible breaking change🤖 Generated with Claude Code