We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1435

Summary: Touch coordinates on retina displays
Product: SDL Reporter: brad <bradallred>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: amaranth72, martin.gerhardy
Version: HG 2.0   
Hardware: iPhone/iPod touch   
OS: iOS (All)   

Description brad 2012-02-29 22:25:09 UTC
we had been using SDL 1.3 successfully to run an 800x600 game on iPhone 4. upon upgrading to SDL 2.0 touch events are no longer working. "Mouse" events continue to work if we multiply by 2, but the tfinger event coordinates are giving coordinates in excess of 20000 which is obviously wrong. none of the values in tfinger make any sense either. I have searched and searched for an answer thinking I was perhaps misusing the API, but I don't think this is the case now :)
Comment 1 Martin Gerhardy 2012-08-27 02:47:26 UTC
Can you attach the parts of the event code you are using to parse the event?

Did you apply the touch resolutions?

README.touch contains this:

      SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
      if(inTouch == NULL) continue; //The touch has been removed

      float x = ((float)event.tfinger.x)/inTouch->xres;
      float y = ((float)event.tfinger.y)/inTouch->yres;
Comment 2 Alex Szpakowski 2015-02-23 03:23:49 UTC
Recent SDL versions don't seem to have this bug.