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 - Touch coordinates on retina displays
Summary: Touch coordinates on retina displays
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-29 22:25 UTC by brad
Modified: 2015-02-23 03:23 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.