Hi there,
I am working on some bindings for raylib 6.0. I know there exist already some bindings, but these looked a bit abandoned so I decided to kickstart my own and hopefully get them to a usable state in the near future.
I am using some generative AI (gemini) to generate the bulk. Some functions however have/will need manual intervention.
I have some questions which hopefully if answered will allow me to complete these bindings. Here I go:
1
I am taking the approach of having in one side the plain c bindings (raylib_c.ads) and then the “thick” bindings in (raylib.ads, raylib.adb). I expose some “thick” types that then get converted into the C counterparts in the bindings.
The structures are simple when taking this approach, so that the conversion is fast. For more complex cases I intend to have other approaches as show in my following questions.
Should I consider other strategies?
2
What is the cleanest way to bind a function that takes a pointer (and usually a count) to several elements corresponding to a C type? This is because it would be rather nicer to have the binding take an Ada array of Ada types (note that the type inside the array is not of the C type) and then pass it somehow to the C function.
e.g. in the following, have Check_Collision_Point_Poly take an array of Vector2 for Points
-- be advised that this may not compile
function Check_Collision_Point_Poly (Point : Vector2; Points : System.Address; Point_Count : Integer) return Boolean is
begin
return To_Ada (Raylib_C.CheckCollisionPointPoly (To_C (Point), Points, To_C (Point_Count)));
end Check_Collision_Point_Poly;
3
How can I make the build system configurable for different platforms (basically linux, openbsd and other UNIX-like OSes for the time being) and adding options such as an additional linking location or the location of libraylib.a for example.
I share here the project which has the Unlicense license. If someome wants to collaborate on finishing this, he/she is happily welcome. I am also new to Ada, so more senior advice is really appreciated.
Cheers
–zen