Commit Graph

12998 Commits (464640440f75c3ff65c597c50cf37e397f5a4c0f)

Author SHA1 Message Date
Ryan C. Gordon 464640440f
audio: Added SDL_GetAudioStreamBinding.
Now you can open a device, bind a stream, and forget about the device ID
until you're ready to shutdown, where you can query the stream for it.
2023-07-30 11:55:54 -04:00
Ryan C. Gordon 01f7b53865
audio: Readded (logical) device pausing. 2023-07-30 11:55:53 -04:00
Ryan C. Gordon fd4c9f4e11
audio: documentation improvements. 2023-07-30 11:55:53 -04:00
Ryan C. Gordon 4b78b789a7
audio: Switch SDL_audio.c and SDL_audiocvt.c to C99-ish syntax.
These files are completely different from SDL2, and no clean merging
is likely to happen there anyhow, so there's really no harm in just
switching them over completely to SDL3's new policy of allowing `//`
comments and mixed variable declarations.

Feels deeply sacrilegious, though.
2023-07-30 11:55:53 -04:00
Ryan C. Gordon d96a1db7d7
audio: Opening via a logical device ID should also track default device.
As these will change devices as the default device changes, in the future,
we would want the original and new logical device to stay together.
2023-07-30 11:55:53 -04:00
Ryan C. Gordon b2e020958f
audio: Wrap device access in opening of logical devices.
Now you open an audio device and attach streams, as planned, but each
open generates a new logical device. Each logical device has its own
streams that are managed as a group, but all streams on all logical
devices are mixed into a single buffer for a single OS-level open of
the physical device.

This allows multiple opens of a device that won't interfere with each
other and also clean up just what the opener assigned to their logical
device, so all their streams will go away on close but other opens will
continue to mix as they were.

More or less, this makes things work as expected at the app level, but
also gives them the power to group audio streams, and (once added) pause
them all at once, etc.
2023-07-30 11:55:53 -04:00
Ryan C. Gordon 7ee2459927
audio: Check for unlikely failure case in WAV loaded.
I don't think this can fail at the moment, but if WaveCheckFormat goes
out of sync with this switch statement at some point, this seems like
a good failsafe.
2023-07-30 11:55:52 -04:00
Ryan C. Gordon 3d65a2cefe
audio: Made SDL_LoadWAV a real function, not just a macro. 2023-07-30 11:55:52 -04:00
Ryan C. Gordon 26525f5fd3
audio: Readd SDL_AudioSpec, but just with format/channels/freq fields. 2023-07-30 11:55:52 -04:00
Ryan C. Gordon e6aaed7d79
include: Audio is not, and has not been, a raw mixing buffer for a long time. 2023-07-30 11:55:52 -04:00
Ryan C. Gordon 56b1bc2198
audio: SDL_AudioStream now has callbacks for Get and Put operations.
This allows code to feed a stream (or feed from a stream) on-demand,
which is to say: it can efficiently simulate the SDL2 audio callback.
2023-07-30 11:55:51 -04:00
Ryan C. Gordon 905c4fff5b
audio: First shot at the SDL3 audio subsystem redesign!
This is a work in progress! (and this commit will probably get
force-pushed over at some point).
2023-07-30 11:55:51 -04:00
1vanK b221b59995
cmake: add SDL_REVISION option
This is useful if one has vendored SDL git and want to avoid rebuilding SDL on every git commit.
2023-07-29 21:16:32 +00:00
Mathieu Eyraud 0500fca00c Add missing break 2023-07-29 10:29:00 -04:00
Ozkan Sezer d3f2de7f29 fixed typo in prev. patch. 2023-07-28 07:35:04 +03:00
Ozkan Sezer 12b35c6a46 test/testnativecocoa.m: fixed deprecation warnings. 2023-07-28 07:20:50 +03:00
Anonymous Maarten e24b3e2fa4 cmake: rename SDL_TEST -> SDL_TEST_LIBRARY 2023-07-28 04:41:29 +02:00
Anonymous Maarten da5016d336 cmake: use pkg-config + test compile instead of Find module for detecting rpi 2023-07-28 04:41:29 +02:00
Anonymous Maarten deec574ff6 cmake: fix SDL_HIDAPI_LIBUSB 2023-07-28 04:41:29 +02:00
SDL Wiki Bot f2ae00c1ad Sync SDL3 wiki -> header 2023-07-27 22:43:14 +00:00
Anonymous Maarten 41a96c8133 doc: document building of SDL tests with CMake 2023-07-28 00:41:26 +02:00
Sam Lantinga 3174d0b970 Sorted controller list 2023-07-27 12:48:15 -07:00
Max Maisel 27b8abb056 Add Steam Deck controller mapping to database.
This adds support for the back paddles, and the "..." key
which are not automatically detected.
* "Back" is mapped to the top left "two windows" key.
* "Start" is mapped to the top right "hambuger menu" key.
* "Guide" is mapped to the "Steam" key.
* The "..." key is just a generic button.

