SDL icon indicating copy to clipboard operation
SDL copied to clipboard

`SDL_GetMouseNameForID()`: Set an error message for invalid mouse IDs.

Open Sackzement opened this issue 4 months ago • 0 comments

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

Sackzement avatar Oct 30 '24 21:10 Sackzement