-
Notifications
You must be signed in to change notification settings - Fork 121
SDL support #71
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
SDL support #71
Conversation
- Add "Gamepad passthrough" option to disable Pojav controller emulation and allow games to process controllers directly. - Add SDL3 AAR and add it as a dependency. - Add SDL lifecycle events in main activity - Add support for SDL in the main activity and include it as a dependency in the `Android.mk`. - Update `libjnidispatch.so` files for all arch.
|
This compiled locally wtf |
c2e4753 to
a9f3639
Compare
This depends on the specific version of SDL shipped here, the changes to SDL required to make this work has been reverted due to being a breaking change. See here for more info: libsdl-org/SDL#11891 fix(workflow): Use Java 21 for the entire build remove overkill checks add checks for instantiation and static method calls feat(SDL): Update strings fix(SDL): Include libSDL3.so This was put in the ANGLE module by the original commit which now doesn't exist so it had to be readded.
For some reason it was no longer in full screen when starting the game, this fixes that
Oculus controllers makes a motion event that doesn't have a device attached to it. Weird but ok.
Uses personal repo for testing
This reverts commit 60f0578.
4967b4d to
2eee393
Compare
This isn't required but it seems like a good idea
Legacy4J has code that traps us inside GLFW only, soo this is a hacky workaround. It works but I'd prefer we don't have it at all.
Changes
|
|
Testing https://github.com/AngelAuraMC/Amethyst-Android/actions/runs/17873979455 Minecraft 1.21.8 fabric loader 0.17.2 Vanilla game: Controllify 2.4.1: I think it's good ngl, this gets the Mommy Stella Seal of Approval™️ |
It can still be selected in Legacy4J but the inputs won't work because of me adding an if statement to not forward inputs into GLFW when SDL joystick subsystem is running. |
No longer rely on the pref for SDL enabling, this lets SDL act the same as GLFW, using the emulated gamepad if SDL isn't inited
This is jank but their implementation of how to default to the system library demands it.
This is not stable yes, but we need to and since they are willing to support it we aren't forking
I didn't do this in native because I thought the JNI overhead would've been worse than doing it in Java
This forces SDL on when an old Legacy4J version, without the android fixes, is identified using log output
Bugfixes
|
|
Also just for documentation purposes, the Gamepad remapping system wasn't used because I don't wanna do the job that SDL already does, that is filter all that stuff through to an actual input again.
If someone somehow has a weirdshit controller they wanna use that isn't registering because of this, they can feel free to make a bug report and I'll try to fix it. |
I don't know why android decided it was a good idea to turn unconsumed MotionEvents into KeyEvents but now it's fixed for SDL too.
824521f to
bf000d6
Compare
Now continously polls the directory where controllable is expected to extract natives instead of waiting on inotify. This theoretically should consume quite a bit of the CPU but it seems to not when testing. This should be much more consistent than waiting on inotify, testing seems to corroborate that. Anyone who's crashing can send a bug report.
Bugfixes
|


A clone of PojavLauncherTeam#6462, but AmethystNot so much anymore
This PR basically takes only the minimum out of what's needed to get controller pass-through working properly, anything else wasn't given thought.
Thanks isXander for most of the reference material used for this PR