Commit Graph

9302 Commits (db6b6bd75ef5fb1335d192cb4edc11719967f52e)

Author SHA1 Message Date
Ryan C. Gordon 12b371679f
audio: Code defensively to placate static analyzers, don't disabling warnings. 2024-04-15 23:53:56 -04:00
Sam Lantinga bdd47f7770 Fixed warning: no previous extern declaration for non-static variable 'ResamplerFilter'
Fixes https://github.com/libsdl-org/SDL/issues/9556
2024-04-15 16:16:32 -07:00
Sam Lantinga 57a5b26d77 Updated to the latest version of the Vulkan SDK 2024-04-15 16:05:32 -07:00
Brick 5e985b72dc SDL_ConvertAudioSamples: Make sure we got enough data 2024-04-15 11:47:18 -10:00
Brick edaab8ad9f Refactored audio conversion to reduce copying
More of the logic has been moved into SDL_AudioQueue,
allowing data to be converted directly from the input buffer.
2024-04-15 11:47:18 -10:00
Brick 8f6f9cadc4 Rewrote audio resampler using cubic filter interpolation
This allows using a much smaller (1.5 KB) lookup table, in exchange for a small amount of extra work per frame.

The extra work (a few extra loads/mul/adds) is negligible, and can execute in parallel.
The reduction in cache misses almost certainly outweighs any added cost.

The table is generated at runtime, and takes less than 0.02ms on my computer.
2024-04-15 11:47:18 -10:00
Brick 46cecc42a2 Slightly optimized and fixed float SDL_MixAudioFormat 2024-04-15 11:47:18 -10:00
Brick 33f28d6143 Refactored ConvertAudio, added SIMD endian-swapping 2024-04-15 11:47:18 -10:00
Brick e9e9424b9a Implemented NEON audio type conversion
Compiler support for loading/storing multiple registers at once (i.e vld1q_f32_x4) seems very poor, so avoiding them for now.

Also switched to aligned stores with SSE. Although both SSE and NEON support unaligned stores, there is more likely to be a penalty to them, i.e when crossing a cache line. So might as align them.
2024-04-15 11:47:18 -10:00
Brick 9c2e4f52e6 Fixed misuse of entry->size in SDL_TrackAllocation
entry->size is the size of the allocation, not the number of stack frames
2024-04-15 11:47:18 -10:00
Brick 449b0229eb Fix SDL_SetAudioStreamFormat incorrectly blocking changes on bound streams
We want to avoid changes to the end used by the device, so src for capture and dst for output
2024-04-15 11:47:18 -10:00
Sam Lantinga dc13c08375 Use single line comment format 2024-04-15 13:42:28 -07:00
Sam Lantinga 1862a62b5d Replaced SDL_GetNumTouchFingers() and SDL_GetTouchFinger() with SDL_GetTouchFingers()
Fixes https://github.com/libsdl-org/SDL/issues/9484
2024-04-15 09:22:41 -10:00
Frank Praznik a845c7027e x11: Fix pointer warp on XWayland
XWayland seems to require that the pointer be hidden when it is warped, so hide and show the pointer when warping, if required.

Note that XWayland still only allows warping within the window, so attempts to warp to global coordinates outside the window won't work.
2024-04-15 14:27:13 -04:00
Sam Lantinga a00669db18 Fixed warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data 2024-04-15 10:29:45 -07:00
Sam Lantinga 43a59ffe45 Fixed crashes when a window has NULL driverdata 2024-04-15 10:15:10 -07:00
Ryan C. Gordon 9f6f4dfcb9
events: Fixed crash in SDL_SetEventEnabled.
This could happen if `enabled` was non-zero but not set to SDL_TRUE.

Static analysis tried to warn us!!

The added SDL_assert is meant to sanity check this, not pacify the analyzer;
this passes Clang's static analysis now, with or without the assert.

Fixes #9544.
2024-04-15 12:44:04 -04:00
Cameron Cawley 9b8e5a705e 3DS: Improve framebuffer support 2024-04-15 06:37:16 -10:00
Cameron Cawley 8bc8047b6f 3DS: Ensure that touchscreen events are associated with a window 2024-04-15 06:37:16 -10:00
Sam Lantinga e161795071 Fixed build
Also removed the assert, since we assume window->driverdata is valid everywhere else.
2024-04-15 09:35:41 -07:00
Semphris 0429f5d6a3 Replace if() with SDL_assert()
If the if statement was not fulfilled, the pointers passed would be silently left unfilled.
2024-04-15 06:02:58 -10:00
Joshua Ashton d0819bcc5c x11: Mark XWayland as MODE_SWITCHING_EMULATED
That way we don't do the awful minimise on focus loss logic by default on XWayland where mode switching is emulated (like on the Wayland backend).

This fixes CS2, Dota 2 minimising on alt-tab when playing in fullscreen (which is really annoying when managing eg. Discord on another screen)
2024-04-15 03:35:06 -10:00
Cameron Cawley d760f16ba6 Add a capability for fullscreen-only video drivers 2024-04-15 03:30:50 -10:00
Vicki Pfau 19445339b8 evdev INPUT_PROP_SEMI_MT devices should be early-detected as touchpads
Some psmouse touchpads were being misdetected as joysticks due to only having
INPUT_PROP_SEMI_MT and INPUT_PROP_POINTER as well as having BTN_1
2024-04-15 03:26:29 -10:00
Mathieu Eyraud 29d43272e2 Fix memory leak in WIN_GetMonitorPathInfo 2024-04-15 03:24:09 -10:00
meyraud705 db9b4ba2fa Fix memory leak in dialog 2024-04-15 03:23:52 -10:00
Anonymous Maarten 07b7ec68eb Add SDLTest_CompareMemory function to compare memory ranges 2024-04-15 03:05:05 -10:00
Frank Praznik f4611ffe9a
wayland: Fix comment 2024-04-14 15:02:31 -04:00
Frank Praznik ad813a65e7 x11: Fix initial window positioning
Some window managers can send garbage values during the initial mapping of a window, and need the position set again after mapping to ensure proper placement. Position requests sent before mapping can otherwise end up ignored. Ignore initial configure events when initially showing the window, and make sure that the position is set after the window is mapped, either when the window borders appear, or after the initial configure events in the case of borderless windows.

This also eliminates sending excessive/redundant move requests, which can cause strange behavior on some window managers, particularly if done before the window is actually mapped.

Fixes cases of incorrect initial window placement on GNOME + XWayland.
2024-04-14 12:19:00 -04:00
Frank Praznik 01195c5d32 x11: Cancel the mode switch timer immediately upon success
Prevents erroneous timeout error messages if the window is moved to another display before the timeout period elapses.
2024-04-14 12:19:00 -04:00
Frank Praznik 037a62add5 wayland: Apply exclusive fullscreen parameters if changed between the initial fullscreen call and the fullscreen configure event 2024-04-14 12:19:00 -04:00
Frank Praznik 26d3cbee79 video: Use the origin for determining the display for fullscreen windows
Fullscreen windows may be larger than the display if they were moved between differently sized displays and the new position was received before the new size or vice versa. Using the center of the window rect in this case can report the wrong display, so use the origin.

Fixes flickering and the window bouncing between different displays when moving fullscreen X11 and Wayland windows in certain multi-monitor layouts.
2024-04-14 12:19:00 -04:00
Frank Praznik 1804ad175c wayland: Don't send spurious display changes when a fullscreen window is moving
When moving a fullscreen window, the compositor movement animation can cause it to cross multiple displays, sending multiple display changed events, which can cause the window to jitter or be snapped to the wrong display in the case of exclusive fullscreen modes.

When moving fullscreen windows, only send the display changed event when the window isn't on multiple displays to avoid spurious display changed events.
2024-04-14 12:19:00 -04:00
Ryan C. Gordon 6e1ed94913
ios: Renamed APIs that referred to "iPhone" to refer to "iOS".
Macros that papered over this difference in SDL2 have been removed for SDL3.

