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_GetMouseNameForID(): Set an error message for invalid mouse IDs. #11383

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sackzement
Copy link
Contributor

Currently SDL_GetMouseNameForID() doesn't set an error message, when passing an invalid mouse ID:

if(!SDL_GetMouseNameForID(99)) {
    printf("Error \"%s\"", SDL_GetError());
}

Prints

""

This commits sets an error message when the function fails.

The style of the message is inspired by a similar joystick error message:

SDL_SetError("Joystick %" SDL_PRIu32 " not found", instance_id);

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

Successfully merging this pull request may close these issues.

1 participant