Commit graph

6817 commits

Author SHA1 Message Date
Ryan C. Gordon
f4b87c2bcb vulkan: Include a copy of vulkan.h and vk_platform.h.
Now we can provide Vulkan support in the build even if the build box doesn't
have a Vulkan SDK, since we dynamically link to the library anyhow.

--HG--
extra : rebase_source : f4972489a15b276f65ea65c077172fdcbbe3420a
2017-08-27 23:25:12 -04:00
Ryan C. Gordon
a566435db1 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.

--HG--
extra : rebase_source : cb3bb332146125366b5242c0d7444f44638733d9
extra : amend_source : c72ebb6d3a92efc3fdd085ce3b6d4b1d7f573cc9
2017-08-27 22:15:57 -04:00
Sam Lantinga
0ff15ac41b Fixed bug 3710 - SDL_OpenAudio(desired, obtained) doesn't update desired's size when obtained is NULL
David Ludwig

I've created a new set of patches.  I am happy to create more, if it would help.

One version only copies 'size'.

A second version copies both 'size' and 'silence'.  When looking over the documentation for SDL_OpenAudio in SDL_audio.h, it mentioned that both 'size' and 'silence' were things that SDL_OpenAudio would calculate.

Regarding *both* patches, I did notice that SDL 1.2 appears to have always modified desired's size and silence fields.  The SDL wiki, at https://wiki.libsdl.org/SDL_OpenAudio#Remarks , does note:
2017-08-27 19:10:30 -07:00
Sam Lantinga
b964d759ca Fixed bug 3724 - Allow Angle Static Link
Carlos

We would like to add a switch (define) that allows us to compile Angle statically with SDL. That is, getting rid of the OpenGL DLL. Usually you need OpenGL to be loaded dynamically as DLL because implementation is provided by the system but no need with Angle.

Only 2 files need modification and it shouldn't affect current behaivor:
include/SDL_egl.h and src/video/SDL_egl.c, as in here

https://github.com/native-toolkit/sdl/pull/10/files

The flag name could be SDL_VIDEO_STATIC_ANGLE (instead of NATIVE_TOOLKIT_STATIC_ANGLE) as discussed here https://github.com/native-toolkit/sdl/pull/10

