Repository navigation
Conversation
… and other apple related stuff) retains my stuff: SDL3_main/-Dmain_callbacks; helpers for finding and linking Apple SDK's for iOS; and this thing where sanitize_c is not working on iOS (seems that Zig's UBSan does not understand something Apple-related)
…un always, and also unify SDK logic in one place
Contributor
|
Nice thanks for the PR! I'm going to have access to a mac to test with next week, at which point I'll review all the Apple related PRs. No worries about conflicts with other open PRs I can sort all that out. :) |
Author
|
Great, thank you! Happy to break this into pieces or remove things, whatever seems best. |
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.
Hi all,
This PR does a couple of things to get SDL working on iOS with SDL's callbacks.
-Dmain_callbacks: when passed,src/sdl_main.cincludes SDL'sSDL_main.haddAppleSdkPathsToModulewhich users can call in their builds to link UIKit etc as needed. I'm not sure if this part would be controversial and happy to remove it. It's used in my demo (below) so I could move it there, but I think that any iOS-targeting user would need something similar.I haven't updated the demo in this repo since I didn't want to force it to use callbacks, but I reworked it here:
https://github.com/cwindolf/zig-sdl3-callbacks-example. In that repository, you can
zig build ios-run -Dtarget=aarch64-ios-simulatorand see the rainbow appear on the iPhone of your choice.I wrote this in a vacuum so I apologize if it conflicts with other PRs or handles existing issues in a non-optimal way. I tried to get a handle on those questions, here are some notes:
-Dinclude_pathlogic as a special case, for instance. They also change this repo's demo app to use callbacks, but in a way which wouldn't work on iOS because iOS needs to run viaSDL_RunApp.Thank you for taking a look at this. Let me know if it's useful, and if so if there are any changes you'd suggest! For now, I haven't touched the README or the example. I wanted to check in about the approach first, but I could at least mention -Dmain_callbacks in the README if that's of interest. Not sure what to do about the example, I'm open to any options.