Pass the error through from the SetRelativeMouseMode() implementation

This commit is contained in:
Sam Lantinga committed 2025-11-03 13:07:17 -08:00
1 parent 05887f2087
commit 49134ecf25
1 file changed
+5 -4
+5 -4
View File
@@ -1369,10 +1369,11 @@ bool SDL_SetRelativeMouseMode(bool enabled)
} }
// Set the relative mode // Set the relative mode
if (!mouse->SetRelativeMouseMode || !mouse->SetRelativeMouseMode(enabled)) { if (!mouse->SetRelativeMouseMode) {
if (enabled) { return SDL_Unsupported();
return SDL_SetError("No relative mode implementation available"); }
} if (!mouse->SetRelativeMouseMode(enabled)) {
return false;
} }
mouse->relative_mode = enabled; mouse->relative_mode = enabled;