Commit Graph

1688 Commits

Author SHA1 Message Date
Ryan C. Gordon
a4c0223c9e Remove use of MAC_OS_X_VERSION_10_x macro.
If you look for MAC_OS_X_VERSION_10_6 in the 10.4 SDK (for example), it'll
 fail to do the right thing in the preprocessor.

--HG--
branch : SDL-1.2
2011-08-25 03:04:24 -04:00
Ryan C. Gordon
84177ee03d Cleaned up Snow Leopard display mode rework.
--HG--
branch : SDL-1.2
2011-08-23 06:04:54 -04:00
Ryan C. Gordon
0862e6401c Added GLX_EXT_swap_control support for 1.2 x11 video target.
--HG--
branch : SDL-1.2
2011-08-22 02:11:56 -04:00
Ryan C. Gordon
601ad28efa Cleaned out all the deprecated stuff in Mac OS X 10.6 SDK.
--HG--
branch : SDL-1.2
2011-08-21 23:38:35 -04:00
Ryan C. Gordon
9b633e09e5 Fixed compiler warning that happens on some platforms (x86 Mac OS X, etc).
--HG--
branch : SDL-1.2
2011-08-21 21:29:12 -04:00
Ryan C. Gordon
c046151e70 Fix SDL_GL_ACCELERATED_VISUAL on Windows in the 1.2 branch.
Fixes Bugzilla #1254.

Thanks to Thilo Schulz for the patch!

--HG--
branch : SDL-1.2
2011-08-21 12:21:01 -04:00
Ryan C. Gordon
804f8e784c Set a minimum sample count in ALSA target.
This should reduce unnecessary hardware interrupts. Apparently improves the
 ALSA target on some systems.

Fixes Bugzilla #1170.

Thanks to Paul Cercueil for the patch!

--HG--
branch : SDL-1.2
2011-08-21 11:42:47 -04:00
Ryan C. Gordon
a5329adc36 Ignore old ConfigureNotify events during X11 window resize.
Fixes Bugzilla #1049.

Thanks to Andrew Church for the patch!

--HG--
branch : SDL-1.2
2011-08-21 11:27:37 -04:00
Ryan C. Gordon
30bfa18146 Don't allocate a new NSGraphicsContext on every call to QZ_UpdateRects().
--HG--
branch : SDL-1.2
2011-08-21 10:10:42 -04:00
Ryan C. Gordon
230a95fb5f Remove src/joystick/darwin/10.3.9-FIX dir.
The license on IOHIDLib.h says we have to distribute a copy of the APSL with
every copy of SDL, and include a "prominent notice" in the documentation, and
that's annoying for something that's only there because Apple forgot to copy
a file in an ancient SDK.

--HG--
branch : SDL-1.2
2011-08-21 09:47:43 -04:00
Ryan C. Gordon
4d3dbbc47f Optionally don't clear the fbcon framebuffer on shutdown.
The new behavior is triggered by setting the environment variable
SDL_FBCON_DONT_CLEAR.

This is useful in certain circumstances (specifically: a game launcher on an
embedded device can leave a "now loading!" screen on the framebuffer while
another process is starting up).

Fixes Bugzilla #1251.

Thanks to Paul Cercueil for the patch!

--HG--
branch : SDL-1.2
2011-08-21 09:26:56 -04:00
Patrice Mandin
2d919cc1a2 Fix typo
--HG--
branch : SDL-1.2
2011-08-11 18:50:45 +02:00
Ryan C. Gordon
1da88c2ee0 Fixed SDL 1.2 fullscreen OpenGL on Mac OS X 10.7.
I'm not sure if there was a way to make CGLSetFullScreen() work, but the
Cocoa path works fine on all Intel Macs.

Please note that the "official" way to do fullscreen in 10.7 is just to make
a window the size of the display mode, and OS X is now smart enough to
recognize this as "fullscreen", but this helps earlier versions of the OS in
any case.

--HG--
branch : SDL-1.2
2011-08-10 01:25:00 -04:00
Ryan C. Gordon
30d7f06bfa Fixes for OpenGL on Haiku.
testgl now passes when this patch is used.

This patch was originally from Urias McCullough (umccullough).

--HG--
branch : SDL-1.2
2011-08-04 01:44:32 -04:00
Ryan C. Gordon
f14fd4d671 Quartz: Don't use -[NSWindow center] on the fullscreen window.
"Centering" is a little off-center, vertically. Apparently in non-fullscreen
 apps, this is more aestetically pleasing or something.

Fixes positioning on fullscreen video modes on Mac OS X.

