Commit Graph

14414 Commits (da8fc70a83cf6b76d5ea75c39928a7961bd163d3)

Author SHA1 Message Date
Sam Lantinga 6d3e21c27c Fixed android build warnings 2023-09-18 13:22:15 -07:00
Sam Lantinga fca2f53189 Fixed warning: this function declaration is not a prototype 2023-09-18 13:09:28 -07:00
Sam Lantinga a72dfa6a5f Fixed sensor timestamp units for third-party PS5 controllers 2023-09-18 12:55:43 -07:00
Sam Lantinga f6756047a4 Fixed error: array subscript 2 is above array bounds of ‘const Uint8[2]’
Smart compilers don't like dereferencing off the end of arrays
2023-09-18 12:19:18 -07:00
Sam Lantinga 7059a55ccc Fixed sensor timestamp calculation for third-party PS5 controllers 2023-09-18 11:50:56 -07:00
Sam Lantinga c0443e5d12 Fixed crash in SDL_IMMDevice_FindByDevID()
Either devid or handle->immdevice_id was NULL, crashing SDL_wcscmp()
2023-09-18 09:47:57 -07:00
Sam Lantinga fde8499f69 Use around 20ms for the audio buffer size
This value is well tested in production software. Larger values introduce audio latency and smaller values cause underflows on many setups.
2023-09-18 09:25:56 -07:00
Frank Praznik e5739d7d1f video: Remove SDL_GetFocusWindow()
It was rarely used and performed an identical function to SDL_GetKeyboardFocus(), but with worse time complexity.
2023-09-18 11:14:42 -04:00
Mathieu Eyraud 39c2f97373 Fix NULL dereference in SDL_OpenAudio 2023-09-18 09:44:59 -04:00
Sam Lantinga 9a23d0e3f6 Added new audio files to the Xcode project 2023-09-17 13:16:19 -07:00
Brick a62e62f97a Refactored SDL_audiocvt.c 2023-09-17 13:13:23 -07:00
Ryan C. Gordon 31229fd47f
include: Added a note about SDL's iOS app delegate functions.
Fixes #8250.
2023-09-15 09:50:24 -04:00
Guldoman 65aaf3a9ab x11: Always update clipboard owner
This allows utilities like clipboard managers to keep track of the 
changes.
2023-09-15 05:21:14 -07:00
Sam Lantinga f622f21e6f Fixed build 2023-09-15 05:17:33 -07:00
Sam Lantinga 5774c9638c Prefer hidraw over libusb when libusb whitelisting is not enabled
Since opening devices via libusb will unbind them from other drivers, we will either whitelist specific devices that we want to support via libusb or we will prefer other drivers over libusb.
2023-09-15 05:14:26 -07:00
Sam Lantinga 9301f7ace2 hidapi/libusb: only enumerate each interface once
If a device has multiple altsettings, like an Xbox Series X controller, make sure we only enumerate each interface once, not once for each altsetting.
2023-09-15 05:07:05 -07:00
Sam Lantinga 859dc14add Replaced SDL_GetGamepadBindForAxis() and SDL_GetGamepadBindForButton() with SDL_GetGamepadBindings() 2023-09-13 23:01:28 -07:00
Sam Lantinga 9e50048ab6 Revert "Removed SDL_GamepadBinding from the API"
This reverts commit eb0955ef89.
2023-09-13 22:42:47 -07:00
Sam Lantinga 9f17d1a9d8 Don't reference the same function in "see also" 2023-09-13 11:01:00 -07:00
Ozkan Sezer 86505ea630 fix SDL_AudioStreamCallback documentation 2023-09-13 18:35:30 +03:00
SDL Wiki Bot d885d5c310 Sync SDL3 wiki -> header 2023-09-13 15:04:13 +00:00
Ryan C. Gordon 2f43f7bc53
audio: Allow querying of device buffer size. 2023-09-13 11:03:17 -04:00
Ryan C. Gordon cf95721130
audio: Added a hint to let apps force device buffer size.
This is a hint because apps might (probably mistakenly) believe they need this
to migrate from SDL2, but most things don't need to specify this.
2023-09-13 10:42:08 -04:00
Ryan C. Gordon 47d8c77c67
audio: Choose better default sample frame counts.
This might still need tweaking, but this is probably better than it was.
2023-09-13 10:27:11 -04:00
Ryan C. Gordon 8b26e95f91
audio: Change SDL_AudioStreamCallback
Now it offers the total requested bytes in addition to the amount
immediately needed (and immediately needed might be zero if the stream
already has enough queued to satisfy the request.
2023-09-13 10:11:23 -04:00
Ryan C. Gordon 9da34e8fb5
docs: Updated README-emscripten.md.
This is updated from the rewrite in the SDL2 branch.
2023-09-12 21:27:40 -04:00
Max Bachmann fd1c54a004 detect fanatec steering wheels 2023-09-12 15:35:35 -07:00
Ryan C. Gordon cb44146089
docs: Whoops, this got added by the wiki bridge by accident! 2023-09-12 17:36:02 -04:00
Sam Lantinga cd633b9a88 Renamed SDL_IsAudioDevicePaused() to SDL_AudioDevicePaused()
This aligns with the SDL3 convention of removing "Is" from self-explanatory function names

Also improved some documentation in SDL_audio.h
2023-09-12 12:11:09 -07:00
SDL Wiki Bot c6cad07faa Sync SDL3 wiki -> header 2023-09-12 18:28:12 +00:00
Ryan C. Gordon a6e52f9e48
Sync SDL3 wiki -> header 2023-09-12 14:27:21 -04:00
Dan Ginsburg 2de2e9d031 Fix flickering of window when using desktop-fullscreen and borderless window on multiple monitors on Linux. Closes #8186. 2023-09-12 07:37:39 -07:00
danginsburg 723835d16a Windows: fix for client rect resizing larger each time we came from exclusive fullscreen -> windowed on a monitor with HiDPI set. The problem was we were using the monitor DPI rather than the window DPI so AdjustWindowRectExForDpi was giving us an incorrect size which would be too large for the client rect. Closes #8237. 2023-09-12 07:36:55 -07:00
Ryan C. Gordon ce27363df2
wikiheaders: Sort undocumented functions.
Otherwise they appear in random order, which isn't ideal in general, but
also this breaks the wiki/header bridge because it can't produce identical
conversions per-run.
2023-09-12 09:58:10 -04:00
Sam Huang e22282b097 Added README about transparent windows in Win32 2023-09-11 22:35:05 -07:00
Sam Lantinga 1d1c6e6305 Turn off COREAUDIO debug logging by default 2023-09-11 09:03:48 -07:00
Frank Praznik 52efefca04 wayland: Fix drag offer leak
The data device leave function is intended for drag offers, not selections, and the function as was previously written was a no-op.
2023-09-09 18:49:47 -04:00
Ryan C. Gordon 3a992af446 audio: Added a postmix callback to logical devices.
You can see it in action in testaudio by mousing over a logical device; it
will show a visualizer for the current PCM (whatever is currently being
recorded on a capture device, or whatever is being mixed for output on
playback devices).

Fixes #8122.
2023-09-09 16:26:37 -04:00
Simon McVittie 7207bdce5d render: Enable clipping for zero-sized rectangles
Battle for Wesnoth apparently relies on being able to disable rendering
of UI elements by setting the clip rectangle to be empty.

Resolves: https://github.com/libsdl-org/SDL/issues/6896
Fixes: 00f05dcf "render: only enable clipping when the rectangle is valid"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-09 11:12:55 -07:00
Anonymous Maarten 22d81fb3e9 cmake: use MSVC_RUNTIME_LIBRARY to force MT 2023-09-09 19:14:12 +02:00
Anonymous Maarten a2e17852d9 cmake: make sure SDL_GetPrefPath is run before testfilesystem
60 seconds timeout ought to be sufficient.
2023-09-08 09:05:58 -04:00
Anonymous Maarten 2fb266e0a4 ci: run tests in parallel 2023-09-08 09:05:58 -04:00
Ryan C. Gordon ad1313e751
testaudio: Patched to compile.
(this was a piece of PR #8213 that accidentally creeped into main.)
2023-09-07 16:03:49 -04:00
Ryan C. Gordon 5747ddc012
testaudio: Clean up some messy memory management. 2023-09-07 10:50:11 -04:00
Ryan C. Gordon fafbea1ced
audio: Move internal float32 mixing to a simplified function 2023-09-07 10:48:04 -04:00
Ryan C. Gordon 116b0ec977
include: minor tweak to audio API documentation 2023-09-07 10:45:45 -04:00
Ryan C. Gordon fb13770353
include: Replaced old Bugzilla URL. 2023-09-07 10:44:30 -04:00
Ryan C. Gordon 38c8fc05c5
audio: Remove ChooseMixStrategy.
This is adds complexity and fragility for small optimization wins.

The biggest win is the extremely common case of a single stream providing
the only output, so we'll check for that and skip silencing/mixing/converting.

Otherwise, just use a single mixer path.
2023-09-07 10:44:30 -04:00
Anonymous Maarten b00cbd76aa wikiheaders.pl: create Unsupported.md file with list of functions undocumented in either the headers or the wiki 2023-09-06 15:51:08 -04:00
Frank Praznik 37e1fc3b58 wayland: Ensure that the toplevel window is recreated when switching decoration modes
If a compositor tries to change the decoration mode when initially creating a window, the hidden flag might not yet be unset if the decoration mode is changed during the initial roundtrip in Wayland_ShowWindow(). As hiding the window destroys the decoration manager object, the hidden flag check is unnecessary, as the decoration configuration listener will never be entered when the window is hidden.
2023-09-06 13:35:44 -04:00