Commit graph

1634 commits

Author SHA1 Message Date
Sam Lantinga
ee42a1018d From Anders F Bj�rklund:
Updated the MPW makefiles ("SDL.make", "SDLtest.make")
by adding the new "dummy" and "disk" directories/files.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401640
2006-04-14 03:24:01 +00:00
Sam Lantinga
a56f361892 Don't check dlopen on Mac OS X, to retain 10.2 compatibility
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401639
2006-04-13 15:36:27 +00:00
Sam Lantinga
50f2cfc3c2 Fixed MacOS X and Solaris detection
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401638
2006-04-13 14:59:34 +00:00
Sam Lantinga
1f2f61915e Fixed compile error
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401637
2006-04-13 14:27:58 +00:00
Sam Lantinga
9568645775 Fixed bug #55
From Christian Walther:
When writing my patch for #12, I ended up doing all sorts of changes to the way
application/window activating/deactivating is handled in the Quartz backend,
resulting in the attached patch. It does make the code a bit cleaner IMHO, but
as it might be regarded as a case of "if it ain't broken, don't fix it" I'd
like to hear other people's opinion about it. Please shout if some change
strikes you as unnecessary or wrong, and I'll explain the reasons behind it. As
far as I tested it, it does not introduce any new bugs, but I may well have
missed some.

- The most fundamental change (that triggered most of the others) is irrelevant
for the usual single-window SDL applications, it only affects the people who
are crazy enough to display other Cocoa windows alongside the SDL window (I'm
actually doing this currently, although the additional window only displays
debugging info and won't be present in the final product): Before, some things
were done on the application becoming active, some on the window becoming key,
and some on the window becoming main. Conceptually, all these actions belong to
the window becoming key, so that's what I implemented. However, since in a
single-window application these three events always happen together, the
previous implementation "ain't broken".

- This slightly changed the meaning of the SDL_APPMOUSEFOCUS flag from
SDL_GetAppState(): Before, it meant "window is main and mouse is inside window
(or mode is fullscreen)". Now, it means "window is key and mouse is inside
window (or mode is fullscreen)". It makes more sense to me that way. (See
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
for a discussion of what key and main windows are.) The other two flags are
unchanged: SDL_APPACTIVE = application is not hidden and window is not
minimized, SDL_APPINPUTFOCUS = window is key (or mode is fullscreen).

- As a side effect, the reorganization fixes the following two issues (and
maybe others) (but they could also be fixed in less invasive ways):

* A regression that was introduced in revision 1.42 of SDL_QuartzVideo.m
(http://libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/quartz/SDL_QuartzVideo.m.diff?r1=1.41&r2=1.42)
(from half-desirable to undesirable behavior):

Situation: While in windowed mode, hide the cursor using
SDL_ShowCursor(SDL_DISABLE), move the mouse outside of the window so that the
cursor becomes visible again, and SDL_SetVideoMode() to a fullscreen mode.
What happened before revision 1.42: The cursor is visible, but becomes
invisible as soon as the mouse is moved (half-desirable).
What happens in revision 1.42 and after (including current CVS): The cursor is
visible and stays visible (undesirable).
What happens after my patch: The cursor is invisible from the beginning
(desirable).

* When the cursor is hidden and grabbed, switch away from the application using
cmd-tab (which ungrabs and makes the cursor visible), move the cursor outside
of the SDL window, then cmd-tab back to the application. In 1.2.8 and in the
current CVS, the cursor is re-grabbed, but it stays visible (immovable in the
middle of the window). With my patch, the cursor is correctly re-grabbed and
hidden. (For some reason, it still doesn't work correctly if you switch back to
the application using the dock instead of cmd-tab. I haven't been able to
figure out why. I can step over [NSCursor hide] being called in the debugger,
but it seems to have no effect.)

- The patch includes my patch for #12 (it was easier to obtain using cvs diff
that way). If you apply both of them, you will end up with 6 duplicate lines in
SDL_QuartzEvents.m.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401636
2006-04-13 14:17:48 +00:00
Sam Lantinga
7a15c646b5 Fixed bug #185
The SDL platform header shouldn't dictate the OS target API for other
applications.  The build system should define the target API for building
SDL internally.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401635
2006-04-13 14:14:06 +00:00
Sam Lantinga
458c2abbc5 Fixed bug #179
SDL_SemValue() always returns 0. That's because the underlying POSIX
sem_getvalue() is implemented as a noop in Mac OS X. Apart from that,
semaphores do work properly (at least according to test/testsem), so I'm not
sure if this is worth fixing at all.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401634
2006-04-13 14:04:13 +00:00
Sam Lantinga
dfa643c31b Fixed bug #176
[I'm fixing this for the public headers, but I'm not going to bother for the SDL library code (yet)]