--HG--
branch : SDL-1.2
2011-07-18 20:32:40 -07:00
Ryan C. Gordon
0e1946b0ed Quartz: Ripped out all the legacy CoreGraphics code.
Mac OS X Lion (10.7) always returns NULL from CGDisplayBaseAddress(), so all
 the direct framebuffer access code has been replaced with something a little
 higher level. This also necessitated taking out the scary SDL_DOUBLEBUF
 codepath that was trying to time out vsync by hand.  :)

--HG--
branch : SDL-1.2
2011-07-17 03:08:53 -07:00
Ryan C. Gordon
426198b711 Quartz: locking should only recheck CGDisplayBaseAddress() for HWSURFACEs.
--HG--
branch : SDL-1.2
2011-07-17 01:03:13 -07:00
Patrice Mandin
b92c1e4101 Check sa_sigaction member of struct sigaction
--HG--
branch : SDL-1.2
2011-07-14 15:40:07 +02:00
Ryan C. Gordon
d4bb6faea5 Linux: Search a smaller set of potential joystick axes.
Newer kernels seem to report bogus axes in the higher ranges, for example
 with a standard PlayStation 3 controller plugged in via USB.

--HG--
branch : SDL-1.2
2011-07-13 17:36:29 -07:00
Ryan C. Gordon
36b75c658a Minor whitespace cleanup.
--HG--
branch : SDL-1.2
2011-07-07 11:50:30 -07:00
Ryan C. Gordon
548ff4bc00 Cleaned up compiler warnings about unchecked return values.
--HG--
branch : SDL-1.2
2011-07-07 11:49:46 -07:00
Ryan C. Gordon
10b49960a9 Don't call CGContextRelease() on object Cocoa already flagged for autorelease.
Thanks to Kirk A. Baker for this fix!

--HG--
branch : SDL-1.2
2011-06-04 15:34:32 -04:00
Ryan C. Gordon
bcc468de12 QZ_LockHWSurface() should always check for changes to the screen surface.
Apparently these pointers can change if the user has multiple displays and
 moves a window between them, and probably other similar cases.

Thanks to Kirk Baker for the patch!

--HG--
branch : SDL-1.2
2011-06-04 15:33:50 -04:00
Sam Lantinga
5d83b03124 Fixed compiler warning
--HG--
branch : SDL-1.2
2011-03-21 13:33:29 -07:00
Sam Lantinga
e1f3e98edf Do not break application's signal handler installed with SA_SIGINFO
Gleb Natapov to sdl

If application installs SIGINT/SIGTERM signal handler with
sigaction(SA_SIGINFO) syscall before initializing SDL, after
initialization
of SDL signal handler will be reinstalled without SA_SIGINFO flag which
brings havoc when the signal handler is called. The breakage is done by
SDL_QuitInit()/SDL_QuitQuit() function. They use signal() to detect that
signal handler is already installed even in sigaction() is available.

--HG--
branch : SDL-1.2
2011-03-15 21:36:36 -07:00
Sam Lantinga
9f5b01a047 Patch for SDL_VIDEO_CENTERED & OpenGL bug
Stephen Anthony to SDL

Using SDL_VIDEO_CENTERED in Linux OpenGL mode issue an unwanted
ConfigureNotify event *after* the SDL screen has already been resized.
When going from a smaller to a larger screen, this event causes the mouse
tracking to be clamped at the *smaller* screen size, even though that
screen no longer exists.

The fix is to not issue a ConfigureNotify when the window is moved because
of the SDL_VIDEO_CENTERED environment variable.  The included patch fixes
this bug.  It seems the hints must be set before the window is moved.

--HG--
branch : SDL-1.2
2011-02-24 17:42:45 -08:00
Sam Lantinga
cdc519267b nasm 2.09 compatibility
nasm-2.09 makes `elf' alias to `elf32', thus __OUTPUT_FORMAT__ macro
becomes `elf32' instead of `elf' (on x86). Unmatched macro value causes
omitting .note.GNU-stack marker and creates ELFs with executable stack.
This is unneeded and attracts security policies like SELinux.

--HG--
branch : SDL-1.2
2011-02-24 09:39:23 -08:00
Sam Lantinga
4d222ab45d Fixed bug #1090 (SDL_BlitCopyOverlap() assumes memcpy() operates in order)
The much more complete fix is in SDL 1.3, but this is a band-aid that will fix the bug for 1.2.

