Commit graph

10374 commits

Author SHA1 Message Date
Sam Lantinga
d8e2ed22db Moved Android patch note into the Android section 2018-02-24 09:09:20 -08:00
Sam Lantinga
507975a360 Fixed bug 4092 - CMake support for building everything in the "test" directory
Eric Wasylishen

Patch to support building the tests with cmake.
Disabled by default, use: "cmake .. -DSDL_TEST=YES" to enable the tests.

Tested on macOS 10.13 with the ninja, makefile, and Xcode generators, and Windows 10 with the Visual Studio 2017 generator.
2018-02-24 08:59:58 -08:00
Sam Lantinga
739eb4b610 Fixed bug 4091 - Undefined references to Android audio functions when SDL_AUDIO_DISABLED is on
Manuel Sabogal

If SDL is compiled with the Audio subsystem disabled there are some undefined references to the functions ANDROIDAUDIO_ResumeDevices and ANDROIDAUDIO_PauseDevices in the file src/video/android/SDL_androidevents.c.
2018-02-24 08:58:22 -08:00
Sam Lantinga
c71be88f69 Added patch note for Ryan's work 2018-02-24 08:42:04 -08:00
Sam Lantinga
5e85fbd95c Added missing file to tvOS build 2018-02-24 08:40:30 -08:00
Sam Lantinga
631aa4081c Fixed MinGW-w64 build 2018-02-24 08:23:44 -08:00
Sam Lantinga
d46e905a81 Updated documentation with API changes in SDL 2.0.8 2018-02-24 08:18:09 -08:00
Brandon Schaefer
0a93dbd9eb Backout the vulkan change in cd67e676bca7 breaks Mir builds 2018-02-23 19:12:04 -05:00
Brandon Schaefer
57b08e341c 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
b014335598 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
7d719ba6da android: apparently they fixed this header at some point. 2018-02-21 22:35:17 -05:00
Ryan C. Gordon
72332a396f vulkan: Possibly fix a compiler warning (-Wstrict-prototypes).
--HG--
extra : rebase_source : 55a8174bb2c9ddf257373ed4034284e9a77b5f51
2018-02-21 22:27:09 -05:00
Ryan C. Gordon
8d4ba86657 wasapi: let Windows do the resampling for us if possible.
--HG--
extra : histedit_source : d3b8d8c50b1158ecacd48fdd35090ffe24d61c81
2018-02-21 21:34:06 -05:00
Ryan C. Gordon
a636f0a41a wasapi: fixed typo in an assert message.
--HG--
extra : histedit_source : 50720952e1131985085ddf58c115123988472fb1
2018-02-21 21:34:35 -05:00
Ryan C. Gordon
0b9aeb9c4c windows: added WIN_IsWindows7OrGreater().
--HG--
extra : histedit_source : cf4acefd794427347dd94a72cb546b4d1da7022c
2018-02-21 21:36:10 -05:00
Ethan Lee
b55bb6ff48 Use new XInput mapping for Win10+ (Bugzilla #3960) 2018-02-21 12:42:30 -05:00
Mark Callow
f410bef6cc 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
7d30836466 Fixed bug 4034 - Don't include _DllMainCRTStartup() if SDL_STATIC_LIB is defined. 2018-02-21 09:40:47 -08:00
Sam Lantinga
45d40a3639 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
fe063ee3f5 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
01e66afef6 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:
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
03495f9a7f 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
c167d6f645 yuv: patched to compile. 2018-02-17 20:18:48 -05:00
Ryan C. Gordon
86cd44db04 yuv: fixed variable declaration shadowing warnings.
Fixes Bugzilla #4062.

--HG--
extra : rebase_source : 3bb1d5bb198a2f9ec55ac2006569e80205e4a119
2018-02-17 20:10:13 -05:00
Ryan C. Gordon
727e213f83 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.

--HG--
extra : amend_source : fd1141d8f1df793c80561e0de05a5c7a15950568
2018-02-17 18:30:21 -05:00
Ryan C. Gordon
5171b96a96 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.

--HG--
extra : rebase_source : d83a60e93030214968dfad99d54fb9c79a1fa97a
2018-02-16 14:56:28 -05:00
Sam Lantinga
adfd973733 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
15e411aedf bug #3739: handle %lu, %li and %ld in SDL_SetError. 2017-10-29 14:15:00 +03:00
Sam Lantinga
085196902a Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition 2018-02-13 22:58:20 -08:00
sezero
51dfb3895d fix building SDL_audiotypecvt.c with gcc < 4.0 2018-02-12 10:47:00 +03:00
sezero
d9c8979193 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
f5cc40c14d 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
b9964632c1 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
12d8a48c9e Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup() 2018-02-13 08:13:29 -08:00
Sam Lantinga
3460188642 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
79bd45a81e Fixed bug 4081 - sdlchecks.cmake: typo introduced by rev11848 breaks building with wayland support 2018-02-13 07:59:45 -08:00
sezero
d899c0d822 kill C99'ism in SDL_waylandvulkan.c 2018-02-12 10:00:00 +03:00
Sam Lantinga
470afa6b34 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
af61cbf39c 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
a8772588a2 ISO C correct fix for casting void* to function pointer 2018-02-11 15:29:36 -08:00
Ryan C. Gordon
87121511c9 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.

--HG--
extra : rebase_source : 6dd9a59b02023162ab0faa8c7c300d881fdcfcf9
2018-02-11 18:16:01 -05:00
Sam Lantinga
ecb6062875 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
6534481645 Fixed compile warning 2018-02-09 16:31:57 -08:00
Sam Lantinga
06c2bf816a Fixed compiler warning on Android 2018-02-09 16:01:11 -08:00
Sam Lantinga
cef043b163 Windows Phone 8.0 is no longer supported 2018-02-09 08:03:03 -08:00
Sam Lantinga
76f32ce55f Fixed min/max window size handling for borderless resizable windows 2018-02-08 18:07:14 -08:00
sezero
5f0540416f add SDL_log10 and SDL_log10f to include and dynapi 2018-02-08 17:07:47 +03:00
Sam Lantinga
2ad41155fb 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
3fdcaa213e Allow Android Java shim to be built as an AAR 2018-01-09 19:11:34 -05:00
Sam Lantinga
d98cc75574 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