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

SDL_HasJoystick() & SDL_HasGamepad() always return true #9841

Closed
AntTheAlchemist opened this issue May 20, 2024 · 4 comments
Closed

SDL_HasJoystick() & SDL_HasGamepad() always return true #9841

AntTheAlchemist opened this issue May 20, 2024 · 4 comments
Milestone

Comments

@AntTheAlchemist
Copy link
Contributor

... even when SDL_GetJoysticks() & SDL_GetGamepads() have a count > 0. I haven't looked into it yet, but do all these methods share the same enumeration logic? Do they all respect the same hints that can affect what is/isn't a joystick?

@slouken
Copy link
Collaborator

slouken commented May 20, 2024

Erm, SDL_HasJoystick() and SDL_HasGamepad() are supposed to return true when SDL_GetJoysticks() and SDL_GetGamepads() returns > 0 respectively. What am I missing?

@AntTheAlchemist
Copy link
Contributor Author

Erm, SDL_HasJoystick() and SDL_HasGamepad() are supposed to return true when SDL_GetJoysticks() and SDL_GetGamepads() returns > 0 respectively. What am I missing?

In my app, SDL_GetJoysticks()'s count == 0, but SDL_HasJoystick() returns true, so something's off. I will debug it later, leave it with me.

@slouken slouken added this to the 3.2.0 milestone May 22, 2024
@AntTheAlchemist
Copy link
Contributor Author

My bad, sorry. There was a logic error in my code.

@slouken
Copy link
Collaborator

slouken commented May 23, 2024

I'm glad you figured it out.

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

2 participants