Pass the error through from the SetRelativeMouseMode() implementation

This commit is contained in:
Sam Lantinga
2025-11-03 13:06:57 -08:00
parent 05887f2087
commit 49134ecf25

View File

@@ -1369,10 +1369,11 @@ bool SDL_SetRelativeMouseMode(bool enabled)
}
// Set the relative mode
if (!mouse->SetRelativeMouseMode || !mouse->SetRelativeMouseMode(enabled)) {
if (enabled) {
return SDL_SetError("No relative mode implementation available");
}
if (!mouse->SetRelativeMouseMode) {
return SDL_Unsupported();
}
if (!mouse->SetRelativeMouseMode(enabled)) {
return false;
}
mouse->relative_mode = enabled;