SDL
SDL copied to clipboard
`SDL_GetMouseNameForID()`: Set an error message for invalid mouse IDs.
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: https://github.com/libsdl-org/SDL/blob/68cc173d9293e890ba93feaed1d3dc17742aa9b3/src/joystick/SDL_joystick.c#L515