Commit graph

11215 commits

Author SHA1 Message Date
Sam Lantinga
a0acea5bcc Fixed the DirectFB renderer not being enabled in autoconf builds 2018-08-27 11:51:05 -07:00
Sam Lantinga
563e2c2d71 Update the cursor clipping each frame, in case it was stolen by another application. 2018-08-26 20:37:23 -07:00
Sam Lantinga
3e67665e66 Only reset the clip rect if it's currently the rect we previously clipped.
This prevents us from clearing the clip rect globally when another application has set it.

There's also an experimental change to regularly update the clip rect for a window defensively, in case someone else has reset it. It works well, but I don't know if it's cheap enough to call as frequently as it would be called now, and might have other undesirable side effects.

Also fixed whitespace and SDL coding style
2018-08-26 10:34:23 -07:00
Sam Lantinga
8dab95ee3d Implement SDL_HapticStopEffect on Android (thanks Rachel!) 2018-08-24 10:41:57 -07:00
Jeremy Ong
69441bd02e vulkan: SDL_Vulkan_GetInstanceExtensions should accept a NULL window.
Fixes Bugzilla #4235.
2018-08-24 09:49:48 -04:00
Sam Lantinga
4ab7b3d88b Implemented SDL_GetDisplayOrientation() on Android (thanks Rachel!) 2018-08-23 14:05:25 -07:00
Ryan C. Gordon
71439d04cb cmake: add sensor subsystem to the build.
--HG--
extra : amend_source : 1bf21ac4f6adc8b9b631b6e45b46aef7640f3b9c
2018-08-23 14:32:30 -04:00
Sam Lantinga
bd663e048e Added documentation for additional Android sensors 2018-08-23 10:51:54 -07:00
Thomas Perl
485e0cf698 Fix "unresponsible application" issues in Wayland
Polling without wl_display_flush() never responds to ping requests.
In that case ping-pong works only on other events, such as user input
or on frame swapped.

From https://git.merproject.org/mer-core/libsdl/merge_requests/3
Original author: Alexander Akulich <a.akulich@omprussia.ru>
2018-08-23 14:47:38 +02:00
Sam Lantinga
07d64253a1 Fixed bug 4324 - Xcode 10 - more cleanup for macOS and iOS projects
Dominik Reichardt

Xcode warns about
"Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO."
Just doing the latter is enough to silence the warning without ill effects on compiling. This affects the macOS Xcode projects as well as the iOS projects. Definitely not a bug but an annoying warning that could go away.
2018-10-18 15:41:50 -07:00
Sam Lantinga
0a07b5b836 Fixed bug 4324 - Xcode 10 - more cleanup for macOS and iOS projects
Dominik Reichardt

Similar to bug/patch #4228, the iOS Demo Xcode project needs to add the CoreBluetooth framework.
2018-10-18 15:40:39 -07:00
Ryan C. Gordon
ad1b9e7cfc cocoa: Fix OpenGL rendering on macOS 10.14 ("Mojave").
Fixes Bugzilla #4272.

--HG--
extra : rebase_source : 897af85e5a1a52c9cba466abf980370c995b7a11
extra : amend_source : 3363fd3637833aad5621aebb7089bbabf6e7c754
2018-10-18 12:05:05 -04:00
Ryan C. Gordon
c247695f19 cocoa: GL_GetDrawableSize only uses -[NSView convertRectToBacking] for highDPI.
On Mojave, this will report large numbers for retina displays in fullscreen
mode, which isn't how it works on previous versions.

--HG--
extra : rebase_source : 175a37f93b8e582bcd3ed80b93e6d40597ce7039
2018-10-18 11:59:48 -04:00
Ozkan Sezer
4e3ee3ee71 use less ancient versions of autofoo scripts 2018-10-18 11:58:00 +03:00
Sam Lantinga
afeced9c72 Fixed bug 4318 - Android move Haptic code to API26 class
Sylvain

- Create SDLHapticHandler_API26
- No need of reflection since SDL2 compile with Android 26 as a min requirement.
- remove spaces
2018-10-16 15:00:43 -07:00
Sam Lantinga
fd48717bca Fixed updating the rumble parameters on Linux 2018-10-16 14:58:07 -07:00
Sam Lantinga
b940c2ed0d Support vibration magnitude on Android 8.0 (thanks Rachel!) 2018-10-16 08:29:27 -07:00
Ozkan Sezer
6967f6fcb9 SDL_power.c: Adjust SDL_POWER_DISABLED ifdefs to avoid zero-size array
Otherwise if SDL_POWER_DISABLED is disabled (eg with --disable-power):