To clarify: Normaly, GCC (or, to be precise, the preprocessor) will ignore
this, and compile the code happily. However, one can specify -Wundef to get a
warning about this.

One can probably argue whether to consider this a bug or not; but I think that
(a) from a semantic point of view, using "#if FOO" when FOO is not defined is
strange, and (b) since it is possible to trigger a warning about this, and a
trivial fix exists, it should be corrected.

I can think of two alternative patches, BTW:
1) Simply use #define HAVE_FOO 0, instead of not defining HAVE_FOO at all
2) Change
  #if HAVE_FOO
to
  #if HAVE_FOO+0
which always does the right thing.

But I think I still prefer the attached patch :-).

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401633
2006-04-13 13:38:40 +00:00
Sam Lantinga
678ac92409 Fixed bug #193
The attached patch is mostly cosmetic: Currently, we always add both -framework
OpenGL and -framework AGL for Mac OS X command line builds.

However, the former is only used for the Cocoa video driver, and the latter
only for the Carbon video driver (as far as I can tell, at least). Hence the
attached patch modifies configure.in so that each only gets added to the list
of frameworks if the corresponding video driver is enabled.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401632
2006-04-13 13:30:21 +00:00
Sam Lantinga
2cfa74d7b8 Fixed bug #192
The change made to sdl-config.in on March 18 (rev 11, see
http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/sdl-config.in), broke static linking
under Mac OS X for unix style build systems. In other words, "sdl-config
--static-libs" no longer produces the correct output, as it is missing the
required -framework switches.

