[Feature] Hi-DPI custom cursor support for MacOS (and possibly other systems?)
The cursor created by SDL_CreateColorCursor is scaled appropriately to the DPI of the display (2x on Retina displays), making it blurry. I think we could add an SDL hint to change this behavior.
I wonder how Wayland and Windows behave / what they expect? Maybe it makes sense to have a 'source image DPI scale' parameter in the Create*Cursor functions?
As far as I remember, the cursors on Windows are rendered as-is (pixel perfect), without any scaling. But it was a long time ago, I don't know how it is currently behaving. We can use SDL_DisplayMode::pixel_density to retrieve native DPI, that shouldn't be a problem I think. The application would manage the scaling itself if it has a built-in vector rasterizer library.
Basically a user-supplied cursor's intended DPI scale might not match the display's current scale - so if SDL assumes it does, it might have the opposite issue that it has right now on macOS (cursors might appear sharp but tiny, instead of normal size but blurry).
There also may be interactions with sizing and scaling when moving the cursor between displays that have different DPI scales. I'm unsure what macOS and other operating systems have in their APIs to make that seamless, if they do have something maybe SDL can take advantage of it.
I think MacOS handles cursors in the same way as windows - if the window is located between screens #1 and #2, it has the DPI of the more dense monitor. The monitor with less DPI, displays the window at the same size, with downsampling (done via compositor). KDE Wayland does that too. I think we can easily assume that the cursor should have a DPI set to the same value as the active window if we want to have pixel-perfect precision. There are a lot of backends, so it wouldn't be suprising if many of them have completely different behavior.
So the right solution is for your application to provide multiple versions of your cursor for different DPI resolutions. I've added functions to let you add alternate versions of a surface, and if you pass that to SDL_CreateColorCursor(), it will create a cursor with multiple images that will be used appropriately. Check out the changes to testcustomcursor.c for details.