[SDL] Re: Mouse position bugs on Mac OS X

Christian Walther cwalther at gmx.ch
Mon Nov 21 08:26:07 PST 2005


E. Wing wrote:
>>2. When using OpenGL, SDL_WarpMouse() inverts the y coordinate.
> 
> The mouse inversion problem for windowed-OpenGL appeared going from
> Jaguar to Panther. I don't remember if we ever resolved this in an
> elegant way.

Currently, there is an inversion in QZ_PrivateCocoaToSDL(), which makes 
getting mouse coordinates work correctly (apart from the off-by-one 
bug). The bug is that the same inversion is also needed in 
QZ_PrivateSDLToCocoa(), which is used when setting mouse coordinates, 
i.e. SDL_WarpMouse(). My patch fixes that.

> At one point I thought I did, but I remembered I ended up
> breaking more stuff and I can't remember if I fixed this or went to an
> OS version check to case the two different situations.

There is no version check in the latest code, and according to your last 
changelog entry 
(http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/quartz/SDL_QuartzWM.m) 
it works everywhere. And if that's true, I guess my patch should also be 
correct everywhere, but I'll still test it to be sure.

> So be careful about testing this one between the Jaguar/Panther
> barrier. If not done correctly, it will probably (incorrectly) invert
> pre-10.3 systems. I would also advise testing the non-OpenGL modes and
> maybe even the fullscreen modes.

Yup, my test program does all combinations of GL/non-GL and 
windowed/fullscreen, and I intend to test it at least on 10.2 and maybe 
10.1. I already did on 10.4.0, and behavior there is identical to 10.3.9.

  -Christian





More information about the SDL mailing list