Commit Graph
4 Commits
Author SHA1 Message Date
NyakoFox cd785316b6 Fix mouse coordinates being wrong on HiDPI displays
When writing the initial stretch mode code, the existence of HiDPI
displays completely slipped my mind -- or at least I didn't realize
that they'd be a problem.

We implement scaling modes ourselves, so transforming the mouse
coordinates to our 320x240 viewport is done manually. Unfortunately,
that code did not take into account HiDPI scaling whatsoever, meaning
that all of the math which assumes the window size and the renderer
size is wrong.

To fix this, we use `SDL_GetWindowSizeInPixels` and `SDL_GetWindow` to
find the scaling factor, and then apply that to the mouse coordinates
to get the mouse coordinates in the pixel-space instead, and then we do
all of our normal logic after.

Due to our usage of `SDL_GetWindowSizeInPixels`, this bumps the minimum
SDL version to 2.26.0.

Closes #1235.
2025-05-03 15:15:38 -04:00
NyakoFox 25dd9d56ad Make 0-length gravity lines invisible again 2024-11-17 11:46:55 -05:00
NyakoFox 3361e71036 Add MSVC version check 2024-03-29 20:31:00 -07:00
NyakoFox 4bba26280f Add /utf-8 to MVSC 2024-03-29 20:31:00 -07:00