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

GameController / Joystick method interoperability #758

Open
ticky opened this issue Mar 7, 2018 · 0 comments
Open

GameController / Joystick method interoperability #758

ticky opened this issue Mar 7, 2018 · 0 comments

Comments

@ticky
Copy link
Contributor

ticky commented Mar 7, 2018

Hi there,

I’m looking at exposing some more of the Joystick and Gamepad APIs and running into some weirdness.

I suspect the reason SDL_GameControllerGetJoystick isn’t shadowed in the GameController object has something to do with the fact that disposing of that Joystick object before the GameController object might be dangerous.

To that end, it seems it is impossible, without using joystick IDs themselves, to use Joystick methods on a GameController.

Would it be worthwhile, perhaps, to define Joystick methods as a trait, and implement it for both types, with the versions for GameController implicitly taking care of using SDL_GameControllerGetJoystick?

I have a branch I’m working on to expose PowerLevel data from Joystick objects, and I’ve realised that getting to it from a GameController will be slightly odd :)

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants