Skip to content
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

Prepare SDL2ControllerBindings class for SDL3 #6232

Merged

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Apr 3, 2024

In SDL3, controller bindings are handled differently so the existing Get{Axis,Button}ForIndex() can't be implemented (eg. a joystick button can map to a gamepad axis, but that method expects each axis to be bound to an axis; ditto for button).

Instead, the methods have been changed to IsJoystick{Axis,Button}Bound() which can work in SDL3, and doesn't change semantics for consumers, which were only checking if the axis/button was bound or not.

This PR also includes minor cleanup that just renames things.

In SDL3, controller bindings are handled differently so the existing methods
can only return true/false.
Luckily, both members have the same `[FieldOffset]`
so it's not a behaviour bug.
@smoogipoo smoogipoo merged commit 20d55fa into ppy:master Apr 3, 2024
21 checks passed
@Susko3 Susko3 deleted the prepare-SDL2ControllerBindings-for-SDL3 branch April 3, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants