No description
Find a file
Ryan C. Gordon fff622da69 To: sdl@libsdl.org
From: Christian Walther <cwalther@gmx.ch>
Date: Fri, 18 Nov 2005 23:39:02 +0100
Subject: [SDL] Mouse position bugs on Mac OS X

The attached patch fixes a few bugs in SDL related to the mouse position
in windowed mode on Mac OS X, reproduced using the attached minimal test
program - at least here on 10.3.9, with SDL CVS from today. Could anyone
test whether the bugs exist and are fixed by the patch on 10.2 and 10.4?

1. When using OpenGL, the vertical mouse positions obtained through
events or SDL_GetMouseState() are off by one.

2. When using OpenGL, SDL_WarpMouse() inverts the y coordinate.

3. Clicks on the topmost pixel row of the window are not recognized.

1 and 2 do not occur in non-OpenGL mode, while 3 does. All three only
occur in windowed mode, not in fullscreen.

The cause for 1 and 3 is that in Cocoa, "the location of the mouse"
seems to be defined as "the location of the top left corner of the mouse
pointer's hot pixel" (this is not documented, it's just what I found out
here), which together with the fact that Cocoa's usual y coordinates
start at the bottom and increase upwards means that the y coordinate of
the mouse runs from 1 to h, not from 0 to h-1, in a window of height h.

If it does work on 10.2 and 10.4 (I'll try to test it as soon as I can,
but at the moment all I have at hand is 10.3.9), can this be applied to
the CVS?

  -Christian



To: sdl@libsdl.org
From: Christian Walther <cwalther@gmx.ch>
Date: Mon, 28 Nov 2005 10:41:51 +0100
Subject: [SDL] Re: Mouse position bugs on Mac OS X

I wrote:
> I'll try to test it as soon as I can, but at the moment all I have at hand is 10.3.9

So, here are the results of my tests (with patched and unpatched
frameworks compiled with Xcode 1.5 (gcc 3.3) on 10.3.9):

On 10.1.5, my test program doesn't run because of "Undefined symbols:
SDL undefined reference to _CGMainDisplayID expected to be defined in
Carbon". I guess not supporting 10.1 was a deliberate decision then and
that's OK with me.

On 10.2.8, 10.3.9, and 10.4.0, the bugs exist as described in my
original post and are fixed by my patch. That is, there is no difference
between pre/post 10.3 and the patched version works correctly in all
combinations of GL/non-GL and windowed/fullscreen.

