Commit Graph

16902 Commits

Author SHA1 Message Date
Sylvain
dfd80f3d76 Android: control activity re-creation 2023-05-12 07:48:33 -07:00
Sam Lantinga
2e6c48dcb4 Added support for the GameSir-G7 Controller for Xbox 2023-05-11 17:44:56 -07:00
Ryan C. Gordon
80a8691098 audio: Fixed buffer overflow in SDL_AudioStream resampling. 2023-05-11 16:25:20 -04:00
Ryan C. Gordon
9bf0934877 audio: SDL_memcpy() params were backwards. :O 2023-05-11 15:13:11 -04:00
Sam Lantinga
d98bd67733 Fixed lockup while waiting for events 2023-05-10 17:35:13 -07:00
Sam Lantinga
fd42a2f994 Changed all variadic macros into fixed (thanks @Wohlstand!) 2023-05-10 06:27:38 -07:00
Sylvain
6d9ccbb3c7 Android: use the headers to have the audio pause/resume definitions
and make SDL_PriveAudioData more private
2023-05-10 09:34:53 +02:00
Sam Lantinga
28f891ad0a Allow the application to send rumble packets to Nintendo Switch controllers 2023-05-09 17:08:47 -07:00
Frank Praznik
785b7c6636 wayland: Implement global mouse coordinate emulation
Wayland doesn't support getting the true global cursor position, but it can be faked well enough for what most applications use it for: querying the global cursor coordinates and transforming them to the window-relative coordinates manually.

The global position is derived by taking the cursor position relative to the toplevel window, and offsetting it by the origin of the output the window is currently considered to be on. The cursor position and button state when the cursor is outside an application window are unknown, but this gives 'correct' coordinates when the window has focus, which is good enough for most applications.
2023-05-09 14:17:18 -07:00
SDL Wiki Bot
9786d8ac40 Sync SDL3 wiki -> header 2023-05-09 18:27:15 +00:00
Ryan C. Gordon
2b6cb7bfb2 include: SDL_ConvertAudioSamples docs now warn about converting in chunks.
Fixes #7154.
2023-05-09 14:24:22 -04:00
Ryan C. Gordon
7b6dabd81f audio: AudioStreams shouldn't overflow output buffers.
Before, as ConvertAudio might have expanded data in-place temporarily during
its work, this could blow up. Now if there's a chance of that, it'll
work out of an internal buffer and copy the final results to the output
buffer.

If the output format can handle the temporary expansion, we write directly
to the output buffer without the extra copy.

Fixes #7668.
2023-05-09 14:19:16 -04:00
Sylvain
04e17d4e46 Remove _THIS in src/audio/ 2023-05-09 11:29:33 -04:00
Sylvain
81ff49f4b5 Remove _THIS in src/video and in src/events (also VideoDevice) 2023-05-09 11:29:33 -04:00
Sylvain
df314ba93e Remove _THIS in src/core: EVDEV UDEV 2023-05-09 11:29:33 -04:00
Ryan C. Gordon
0e1669e296 audio: Fixed audiostreams converting incorrect channel counts. 2023-05-09 10:58:32 -04:00
Ryan C. Gordon
7f219aa369 audio: Make sure AudioStream's internal buffers are large enough.
It needs to deal with ConvertAudio growing buffers in-place, as it might
convert smaller types to float as an intermediate step.
2023-05-09 10:57:23 -04:00
Ryan C. Gordon
c7629704b4 audio: SDL_ConvertAudioSamples shouldn't calculate its output buffer size.
Just use what the AudioStream calculates instead.
2023-05-09 10:56:34 -04:00
Ryan C. Gordon
a88aeb2a8a coreaudio: Flush/stop the AudioQueue before disposing of it.
Otherwise, a CoreAudio thread lingers forever, and coreaudiod eats CPU
until the SDL process terminates.

Fixes #7689.

(cherry picked from commit 86786ed544)
2023-05-08 14:26:34 -04:00
Semphris
7f2ef4d02f Implement SDL_GetPath stub for all OSes 2023-05-08 09:36:39 -07:00
Ozkan Sezer
ef2ad2b0c6 windows/SDL_sysfilesystem.c: fix SHGetKnownFolderPath calling convention 2023-05-08 11:55:32 +03:00
Frank Praznik
b92eaddbbd wayland: Fix the corner case when positioning popups
If the popup is positioned such that it requires correction on both the x and y axes, it will be aligned with parent only at the window corners, which is neither overlapping nor adjacent. In this case, nudge the window plus or minus one screen unit on the x axis so it is properly adjacent to the parent and within spec guidelines.
2023-05-06 12:35:47 -04:00
Sam Lantinga
b6df25c334 Removed redundant __powerpc__ check 2023-05-06 08:44:19 -07:00
Jeremy Rand
9142292f4a SDL_blit_N.c: Move ppc64le swizzle outside of loop
An in-place swizzle mutation was erroneously inside of a loop, which
caused each consecutive 4-pixel vector to alternate between correct and
incorrect endianness.

The bug was introduced in 715e070d29.

