Commit Graph

15304 Commits (main)

Author SHA1 Message Date
LeRoyce Pearson ec7d9c468e build.zig: add missing .c files and system dependencies 2024-04-20 02:09:16 -06:00
LeRoyce Pearson 72dfb4f05a feat: add build.zig 2024-04-20 01:21:58 -06:00
Frank Praznik fb4c15319e pipewire: Raise minimum build version to 0.3.44 2024-04-19 12:34:22 -04:00
Frank Praznik 566d142938 tests: Clean up the renderer in the video test suite since it isn't automatic anymore. 2024-04-19 12:23:40 -04:00
Frank Praznik bede245395 Remove references to renderers being destroyed with windows in the documentation 2024-04-19 12:23:40 -04:00
Ryan C. Gordon cab3defc18 render: SDL_DestroyWindow hollows out its renderer but doesn't free it.
This allows apps to destroy the window and renderer in either order, but
makes sure that the renderer can properly clean up its resources while OpenGL
contexts and libraries are still loaded, etc.

If the window is destroyed first, the renderer is (mostly) destroyed but its
pointer remains valid. Attempts to use the renderer will return an error,
but it can still be explicitly destroyed, at which time the struct is free'd.

If the renderer is destroyed first, everything works as before, and a new
renderer can still be created on the existing window.

Fixes #9540.
2024-04-19 00:25:59 -04:00
Ryan C. Gordon 39c8434f5f render: Manage memory for SDL_Renderer* at higher level.
Previously, each backend would allocate and free the renderer struct. Now
the higher level does it, so the backends only manage their private resources.

This removes some boilerplate and avoids some potential accidents.
2024-04-19 00:25:59 -04:00
Frank Praznik 09e32faa68 x11: Ensure that a configure event was received before sending the final window size and coordinates
Headless display servers might not send an initial configure event, so don't assume that one has arrived and send garbage size/position values when showing a window.
2024-04-18 14:28:16 -04:00
SDL Wiki Bot 64d5fb6ab6 Sync SDL3 wiki -> header 2024-04-18 17:41:14 +00:00
Anonymous Maarten 911fc9b17e testffmpeg: treat Khronos headers as system headers 2024-04-18 09:10:15 -07:00
devon-artmeier 9c65738926
dialog: Use size_t for length variables (#9572)
Shuts up a warning about size differences.
2024-04-18 09:09:10 -07:00
bootrako 1de8a53015 windows hidapi: fix header compilation 2024-04-18 09:00:49 -07:00
Frank Praznik 0bda7e22cf
wayland: Print an error when the display connection is closed by the server
Otherwise, it isn't immediately clear to the client application as to why its windows suddenly disappeared, and it received a quit event out of nowhere.
2024-04-18 11:23:58 -04:00
Frank Praznik a923db9d0a
pipewire: Use the core version info for the preferred version check
When running in a container, the underlying Pipewire version may not match the library version, so retrieve and check the core version info to see if it meets the preferred version requirements.
2024-04-17 22:34:26 -04:00
Ryan C. Gordon bc6ad3ee43
dialog: convert_ext_list had parameter names in wrong order in header. 2024-04-17 21:45:51 -04:00
Anonymous Maarten 7dd4f1ec22 SDL3 removed SDL_HINT_RENDER_SCALE_QUALITY hint
textures now default to linear filtering, use SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST) if you want nearest pixel mode instead
2024-04-17 16:38:15 -07:00
Ryan C. Gordon 093160904d
SDL_Keymod: Removed SDL_KMOD_RESERVED.
Fixes #9481.
2024-04-17 17:30:10 -04:00
Frank Praznik b1e47704ee audio: Prefer Pipewire if at least version 1.0.0
Checking for the pipewire-pulse service is unreliable when used in containers such as Flatpak, so simply use a minimum version check instead and prefer it over the Pulseaudio backend if at least version 1.0.0.
2024-04-17 17:16:28 -04:00
SDL Wiki Bot 2c183c602d Sync SDL3 wiki -> header 2024-04-17 21:09:29 +00:00
Ryan C. Gordon a18f3d55b7
SDL_iostream.h: Corrected documentation for SDL_ReadIO and SDL_WriteIO.
Fixes #9443.
2024-04-17 17:08:05 -04:00
Mathieu Eyraud cac1434295 Close pipe in Wayland_ShowMessageBox
When closing message box by pressing escape, Zenity does not write to the pipe and fgets() get stuck waiting for EOF.
2024-04-17 15:27:34 -04:00
Frank Praznik a2eb2697a3 x11: Fix mode switching when running under XWayland
XWayland emulates the XRandR interface, so it still needs the actual mode switch call to trigger the mode switching emulation.

