Commit Graph

3481 Commits

Author SHA1 Message Date
Ryan C. Gordon
a3890ff6d7 dynapi: fill in OS/2 loading code (thanks, Ozkan!).
Partially fixes Bugzilla #3765.
2017-08-22 15:50:39 -04:00
Brandon Schaefer
17453d495a x11: Move screen_w/h inside the only ifdef they are referenced in to avoid compiler warnings 2017-08-21 23:44:46 -07:00
Brandon Schaefer
a6dc4ed568 kmsdrm: Remove moved file 2017-08-21 17:22:00 -07:00
Brandon Schaefer
1171718473 kmsdrm: Cleanup unused headers, rename SDL_kmsdrmevents_c.h -> SDL_kmsdrmevents.h 2017-08-21 17:20:50 -07:00
Sam Lantinga
fcf83e7908 Fixed bug 3768 - provide a quick copysign() solution for watcom
Ozkan Sezer

The following patch provides a quick copysign solution for Watcom/x86
2017-08-21 16:30:24 -07:00
Sam Lantinga
9b3ec6a570 SDL_thread.h: add missing os/2 defines.
(essentially replicates the windows case || SDL1.2 case.)
2017-08-21 13:01:22 -07:00
Sam Lantinga
f6ad070b82 SDL_dynapi.h: disable dynapi for os/2. 2017-08-21 13:00:58 -07:00
Sam Lantinga
b821ded96c SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM(). 2017-08-21 13:00:40 -07:00
Sam Lantinga
f807655b7d Fixed bug 3761 - Windows non-MinGW cmake build defines HAVE_WCSLCPY and HAVE_WCSLCAT
Tom Seddon

0f0ad62237 (git head at the time of writing); Visual Studio 2015, toolset v140, Platform 10.0.14393.0, building for x64

Windows non-MinGW cmake build sets defines implying wcslcpy and wcslcat are available, but Windows doesn't have these functions.

Ryan C. Gordon

That's weird, these are the exact two functions that Emscripten incorrectly believed it had until we upgraded the buildbot's emsdk install.

Not sure what's up with this, but it's possibly not a MingW-specific thing!
2017-08-21 11:25:04 -07:00
Sam Lantinga
834ab350e5 Fixed bug 3644 - Wayland touch event support
Moritz Bitsch

Attached is a small patch which enables multitouch events on Wayland.
2017-08-21 11:19:38 -07:00
Sam Lantinga
a78c20ae19 configury: check mmdeviceapi.h and audioclient.h before enabling wasapi. 2017-08-21 11:17:38 -07:00
Ryan C. Gordon
f5a38f234b x11: specify event mask for buttons when grabbing pointer (thanks, Stas!).
This fixes a strange corner case (notes appended below), and should be
safe to do anyhow.

Fixes Bugzilla #3674.

"I did more tests.
It appears the bug only happens if there is
another window on the screen that has "always
on top" property. For me it is xawtv - it is
always opened in a screen corner. Closing
xawtv or removing "always on top" property
from it makes the problem to go away.
Plus, it doesn't appear like the buttons are
not delivered at all. It appears that instead
the button presses are delivered on some mouse
positions, but not delivered when you move the
mouse to other part of the window... So this is
really weird and is likely somewhere deep in the
Xorg.
Maybe somehow it happens that the cursor is
actually above the xawtv window, but, because
my app uses grab, it is not visible there, and
in that case the events are not delivered to
my app?
But with my patch the button events are
always delivered flawlessly, it seems.

Hmm, and that indeed seems to explain my problem:
if the mask is set properly and my app uses
grab, then, even if the mouse is above some
other window, the events would still be delivered
to the grabbing app, which is what actually wanted
because my app uses relative mouse mode, so it
doesn't know the pointer can cross some other window
(my app draws the pointer itself).
So my current theory is that my patch only enforces
the mouse grab, which otherwise can be tricked by
some other window preventing the button events
delivery (but motion events are still delivered
via xinput2, which makes it all look very obscure)."
2017-08-21 00:42:06 -04:00
Ryan C. Gordon
5574b43376 x11: Pass generic XEvents by pointer instead of copying to stack for XInput2. 2017-07-31 12:22:18 -04:00
Ryan C. Gordon
01e0d8fc85 opengl: Add support for [GLX|WGL]_ARB_create_context_robustness.
This patch was originally written by Marc Di Luzio for glX and enhanced by
Maximilian Malek for WGL, etc. Thanks to both of you!

