iPad 3 and some dimensions inconsistencies with SDL_GetMouse

Things seem to work perfectly on the iPad simulator (when I simulate non-retina iPad), but when I’m using the actual device (an iPad3) or when I simulate a retina-display iPad, I am getting some puzzling coordinate related bugs.

SDL_GetWindowSize returns the values of 2048x1536 when run on my iPad 3, but when my program calls SDL_GetMouseState, it returns x/y coordinates as if my iPad had a resolution of 1024x768. In other words, touching the right most area of the screen returns an x value of 1024 when it should return 2048.
I mean, there’s gotta be something wrong when SDL_GetMouseState doesn’t agree with SDL_GetWindowSize, right? Whatever the window dimensions are, I think those should be the upper bounds for SDL_GetMouseState.

I believe the iPad 1 and iPad 2 have a resolution of 1024x768.
I have an iPad 3 which has a resolution of 2048x1536. I am wondering if I need to indicate that somewhere in my code (or perhaps the project settings), and if that could be why the values returned aren’t correct. It seems like SDL_GetMouseState always seems to return values as if the screen dimensions were 1024x768 whether or not they are.

I am thinking this isn’t just an error with my code because I tried the fireworks.c demo code on my iPad 3 and it did the exact same thing with the coordinates not matching the screen dimensions.

Anyone experience anything like this and know what’s going on?

FYI, I ran into this too, and just fixed it in the latest snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip

Cheers!On Wed, Jul 25, 2012 at 1:40 AM, Trev wrote:

**
Things seem to work perfectly on the iPad simulator (when I simulate
non-retina iPad), but when I’m using the actual device (an iPad3) or when I
simulate a retina-display iPad, I am getting some puzzling coordinate
related bugs.

SDL_GetWindowSize returns the values of 2048x1536 when run on my iPad 3,
but when my program calls SDL_GetMouseState, it returns x/y coordinates as
if my iPad had a resolution of 1024x768. In other words, touching the right
most area of the screen returns an x value of 1024 when it should return
2048.
I mean, there’s gotta be something wrong when SDL_GetMouseState doesn’t
agree with SDL_GetWindowSize, right? Whatever the window dimensions are, I
think those should be the upper bounds for SDL_GetMouseState.

I believe the iPad 1 and iPad 2 have a resolution of 1024x768.
I have an iPad 3 which has a resolution of 2048x1536. I am wondering if I
need to indicate that somewhere in my code (or perhaps the project
settings), and if that could be why the values returned aren’t correct. It
seems like SDL_GetMouseState always seems to return values as if the screen
dimensions were 1024x768 whether or not they are.

I am thinking this isn’t just an error with my code because I tried the
fireworks.c demo code on my iPad 3 and it did the exact same thing with the
coordinates not matching the screen dimensions.

Anyone experience anything like this and know what’s going on?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org