When looking at the screen, paddles are number
* P1: Top right
* P2: Top left
* P3: Bottom right
* P4: Botom Left

The new controller mapping was created with the SDL3 gamepadmap tool.
2023-07-27 12:46:47 -07:00
Sam Lantinga 41d436f0fe Use SetWindowPos to show windows when SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN is set to avoid activating the parent window when showing a child window 2023-07-27 11:56:53 -07:00
Sam Lantinga 0dc85f3078 Improved the documentation for the gamepad paddle buttons 2023-07-27 11:27:42 -07:00
Frank Praznik 2fff999a41 Try to create the dummy mouse cursor after video backend initialization
The mouse->CreateCursor function pointer will always be null if checked before the video backend is initialized, so a dummy default cursor with null internal structures was being created in all cases, not just for backends lacking cursor functionality. Move the check to after the video subsystem is initialized, when the function pointer check is valid.

Passing this dummy cursor with null internal structures to the Wayland backend would cause a crash, as it requires the internal cursor structures to be valid in order to store cursor backing data, even for default system cursors.
2023-07-27 13:00:50 -04:00
SDL Wiki Bot d086d9874d Sync SDL3 wiki -> header 2023-07-27 13:36:07 +00:00
Ryan C. Gordon bce598addd
SDL_pixels.c: Fixed compiler warning on Android NDK. 2023-07-26 15:49:24 -04:00
SDL Wiki Bot ad0c0d3cde Sync SDL3 wiki -> header 2023-07-26 17:17:06 +00:00
Frank Praznik f8e8dff7ee tests: Fix automated window grab and positioning tests under Wayland/XWayland
When using the Wayland video driver or X11 under XWayland, create a renderer and present a frame as part of window creation, as Wayland requires that a frame be presented for the window to be fully mapped and displayed onscreen. This fixes the grab and expected window size tests.