... with clang -pedantic:
src/power/SDL_power.c:48:50: warning: use of GNU empty initializer extension [-Wgnu-empty-initializer]
static SDL_GetPowerInfo_Impl implementations[] = {
                                                 ^
src/power/SDL_power.c:48:50: warning: zero size arrays are an extension [-Wzero-length-array]
2 warnings generated.

... with gcc -pedantic:
src/power/SDL_power.c:48:50: warning: ISO C forbids empty initializer braces [-Wpedantic]
src/power/SDL_power.c:48:50: warning: ISO C forbids empty initializer braces [-Wpedantic]
 static SDL_GetPowerInfo_Impl implementations[] = {
                                                  ^
src/power/SDL_power.c:48:30: error: zero or negative size array ‘implementations’
 static SDL_GetPowerInfo_Impl implementations[] = {
                              ^~~~~~~~~~~~~~~

... with Watcom:
./src/power/SDL_power.c(85): Error! E1112: Initializer list cannot be empty
2018-10-15 11:01:00 +03:00
Ryan C. Gordon
6f747d79e4 x11: Don't hardcode limit on lines of text in message boxes.
Plus other text parsing fixes.

Fixes Bugzilla #4306.
2018-10-15 00:46:43 -04:00
Ozkan Sezer
87c7eb2365 add a minimal config and makefile to test watcom/os2 builds. 2018-10-14 23:56:56 +03:00
Ozkan Sezer
f0a2bead1e SDL_GetPowerInfo_Hardwired is static in SDL_power.c
.. therefore, comment out its extern declaration in SDL_syspower.h.
2018-10-14 23:55:02 +03:00
Ozkan Sezer
460ecb4500 add missing include. 2018-10-14 23:50:50 +03:00
Alex Szpakowski
88fcd97fbb iOS: Don't ignore the requested alpha bit size when determining whether to use an RGBA8 backbuffer. 2018-10-14 17:26:10 -03:00
Charlie Birks
7784f5e8b7 Emscripten: Load eglQueryString and eglGetError
This prevents an assertion on context creation failure (calling a null
function pointer).
2018-10-13 17:18:59 +01:00
Alex Szpakowski
e311ac3bdf metal: Fix SDL_RenderReadPixels to wait for the GPU to finish rendering to the active texture before reading its pixels. 2018-10-13 03:36:42 -03:00
Alex Szpakowski
7144595a99 macOS: Fixed MoltenVK dynamic library loading code. 2018-10-12 23:23:52 -03:00
Alex Szpakowski
8b260f68d2 metal: Fix high dpi and resizing on macOS, and clean up iOS code. Fixes bug #4250. 2018-10-12 17:55:42 -03:00
Sam Lantinga
100e8e727f Allow Android haptics to work when SDL is reinitialized (thanks Rachel!) 2018-10-11 15:14:48 -07:00
Ozkan Sezer
5733b6d7b9 SDL_thread.h: undefine SDL_CreateThreadWithStackSize before redefining. 2018-10-12 01:03:40 +03:00
Ryan C. Gordon
3c8fb7cfe8 thread: make SDL_CreateThreadWithStackSize() a public API.
--HG--
extra : rebase_source : 61cb2213bd8b0496a43b2175b6e526e8a1eb6a2c
2018-10-11 16:40:01 -04:00
Cameron Gutman
78fd489f4a Implement SuspendScreenSaver for Win32
Creating a full-screen SDL renderer on Windows will keep the screensaver
suspended by DirectX, as is default for full-screen DX applications. However,
for applications that render in windowed-mode, the screensaver will
still kick in, even if SDL_DisableScreenSaver() is called or
SDL_HINT_VIDEO_ALLOW_SCREENSAVER is set to 0 (default). Implementing
a SuspendScreenSaver() function for Win32 fixes this behavior.
2018-10-09 23:01:43 -07:00
Ryan C. Gordon
42e05971ed audio: All device names reported by SDL must be unique.
This means that if you have two devices named "Soundblaster Pro" in your
machine, one will be reported as "Soundblaster Pro" and the other as
"Soundblaster Pro (2)".

This makes it so you can't into a position where one of your devices can't
be opened because another is sitting on the same name.

--HG--
extra : rebase_source : 42a75cc0b282ece7097b6f524bcaccca314e0ea9
2018-10-10 15:20:56 -04:00
Ryan C. Gordon
ca08630740 audio: clean_out_device_list() already sets this flag to false for us.
--HG--
extra : rebase_source : df851854c497ef14bd6a1659b58d630aee0eebe2
2018-10-10 14:55:24 -04:00
Sam Lantinga
31490ce318 Added support for surround sound and float audio on Android 2018-10-09 20:12:43 -07:00
Sam Lantinga
223bea8f0e Removed unneeded variable qualifiers 2018-10-09 20:12:40 -07:00
Sam Lantinga
3c3dc10de5 Fixed bug 4188 - Software renderer SDL_RenderCopyEx blits corrupt image under certain cases
duckgrease

SDL_RenderCopyEx blits wrong image (in some cases it's bunch of alternating horizontal lines, some cases it's image from the wrong coordinate, and in some cases it's just a bunch of garbled pixels), when the following conditions are met:
- Use software renderer.
- Enable either horizontal or vertical flip.
- source and destination rectangles must have same width and height, and must be smaller than the size of the texture.
- source rectangle's X and Y coordinates must be 0.
2018-10-09 17:41:40 -07:00
Ryan C. Gordon
06504eb80b kmsdrm: find available card if called without index.
This work was done by Michael Grzeschik, I just cleaned up the patch a little.

Fixes Bugzilla #4241.

--HG--
extra : rebase_source : 388917b8a360cd01d53e90ccd455240653743dac
2018-10-09 00:27:55 -04:00
Sam Lantinga
ee865fc0f4 This device gets Xinput driver loaded on windows. 2018-10-08 19:46:01 -07:00
Sam Lantinga
c34c6e1474 Fixed life-cycle issues with two activities sharing HIDDeviceManager 2018-10-08 12:49:30 -07:00
Sam Lantinga
d6cb11d8cc Close on shutdown, for consistency 2018-10-08 12:49:28 -07:00
Sam Lantinga
1faa0d69ec Trying to track down NullPointerException in USB input thread 2018-10-08 12:49:26 -07:00
Sam Lantinga
3abd7b6d7a Don't flash the navigation bar when destroying a fullscreen SDL window 2018-10-08 12:49:25 -07:00
Sam Lantinga
d0433b8486 There are legitimate reasons to skip full cleanup at shutdown, don't assert in that case. 2018-10-08 12:49:23 -07:00
Sam Lantinga
ff6aab8c51 Fixed bug 4296 - kmsdrm video driver leaks 1 bo in KMSDRM_GLES_SetupCrtc()
Icenowy Zheng

One front buffer is locked in GLES_SetupCrtc() and overrides the next_bo just locked in KMSDRM_GLES_SwapWindow, then the next_bo gets lost and is not released even when quitting the video.

It may leads to problems with GLES drivers that doesn't clean up GBM correctly if there's any bo left (e.g. the Mali Utgard r6p2 blob). In the case of Mali Utgard r6p2 blob, the DRM device file is still hold by the blob, and if you try to SDL_Quit to let another program to run (this is done by EmulationStation), the new program will fail to open DRM device.
2018-10-05 17:06:05 -07:00
Ryan C. Gordon
8ca5da741d wayland: Fixed missing window sizing events.
Fixes Bugzilla #4242.

--HG--
extra : rebase_source : a4acd992b5d392711e0d4e4b8b5d73c1e0b83145
2018-10-05 17:24:03 -04:00
Sam Lantinga
a729c62a9e It turns out HIDAPI for Xbox controllers doesn't allow background input, so we won't enable it by default on Windows. 2018-10-05 01:41:59 -07:00
Sam Lantinga
cfefb1c1ed Allow SDL to use ReLinker if present.
This fixes issues for applications that have a large number of shared libraries
For more information, see https://github.com/KeepSafe/ReLinker for ReLinker's repository.
2018-10-04 16:29:17 -07:00
Sam Lantinga
61000206da Fixed updating bindings for controllers using the wildcard mappings 2018-10-04 15:23:42 -07:00
Sam Lantinga
315f87a31f Update documentation to note that this hint works on Android too (thanks Trent!) 2018-10-03 15:48:26 -07:00
Ryan C. Gordon
a6ce324072 evdev: Don't initialize struct sigaction with "{ 0 }".
It causes warnings on some platforms, depending on the actual definition of
sigaction, and since this is static data, it'll be zero'd out anyhow.

--HG--
extra : rebase_source : 5889563dfd03ef7c2a1443eace02339e4b470437
2018-10-03 16:54:24 -04:00