-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate binding and misc #272
Comments
Looks like a nice way to generate bindings. Could probably handle most of the bindings. Would help with maintenance since the library is now passively maintained. Open to updating .net and c# versions but only if we need to for specific features etc. As for |
Upgrading to .NET 8 should be fine for most users since it is LTS and defaults to C# 12. It it also required for the new p/invoke source generator ( As of
If you want I can work on a generator in order to generate all the source files from raylib's definitions. |
Still undecided but examples comparing/showing the pros and cons for both ideas would be useful either way. |
Here's more details of pros and cons of both.
|
if you generate the binding you need a github action to build it for every platform or having a Windows, Linux and Mac pc. |
I was working on generator + new native bindings builder based on raylib zig build that I would want to eventually contribute to raylib-cs after i even out some remaining small issues, but thanks to zig being so easy to work with the natives support linux/osx/windows/wasm already together with support for cross-compilation so huge step up from what raylib-cs has now. And for generator, the biggest issue is how raylib-cs is structured, e.g a lot of extra helper methods are spread out on the raylib structs, so im not sure how to deal with that. Ideally they should be just partial structs and the helper methods elsewhere, but moving all of them is about as big task as the effort it took to write the generator. Anyway for anyone interested here is the code now for both bindings + generator: https://github.com/deathbeam/Raylib.NET And as i said the end goal is to PR it here ideally as im not interested in further fragmentation of CS raylib bindings (even though its mostly fault of the maintainers, raylib-cs included with its project structure, makes bigger contributions like this very hard). EDIT: So got the native generator to good state but the build.zig in 5.0 release is kinda unusable so raylib-cs would first need to get updated to 5.5, rip |
Consider using raylib's definitions from the official repo to auto generate source files.
This will make the latest APIs available in raylib-cs and drastically reduce the manual work of porting raylib's structs, enums and functions - make sure that all the structs are blittable.
Also consider these other changes
LibraryImport
for better AOT compatibility.The text was updated successfully, but these errors were encountered: