Commit Graph

6928 Commits

Author SHA1 Message Date
Cameron Cawley 2f4e9294aa Update the Linux build instructions 2021-02-25 19:24:50 +03:00
Ozkan Sezer e561ce3a75 SDL_cpuinfo.c: replaced gcc i386 checks with __i386__ . 2021-02-25 01:40:02 +03:00
Ozkan Sezer 55a385a333 removed a useless restriction from Watcom version of SDL_Swap32()
also did a little whitespace tidy-up.
2021-02-24 20:03:50 +03:00
Ozkan Sezer b8d2185277 added Watcom i386 inline asm for SDL_Swap64() 2021-02-23 17:37:20 +03:00
JibbSmart c287087fcc Only change joystick->nbuttons for Joy-Cons, since they're the only ones that have these "paddles" 2021-02-22 17:54:32 -08:00
JibbSmart ee52624f95 Switch Joy-Con SL and SR buttons are now mapped to matching paddle positions so that all buttons can be accessed when using SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS 2021-02-22 17:54:32 -08:00
Mathieu Eyraud 7a2b6f331b Guard Inotify stuff with macro
This fix implicit declaration of close and unused variable warning.
2021-02-22 09:07:07 -08:00
Mathieu Eyraud 8481229ff7 Fix error handling in KMSDRM_AddDisplay
Add missing `goto cleanup` and check that `dispdata` is not NULL before dereferencing it.
2021-02-22 09:01:36 -08:00
Mathieu Eyraud 2df9c15e96 Fix memory leak in KMSDRM_Vulkan_CreateSurface
Variable `device_props` is never freed.
2021-02-22 09:00:45 -08:00
Ozkan Sezer b3498a5dc2 make SDL_syswm.h work with apple's older gcc versions
c.f. https://bugzilla.libsdl.org/show_bug.cgi?id=2694
2021-02-22 15:50:02 +03:00
Ozkan Sezer bb76edf3d7 fix permissions of a few files 2021-02-22 15:44:32 +03:00
Mathieu Eyraud 844d5e3ed3 Fix memory leak in ConnectSensor
'name' is leaked in case of error.
2021-02-21 16:46:20 -08:00
Martin Gerhardy 557aa140e8 CI: fixed branch name 2021-02-21 16:45:48 -08:00
Martin Gerhardy f63e827efa DOCS: group the markdown 2021-02-21 16:45:48 -08:00
Martin Gerhardy 306e808da1 CI: added github pages build job 2021-02-21 16:45:48 -08:00
Martin Gerhardy 5d266e9bba CI: added github actions 2021-02-21 16:45:48 -08:00
Vanfanel 11cb53d2a5 [KMSDRM] Add missing break and modify comments. 2021-02-21 15:27:12 -08:00
Vanfanel 9172e413ad [KMSDRM] Fix intermitent bug in Vulkan initialization on Raspberry Pi 4. 2021-02-21 15:27:12 -08:00
Sam Lantinga 1a17ab30e1 Added mappings for popular controllers on Chromebooks 2021-02-21 11:03:26 -08:00
Sam Lantinga f5e9c5b7e0 Chromebooks support relative mouse motion now 2021-02-21 11:03:25 -08:00
David Gow db58166e9b joystick: hidapi: Properly include <unistd.h> when inotify not available
In the extremely unlikely event that inotify is not available (and,
therefore, HAVE_INOTIFY is not #defined), SDL will no-longer build.

This is because <unistd.h> is only included when HAVE_INOTIFY is
defined, and PR #4098 adds a call to access(…, F_OK), which requires
<unistd.h>.

(Note that the F_OK symbol is the only one which actually prevented
SDL from compiling, but both access() and close() fell back to implicit
definitions, which is a bit concerning.)

Fixes: 8d43f45a7b ("Don't use udev for joystick enumeration if running in a container")
2021-02-21 12:55:01 +03:00
Amir 360740ac76 correct dynapi 2021-02-20 23:05:09 -08:00
Amir 5696582e1d add SDL_AndroidShowToast for https://developer.android.com/reference/android/widget/Toast 2021-02-20 23:05:09 -08:00
Amir 1a924bc0bb add SDL_AndroidShowToast for https://developer.android.com/reference/android/widget/Toast 2021-02-20 23:05:09 -08:00
Ludovico de Nittis 8d43f45a7b Don't use udev for joystick enumeration if running in a container
If we are running in a container, like Flatpak[1] or pressure-vessel[2],
it's likely that we are using user namespaces,
therefore udev event notification via netlink won't work reliably.
Use their filesystem API to detect them and automatically fallback to
the inotify-based enumeration.

[1] <https://flatpak.org/>
[2]
<https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/tree/master/pressure-vessel>

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2021-02-20 23:01:38 -08:00
Ludovico de Nittis 2c3269152a Use inotify for HIDAPI joystick enumeration if not using udev
This improves SDL's ability to detect HIDAPI joystick hotplug in a
container environment because we cannot reliably receive events from
udev in a container.

For a more detailed explanation of why this issue happens with
containers, please check the previous commit
"joystick: Use inotify to detect joystick unplug if not using udev"
(b0eba1c5).

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2021-02-20 23:01:38 -08:00
Ludovico de Nittis b17242bf98 Allow libudev for HIDAPI joystick to be disabled at runtime
As already explained in the previous commit "joystick: Allow libudev to
be disabled at runtime" (13e7d1a9), libudev can fail in a container.

To make it easier to experiment with, we add a new environment variable
"SDL_HIDAPI_JOYSTICK_DISABLE_UDEV" that disables udev and let it
fallback to the device enumeration using polling.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2021-02-20 23:01:38 -08:00
Jay 0052339b66 Move handleURLEvent setEventHandler to init 2021-02-20 22:59:11 -08:00
Sam Lantinga 42607909a0 Remove devices from the list after they've been disconnected due to read errors.
This fixes problems with controllers not being re-detected when a computer goes to sleep and a controller is removed and plugged back in while it's asleep.
2021-02-20 22:51:57 -08:00
Oschowa 08547adb52 pulseaudio: Add "zerocopy" playback path 2021-02-20 12:50:36 -05:00
Ozkan Sezer a29fe29296 configury: replace host checks against *-*-mingw32* with *-*-mingw* 2021-02-18 20:10:50 +03:00
Ryan C. Gordon c4b7e485af docs: README.md points to Discourse instead of the mailing list now. 2021-02-18 11:10:20 -05:00
Ryan C. Gordon abe2c0f1b1 license: Fixed references to COPYING.txt that are now LICENSE.txt.
Fixes #4108
2021-02-18 11:07:26 -05:00
Romain Roffé ef85ed9352 pulseaudio: Initialize fragsize to fix mic recording
fragsize wasn't initialized, and it is used for recording.
If the value was 0 or -1, pulseaudio configures it itself. But sometimes
we can get a random (and large) value that makes pulseaudio give us
large sample at a very low frequency.

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/master/src/pulse/def.h#L453
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/v13.0/src/pulsecore/protocol-native.c#L409
2021-02-18 09:51:35 -05:00
Cacodemon345 0a58010c0d Fix README-kmsbsd.md Markdown display 2021-02-17 13:11:00 -05:00
Erik Yuzwa ffce58a30c
license: Fixing the license file to be correctly scooped up by Github automation
Renamed COPYING.txt to LICENSE.txt, and ensured the copyright year
is the first line in the license file. This causes GitHub to correctly
identify the zlib license and report it on SDL's project page.
2021-02-17 13:08:13 -05:00
Vanfanel e4a81a98a0 [KMSDRM] Correct indentation. 2021-02-17 17:03:42 +03:00
Cameron Cawley d79bc0015e Update the .gitignore file 2021-02-17 11:55:01 +03:00
Cameron Cawley 9323cd51f0 Check for ARM SIMD in testplatform 2021-02-17 11:10:02 +03:00
Cameron Cawley 98bf79cff1 Minor improvements for CPU detection on ARM 2021-02-17 11:10:02 +03:00
Matt Borgerson 4aa2e74844 Add Xbox Controller S entry to gamecontrollerdb 2021-02-16 10:15:44 -08:00
Cacodemon345 350e0ae1fd Add documentation for KMSDRM on *BSDs 2021-02-15 15:24:52 -05:00
Ozkan Sezer f2a2d0c696 SDL_render_d3d.c: fix build with SDL_LEAN_AND_MEAN 2021-02-15 22:56:20 +03:00
Ozkan Sezer bd4277ee39 fixed make dist (VisualC.html went bye bye..) 2021-02-15 20:10:50 +03:00
Alex Szpakowski 09231c42ea Fix flags check in test code 2021-02-15 08:43:53 -08:00
Alex Szpakowski 9b9d0d484d mac/iOS: allow Metal in windows created without an explicit backend
Fixes SDL_CreateWindowAndRenderer (and similar situations) not choosing a Metal backend. See #3991.

Passing an explicit backend into CreateWindow, eg SDL_WINDOW_OPENGL or SDL_WINDOW_METAL, will still prevent the window from being used with other backend types.
2021-02-15 08:43:53 -08:00
erik yuzwa 9c1871c144 update path to visualc README 2021-02-15 08:35:13 -08:00
erik yuzwa 92506462e2 update some copy 2021-02-15 08:35:13 -08:00
erik yuzwa be17004e67 updated some notes around using a newer IDE 2021-02-15 08:35:13 -08:00
erik yuzwa 7f1b833373 initial work 2021-02-15 08:35:13 -08:00