There is also no need to wait when using XWayland mode switching emulation, as it is handled via viewport scaling and thus instantaneous.
2024-04-17 11:39:49 -04:00
Frank Praznik bed6c5b81f x11: Wait for mode switches to complete when synchronizing a window
Otherwise, the sync can timeout due to mode switching taking several seconds.
2024-04-17 11:39:49 -04:00
Sam Lantinga e632ed23ad Fixed compilation with C89 (thanks @d-s-a!)
Closes https://github.com/libsdl-org/SDL/pull/9564

(cherry picked from commit 4e29be814e2a67992e7487b2b1814e37ff4c6980)
2024-04-17 07:49:19 -07:00
DevonArtmeier 65a04a772e dialog: Allocate space for terminator when building filter string 2024-04-16 14:09:18 -07:00
Ryan C. Gordon fdcc3e1151
thread: make generic SDL_Condition a no-op if built with SDL_THREADS_DISABLED.
Otherwise, when you call SDL_CreateCondition() in something that can otherwise
survive in a single-threaded build, you'll get an error that seems fatal.

We already do this for mutexes and rwlocks (but not semaphores!)

Fixes #9558.
2024-04-16 15:07:56 -04:00
SDL Wiki Bot bf0bf80df6 Sync SDL3 wiki -> header 2024-04-16 17:30:27 +00:00
Ryan C. Gordon db6b6bd75e
include: Fixed up some sensor documentation.
Fixes #9468.
2024-04-16 13:29:26 -04:00
Sam Lantinga 650d3b44e1 Removed the word "other" since the version has been removed 2024-04-16 08:52:21 -07:00
Ryan C. Gordon 235bfe2631
SDL_log.h: Remove SDL_MAX_LOG_MESSAGE.
The message length limit was removed in 2.0.24, so there's no need for
this define in SDL3 at all.

Fixes #9467.
2024-04-16 00:31:57 -04:00
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 d51b53ef8f Add final Vulkan AV1 ext and VVC support
Fixes https://github.com/libsdl-org/SDL/issues/9464
2024-04-15 16:15:09 -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 ae57b0c9d8 Randomly split the data in audio_resampleLoss
This helps ensure correct resampling across track boundaries
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 7f96217c63 Add testautomation to android artifacts 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 f18cf7cffb Avoid changing dst_spec in testaudiostreamdynamicresample skip_audio
This is no longer allowed on bound streams
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 d69e6714a8 Document that tooltip windows don't get mouse or keyboard focus 2024-04-15 14:38:00 -07:00
Sam Lantinga bfde7294f5 Added a note that the joystick should be initialized on the main thread on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9533
2024-04-15 14:19:44 -07:00
SDL Wiki Bot 7000a112a3 Sync SDL3 wiki -> header 2024-04-15 21:13:12 +00:00
Sam Lantinga 70ce808c09 Changed SDL_KeyCode values to defines
This clears up confusion about whether to use SDL_KeyCode or SDL_Keycode and makes it clear that the values aren't the full set of possible keycodes.

Fixes https://github.com/libsdl-org/SDL/issues/9493
2024-04-15 11:08:51 -10:00
Sam Lantinga 2fa4937e1a Removed obsolete padding 2024-04-15 13:55:01 -07:00