Fixes #9527.
2024-04-13 14:30:30 -04:00
Ryan C. Gordon d252a8fe12
joystick: SDL_VirtualJoystickDesc no longer takes a struct version.
If we need to extend this in the future, we'll make a second struct and
a second SDL_AttachVirtualJoystickEx-style function that uses it.

Just zero the struct and don't set a version.

Fixes #9489.
2024-04-13 14:16:12 -04:00
Ryan C. Gordon 98e9f361a8
winrt: Remove SDL_WinRTGetFSPathUNICODE, rename SDL_WinRTGetFSPathUTF8.
Fixes #9470.
2024-04-13 08:24:12 -04:00
Ryan C. Gordon 3f4ac1a3c7
winrt: Implemented SDL_GetUserFolder() for WinRT/UWP. 2024-04-13 08:05:43 -04:00
Frank Praznik 3fca8d4f82
wayland: Fix build warning (boolean always true) 2024-04-12 14:15:29 -04:00
Frank Praznik f6edc2f603 wayland: Use xdg-output to get connector names when older versions of libwayland are in use
Connector names prior to v4 were sent via xdg-output, so use that if an older version of libwayland is present.

Additionally, ensure the output names are actually allocated before comparing the strings.
2024-04-12 14:04:43 -04:00
Frank Praznik 60f26182c3 audio: Prefer Pipewire over Pulseaudio if the pipewire-pulse service is running
Use DBus to query Systemd to check if the pipewire-pulse service is in the "running" state. If it is, then it is certain that Pipewire is being used instead of Pulseaudio as the preferred system mixer.

If DBus support is not enabled or Systemd is not being used on the underlying system, this check will simply fail and the standard driver order will be tested.
2024-04-11 20:35:10 -04:00
Frank Praznik b6cb63adef
wayland: Update tablet-v2 protocol file to stable version
No functional changes, just removes the 'unstable' wording from the header names and updates some documentation.
2024-04-11 18:34:02 -04:00
Frank Praznik 38c4f29c29 wayland: Round fractional scale values when viewports aren't supported 2024-04-10 16:01:23 -04:00
Ryan C. Gordon ad090d2444
include: A ton of little documentation tweaks, fixes, and improvements.
This is just stuff I noticed while working on the wikiheaders updates. A
thorough pass over all the docs would not be terrible, and maybe a simple
script to check for consistency (does everything have a `\since` on it? etc)
might be nice, too.
2024-04-09 00:50:02 -04:00
Ryan C. Gordon 6906c50e8b
assert: SDL_AssertData::always_ignore should be an SDL_bool, not an int. 2024-04-09 00:50:01 -04:00
Petar Popovic c8a066019b Renaming SDL_eventaction to SDL_EventAction 2024-04-08 14:28:52 -04:00
Petar Popovic 1efadcc5d4 Revert renaming SDL_eventaction. adding it again in next commit with
scripts

This reverts commit f08c31060a.
2024-04-08 14:28:52 -04:00
Frank Praznik 224f2e921e
video: Remove unused bootstrap declarations
Pandora and KMSDRM_Legacy are not used anywhere.
2024-04-08 11:07:05 -04:00
Petar Popovic 764fe72449 SDL_time.h: Renaming enums SDL_DATE_FORMAT and SDL_TIME_FORMAT to SDL_DateFormat and SDL_TimeFormat 2024-04-07 23:03:01 -04:00
Petar Popovic f08c31060a Renaming SDL_eventaction to SDL_EventAction 2024-04-07 12:04:32 -04:00
Semphris 6ad390fc50 File dialog improvements
- Add a globally-accessible function to handle the parsing of filter extensions
- Remove the ability of putting the wildcard ('*') among other patterns; it's either a list of patterns or a single '*' now
- Add a hint to select between portals and Zenity on Unix
2024-04-04 22:07:14 -07:00