Commit Graph

10368 Commits

Author SHA1 Message Date
Sam Lantinga
2ebbb5f3c2 Updated documentation with API changes in SDL 2.0.8 2018-02-24 08:18:09 -08:00
Brandon Schaefer
149c55a3fd Backout the vulkan change in cd67e676bca7 breaks Mir builds 2018-02-23 19:12:04 -05:00
Brandon Schaefer
1e7c6e97ff mir: Disable Mir by default as Mir supports Wayland clients
Also remove enabling VK support for Mir
2018-02-23 11:24:26 -05:00
Ryan C. Gordon
5117e52a11 Backed out changeset bd976b7b2b43
Apparently this still triggers a compiler warning, have to dig further.
2018-02-21 22:53:52 -05:00
Ryan C. Gordon
b32b2a680c android: apparently they fixed this header at some point. 2018-02-21 22:35:17 -05:00
Ryan C. Gordon
3dbbb39132 vulkan: Possibly fix a compiler warning (-Wstrict-prototypes). 2018-02-21 22:27:09 -05:00
Ryan C. Gordon
7d92099fee wasapi: let Windows do the resampling for us if possible. 2018-02-21 21:34:06 -05:00
Ryan C. Gordon
b3d32bb003 wasapi: fixed typo in an assert message. 2018-02-21 21:34:35 -05:00
Ryan C. Gordon
73e151fc52 windows: added WIN_IsWindows7OrGreater(). 2018-02-21 21:36:10 -05:00
Ethan Lee
9b4912815b Use new XInput mapping for Win10+ (Bugzilla #3960) 2018-02-21 12:42:30 -05:00
Mark Callow
220ef7f3b9 Fix high-dpi support on macOS and simplify it and iOS variant.
The detault drawableSize for a CAMetalLayer is its bounds x its scale.
So it is sufficient to set the *layer's* scale to the desired value.
2018-02-21 09:58:21 -08:00
Sam Lantinga
986b771c30 Fixed bug 4034 - Don't include _DllMainCRTStartup() if SDL_STATIC_LIB is defined. 2018-02-21 09:40:47 -08:00
Sam Lantinga
a78f8d9231 Fixed bug 4088 - Fix Metal link errors with test programs in SDLTest.xcodeproj
Eric Wasylishen

The following patch adds Metal.framework to the "link binary with libraries" section of each test program, with "status" set to "optional", which fixes link errors on all of the test programs. I'm not sure if this is a correct fix - the fact that this was necessary might indicate the static SDL2.a library has a hard dependency on Metal.framework (?) - but it gets the test programs working in Xcode again.

It also adds testyuv_cvt.c to the testoverlay2 target, fixing a link error.
2018-02-20 09:04:31 -08:00
Sam Lantinga
c6bc5d1904 Actually, this is needed for building with Visual Studio with both /MT and /MD.
With the previous change, I get:
1>     Creating library C:\projects\SDL\VisualC\Win32\Debug\SDL2.lib and object C:\projects\SDL\VisualC\Win32\Debug\SDL2.exp
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
2018-02-18 09:09:56 -08:00
Sam Lantinga
f6a5126a8f Fixed bug 4034 - Do we really need _DllMainCRTStartup() in every Windows build?
Andreas Falkenhahn

In src/SDL.c there is this code:

_DllMainCRTStartup(HANDLE hModule,

...

The comment says that this is needed on Watcom C for some reason but why is it included then when building with Visual C as well? Shouldn't it be only included when compiling on Watcom C then?

I'm asking because this code caused me a lot of headaches because I'm building a DLL that contains SDL and I link using /MT and the _DllMainCRTStartup() symbol obviously led to lots of trouble but it wasn't clear to me where the problem was because all I got from the linker was:

LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

So I had to got through each and every object to see what the culprit was. See here for the full story:
https://stackoverflow.com/questions/25067151/lnk2019-unresolved-external-symbol-main-referenced-in-function-tmaincrtstar/48177067#48177067

So if it isn't necessary on Visual C, please just leave that symbol out on Visual C so that it no longer leads to any trouble. Thanks.
2018-02-18 08:57:01 -08:00
Ryan C. Gordon
2c26c27543 pthread: fix error code checks (thanks, Andreas!).
Most pthread functions return 0 on success and non-zero on error, but those
errors might be positive or negative, so checking for return values in the
Unix style, where errors are less than zero, is a bug.

Fixes Bugzilla #4039.
2018-02-17 23:57:57 -05:00
Ryan C. Gordon
b3687328f2 yuv: patched to compile. 2018-02-17 20:18:48 -05:00
Ryan C. Gordon
002b5892bb yuv: fixed variable declaration shadowing warnings.
Fixes Bugzilla #4062.
2018-02-17 20:10:13 -05:00
Ryan C. Gordon
3050b440f8 pulseaudio: Just read/dump captured data in FlushCapture.
Apparently pa_stream_flush() doesn't work as expected:

https://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013328.html

Fixes Bugzilla #4087.
2018-02-17 18:30:21 -05:00
Ryan C. Gordon
3e76436bcf video: put a spinlock around a global linked list.
This should only contend if you're allocating or freeing surfaces from
multiple threads at once, and then just for a short time.

Fixes Bugzilla #4084.
2018-02-16 14:56:28 -05:00
Sam Lantinga
f8023f1dd4 Fixed bug 4085 - X11: Allow configuring _NET_WM_BYPASS_COMPOSITOR through SDL hints
Callum McGing

This patch allows the user to disable the behaviour that blocks the compositor through a new hint: SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR. This allows tools or other windowed applications to behave properly under KWin.
2018-02-16 10:23:10 -08:00
Ozkan Sezer
7eaf8603c7 bug #3739: handle %lu, %li and %ld in SDL_SetError. 2017-10-29 14:15:00 +03:00
Sam Lantinga
e465610bd4 Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition 2018-02-13 22:58:20 -08:00
sezero
c181d919af fix building SDL_audiotypecvt.c with gcc < 4.0 2018-02-12 10:47:00 +03:00
sezero
7287068da5 revert the recent typecast assignment changes (see bug #4079)
also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h  into generic function
pointer typedefs.
2018-02-12 17:00:00 +03:00
Sam Lantinga
c938610654 Fixed bug 4027 - CheckLibSampleRate macro in sdlchecks.cmake never defines HAVE_LIBSAMPLERATE{,_SHARED}, so they're always reported as disabled by MESSAGE_TESTED_OPTION macro in macros.cmake 2018-02-13 13:25:59 -08:00
Sam Lantinga
9d193f9109 Fixed bug 3920 - IBus not work with SDL 2.0.7
cjacker

After updating from 2.0.5 to 2.0.7, Ibus not work anymore(fcitx still works).

Compare with 2.0.5, there are two issues in SDL_ibus.c.

1, SetupConnection always return SDL_FALSE in 2.0.7.

2, 'SetCapabilities' method should be called on 'ibus_conn'.

Patch attached.
2018-02-13 08:15:39 -08:00
Sam Lantinga
add5711436 Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup() 2018-02-13 08:13:29 -08:00
Sam Lantinga
eb6e89e3fd Fixed bug 3950 - Don't always call dbus_shutdown in SDL_DBus
Alexander Larsson

dbus_shutdown() is a debug feature which closes all global resources in the dbus library. Calling this should be done by the app, not a library, because if there are multiple users of dbus in the process then SDL could shut it down even though another part is using it.

For example, i had an issue with this in mGBA, which uses both Qt and SDL, both using libdbus. I had a session bus, but no system bus (this was in a flatpak sandbox), and when SDL_DBus_Init() failed to init the system bus it called dbus_shudown() and continued on. This caused issues for Qt when running due to its session bus connections having disappeared beneath it.
2018-02-13 08:07:52 -08:00
Sam Lantinga
fccd7b4b9d Fixed bug 4081 - sdlchecks.cmake: typo introduced by rev11848 breaks building with wayland support 2018-02-13 07:59:45 -08:00
sezero
42a6c0d693 kill C99'ism in SDL_waylandvulkan.c 2018-02-12 10:00:00 +03:00
Sam Lantinga
6fcd640364 On Android show the system UI when an SDL window is windowed, hide the system UI when it's fullscreen, like we do on iOS.
We're increasing the Android SDK minimum version to API 19, this doesn't increase the minimum target API, which is API 14.
2018-02-11 18:23:37 -08:00
Sam Lantinga
f0b206ee06 Fixed bug 4075 - configury adds Metal.framework to linkage even if it is not available
Ozkan Sezer

Configury adds Metal.framework to linkage even if it is not available.
My solution is setting enable_render_metal to no when Metal.framework
is not found
2018-02-11 17:25:51 -08:00
Sam Lantinga
d89ff59577 ISO C correct fix for casting void* to function pointer 2018-02-11 15:29:36 -08:00
Ryan C. Gordon
e3528b63d0 vulkan: Fix assignment of vkGetInstanceProcAddr on Windows.
"*(void**)pfn = LoadAddress()" would cast the NULL pointer in pfn to a
void**, and then dereference it, which wasn't what we wanted. Replaced with
a clearer cast operation.
2018-02-11 18:16:01 -05:00
Sam Lantinga
a9196a5280 Fixed bug 4073 - Unquoted Unicode argument parsing broken on Windows due to incorrect usage of SDL_isspace() 2018-02-10 12:43:11 -08:00
Sam Lantinga
8a477f57e7 Fixed compile warning 2018-02-09 16:31:57 -08:00
Sam Lantinga
7ceef7fd16 Fixed compiler warning on Android 2018-02-09 16:01:11 -08:00
Sam Lantinga
114454d370 Windows Phone 8.0 is no longer supported 2018-02-09 08:03:03 -08:00
Sam Lantinga
dec734e510 Fixed min/max window size handling for borderless resizable windows 2018-02-08 18:07:14 -08:00
sezero
4afad75308 add SDL_log10 and SDL_log10f to include and dynapi 2018-02-08 17:07:47 +03:00
Sam Lantinga
f1e0f8998a Fixed bug 4021 - Android, hard-coded Keycode value
Sylvain

There is an hard-coded keycode value in SDLActivity.java
2018-02-07 15:10:50 -08:00
Cole Campbell
29b9c44a4b Allow Android Java shim to be built as an AAR 2018-01-09 19:11:34 -05:00
Sam Lantinga
1b533d9836 Fixed bug 4054 - Raspberry Pi refresh rate detection
Viacheslav Slavinsky

SDL_rpivideo driver has 60 frames per second hardcoded in it, this is a problem for games that need to keep pace using VSYNC. I believe that I have found a solution to this. It is based on code in tvservice.c in rpi userland:

a1b89e91f3/host_applications/linux/apps/tvservice/tvservice.c (L433)
2018-02-07 15:05:30 -08:00
Ethan Lee
ff50cc0958 SDL_log10 2018-01-17 11:53:09 -05:00
"Guillermo A. Amaral"
5f5aae7d8d Set rpath instead of changing environment for RPi
Credit goes to Adrian Perez de Castro for the improvement.

Signed-off-by: Guillermo A. Amaral <g@maral.me>
2018-02-07 14:12:26 -08:00
Sam Lantinga
20bc9a6dca Fixed bug 4060 - Alternative DualShock 4 v2 controller GUID
ayer.3d

I have a DualShock 4 v2 controller with a GUID that's not in the database. There is an existing GUID that is almost identical, with the only difference that I can tell being the reported version string (mine being 8001, database is 8100).

Existing GUID: 050000004c050000cc09000000810000
     New GUID: 050000004c050000cc09000001800000

When connected via USB, the GUID matches an existing entry: 030000004c050000cc09000011810000
2018-02-07 14:07:54 -08:00
Sam Lantinga
4d92f16e26 Description: fix installation of shared library for Android
Author: Boris Pek <tehnick-8@yandex.ru>
Last-Update: 2018-01-10
2018-02-07 14:03:24 -08:00
Ryan C. Gordon
0efdf226de wayland: Add support for xdg-shell protocol (unstable v6).
This is meant to be the desktop-enhanced version of wl_shell. Right now we
just match what the existing wl_shell code does, but there are other areas of
functionality available to us now, that we can fill in later.

This uses the "unstable" API, since this is what ships in Ubuntu 17.10 (as
part of Wayland 1.10), but Wayland 1.12 promotes this to stable with extremely
minor changes. We will add support for the stable version when it makes sense
to do so.
2018-02-07 13:13:55 -05:00
Ryan C. Gordon
adba52788c cmake: Minor cleanup (reuse a string we already calculated). 2018-02-07 13:07:59 -05:00