This also disables the window positioning tests when running under the Wayland driver, as Wayland does not allow application windows to position themselves in the desktop space, which renders the tests unreliable and subject to spurious failure.
2023-07-26 10:08:27 -04:00
Starbuck5 4cffbc3644 Add VS code directory to gitignore 2023-07-25 23:36:14 -07:00
Starbuck5 666f81bace Add more endian-specific aliases for 32 bit pixelformats
Add these for all the RGBX variants, just like all the RGBA variants already have.
2023-07-25 23:35:42 -07:00
Sam Lantinga 4749df0a63 Just disable the 4214 warning instead of trying to change the structure definition 2023-07-25 14:01:46 -07:00
Sam Lantinga b8d91252c6 Fixed automation tests using the dummy video driver 2023-07-25 11:48:10 -07:00
Sam Lantinga a16b241b89 Make sure the mouse and keyboard focus is cleared when a window is hidden 2023-07-25 11:47:55 -07:00
Sam Lantinga 21692bc9a8 Cleaned up dummy evdev initialization 2023-07-25 10:44:40 -07:00
Sam Lantinga 3c8f4dca1d Make sure we don't touch the controller effects state when we're in auto mode for PS4/PS5 controllers. 2023-07-24 10:17:02 -07:00
Sam Lantinga 8adab0b88a Removed invalid assert in testatomic 2023-07-22 18:39:39 -07:00
Anonymous Maarten d5479d7b81 project: build in (at least) c99 mode 2023-07-22 15:55:48 -04:00
Anonymous Maarten 8105f1d5b5 SDL_atomic.h: __ARM_ARCH is not always defined for an arm platform
e.g. riscos toolchain
2023-07-22 15:55:48 -04:00
Anonymous Maarten b8c8968b69 ci: disable precompiled headers for riscos 2023-07-22 15:55:48 -04:00
Frank Praznik 96720f3350 wayland: Don't clamp the max window size when unbounded 2023-07-22 11:42:23 -04:00
Anonymous Maarten 3823219b28 ci: bump mymindstorm/setup-emsdk to latest tag 2023-07-22 17:36:02 +02:00
Frank Praznik 813e7c3992 wayland: Ensure that the maximum libdecor frame size limit is above the required minimum
Both the minimum and maximum libdecor frame size limits must meet or exceed the required minimum size, or the libdecor plugins can error and/or crash.
2023-07-22 10:26:33 -04:00
Alexander Richards ec5088cb99 src/SDL.c: add managarm support 2023-07-21 22:45:21 -04:00
Weng Xuetian d4519aafd3 Remove the unimplemented CloseIC in fcitx module
This call is actually a left-over when porting from fcitx4 service to the new org.freedesktop.portal.Fcitx supported by both fcitx4/fcitx5. CloseIC is actually never a part of the new interface on org.freedesktop.portal.Fcitx. It cause any issue user visible effect.
2023-07-20 13:36:33 -07:00
Frank Praznik 5c2fb6eb61 wayland: Adjust the position of existing popups when resizing a window
When resizing a window, adjust the size of the anchor rect and ensure that existing popups remain in bounds/adjacent to avoid a protocol error.
2023-07-20 15:10:39 -04:00
Frank Praznik 72a489e6be wayland: Always use the requested compositor dimensions for fullscreen windows
In the event that the compositor sends window dimensions of (0,0), use the last requested compositor dimensions for fullscreen windows as opposed to trying to guess the target dimensions from the output, which can be null if no outputs are present, or wrong in the case of multi-display setups.  Fullscreen windows must respect the maximum dimensions reported by the compositor, or a protocol violation can result.

This also prevents possible crashes if the compositor sends a config event with dimensions of (0,0) before a display has been added and/or finalized.
2023-07-20 12:06:59 -04:00
Anonymous Maarten 3ab4665956 cmake: bump minimum required CMake version to 3.16
main features:

- No more sdl-build-options/sdl-shared-build-options/sdl-global-options
- Dependency information is stored on SDL3-collector for sdl3.pc
- Use helper functions to modify the SDL targets;
    - sdl_sources to add sources
    - sdl_glob_sources to add glob soruces
    - sdl_link_dependency to add a link dependency that might also
      appear in sdl3.pc/SDL3Config.cmake
    - sdl_compile_definitions to add macro's
    - sdl_compile_options for compile options
    - sdl_include_directories for include directories
  They avoid repeated checks for existence of the SDL targets
- A nice feature of the previous is the ability to generate
  a sdl3.pc or SDL3Config.cmake that describes its dependencies
  accurately.

various:

- remove duplicate libc symbol list
- add CheckVulkan
- remove unused HAVE_MPROTECT
- add checks for getpagesize
2023-07-20 17:58:06 +02:00
SDL Wiki Bot a3a9019265 Sync SDL3 wiki -> header 2023-07-20 14:55:15 +00:00