The attached patch fixes this.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401631
2006-04-13 13:29:00 +00:00
Sam Lantinga
8e0aecf6fd Added a delay so the warning message isn't accidentally missed.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401630
2006-04-13 13:25:21 +00:00
Sam Lantinga
ad57e2ae8c Fixed bug #191
[I opted to go for a warning, since I often tweak configure.in, but don't want to rebuild the entire project]

One thing that was lost in the switch from automake to the new build system is
that there is now no rule to build configure from configure.in.

IMHO, if configure.in gets changed, then at the very least, the build system
should print out a warning (better, again IMHO, an error) about this fact.
Else, you easily forget about this when modifying configure.in.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401629
2006-04-13 13:23:56 +00:00
Sam Lantinga
be0f0ff107 Fixes bug #195:
The proper name of Apple's operating system is "Mac OS X" not "MacOS X", as can
bee seen in many places, for example http://www.apple.com/macosx/). This
contrasts the naming of the old operating system, which was called "MacOS" and
today is often refered to as "MacOS Classic".

The attached patches fixes the misuse of the name "MacOS X" in both the SDL12
and sdlweb CVS modules.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401628
2006-04-13 13:08:26 +00:00
Sam Lantinga
8445eb17d1 From Anders F Bjorklund:
The current definition of int32_t, uint32_t, uintptr_t
doesn't match what the Mac system headers already have...

Since it's an old 16/32 bit platform, the system headers
expect the types to use "long" and not "int" like they do.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401627
2006-04-12 14:38:47 +00:00
Sam Lantinga
0478af81b2 From Anders F Bjorklund:
When switching to "UNIX-style paths" as needed for the new includes,
including <GL/gl.h> and <GL/glu.h> doesn't work anymore on Mac OS...

The two headers are really located in the OpenGL SDK 1.2 CFM like this:
OpenGL:Headers:gl.h
OpenGL:Headers:glu.h

There are also some compat copies, that *used* to work with Mac paths:
OpenGL:Headers:GL/gl.h
OpenGL:Headers:GL/glu.h

The easiest fix is to make SDL_opengl.h include the proper header names,
by adding a special case for the MACOS platform in addition to the MACOSX

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401626
2006-04-12 14:37:05 +00:00
Sam Lantinga
f2c3b5141a *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401625
2006-04-12 14:25:29 +00:00
Sam Lantinga
20e18895f0 Patch from Alex to fix reverted code
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401624
2006-04-12 14:19:11 +00:00
Sam Lantinga
a3f6fa51eb *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401623
2006-03-31 06:30:16 +00:00
Sam Lantinga
9ccb05a0a6 Ugh, more 64-bit cleanup
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401622
2006-03-31 06:27:47 +00:00
Sam Lantinga
403b4f89bd Date: Wed, 29 Mar 2006 17:26:55 +0200 CEST
From: "Fran���is Revol"
Subject: [SDL] BeOS port fix: PrintScreen key crashing

It seems the latest SDL crashes when someone hits the PrtScrn key in
ZETA (BeOS R6), somewhere it gets a negative value as key code (or a
big unsigned maybe ?), and uses it as an index in the keysym table...
I'll investigate the cause for the negative value, but it's always
better to check for bounds correctly when indexing a table. The
attached diff fixes it.

Fran���is Revol
--
Software Architect
yellowTAB GmbH

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401621
2006-03-31 06:16:20 +00:00
Sam Lantinga
0756c83258 Fixed building DLL on Windows
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401620
2006-03-25 20:40:30 +00:00
Sam Lantinga
26cb9c7c80 Fixed some ultra-pedantic gcc warnings
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401619
2006-03-24 06:10:24 +00:00
Sam Lantinga
1237375c2d Fixed bug #177
The attached patch changes configure.in to use "-framework FOO" instead of
"-Wl,-framework,FOO".

This avoid some issues with certain versions of libtool that do not handle
-framework properly.
Some versions of libtool will try to reorder the two parts of the option, or
render the 2nd part of the argument to the relative path of a non-existent
library.

Note: It is not enough if SDL uses a version of libtool that does this
correctly, because these -framework options show up in "sdl-config --libs".
Hence, some 3rd party apps which still ship with an old libtool have troubles
compiling under Mac OS X.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401618
2006-03-24 05:11:51 +00:00
Ryan C. Gordon
fee3805600 SDL_X11_LoadSymbols() was reporting success when required symbols weren't
found!

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401617
2006-03-24 03:49:37 +00:00
Ryan C. Gordon
092d48fc0f Fixed compiler warning.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401616
2006-03-23 22:11:29 +00:00
Sam Lantinga
764d343924 A less rude way of doing the same thing...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401615
2006-03-23 21:55:13 +00:00
Sam Lantinga
88dd069862 These files should be included from SDL_config.h (so they get SDL_platform.h)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401614
2006-03-23 21:52:47 +00:00
Sam Lantinga
bd6b201457 ls shouldn't barf if it gets passed a path starting with - (e.g. -lesd)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401613
2006-03-23 21:46:24 +00:00
Sam Lantinga
e847bdc465 Fixed bug #175
Removed obsolete .cvsignore files... whee!

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401612
2006-03-23 21:39:58 +00:00
Sam Lantinga
c9bbe9f6c2 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401611
2006-03-23 21:39:02 +00:00
Sam Lantinga
c68ee88d7a Fixed bug #171
SDL_config.h is no longer in CVS.  Instead, configure will generate it for
systems that use configure, and we always copy SDL_config.h.default to
SDL_config.h before generating a snapshot or release archive.

Also fixed a couple of uninstall issues.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401610
2006-03-23 21:28:33 +00:00
Sam Lantinga
3c6f272957 Fixed DirectFB detection
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401609
2006-03-23 17:31:12 +00:00
Sam Lantinga
2f05889935 Hopefully fixed up DirectFB detection
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401608
2006-03-23 15:25:30 +00:00
Sam Lantinga
73025412fa *sigh*
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401607
2006-03-23 15:22:40 +00:00
Ryan C. Gordon
635e991de1 More dynamic X11 mangling...should fix NetBSD builds. And hopefully doesn't
break 6 other platforms.  :)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401606
2006-03-23 08:43:37 +00:00
Sam Lantinga
29098a80cb Need time.h for nanosleep too...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401605
2006-03-23 08:37:36 +00:00
Sam Lantinga
10d2937b45 Better wscons detection
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401604
2006-03-23 07:44:52 +00:00
Sam Lantinga
2ac61483a9 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401603
2006-03-23 07:38:32 +00:00
Sam Lantinga
14da84d333 Only use the visibility attribute in gcc 4.0 or newer
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401602
2006-03-23 07:34:03 +00:00
Ryan C. Gordon
5969b6854f Updated my email address.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401600
2006-03-23 06:48:12 +00:00
Ryan C. Gordon
19882a1bfb Consolidate all the X11 libraries, so you don't have to update 12 different
places in the source when adding a new one. Also handles build systems that
 don't define a given library.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401598
