You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: 2.0.4 Reported for operating system, platform: iOS (All), All
Comments on the original bug report:
On 2016-04-21 00:49:42 +0000, Eric wing wrote:
Created attachment 2434
Sample SDL program reproducing SDL_RenderSetLogicalSize & SDL_WINDOW_ALLOW_HIGHDPI bug
Hi, I think I found a bug when using SDL_WINDOW_ALLOW_HIGHDPI with SDL_RenderSetLogicalSize on iOS. I use SDL_RenderSetLogicalSize for all my stuff. I just tried turning on SDL_WINDOW_ALLOW_HIGHDPI on iOS and suddenly all my touch/mouse positions are really broken/far-off-the-mark.
I actually don't have a real retina device (still) so I'm seeing this using the iOS simulator with a 6plus template.
Attached is a simple test program that can reproduce the problem. It uses RenderSetLogicalSize and draws some moving happy faces (to show the boundaries/space of the LogicalSize and that it is working correctly for that part).
When you click/touch, it will draw one more happy face where your button point is.
If you comment out SDL_WINDOW_ALLOW_HIGHDPI, everything works as expected. But if you compile with it in, the mouse coordinates seem really far off the mark. (Face appears far up and to the left.)
Alex Szpakowski on the mailing list suggests the problem is
"I believe this is a bug in SDL_Render’s platform-agnostic mouse coordinate scaling code. It assumes the units of the mouse coordinates are always in pixels, which isn’t the case where high-DPI is involved (regardless of whether iOS is used) – they’re actually in “DPI independent” coordinates (which matches the window size, but not the renderer output size)."
Additionally, if this is correct, the Mac under Retina is also probably affected too and "as well as any other platform SDL adds high-dpi support for in the future".
On 2016-09-06 07:03:06 +0000, Jeremiah Morris wrote:
I ran into this today on a Retina Mac. Running 2.0.4, haven't checked Mercurial yet. Mouse coordinates were roughly half what they should have been; X was more off due to the difference between my logical aspect ratio and the monitor's aspect. Without the HIGHDPI flag, everything works great.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 2.0.4
Reported for operating system, platform: iOS (All), All
Comments on the original bug report:
On 2016-04-21 00:49:42 +0000, Eric wing wrote:
On 2016-09-06 07:03:06 +0000, Jeremiah Morris wrote:
On 2017-08-02 20:39:09 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: