Commit Graph

1913 Commits (5774c9638c22863edb6f02c2380ec68c56373155)

Author SHA1 Message Date
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 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
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
Ryan C. Gordon a6e52f9e48
Sync SDL3 wiki -> header 2023-09-12 14:27:21 -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
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
Brick f2ca9a615b Added SDL_AUDIO_FRAMESIZE 2023-09-05 17:56:58 -07:00
Brick 53122593f8 Added SDL_AUDIO_BYTESIZE 2023-09-05 17:56:58 -07:00
SDL Wiki Bot 544351c98e Sync SDL3 wiki -> header 2023-09-05 21:19:16 +00:00
Sam Lantinga 2e7d2b94eb Clarify that SDL_BlitSurface() ignores the width and height in dstrect 2023-09-05 14:18:43 -07:00
Sam Lantinga 3a932141e4 Restore audio format binary compatibility with SDL 2.0 2023-09-04 10:16:53 -07:00
Sam Lantinga 233789b0d1 Audio types have the same naming convention as other SDL endian types, e.g. [S|U][BITS][LE|BE]
Native endian types have no LE/BE suffix
2023-09-04 09:48:44 -07:00
SDL Wiki Bot 36b5f3e35c Sync SDL3 wiki -> header 2023-09-04 14:47:15 +00:00
Brick 0e552761b7 Renamed AudioStreamSpeed to AudioStreamFrequencyRatio 2023-09-04 07:46:18 -07:00
Brick 5394a805f4 Improved testaudiostreamdynamicresample
Tweaked color palette
2023-09-01 14:38:45 -04:00
Brick e55844274d Added SDL_(Get|Set)AudioStreamSpeed 2023-09-01 14:38:45 -04:00
Jeremy Demeule 6ff31e10cf
metal: Add hint to select low power device instead of the default one (#8182)
On some system like MacBook Pro Intel with AMD card, asking for the default device will always return the AMD GPU.
This is not an issue for 99% of the case when the renderer context is here to provide the maximum performance level like for game.
However, for video application using GPU for 1 quad and 1 texture, using the discrete GPU for that lead to an important power consumption (4 to 8W), heat increase, and fan noise.
With this patch, I successfully amend ffplay to only use the integrated GPU (i.e. the Intel one), instead of the discrete GPU (i.e. the AMD one).
2023-08-31 01:23:45 -07:00
SDL Wiki Bot f84c87f204 Sync SDL3 wiki -> header 2023-08-31 03:26:13 +00:00
Sam Lantinga a5e7214795 Add SDL_WINDOW_NOT_FOCUSABLE flag to set that the window should not be able to gain key focus
- Also adds SDL_SetWindowFocusable() to set/clear flag on existing windows
2023-08-30 20:29:51 -07:00
Sam Lantinga 82db2b58f9 Renamed audio stream callback and moved the userdata parameter first
In general SDL API callbacks are called with the userdata paramter first, to mimic C++ method call convention
2023-08-27 14:43:21 -07:00
SDL Wiki Bot 5bdad5210f Sync SDL3 wiki -> header 2023-08-27 20:55:12 +00:00
Ryan C. Gordon 58c859f64d audio: Rename SDL_GetAudioStreamBinding to SDL_GetAudioStreamDevice. 2023-08-27 16:54:30 -04:00
Ryan C. Gordon efd2023a72 audio: Fixed documentation. 2023-08-27 16:54:30 -04:00
Ryan C. Gordon 1e775e0eef audio: Replace SDL_CreateAndBindAudioStream with SDL_OpenAudioDeviceStream.
This is meant to offer a simplified API for people that are either migrating
directly from SDL2 with minimal effort or just want to make noise without
any of the fancy new API features.

Users of this API can just deal with a single SDL_AudioStream as their only
object/handle into the audio subsystem.

They are still allowed to open multiple devices (or open the same device
multiple times), but cannot change stream bindings on logical devices opened
through this function.

Destroying the single audio stream will also close the logical device behind
the scenes.
2023-08-27 16:54:30 -04:00
Brick 82e481b520 Added --randmem test parameter 2023-08-27 13:08:15 -07:00
SDL Wiki Bot e30e5c77e6 Sync SDL3 wiki -> header 2023-08-25 14:42:25 +00:00
Ethan Lee c0cd8c8142 gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation 2023-08-25 10:40:16 -04:00
Sam Lantinga 8924d0d927 Added missing function prototype for SDL_WriteS64BE() 2023-08-23 21:19:25 -07:00
Frank Praznik be8c42cfd7 Clarify that a window being 'hidden' means that it is unmapped/ordered out
SDL considers a hidden window to be unmapped and blocks or defers certain operations until the window is shown again, however, the X11 and Cocoa backends would set the hidden flag when the window was minimized, which blocked the functionality of SDL_RestoreWindow().

Specify that a window with the hidden flag set is unmapped and not visible on the desktop or in the dock/taskbar without a call to SDL_ShowWindow(), and don't set the hidden flag in the X11 and Cocoa backends when the window is in the minimized state, but still mapped to the desktop.
2023-08-14 13:20:24 -04:00
David CARLIER 723bcd0a8b SDL_TriggerBreakppoint for riscv arch (both 32/64) version.
`ebreak` acts like int3 for x86, giving control of running process to debuggers.
2023-08-13 11:36:49 -04:00
Anonymous Maarten b7889a7389 winrt: use windowsio in non-libc mode
CMake's SDL_build_config.h force disables HAVE_STDIO_H when buiding
winrt in non-libc mode.

Becase CreateFileEx is not available in UWP mode, use CreateFile2
instead.
2023-08-12 17:37:52 +02:00
Sam Lantinga 80850af7ce The controller update complete events are no longer disabled by default 2023-08-10 17:45:00 -07:00
Simon McVittie efe15588d5 Relabel back paddles as left or right
The sequence order of the four paddles is not obvious, with SDL and Xbox
controllers swapping the order of P2 and P3 relative to each other.
If we group them into left and right, then it becomes more obvious.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-09 11:03:30 -07:00
Ravbug 690eae7d22 Implement visionOS support 2023-08-08 22:25:04 -07:00
Sam Lantinga 12deed91f8 Added information on how to enable thread-safety analysis 2023-08-08 22:09:46 -07:00
Anonymous Maarten 917e036f6f MSVC has __declspec(deprecated) 2023-08-09 02:54:18 +02:00
Sam Lantinga a2d594269c Fixed pixel format compatibility with SDL2 2023-08-07 22:45:21 -07:00
SDL Wiki Bot 8fdebdd3e0 Sync SDL3 wiki -> header 2023-08-08 03:37:14 +00:00
Sam Lantinga b903ccf945 SDL_rwops read/write functions return size_t again
The current status is stored in the SDL_rwops 'status' field to be able to determine whether a 0 return value is caused by end of file, an error, or a non-blocking source not being ready.

The functions to read sized datatypes now return SDL_bool so you can detect read errors.

Fixes https://github.com/libsdl-org/SDL/issues/6729
2023-08-07 20:36:21 -07:00
Ryan C. Gordon 6af0448af9
include: fixed a typo in SDL_RenderGetMetalCommandEncoder docs.
(cherry picked from commit 8087c0a5d2e2e47b7841cdd9d3fdff8cfb23e241)
2023-08-06 10:45:46 -04:00
Ozkan Sezer f3cb46b083 SDL_thread.h: do not conflict with sdl2-compat::sdl3_include_wrapper.h
The windows hacks in there will not be needed any longer
2023-08-06 14:11:02 +03:00
Sam Lantinga 080b1dfbdb Revert "Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!)"
This reverts commit 9d453daa23.

Oops, it totally doesn't work:
error: unused variable 'SDL_compile_time_assert_SDL_copyp' [-Werror=unused-variable]
2023-08-05 19:23:30 -07:00
Sam Lantinga 9d453daa23 Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!) 2023-08-05 19:18:31 -07:00