2006-03-23 02:47:56 +00:00
Sam Lantinga
f60cdaa43f Lines swapped to match ordering elsewhere
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401597
2006-03-22 22:42:44 +00:00
Ryan C. Gordon
2c90fe6bf1 Close off warning about setAppleMenu on Mac OS X 10.4 SDK.
Fixes Bugzilla #97.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401596
2006-03-22 22:33:23 +00:00
Sam Lantinga
95e9bf51db Don't detect Altivec on MacOS X Intel
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401595
2006-03-22 22:29:44 +00:00
Ryan C. Gordon
be7a5193c8 Xrandr support in the X11 target.
Fixes Bugzilla #109, and as a bonus, Bugzilla #145, too!

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401594
2006-03-22 11:13:58 +00:00
Sam Lantinga
164d170fcd Improved DirectFB install detection
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401593
2006-03-22 09:18:10 +00:00
Sam Lantinga
cb61dcc206 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401592
2006-03-22 09:13:10 +00:00
Ryan C. Gordon
09d17c7320 Patched to compile on 32-bit X11, I think.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401591
2006-03-22 08:57:37 +00:00
Sam Lantinga
2f58ef08ec Date: Tue, 4 Mar 2003 15:05:31 -0800
From: "Jim"
Subject: [SDL] Frame Buffer patches...

 Okay I'm new at patch generation - so please tell me if there's a better way
 I could have done this.

 Attached are two patch files generated with 'cvs diff -u'

 SDL-fb-open-lock.patch applies to SDL_fbvideo.c
    Modifies the open loop to check /dev/fb/0 found on devfs...

    Modifies the lock code to return failure if the current virtual terminal
 is not the one opened for frame buffer writing...
   Lock would hang forever if switched away (ctrl-alt-F1) ...

 SDL-fb-mousedrv-screensave.patch applies to SDL_fbevents.c
    Switches default mouse mode based on SDL_MOUSEDRV - currently only
 accepts PS2 - otherwise default is MS Mouse.

    When the screen is switched - exisiting code (wrapped in ifdef
 SAVE_SCREEN_COTENTS) would save the wrong bit of the screen....
     ( I run frame buffer 1600x1200, the size I requested was 800x600 - the
 save would save the top 800 lines (non biased) and restore them... Adding
 screen->offset fixed that )

    However, if that option is not set, then a call to SDL_UpdateRect (full
 screen) is made. (which may have had it's contents changed since the screen
 is not entirely locked because of lock-failure patch)

 Jim

[patches slightly tweaked for SDL 1.2.10]

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401590
2006-03-22 07:48:22 +00:00
Sam Lantinga
864d889bce Fixed bug #61
Date: Mon, 24 Feb 2003 13:35:11 +0800
From: "Leonidas"
Subject: [SDL] Re: Trigger mouse wheel event -- not in X-environment

I have looked into the codes for the IMPS/2 mouse wheel mode of fbcon driver.
But I found something weird.

Here's the original codes to set a mouse device into IMPS/2 mode in libSDL.
In the file src/video/fbcon/SDL_fbevents.c
In function static int set_imps2_mode(int fd)
...
 Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
 Uint8 reset = 0xff;
 fd_set fdset;
 struct timeval tv;
 int retval = 0;

 // Set mouse device fd into IMPS/2 mode
 if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
  // ??? then RESET it..???
  if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
   retval = 1;
  }
 }
...........

Since it sets IMPS/2 mode then reset it, so you will never get a mouse into
IMPS/2 mode to use its wheel.
What I did to make the wheel usable is remove the RESET codes.
....
 if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
    /*
    if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
    }
   */
   retval = 1;
 }
....
And in FB_OpenMouse(_THIS)
Make the device /dev/psaux to be setted into imps2 mode  such that it can be
detected its a imps/2 mouse or not.
(my mouse device is on ps2, but the codes only set /dev/input/mice device
originally)
Then I have done, I can use the mouse wheel when SDL uses frame buff driver.

I dont exactly know I did right or wrong, I just change it for my usuage.
Correct me please, if I did something wrong.

Best regards,
Li Tsung Lin
IAP Product Dept. Engineer
EeRise Corp. (Image Processing System, Computer Vision System)
Hsin Tien, Taipei Hsien, Taiwan, R.O.C.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401589
2006-03-22 07:22:40 +00:00