Browse Source

Log an error if `SDL_CreateColorCursor` fails

pull/6127/head
Gleb Mazovetskiy 3 years ago
parent
commit
a8f1d74bc4
  1. 5
      Source/hwcursor.cpp

5
Source/hwcursor.cpp

@ -102,8 +102,11 @@ bool SetHardwareCursorFromSurface(SDL_Surface *surface, HotpointPosition hotpoin
const Point hotpoint = GetHotpointPosition(*scaledSurface, hotpointPosition);
newCursor = SDLCursorUniquePtr { SDL_CreateColorCursor(scaledSurface.get(), hotpoint.x, hotpoint.y) };
}
if (newCursor == nullptr)
if (newCursor == nullptr) {
LogError("SDL_CreateColorCursor: {}", SDL_GetError());
SDL_ClearError();
return false;
}
SDL_SetCursor(newCursor.get());
CurrentCursor = std::move(newCursor);
return true;

Loading…
Cancel
Save