--HG--
branch : SDL-1.2
2011-02-17 02:31:50 -08:00
Sam Lantinga
6341d68347 Fixed bug #1121 (More than one device through SDL_JOYSTICK_DEVICE)
Chusslove Illich      2011-02-13 04:30:28 PST

Currently SDL_JOYSTICK_DEVICE environment variable can be used to add
exactly one topmost device. I think it would be nice if one could also set
several devices (e.g. a stick and a throttle) in this way, as a colon-
separated list. The attached patch implements this

--HG--
branch : SDL-1.2
2011-02-16 04:49:07 -08:00
Sam Lantinga
ffcdf2f90f Fixed compile error
--HG--
branch : SDL-1.2
2011-02-04 09:07:39 -08:00
Sam Lantinga
a03d783f83 Fixed bug #1111
kwm@rainbow-runner.nl      2011-01-30 06:28:27 PST

When building sdl 1.2.14 with the Clang compiler http://clang.llvm.org .
The build fails in src/video/mmx.h with the following error:

--------------------------------------------------
./src/video/SDL_RLEaccel.c:831:5: error: invalid operand for instruction
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
    ^
./src/video/SDL_RLEaccel.c:831:17: note: instantiated from:
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
                ^
./src/video/SDL_RLEaccel.c:831:5: note: instantiated from:
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
    ^
./src/video/SDL_RLEaccel.c:647:23: note: instantiated from:
                                blitter(2, Uint8, ALPHA_BLIT16_565MMX); \
                                                  ^
./src/video/SDL_RLEaccel.c:282:4: note: instantiated from:
          movq_r2m(mm3, *dstp);                         \
          ^
In file included from ./src/video/SDL_RLEaccel.c:99:
./src/video/mmx.h:379:28: note: instantiated from:
#define movq_r2m(reg, var)      mmx_r2m(movq, reg, var)
                                ^
<scratch space>:192:1: note: instantiated from:
"movq"
^
<inline asm>:1:2: note: instantiated into assembly here
        movq %mm3, %dx
        ^
--------------------------------------------------

According to the clang developers this is a invalid inline assembly.
Using the attached patch from the last commit in the below bug report fixes the
compile.
More details from: http://llvm.org/bugs/show_bug.cgi?id=6730

--HG--
branch : SDL-1.2
2011-01-30 13:38:57 -08:00
Sam Lantinga
e5a771fcad Colin Leroy 2011-01-26 04:24:20 PST
the pthread implementation of SDL_SemWaitTimeout() uses busy waiting, while
pthread's sem_timedwait() does work. Attached are patches that make use of it

--HG--
branch : SDL-1.2
2011-01-27 00:33:26 -08:00
Sam Lantinga
75d7d9364d Missed a small part of the patch
--HG--
branch : SDL-1.2
2011-01-24 14:34:58 -08:00
Sam Lantinga
2b8a7320bf Fixed bug #1080
Markus Rathgeb      2011-01-23 14:34:23 PST

With kernel 2.6.31 the struct input_absinfo defined in linux/input.h changed.
A field "__s32 resolution" was added at the end of the struct.

Because the macro EVIOCGABS(abs) is using the struct input_absinfo, it would be
better (IMHO) to change the declaration of variable values to
"int values[sizeof(struct input_absinfo) / sizeof(int)];" or using "struct
input_absinfo" directly.

--HG--
branch : SDL-1.2
2011-01-24 14:31:32 -08:00
Sam Lantinga
af5e892e35 Michael Bicha to Sam
I came across further issues with SDL 1.2.14 on win32 in combination
with touch screens.

When you touched the screen older SDLs reported
SDL_MOUSEMOTION to the touch position
SDL_MOUSEBUTTONDOWN at the touch position

1.2.14 reports
SDL_MOUSEBUTTONDOWN at the last mouse position before the touch
and then a
SDL_MOUSEMOTION to the touch position

I found that to fix it in the file SDL_sysevents.c i had to put back the
following lines from 1.2.12 to get it working correctly again:
               if ( mouse_relative ) {
               /*    RJR: March 28, 2000
                   report internal mouse position if in relative mode */
                   x = 0; y = 0;
               } else {
                   x = (Sint16)LOWORD(lParam);
                   y = (Sint16)HIWORD(lParam);
#ifdef _WIN32_WCE
                   if (SDL_VideoSurface)
                       GapiTransform(this->hidden->userOrientation,
this->hidden->hiresFix, &x, &y);
#endif
               }
               posted = SDL_PrivateMouseButton(
                           state, button, x, y);

where there was only
               posted = SDL_PrivateMouseButton(
                           state, button, 0, 0);
