Mac mouse X/Y on HiDPI |
Mac mouse X/Y on HiDPI |
Alex Szpakowski
Guest
|
I encountered the same thing back when retina support was initially added, but it turned out that (at least on my computer) Apple’s own APIs reported the mouse position with the same level of granularity as SDL does, when I used a HiDPI display resolution.
On May 6, 2014, at 4:30 AM, Stefanos A. wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Mac mouse X/Y on HiDPI |
Stefanos A.
Guest
|
Cocoa indeed reports mouse coordinates in points (so [0,0]-[800,600] for a 800x600 window), but the datatype is float and, as far as I can tell, mouse events are delivered with sub-point accuracy. SDL2 appears to be chopping off these fractional parts by converting the coordinates to integers.
The end result is that my Cocoa backend can address individual pixels but my SDL2 backend can only address even pixels. This is different than on windows, where SDL2 can address each pixel individually. Note that a similar thing is happening with wheel events, which are always rounded to integer numbers. This is causing a reduction in accuracy both on Windows and on Mac OS X, which support fractional wheel rotations. Maybe it would be possible to add two more fields to the event structure that hold the floating point coordinates from the OS? (i.e. float RawX, RawY, RawWheel?) Â 2014-05-06 16:03 GMT+02:00 Alex Szpakowski:
|
|||||||||||||||||
|