-
Notifications
You must be signed in to change notification settings - Fork 473
Add sensor API implementation #1131
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
Conversation
How can I try this crate with the master version of SDL2 ? There has been significant changes since 2.0.14. |
I doubt it's breaking changes, SDL2 is heavily against breaking anything, only adding new calls. There is no way to build and link to master directly via this crate, but you could try to compile SDL2 yourself, and link it the old way with rustflags. That, or you can use "bundled" and change build.rs to point to the master source code tarball instead of the 2.0.14 one temporarily. |
By "significant changes", I mean "gyro and accel work on switch controllers instead of not working" ^^ |
TODO: add sensor events. |
Ready to merge. |
The CI error is because SDL 2.0.10 is installed, which doesn't support the new features. What could be done? Conditional compilation? |
Update CI to 2.0.14 somehow? |
github uses Ubuntu 2020 focal which uses sdl 2.0.10. https://launchpad.net/ubuntu/+source/libsdl2. The new calls are on 2.0.14. |
Skip this example for pkg-config? Those functions probably won't be linked if they aren't used by any rust code (probably) |
Just disabled sensors.rs for build-linux, we'll see if it works. |
Oops, missing |
updated |
I think I need to add sensors as an optional feature. We can't ship a version that doesn't compile on the latest ubuntu. |
Ended up adding a default hidapi feature, should work this time. After that I'll cleanup the commits a bit. |
Fixes #1123 .
Still draft for now. Edit: ready to merge
Documentation and examples are very minimal for this feature. Best use I could find is at https://github.com/Electronicks/JoyShockMapper/blob/master/JoyShockMapper/src/SDL2Wrapper.cpp.
Missing: