Commit graph

7066 commits

Author SHA1 Message Date
Ryan C. Gordon 4075748e41
rwops: Removed unused variable in Windows-specific code. 2022-12-15 00:09:32 -05:00
Brian Kirkpatrick e35730ac54 fixed const error when compiling for mutated total_need value in SDL_rwops.c 2022-12-14 20:25:40 -08:00
Sam Lantinga 980208b814 Fixed crash in SDL_PrivateGameControllerRefreshMapping()
(cherry picked from commit 7a9966af9d)
2022-12-14 20:24:14 -08:00
Ryan C. Gordon 72c1f73bc5
rwops: Make read and write work like POSIX, not stdio.
This simplifies some things, clarifies some things, and also allows
for the possibility of RWops that offer non-blocking i/o (although
none of the current built-in ones do, intentionally, we could add this
later if we choose, or people could provide things like network socket
RWops implementations now, etc.

Fixes #6729.
2022-12-14 15:47:13 -05:00
Frank Praznik e9a9afaded wayland: Look up pressed keys via keycodes instead of scancodes on keyboard entry
On window focus, look up the pressed modifier keys via keycodes instead of scancodes to handle the case of remapped keys, as xkb remapping changes the associated keycode, not the scancode.
2022-12-14 11:31:40 -08:00
Sam Lantinga 3a940ba8ee Updated gendynapi.py to handle thread-safety annotations 2022-12-14 09:59:56 -08:00
Sam Lantinga 5c29b58e95 Added support for clang thread-safety analysis
The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code.

Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change.

This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock.

To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
2022-12-14 09:53:39 -08:00
Sylvain Becker 02493579b5
DBus: add a reference to the connection
Fixed bug #6712
2022-12-14 11:41:35 -05:00
Sylvain Becker e0ee9fa80c
Fix build (#6808) 2022-12-14 09:47:15 +01:00
Ryan C. Gordon 5a2d0b69c8
render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer.
Fixes #6625.
2022-12-13 23:27:35 -05:00
Ryan C. Gordon a76053352c
gesture: Removed the gesture API from SDL3.
Fixes #6758.
2022-12-13 14:54:37 -05:00
Simon McVittie 45ebdfb1dc emscripten: Replace a stray reference to SDL2 with SDL3
Entirely untested, but I'm fairly sure this is what was intended.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:03:11 -05:00
Sam Lantinga 650e16a824 Detect display change when fullscreen desktop windows move displays
This happens when using Win+Alt+Left/Right on a resizable fullscreen desktop window on Windows
2022-12-12 20:26:17 -08:00
Sam Lantinga a506d798d8 Don't try to open the Razer Huntsman Elite keyboard as a controller
(cherry picked from commit 817454cfe6)
2022-12-12 18:01:32 -08:00
Ryan C. Gordon 12486e144b
wasapi: Fixed incorrect assertions.
Fixes #6795.
2022-12-12 16:07:48 -05:00
Frank Praznik 90a964f132 wayland: Set xdg surface geometry
It was previously thought that these function calls were unnecessary as the initial bug and reproduction case that necessitated their addition seemed to be fixed, but apparently there are still cases where this needs to be set explicitly. Set the xdg surface geometry at creation time and when the window size changes.

Partially reverts #6361.  This is not needed in the libdecor path, as libdecor calls this for the content surface internally.
2022-12-12 11:21:20 -08:00
Sam Lantinga 618340bf99 Added support for the STRIKEPAD PS4 Grip Add-on to the HIDAPI driver 2022-12-12 10:55:38 -08:00
Pierre Wendling 053ce39d67
N3DS: Semaphore fixes. (#6776)
* N3DS: Make Sem waits cooperative friendly.

The 3DS has a cooperative threading model. Sleeping after TryWait and
WaitTimeout avoid starving other threads. It inccurs a runtime penalty,
but it's better than having to hard reset your console to recover from
a deadlock.
2022-12-11 11:27:16 -08:00
Sylvain e5a470d0d3
Update DYNAPI SDL_WinRTRunApp() prototype which was wrong (see #6783) 2022-12-10 17:54:16 +01:00
Sylvain 3d190ebcb4
SDL_dynapi_procs: fixed SDL_UIKitRunApp prototype (see #6783) 2022-12-10 17:45:56 +01:00
Sylvain f906c52ee6
SDL_assert: remove old naming convention (see #6783) 2022-12-10 17:19:00 +01:00
Sylvain 2905b6d65a
SDL_dynapi_procs: update wrong naming conventions with SDL_AssertState/Data (see #6783) 2022-12-10 17:15:14 +01:00
Sylvain 99baebf5eb
SDL_dynapi_procs.h: one more space (for diff purpose) 2022-12-09 20:42:01 +01:00
Sylvain b7008e4614
SDL_dynapi_procs: remove extra ' ' 2022-12-09 20:36:34 +01:00
Sylvain cce1341b5b
gendynapi.py: don't generate parameter for '...' - corrected 2022-12-09 20:34:13 +01:00
Sylvain f442d0a0ef
Revert "gendynapi.py: don't generate parameter for '...'"
This reverts commit ea8c7df91b.
2022-12-09 20:33:14 +01:00
Sylvain ea8c7df91b
gendynapi.py: don't generate parameter for '...' 2022-12-09 20:22:44 +01:00
Sylvain 5f89987d7f
Fixed extra 'space' (see #6783 Thanks @sezero !) 2022-12-09 20:09:17 +01:00
Sam Lantinga 3736005fc4 Added test event logging for SDL_WINDOWEVENT_ICCPROF_CHANGED and SDL_WINDOWEVENT_DISPLAY_CHANGED 2022-12-09 10:23:00 -08:00
Sylvain b116dd8eb8
gendynapi.py: add comment for OS-specific API (Thanks @DanielGibson!) 2022-12-09 09:27:19 +01:00
Sam Lantinga cfa493c97f Use the current timestamp for keyboard hook events
Fixes https://github.com/libsdl-org/SDL/issues/6771
2022-12-08 23:13:13 -08:00
Sam Lantinga 5bc80abe0d Added logging for SDL_DISPLAYEVENT_MOVED
(cherry picked from commit be3b1cff0b)
2022-12-08 17:04:27 -08:00
Sam Lantinga 7d1bf0a9fe Make sure the display list is up to date for window placement
(cherry picked from commit ab479b4961)
2022-12-08 17:04:11 -08:00
Sam Lantinga a4a80360f5 Added SDL_DISPLAYEVENT_MOVED to detect when display positioning changes
(cherry picked from commit 264da8c127)
2022-12-08 12:47:56 -08:00
Sam Lantinga 98fa97de91 Fixed memory leak when removing existing displays
(cherry picked from commit cfc7cac3c9)
2022-12-08 12:46:50 -08:00
Frank Praznik 653e484da1 wayland: Handle the Num Lock and Caps Lock modifiers via modifier events
Num Lock and Caps Lock always need to be explicitly handled by the modifier handler function, or they won't be correctly set if active at application startup, or if the lock state is changed while the application lacks focus since a key press for these keys will never be received.  In these cases, the internal SDL modifier state can end up the inverse of the actual modifier state.
2022-12-08 09:29:37 -08:00
Sylvain e93769d2c9 Extract the name of a callback paramter 2022-12-08 08:55:27 -08:00
Sylvain 67a4094eea Rewrite + gendynapi into python 2022-12-08 08:55:27 -08:00
Sylvain c265fb74b0 Renamed AUDIODRIVER and VIDEODRIVER hint/env to AUDIO_DRIVER and VIDEO_DRIVER 2022-12-08 09:50:09 -05:00
Ryan C. Gordon 7ca0d15d64
events: Changed SDL_GetEventState from a macro to a function.
Fixes #6773.
2022-12-08 00:08:51 -05:00
Sam Lantinga 9a6bcca6b8 Use the correct name for the DualSense controllers 2022-12-07 14:53:33 -08:00
Sam Lantinga 9339085593 Added support for the DualSense Edge paddles 2022-12-07 14:25:53 -08:00
Sam Lantinga a71ac0eb06 Revert "Add window title to app_ids for different"
This reverts commit 39eab4bf44.

From @Kontrabant:
Making windows use the window title as the app ID by default doesn't seem like the right direction. The app ID is used by window managers to group windows from the same application together for switching between with alt-tilde and such functionality, and giving each window it's own app ID would break this.
2022-12-07 07:39:40 -08:00
Frank Praznik 30bb8f616d wayland: Pass through event timestamps of 0
Always pass through event timestamps of 0 so the current time will be used for the event.
2022-12-06 09:17:00 -08:00
Lei.Huang 39eab4bf44 Add window title to app_ids for different
"app_ids" can be used for multiple windows

Signed-off-by: Lei.Huang <leihuang@amd.com>
2022-12-05 21:30:03 -05:00
Sam Lantinga e8b1dfef9b Fixed centering the D-pad on some joysticks
Fixes https://github.com/libsdl-org/SDL/issues/6767
2022-12-05 13:33:04 -08:00
Sam Lantinga fcafe40948 Removed balls from the joystick API
They were only used by one joystick decades ago, so removing them for SDL3

Fixes https://github.com/libsdl-org/SDL/issues/6766
2022-12-05 13:17:18 -08:00
Sam Lantinga 75f1eb9216 Don't assume evdev events and SDL_GetTicks() use the same time source
The evdev events are in the same time base as gettimeofday(), but SDL_GetTicks() might be using clock_gettime()
2022-12-05 10:40:16 -08:00
Sam Lantinga 57d34f2e10 Make sure we never get a zero tick_start value 2022-12-05 10:17:38 -08:00
Sam Lantinga c468d93760 Removed unnecessary conversion from nanoseconds to milliseconds in SDL_GetTicks() 2022-12-05 10:11:22 -08:00
Sam Lantinga 82b01035d1 Reduce the chance of overflow when calculating nanosecond time
Fixes https://github.com/libsdl-org/SDL/issues/6762
2022-12-05 09:43:30 -08:00
Ozkan Sezer ed6d401616 gendynapi.pl: fix "Use of uninitialized value $7" after commit 0f9482e.
Reference issue: https://github.com/libsdl-org/SDL/issues/6740.
2022-12-05 20:29:56 +03:00
Sylvain af5bda5ef3 Fix warnings 'macro argument should be enclosed in parentheses' 2022-12-05 09:06:44 -08:00
Frank Praznik 8cafde5ecc wayland: Add high-resolution event timestamp support
Add the protocol for high-resolution timestamp events and subscribe to them if available.

Event timestamps are now handled natively in nanoseconds as much as possible to avoid error-prone conversions.

Variables have been appended with _ms or _ns where appropriate, to avoid ambiguity.
2022-12-04 16:56:26 -08:00
Ozkan Sezer d6327a00fb re-applied the SDL_NewAudioStream deconstification, including to its definition
we should keep this to SDL3 only.
2022-12-04 20:50:20 +03:00
Sam Lantinga d3ba6529e6 Fixed windows build 2022-12-04 09:39:55 -08:00
Cameron Cawley ee0e9e979c Move intrinsic includes into a private header 2022-12-04 09:34:10 -08:00
Sam Lantinga b4da4ed95a Removed SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp()
If you care about timestamps you'll also want to catch all of the sensor events instead of just polling the current state. For example, Nintendo Switch controllers generate 3 sensor events with distinct values for each polling interval.
2022-12-04 09:29:28 -08:00
Sam Lantinga b8760a3ffe The timestamp_us member of the sensor events has been renamed sensor_timestamp and now represents nanoseconds. 2022-12-04 09:29:28 -08:00
Sam Lantinga 73f4aeee6a Pass the event timestamp for joystick events
This allows the application to get more fine grained information about controller event timing, and group events that happened together.
2022-12-04 09:29:28 -08:00
Sam Lantinga f32cdfa096 Fixed presentation reset calculation (thanks @zturtleman!) 2022-12-04 09:28:03 -08:00
Ozkan Sezer 25e62193f4 just revert the const removal from SDL_NewAudioStream in commit d0bbfdb 2022-12-04 12:56:50 +03:00
Ozkan Sezer 202eaeea11 replace windows timeapi.h with mmsystem.h for better compatibility. 2022-12-04 12:50:04 +03:00
Ozkan Sezer 36a43eac00 apply const removal changes from SDL_NewAudioStream to dynapi side too. 2022-12-04 12:47:20 +03:00
Frank Praznik 1f40b9de96 wayland: Pass event timestamps to SDL
SDL events support system timestamps now, so pass them through.
2022-12-03 21:17:35 -08:00
Sylvain Becker 4ffa7f868d
Fixed bug libsdl-org#6745 - Check for overflow in SDL_CalculateYUVSize (#6747)
Fixed bug #6745 - Check for overflow in SDL_CalculateYUVSize
2022-12-03 21:22:14 +01:00
Max Bachmann 5650046f93 Detect Logitech PRO Racing Wheel as wheel 2022-12-03 08:21:18 -08:00
Sylvain 021d0b7300
Fix wrong clang-tidy modification. This is an integer division. Thanks @meyraud705 (see PR #6725) 2022-12-03 13:36:09 +01:00
Ozkan Sezer 0f9482ebc3 reran gendynapi.pl to add SDL_GetTicksNS / SDL_DelayNS to SDL_dynapi.sym 2022-12-03 00:33:50 +03:00
Jan Engelhardt 1878674477 build: add symbol versioning for SDL
If a program built against one version of SDL is run in an
environment where there is an earlier version of the SDL .so library
installed, the result varies depending on platform configuration; in
the best case, it won't start at all, at worst it aborts in the
middle of the user doing "something important" (systems implementing
lazy symbol resolution). verdefs on the other hand are always checked
on startup.

The dependency information present in programs and shared libraries
is not only of value to the dynamic linker, but also to a
distribution's package management. If the dynamic linker is able to
tell that a program is not runnable per the above, a package manager
is able to come to the same conclusion — and block the installation
of a nonfunctional program+library ensemble.

Because there are a lot more symbols than there are libraries (I am
going to throw in "10^4 to 1 or worse"), package managers generally
do not evaluate symbols, but only e.g. the SONAME, NEEDED and VERNEED
fields/blocks. Because the SONAME is the same between two SDL
versions like 2.0.24, and 2.0.26, everything rests on having verdefs.

This patch proposes the addition of verdefs.
2022-12-02 13:05:37 -08:00
Sylvain Becker 92cd2c0a74
Enable creation of yuv SDL_Surfaces (#6735) 2022-12-02 12:53:48 -08:00
Sam Lantinga 0a3262e819 Pass the OS event timestamp for keyboard, mouse, and touch events where possible
Currently implemented for Windows and Apple platforms
2022-12-02 12:37:41 -08:00
Sam Lantinga 1f4cc733a1 Removed the nanosecond versions of event and thread primitive waits from the public API
It's not clear applications need this level of precision yet, so let's leave these private for now.
2022-12-02 12:37:41 -08:00
Sam Lantinga 8121bbd083 Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512
Fixes https://github.com/libsdl-org/SDL/issues/6731
2022-12-02 12:37:41 -08:00
Sylvain 764b899a13
Fix Conditional jump or move depends on uninitialised value(s)
eg ./testsprite2 --trackmem
2022-12-02 21:11:33 +01:00
Ozkan Sezer a3d7dd2464 SDL_sysfilesystem.c (SDL_GetBasePath): fixed the solaris code path.
Reference issue: https://github.com/libsdl-org/SDL/pull/6681
2022-12-02 06:23:30 +03:00
Ozkan Sezer ab916e8a61 fixed corrupted (zero-sized) SDL3-WinRTResource_BlankCursor.cur.
(copied from SDL2 branch with renaming.)
2022-12-02 03:32:00 +03:00
Frank Praznik 378b1c286a Fix formatting on Wayland and Pipewire function signatures
Fixes the formatting on some function signatures that clang-format missed.
2022-12-01 15:13:28 -08:00
Sylvain Becker ab1f4172e3
Remove SDL_GL_CONTEXT_EGL #6657 (#6683) 2022-12-01 14:53:37 -08:00
Sam Lantinga 7237c56499 Detect the G923 (Xbox style) and PXN V900 (PS3 mode) as wheels 2022-12-01 14:43:34 -08:00
Pierre Wendling 3c501b963d
Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
Sylvain Becker 932f61348d
Remove mask versions of SDL_CreateRGBSurface* #6701 (#6711)
* Rename SDL_CreateRGBSurface{,From} to SDL_CreateSurface{,From}, which now takes a format parameter
2022-12-01 08:04:02 -08:00
Sylvain 778b8926b4
Small format changed (using clang-format 15.0.2-1) 2022-12-01 09:39:08 +01:00
Ozkan Sezer 45025799b7 restore SDL_malloc.c original formatting. 2022-11-30 17:28:26 -08:00
Sam Lantinga 36c5d5cc65 Added support for the Logitech Cordless Precision PS3 controller 2022-11-30 17:18:00 -08:00
Sam Lantinga 4f9c2b3e2e Added support for the HORIPAD Pro for Xbox Series X 2022-11-30 17:17:44 -08:00
Sam Lantinga e2df0a9d5a Re-enabled support for third party PS3 controllers 2022-11-30 17:17:15 -08:00
Sam Lantinga 27e8eb4ca8 Fixed Victrix FS Pro V2 controller hang on reboot
(cherry picked from commit 9e997cc787)
2022-11-30 15:39:48 -08:00
Sam Lantinga f8c3528c55 Fixed crash if GetRectDisplayIndex() is called before SDL_VideoInit()
(cherry picked from commit d87048fd5a)
2022-11-30 14:38:25 -08:00
Sam Lantinga 1e2dfdb019 Removed the OpenGL ES 1.0 2D render implementation
In SDL3 we plan to make more use of shaders in the 2D render API, and this minimizes the number of platforms we have to consider for new features. OpenGL ES 2.0 or newer is supported on all modern iOS and Android devices.
2022-11-30 13:39:37 -08:00
Sam Lantinga 5750bcb174
Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594
2022-11-30 12:51:59 -08:00
Sam Lantinga c5790359fd
Added precompiled header support for Visual Studio and Xcode (#6710)
Fixes https://github.com/libsdl-org/SDL/issues/6704
2022-11-29 18:34:15 -08:00
Sam Lantinga 6ca7212b75 Fixed unreachable code warning 2022-11-29 18:03:58 -08:00
Ethan Lee f9f7db4e08 video: Prefer Wayland over X11 (take 2!) 2022-11-29 16:35:36 -05:00
David Edmundson 6d2b74db66 Support wayland fractional scale protocol
The new protocol adds support for more native communication of
fractional scaling.

Everything in the wayland backend already existed only our fractional
scale was calculated implicitly through a combination of output size
guesswork for fullscreen windows.

This new protocol makes that explicit, providing a more robust solution
and a solution for non-fullscreen surfaces. The fallback code is still
left in place for now whilst compositors gain support.
2022-11-29 16:35:12 -05:00
Ryan C. Gordon a3225ae6de
dynapi: Abstract out the environment variable name. 2022-11-29 14:13:07 -05:00
pionere cf0cb44df8 video: fix error messages
- do not overwrite error message set by SDL_InitFormat (SDL_AllocFormat)
- set proper error message (Cocoa_Metal_CreateView)
- protect against allocation failure (UIKit_Metal_CreateView)
2022-11-29 10:59:40 -08:00
Sylvain Becker fc4fc5295f
Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_Create… (#6685)
* Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_CreateRGBSurfaceWithFormatFrom
* Removed unused 'flags' parameter from SDL_CreateRGBSurface and SDL_CreateRGBSurfaceWithFormat
* Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
2022-11-29 09:40:09 -08:00
Sam Lantinga 6873082c34 Fixed building on Windows with SDL_VIDEO=OFF
Fixes https://github.com/libsdl-org/SDL/issues/6562
2022-11-29 09:29:42 -08:00
Sam Lantinga f077c69193 Fixed bug #6698 - VISA: wrong check sceKernelPollSema 2022-11-29 08:50:51 -08:00
pionere 461a38ff1a thread: code style 2022-11-29 08:44:10 -08:00
Sylvain 38c281fbc0
Fixed bug #6698 - VISA: wrong check sceKernelPollSema 2022-11-29 16:14:23 +01:00
pionere f6db1aba66 thread: return -1 from SDL_SemWaitTimeout if semaphore is NULL 2022-11-29 09:40:32 -05:00
pionere 6875e1c262 thread: fix inconsistent return values
- SDL_CreateMutex returns NULL when the creation fails (ngage)
- SDL_SemValue returns 0 when the semaphore is NULL (n3ds)
2022-11-29 09:26:12 -05:00
Sam Lantinga b5076ef5e3 Added support for the Xbox Elite controller paddles with firmware version 5.13+ 2022-11-28 23:15:23 -08:00
Vasily Khoruzhick dbaeb2b9e9 Add support for the 8BitDo Ultimate Wireless 2.4GHz Controller in DirectInput mode
Generated using controller map
2022-11-28 17:47:09 -08:00
Sam Lantinga 04399e1fc2 Added support for the 8BitDo Ultimate Wired Controller in DirectInput mode, including the misc button and paddles 2022-11-28 14:54:56 -08:00
Sam Lantinga 5efca283d3 Add 8BitDo to the list of Xbox 360 third party vendors
Allows detection of the 8BitDo Ultimate Wired Controller
2022-11-28 14:54:36 -08:00
Sam Lantinga c2432f8d0d Rename SDLmain to SDL_main and SDLtest to SDL_test for consistency with other SDL libraries 2022-11-28 10:57:59 -08:00
Sam Lantinga b4ebb3b568 Windows borderless windows interact better with the window manager
This behavior more closely matches other platform where the window is borderless but still interacts with the window manager (e.g. task bar shows above it, it can be resized to fit within usable desktop area, etc.)

If you want a borderless window the size of the desktop that looks like a fullscreen window, then you should use the SDL_WINDOW_FULLSCREEN_DESKTOP flag.

Fixes https://github.com/libsdl-org/SDL/issues/6659
2022-11-28 09:32:39 -08:00
Sam Lantinga 62f4fc6f35 Be explicit that we support the MSB variants of the 1bpp and 4bpp surface formats
Fixes https://github.com/libsdl-org/SDL/issues/6242
2022-11-28 09:06:44 -08:00
Samuel Venable 4f5e9fd5bd [skip ci] Solaris getexecname() returns argv[0]
`argv[0]`/`getexexname()` are not always absolute paths by default and can be modified to anything the developer wants them to be.

Consider using `readSymLink("/proc/self/path/a.out")` instead and `getexecname()` as the fallback, since the symlink will always be the correct absolute path (unless /proc is ot mounted, but it is by default on Solaris and Illumos platforms).
2022-11-27 21:29:07 -05:00
Markus Mittendrein f3c466ec1e
SDL_ResampleAudio: Fix float accumulation error
While 78f97108f9 reduced the accumulation error, it was still big enough to cause distortions.
Fixes #6196.

(cherry picked from commit 8145212103)
2022-11-27 21:15:44 -05:00
Sylvain Becker 6a2200823c
Cleanup add brace (#6545)
* Add braces after if conditions

* More add braces after if conditions

* Add braces after while() conditions

* Fix compilation because of macro being modified

* Add braces to for loop

* Add braces after if/goto

* Move comments up

* Remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements after merge

* Fix inconsistent patterns are xxx == NULL vs !xxx

* More "{}" for "if() break;"  and "if() continue;"

* More "{}" after if() short statement

* More "{}" after "if () return;" statement

* More fix inconsistent patterns are xxx == NULL vs !xxx

* Revert some modificaion on SDL_RLEaccel.c

* SDL_RLEaccel: no short statement

* Cleanup 'if' where the bracket is in a new line

* Cleanup 'while' where the bracket is in a new line

* Cleanup 'for' where the bracket is in a new line

* Cleanup 'else' where the bracket is in a new line
2022-11-27 08:38:43 -08:00
Sasha Szpakowski 80a9397459 Remove SDL_HINT_IDLE_TIMER_DISABLED.
SDL_DisableScreenSaver can be used instead. Fixes #6660.
2022-11-27 08:23:02 -08:00
Sam Lantinga 0a48abc860 Switch header convention from #include "SDL.h" to #include <SDL3/SDLh>
I ran this script in the include directory:
```sh
sed -i '' -e 's,#include "\(SDL.*\)",#include <SDL3/\1>,' *.h
```

I ran this script in the src directory:
```sh
for i in ../include/SDL3/SDL*.h
do hdr=$(basename $i)
   if [ x"$(echo $hdr | egrep 'SDL_main|SDL_name|SDL_test|SDL_syswm|SDL_opengl|SDL_egl|SDL_vulkan')" != x ]; then
        find . -type f -exec sed -i '' -e 's,#include "\('$hdr'\)",#include <SDL3/\1>,' {} \;
    else
        find . -type f -exec sed -i '' -e '/#include "'$hdr'"/d' {} \;
    fi
done
```

Fixes https://github.com/libsdl-org/SDL/issues/6575
2022-11-26 22:15:18 -08:00
Joshua Root 9a64aa6f95 Fix build with Xcode < 7
The _Nullable attribute is not available in older versions.
2022-11-26 20:35:57 -08:00
Sam Lantinga 9c8369e097 Temporary hack to address performance issues in https://github.com/libsdl-org/SDL/issues/6581#issuecomment-1327987916 (thanks @icculus!) 2022-11-26 13:09:50 -08:00
Sam Lantinga bb5568ac4f Fixed HAVE_SIGNAL_SUPPORT typo in commit 63f307fe1f (thanks @sezero!) 2022-11-26 12:52:23 -08:00
Sam Lantinga a268c841e3 Remove references to STDC_HEADERS (thanks @sezero!) 2022-11-26 12:51:20 -08:00
Sam Lantinga 581f1ca5c8 We should only mark functions as inline if necessary for performance 2022-11-26 11:18:24 -08:00
Ryan C. Gordon fa5adcafd5 cocoa: Patched to compile on macOS SDK < 10.10.
Fixes #6586.
2022-11-26 13:57:45 -05:00
Ozkan Sezer 141bc25198 SDL_rwops.c: reduce ifdefs, and mark SDL_RWFromFP() as SDL_INLINE. 2022-11-26 20:11:20 +03:00
Ryan C. Gordon 80c1ddbe97
dynapi: Bumped dynapi version to 2, so SDL2 libs don't conflict. 2022-11-26 09:49:18 -05:00
Sam Lantinga ce9f3173cd Only use memset_pattern4() if we have string.h on Apple platforms 2022-11-26 05:25:57 -08:00
Sam Lantinga bde808cd87 Fixed some warnings when building on Linux with -DSDL_LIBC=OFF 2022-11-26 05:18:26 -08:00
Sam Lantinga e9014ee769 Fixed evdev using standard C functions instead of SDL functions 2022-11-26 05:01:03 -08:00
Sam Lantinga 45cbee81df Fixed kmsdrm using standard C functions instead of SDL functions 2022-11-26 04:58:55 -08:00
Sam Lantinga 63f307fe1f Remove SDL_config.h from the public headers
The SDL headers are no longer dependent on the build configuration.

Fixes https://github.com/libsdl-org/SDL/issues/6643 and https://github.com/libsdl-org/SDL/issues/6641
2022-11-26 04:48:36 -08:00
Sam Lantinga b6b29fd071 Updated Metal shaders 2022-11-25 16:07:09 -08:00
Sam Lantinga cc1f9eb983 Use Apple's nomenclature for macOS and iOS
Fixes https://github.com/libsdl-org/SDL/issues/6621
2022-11-25 16:00:06 -08:00
Frank Praznik 873ec097ea x11: Remove deprecated/defunct X11 hints
SDL_HINT_VIDEO_X11_FORCE_EGL was deprecated in favor of the more general SDL_HINT_VIDEO_FORCE_EGL, and Xinerama and Xvidmode support was previously removed from SDL, rendering their associated hints nonfunctional.
2022-11-25 13:46:47 -08:00
Sam Lantinga 346eeba210 Removed SDL_GetRevisionNumber()
Fixes https://github.com/libsdl-org/SDL/issues/6620
2022-11-25 13:36:14 -08:00
slime ac8fbb7040 Remove SDL_CalculateGammaRamp. 2022-11-25 13:28:56 -08:00
slime 52f4cc843d Remove SDL_SetWindowBrightness and SDL_SetWindowGammaRamp. 2022-11-25 13:28:56 -08:00
Ozkan Sezer ab8df9096c fix copy/paste typo in previous commit. 2022-11-25 23:20:00 +03:00
Ozkan Sezer f3fe8ea7ad fix CI windows errors again (because of unused stdio reader callbacks.) 2022-11-25 23:15:02 +03:00
Ozkan Sezer de0cca91d4 fix CI windows errors because of SDL_RWFromFP() 2022-11-25 22:55:30 +03:00
Ozkan Sezer 0b8309da0c renamed SDL PI constants to SDL_PI_D and SDL_PI_F. 2022-11-25 22:35:24 +03:00
Sam Lantinga 05139f4a2e Removed SDL_RWFromFP from the public API
This will blow up if the SDL library and the application have a different C runtime, which can easily happen on Windows.
2022-11-25 10:46:26 -08:00
Sam Lantinga 670f1df469 Removed SDL_stdinc.h dependency on HAVE_M_PI, added SDL_M_PIl (double) and SDL_M_PIf (float) instead 2022-11-25 10:33:37 -08:00
Sam Lantinga fa3814ddf1 Removed SDL_rwops.h dependency on stdio.h 2022-11-25 09:55:42 -08:00
Michael Fitzmayer 67f31a19a8 Add bitdraw.h, remove non-working stub class 2022-11-24 13:12:36 -08:00
Sylvain Becker 4f780c7319 SDL_mfijoystick.m: remove VLA, so that projects can be built with error on vla 2022-11-24 16:07:03 +01:00
Frank Praznik 836eb22442 wayland: Fix build when not using the shared Wayland libraries
Explicitly include the Wayland protocol headers when statically linking against the Wayland libraries or older system headers might be used instead of the local versions.
2022-11-24 03:00:56 -08:00
Sam James 3e7952ce8a Avoid use of deprecated egrep/fgrep
GNU grep 3.8 emits a deprecation warning on use of egrep/fgrep.

Signed-off-by: Sam James <sam@gentoo.org>
2022-11-24 02:58:20 -08:00
Joshua Root 239423e205 vulkan_metal.h: Make compatible with ObjC ARC
Fixes #6598
2022-11-23 17:37:38 -08:00
Frank Praznik f47169fcba wayland: Fix libdecor_dispatch signature
The function returns an int, not a bool.
2022-11-23 15:16:37 -08:00
Sam Lantinga 003fd11de8 Regenerated dynamic API after SDL_syswm.h update 2022-11-23 14:34:21 -08:00
Sam Lantinga b0840eb32e Updated SDL_syswm.h for SDL 3.0
* The header is no longer dependent on SDL build configuration
* The structures are versioned separately from the rest of SDL
* SDL_GetWindowWMInfo() now returns a standard result code and is passed the version expected by the application
* Updated WhatsNew.txt and docs/README-migration.md with the first API changes in SDL 3.0
2022-11-23 14:05:59 -08:00
Joshua Root 53ca1f7702 SDL_mfijoystick.m: fix build with Xcode < 9
Fixes #6601.
2022-11-23 12:47:46 -08:00
Joshua Root f8cebeea59 Check build-time SDK in LoadMainMenuNibIfAvailable
Fixes building against OS X 10.7 SDK.
2022-11-23 12:27:50 -08:00
Joshua Root d2910904fb SDL_cocoaopengl.h: ensure CVDisplayLinkRef is defined
The typedef seems to be pulled in coincidentally with newer SDKs, but
older ones need to import the header explicitly.
2022-11-23 12:21:31 -08:00
Ozkan Sezer dcad446066 fix dynapi after SDL_GDKSuspendComplete addition. 2022-11-23 23:04:25 +03:00
Sam Lantinga d5ff71d685 Updated dynamic API after 040a17a50f 2022-11-23 11:55:02 -08:00
Ciro Mondueri 896e200d94 adds GDK suspend/resume basic handling (#6596)
(cherry picked from commit f6144dfe03)
2022-11-23 11:54:16 -08:00
pionere 450f184f7d use SDL_InvalidParamError in the thread 'classes' 2022-11-23 14:27:26 -05:00
Joshua T. Fisher 61188d4972
Allow Foreign Windows to call SDL_Vulkan_CreateSurface on MacOS (#6436) 2022-11-23 11:13:33 -08:00
Cameron Cawley 4ee4e49e49 Select the best pixel formats for use in the software renderer 2022-11-23 11:08:40 -08:00
Ryan C. Gordon 712457ec28
Merge pull request #6321 from Daft-Freak/no-ie
Delete emscripten CanvasPixelArray (IE10/11) support
2022-11-23 14:03:35 -05:00
Ryan C. Gordon dcd9e21966
Merge branch 'main' into wip/angle-egl 2022-11-23 14:01:17 -05:00
Ryan C. Gordon 3983c98ece
Merge branch 'main' into no-ie 2022-11-23 13:46:27 -05:00
Rémy Tassoux a94d2e929d Prevent the delay conversion result from being truncated to 32bits 2022-11-23 10:44:53 -08:00
Rémy Tassoux 7d5ffbdab7 Use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag in SDL_Delay on Windows 10 version 1803 and later 2022-11-23 10:44:53 -08:00
Sam Lantinga a635a485bc Re-added WinRT support until we're sure that it's no longer being used 2022-11-23 10:41:43 -08:00
Ryan C. Gordon c2f26087c8
Merge branch 'main' into em-webgl-selector-hint 2022-11-23 13:22:23 -05:00
Yevhen Babiichuk (DustDFG) a05b2fbeee Use alias types for which members of event structs instead of plain types
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2022-11-23 10:19:13 -08:00
Susko3 8f991d7576 Define TOUCHEVENTF_PEN if not defined 2022-11-23 10:09:08 -08:00
Susko3 42796c56a9 Differentiate between Windows Ink (pen) and regular touch input 2022-11-23 10:09:08 -08:00
Ozkan Sezer 34231f5ba0 reverted opengles removal. 2022-11-23 18:50:02 +03:00
Ozkan Sezer 016b757311 reverted jack audio backend removal. 2022-11-23 06:50:20 +03:00
Ethan Lee ecc4b8773c
wasapi: Removed WinRT PrivateAudioData members 2022-11-22 17:12:56 -05:00
Ethan Lee 57458588ee wasapi: Merge wasapi_win32.c into wasapi.c 2022-11-22 16:46:12 -05:00
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Ozkan Sezer 7df102d220 reverted sndio backend removal. 2022-11-22 22:04:10 +03:00
Sam Lantinga 3b318f981e Removed G29 from controller_type.c
We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit dce6ed56d7)
2022-11-22 10:57:45 -08:00
Sam Lantinga 189f71efb3 Revert "Added Linux mappings for the Logitech G29 in PS3 and PS4 modes"
This reverts commit 33a68f575f.

We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit e3d430b83e)
2022-11-22 10:57:39 -08:00
Ozkan Sezer 30b1ab2add removed opengles. 2022-11-22 21:48:40 +03:00
Ozkan Sezer 3cccaeba6c removed jack audio remnants. 2022-11-22 20:51:07 +03:00
Ozkan Sezer 3aea865cdf removed directfb support. 2022-11-22 20:45:45 +03:00
Ozkan Sezer 5cedc2f1ff removed QNX support. 2022-11-22 20:23:40 +03:00
Ozkan Sezer e89a1f9157 removed NaCL support. 2022-11-22 20:10:47 +03:00
Ozkan Sezer cdb54ad21e removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. 2022-11-22 19:51:56 +03:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Ozkan Sezer 63243eb3a5 removed pandora support 2022-11-22 18:50:00 +03:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga d167cd6715 Added the Gunfighter Mk.III ‘Space Combat Edition’ as a flight stick 2022-11-21 09:02:10 -08:00
Sam Lantinga 8b20b568b0 Don't report battery level for disconnected batteries
Fixes https://github.com/libsdl-org/SDL/issues/6536
2022-11-21 07:42:14 -08:00
Frank Praznik fe396e306e wayland: Use the cached window size when switching from non-floating to floating window state
When changing the window state from non-floating to floating (e.g. leaving fullscreen), libdecor can send bogus content sizes that are +/- the height of the window title bar and start 'walking' the window height in one direction or the other with every transition.

The floating window size is known, so use the cached value instead of the size reported by libdecor when restoring the floating state.
2022-11-19 09:15:27 -08:00
Sam Lantinga 509939b1b6 Disable the third party PS3 HIDAPI driver by default, the L3/R3 buttons are unknown 2022-11-18 18:20:53 -08:00
Sam Lantinga ff99e56d3a Fixed KMSDRM window creation failing if OpenGL libraries are not available, but GLES 2.0 libraries are 2022-11-18 12:54:55 -08:00
Sam Lantinga da9ba3a2a1 If a CRTC doesn't have a mode configured, use the preferred or largest mode as the default mode
Fixes https://github.com/libsdl-org/SDL/issues/6421
2022-11-18 12:17:27 -08:00
Sam Lantinga ea4ea27a59 Don't trigger an error if we try to delete a touch device after shutting down the touch system
This can happen on Raspberry Pi if the display system fails to initialize.
2022-11-18 11:14:14 -08:00
David Gow 81479d8784 wayland: keyboard: Cache text input parameters.
Some applications (and embarrassingly, testime is one of them) call
SDL_StartTextInput() or SDL_SetTextInputRect() every frame. On KDE/KWin
with fcitx5, this causes there to be several preedit events every frame
(particularly given some of the workarounds in Wayland_StartTextInput),
which slows testime down to an unusable crawl.

Instead, make SDL_StartTextInput() a no-op if text input is already
enabled, and cache the input rect, only changing it when the new rect is
actually different.

With these changes, we only get preedit events (and hence
SDL_TEXTEDITING events) when the preedit string actually changes. This
matches the behaviour under XWayland, and works very smoothly.
2022-11-18 07:18:36 -08:00
Ozkan Sezer 6dc96aa745 SDL_UDEV_DelCallback: return early if _this is NULL
Fixes https://github.com/libsdl-org/SDL/issues/6548
2022-11-18 18:02:10 +03:00
Sylvain 16824865c2 Cleanup of SDL_SetError that already return -1 value 2022-11-18 06:59:10 -08:00
Sylvain 3e70553c48 Unneed test before calling SDL_FreeSurface 2022-11-18 06:58:34 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Sylvain 89572af6a8
Fixed bug #6537 - AIX: use PAUDIO_WaitDevice 2022-11-17 11:43:46 +01:00
Sylvain cd0d5a5fc5
Don't compare pointer against '0', but NULL 2022-11-17 11:23:15 +01:00
Sylvain ddad901c0d
Remove unneeded semicolon 2022-11-17 10:43:45 +01:00
Sylvain 60c6cd554d
Fixed bug #6533 - PS2_JoystickUpdate: some invalid condition 2022-11-17 09:34:27 +01:00
Sam Lantinga 77bcd269be Allow creating an empty surface with pitch 0
This fixes Maelstrom, which creates an empty staging surface and then uses it for transfer to texture
2022-11-16 22:23:16 -08:00
Ryan C. Gordon a1702d463c
ibus: Try to use org.freedesktop.portal.IBus first if available.
This should fix apps that want ibus support inside sandboxed environments
like FlatPak or Snaps.

Fixes #4706.
2022-11-16 23:39:41 -05:00
Ryan C. Gordon bb0b8adacc mac: Fix handling of deprecated symbol.
This needs to check what our deployment target is, not what SDK
is available, since this is a linker symbol and not an enum
value or whatever.

Also removed a copy/paste error that mentioned CoreAudio in
the haptic subsystem.

Fixes #6534.
2022-11-16 22:04:04 -05:00
Sam Lantinga 913e403f2a Fixed error message when trying to create an OpenGLES2 renderer on macOS
Testing: testsprite2 --renderer opengles2

OpenGLES2 isn't available by default, and we want to see the error "Could not load EGL library"
2022-11-16 18:03:29 -08:00
Sam Lantinga fcc994e132 ensure that SDL2 does not set conflicting window flags (thanks @pionere!) 2022-11-16 17:40:32 -08:00
Sylvain ce5da5d579
Don't compare pointer against '0', but NULL 2022-11-16 21:47:43 +01:00
Sylvain 1d7966df15
Remove un-needed check for NULL pointer. They were previously checked just before. 2022-11-16 21:27:16 +01:00
Frank Praznik 8ea96f365f events: Remove X and XKB keysym constants and headers
The XKB_KEY_* and XK_* macros resolve to the same constant values, so use the raw values and note what keys they correspond to in the comments, as is done for the other keysym values in this file.

This completely eliminates the need for any X or XKB system headers along with the if/else defines.
2022-11-16 11:42:53 -08:00
Ryan C. Gordon 389ffab733 Code style fixes, etc.
Reference PR #6345.
2022-11-16 12:53:48 -05:00
ulatekh ec58a817ef Fixes made in response to running a static code analyzer under MS Windows.
Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs.

SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision.
SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer.
SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used.
SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range.
SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it.
SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691).
SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen.
SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL.
SDL_pixels.c: Looks like the switch is genuinely missing a break!
SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons.
SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns.
2022-11-16 12:43:20 -05:00
Ryan C. Gordon 7ebdae5dc9 cocoa: Fix OpenGL deprecation warning. 2022-11-16 11:45:41 -05:00
Ryan C. Gordon 7c760f7f79 cocoa: Update CVDisplayLink timing when screen changes.
This handles both the window moving to a new display and
changing the current display's refresh rate in System
Preferences

Reference Issue #4918.
2022-11-16 11:35:27 -05:00
Ryan C. Gordon 1fd66cc890 Revert "cocoa: Backed out CVDisplayLink code for macOS vsync."
This reverts commit 04b50f6c6b.

It turns out OpenGL vsync has broken again in macOS 12, so
we're reintroducing our CVDisplayLink code to deal with it,
again.

Reference Issue #4918.
2022-11-16 11:34:25 -05:00
Ryan C. Gordon 9d67686a5b haptic: Deal with deprecated macOS symbol. 2022-11-16 10:08:40 -05:00
Ryan C. Gordon 6801d676c0
Revert "pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small."
This reverts commit d8b1ef42ae.

This turned out to be unnecessary (it was a problem on the user's system,
not an SDL bug).

Reference Issue #6121.
2022-11-16 09:53:37 -05:00
Frank Praznik 903301c6aa wayland: Always use integer scaling for cursors.
Cursors don't get fractionally scaled, so always scale system cursor sizes to the next whole integer.
2022-11-16 06:15:17 -08:00
Ryan C. Gordon d8b1ef42ae
pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small.
Fixes #6121.
2022-11-15 22:44:31 -05:00
Sam Lantinga 02ab7f3745 Fixed release build using clang on Windows 2022-11-15 12:57:07 -08:00
Sam Lantinga 98f93d0aa1 Fixed building without xkbcommon support 2022-11-15 11:39:06 -08:00
Sam Lantinga 615901dbfe Removed unnecessary header
The xkbcommon-keysyms.h header isn't available on some older systems,
and we don't actually need it for this code.
2022-11-15 11:19:08 -08:00
Frank Praznik c855184765 wayland: Handle virtual keyboards that don't fit the X mapping
SDL is built around the concept of keyboards having a fixed layout with scancodes that correspond to physical keys no matter what linguistic layout is used. Virtual keyboards don't have this concept and can present an arbitrary layout of keys with arbitrary scancodes and names, which don't fit the SDL model. When one of these keyboards is encountered, it requires special handling: use the keysym of the pressed keys to derive their ANSI keyboard scancode equivalents for control keys and ASCII characters. All other characters are passed through as text events only.
2022-11-15 11:00:39 -08:00
Frank Praznik d1858eb124 events: Add a helper function to get the default keycode for a scancode
Add a helper function to get the keycode for a scancode from the default lookup table. Unlike SDL_GetKeyFromScancode(), this is not affected by the set keymap.
2022-11-15 11:00:39 -08:00
Frank Praznik 0e446c54bd events: Factor out the xkb keysym to scancode conversion from the X11 driver 2022-11-15 11:00:39 -08:00
Ryan C. Gordon 44d7b8b91d
egl: Check for a NULL pointer in SDL_EGL_GetProcAddress.
This happens on kmsdrm if you try to GetProcAddress before creating
a window.

Fixes #5399.
2022-11-15 13:59:24 -05:00
Ethan Lee f3cc99fb93
x11: Minor style fixes for recent OSK changes 2022-11-15 13:56:44 -05:00
Sam Lantinga 70656b133c Don't recreate the window when creating a Metal renderer on an OpenGL window.
It turns out that we can safely create a Metal view on an existing window, and that avoids issues with the window being recreated with the wrong orientation in iOS 16.

Fixes https://github.com/libsdl-org/SDL/issues/6289
2022-11-15 10:21:07 -08:00
Pierre Wendling 80ff20f6fe N3DS: Set keyboard focus to newly created windows.
This fixes polling issues with Joystick subsystem where
`SDL_PrivateJoystickShouldIgnoreEvent` would always return true, thus
ignoring all inputs.
2022-11-14 21:24:10 -08:00
Pierre Wendling 491d0bcc3c N3DS: Refactor N3DS_FileOpen. 2022-11-14 21:24:10 -08:00
Pierre Wendling de5fa89b50 N3DS: Prepend PrefPath with sdmc:. 2022-11-14 21:24:10 -08:00
Pierre Wendling 7d536d5240 N3DS: Put SDL_Log.txt in the proper directory.
The homebrew "user" directory should be `/3ds/`.
To avoid ambiguity, `sdmc:` is specified.
2022-11-14 21:24:10 -08:00
Pierre Wendling bf4f9aaa63 N3DS: Use designated initialiser for drivers.
Just a sanity check that the functions are actually mapped correctly.
2022-11-14 21:24:10 -08:00
Sam Lantinga a40b7cde10 Workaround for views being in portrait instead of landscape mode on iOS 16
Fixes https://github.com/libsdl-org/SDL/issues/6289
2022-11-14 13:03:52 -08:00
pionere b886f4c6c9 events: eliminate redundant code in SDL_SendEditingText 2022-11-14 09:00:45 -08:00
pionere dad8df3ed1 video: check graphics flags the same way in SDL_RecreateWindow as in SDL_CreateWindow
- single check to validate the graphics flags
- check it before tearing down the window
2022-11-14 07:53:41 -08:00
Frank Praznik eef4d3c86a wayland: Clamp wl_seat version on older versions of libwayland
Clamp the wl_seat max version to 5 if being built against a version of libwayland below 1.21.0, or containers that bundle newer versions of SDL with older versions of libwayland can break if the compositor advertises support for a protocol version above 5.
2022-11-13 17:48:14 -06:00
Sam Lantinga 674989261d Fixed warning
Fixes https://github.com/libsdl-org/SDL/issues/5842
2022-11-13 11:09:39 -08:00
Ethan Lee c4b9f62164 x11: Add support for the Steam Deck on-screen keyboard 2022-11-13 11:02:27 -08:00
pionere 5f2a1231dd video: check graphics flags the same way as the type flags 2022-11-13 08:31:50 -08:00
pionere 22354b4142 video: simplify window-type check in SDL_CreateWindow 2022-11-12 07:18:04 -08:00
Ryan C. Gordon 85aa9b8b6f
wasapi: Favor the system resampler again, for now.
Reference Issue #5538.
2022-11-11 13:48:11 -05:00
Sam Lantinga 9f8b68a278 Fixed building without linux/input.h
https://github.com/libsdl-org/SDL/issues/6169
2022-11-11 10:25:52 -08:00
Sam Lantinga b7e65a81f1 Fixed incorrect WGI controller state when the application loses focus
Recenter the controller elements when WGI stops reporting valid state

Fixes https://github.com/libsdl-org/SDL/issues/5261
2022-11-11 08:58:27 -08:00
Michael Fitzmayer 875e9b35d7 N-Gage: additional cleanup 2022-11-11 05:04:28 -08:00
Michael Fitzmayer afbafc2aef Remove redundant dependency to bitdraw.h, minor cleanup 2022-11-11 05:04:28 -08:00
pionere d09edcbcac video: sync Metal_CreateView with GL_CreateContext and Vulkan_CreateSurface
no need to check if _this->Metal_CreateView, since it is already checked in Re(create)Window
2022-11-11 04:58:40 -08:00
pionere b71d927429 video: add NOT_AN_OPENGL_WINDOW define (similar to NOT_A_VULKAN_WINDOW) 2022-11-11 04:58:40 -08:00
pionere 36c6ed4b6f video: add SDL_DllNotSupported
- add SDL_DllNotSupported and use it to sync the behavior of SDL_GL_LoadLibrary with SDL_Vulkan_LoadLibrary
2022-11-11 02:53:30 -08:00
Sam Lantinga 0dfc829a6b Added simple BLE Steam Controller support on all platforms
This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM
2022-11-10 19:17:04 -08:00
Steven Noonan 3d8a7e4c15
cocoa: implement GL_GetDrawableSize for OpenGL ES 2022-11-10 18:06:12 -08:00
Steven Noonan e8fbb02d16
windows: support forcing EGL for GL desktop
This will theoretically support ANGLE's GL desktop frontend whenever it
becomes fully implemented and enabled in the future.
2022-11-10 18:06:12 -08:00
Steven Noonan 085a276d6c
egl: implement callbacks for defining custom EGL attributes
Depending on the underlying EGL library, it may be desirable to
conditionally set some specific EGL attributes depending on available
extensions and other application state.

SDL's EGL usage makes this a little bit complicated because:

- there are multiple functions used to set up a working EGL context
- some of these functions take different types of EGL attributes
  (EGLAttrib vs EGLint)
- the EGL extension list before creating an EGLDisplay differs from the
  extension list after (i.e. display vs client extensions)
- all of the above happens in a single SDL_CreateWindow call

This leaves no place for the application to discover what EGL extensions
are available and provide custom attribute lists.

Until now, if a developer wants to add a custom EGL attribute for
eglGetPlatformDisplay, eglCreateWindowSurface or eglCreateContext, they
needed to patch SDL itself. This is very undesirable, since such
developers would have to disable the SDL dynapi in order to maintain
compatibility with their needs.

This patch implements some callbacks which developers can use to
dynamically generate custom EGL attributes for SDL to use during
SDL_CreateWindow.
2022-11-10 18:06:12 -08:00
Steven Noonan 0644042eb8
egl: implement public functions to obtain internal EGL handles
These functions allow applications to call EGL functions against the SDL
EGL context. For example, applications can use an EGL API loader via
SDL_EGL_GetCurrentDisplay and SDL_EGL_GetProcAddress, and can call
functions such as eglQuerySurface against the internal EGLSurface and
EGLDisplay.
2022-11-10 18:06:11 -08:00
Steven Noonan eacf6dc15e
egl: fix function prototype for eglGetPlatformDisplay
The EGL 1.5 specification says that eglGetPlatformDisplay (unlike
eglGetPlatformDisplayExt) takes an EGLAttrib* rather than EGLint* for
the attribute list.
2022-11-10 18:06:11 -08:00
Steven Noonan fb1a581209
egl: add hint to disable eglGetDisplay fallback when eglGetPlatformDisplay fails
This fallback is undesirable when using ANGLE, because it will end up
using some default configuration (e.g. on Windows it defaults to the
D3D11 backend).
2022-11-10 18:06:11 -08:00
Steven Noonan c608cf6222
egl: implement SDL_GL_EGL_PLATFORM attribute
This implements a new SDL_GL_EGL_PLATFORM attribute to set the
"platform" argument for SDL_EGL_LoadLibrary on Windows, macOS, and
Linux. I've limited it to those three operating systems because that's
what I've been able to test against.
2022-11-10 18:06:11 -08:00
Steven Noonan aed980526c
SDL_video: defer destroying window until GL/EGL/Vulkan unloaded 2022-11-10 18:06:11 -08:00
Steven Noonan 5a7c20b945
hints: replace SDL_HINT_VIDEO_X11_FORCE_EGL with platform-agnostic SDL_HINT_VIDEO_FORCE_EGL
This adds support for forcing the use of EGL on Windows and MacOS. The
SDL_HINT_VIDEO_X11_FORCE_EGL hint is retained for backwards
compatibility but is now deprecated.
2022-11-10 18:06:10 -08:00
Sam Lantinga f430ef5ddc Don't change the window position when creating it on iOS, it is already placed on the correct display 2022-11-10 17:27:48 -08:00
Sam Lantinga 7c05ea0a0e Added mappings for the GameSir T3 and T4 Pro controllers 2022-11-10 13:35:59 -08:00
Sam Lantinga 404cb27677 Added macOS mappings for the Nintendo Switch Pro Controller over Bluetooth 2022-11-10 13:28:03 -08:00
pionere 29cafa9c94 add SDL_ContextNotSupported and validate flags in SDL_RecreateWindow similar to SDL_CreateWindow 2022-11-10 06:56:24 -08:00
Ryan C. Gordon 1008cc8e5f
video: Add some braces to match SDL coding style. 2022-11-09 12:55:27 -05:00
pionere ac3349faaf solve FIXMEs in SDL_video.c 2022-11-09 12:54:07 -05:00
pionere e5c599f8c6 fix SOLARIS_ATOMICS
- use 'sizeless' int types (int uses 32-bit even if _LP64 is set)
2022-11-09 12:45:14 -05:00
pionere b095df7f5c simplify MSC_ATOMICS
- use _Interlocked(Compare)ExchangePointer in case of _M_IX86 as well
- improve assertions:
  1. add assertions to SDL_AtomicAdd/SDL_AtomicSet and SDL_AtomicCAS
  2. use sizeof(a->value) instead of sizeof(int)
2022-11-08 10:32:31 -08:00
meyraud705 3dc88da022 Fix Dualshock 4 rumble stopping too early
Dualshock 4 controller only rumbles for 5 seconds maximum. Resend
rumble command every 2 seconds to make long rumble work.
2022-11-08 10:30:11 -08:00
Sam Lantinga 6432f45a1c Don't treat the Nintendo IMU as a separate game controller on Linux 2022-11-08 10:27:21 -08:00
Sam Lantinga 2e3b4f3fd7 Don't send rumble to the Amazon Luna controller on macOS
Sending rumble to the Amazon Luna controller on macOS gets there, but IOHIDDeviceSetReport() blocks for a long time and eventually fails.

This appears to be a bug in the macOS Bluetooth stack, ref rdar://99265496
2022-11-08 07:50:51 -08:00
Sam Lantinga 02bc359b64 Shorten "Bensussen Deutsch & Associates,Inc.(BDA)" to "BDA" for controller names 2022-11-07 19:31:18 -08:00
Ryan C. Gordon b0dc6709b9 coreaudio: Don't use deprecated kAudioObjectPropertyElementMaster symbol.
Fixes #6449.
2022-11-07 14:26:48 -05:00
pionere e873d60981 fix handling of SDL_EventQ.active
- SDL_EventQ.active is a bool variable -> do not use SDL_AtomicGet/Set, it does not help in any way
- protect SDL_EventQ.active with SDL_EventQ.lock
- set SDL_EventQ.active to FALSE by default
2022-11-07 09:12:37 -08:00
pionere eb670742f5 better SDL_AtomicGet(Ptr) implementation 2022-11-07 09:09:37 -08:00
Hubert Maier 5dc93451d2
JANITORIAL : Correct some more spelling mistakes (#6489) 2022-11-06 11:49:37 -08:00
Sam Lantinga c2675d74c5 Revert "cocoa: Discard the IME Candidate Window immediately when Escape is pressed"
This reverts commit 0d76e2a8a1, as it introduced other issues:
https://github.com/libsdl-org/SDL/pull/6486#issuecomment-1304684865
2022-11-06 10:52:20 -08:00
Sam Lantinga f2ce7c5fb2 Added the G29 as a PlayStation controller 2022-11-06 08:23:08 -08:00
Sam Lantinga 9d1dbd2ad8 Added note about trigger rumble availability across third-party Xbox One controllers 2022-11-06 01:16:52 -08:00
Sam Lantinga e7a56323ab Make sure we wait after sending the rumble packet when initializing the PowerA Xbox One Mini Wired Controller 2022-11-06 01:43:05 -07:00
Sam Lantinga 6875e62af3 Make sure we don't send Xbox controllers rumble so quickly that it overwhelms the firmware
Fixes https://github.com/libsdl-org/SDL/issues/6435
2022-11-06 01:15:20 -07:00
Sam Lantinga 38af459dd9 Fixed potential clobbering of packets of different types using SDL_HIDAPI_SendRumble() 2022-11-06 01:15:19 -07:00
Sam Lantinga e45cb5b1e2 Fixed initializing the PowerA Xbox One Mini Wired Controller 2022-11-06 01:15:18 -07:00
Edward Li 0d76e2a8a1 cocoa: Discard the IME Candidate Window immediately when Escape is pressed 2022-11-05 17:03:10 -07:00
Sam Lantinga 15a9890919 Added SDL_HINT_HIDAPI_IGNORE_DEVICES to specify devices that should be ignored in SDL_hid_enumerate() 2022-11-05 16:44:52 -07:00
Sam Lantinga 297ecb706d Added SDL_strcasestr() for a case insensitive version of SDL_strstr() 2022-11-05 15:58:30 -07:00
Sam Lantinga a4626dea8d Fixed initializing the PDP Xbox One and Victrix Gambit controllers 2022-11-05 14:24:41 -07:00
Sam Lantinga 7e11b09b3b The PowerA Xbox One Mini Wired Controller works with the HIDAPI driver now 2022-11-05 13:50:37 -07:00
Sam Lantinga a2d66b6a91 SDL_GameControllerMapping() should return the string for the actual mapping that was used when opening a gamecontroller, rather than do a GUID match again
Also don't match against the zero guid if that happens to be in the mapping list for some reason
2022-11-05 13:12:10 -07:00
Stefan Sperling f3bf543e2a recognize game controllers connected via raphnet technologies WUSBMote v2.2
This is a USB adapter for controllers shipped with Nintendo's NES-mini and
SNES-mini consoles.
Tested with both NES and SNES controllers, buttons map as expected on both.
2022-11-05 10:35:07 -07:00
Sam Lantinga 24cdebe464 Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the Xbox button LED on the Xbox One controller 2022-11-05 10:34:08 -07:00
Ryan C. Gordon 78f97108f9
audio: Avoid accumulation errors in resampler.
Fixes #6391.
2022-11-05 10:39:35 -04:00
David Edmundson 689218ebf5 Fix wayland reconnection paths
Most of this code is disabled out for now.

- For mouse cursors we have a wl_surface for both system and custom
cursors which needs recreating.
 - The other patch is about nullification after deletions
2022-11-04 11:13:30 -04:00
Sam Lantinga 33a68f575f Added Linux mappings for the Logitech G29 in PS3 and PS4 modes 2022-11-03 16:02:58 -07:00
Sam Lantinga c70e675900 Wait a bit for devices to initialize before trying to enumerate and open them.
This works around udev event nodes arriving before hidraw nodes and the controller being opened twice - once using the Linux driver and once by the HIDAPI driver.

This also fixes a kernel panic on Steam Link hardware due to trying to open the hidraw device node too early.

A delay of 10 ms seems to be a good value, tested on Steam Link hardware.
2022-11-03 12:37:54 -07:00
Guldoman 084fa4c3fa cocoa: Reset IME when sending composed text
This will send an empty `TEXTEDITING` event that is used to signal the 
end of the composition.
2022-11-03 10:41:53 -07:00
Guldoman 70a41f9bc2 wayland: Read window data only if window is valid 2022-11-01 05:14:05 -07:00
Sam Lantinga b75d318776 Sometimes the HID open doesn't succeed immediately after being notified about the device
Tested on Steam Link hardware with the Nintendo Switch Pro controller, which will occasionally take 2 attempts to open.
2022-10-31 13:33:53 -07:00
Jasper Hugunin 27ee8c8e14 Fix mismatch between Init and Quit
Init says that audio implies events (line 195), Quit was missing the implication.
2022-10-31 11:22:40 -07:00
Frank Praznik 33a430056f wayland: Don't modify the mouse capture flag in relative mode
If relative mouse mode is explicitly enabled, don't modify the capture flag on button events or the window might report having lost mouse focus if a button is pressed while moving the cursor.
2022-10-31 10:13:58 -07:00
Hubert Maier 678ef7977f SDL_KMSDRMOPENGLES.H: Correct spelling mistakes
begining -> beginning
beggining -> beginning
2022-10-30 11:24:42 -04:00
Hubert Maier 8b9c82e140 SDL_RENDER_PSP.C: Correct spelling mistakes
wether -> whether
2022-10-30 11:24:42 -04:00
Hubert Maier 3369b0163f SDL_PS2_MAIN.C: Correct spelling mistake
untill -> until
2022-10-30 11:24:42 -04:00
Hubert Maier d7a46a16e9 SDL_SYSLOADSO.c: Correct spelling mistake
publically -> publicly
2022-10-30 11:24:42 -04:00
Hubert Maier 6a881302ad SDL_IBUS.H: Correct spelling mistake
recieve -> receive
2022-10-30 11:24:42 -04:00
Hubert Maier 61f3662c95 SDL_QSA_AUDIO.C: Correct spelling mistake
occured -> occurred
2022-10-30 11:24:42 -04:00
Ethan Lee 571ff1a3a9 wayland: Prepare cursor implementation for reconnect support
Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
2022-10-30 00:19:09 -04:00
Ethan Lee 9c8b1fd8b6 wayland: Cleanup work to aid reconnect support
Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
2022-10-29 22:41:42 -04:00
Sam Lantinga f6b1e028ab Allow vendor matching for hid_enumerate() on all backends 2022-10-29 10:43:11 -07:00
Sam Lantinga 4556074e18 Re-set the maximize state if we were maximized while fullscreen 2022-10-29 09:35:07 -07:00
Sam Lantinga ab06a307dc Don't report windows being maximized when fullscreen on X11
This is a functional state for some window managers (tested using stock Ubuntu 22.04.1), and removing that state, e.g. using SDL_RestoreWindow(), results in a window centered and floating, and not visually covering the rest of the desktop.
2022-10-29 09:21:17 -07:00
Ryan C. Gordon b9e1d1b4de events: Rename SDL_SendKeyboardKeyComplete to SDL_SendKeyboardKeyAndKeycode.+ 2022-10-28 16:19:00 -04:00
Ryan C. Gordon 9221548114 emscripten: Make an attempt at correct keyboard scancode/keycodes.
This uses a newer browser API to get physical scancodes, but still
uses the (deprecated) event field that we were already using for
scancodes, but for keycodes instead now, which appears to be more
accurate.

Since keyboard layout isn't (generally) available to web apps, this
adds an internal interface to send key events with both scancode
and keycode to SDL's internals, instead of sending just scancodes and
expecting SDL to use its own keymap to generate keycodes.

Future work in this area would be to use the keyboard layout APIs
on browsers that support them, which would allow us to use SDL's
usual keymap code and not rely on a deprecated browser API, but
until we get there, this patch gives significantly more correct
results than we would have before.

Fixes #2098.
2022-10-28 16:19:00 -04:00
Francisco Javier Trujillo Mata a8f019b1f0 Using ST and removing warnings 2022-10-28 11:42:44 -07:00
Francisco Javier Trujillo Mata f2ebedae92 adding texture function 2022-10-28 11:42:44 -07:00
Francisco Javier Trujillo Mata 5de01eb0aa Make render to use new functions 2022-10-28 11:42:44 -07:00
Sam Lantinga f500c14766 Fixed DirectFB build 2022-10-28 08:39:02 -07:00
Ryan C. Gordon 9e8d2f3948
video: Don't use texture framebuffer on Windows Subsystem for Linux.
Reference Issue #6333.
2022-10-27 13:54:53 -04:00
Frank Praznik 4223e6ac7a wayland: Early-out sooner when requesting fullscreen on a popup
Exit the fullscreen sequence sooner if it is requested that a popup window be fullscreen.

The surface commit formerly in this path is irrelevant and can be removed as previous changes made it so that SetFullscreen() is no longer called from anywhere except Wayland_SetWindowFullscreen().
2022-10-26 22:19:59 -04:00
Ryan C. Gordon 41d38c0f64 shape: More robust handling of failure cases in CreateShaper. 2022-10-26 13:57:49 -04:00
Ryan C. Gordon c8d20f96ba shape: Free platform-specific shaped window data.
Fixes #2128.
2022-10-26 13:57:49 -04:00
Frank Praznik 30c2dac787 wayland: Remove duplicate #include statement 2022-10-25 17:03:25 -07:00
Sam Lantinga 25d0473aad Removed Razer Onza Tournament Edition mapping
The controller can use either hat or buttons for the D-Pad, depending on what Linux driver is in use. The automatic mapping in LINUX_JoystickGetGamepadMapping() will do the right thing based on the exposed capability bits.

I'm sure this is the case for other controllers as well, so we might be removing more mappings over time.
2022-10-25 16:14:26 -07:00
Sam Lantinga e837debc25 Bindings should have a trailing comma, so the CRC can be appended 2022-10-25 16:13:50 -07:00
Sam Lantinga b6cf889af4 Use ScreenCount() instead of SDL_GetNumVideoDisplays()
The limitation appears to be specific to multi-screen setups
2022-10-25 15:10:50 -07:00
Sam Lantinga c74ea994a5 Added support for the Razer Raiju Tournament Edition controller in Bluetooth mode 2022-10-25 13:11:41 -07:00
Sam Lantinga 72f6e216dc Disabled debug logging 2022-10-25 12:25:57 -07:00
Sam Lantinga e3f5744db4 Don't use XIWarpPointer() on multi-display configurations 2022-10-25 12:14:00 -07:00
Alynne 5fbf8f6cf0 Adds DualSense Edge 2022-10-25 10:32:44 -07:00
Sam Lantinga da478d1f66 Fixed build 2022-10-25 10:30:56 -07:00
Sam Lantinga a6018ae57f Added support for the NVIDIA SHIELD controller v1.03 to the HIDAPI driver 2022-10-25 10:23:51 -07:00
Ozkan Sezer 20beed3029 SDL_EGL_GetProcAddress: remove unnecessary underscore-prepended search.
Closes https://github.com/libsdl-org/SDL/issues/6236.
2022-10-25 14:56:32 +03:00
Steven Noonan 053b5f85f1 SDL_windowsevents: minimize white screen flash on window creation
Clear the window to black on the initial window draw, to avoid a really
obnoxious white flash. This doesn't always eliminate it, but it
definitely minimizes it.
2022-10-24 10:39:37 -07:00
Steven Noonan d2300516c3 cocoa: set sRGB colorspace on nswindow
This makes the colorspace match across different graphics APIs. By
default, OpenGL was getting a much more saturated colorspace (maybe
Display P3?) and it was looking very different from the rendering done
by Metal or MoltenVK.
2022-10-24 10:38:59 -07:00
Steven Noonan 019e9d4c92 SDL_cocoavideo.m: add missing SDL_cocoaopengles.h include 2022-10-24 10:38:36 -07:00
Sam Lantinga dd72f3f03d Added comment for #endif 2022-10-24 10:37:43 -07:00
Steven Noonan 3d35c08585 fix a few 'unused but set variable' and 'unused function' warnings 2022-10-24 10:36:56 -07:00
Sam Lantinga f4d1f5ed54 SDL-HIDPS4: fix PS4 Slim controller over BT - it sends the same input report as the it does over USB, but with a larger packet size
CR: saml
2022-10-23 16:35:36 -07:00
Thomas Cashman 8db3a33872 #6433 Fix WINRT_IsScreenKeyboardShown on Xbox 2022-10-23 11:42:11 -07:00
Sam Lantinga 413500ab69 Replaced mouseWheelGesture with GCMouse support on iOS (thanks @russelltg!)
Fixes https://github.com/libsdl-org/SDL/issues/6411
2022-10-22 09:37:34 -07:00
Deve 2ebaafa6c9 Use translationInView for mouse wheel event 2022-10-22 09:31:39 -07:00
Anonymous Maarten c3b13346e0 On x86, pass -nodefaultlib to linker when wanting to avoid the C library 2022-10-22 09:28:00 -07:00
Sam Lantinga 5b8f830e34 Virtual joysticks don't need initial axis jitter protection
Fixes https://github.com/libsdl-org/SDL/issues/6426
2022-10-22 09:25:09 -07:00
Ozkan Sezer 0e1d19cf68 fix build errors resulting from -Wmisleading-indentation 2022-10-22 18:56:40 +03:00
Sam Lantinga a905a7869f Clear the previous bitmap when calculating a new window shape
Fixes https://github.com/libsdl-org/SDL/issues/6428
2022-10-22 08:50:18 -07:00
Ozkan Sezer 65a38a4015 hidapi, libusb: remove os/2 symbol load hack after os/2 loadso updates 2022-10-22 08:40:16 -07:00
Ozkan Sezer 3f1b5efcca os2 loadso improvements:
- SDL_LoadObject: upon failure, strip the .dll extension and retry,
  but only if module name has no path.
- SDL_LoadFunction: upon failure, retry with an underscore prepended,
  e.g. for gcc-built dlls.
2022-10-22 08:40:16 -07:00
Ozkan Sezer 3d415bc5d6 loadso, dlsym, SDL_LoadFunction: cleanup the underscored name path.
- strlcpy was passed a wrong buffer length parameter. has worked so
  far by luck.
- use memcpy instead of strlcpy for simplicity.
- 'append' has been a typo: should be 'prepend'.
2022-10-22 07:25:46 -04:00
Ozkan Sezer 4264c0b674 os2: fix error message for SDL_LoadObject() 2022-10-21 11:21:40 +03:00
Ryan C. Gordon e7ab581d79
coreaudio: Dispose of AudioQueue before waiting on the thread.
Otherwise the thread might block for a long time (more than 10 seconds!).
It's not clear to me why this happens, or why its safe to do this with a
resource that's still in use, but we have, until recently, always
disposed of the AudioQueue first, so changing back is probably okay.

Also changed the disposal to allow in-flight buffers to reach hardware;
otherwise you lose the last little bit of audio that's already been queued
but not played, which you can hear clearly in the loopwave test program.

Fixes #6377.
2022-10-19 09:14:16 -04:00