Reverted the order of the SDL_WarpMouseInWindow and SDL_GetMouseState
to its original sequence.
This avoids cursor warping to the center of screen on older SDL versions
It causes an additional SDL_MOUSEMOTION event when ungrabbing, but does
not cause any issues.
Move grab handling out of `nk_sdl_handle_event` to `nk_sdl_handle_grab`,
which is now called outside of the event loop.
This change makes the logic similar to the GLFW demos and fixes issues
with missed grab state changes and mouse cursor disappearing.
This commit resolves two issues with high-DPI display rendering:
1. The coordinates were not scaled properly, resulting in tiny output
and misalignment of actual cursor position with apparent position;
this is fixed by calling SDL_SetRenderScale with appropriate scaling
factors determined by comparing the window size to the renderer's
output size
2. The fonts were not oversampled, resulting in excessively blurry text;
this is fixed by setting oversample_h and oversample_v on the
font_config according to the scaling factors
Addresses an issue where the Metal render driver (macOS) could not handle the clipping rectangle {-8192, -8192, 16384, 16384} and would simply draw nothing to the screen. The solution is to ensure the cliprect coordinates are not negative, which also doesn't break the other render drivers.
Co-authored-by: Kristian Bolino <kbolino@kbolino.com>