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

Should getControllerID be removed? #305

Open
asivitz opened this issue Mar 28, 2024 · 0 comments
Open

Should getControllerID be removed? #305

asivitz opened this issue Mar 28, 2024 · 0 comments

Comments

@asivitz
Copy link

asivitz commented Mar 28, 2024

I tried

  cds <- SDL.availableControllers
  gcs <- for cds SDL.openController
  gcids <- for gcs SDL.getControllerID

which gave me

SDLCallFailed {sdlExceptionCaller = "SDL.Input.GameController.getControllerID", sdlFunction = "SDL_JoystickInstanceID", sdlExceptionError = "Parameter 'joystick' is invalid"}

After a little digging, I see the markdown for getControllerID has

See [SDL_GameControllerInstanceID](https://wiki.libsdl.org/SDL_GameControllerInstanceID) for C documentation.

but that function (SDL_GameControllerInstanceID) doesn't seem to exist.

And the binding actually calls "SDL_JoystickInstanceID" which expects a joystick, not a controller, hence the error.

So what is the point of this function? It doesn't seem to map to any SDL functionality. If the point is to match up a controller to an event, I believe the intention is to use SDL_GameControllerFromInstanceID (basically go the other way from instance id to controller).

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

No branches or pull requests

1 participant