-
Notifications
You must be signed in to change notification settings - Fork 4
added minimal example for raylib #35
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
added minimal example for raylib #35
Conversation
Just a few more requested changes, mostly if the linking of Otherwise this looks fantastic. Thanks for putting this together :) |
EGL should be linked at the library level now, and only for the appropriate targets. Also some conditional compilation as suggested.
Should be good to go now (famous last words). I did take the time to boot up my Windows machine this time and managed to build successfully on it as well. Let me know if you have any more suggestions. Potential concerns that I can think of:
const c_impl = @cImport({
@cInclude("android_native_app_glue.h");
});
pub extern "c" fn GetAndroidApp() *c_impl.android_app;
pub fn GetInternalDataPath() [:0]const u8 {
return std.mem.sliceTo((GetAndroidApp()).*.activity.*.internalDataPath, 0);
}
pub fn GetDocumentsPath() [:0]const u8 {
return std.mem.sliceTo((GetAndroidApp()).*.activity.*.externalDataPath, 0);
} |
examples/raylib/src/main.zig
Outdated
//The main function is not allowed to return zig errors, so you will have to | ||
//use "catch @panic()" or create other error handling functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is no longer true and should probably be removed right?
.url = "git+https://github.com/lumenkeyes/raylib-zig#b00d4c2b973665e3a88c2565b6cd63c56d0173c2", | ||
.hash = "raylib_zig-5.6.0-dev-KE8REPwqBQC35iWa2sFblBUNWkTlEi1gjit9dtyOLu_b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to do a PR here to upstream your Android build support?
https://github.com/Not-Nik/raylib-zig
It'd be ideal if we point at the main maintainer of the library but we can do that in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only real difference is which version of upstream raylib we're depending on in our zon file. I can definitely submit a PR, but I also figure they'll have to update their dependencies eventually. I can try to get that moving, though, as I agree it would be preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have submitted the PR, but I haven't heard anything back yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to merge as-is if you'd like. If/when your PR is merged, we can upstream it if that works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
Fixes an issue where zig was unable to find the "main" entry point for non-android builds.
awesome, thanks for putting this together. Just raise further PRs if/when your PR is merged :) |
Finally got around to adding the raylib example, lmk what you think.
The
build.zig.zon
raylib-zig dep points to my own fork just because it's easier for me to keep that one up-to-date with changes in upstream raylib.Fixes #31