Fixes Bugzilla #3643.
Fixes Bugzilla #3735.
2017-08-19 15:02:03 -04:00
Sam Lantinga
18a6538507 add missing os/2 apientry defs to SDL_opengl.h 2017-08-19 11:15:58 -07:00
Sam Lantinga
30d554e3d6 Fixed building SDL applications with Visual Studio and the clang toolset
Also fixed building 64-bit SDL with clang. 32-bit doesn't build because of the inline assembly for C runtime support.
2017-08-19 03:07:44 -07:00
Sam Lantinga
12d33b33ca Fixed building with Visual Studio 2017 and the Windows XP toolset if _USING_V110_SDK71_ accidentally gets undefined 2017-08-19 02:23:50 -07:00
Sam Lantinga
148ac5b3cf Added Matt Styles' tutorial on building SDL for Android with Visual Studio 2017-08-19 00:27:11 -07:00
Alex Szpakowski
3d0f521be5 iOS 10: Work around screen bounds orientation bug. Fixes bugs #3465 and #3505. 2017-08-18 23:23:30 -03:00
Sam Lantinga
2dc5d32fab Updated version to 2.0.6 2017-08-18 18:16:37 -07:00
Sam Lantinga
bcf0e07107 Added WASAPI audio target to autoconf build process 2017-08-18 17:29:44 -07:00
Ryan C. Gordon
5c4a45f1cc cmake: some iOS fixes (don't link to Cocoa or Carbon frameworks).
Fixes Bugzilla #3625.
2017-08-18 20:25:14 -04:00
Ryan C. Gordon
f4011bf081 cmake: added a FIXME for later.
Have to figure out what cmake version fixed this and bump the minimum to that.
2017-08-18 20:00:29 -04:00
Ryan C. Gordon
8816bb08f9 configure: Apple platforms don't need to build with -fpascal-strings anymore. 2017-08-18 19:53:40 -04:00
Ryan C. Gordon
677b2e5713 configure: mac and iOS should compile core/unix/*.c
macOS currently needs this if you build with X11 support. iOS doesn't
(currently), but it doesn't hurt to compile it in case we do something
Unixy on that platform later on.
2017-08-18 19:52:58 -04:00
Ryan C. Gordon
f75caa2ff6 cmake: Fix building for macOS with Xcode generator (thanks, dungaipara!).
Fixes Bugzilla #3625.
2017-08-18 18:52:25 -04:00
Ryan C. Gordon
e3e6b4fd35 audio: better docs on conversion APIs, error if not init'd (thanks, Simon!).
Fixes Bugzilla #3662.
2017-08-18 16:52:19 -04:00
Ozkan Sezer
500378eb52 Add atomics for Watcom/x86 as inline asm
Partially fixes Bugzilla #3758.
2017-08-18 16:35:55 -04:00
Ozkan Sezer
c68d3ab785 Watcom supports __FUNCTION__ identifier (and surely not __PRETTY_FUNCTION__)
Partially fixes Bugzilla #3758.
2017-08-17 21:35:46 -04:00
Ozkan Sezer
bdb7bfd79b SDL_assert.h: add inline asm (int $3) as SDL_TriggerBreakpoint for Watcom/x86
(also disable SIGTRAP case to !watcom, because watcom doesn't have SIGTRAP.)

Partially fixes Bugzilla #3758.
2017-08-17 21:32:42 -04:00
Ozkan Sezer
fbda68ea7b SDL_endian.h: add SDL_Swap16 and SDL_Swap32 for Watcom/x86 as inline asm
Partially fixes Bugzilla #3758.
2017-08-17 21:32:00 -04:00
Ozkan Sezer
eccbe366bc SDL_bits.h: add __builtin_clz equivalent for Watcom/x86 as inline asm
Partially fixes Bugzilla #3758.
2017-08-17 21:30:29 -04:00
Ryan C. Gordon
7a9b9e05e0 SDL_mouse.c doesn't need default_cursor.h. 2017-08-17 20:47:16 -04:00
Ryan C. Gordon
47beda9767 cmake: add core/unix sources to the build.
Fixes Bugzilla #3757.
2017-08-17 15:44:47 -04:00
Ryan C. Gordon
00905c98be filesystem: Patched to compile on QNX. 2017-08-17 03:22:44 -04:00
Ryan C. Gordon
e50d3cdf8e filesystem: QNX should use SDL_LoadFile() instead of rolling it from scratch. 2017-08-17 02:58:46 -04:00
Ryan C. Gordon
c13c45c7be qnx: Implemented SDL_GetBasePath(). 2017-08-17 01:25:48 -04:00
Ryan C. Gordon
adecda5080 cpuinfo: Add SDL_HasNEON() support for ARM-based QNX. 2017-08-16 21:31:03 -04:00
Alex Szpakowski
efc43a1d88 More cleanup of the iOS keyboard demo. 2017-08-15 23:00:54 -03:00
Alex Szpakowski
a0a09f646c Improve iOS keyboard demo code a bit. 2017-08-15 22:53:57 -03:00
Alex Szpakowski
2e4248ed44 Address a compiler warning. 2017-08-15 18:29:47 -03:00
Ryan C. Gordon
c7b4f2b92e rwops: Fixed 64-bit file i/o on QNX. 2017-08-15 16:30:26 -04:00
Sam Lantinga
e83764a5e0 Fixed bug 2137 - SDL Message Boxes don't cope with fixed width fonts (in windows at least)
Pegasus Epsilon

With the system dialog font set to Arial or Tahoma or another variable-width font, everything works just as expected. When using a fixed-width font, like Courier or DejaVu Sans Mono, the text gets cut off. Example screenshots attached.
2017-08-14 23:45:06 -07:00
Sam Lantinga
fb14cb7425 Fixed bug 2263 - Event timestamp members are undocumented
Charles Huber

The event timestamp members should be documented to indicate their meaning and units.

Currently the timestamps are populated using SDL_GetTicks() in SDL_PushEvent() in SDL_events.c.
2017-08-14 21:40:40 -07:00
Sam Lantinga
1d0584d558 Hopefully fixed Wayland build 2017-08-14 21:35:16 -07:00
Sam Lantinga
a4cfa93670 Fixed bug 2293 - Precise scrolling events
Martijn Courteaux

I implemented precise scrolling events. I have been through all the folders in /src/video/[platform] to implement where possible. This works on OS X, but I can't speak for others. Build farm will figure that out, I guess. I think this patch should introduce precise scrolling on OS X, Wayland, Mir, Windows, Android, Nacl, Windows RT.

The way I provide precise scrolling events is by adding two float fields to the SDL_MouseWheelScrollEvent datastructure, called "preciseX" and "preciseY". The old integer fields "x" and "y" are still present. The idea is that every platform specific code normalises the scroll amounts and forwards them to the SDL_SendMouseWheel function. It is this function that will now accumulate these (using a static variable, as I have seen how it was implemented in the Windows specific code) and once we hit a unit size, set the traditional integer "x" and "y" fields.

I believe this is pretty solid way of doing it, although I'm not the expert here.

There is also a fix in the patch for a typo recently introduced, that might need to be taken away by the time anybody merges this in. There is also a file in Nacl which I have stripped a horrible amount of trailing whitespaces. (Leave that part out if you want).
2017-08-14 21:28:04 -07:00
Sam Lantinga
72b195d27c Fixed Android build warning 2017-08-14 20:45:14 -07:00
Sam Lantinga
04e76499ea Fixed build warning 2017-08-14 20:37:07 -07:00
Sam Lantinga
e086a1c183 Added missing files from the previous commit 2017-08-14 20:25:53 -07:00
Sam Lantinga
fb835f9e3b Fixed bug 2330 - Debian bug report: SDL2 X11 driver buffer overflow with large X11 file descriptor
manuel.montezelo

Original bug report (note that it was against 2.0.0, it might have been fixed in between):  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733015

--------------------------------------------------------
Package: libsdl2-2.0-0
Version: 2.0.0+dfsg1-3
Severity: normal
Tags: patch

I have occasional crashes here caused by the X11 backend of SDL2. It seems to
be caused by the X11_Pending function trying to add a high number (> 1024)
file descriptor to a fd_set before doing a select on it to avoid busy waiting
on X11 events. This causes a buffer overflow because the file descriptor is
larger (or equal) than the limit FD_SETSIZE.

Attached is a possible workaround patch.

Please also keep in mind that fd_set are also used in following files which
may have similar problems.

src/audio/bsd/SDL_bsdaudio.c
src/audio/paudio/SDL_paudio.c
src/audio/qsa/SDL_qsa_audio.c
src/audio/sun/SDL_sunaudio.c
src/joystick/linux/SDL_sysjoystick.c


--------------------------------------------------------

On Tuesday 24 December 2013 00:43:13 Sven Eckelmann wrote:
> I have occasional crashes here caused by the X11 backend of SDL2. It seems
> to be caused by the X11_Pending function trying to add a high number (>
> 1024) file descriptor to a fd_set before doing a select on it to avoid busy
> waiting on X11 events. This causes a buffer overflow because the file
> descriptor is larger (or equal) than the limit FD_SETSIZE.


I personally experienced this problem while hacking on the python bindings
package for SDL2 [1] (while doing make runtest). But it easier to reproduce in
a smaller, synthetic testcase.
2017-08-14 20:22:19 -07:00