I therefore recommend the patch for inclusion.

  -Christian

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401195
2005-11-28 13:58:26 +00:00
docs *** empty log message *** 2004-12-16 06:39:54 +00:00
include OS/2 port! 2005-11-23 07:29:56 +00:00
src To: sdl@libsdl.org 2005-11-28 13:58:26 +00:00
test OS/2 port! 2005-11-23 07:29:56 +00:00
.cvsignore *** empty log message *** 2004-12-16 05:29:55 +00:00
acinclude.m4 Don't fail if we don't have ALSA available 2004-08-24 06:32:50 +00:00
autogen.sh Date: Fri, 2 Sep 2005 21:56:50 -0400 2005-09-11 04:15:44 +00:00
Borland.html *** empty log message *** 2003-07-01 01:18:27 +00:00
Borland.zip *** empty log message *** 2003-07-01 01:18:27 +00:00
BUGS Real Unicode support for X11. Based on updated version of this patch: 2005-11-21 00:16:34 +00:00
config.guess Updated libtool support so Mingw32 builds work. 2003-10-06 07:13:16 +00:00
config.sub Date: Sat, 24 Apr 2004 15:13:32 +0300 2004-05-06 15:55:06 +00:00
configure.in Seperate glX from HAVE_OPENGL, for platforms that have both an X server and 2005-11-23 11:46:36 +00:00
COPYING Initial revision 2001-04-26 16:45:43 +00:00
CREDITS Lots of people have contributed cash. :) 2004-02-15 22:04:46 +00:00
CWprojects.sea.bin Updated version number 2005-08-24 05:49:57 +00:00
docs.html *** empty log message *** 2005-08-21 08:02:23 +00:00
EpocBuildFiles.zip Added support for building SDL for EPOC/SymbianOS 6.0 (thanks Hannu!) 2001-12-14 12:37:34 +00:00
INSTALL Date: Tue, 2 Mar 2004 11:34:54 +0100 2004-03-02 13:01:02 +00:00
ltmain.sh Updated libtool support for libtool 1.5.8 2004-08-21 20:35:50 +00:00
Makefile.am Merged the Visual C++ 6 and 7 projects so all Visual C++ users unpack the same set of projects to get started. 2005-08-24 21:57:48 +00:00
Makefile.dc Added initial support for Dreamcast (thanks HERO!) 2002-10-05 16:50:56 +00:00
MPWmake.sea.bin Updated projects with cpuinfo API 2004-02-10 17:34:38 +00:00
PBProjects.tar.gz The tenth time is the charm... 2004-05-20 10:05:59 +00:00
README QNX is now officially supported! Thanks to Mike Gorchak! 2003-08-30 17:09:59 +00:00
README-SDL.txt Initial revision 2001-04-26 16:45:43 +00:00
README.AmigaOS Updated the Amiga OS port of SDL (thanks Gabriele) 2001-05-10 20:13:29 +00:00
README.CVS *** empty log message *** 2004-05-16 22:37:59 +00:00
README.DC Added initial support for Dreamcast (thanks HERO!) 2002-10-05 16:50:56 +00:00
README.Epoc Added support for building SDL for EPOC/SymbianOS 6.0 (thanks Hannu!) 2001-12-14 12:37:34 +00:00
README.MacOS Date: Sat, 8 Sep 2001 04:42:23 +0200 2001-09-11 19:00:18 +00:00
README.MacOSX Updated SDL for MacOS X Xcode support 2004-12-06 04:17:56 +00:00
README.MiNT Document recent audio updates 2005-08-10 14:30:53 +00:00
README.NanoX Date: Sat, 24 Aug 2002 22:20:01 -0600 2002-08-25 06:21:49 +00:00
README.OS2 OS/2 port! 2005-11-23 07:29:56 +00:00
README.PicoGUI Added initial support for PicoGUI (thanks Micah!) 2002-08-01 23:24:13 +00:00
README.QNX Date: Sat, 24 Apr 2004 15:13:32 +0300 2004-05-06 15:55:06 +00:00
README.Qtopia Added a README for Qtopia 2002-06-01 18:43:51 +00:00
README.RISCOS Date: Wed, 26 Jan 2005 13:37:09 GMT 2005-02-12 18:01:31 +00:00
README.WinCE Updated for embedded Visual C++ 4.0 2002-08-20 00:20:06 +00:00
README.wscons To: sdl@libsdl.org 2005-11-22 15:19:50 +00:00
sdl-config.in Fixed static linking on MacOS X (thanks Max!) 2004-02-11 07:09:11 +00:00
sdl.m4 Date: Wed, 17 Aug 2005 11:23:40 -0400 2005-08-18 06:06:02 +00:00
SDL.qpg.in Date: Tue, 2 Mar 2004 08:52:20 +0200 2004-03-02 12:38:27 +00:00
SDL.spec.in The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails: 2005-09-08 06:16:14 +00:00
setvars.cmd OS/2 port! 2005-11-23 07:29:56 +00:00
strip_fPIC.sh Fixed to work on Solaris x86 2001-05-10 20:19:50 +00:00
TODO *** empty log message *** 2001-08-18 10:33:55 +00:00
VisualC.html Merged the Visual C++ 6 and 7 projects so all Visual C++ users unpack the same set of projects to get started. 2005-08-24 21:57:48 +00:00
VisualC.zip Merged the Visual C++ 6 and 7 projects so all Visual C++ users unpack the same set of projects to get started. 2005-08-24 21:57:48 +00:00
VisualCE.zip Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at 2005-09-29 09:43:00 +00:00
Watcom.mif OS/2 port! 2005-11-23 07:29:56 +00:00
WhatsNew *** empty log message *** 2004-01-08 16:01:07 +00:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 1.2

---
http://www.libsdl.org/

This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.

SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Java, Lua, ML,
Objective C, Perl, PHP, Pike, Python, and Ruby.

The current version supports Linux, Windows, BeOS, MacOS, MacOS X,
FreeBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.  The code contains
support for Windows CE, AmigaOS, Dreamcast, Atari, NetBSD, AIX, OSF/Tru64,
RISC OS, and SymbianOS, but these are not officially supported.

This library is distributed under GNU LGPL version 2, which can be
found in the file  "COPYING".  This license allows you to use SDL
freely in commercial programs as long as you link with the dynamic
library.

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation is available in HTML format in "./docs/index.html"

The test programs in the "test" subdirectory are in the public domain.

Frequently asked questions are answered online:
	http://www.libsdl.org/faq.php

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)