in 1.2.14 (appx. line 484)

please feel free to put that change into any SDL lib you like in any way
you like and thanks for your great work !

--HG--
branch : SDL-1.2
2011-01-23 21:02:02 -08:00
Sam Lantinga
d4ac198b04 Patch from Haiku's Google Code-In student Daniel Marth, fixes an off-by-one issue in bwindow.
--HG--
branch : SDL-1.2
2010-12-03 16:55:25 -08:00
Sam Lantinga
27aa45979d Here's the patch we use when building SDL-1.2.14 and 1.2-hg on Haiku,
it only affects Haiku specific files so should be ok to apply in hg.

-Scott McCreary
HaikuPorts

--HG--
branch : SDL-1.2
2010-09-18 17:16:36 -07:00
Patrice Mandin
d532e5b2cd Use proper GEM API to handle mouse button events
--HG--
branch : SDL-1.2
2010-07-09 17:19:18 +02:00
Sam Lantinga
6e895b65ed Finally fixed bug 894 without breaking bug 716. Yay! :)
--HG--
branch : SDL-1.2
2010-07-20 00:01:26 -07:00
Sam Lantinga
1884f9add8 Fixed bug 1015
Don't set the WM_TRANSIENT_FOR property to an invalid value - delete it instead.

--HG--
branch : SDL-1.2
2010-07-18 11:37:12 -07:00
Sam Lantinga
049d2f44c7 RedHat patch: SDL-1.2.14-xio_error-rh603984.patch
--HG--
branch : SDL-1.2
2010-07-18 11:24:37 -07:00
Sam Lantinga
7a99d1b90b RedHat patch: SDL-1.2.14-audiodriver.patch
--HG--
branch : SDL-1.2
2010-07-18 11:12:27 -07:00
Sam Lantinga
017012df21 Fixed bug 1006
Get the GLX functions with glXGetProcAddress() when available.

--HG--
branch : SDL-1.2
2010-07-18 11:11:37 -07:00
Sam Lantinga
edd35e7af0 Fixed bug 993
GCC supports unnamed unions now. :)

--HG--
branch : SDL-1.2
2010-07-18 10:51:25 -07:00
Sam Lantinga
9658a578d6 Better fix for bug 936
--HG--
branch : SDL-1.2
2010-07-18 10:28:57 -07:00
Sam Lantinga
b55d270161 Fixed bug 936
Make sure that eip doesn't overflow the copy buffer beforehand. :)

--HG--
branch : SDL-1.2
2010-07-18 10:08:06 -07:00
Sam Lantinga
a977e65fde Debian patch: 215_kfreebsd_gnu.diff
--HG--
branch : SDL-1.2
2010-07-18 08:12:48 -07:00
Ryan C. Gordon
1daff39d16 SDL-1.2: Quartz fullscreen video contentRect was used uninitialized.
--HG--
branch : SDL-1.2
2010-04-25 20:16:38 -04:00
Sam Lantinga
eae15b1ad8 Fixed bug #943
Ozkan Sezer      2010-02-06 12:31:06 PST

Hi:

Here are some small fixes for compiling SDL against mingw-w64.
(see http://mingw-w64.sourceforge.net/ .  Despite the name, it
supports both win32 and win64.)  Two patches, one for SDL-1.2
and one for SDL-1.3 attached.

src/audio/windx5/directx.h and src/video/windx5/directx.h (both
SDL-1.2 and SDL-1.3.)  I get compilation errors about some union
not having a member named u1 and alike, because of other system
headers being included before this one and them already defining
DUMMYUNIONNAME and stuff. This header probably assumes that those
stuff are defined in windef.h, but mingw-w64 headers define them
in _mingw.h. Easily fixed by moving NONAMELESSUNION definition to
the top of the file.  SDL_dx5yuv.c (SDL-1.2-only) also needs to
include the header before SDL_video.h to avoid the same problem.

src/thread/win32/SDL_systhread.c (both SDL-1.2 and SDL-1.3.) :
The __GNUC__ case for pfnSDL_CurrentBeginThread is 32-bit centric
because _beginthreadex returns uintptr_t, not unsigned long which
is 32 bits in win64. Changing the return type to uintptr_t fixes
it.

Hope these are useful. Thanks.

--HG--
branch : SDL-1.2
2010-03-10 15:04:13 +00:00
Ryan C. Gordon
22cd9e3e14 Fixed channel swizzling for ALSA target with 6-channel output.
Fixes Bugzilla #942.

--HG--
branch : SDL-1.2
2010-02-12 16:59:34 +00:00