We have tested this with both Windows and UWP, using NME engine (https://github.com/haxenme/nme).

Releated issue: https://bugzilla.libsdl.org/show_bug.cgi?id=1820
2017-08-27 19:05:57 -07:00
Sam Lantinga
1bf8d4ca37 SDL_dynapi.c: add missing SDLCALL to macros. 2017-08-27 18:53:30 -07:00
Sam Lantinga
af31e7aab5 Swapped conditional arguments for standard SDL readability 2017-08-27 18:52:43 -07:00
Sam Lantinga
279b03e2c4 SDL_dynapi.h: revert commit a6da0a386f68 in order to enable dynapi
[ optional ]
2017-08-27 18:49:36 -07:00
Sam Lantinga
c51aa7eba0 SDL_dynapi_procs.h: adjust SDL_CreateThread for os/2 2017-08-27 18:49:11 -07:00
Sam Lantinga
c29d430656 Fixed bug 2266 - please add notifications for clipboard updates on Android
Sylvain

Hi! here's a patch for that with two class loaded regarding API level.
Test both case : before API 11 and after.

I also remove now unused GetSystemServiceFromUIThread() and minor clean-up (haptic warning prototype).
2017-08-27 18:43:52 -07:00
Patrice Mandin
0b51b163ee Add support for GameSir G4s 2017-08-26 21:20:20 +02:00
Ryan C. Gordon
dd32ce4d69 windows: Attempt to make Visual Studio not hardcode a call to memset(). 2017-08-25 15:16:39 -04:00
Ryan C. Gordon
ae2ce839f8 x11: Patched to compile with DEBUG_XEVENTS defined. 2017-08-25 12:51:42 -04:00
Ryan C. Gordon
e1c35f01fb OS/2: fixed inverted logic bug (thanks, Ozkan!). 2017-08-25 12:27:18 -04:00
Ryan C. Gordon
abe59c0808 OS/2: proper fix for dynapi (thanks, Ozkan!). 2017-08-25 11:31:12 -04:00
Ethan Lee
6fb747472a Fix KHR_no_error support 2017-08-24 22:57:42 -04:00
Ryan C. Gordon
b82bd0bd37 opengl: add support for GL_KHR_no_error.
This is completely untested!

Fixes Bugzilla #3721.
2017-08-24 21:30:53 -04:00
Ryan C. Gordon
28e9e6c28f dynapi: fill in OS/2 loading code (thanks, Ozkan!).
Partially fixes Bugzilla #3765.
2017-08-22 15:50:39 -04:00
Brandon Schaefer
d4564ef4f5 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
0e04e04c4d kmsdrm: Remove moved file 2017-08-21 17:22:00 -07:00
Brandon Schaefer
1b70bac91f kmsdrm: Cleanup unused headers, rename SDL_kmsdrmevents_c.h -> SDL_kmsdrmevents.h
--HG--
rename : src/video/kmsdrm/SDL_kmsdrmevents_c.h => src/video/kmsdrm/SDL_kmsdrmevents.h
2017-08-21 17:20:50 -07:00
Sam Lantinga
897ce9c889 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
4c41e57f57 SDL_dynapi.h: disable dynapi for os/2. 2017-08-21 13:00:58 -07:00
Sam Lantinga
fd5eb6d1f0 SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM(). 2017-08-21 13:00:40 -07:00
Sam Lantinga
8a1684a382 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
Ryan C. Gordon
9eaf62c483 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
157f916a11 x11: Pass generic XEvents by pointer instead of copying to stack for XInput2. 2017-07-31 12:22:18 -04:00
Ryan C. Gordon
4e99081584 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.

--HG--
extra : rebase_source : 4339a25375897f157f59719876086f84acc10aad
2017-08-19 15:02:03 -04:00
Sam Lantinga
e9ee7f6f0d 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
Alex Szpakowski
1fe83fd6eb iOS 10: Work around screen bounds orientation bug. Fixes bugs #3465 and #3505. 2017-08-18 23:23:30 -03:00
Sam Lantinga
d345de0831 Updated version to 2.0.6 2017-08-18 18:16:37 -07:00
Sam Lantinga
d5c138b4f0 Added WASAPI audio target to autoconf build process 2017-08-18 17:29:44 -07:00
Ryan C. Gordon
b44189aee2 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
29941a2a2b Add atomics for Watcom/x86 as inline asm
Partially fixes Bugzilla #3758.
2017-08-18 16:35:55 -04:00
Ozkan Sezer
0216e916d3 Watcom supports __FUNCTION__ identifier (and surely not __PRETTY_FUNCTION__)
Partially fixes Bugzilla #3758.
2017-08-17 21:35:46 -04:00
Ryan C. Gordon
0e7b72b155 SDL_mouse.c doesn't need default_cursor.h. 2017-08-17 20:47:16 -04:00
Ryan C. Gordon
f07a0b3b5d filesystem: Patched to compile on QNX. 2017-08-17 03:22:44 -04:00
Ryan C. Gordon
d5066e8edb filesystem: QNX should use SDL_LoadFile() instead of rolling it from scratch. 2017-08-17 02:58:46 -04:00
Ryan C. Gordon
edeabbcec9 qnx: Implemented SDL_GetBasePath(). 2017-08-17 01:25:48 -04:00
Ryan C. Gordon
24ac42f8d9 cpuinfo: Add SDL_HasNEON() support for ARM-based QNX.
--HG--
extra : rebase_source : 74fc0cc3f24a3cea51d5217d226f4c3d4de5c9d1
2017-08-16 21:31:03 -04:00
Alex Szpakowski
c396ee0c3b Improve iOS keyboard demo code a bit. 2017-08-15 22:53:57 -03:00
Alex Szpakowski
30b48f3da5 Address a compiler warning. 2017-08-15 18:29:47 -03:00
Ryan C. Gordon
cd85821b16 rwops: Fixed 64-bit file i/o on QNX. 2017-08-15 16:30:26 -04:00
Sam Lantinga
e2b4d5eb8c 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
be8eaab7ee Hopefully fixed Wayland build 2017-08-14 21:35:16 -07:00
Sam Lantinga
cd4cfd2c89 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
a2c23256eb Fixed Android build warning 2017-08-14 20:45:14 -07:00
Sam Lantinga
5f531376c2 Fixed build warning 2017-08-14 20:37:07 -07:00
Sam Lantinga
8109ab9485 Added missing files from the previous commit 2017-08-14 20:25:53 -07:00
Sam Lantinga
87ea96c003 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
Sam Lantinga
e97f14a10e Fixed compiler warnings 2017-08-14 20:07:30 -07:00