Thanks to RobbieAB for reporting the bug.

Fixes https://github.com/libsdl-org/SDL/issues/3428
2023-05-06 11:05:48 -04:00
Ozkan Sezer
26903f237f windows/SDL_sysfilesystem.c: replace KNOWNFOLDERID type usage with GUID 2023-05-06 01:10:02 +03:00
Frank Praznik
1bf5a78b53 wayland: Don't print an error when moving a hidden popup window
Repositioning a hidden popup window is valid behavior, so don't print an error message in this case.
2023-05-05 14:05:34 -04:00
Frank Praznik
27085df50d wayland: Remove redundant window geometry configuration
The window geometry will be updated when in underlying shell surface config handler, before the config is ack-ed, so no need to do it in the popup config handler.
2023-05-05 13:54:10 -04:00
Frank Praznik
eb6837e353 wayland: Validate and trigger the repositioning of popups in more cases
Validate and reposition popups in any case where the position or size may have changed. In particular, this fixes cases where the position parameters were adjusted while the window was hidden, as the new values weren't being applied in all cases.
2023-05-05 13:54:10 -04:00
Frank Praznik
17fba24e21 wayland: Adjust overlap required for popups to be considered adjacent
Popups beyond the right and bottom borders of the window must be width/height minus one in order to be considered adjacent and not be instantly closed or cause a protocol error.
2023-05-05 13:54:10 -04:00
Anonymous Maarten
c810e5f63d video: set error code when SetWindowPosition fails 2023-05-05 17:50:32 +02:00
Ozkan Sezer
52c19bd21b attempt to fix more build failures against older Win32 SDKs. 2023-05-05 03:33:10 +03:00
Ozkan Sezer
d7f1719777 fixed -Wundef warning due to HAVE_MMDEVICEAPI_H 2023-05-05 03:32:56 +03:00
Sam Lantinga
450c947949 Actually define the folder GUIDs 2023-05-04 16:39:16 -07:00
Sam Lantinga
e0e95b1ea9 Fixed coding style and building on older Windows SDKs 2023-05-04 16:28:16 -07:00
Sam Lantinga
9b87de258f Fixed crash in new audio channel conversion code
Each loop needs to be run num_frames times, and the source and destination pointers are incremented by the number of channels during the conversion.
2023-05-04 15:50:38 -07:00
Semphriss
c1dab7745a Add SDL_GetPath() for default OS folders (#7665) 2023-05-04 11:38:11 -07:00
Anonymous Maarten
72e5a52c51 ci: use Haiku cross toolchain
A cross compiler is much faster then an emulated one.
2023-05-04 08:26:54 -04:00
Anonymous Maarten
fe68fd3af9 ci: disable pull_request trigger for haiku 2023-05-04 05:15:10 +02:00
Ryan C. Gordon
e191bc8491 audio: Simplified GetFirstAudioFormat/GetNextAudioFormat.
Now it just returns an iterable array and needs no global state.
2023-05-03 22:37:23 -04:00
Sam Lantinga
b6ca360228 Added support for the Saitek Cyborg V.3 Rumble Pad in PS3 mode 2023-05-03 09:47:16 -07:00
Sam Lantinga
3f0c2a6694 Don't set the display scale if DPI scaling isn't enabled
In this case we want the display mode pixel to screen coordinates to be 1:1 ... but we lose information about the UI scaling of the display - is that okay?
2023-05-03 09:47:13 -07:00
Brick
86b5f40b53 Fixed CalculateAudioStreamWorkBufSize 2023-05-02 11:16:20 -04:00
Brick
079ae065f1 Added SDL prefix AUDIO_* constants 2023-05-02 08:09:06 -07:00
Brick
1ee2832326 Fixed SDL_ConvertMonoToStereo_SSE reading out of bounds 2023-04-30 13:14:20 -04:00
Sam Lantinga
255c3b7c82 By default, OpenBSD uses Linux controller mappings
Fixes https://github.com/libsdl-org/SDL/issues/7609
2023-04-29 17:09:17 -07:00
Sam Lantinga
0d559b7cb3 Fixed parsing SDL_mutex.h 2023-04-29 10:14:03 -07:00
Eric
f7df966b41 SDL_JOYBALLMOTION 2023-04-28 23:35:33 -04:00
Eric
e8c16ce483 Update migration guide with info on trackballs 2023-04-28 23:35:33 -04:00
Frank Praznik
bee6099372 events: Emit an event when a window is destroyed
As child windows can be recursively destroyed when their parents are destroyed, emit an event to notify the application when a window is being or has been implicitly destroyed so that it can appropriately clean up any associated resources.

If the application has registered an event watch, the destroy message will be received when the window handle is still valid, so the application can retrieve and release any userdata associated with the window. If the message is processed at any time after that, the window handle is already invalid and the ID is only useful for application-side bookkeeping purposes.
2023-04-28 15:09:47 -04:00
SDL Wiki Bot
78cfc23993 Sync SDL3 wiki -> header 2023-04-28 19:09:14 +00:00