Skip to content

GameController / Joystick method interoperability #758

Open
@ticky

Description

@ticky

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions