Compare commits

..

380 Commits

Author SHA1 Message Date
Sam Lantinga
3aabb7bc53 Updated to version 3.4.6 for release 2026-05-01 06:31:29 -07:00
Cameron Gutman
102bf22db8 haptic: Enable gamepad haptic support under sdl2-compat
(cherry picked from commit c677c913a6)
2026-04-30 21:17:56 -07:00
Sam Lantinga
65eda5fbd4 Fixed copyright on SDL_hidapi_steam_triton.c
Fixes https://github.com/libsdl-org/SDL/issues/15486
Closes https://github.com/libsdl-org/SDL/pull/15487

(cherry picked from commit e9a6d7eda0)
2026-04-30 19:56:07 -07:00
Cameron Gutman
ed70ce85c1 pen: Fix enabling touch emulation while a pen is connected
(cherry picked from commit 41f079491a)
2026-04-29 19:50:48 -05:00
Jakub Wasilewski
cc150bc566 metal: Added missing lock in METAL_INTERNAL_PerformPendingDestroys.
Without this lock, a concurrent call to SDL_ReleaseGPUBuffer, SDL_ReleaseGPUTransferBuffer or SDL_ReleaseGPUTexture can cause one of the arrays to be reallocated while METAL_INTERNAL_PerformPendingDestroys is iterating over it, causing a bad day all around.

(cherry picked from commit 1492911c7d)
2026-04-29 08:48:49 -07:00
Cameron Gutman
46f87cdc5a pen: Only create touch emulation device when a pen is present
(cherry picked from commit 1aa72247af)
2026-04-29 02:21:46 -04:00
Sam Lantinga
d7af22f927 Disable accidentally enabled debug logging
(cherry picked from commit e1e6cbe6ec)
2026-04-28 17:26:48 -07:00
Ryan C. Gordon
fbd792e4df android: Parsing the APK's central dir is separate from the AAssetManager.
Only parse when necessary, which it isn't when opening a file, so this is now
separated from creating the cached AAssetManager object.

(cherry picked from commit 9235ac4efd)
2026-04-28 20:25:19 -04:00
Ryan C. Gordon
79dacf6630 android: Use enough zip64 format info to see APKs with files that are > 4gb.
(cherry picked from commit 40e60452ad)
2026-04-28 20:25:10 -04:00
Ryan C. Gordon
46045ea060 android: Parse the APK directory tree, replace AAssetManager enum/getpathinfo.
The AAssetManager won't supply this information to us, but it's just a zip
file, so we can read its central directory ourselves. We can still use
AAssetManager for file i/o to the APK's assets, so we don't have to deal with
compression and other zipfile features.

Fixes #15220.
Reference Issue #15347.

(cherry picked from commit bb4332bdc2)
2026-04-28 20:25:05 -04:00
Sam Lantinga
3164b74256 Don't use the fake HID endpoint for Xbox controllers on Windows
(cherry picked from commit d5fca9628a)
2026-04-28 14:10:29 -07:00
Ryan C. Gordon
affc61cc5e checkkeys: Sleeping for 100ms every frame makes the program too unresponsive.
Makes it feel like there's a bug in SDL's text input handling. 10ms is fine.

(cherry picked from commit 7212ab1c2a)
2026-04-28 17:16:37 +03:00
Cameron Gutman
0013e9e1d3 atomic: Fix and cleanup SDL_UnlockSpinlock()
- Add missing SDL_MemoryBarrierRelease() in the generic codepath
- Remove MSVC x86/x64 case which is now identical to the generic codepath
- Fix Solaris barrier to ensure prior stores are visible before unlocking

(cherry picked from commit 95ae0c194e)
2026-04-27 19:42:39 -05:00
Cameron Gutman
22b5ceb0c7 atomic: Fix infinite recursion in SDL_CompilerBarrier() fallback
On some platforms, SDL_MemoryBarrierRelease() is defined to
SDL_CompilerBarrier(). If SDL_CompilerBarrier() is also defined to
the fallback spinlock acquire/release, then we will infinitely
recurse in SDL_UnlockSpinlock(). Avoid this by not unlocking the
temporary spinlock we create.

(cherry picked from commit 66e98b5598)
2026-04-27 14:31:09 -04:00
Sam Lantinga
259e4fe1a2 Fixed double-backspace with hardware keyboard on iOS
(cherry picked from commit b7726026f8)
2026-04-27 10:55:11 -07:00
Sam Lantinga
aef5dc0967 Use SDL_SendScreenKeyboardShown() and SDL_SendScreenKeyboardHidden() on iOS
We now have events for on-screen keyboard visibility, so we should use these instead of starting and stopping text input.

Fixes https://github.com/libsdl-org/SDL/issues/15437
Confirmed not to regress the fix in https://github.com/libsdl-org/SDL/pull/11845

(cherry picked from commit dcf05165d3)
2026-04-27 10:55:11 -07:00
Sam Lantinga
d83ac9ebfc testime: use the correct properties when enabling text input
(cherry picked from commit 6f952a8e63)
2026-04-27 10:55:11 -07:00
Frank Praznik
2a53eed783 renderer: Check the surface validity flag when re-acquiring the surface in the software renderer
If a size change occurs, the sdl2-compat event handler will flush the renderer, which will cause the software renderer to re-acquire a surface that was invalidated due to the size change. However, if the OnWindowPixelSizeChanged handler is called afterward, the invalid flag will be set on the surface, causing presentation to fail.

Check both for a null surface pointer and an invalid surface flag when checking surface validity in the software renderer.

(cherry picked from commit 73fc274ef7)
2026-04-27 12:57:40 -04:00
Cameron Gutman
c784127077 atomic: Use __atomic_signal_fence() for SDL_CompilerBarrier()
This is the (slightly) more standard way to accomplish it.

(cherry picked from commit d5acd7f123)
2026-04-26 22:04:58 -05:00
ShulkerSakura
1d228f8a7d Add keychron Q3 blacklist (#15462)
(cherry picked from commit 543a05bf08)
2026-04-26 07:45:43 -07:00
Sam Lantinga
ee2bebbace Fixed keyboard being hidden while being shown on Android
(cherry picked from commit 47d14491a6)
2026-04-25 17:11:14 -07:00
Ryan C. Gordon
33f4093086 haiku: Don't strdup SDL_GetError()'s string before using it in SDL_SetError().
This isn't necessary anymore, after recent fixes.

(cherry picked from commit 8fb1c6e367)
2026-04-25 15:27:15 -04:00
Ryan C. Gordon
8975782d9a error: Alternate between two buffers in SDL_SetError.
This way you can always safely use SDL_GetError() in your formatted string:

```c
SDL_SetError("Couldn't open '%s': %s", filename, SDL_GetError());
```

This problem was hidden on platforms that use the dynamic API, because it
would format the new error string to a separate buffer first, to deal with
the varargs entry point.

Fixes #15456.

(cherry picked from commit 559d226fc6)
2026-04-25 15:18:25 -04:00
Anonymous Maarten
74058d40d6 cmake: also check iconv on Windows when SDL_SYSTEM_ICONV is defined
(cherry picked from commit 929e304b18)
2026-04-25 20:50:45 +03:00
Sam Lantinga
70d4363890 Ignore the first hover event with a stale position on iOS
Fixes https://github.com/libsdl-org/SDL/issues/15450

(cherry picked from commit 3c02de2f7c)
2026-04-25 07:26:25 -07:00
Cameron Gutman
396cd2d7f7 atomic: Fix memory barriers on MSVC ARM64
(cherry picked from commit 2c4c8172d7)
2026-04-24 20:13:22 -05:00
Cameron Gutman
604a4dfa69 atomic: Use acquire/release InterlockedExchange intrinsics on ARM64EC
(cherry picked from commit 0220a41a2e)
2026-04-24 19:01:31 -05:00
Cameron Cawley
da0e3abd41 Fix compiler warning in MSVC ARM64 builds
(cherry picked from commit fa68a73788)
2026-04-24 19:01:31 -05:00
Sam Lantinga
eebe7558d5 Fixed the menu controller button state on recent Apple platforms
The OS reports the button state as of macOS 11.0, iOS 14.0, and tvOS 14.0, so use that instead of the deprecated pause handler.

(cherry picked from commit 1146ea484a)
2026-04-24 11:38:13 -07:00
Frank Praznik
d240da419e wayland: Avoid excessive exposure events during interactive resizes
Only send the unblocking exposure event once per frame, so that clients using an event watcher won't redraw excessively.

Also ensure that the unblocking exposure is always sent on the libdecor path.

(cherry picked from commit 01a7588f8e)
2026-04-24 13:26:18 -04:00
Sam Lantinga
b00d32c10a Don't do name blacklisting if there's no name
(cherry picked from commit c124da4367)
2026-04-24 07:34:54 -07:00
Sam Lantinga
89eb50b25e Fixed crash in SDL_startswith() when passed NULL strings
Fixes https://github.com/libsdl-org/SDL/issues/15451

(cherry picked from commit f3d7df54e2)
2026-04-24 07:34:54 -07:00
Petar Popovic
8f99954e01 SDL_EnumerateDirectory(""): Don't append path separator if path is empty
(cherry picked from commit 1db6d5381a)
2026-04-23 22:53:16 -04:00
Cameron Gutman
da032b77ab atomic: Use DMB ISHLD for aarch64 acquire barrier
This is a little more efficient than a DMB ISH and matches what
GCC, Clang, and MSVC generate for a C++11 acquire fence.

(cherry picked from commit f2206974b0)
2026-04-23 21:19:29 -05:00
Cameron Gutman
ef425def66 atomic: Use __atomic_thread_fence() when available
This avoids requiring inline assembly for each architecture.

It also fixes some weakly ordered architectures which lacked
said inline assembly (RISC-V, MIPS, LoongArch, etc) and were
thus disasterously broken.

(cherry picked from commit 2858a32723)
2026-04-23 18:53:28 -05:00
Anders Jenbo
525842f2e7 Prefer higher color depths in SDL_GetClosestFullscreenDisplayMode()
(cherry picked from commit 9fa9edeadb)
2026-04-23 15:33:43 -07:00
Sam Lantinga
88102f8d3c Revert "(video) fix SDL_GetClosestFullscreenDisplayMode aspect ratio & refresh rate picking logic"
This reverts commit 0231ff03de.

This causes SDL to return 1024x768 when asking for a best fit to 640x480 (thanks @AJenbo), so I'm reverting this until we can investigate more.

(cherry picked from commit 7b23cd62ca)
2026-04-23 13:23:56 -07:00
Semphris
5454711c3b Update Zenity dialog filters to ignore case
(cherry picked from commit 726e82d0f3)
2026-04-21 14:39:26 -07:00
Nintorch
563b8cb51c Include OS detection in Emscripten joystick GUID
This PR modifies the Emscripten joystick backend to detect the user's OS and store its ID in the GUID, because different OSes might need different mappings for the same controllers.
I'm not sure if different browsers on the same OS can also have different mappings, but if they can, browser detection can be added to the GUID too if needed.

This PR also makes the GUID use `SDL_HARDWARE_BUS_USB` instead of `SDL_HARDWARE_BUS_UNKNOWN`, similarly to how Android and MFI backends always use `SDL_HARDWARE_BUS_BLUETOOTH` and GameInput, XInput, and RawInput backends always use `SDL_HARDWARE_BUS_USB`.

(cherry picked from commit 60a59fa557)
2026-04-21 10:35:52 -07:00
Frank Praznik
7060088ffc dialog: Use case-insensitive filter matching on portal dialogs
On most implementations, filter pattern matching is case-sensitive. For case-insensitive matching of a pattern such as '*.png', the pattern *.[pP][nN][gG]' must be used.

(cherry picked from commit 387439d009)
2026-04-21 11:42:22 -04:00
Nintorch
9cdad39b52 Add trigger rumble support to Emscripten joysticks
This PR adds trigger rumble support to the Emscripten joystick backend.

(cherry picked from commit 651136ac7a)
2026-04-21 07:46:16 -07:00
Petar Popovic
7bd84b29e9 Fix potential leak in camera example
(cherry picked from commit eacfe835e7)
2026-04-21 07:40:16 -04:00
som3a-dev
ab6bc13ef1 (video) fix SDL_GetClosestFullscreenDisplayMode aspect ratio & refresh rate picking logic
(cherry picked from commit 0231ff03de)
2026-04-20 10:51:53 -07:00
Frank Praznik
462b1f7b0d dbus: Return false if the screensaver inhibitor interface is unavailable
Returning true with an unavailable interface in no-op cases can prevent fallback to other inhibition methods. If the inhibitor interface was previously tried and marked as unavailable, just return false.

(cherry picked from commit 125ed508c2)
2026-04-20 12:59:01 -04:00
atiradonet
7ca97d0791 joystick: Add VIRPIL Controls flight stick and throttle device IDs. (#15418)
VIRPIL Controls (VID 0x3344) flight sticks are misclassified as
gamepads by SDL's axis-count heuristic because they report exactly
6 axes, matching SDL_GAMEPAD_AXIS_COUNT. Adding them to the
appropriate device lists ensures correct classification.

Tested on Linux (Fedora 43, kernel 6.19) with:
- R-VPC Stick MT-50CM3 (PID 0x4391) -> SDL_JOYSTICK_TYPE_FLIGHT_STICK
- L-VPC Stick MT-50CM3 (PID 0x8390) -> SDL_JOYSTICK_TYPE_FLIGHT_STICK
- VPC VMAX Prime Throttle (PID 0x0196) -> SDL_JOYSTICK_TYPE_THROTTLE

(cherry picked from commit 3b89c7b537)
2026-04-20 09:04:42 -07:00
Frank Praznik
c819960a1c hints: Correct the cursor DPI scaling hint
Support for this hint was removed from Wayland shortly after it was added, but the documentation was never updated to reflect this.

(cherry picked from commit 76aa12701a)
2026-04-20 10:33:39 -04:00
Frank Praznik
aadc6724d8 wayland: Fix scaled cursor image selection
When the pointer isn't being scaled, make sure the cursor scale factor is set to that of the window to avoid blurry cursors on high-DPI desktops, and use the inverse of the pointer scale value when selecting buffers for size-adjusted cursors. Fixes a regression from adjusting custom cursor sizes when using scale to display mode, and ensures that the best buffer size for the scaled cursor is always selected.

(cherry picked from commit 03f1a84302)
2026-04-20 10:21:53 -04:00
Cameron Cawley
447ba0aa01 Improve constness with Clipboard APIs
(cherry picked from commit 43c928ee86)
2026-04-19 07:06:43 -04:00
Cameron Gutman
97c154791b atomic: Fix missing full memory barrier on GCC/Clang
__sync_lock_test_and_set() is designed for creating locks, not as
a general atomic exchange function. As a result, it only provides
an acquire memory barrier and isn't guaranteed to actually store
the provided value (though it does on architectures we care about).

__atomic_exchange_n() is supported on GCC/Clang for the last ~10
years, so let's use that instead if available. We will keep the
__sync_lock_test_and_set() fallback around for ancient platforms,
but add a full memory barrier to match the documented behavior.

(cherry picked from commit 509a36db16)
2026-04-19 06:55:12 -04:00
William Horvath
350f873534 windowsrawinput: Add missing WIN_SetRawKeyboardFlag_Inputsink stub.
(cherry picked from commit 00f9a25879)
2026-04-17 14:48:05 -04:00
Ryan C. Gordon
0e105ba49f CLAUDE.md: Just copy the text from AGENTS.md in here for now.
Someone mentioned that Claude sees this file's previous text and adds "look at
AGENTS.md" to it's TODO list instead of treating it as the thing it should do
first.

If everything decides to prefer AGENTS.md at some point, we'll delete this
file.

A symlink would apparently also work, but it would be the only symlink in the
SDL git repo, so it seemed less disruptive to just copy the file over for now.

(cherry picked from commit 847fc72b1b)
2026-04-16 13:55:51 -04:00
Ryan C. Gordon
0f67a2d179 CLAUDE.md: added.
Apparently Claude Code won't read AGENTS.md by default at this moment, but
since that's the direction we're moving, let's just add the file Claude
currently looks for and tell it that the actual instructions are in AGENTS.md.

I thought these things were supposed to be less complicated that interacting
with humans, lol.

(cherry picked from commit 1124e44e4c)
2026-04-16 12:22:42 -04:00
Frank Praznik
3dc844148c wayland: Fix some comments
Fix grammar, and remove a TODO that is no longer relevant with an event thread.

(cherry picked from commit c1bf0e9de9)
2026-04-16 10:15:26 -04:00
Ryan C. Gordon
95965bfef4 AGENTS.md: Change "may not" to "must not".
(Hat tip to Sean Barrett on the stronger wording here.)

(cherry picked from commit 5bda0ccfb0)
2026-04-15 17:27:40 -04:00
Ryan C. Gordon
533ca2ea0c policy: Clarify that "AI" means specific things.
(cherry picked from commit 954e2f3354)
2026-04-15 15:42:08 -04:00
Ryan C. Gordon
2e90ed4290 policy: Updated AI-related text based on excellent feedback.
(cherry picked from commit 4711119605)
2026-04-15 15:42:02 -04:00
Ryan C. Gordon
00c3cfcf97 policy: Added to the PR template, and an AGENTS.md, refusing AI contributions.
Fixes #15350.

(cherry picked from commit 08285d828e)
2026-04-15 15:41:56 -04:00
Ryan C. Gordon
a727925b5a wikiheaders: Don't escape . chars in manpage's brief section.
Otherwise, the `apropos` command gets upset.

Fixes #15387.

(cherry picked from commit a49a5e87a9)
2026-04-15 13:31:42 -04:00
David Vanderson
d6f7b314b3 xinput2: correct horizontal touchpad scrolling direction
This fixes testmouse so when fingers move left the green line moves
left.

(cherry picked from commit 5e0f721fd4)
2026-04-13 19:44:58 -04:00
Frank Praznik
88acac053a wayland: Enable text input even when the text input protocol is not available.
Even without the text input protocol, basic text can still be obtained from individual keys and the composition system.

(cherry picked from commit dd6d49afbd)
2026-04-12 13:03:29 -04:00
Mathieu Eyraud
69d4499c56 Don't call function pointer when it is NULL
(cherry picked from commit dc16a35140)
2026-04-10 10:54:08 -07:00
Cameron Gutman
e54cc2b1fb kmsdrm: Fix order of GBM and EGL teardown
All locked front buffers must be released prior to destroying
the EGL surface to avoid causing a UAF in libnvidia-egl-gbm.so.

(cherry picked from commit 463b6be133)
2026-04-10 10:38:43 -07:00
Frank Praznik
e057712565 x11: Ignore slave button presses on non-focused windows
When a window has the pointer grabbed, the X server will grab all master device events, and XInput2 will continue to deliver slave events to the window immediately under the pointer, regardless of grab status. Only send slave pointer events to the focused window, and fall back to the core X events to catch button presses missed when the pointer is over another window.

(cherry picked from commit 0fc9db9b82)
2026-04-10 12:51:56 -04:00
Sylvain
3243ae52e7 Android: fix lint warning "unneed cast to Activity"
(cherry picked from commit ccf688c921)
2026-04-10 07:09:02 -07:00
Cameron Gutman
2d0ea900ba kmsdrm: Fix double-free of GBM surface buffer in atomic mode
(cherry picked from commit c2d0b59f29)
2026-04-10 00:06:49 -05:00
Sam Lantinga
61ba96db36 Don't send any commands to the GPU while hidden
Previously we weren't doing drawing, but we were enqueuing viewport commands and so forth, which were causing GPU permission errors on iOS. We really don't want to be sending any work to the GPU when we're in the background.

(cherry picked from commit 57f3d2ea0a)
2026-04-08 10:10:00 -07:00
Sam Lantinga
a22488663c Fixed SDL_GlobDirectory() on asset paths on Android
Make sure we pass the original path back to the directory enumeration callback.

(cherry picked from commit 5c430f8715)
2026-04-08 09:10:54 -07:00
Sam Lantinga
d2289755e9 Fixed crash if SDL_SYS_CreateThread() fails (thanks @capehill!)
Fixes https://github.com/libsdl-org/SDL/issues/15340

(cherry picked from commit 7f23f09ee8)
2026-04-07 12:23:14 -07:00
Ozkan Sezer
7f3071a207 SDL_hidapi_zuiki.c: silence bogus -Warray-bounds warnings from gcc-4.9
(cherry picked from commit f61a22e10f)
2026-04-07 06:47:02 +03:00
Frank Praznik
ff2c970c15 dbus: Better handle local URI paths
Decode file URIs before trying to open them, and properly handle non-URI local paths.

(cherry picked from commit b8e8caf7c5)
2026-04-06 19:45:12 -04:00
Anonymous Maarten
6b73386987 ci: bump workflows
(cherry picked from commit 928cfef4b7)
2026-04-07 01:27:56 +02:00
cosmonaut
543b8b9b12 GPU: Fix Vulkan backend segfault
(cherry picked from commit f8b7e22d7d)
2026-04-06 14:47:00 -07:00
cosmonaut
c226a67760 GPU: Fix memory leak in Vulkan command buffer
(cherry picked from commit aeb4309c0e)
2026-04-06 10:40:14 -07:00
Frank Praznik
33090dc318 dbus: Use OpenFile for opening local 'file://' URIs
Per the spec, OpenURI can't open local paths, so OpenFile needs to be used instead.

(cherry picked from commit 0a54fdb862)
2026-04-06 11:45:37 -04:00
Sascha Reuter
3939fb03bf GPU Vulkan: handle VK_ERROR_SURFACE_LOST_KHR in acquire path
On Android, backgrounding and foregrounding an app causes the Vulkan
surface to be destroyed. vkAcquireNextImageKHR returns
VK_ERROR_SURFACE_LOST_KHR, but the acquire while(true) loop only calls
RecreateSwapchain which doesn't recreate the surface, resulting in an
infinite retry loop and a black screen.

Handle VK_ERROR_SURFACE_LOST_KHR by setting both needsSurfaceRecreate
and needsSwapchainRecreate, then returning to let the existing
recreation path handle it on the next call.

Fixes #15322

(cherry picked from commit c98b36ff03)
2026-04-06 07:19:36 -07:00
Frank Praznik
d07bd49a7d misc: Use the OpenURI D-Bus portal for opening URLs
This works inside of containers, and supports passing an activation token with the request, which is needed on Wayland to transfer focus to the browser.

(cherry picked from commit 682da4ee98)
2026-04-05 16:33:11 -04:00
Peter Kokot
4bc27ad15e CMake: Replace CMAKE_COMPILER_IS_GNUCC with CMAKE_C_COMPILER_ID
CMAKE_COMPILER_IS_GNUCC is obsolete variable and can be replaced with
CMAKE_C_COMPILER_ID (also available since early CMake versions).

In the past CMake versions also LCC and QCC compilers had this varible
set to boolean true but these aren't relevant here.

(cherry picked from commit 25aa1c643f)
2026-04-04 10:29:06 -07:00
Sam Lantinga
ce3cc80aca Send SDL_EVENT_SCREEN_KEYBOARD_HIDDEN when the keyboard is hidden on Android
(cherry picked from commit fc2f4fcc22)
2026-04-04 10:08:57 -07:00
Sam Lantinga
103a4c4cb2 Enable npot texture wrapping if GL_OES_texture_npot is available
(cherry picked from commit 173adc1bf6)
2026-04-04 08:17:57 -07:00
Sam Lantinga
b6fd088246 Updated to version 3.4.5 for development 2026-04-03 17:16:53 -07:00
Sam Lantinga
5848e584a1 Updated to version 3.4.4 for release 2026-04-03 16:10:59 -07:00
Sam Lantinga
a883e69d7b Use the correct index for PS2 controllers
Closes https://github.com/libsdl-org/SDL/pull/15294

(cherry picked from commit 41c3a91079)
2026-04-03 16:08:55 -07:00
Sanjay Govind
8d7f469fb5 Add support for GIP guitars via gameinput (#15301)
(cherry picked from commit 7f86f9107d)
2026-04-03 16:03:17 -07:00
foxtacles
18463ccb8f (emscripten) Add null checks for gamepad in vendor/product/xinput helpers (#15313)
navigator.getGamepads() can return null for a slot if the gamepad
disconnects between the gamepadconnected event and the proxied
MAIN_THREAD_EM_ASM_INT call. This causes a TypeError when accessing
gamepad.id. Add null guards matching the pattern already used in
EMSCRIPTEN_JoystickOpen and EMSCRIPTEN_JoystickRumble.

(cherry picked from commit 59602fb473)
2026-04-03 15:08:37 -07:00
Frank Praznik
2798ac07ea wayland: Retrieve the system minimum libdecor limits before overwriting them 2026-04-03 14:08:58 -04:00
Sam Lantinga
9403c6b43d Use the correct source rectangle when doing scaled blits
Fixes https://github.com/libsdl-org/SDL/issues/15309

(cherry picked from commit 5ae1308e5b)
2026-04-03 01:33:21 -07:00
nilFinx
48060320f6 haiku: Always assume that the URL is encoded (required on nightly) (#15305)
(cherry picked from commit f3a3b4b95a)
2026-04-03 00:01:41 -07:00
Cameron Gutman
f3e1c93ea2 kmsdrm: Add missing KMSDRM_FBFromBO() failure check
(cherry picked from commit 1674a04b01)
2026-04-02 22:03:43 -05:00
Christian Semmler
5be888591c emscripten: Fix navigator.getGamepads crash in worker threads
The three EM_JS functions (SDL_GetEmscriptenJoystickVendor,
SDL_GetEmscriptenJoystickProduct, SDL_IsEmscriptenJoystickXInput)
call navigator.getGamepads() which is only available on the main
browser thread. With PROXY_TO_PTHREAD, the joystick callbacks are
dispatched to a worker where the Gamepad API is not available,
causing a TypeError.

Convert these from EM_JS to static functions using
MAIN_THREAD_EM_ASM_INT, which proxies the JavaScript execution to
the main browser thread. This matches the pattern already used by
other navigator.getGamepads() calls in the same file.

(cherry picked from commit be8643f739)
2026-04-02 19:37:33 -07:00
Cameron Gutman
c391e73432 kmsdrm: Initialize kms_in_fence_fd to -1
Prior to this fix, we closed stdin on the first call to drm_atomic_commit().

(cherry picked from commit 3c11b43e59)
2026-04-02 20:47:51 -05:00
Ryan C. Gordon
195b58121e kmsdrm: Disable atomic mouse code for now.
The rest of the atomic codepath is still enabled and usable.

This fixes missing and weird mouse cursors. We'll debug this code later on.

Reference Issue #15242.

(cherry picked from commit f423a2ae34)
2026-04-02 20:41:54 -04:00
Sanjay Govind
b264c19c83 Update to GameInput V3 (#15302)
(cherry picked from commit c58a61fdd4)
2026-04-02 17:10:59 -07:00
Sam Lantinga
870c006288 Don't strip the alpha channel when scaling surfaces if it will be needed
Fixes https://github.com/libsdl-org/SDL/issues/15297

(cherry picked from commit 501ee05129)
2026-04-02 11:01:27 -07:00
Ryan C. Gordon
9c6876ac18 pipewire: Don't mark a device disconnected if pw_stream_dequeue_buffer fails.
Apparently this _can_ happen under load, or maybe some other weird condition.

Hopefully this will encourage PipeWire to fire output_callback again, and
we'll just try again later.

Reference Issue #14916.

(cherry picked from commit 32ef82caaf)
2026-04-02 13:59:43 -04:00
Sam Lantinga
31c7aab5db Added a hint "SDL_SURFACE_MALLOC" to disable aligned surface allocation
This is needed for sdl12-compat, where all surfaces were not aligned.

(cherry picked from commit 156187bf58)
2026-04-02 10:33:24 -07:00
Janne Virtala
212f7539cb SDL_PrivateJoystickForceRecentering(): fix infinite loop
(cherry picked from commit b5ef75249f)
2026-04-02 09:28:15 -07:00
Ryan C. Gordon
2503d34724 aaudio: Respect SDL_HINT_AUDIO_DEVICE_STREAM_ROLE hint.
Fixes #15299.

(cherry picked from commit 4d17b99d0a)
2026-04-02 11:25:22 -04:00
Sam Lantinga
b7e1f88db8 Added documentation to fix building on macOS with Xcode 12.2 (thanks @buhman!)
Fixes https://github.com/libsdl-org/SDL/issues/15167

(cherry picked from commit 6466c10ae4)
2026-04-01 16:38:12 -07:00
Petar Popovic
8af454a0a1 SDL_GlobDirectory(): Don't descend into sub-directories, if not requested by pattern
(cherry picked from commit d6129d063f)
2026-03-30 16:39:14 -04:00
Ryan C. Gordon
270c2b8e86 process: Don't duplicate NULL stdio handles on Windows.
It's okay to pass null handles to win32's CreateProcess().

Fixes #14977.

(cherry picked from commit f13cd9a666)
2026-03-30 16:28:41 -04:00
Sam Lantinga
3c9510f2ce Fix msvc analyzer warnings
- Initialize some out variables that are annotated inout in the function setting them.

- Fix 'dwVerHandle' might not be '0' warning from msvc analyzer calling GetFileVersionInfoA. MSDN says that
  the lpdwHandle param to GetFileVersionInfoSize is optional (set to zero) and the dwHandle param to
  GetFileVersionInfoA is ignored. msvc goes a step further and explicitly warns if dwHandle is not provably 0.

Fixes the following:
SDL3\src\stdlib\SDL_string.c(2359): warning C6054: String 'text' might not be zero-terminated.
SDL3\src\video\windows\SDL_windowsevents.c(897): warning C6001: Using uninitialized memory 'devName'.
SDL3\src\video\windows\SDL_windowskeyboard.c(644): warning C6388: 'dwVerHandle' might not be '0':  this does not adhere to the specification for the function 'GetFileVersionInfoA'.

(cherry picked from commit b878ab1691)
2026-03-30 10:49:46 -07:00
zn-arf
3ae089e4de Fix Metal GPU backend not being included in CMake configuration
Fixes #15285

Missing Metal GPU block in CMakeLists.txt prevents `HAVE_SDL_GPU` from being set when only Metal is enabled.

(cherry picked from commit e66f1b5162)
2026-03-30 10:49:46 -07:00
Ryan C. Gordon
2b6bee46b2 thread: SDL_CreateThread() shouldn't return before the new thread is set up.
Fixes #15290.

(cherry picked from commit 0756603e6d)
2026-03-30 10:40:16 -04:00
Sam Lantinga
be45038432 Make sure native textures have the same channel precision if possible
Fixes https://github.com/libsdl-org/SDL/issues/14882

(cherry picked from commit fdfcfc0566)
2026-03-30 06:40:51 -07:00
Ryan C. Gordon
1fc5001f77 emscripten: Add support for automounting persistent storage before SDL_main.
Now apps can have persistent files available during SDL_main()/SDL_AppInit()
and don't have to mess with Emscripten-specific code to prepare the filesystem
for use.

(cherry picked from commit dcc177faa4)
2026-03-29 07:41:37 -07:00
Semphris
c546c5d335 Fix Windows file dialog calling the callback twice
If the modern implementation of file dialogs on Windows fails, it will invoke the callback on error and report an error, then SDL would attempt invoking the dialog again using an older implementation, which would call the callback again.

This is not desired behavior, so it has been changed as follows:
- If the modern dialog fails before showing (missing library/symbol), don't call the callback and try the older dialogs in case we're on an old platform.
- If the dialog fails while or after showing, assume the error is a normal invocation error (such as an invalid path), call the callback and don't show the older dialogs to prevent showing two dialogs in succession to the user.

(cherry picked from commit a54dd7ba45)
2026-03-29 02:06:59 -04:00
Ryan C. Gordon
880739f587 stdlib: Patched SDL_rand_f to compile on pre-C99 compilers.
Visual Studio _still_ doesn't report itself as C99 compatible, afaict, but
does support the syntax as of VS2017 15.6, apparently.

This page mentions the first version of Visual Studio that handles hexidecimal
float notation:

https://stackoverflow.com/questions/18180116/vc-rejecting-hexadecimal-floating-point-constant?utm_source=chatgpt.com

If not Visual Studio, we also take the messier path for things that don't
report themselves as C99. Most things will take the cleaner path, though.

Closes #15276.

(cherry picked from commit a157d96de8)
2026-03-28 14:45:53 -04:00
Frank Praznik
5a7e2d41b8 x11: Look for text/uri-list in the list of MIME types more thoroughly
A uri-list of files is the preferred format, so don't bail if a preferred text format is encountered first.

(cherry picked from commit 1df279a04f)
2026-03-27 12:22:34 -04:00
Sam Lantinga
69cf2cf6aa Added documentation for getting the full resolution in iOS
(cherry picked from commit 995d4e10a6)
2026-03-27 08:44:07 -07:00
Strultz
b11ac0087f Fix window caption drawing on borderless windows (#15275)
(cherry picked from commit 6a9449c098)
2026-03-27 05:14:46 -07:00
c4veman
a004c1bcc4 Check Windows version before setting window attributes
(cherry picked from commit 159bba9aa1)
2026-03-26 10:44:05 -07:00
Petar Popovic
db3ff5f5c4 SDL_SetWindowShape(): Remove shape when argument is NULL
(cherry picked from commit 53c799a7a9)
2026-03-26 10:42:46 -07:00
Regan Green
764d7633ea Use DSBFREQUENCY_MAX instead of hardcoded constant for DirectSound driver max frequency.
(cherry picked from commit 1d2f9f0e0e)
2026-03-25 17:42:58 -07:00
Clownacy
fda7c0b461 Fix DirectSound buffer creation failure with >200kHz
Caps the sample rate at 200kHz so that SDL's mixer will downsample any streams which are higher than that.

My Mega Drive emulator outputs at 223721Hz (the sample rate of the PSG chip), and `SDL_OpenAudioDeviceStream` fails due to DirectSound's `CreateSoundBuffer` returning an 'invalid parameter' error code. Lowering the sample rate makes the error go away.

Reported to me by @B3HKO in this issue:
https://github.com/Clownacy/clownmdemu-frontend/issues/60

The 200kHz limit is documented here:
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee419022(v=vs.85)

DirectSound's Wikipedia article mentions that problems may occur with sample rates above 192kHz, but no source is provided, so I am unsure whether to take it seriously.

(cherry picked from commit 6efe0e19a7)
2026-03-25 13:24:03 -07:00
Anonymous Maarten
add51f85c2 ci: clang-tools-extra is no longer available for mingw32
mingw32 and mingw64 are in the process of being deprecated

(cherry picked from commit be6f1efa26)
2026-03-25 18:57:33 +01:00
c4veman
eca1479ff5 Fix endmacro syntax in macros.cmake
(cherry picked from commit 8eeef53a80)
2026-03-25 08:31:21 -07:00
nmlgc
c4af41ba27 render: Skip UV check when software-rendering untextured quads
Fixes a crash when calling SDL_RenderGeometryRaw() with both `texture`
and `uv` set to `NULL`, and with geometry that is laid out in a way
that passes the quad checks.

(cherry picked from commit 989de77f4f)
2026-03-25 07:25:23 -07:00
Green Sky
4b8fcb468b video: add more direct mjpeg to yuv conversions
(cherry picked from commit 998159fa95)
2026-03-24 09:00:43 -07:00
Sam Lantinga
99a026cfde Clarified SDL_MostSignificantBitIndex32() documentation
Fixes https://github.com/libsdl-org/SDL/issues/15247

(cherry picked from commit f22e088211)
2026-03-22 17:52:54 -07:00
Sam Lantinga
fa68d7de8b Updated documentation on customizing your Android app name
(cherry picked from commit a48dee5ac1)
2026-03-21 16:04:09 -07:00
Sam Lantinga
b7e46361f5 Fixed incorrect sampler when changing Metal draw state
(cherry picked from commit 0f9292a367)
2026-03-21 14:09:19 -07:00
sunshineinabox
c9271b2f18 egl: Handle error when binding EGL API in context creation
(cherry picked from commit 6b060435e3)
2026-03-20 12:28:14 -04:00
Konstantin Tomashevich
7b7322b222 SDL_systhread.c: Remove SIGCHLD from blocked signal mask.
When SIGCHLD is blocked, some executables (for example CMake) do not exit properly when executed using `SDL_CreateProcess` from any SDL thread (not main thread). `SDL_CreateProcessWithProperties` docs say that `SIGCHILD` should not be ignored or handled, therefore blocking it during thread creation is a likely reason for the bug. Should fix #15210.

Signed-off-by: Konstantin Tomashevich <konstantin.tomashevich@gmail.com>
(cherry picked from commit 291d1b6491)
2026-03-18 13:10:45 -07:00
Frank Praznik
a4c326a7bb x11: More XInput2 #define cleanups
Fixes building on very old XInput2 versions (pre-2012) without smooth scrolling and multitouch.

(cherry picked from commit 62af66f14a)
2026-03-18 11:26:34 -04:00
Frank Praznik
a2fb4d6d47 x11: Fix building when XInput2 is not available
(cherry picked from commit d88f76caac)
2026-03-17 15:32:26 -04:00
Frank Praznik
b560f8ab17 wayland: Scale custom cursors with the pointer scale
When emulating display modes or using display scaling, custom cursors need to be scaled, or they can appear too large or small relative to the window size.

(cherry picked from commit 3d21b3bc68)
2026-03-17 13:28:27 -04:00
Steel
0bf2065922 Add support for PXN VD6 Wheelbase
(cherry picked from commit 32cf5fe93d)
2026-03-16 10:51:30 -07:00
Cameron Gutman
5ee57a9da1 windows: Fix Print Screen key capture during keyboard grab
(cherry picked from commit 5f92aac095)
2026-03-15 15:35:00 -05:00
Sam Lantinga
86c664d695 Fixed error when SDL_LoadSurface_IO() is passed a NULL src
(cherry picked from commit 1d081314a8)
2026-03-15 13:17:22 -07:00
Sam Lantinga
8fa310e162 Add a necessary step for iOS app setup in Xcode
(cherry picked from commit 46f35e6ea2)
2026-03-15 01:55:07 -07:00
Frank Praznik
4dc440ff71 wayland: Eliminate redundant keyboard and mouse removals
The SDL keyboard and mouse will be removed when destroying the seat, so there is no need to preemptively remove them.

(cherry picked from commit 566448d95a)
2026-03-13 22:43:25 -04:00
Rachel Blackman
8ba903c859 Add second-gen Backbone One to recognized controllers.
(cherry picked from commit ba00e772a7)
2026-03-13 15:40:29 -07:00
Ryan C. Gordon
a63fd07812 io: With stdio, only forbid opening directories as files.
This allows opening Unix device nodes, etc.

Fixes #15188.

(cherry picked from commit 9f19cffc78)
2026-03-12 13:17:08 -04:00
Ryan C. Gordon
993993aaf3 io: Wrap IsRegularFileOrPipe in a more generic preprocessor test.
This way we can turn it off for various console platforms without changes
to this file.

(cherry picked from commit 4d675f2bd3)
2026-03-12 13:17:02 -04:00
Ryan C. Gordon
c189cce819 io: Remove iodata->regular_file check.
It wasn't used, and causes an extra fstat().

(cherry picked from commit 803cd7589a)
2026-03-12 13:16:58 -04:00
Sam Lantinga
6248eeec09 Disable system gesture state for all GCControllers
Technically we only want to do this for controllers that are opened, but we don't have a way to match up controllers using other APIs with individual GCControllers.

(cherry picked from commit 11adfd2008)
2026-03-12 08:43:19 -07:00
Frank Praznik
58c9c0ba7b wayland: Prevent the window from errantly growing when scale to display is used
Some compositors will send a configure event immediately after a scale event, however, this event can contain the old logical size, and should be ignored, or the window will incorrectly change size when moved between displays with differing scale factors.

Store the last requested logical size as the last configure size when resizing a floating window due to a scale change, so a configure event immediately following with the old size will be ignored.

(cherry picked from commit 18219d5b53)
2026-03-12 10:23:39 -04:00
Evan Hemsley
96c4104523 GPU: Refcount Vulkan allocations to fix transfer corruption on defrag (#15127) 2026-03-11 10:31:01 -07:00
WillyJL
e8f600bf46 Fix strpbrk() discarded const qualifier
(cherry picked from commit c45be94938)
2026-03-10 14:25:39 -07:00
Nintorch
ffd2696516 Fallback for non-gamepad controllers in GameInput
This PR makes the GameInput joystick backend ignore non-gamepad controllers if DirectInput or XInput backends are enabled. This is done to prevent possible bugs and/or regressions.

(cherry picked from commit 419dcfe747)
2026-03-10 11:06:37 -07:00
Ryan C. Gordon
c5bc4576fc video: Default SDL_GL_FRAMEBUFFER_SRGB_CAPABLE back to zero.
(This was corrected in main, but there isn't a clean cherry-pick we can do for
the release-3.4.x branch at this point, since various pieces of the sRGB work
made it in here in a different order, but this is the one crucial line that
appears to be missing.)

Reference Issue #14898.
2026-03-09 16:47:49 -04:00
Nintorch
66020c2ed7 Small GameInput joystick backend improvements
This PR includes small improvements to the GameInput joystick backend:
- Device subtypes
- Compatibility with DirectInput joystick mappings (if the controller is not a gamepad, i.e. `GAMEINPUT_InternalIsGamepad()` returns `false`)
- Fallback to DirectInput/XInput for currently unsupported devices (force feedback ones and the ones that are neither gamepads nor controllers, I'm not sure if that's possible, but maybe racing wheels and other device subtypes would count?)

(cherry picked from commit 0138843eb7)
2026-03-09 11:12:30 -07:00
Mike Egger
c2a910ab02 windows: support flag RIDEV_INPUTSINK in raw input (#15182)
(cherry picked from commit ae3ae4ba44)
2026-03-08 16:12:03 -07:00
Ozkan Sezer
1e4fd21700 stb_image: Fix -Wdouble-promotion warning
Upstream PR 1902 by Björn Wahlstrand at https://github.com/nothings/stb

(cherry picked from commit 31aa18fc1d)
2026-03-09 00:40:14 +03:00
Sanjay Govind
36ed4b75d1 support batteries on 3rd party controllers
(cherry picked from commit e610b85d1c)
2026-03-08 11:40:56 -07:00
Petar Popovic
7280152549 SDL_InternalGlobDirectory(): set string length of base directory to 1, if it's just one slash
(cherry picked from commit 67ac0e5eee)
2026-03-08 11:39:11 -07:00
Petar Popovic
a70353891e SDL_InternalGlobDirectory(): keep track of pathlen and reuse it, instead of calling SDL_strlen(path)
(cherry picked from commit 93e3e8a5fe)
2026-03-08 11:39:11 -07:00
Petar Popovic
fb312b2463 SDL_GlobDirectory(): Don't chop off first slash from path, if it's just multiple slashes
(cherry picked from commit 961a04fa26)
2026-03-08 11:39:11 -07:00
Sanjay Govind
b08f7924a4 Add support for whammy and tilt on PS4/5 guitars
PS4/5 controllers put device specific data into a specific region in the report, so we have to extract it separately.

No known guitars use the right stick on the guitar, so to keep things working similarly to PS3, i have opted to map whammy and tilt the same way as the PS3 rb guitars.

(cherry picked from commit 94f17d6c61)
2026-03-08 11:36:17 -07:00
Ethan Lee
96e05da95e gpu: Fix swapchain texture cycling.
This is actually a 1:1 copy of a patch we wrote for GPU PS5 some time ago!
2026-03-07 10:37:53 -05:00
Ethan Lee
776e87ada9 Revert "render: Added Xbox DXIL for gpu backend".
Turns out Xbox is okay with the PC DXIL, it just isn't as optimal without the root signature annotations.

This reverts commit f2c4c66429.
2026-03-04 15:52:52 -05:00
ImpDi
99a65853a6 Texture2DArray and Compute Pipeline in DirectX12 (#15161)
Apparently, because PlaneSlice wasn't initialized, we couldn't use SDL_GPU_TEXTURETYPE_2D_ARRAY and SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE together, as the error d3d12:
"ID3D12Device::CreateUnorderedAccessView occurred: The PlaneSlice -858993460 is invalid when the resource format is R8G8B8A8_UNORM and the view format is R8G8B8A8_UNORM. Only Plane Slice 0 is valid when creating a view on a non-planar format. [ STATE_CREATION ERROR #344: CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE]"

(cherry picked from commit 89cab56536)
2026-03-03 19:20:09 -08:00
Tobiasz Laskowski
4128c4e44b Fix backspace on android with api 30+
(cherry picked from commit 01bd8b3780)
2026-03-03 17:12:28 -08:00
Frank Praznik
18a0157457 Deprecate SDL_INIT_EVERYTHING from SDL2
Adds SDL_INIT_EVERYTHING to the deprecated symbol list, and renames an internal usage to avoid a warning.

(cherry picked from commit e7199cad0b)
2026-03-03 15:10:43 -05:00
Frank Praznik
b36a5ab6f4 Log failure reasons during early X11 and Wayland initialization
Log the reason for failure during initialization to the debug log to aid in troubleshooting.

(cherry picked from commit 5880b8a283)
2026-03-03 13:33:11 -05:00
Frank Praznik
aa5bcfa3d8 wayland: Don't add keys with the super/GUI modifier to the keymap
SDL normalizes the super/GUI modifier away, so adding a key with this modifier will overwrite the base, unmodified value.

(cherry picked from commit 8c8efd4ccd)
2026-03-02 18:30:40 -05:00
Qiu Qiang
ef03c66ef3 camera: Fix crash when setting frame rate and improve FPS precision
- Use exact numerator/denominator from spec for CMTime to avoid rounding errors.
- Wrap frame rate setting in @try-catch to prevent crashes on strict drivers.

(cherry picked from commit e2a2e2c31e)
2026-03-02 12:00:32 -08:00
DominusExult
6299705584 Use AV capture methods available since iOS 7
(cherry picked from commit 0270da4d1f)
2026-03-02 12:00:29 -08:00
MSRPP-dev
fcce05a19c Update SDL_render_sw.c
Fix the bug in the standard scaling path, SDL_RENDERCMD_COPY should follow the same pattern as SW_RenderCopyEx.

(cherry picked from commit 4dbf5811e9)
2026-03-02 09:49:59 -08:00
Sanjay Govind
1ee158cd31 fix off by one with tilt on ps3 guitars (#15144)
(cherry picked from commit 34378609bb)
2026-03-02 09:45:54 -08:00
Antonio Lattanzio
e4c664a75f oldnames: Add missing deprecated SDL2 symbol mappings (#15137)
(cherry picked from commit 4c52cfb495)
2026-03-02 09:44:52 -08:00
Sam Lantinga
7a1d02083d Added surface validation to SDL_DuplicateSurface()
(cherry picked from commit 73b13728de)
2026-03-02 09:42:01 -08:00
Ethan Lee
0030fafda2 render: Added Xbox DXIL for gpu backend 2026-03-01 23:27:37 -05:00
Ethan Lee
c9479f86f6 testgdk: Update icon filename for the new png image 2026-03-01 23:27:22 -05:00
Petar Popovic
8bf6e23164 Fix potential memory leak in VULKAN_AcquireCommandBuffer() on error
(cherry picked from commit 77f4a8e2b8)
2026-03-01 14:11:19 -08:00
Petar Popovic
fb9bb7426d Fix memory leak when X11 toolkit window locale SDL_strdup() fails
(cherry picked from commit fb1d1ab306)
2026-03-01 11:44:59 -08:00
Sam Lantinga
3a2a13d966 Loading PNG files are part of the core SDL library
Don't disable this functionality when defining SDL_LEAN_AND_MEAN, but if you need to, you can define SDL_DISABLE_STB if you want to compile this out.

Fixes https://github.com/libsdl-org/SDL/issues/15139

(cherry picked from commit 72d5fe213f)
2026-03-01 11:44:01 -08:00
Petar Popovic
48fb914228 Fix potential memory leak in SDL_HIDAPI_HapticOpenFromJoystick() on error
(cherry picked from commit 6cf03ca729)
2026-03-01 11:36:14 -08:00
Sam Lantinga
3e87c31a6c Added surface validation to SDL_ConvertSurfaceRect()
Fixes https://github.com/libsdl-org/SDL/issues/15141

(cherry picked from commit 2d9fca46c6)
2026-03-01 11:35:11 -08:00
Sam Lantinga
654f6f94f6 Fixed SDL_GetIOSize() return value
Fixes https://github.com/libsdl-org/SDL/issues/15129

(cherry picked from commit 0a1c7b5348)
2026-02-28 08:42:21 -08:00
SDL Wiki Bot
e7e2805475 Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit 5212b82c4f)
2026-02-26 07:55:56 +03:00
SDL Wiki Bot
df72790cfb Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit 2e18cf8d09)
2026-02-26 07:55:40 +03:00
Sam Lantinga
0f02c41ac0 Note that SDL_getenv() is case sensitive
Fixes https://github.com/libsdl-org/SDL/issues/15086

(cherry picked from commit 21e10b2e76)
2026-02-26 07:55:20 +03:00
zuiki_inn
6d93ffe923 Add ZUIKI EVOTOP controller support with gyroscope and accelerometer sensor capabilities. (#15034)
(cherry picked from commit 29ca920fdf)
2026-02-25 20:24:50 -08:00
rabbit-ecl
2fad85fa26 Use Uint64 instead for tick_numerators in USE_128BIT_MATH
(cherry picked from commit 230814e85e)
2026-02-25 20:19:30 -08:00
Sam Lantinga
36ba09b63d Fixed definition of builtin function '_m_prefetch'
Fixes https://github.com/libsdl-org/SDL/issues/15116

(cherry picked from commit 5340d6a94c)
2026-02-25 14:30:12 -08:00
Sam Lantinga
b0414440a3 Fixed timer overflow on some platforms
We have an implementation that uses 128-bit math and one that handles large values without it (thanks @jessechounard and @rabbit-ecl!)

Fixes https://github.com/libsdl-org/SDL/issues/15042

(cherry picked from commit 24404d9047)
2026-02-25 11:43:08 -08:00
SDL Wiki Bot
28014a0452 Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit 0246598d62)
2026-02-25 07:40:51 -08:00
SDL Wiki Bot
488e196415 Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit 03fcc037d9)
2026-02-25 07:40:51 -08:00
Ethan Lee
d5b90fd82f render: Reduce scope of D3D12 GDK event watcher to Xbox
(cherry picked from commit a4cd62ef93)
2026-02-25 07:40:51 -08:00
SDL Wiki Bot
c903079708 Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit bad072e693)
2026-02-25 07:40:51 -08:00
Ethan Lee
b488c2e4a0 gdk: Render/GPU can call SuspendX, document when to call SuspendComplete
(cherry picked from commit 5770e013c2)
2026-02-25 07:40:51 -08:00
Sam Lantinga
aa9de89232 Added battery status for newer FlyDigi controllers
(cherry picked from commit 49a8b4229b)
2026-02-24 20:50:11 -08:00
Sanjay Govind
645b8e7f6d Support accelerometers on 3rd party ps3 controllers (#15109)
(cherry picked from commit 0c859452ef)
2026-02-24 19:00:11 -08:00
Sanjay Govind
17532fd62e Set joystick_type for known ps3/wii instruments (#15111)
(cherry picked from commit a7ccd48957)
2026-02-24 17:30:07 -08:00
Sanjay Govind
2214522b69 deal with controllers that don't have report ids
(cherry picked from commit 1419bcb6cb)
2026-02-24 15:19:49 -08:00
Frank Praznik
c608ce5acb x11: Also send key releases when reconciling state
(cherry picked from commit 2f38b6a396)
2026-02-24 17:13:04 -05:00
Sanjay Govind
b3adee0720 Fix up controller types for various playstation and wii instruments (#15104)
(cherry picked from commit 0e4008441f)
2026-02-24 13:36:08 -08:00
Sam Lantinga
00c85a0b9e Added support for the Flydigi Vader 5 Pro in Xbox 360 mode
(cherry picked from commit 2385dc6297)
2026-02-24 10:20:29 -08:00
Brenton Bostick
77edb4d5d3 fix unknown argument nBufSize
(cherry picked from commit c259f969f2)
2026-02-24 09:50:34 -08:00
Brenton Bostick
62aea530b4 fix JNI parameter types
(cherry picked from commit 0d0db08b61)
2026-02-24 09:49:57 -08:00
Brenton Bostick
abab2f1181 make sure #endif comment matches the macro name
(cherry picked from commit a5889b0e44)
2026-02-24 09:49:08 -08:00
Void Star Caster
01d8bb5b7c Fix GetSampler() bug for INDEX8 pixel format (#15099)
(cherry picked from commit 4a4ae4a79d)
2026-02-24 08:06:44 -08:00
Vicki Pfau
27439467ce camera: Don't try to fake entire range for FRMIVAL_TYPE_CONTINUOUS
V4L2 is able to advertise that a video device is able to display any frame
interval within a continuous range. SDL does not allow advertising this and
only exposes discrete frame intervals. To work around this, SDL attempted to
generate a subset of the range with a fixed interval. Unfortunately, the way
this was accomplish is inherently broken and led to attempting to allocate a
very large number of formats per resolution and colorspace. With the Magewell
Pro Capture HDMI, which can expose FRMSIZE_TYPE_CONTINUOUS as well, this can
expose a truly astronomical number of formats, exceeding 1 PB of RAM. This will
lead to an OOM kill for any process that tries to initialize the camera
subsystem.

This patch just tests to see if some common frame rates are within the
contiuous range and expose those. SDL still does not handle
FRMSIZE_TYPE_CONTINUOUS in a graceful way so it still uses over a gigabyte of
RAM for each possible combination of sizes, but with this patch it no longer
leads to an OOM kill. The API will need amending for proper support for both
continuous frame sizes and frame intervals.

(cherry picked from commit ab6dd970ac)
2026-02-24 06:55:10 -08:00
Vicki Pfau
399b2b18ce Support SL/SR on Switch 2 controllers, but only in mini-controller mode
It doesn't really make sense to support these in combined mode since they're usually occluded.

(cherry picked from commit 8a1684fbbc)
2026-02-24 06:53:41 -08:00
Frank Praznik
cbee4abdfc x11: Don't send duplicate key down events when reconciling
Modifier keys shouldn't be repeated.

(cherry picked from commit 550394eecd)
2026-02-23 15:10:17 -05:00
Sam Lantinga
7066c6491e Fixed cursor mask padding calculation
(cherry picked from commit 2e4ac09b1f)
2026-02-23 09:53:12 -08:00
Sam Lantinga
74bfc913ac Improved support for byte array pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/15082

(cherry picked from commit 4f06087b36)
2026-02-21 12:52:12 -08:00
Ozkan Sezer
d01ec84d85 headers: selected sdl-wiki-bot-authored updates from main branch
to eliminate discrepancies between release-3.4.x and main branches.

(cherry picked from commit 165bfd3e83)
(cherry picked from commit 90aaa23977)
(cherry picked from commit 7d27ca282e)
(cherry picked from commit 6fc31b7f0b)
(cherry picked from commit c71c53c406)
(cherry picked from commit c9b7ca0c42)
(cherry picked from commit e2bc4be482)
(cherry picked from commit ae4fb50316)
(cherry picked from commit 6f45f97af0)
(cherry picked from commit d2ca570050)
(cherry picked from commit 73500019ea)
(cherry picked from commit 72ed7d0f87)
(cherry picked from commit 2aacf018f0)

[ci skip]
2026-02-21 03:03:32 +03:00
Sam Lantinga
d281a080c6 Updated to version 3.4.3 for development 2026-02-20 15:59:20 -08:00
Sam Lantinga
683181b47c Updated to version 3.4.2 for release 2026-02-20 15:12:29 -08:00
Alex Threlfo
a3bfd36665 filesystem: Fix Android asset enumeration
Passes expected relative paths to Android's AssetManager API instead of
absolute ones + fixes some indexing logic with trailing slashes.
2026-02-20 15:09:53 -08:00
Ryan C. Gordon
70e1804e9f docs: Clarify symlink info in SDL_GetPathInfo, etc.
Fixes #15078.

(cherry picked from commit 69ddf1d6c7)
2026-02-20 14:30:39 -05:00
Anonymous Maarten
eaa20b5e8a ci: add CFLAGS to pkg-config link command
(cherry picked from commit bc211aa150)
2026-02-20 11:20:57 -08:00
Ethan Lee
a056d0f39a cocoa: Don't include KHR_portability_enumeration by default.
This is only useful if the application knows to add the flag introduced by this
extension, and at that point the application can also include the extension
themselves.

Case in point: SDL_gpu_vulkan was already doing this!
2026-02-20 11:35:43 -05:00
Ethan Lee
910d31e56a vulkan: Only enable KHR_portability_enumeration when available 2026-02-20 11:35:37 -05:00
Ryan C. Gordon
77dd2685ec include: More \threadsafety documentation.
Reference Issue #7140.

(cherry picked from commit 1223767b2c)
2026-02-20 10:46:17 -05:00
Ryan C. Gordon
7cc9955ae1 emscripten: Move some EM_ASM blocks to MAIN_THREAD_EM_ASM.
These blocks reference the `navigator` global, which is not available in
background threads.

(cherry picked from commit c728e2f044)
2026-02-20 10:28:12 -05:00
Jesse Chounard
76ff74eeab Fix D3D12 DSV creation for array/cube/cube-array depth textures
DSV creation was missing a TEXTURE2DARRAY branch for array, cube, and
cube-array depth textures. It fell through to TEXTURE2D, so
FirstArraySlice was never set and all layers' DSVs targeted layer 0.
This caused incorrect rendering when using depth textures with multiple
layers, such as cubemap shadow maps.
2026-02-20 10:26:32 -05:00
Ryan C. Gordon
dc590257ba n3ds: SDL_SYS_GetPreferredLocales now handles error cases correctly.
Previously it would have reported success but not returned a valid string, and
didn't check for the (probably extremely unlikely) case of overflowing our
locale list array.

(cherry picked from commit 3aa531000a)
2026-02-20 10:14:36 -05:00
Frank Praznik
267f13446d video: Check video backend initialization when querying the grabbed window
SDL_GetGrabbedWindow() can be called when the video system is uninitialized, and, since there is no window parameter, _this must be checked for validity to avoid a segfault.

(cherry picked from commit be82f316c4)
2026-02-19 11:22:55 -05:00
Ryan C. Gordon
4cc96e3506 include: Added \threadsafety notes to about 60 more functions.
Reference Issue #7140.

(cherry picked from commit 28e4269915)
2026-02-18 19:51:25 -05:00
Ryan C. Gordon
13ff9e0818 filesystem: Fix SDL_GlobDirectory on iOS and Android.
It SDL_SYS_EnumerateDirectory was changing the path string and passing it to
the callback, causing chaos in the glob handler, which expected the original
string to pass through.

Fixes #15057.

(cherry picked from commit a3b0403412)
2026-02-18 08:21:48 -08:00
Ryan C. Gordon
42abf69434 emscripten: Fix only one mouse button being usable at a time.
Fixes #15056.

(cherry picked from commit c9591c515c)
2026-02-17 19:05:18 -05:00
Ryan C. Gordon
5d9d966d59 emscripten: Allow resize events on fullscreen windows.
Fixes browsers on phone that change screen orientation during fullscreen not
getting a resize event.

Fixes #15024.

(cherry picked from commit 0f2d415dee)
2026-02-17 18:41:38 -05:00
William Horvath
8df04368b3 gpu_vulkan: Set texture container before transitioning to default barrier state.
Avoids a null dereference of currentRegion->vulkanTexture->container in DefragmentMemory:

} else if (!currentRegion->isBuffer && !currentRegion->vulkanTexture->markedForDestroy) {
...
&currentRegion->vulkanTexture->container->header.info
... (among others)

by not "VULKAN_Submit"ting (and thus adding it to the defrag pool) before setting the container.

Although rare (defrag almost never ran), this crash happened in a real-world application.

(cherry picked from commit 06bf8d1924)
2026-02-17 14:13:03 -08:00
Sam Lantinga
3b4cf41c92 Fixed HIDAPI PS5 Bluetooth report format
(cherry picked from commit 129627068f)
2026-02-17 08:57:28 -08:00
Zack Middleton
65dfdce3df win32: Set error for SDL_GL_GetSwapInterval()
(cherry picked from commit 54de246b4b)
2026-02-17 10:27:45 -05:00
Ryan C. Gordon
3a5d0bac71 Revert "MacOS: improve scroll smoothing"
This reverts commit 5dab2c73f0.

We'll revisit this in the next SDL release.

Reference Issue #15058.

(cherry picked from commit 63c0650321)
2026-02-17 10:25:04 -05:00
Cameron Gutman
29c58245a7 android: Fix scancode for AKEYCODE_CHANNEL_DOWN
(cherry picked from commit f0bda7b655)
2026-02-17 00:27:18 -06:00
Sam Lantinga
1edb906aad Fixed detection of the "Android TV Box" as a TV
(cherry picked from commit 1dcc6e2135)
2026-02-16 12:35:34 -08:00
Sam Lantinga
1faaa128e5 Treat the D-pad center button as SDL_SCANCODE_RETURN
This fixes handling of the Android TV remote select button sent over CEC.

(cherry picked from commit 089f5e1318)
2026-02-16 12:35:34 -08:00
Sam Lantinga
99e1d9595f Moved mouse/keyboard detection to a separate thread on Windows
Getting device names can hang for a long time on certain devices, so make sure this is done on a separate thread to avoid blocking initialization and the main loop.

Fixes https://github.com/libsdl-org/SDL/issues/12913

(cherry picked from commit bc623d1af6)
2026-02-16 11:27:11 -08:00
Sam Lantinga
8389de757a Don't re-query HID device vendor and product
(cherry picked from commit a98e49409e)
2026-02-16 11:27:11 -08:00
Sam Lantinga
a82660bb76 Added temporary workaround hint "SDL_WINDOWS_DETECT_DEVICE_HOTPLUG"
Some devices with broken drivers hang when their name is queried, so added a workaround for applications that don't need input device details. The long term fix is to move the hotplug detection into a separate thread.

(cherry picked from commit a66988621a)
2026-02-16 11:27:11 -08:00
Ryan C. Gordon
3d2af85934 examples: Make source code and console tabs take 80% of browser page.
Fixes #14997.
2026-02-16 13:17:55 -05:00
Ryan C. Gordon
ea2b4f4674 hints: Rename SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE.
It's now SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER, since it does more than mess
with the srgb-capable context attribute now.

Reference Issue #14898.

(cherry picked from commit 10b524c7cc)
2026-02-16 13:09:24 -05:00
Ryan C. Gordon
febe5dd3bc render: opengl and opengles2 renderers try to disable GL_FRAMEBUFFER_SRGB.
Reference Issue #14898.

(cherry picked from commit fc570a1a1c)
2026-02-16 13:09:18 -05:00
Ryan C. Gordon
8f9dd75ead video: Only set GL_FRAMEBUFFER_SRGB state if the hint requests it.
Reference Issue #14898.

(cherry picked from commit ead67481c0)
2026-02-16 13:08:59 -05:00
Cameron Gutman
a849c4d361 win32: Fix composition UI being displayed when IME is disabled
(cherry picked from commit 8535936401)
2026-02-16 09:00:49 -08:00
NateXS
8973dfd9cc n3ds: Don't put audio thread in system core on Old 3DS systems
(cherry picked from commit 149abe8f85)
2026-02-16 08:44:52 -08:00
Sam Lantinga
2f4919c6ff Use 20 ms as the default audio buffer size on Android
It turns out that Android will not pick a low latency buffer size by default.

(cherry picked from commit c381b2bdfa)
2026-02-13 14:35:25 -08:00
DominusExult
d390a4e8f0 Fix testime to pass window coordinates to SDL_SetTextInputArea().
Also moved the area closer to the bottom so the panning of the screen can be observed on Android and iOS.

(cherry picked from commit e049fff360)
2026-02-13 08:23:03 -08:00
Sam Lantinga
9f0ebbef46 Steam Controller report 0x45 is used for BLE mode
(cherry picked from commit 0b1c592fda)
2026-02-12 15:46:19 -08:00
Sam Lantinga
6707df6d88 Updated Steam Controller packet handling
(cherry picked from commit 84c21cf970)
2026-02-12 14:34:52 -08:00
Sam Lantinga
744ea5701c Fixed initializing the PowerA OPS v1 Wireless Controller
(cherry picked from commit 4e2fd57e77)
2026-02-11 16:54:42 -08:00
Sam Lantinga
b467276f4a Fixed initializing the PowerA Fusion Pro 4 on Steam Link hardware
(cherry picked from commit 2b484a1ccb)
2026-02-11 16:54:42 -08:00
Sam Lantinga
4361920501 Fixed HIDAPI hotplug detection in applications that don't initialize video
(cherry picked from commit eaeca340f3)
2026-02-11 09:12:35 -08:00
Sam Lantinga
b5cad69b9c Fixed HIDAPI hotplug detection when initializing gamepads off the main thread
(cherry picked from commit d3f9899df5)
2026-02-11 09:03:43 -08:00
Ryan C. Gordon
723b77ede8 wasapi: Patched to compile.
(cherry picked from commit 31404a9dcb)
2026-02-10 11:35:33 -05:00
Sylvain
a7bac75470 Android: prevent SDLActivity and Main Thread to access mJoystick at the
same time. same for mHapticHandler

(cherry picked from commit a35bcad0be)
2026-02-10 07:54:19 -08:00
Ryan C. Gordon
a806a9092b wasapi: stop infinite loop in audio thread when recording device is unplugged. 2026-02-10 09:24:34 -05:00
Ryan C. Gordon
55d78567b1 video: Wrap OpenGL work in ifdefs.
Apparently the rest of SDL_GL_CreateContext compiles on platforms without
OpenGL, though!  :)

(cherry picked from commit 3dc48a4890)
2026-02-09 21:45:42 -05:00
Ryan C. Gordon
88bbc94921 video: Respect SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE with GL_FRAMEBUFFER_SRGB.
Reference Issue #14898.

(cherry picked from commit 9f5747ccd4)
2026-02-09 21:45:22 -05:00
Ryan C. Gordon
027183f89c video: Maybe fix build.
(cherry picked from commit 01689bca0e)
2026-02-09 21:45:10 -05:00
Ryan C. Gordon
0810c5ac0d video: Force GL_FRAMEBUFFER_SRGB state at OpenGL context creation time.
The default varies between OpenGL and OpenGL ES, so try to force it to what
the app actually requested with SDL_GL_FRAMEBUFFER_SRGB_CAPABLE.

Fixes #14898.

(cherry picked from commit 083c6b8872)
2026-02-09 21:45:00 -05:00
Ryan C. Gordon
9f45801fa7 render: OpenGL and GLES2 should explicitly request a not-sRGB-capable context.
Reference Issue #14898.

(cherry picked from commit 60690ff829)
2026-02-09 21:44:47 -05:00
Ryan C. Gordon
ae3bb879c7 emscripten: drag-and-drop fixes.
FS.mkdir() will throw a javascript exception if the scratch directory already
exists, so catch/ignore that.

Wrap the rest of the scratch i/o in a try/catch block; the event will only
send if everything works out.

Wrap some calls from Javascript to the C runtime's free() in an
EMSCRIPTEN_KEEPALIVE function, so that the compiler doesn't optimize the
function out and crash at runtime.

Fixes #14999.

(cherry picked from commit 267e681a0b)
2026-02-09 21:43:12 -05:00
Sam Lantinga
17eb20505c Fix the 8BitDo Ultimate 2D Wireless Controller showing up multiple times
This controller has 3 interfaces, one for the Xbox gamepad protocol, and two HID interfaces. We should only handle the Xbox interface in the Xbox driver.

(cherry picked from commit 9f8c70713a)
2026-02-09 13:29:47 -08:00
Sam Lantinga
badd9e5a15 You can't combine SDL_STRINGIFY_ARG() and SDL_FUNCTION
Removed obsolete documentation that shows this usage and macros that attempt it.

Also allow SDL_FUNCTION to be redefined by the application.

Fixes https://github.com/libsdl-org/SDL/issues/15004

(cherry picked from commit 6feb0e1333)
2026-02-08 11:56:12 -08:00
Max Seidenstücker
576c2d2f2c Merge all occurances of __func__ and __FUNCTION__ to SDL_FUNCTION
(cherry picked from commit 8f8880a8eb)
2026-02-08 11:56:12 -08:00
Cameron Gutman
48e5fc7b69 cocoa: Fix 1px border in fullscreen on Tahoe
(cherry picked from commit 1d83a35e48)
2026-02-08 11:01:44 -08:00
Sam Lantinga
12e9ff33c3 Fixed checking against cached shader params (thanks @ccawley2011!)
(cherry picked from commit 4de62c35c0)
2026-02-08 11:00:24 -08:00
William Horvath
054bea938a dummyaudio: Remove bitrotted support for __EMSCRIPTEN_PTHREADS__ code path.
In SDL_audio.c:OpenPhysicalAudioDevice, an attempt is made to SDL_CreateThread
if ProvidesOwnCallbackThread is false, but SDL_CreateThreadWithPropertiesRuntime
is not implemented for Emscripten, so this always fails. I'm not sure if/when
this ever worked, but it simply cannot work in its current state.

(cherry picked from commit 8ee7dc2f9f)
2026-02-08 09:32:18 -08:00
RaceTheMaSe
b9107ec196 dialog_utils: fix NameTransform() function pointer type (#15002)
(cherry picked from commit c15ca27740)
2026-02-08 09:32:18 -08:00
Frank Praznik
5728f9d703 wayland: Check the mod state when sending repeated key text
The control and alt modifiers should suppress text events when repeating to match standard press behavior.

(cherry picked from commit f07ba5b954)
2026-02-07 14:32:12 -05:00
ROllerozxa
e61a874c66 Fix SDL_TriggerBreakpoint being undefined on slimcc
(cherry picked from commit 3919cc902e)
2026-02-07 10:14:28 -08:00
Vicki Pfau
2b72332b81 Fix Switch and Switch 2 player LED patterns
The patterns we were using don't match the official patterns, which fill up as
many lights as players instead of just using the nth player LED. Above 4,
there are some special patterns, as documented on Nintendo's Singaporean site:
https://www.nintendo.com/sg/support/qa/detail/33822

(cherry picked from commit 017d950b6b)
2026-02-07 07:37:51 -08:00
Sam Lantinga
9ee86e7e79 Fixed building with -DSDL_HIDAPI=OFF
Fixes https://github.com/libsdl-org/SDL/issues/14975

(cherry picked from commit 56b77177a9)
2026-02-06 10:00:17 -08:00
Jari Vetoniemi
6168085e45 cocoawindow: fix wrong content scale with ANGLE EGL context
ANGLE expects that the surface layer content scale is updated
accordingly.

<b406401e42/src/libANGLE/renderer/metal/SurfaceMtl.mm (L597-L636)>

(cherry picked from commit ef41e0a0f0)
2026-02-06 09:17:17 -08:00
Wohlstand
000d56702e SDL_render_psp.c: Also apply the similar fix to PSP
Since this problem is the same here

(cherry picked from commit a36ef1f187)
2026-02-06 09:08:58 -08:00
Wohlstand
c12d90108f SDL_render_vita_gxm.c: Fixed the black screen due to zero cliprect
(cherry picked from commit 87a81bd09d)
2026-02-06 09:08:57 -08:00
Wohlstand
44c0feed99 Revert "Reverted Vita cliprect changes"
This reverts commit aeb4b3d2fc.

(cherry picked from commit 75d1d64c75)
2026-02-06 09:08:57 -08:00
Ryan C. Gordon
fc5862b0dd opengl: added SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE.
Reference Issue #14898.

(cherry picked from commit 632c83b722)
2026-02-05 18:45:06 -05:00
Ryan C. Gordon
7f3d51b690 cocoa: Fix SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES=0.
This hint is documented to not just turn off fullscreen windows going into a
new Fullscreen Space, but also to make the green button on a resizeable
window's title bar do a maximize/zoom instead of make the window fullscreen.

Previously, this only did the former and not the latter (or perhaps it worked
and the defaults changed in a newer macOS, we aren't sure).

Fixes #7470.

(cherry picked from commit 50f3adec77)
2026-02-05 18:43:39 -05:00
Vicki Pfau
45086459d2 Add and use libusb_set_auto_detach_kernel_driver for the Switch 2 driver
(cherry picked from commit e1b8ad0380)
2026-02-05 14:59:10 -08:00
Sam Lantinga
5964104910 Guarantee that pens are in proximity before motion and button events
This also delays pen proximity out events to make sure that the pen is really gone before delivering them. On Android, you get a HOVER_EXIT event when the pen contacts the surface, which we don't want to treat as the pen leaving proximity.

(cherry picked from commit bddf6d3e2a)
2026-02-05 14:09:07 -08:00
Sam Lantinga
9194d199e7 Added support for the third stylus button on Android
(cherry picked from commit cd7fc90c87)
2026-02-05 14:09:07 -08:00
Ryan C. Gordon
81d9f30db4 pen: Fixed incorrect comment.
(cherry picked from commit dd18d7ff52)
2026-02-05 14:09:07 -08:00
Sam Lantinga
38b9c9117d Fixed warning: no previous prototype for function 'SDL_PrivateIsGamepadPlatformMatch'
(cherry picked from commit cd14bf3d00)
2026-02-04 14:41:27 -08:00
Frank Praznik
2887de55d6 wayland: Only use owned surface data when processing touches
Otherwise, user data set externally may be treated as SDL window data.

(cherry picked from commit bd472b43f5)
2026-02-04 14:29:08 -05:00
Anonymous Maarten
8107d5b042 cmake: cannot detect deprecated apple-clang link options (they are not fatal)
So skip these

(cherry picked from commit 5f151f4532)
2026-02-03 20:57:32 +01:00
Nintorch
94f6f8d3c3 Add share button mapping to Xbox Series X controller on Android
(cherry picked from commit 997a168e00)
2026-02-03 11:33:44 -08:00
Sam Lantinga
5935fe73d3 Fixed detecting Nintendo Switch Pro 2 controller on Steam Link hardware
In this case, it's available via both libusb and hidraw, but the hidraw device isn't usable. If a device needs to be opened via libusb, don't expose it via hidraw enumeration.

(cherry picked from commit f60231759d)
2026-02-03 10:44:31 -08:00
Anonymous Maarten
775eac98ee surface: verify surface palette in SDL_Save(BMP|PNG) before hitting the FS
(cherry picked from commit 28ea4a8e31)
2026-02-03 09:32:37 -08:00
Ryan C. Gordon
d9bc9dda7a emscripten: Cleanup some wasm32/wasm64 ifdefs.
Fixes #14066.

(cherry picked from commit bb6ced6fc0)
2026-02-02 19:23:33 -05:00
Ryan C. Gordon
f9bb023eeb emscripten: Unify creation of Module['SDL3'] in at SDL_Init time.
(cherry picked from commit 7d093940a7)
2026-02-02 19:23:28 -05:00
Sam Lantinga
9bf533d1c4 Reverted unintended testsprite changes
(cherry picked from commit de605a3b7e)
2026-02-02 16:01:02 -08:00
Sam Lantinga
a2653b857c Fixed the GameCube Controller Adapter showing up twice on macOS
(cherry picked from commit b5206909a7)
2026-02-02 15:56:06 -08:00
Sam Lantinga
00fc74e6af Fixed handling GameCube adapters in PC mode on Linux and macOS
On Windows there is a separate HIDAPI device for each slot. On Linux and macOS, there is a single HIDAPI device and the slot is included in the report.

(cherry picked from commit cdffbdfeaf)
2026-02-02 15:56:05 -08:00
SDL Wiki Bot
28470f9231 Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit eb181c8d1a)
2026-02-02 11:40:08 -08:00
Evan Hemsley
171874ae5c GPU: Allow D3D12 backend to load vendored D3D12Core.dll (#14946)
---------

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
(cherry picked from commit e25e0f3c5b)
2026-02-02 11:40:08 -08:00
Anonymous Maarten
6dc3211d56 cmake: dfix disabling dlopen notes when configuring with -DSDL_DLOPEN_NOTES=OFF
(cherry picked from commit b0a9f40e28)
2026-02-01 19:24:19 +01:00
Cameron Gutman
6c38358984 Fix invalidation of bound textures/shaders across a renderer flush on D3D9
(cherry picked from commit 4743f97c39)
2026-01-31 17:17:44 -08:00
Ryan C. Gordon
c3e92cf1c4 asyncio: don't report failures on closing read-only files with Windows IoRing.
We still need the task to go through the IoRing, even though the flush
operation we use to get it there will always fail on a read-only file. So
check for this specific case and don't report failure.

Fixes #14878.

(cherry picked from commit 4df13e8806)
2026-01-31 16:06:54 -08:00
Caleb Cornett
de5e0f1784 GPU: Query UnrestrictedBufferTextureCopyPitchSupported to avoid D3D12 realignment copies
(cherry picked from commit 742a6fd092)
2026-01-31 16:04:03 -08:00
Lucas Murray
1a278bb511 GPU: Fix memory leak when creating D3D12 compute pipelines 2026-01-31 16:24:06 -05:00
Ethan Lee
e803cbb34a gpu: Rank dzn above lavapipe, for WSL Vulkan support 2026-01-31 08:35:04 -05:00
Sam Lantinga
997808a945 Updated SDL_PollEvent() documentation
Fixes https://github.com/libsdl-org/sdlwiki/issues/911

(cherry picked from commit 63a95a4a4d)
2026-01-30 16:24:10 -08:00
Cameron Gutman
3cf15dc222 gamepad: Accept older 'Mac OS X' mappings on macOS
(cherry picked from commit e3c9ec7b67)
2026-01-30 18:12:54 -06:00
Henrique Jorge Barateli
38b5ad824d Fixed PS2 joystick analog sticks not enabled
(cherry picked from commit 8fa8c331a5)
2026-01-30 12:17:39 -08:00
Anonymous Maarten
d90c07a88f cmake: force disable SDL_HIDAPI_LIBUSB when SDL_HIDAPI is disabled
(cherry picked from commit 821ab81a62)
2026-01-30 07:32:38 -08:00
Eddy Jansson
ff2a43bfbf Fix typos in comments.
(cherry picked from commit 23fec649c2)
2026-01-30 07:25:35 -08:00
Ethan Lee
5a4f1cbceb gpu: MSVC buildfix for Vulkan device property struct initialization 2026-01-30 09:41:05 -05:00
Ethan Lee
c4074bc9c9 gpu: Check for Vulkan conformance while checking the device rank.
This should behave largely the same, except now Dozen is given a pass for WSL.

This is a better fix for #14915.
2026-01-30 09:22:13 -05:00
Sam Lantinga
6b6fe286fb Fixed macOS build when video is disabled
Fixes https://github.com/libsdl-org/SDL/issues/14912

(cherry picked from commit 5f0c889082)
2026-01-29 14:30:51 -08:00
Sam Lantinga
e612c58518 Reference count window claim calls for a given GPU device
Fixes https://github.com/libsdl-org/SDL/issues/14918

(cherry picked from commit 696c12826f)
2026-01-29 14:05:13 -08:00
Ethan Lee
dfb270f87c gpu: Vulkan should fail if the best device is non-conformant 2026-01-29 14:42:17 -05:00
Sam Lantinga
1ec73bac92 Fixed typo
(cherry picked from commit 58c30a4451)
2026-01-28 13:43:40 -08:00
Sam Lantinga
e1294f3b48 Fixed the 8BitDo Ultimate 2 Wireless for PC controller showing up twice on macOS
(cherry picked from commit 0f10f81b3b)
2026-01-28 13:39:37 -08:00
Sam Lantinga
9c0b773f09 Fixed memory leak in testffmpeg EGL codepath
Fixes https://github.com/libsdl-org/SDL/issues/14908

(cherry picked from commit ee38b7c3df)
2026-01-28 08:21:11 -08:00
Wouter Wijsman
6cd9374929 Fix PSP_QueueGeometry funcion rendering some textures too small
(cherry picked from commit c1e715439a)
2026-01-28 07:39:43 -08:00
Sam Lantinga
3bde3e2406 Fixed the 8BitDo Ultimate 2 Wireless controller showing up twice on macOS
Fixes https://github.com/libsdl-org/SDL/issues/14902

(cherry picked from commit 3aa3a357fc)
2026-01-27 14:41:36 -08:00
Sam Lantinga
5c002ba0b9 Fixed the NVIDIA SHIELD Controller showing up twice on macOS
Fixes https://github.com/libsdl-org/SDL/issues/14911

(cherry picked from commit 1fe6bf4982)
2026-01-27 13:53:06 -08:00
Sam Lantinga
05fdfa1572 Fixed hang sending output reports to the NVIDIA SHIELD Controller on macOS
(cherry picked from commit 72343b9ee2)
2026-01-27 13:53:06 -08:00
Sam Lantinga
d4da5df088 Fixed unaligned access in NVIDIA SHIELD Controller driver
Also refactored the LOAD16() and LOAD32() macros into SDL_hidapijoystick_c.h

(cherry picked from commit cae2a28f5b)
2026-01-27 13:53:06 -08:00
Sam Lantinga
6fef8fd0dc Fixed Steam Controller battery state
(cherry picked from commit dd53ecbce8)
2026-01-27 09:53:17 -08:00
Nintorch
13f8201dbe Add support for joystick LED for Switch controllers
Co-Authored-By: Thiago Lelles Fernandes <125714191+thilelito@users.noreply.github.com>
(cherry picked from commit 90dabda3b4)
2026-01-27 09:46:00 -08:00
Anonymous Maarten
4431c5f8ba stb_image: use SDL_TARGETING("sse2") macro for supporting intrinsics on 386
(cherry picked from commit ac4f852a6a)
2026-01-25 18:34:33 +01:00
Sam Lantinga
a3232fe84e Set SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN for the GPU renderer
(cherry picked from commit a929eb71b3)
2026-01-25 09:16:01 -08:00
SDL Wiki Bot
2ea3ac2914 Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit 5642fc963e)
2026-01-25 09:16:01 -08:00
Sam Lantinga
34c687a59b Add the type to SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1
(cherry picked from commit 17c375738f)
2026-01-25 09:16:00 -08:00
SDL Wiki Bot
388546be2e Sync SDL3 wiki -> header
[ci skip]

(cherry picked from commit d311b5c779)
2026-01-25 09:16:00 -08:00
Ethan Lee
78b16b3cb8 gpu: Add SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1 property
(cherry picked from commit 16f2037efd)
2026-01-25 09:09:28 -08:00
Madeline Whitmore
e48e8a48ad SDL GPU: Fix features not being enabled with Vulkan 1.1 (#14885)
Use pre-Vulkan 1.2 structs to request features from a Vulkan 1.1 instance.

(cherry picked from commit 97b177c92f)
2026-01-25 08:19:42 -08:00
Eddy Jansson
26352be1e5 More prefer SDL_zero*()
Transform clearing of arrays into SDL_zeroa(), and
clearing through a T* with size(T) into SDL_zerop().

Extends commit 83fb7b6636.

(cherry picked from commit 248223592a)
2026-01-23 16:02:27 -08:00
Eddy Jansson
1d6d424775 Prefer SDL_zero()/SDL_zerop()
Replace uses of 'SDL_memset(E, 0, sizeof(E))' and similar
with the SDL_zero()/SDL_zerop() macros.

(cherry picked from commit 83fb7b6636)
2026-01-23 11:23:55 -08:00
Sam Lantinga
c8fa870b36 Don't load libdecor if SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR is false
Fixes https://github.com/libsdl-org/SDL/issues/14887

(cherry picked from commit fe403220f0)
2026-01-23 11:21:32 -08:00
Frank Praznik
b7df720371 wayland: Don't try to set the seat cursor when no pointer object exists
(cherry picked from commit 79b40ad397)
2026-01-23 09:05:20 -05:00
Sam Lantinga
b73ab6cc82 Revert "cmake: rpi videocore needs brcmegl as well"
This reverts commit cd31381185.

Linking libbrcmEGL.so explicitly breaks (causes segmentation faults) in other code that links and runs the X11 EGL.

Reopens https://github.com/libsdl-org/SDL/issues/14749

At least in my Raspbian Stretch build environment, the vc_dispmanx symbols that were missing are found in libbcm_host.so, which is linked by default.

(cherry picked from commit 7fe30b04bf)
2026-01-22 17:56:35 -08:00
Sam Lantinga
fffa14eb1a Call dbus_message_set_no_reply() when not expecting a reply 2026-01-22 09:42:15 -08:00
Sam Lantinga
5454573e2d Retain the dbus reply when getting string results
The string result points at memory in the reply, so we can't unref that until the string is no longer needed.

Fixes https://github.com/libsdl-org/SDL/issues/14839
2026-01-22 09:42:15 -08:00
Anonymous Maarten
c6489b731e release: synchronize build-scripts/build-release.py
(cherry picked from commit 0f89d64623)
2026-01-21 21:52:07 +01:00
Simon McVittie
b451b27427 dummy: Only initialize evdev input devices in the evdev driver
This avoids some misleading error messages when running unit tests with
the dummy driver: on a typical desktop Linux system, it's normal for
opening keyboards and mouse in `/dev/input/*` to fail with `EACCES`,
and in container technologies that share `/sys` but not `/dev` with the
container, we can find that we fail to open them with `ENOENT`.

Resolves: https://github.com/libsdl-org/SDL/issues/14872
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 9ceb982a63)
2026-01-20 14:17:37 -08:00
Sam Lantinga
895bdc4f21 Fixed divide by zero handling Nintendo Switch 2 controller
(cherry picked from commit b1362f8a42)
2026-01-20 11:04:44 -08:00
Aubrey Hesselgren
9e5975f332 Fix Horipad bluetooth gyro stutter issues using simulated sensor timing approach (based on packet rate observation)
By observation: wired is 250hz/4000ms, and bluetooth is 120hz/8333ms for IMU sensor.

(cherry picked from commit 5c15d74394)
2026-01-19 15:26:03 -08:00
Thour
a84cde99b7 Fix incorrect type in SDL_GetMice() and SDL_GetKeyboards() allocation (#14870)
(cherry picked from commit 124c5922aa)
2026-01-19 15:24:37 -08:00
Wolf3s
aae4cb8d15 Fix the video size matching the renderer.
(cherry picked from commit 0d845e8689)
2026-01-19 10:12:48 -08:00
Brad Smith
8ed4f46db0 cmake: Replace sys/types.h usage with stdint.h with CheckUSBHID
(cherry picked from commit d4d66e77cc)
2026-01-18 16:18:38 -08:00
Brad Smith
3a54ca75cf cmake: Fix header detection with CheckUSBHID
Make use of check_include_files to be able to also include
stdint.h when checking for the headers. Fixes detection of
usbhid.h on OpenBSD.

/usr/include/usbhid.h:40:2: error: unknown type name 'uint32_t'
   40 |         uint32_t _usage_page;
      |         ^

(cherry picked from commit 410a35fbee)
2026-01-18 10:30:09 -08:00
Sam Lantinga
3ec7fc8f59 SDL_CreateGPURenderState() doesn't modify the createinfo parameter
(cherry picked from commit 3f0e0975d8)
2026-01-17 20:49:04 -08:00
ROllerozxa
4214001b97 Fix SDL_SetWindowIcon on singlethreaded Emscripten builds (#14850)
(cherry picked from commit 064096bf61)
2026-01-17 20:39:15 -08:00
Frank Praznik
44b59db1d5 event: Only consider topmost windows when generating SDL_QUIT
Otherwise, the quit event can be sent prematurely. The topmost status must be queried and cached before sending the close request event, as the window may be destroyed in an event handler.

(cherry picked from commit 34b620c3f8)
2026-01-17 15:52:35 -05:00
Frank Praznik
7627f5d838 wayland: Only destroy tool frame callbacks if the cursor is the one being destroyed
(cherry picked from commit 202fdb2795)
2026-01-16 12:31:30 -05:00
ocelote_ml
9c69084ed3 updated png texture example
the example was updated to use png's but they didn't update the error message nor the comments

(cherry picked from commit 008aa18810)
2026-01-16 12:24:30 -05:00
Frank Praznik
3b4ea10ebc wayland: Also check tools for cursor usage during cursor destruction
(cherry picked from commit 35a80bdf1f)
2026-01-16 11:40:08 -05:00
Frank Praznik
799d2ca80b wayland: Don't clear the cursor on leave events
Stop the frame callback and flag the cursor for a refresh when the pointer re-enters the surface, but don't set a null cursor, as it may have already been set after entering a surface that is part of the window decorations, resulting in an unwanted invisible cursor.

(cherry picked from commit 5e2977709b)
2026-01-16 11:40:08 -05:00
William Horvath
66a8454f2d thread: Use a flexible array member for "array" in SDL_TLSData.
Avoids UBSan warning (among other similar ones in SDL_thread.c):
src/thread/SDL_thread.c:109:13: runtime error: index 1 out of bounds for type 'struct (unnamed struct at src/thread/SDL_thread_c.h:70:5)[1]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/thread/SDL_thread.c:109:13

(cherry picked from commit f9395a766f)
2026-01-16 08:32:27 -08:00
Frank Praznik
012443729d events: Raise keyboard keys before sending the focus lost message
Otherwise, the key raises may end up being ignored.

(cherry picked from commit e62d6a95b9)
2026-01-15 15:03:10 -05:00
Cameron Cawley
26d20d5e22 Fix touch screen display IDs on the 3DS
(cherry picked from commit 02c9f2045b)
2026-01-14 15:07:10 -08:00
Sam Lantinga
45ab4a16a2 You can't change the size of a window while in macOS fullscreen space
(cherry picked from commit 77290f9788)
2026-01-14 15:06:45 -08:00
Frank Praznik
2a6187aa6b tests: Don't try to load unsupported image types in testclipboard
Requesting certain MIME types (e.g. EPS formats offered by KDE) can be *very* slow, on the order of multiple seconds, due to requiring significant processing. Only try to load image MIME types that SDL is known to support (BMP and PNG).

(cherry picked from commit 32747ceb84)
2026-01-14 11:01:31 -05:00
Frank Praznik
b7a241973a wayland: Increase the read timeout when reading from SDL_GetClipboardData()
The default timeout value of 14ms is ideal when querying clipboard data while polling events, to prevent excessive lag if the source takes a long time to respond, however, when reading from SDL_GetClipboardData(), the timeout can be too short if a large amount of data must be processed or transferred. SDL_GetClipboardData() is not called while polling events, so using a longer read timeout to greatly increase the chance of success is acceptable.

Use a 5 second timeout when reading from SDL_GetClipboardData() and GetPrimarySelectionText() to greatly increase the chances of a successful read, even if the requested format requires heavy processing.

(cherry picked from commit 2a0d04613c)
2026-01-14 11:01:30 -05:00
Sam Lantinga
b8aff4a3ed Revert "Fix duplicate event dispatch in Cocoa event pump"
This reverts commit dd52dd8995.

After that commit mouse input is not received and the window cannot be closed or resized.

Fixes https://github.com/libsdl-org/SDL/issues/14818

(cherry picked from commit 206989a22d)
2026-01-13 16:24:59 -08:00
Sam Lantinga
d264c27468 Added support for the Razer Raiju V5 Pro in wireless mode
(cherry picked from commit 54fdeb9e79)
2026-01-13 16:24:56 -08:00
Sam Lantinga
92d6308aac Added support for the Razer Raiju V5 Pro
(cherry picked from commit 015d0fc2e4)
2026-01-13 15:48:35 -08:00
Anonymous Maarten
a2f3e2ac23 cmake: compile SDL_uclibc separately for shared and static SDL3, ensuring fPIC for shared SDL3
(cherry picked from commit 6f19fecba3)
2026-01-13 23:28:25 +01:00
Sergei Petunin
e1b020f340 Fix MAC_PRESS_AND_HOLD hint documentation
(cherry picked from commit 460b8a0db1)
2026-01-13 09:01:42 -08:00
Frank Praznik
c88049d27f wayland: Send exposure events when deferring resize events
Clients that defer repainting may hang in SDL_WaitEvent() while interactively resizing if they only redraw when an appropriate event is received, as resizing defers the new state until a frame callback is received, and if too much time elapsed since the last redraw, the last frame callback may have already occurred. Send an exposure event when deferring resizes so the client will make forward progress and trigger a frame callback to ack the pending configure state.

(cherry picked from commit 2212c4f085)
2026-01-12 20:05:24 -05:00
Qiu Qiang
3cd5a407b8 Fix duplicate event dispatch in Cocoa event pump
Prevent mouse and keyboard events from being processed twice by
skipping [super sendEvent:] for events SDL has already handled via
Cocoa_DispatchEvent. Other event types still go through AppKit's
normal handling.

(cherry picked from commit dd52dd8995)
2026-01-12 11:30:02 -08:00
Frank Praznik
75ff70b489 joystick/win32: Fix function return type mismatch
Fixes #14804

(cherry picked from commit 55acc0b829)
2026-01-11 10:57:24 -05:00
Ethan Lee
f6a979d7e8 events: Buildfix for targets with C++ build units 2026-01-09 14:51:23 -05:00
Katharine Chui
f4b937adf8 haptic hidapi: maintain effects array for external checking
(cherry picked from commit 2bb463921f)
2026-01-08 14:05:26 -08:00
Ozkan Sezer
6aa227a428 stb_image.h (stbi__start_mem): initialize io.skip and io.eof to NULL
Patch authored by @NBickford-NV: https://github.com/miniupnp/stb/pull/1
c.f.: https://github.com/nothings/stb/pull/1751

(cherry picked from commit ab900a389f)
2026-01-08 23:23:02 +03:00
Sam Lantinga
cc0755881c Fixed crash when the broken EZFRD64.DLL is present
Fixes https://github.com/ppy/osu/issues/13634

(cherry picked from commit f369e804e2)
2026-01-07 20:32:07 -08:00
limb-soup
f1b2fa5b9b pthread: add call to pthread_mutexattr_destroy (#14786)
(cherry picked from commit f805bb53cf)
2026-01-07 10:56:25 -08:00
DarkContact
a4b7a77d70 Add support for GPU ARGB1555 (B5G5R5A1_UNORM) textures with DX11
(cherry picked from commit 044aed1f27)
2026-01-07 10:12:46 -08:00
bubbleguuum
06a6adf2b0 x11: fix compilation failure on older XInput2
Older versions of XInput2 do not declare struct XIGesturePinchEvent
in XInput2.h, causing compilation failure in SDL_x11xinput2.c

Check for XIGesturePinchEvent in the test for enabling
SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE

(cherry picked from commit 7690e00f42)
2026-01-06 06:49:53 -08:00
Sam Lantinga
08b2176a80 Fixed conflict when linking both SDL and hidapi statically
Closes https://github.com/libsdl-org/SDL/pull/14772

(cherry picked from commit bc68c1c920)
2026-01-06 06:10:51 -08:00
Anonymous Maarten
99b2344253 cmake: add SDL_FULL_VERSION target property containing full SDL version
(cherry picked from commit d73e74f9bf)
2026-01-06 04:05:04 +01:00
Anonymous Maarten
35a891d0e9 cmake: rpi videocore needs brcmegl as well
(cherry picked from commit cd31381185)
2026-01-05 23:45:59 +01:00
Mathieu Eyraud
0394e2e583 Fix Mouse button index
(cherry picked from commit c9baf208bd)
2026-01-05 16:08:38 -05:00
Frank Praznik
8a418521e1 wayland: Check focus when dispatching relative motion
In rare cases, a leave event can be grouped with relative motion in a frame. Ensure a valid focus window when dispatching relative motion.

(cherry picked from commit fab42a1432)
2026-01-05 13:44:09 -05:00
Katharine Chui
fa894b07be hidapi: Disable hidapi LG4FF on windows (#14762)
hid.dll simply cannot send 7 bytes reports unlike other platforms

It enforces full length repots of 17 from the device's descriptor,
which does not work on the device.

This breaks ffb and led control, so we disable this by default on
windows.

(cherry picked from commit 6c2f9bc41e)
2026-01-05 08:14:45 -08:00
Sam Lantinga
832b2aaf39 Don't call SDL_Gtk_Quit() on private platforms
(cherry picked from commit c742038aa9)
2026-01-05 08:08:51 -08:00
Sam Lantinga
3f58b99b53 Fixed handling status changes in the FlyDigi controller driver
(cherry picked from commit ce6a6d1b39)
2026-01-05 08:00:13 -08:00
Ethan Lee
406cd277d2 render: Add support for private-platform shaders in GPU backend 2026-01-05 09:49:15 -05:00
Lucas Murray
9a5700e9a3 GPU: Add error message to Vulkan buffer creation error path
(cherry picked from commit cced3ce8b9)
2026-01-04 15:18:11 -08:00
Sam Lantinga
2237a8eba2 Fixed building with Xcode 15.4
Fixes https://github.com/libsdl-org/SDL/issues/14740

(cherry picked from commit 504041a1ba)
2026-01-03 08:04:59 -08:00
Qiu Qiang
0bc2296756 Cache CGDisplayPixelsHigh result on macOS to reduce IPC overhead
CGDisplayPixelsHigh(kCGDirectMainDisplay) involves an IPC call to the
Window Server on each invocation. Cache the main display height in
SDL_CocoaVideoData and update it only when display configuration changes,
reducing overhead during high-frequency mouse event processing.

(cherry picked from commit 3ee8d1406c)
2026-01-02 12:29:36 -08:00
Ethan Lee
a85a6364d8 ci: Add steamrt4 workflows 2026-01-02 12:19:08 -05:00
Sam Lantinga
9fbba079b9 Update the iOS Xcode build requirements
(cherry picked from commit 7edcc413e8)
2026-01-02 08:53:40 -08:00
Sam Lantinga
3d651ee403 iOS: if the file doesn't exist in the pref path, use the current directory
Fixes https://github.com/libsdl-org/SDL/issues/14743

(cherry picked from commit a0307589bd)
2026-01-02 08:19:45 -08:00
Joshua Vandaële
8de01986b1 Fix dynamic library handling for LibUSB
`target_get_dynamic_library` should not be called if `SDL_HIDAPI_LIBUSB_SHARED` is set to OFF, it otherwise causes a warning at best, or a build failure if libusb is provided by a parent project and not installed on the system

(cherry picked from commit 4a29b6a651)
2026-01-02 07:39:42 -08:00
Ethan Lee
cbed9bd54d gpu: D3D12 uploads should also factor in block size for height, not just width.
It turns out the reason this function was having so many overread issues was because our row copies were wrong - for compressed images we also need to reduce the row count based on the block size, similar to what we already do for pitch calculation - these copies are byte copies, not pixel copies!

(cherry picked from commit f472f93db8)
2026-01-02 07:37:56 -08:00
Zack Middleton
fd345ae2f9 Improve hint documentation
(cherry picked from commit 6247568a1b)
2026-01-02 07:33:17 -08:00
Kadir
c5dee0feb5 Add ProGuard rule for joystickSetLED method in SDLControllerManager
(cherry picked from commit cbcc565ca9)
2026-01-02 07:31:37 -08:00
Brad Smith
a6ff5646f4 cmake: Enable Vulkan support on OpenBSD
(cherry picked from commit 1d51671cbe)
2026-01-02 00:18:38 +01:00
Sam Lantinga
80c6a5f8d9 Updated copyright for 2026 2026-01-01 09:48:19 -08:00
Sam Lantinga
d15ecb21be Updated to version 3.4.1 for development 2025-12-31 18:18:45 -08:00
1206 changed files with 7618 additions and 3608 deletions

View File

@@ -1,3 +1,5 @@
- [ ] I confirm that I am the author of this code and release it to the SDL project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").
<!--- Provide a general summary of your changes in the Title above --> <!--- Provide a general summary of your changes in the Title above -->
## Description ## Description

View File

@@ -30,7 +30,7 @@ runs:
echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
- name: 'Restore cached GDK' - name: 'Restore cached GDK'
id: cache-restore id: cache-restore
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
with: with:
path: '${{ steps.calc.outputs.gdk-path }}' path: '${{ steps.calc.outputs.gdk-path }}'
key: ${{ steps.calc.outputs.cache-key }} key: ${{ steps.calc.outputs.cache-key }}
@@ -58,7 +58,7 @@ runs:
--no-user-props --no-user-props
- name: 'Cache GDK' - name: 'Cache GDK'
if: ${{ !steps.cache-restore.outputs.cache-hit }} if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@v4 uses: actions/cache/save@v5
with: with:
path: '${{ steps.calc.outputs.gdk-path }}' path: '${{ steps.calc.outputs.gdk-path }}'
key: ${{ steps.calc.outputs.cache-key }} key: ${{ steps.calc.outputs.cache-key }}

View File

@@ -17,7 +17,7 @@ outputs:
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- uses: actions/cache/restore@v4 - uses: actions/cache/restore@v5
id: restore-cache id: restore-cache
with: with:
path: /opt/cross-tools path: /opt/cross-tools
@@ -34,7 +34,7 @@ runs:
mkdir -p /opt mkdir -p /opt
tar -C /opt -x -f /tmp/toolchain.tar.xz tar -C /opt -x -f /tmp/toolchain.tar.xz
- uses: actions/cache/save@v4 - uses: actions/cache/save@v5
if: ${{ !steps.restore-cache.outputs.cache-hit }} if: ${{ !steps.restore-cache.outputs.cache-hit }}
with: with:
path: /opt/cross-tools path: /opt/cross-tools

View File

@@ -17,7 +17,7 @@ runs:
steps: steps:
- name: 'Restore cached libusb-${{ inputs.version }}.7z' - name: 'Restore cached libusb-${{ inputs.version }}.7z'
id: cache-restore id: cache-restore
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
with: with:
path: 'C:\temp\libusb-${{ inputs.version }}.7z' path: 'C:\temp\libusb-${{ inputs.version }}.7z'
key: libusb-msvc-${{ inputs.version }} key: libusb-msvc-${{ inputs.version }}
@@ -28,7 +28,7 @@ runs:
Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z" Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z"
- name: 'Cache libusb-${{ inputs.version }}.7z' - name: 'Cache libusb-${{ inputs.version }}.7z'
if: ${{ !steps.cache-restore.outputs.cache-hit }} if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@v4 uses: actions/cache/save@v5
with: with:
path: 'C:\temp\libusb-${{ inputs.version }}.7z' path: 'C:\temp\libusb-${{ inputs.version }}.7z'
key: libusb-msvc-${{ inputs.version }} key: libusb-msvc-${{ inputs.version }}

View File

@@ -7,7 +7,7 @@ inputs:
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- uses: actions/setup-python@v5 - uses: actions/setup-python@v6
with: with:
python-version: '3.x' python-version: '3.x'
- name: 'Verify platform' - name: 'Verify platform'
@@ -52,7 +52,7 @@ runs:
echo "extras-branch=${extras_branch}" >> ${GITHUB_OUTPUT} echo "extras-branch=${extras_branch}" >> ${GITHUB_OUTPUT}
# - name: 'Restore cached ${{ steps.calc.outputs.archive }}' # - name: 'Restore cached ${{ steps.calc.outputs.archive }}'
# id: cache-restore # id: cache-restore
# uses: actions/cache/restore@v4 # uses: actions/cache/restore@v5
# with: # with:
# path: '${{ runner.temp }}' # path: '${{ runner.temp }}'
# key: ${{ steps.calc.outputs.cache-key }} # key: ${{ steps.calc.outputs.cache-key }}
@@ -68,7 +68,7 @@ runs:
# - name: 'Cache ${{ steps.calc.outputs.archive }}' # - name: 'Cache ${{ steps.calc.outputs.archive }}'
# if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }} # if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
# uses: actions/cache/save@v4 # uses: actions/cache/save@v5
# with: # with:
# path: | # path: |
# ${{ runner.temp }}/apps.zip # ${{ runner.temp }}/apps.zip

View File

@@ -36,7 +36,7 @@ runs:
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT} echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
- name: 'Restore cached ${{ steps.calc.outputs.archive }}' - name: 'Restore cached ${{ steps.calc.outputs.archive }}'
id: cache-restore id: cache-restore
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
with: with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }} key: ${{ steps.calc.outputs.cache-key }}
@@ -47,7 +47,7 @@ runs:
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Cache ${{ steps.calc.outputs.archive }}' - name: 'Cache ${{ steps.calc.outputs.archive }}'
if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }} if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
uses: actions/cache/save@v4 uses: actions/cache/save@v5
with: with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }} key: ${{ steps.calc.outputs.cache-key }}

View File

@@ -33,7 +33,7 @@ runs:
exit 1 exit 1
;; ;;
esac esac
- uses: actions/cache/restore@v4 - uses: actions/cache/restore@v5
id: restore-cache id: restore-cache
with: with:
path: /vita/dependencies path: /vita/dependencies
@@ -81,7 +81,7 @@ runs:
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib
- uses: actions/cache/save@v4 - uses: actions/cache/save@v5
if: ${{ !steps.restore-cache.outputs.cache-hit }} if: ${{ !steps.restore-cache.outputs.cache-hit }}
with: with:
path: /vita/dependencies path: /vita/dependencies

View File

@@ -117,8 +117,10 @@ JOB_SPECS = {
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ), "ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ),
"ubuntu-latest": JobSpec(name="Ubuntu (latest)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-ubuntu-latest", ), "ubuntu-latest": JobSpec(name="Ubuntu (latest)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-ubuntu-latest", ),
"ubuntu-24.04-arm64": JobSpec(name="Ubuntu 24.04 (ARM64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-ubuntu24.04-arm64", ), "ubuntu-24.04-arm64": JobSpec(name="Ubuntu 24.04 (ARM64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-ubuntu24.04-arm64", ),
"steamrt3": JobSpec(name="Steam Linux Runtime 3.0 (x86_64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-steamrt3", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest", more_hard_deps = True, ), "steamrt3": JobSpec(name="Steam Linux Runtime 3.0 (x86_64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-steamrt3", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest" ),
"steamrt3-arm64": JobSpec(name="Steam Linux Runtime 3.0 (arm64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-steamrt3-arm64", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk/arm64:latest", more_hard_deps = True, ), "steamrt3-arm64": JobSpec(name="Steam Linux Runtime 3.0 (arm64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-steamrt3-arm64", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk/arm64:latest" ),
"steamrt4": JobSpec(name="Steam Linux Runtime 4.0 (x86_64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-steamrt4", container="registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk:latest", more_hard_deps = True, ),
"steamrt4-arm64": JobSpec(name="Steam Linux Runtime 4.0 (arm64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-steamrt4-arm64", container="registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk/arm64:latest", more_hard_deps = True, ),
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ), "ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
"ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ), "ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ),
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos14, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ), "macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos14, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
@@ -210,8 +212,7 @@ class JobDetails:
minidump: bool = False minidump: bool = False
intel: bool = False intel: bool = False
msys2_msystem: str = "" msys2_msystem: str = ""
msys2_env: str = "" msys2_packages: list[str] = dataclasses.field(default_factory=list)
msys2_no_perl: bool = False
werror: bool = True werror: bool = True
msvc_vcvars_arch: str = "" msvc_vcvars_arch: str = ""
msvc_vcvars_sdk: str = "" msvc_vcvars_sdk: str = ""
@@ -246,8 +247,7 @@ class JobDetails:
"enable-artifacts": enable_artifacts, "enable-artifacts": enable_artifacts,
"shell": self.shell, "shell": self.shell,
"msys2-msystem": self.msys2_msystem, "msys2-msystem": self.msys2_msystem,
"msys2-env": self.msys2_env, "msys2-packages": my_shlex_join(self.msys2_packages),
"msys2-no-perl": self.msys2_no_perl,
"android-ndk": self.android_ndk, "android-ndk": self.android_ndk,
"java": self.java, "java": self.java,
"intel": self.intel, "intel": self.intel,
@@ -735,15 +735,26 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.shell = "msys2 {0}" job.shell = "msys2 {0}"
assert spec.msys2_platform assert spec.msys2_platform
job.msys2_msystem = spec.msys2_platform.value job.msys2_msystem = spec.msys2_platform.value
job.msys2_env = { job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.A
msys2_env = {
"mingw32": "mingw-w64-i686", "mingw32": "mingw-w64-i686",
"mingw64": "mingw-w64-x86_64", "mingw64": "mingw-w64-x86_64",
"clang64": "mingw-w64-clang-x86_64", "clang64": "mingw-w64-clang-x86_64",
"ucrt64": "mingw-w64-ucrt-x86_64", "ucrt64": "mingw-w64-ucrt-x86_64",
}[spec.msys2_platform.value] }[spec.msys2_platform.value]
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, ) job.msys2_packages.extend([
job.shared_lib = SharedLibType.WIN32 f"{msys2_env}-cc",
job.static_lib = StaticLibType.A f"{msys2_env}-cmake",
f"{msys2_env}-ffmpeg",
f"{msys2_env}-ninja",
f"{msys2_env}-pkg-config",
])
if spec.msys2_platform not in (Msys2Platform.Mingw32, ):
job.msys2_packages.append(f"{msys2_env}-perl")
job.msys2_packages.append(f"{msys2_env}-clang-tools-extra")
if job.ccache:
job.msys2_packages.append(f"{msys2_env}-ccache")
case SdlPlatform.Riscos: case SdlPlatform.Riscos:
job.ccache = False # FIXME: enable when container gets upgrade job.ccache = False # FIXME: enable when container gets upgrade
# FIXME: Enable SDL_WERROR # FIXME: Enable SDL_WERROR

View File

@@ -27,15 +27,7 @@ jobs:
uses: msys2/setup-msys2@v2 uses: msys2/setup-msys2@v2
with: with:
msystem: ${{ matrix.platform.msys2-msystem }} msystem: ${{ matrix.platform.msys2-msystem }}
install: >- install: ${{ matrix.platform.msys2-packages }}
${{ matrix.platform.msys2-env }}-cc
${{ matrix.platform.msys2-env }}-cmake
${{ matrix.platform.msys2-env }}-ffmpeg
${{ matrix.platform.msys2-env }}-ninja
${{ (!matrix.platform.msys2-no-perl && format('{0}-perl', matrix.platform.msys2-env)) || '' }}
${{ matrix.platform.msys2-env }}-pkg-config
${{ matrix.platform.msys2-env }}-clang-tools-extra
${{ (matrix.platform.ccache && format('{0}-ccache', matrix.platform.msys2-env)) || '' }}
- name: 'About this job' - name: 'About this job'
run: | run: |
echo "key=${{ matrix.platform.key }}" echo "key=${{ matrix.platform.key }}"
@@ -43,7 +35,7 @@ jobs:
echo "os=${{ matrix.platform.os }}" echo "os=${{ matrix.platform.os }}"
echo "" echo ""
echo "Add [sdl-ci-filter ${{ matrix.platform.key }}] to your commit message to reduce the number of jobs." echo "Add [sdl-ci-filter ${{ matrix.platform.key }}] to your commit message to reduce the number of jobs."
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: 'Set up ninja' - name: 'Set up ninja'
if: ${{ matrix.platform.setup-ninja }} if: ${{ matrix.platform.setup-ninja }}
uses: ./.github/actions/setup-ninja uses: ./.github/actions/setup-ninja
@@ -52,11 +44,11 @@ jobs:
uses: ./.github/actions/setup-msvc-libusb uses: ./.github/actions/setup-msvc-libusb
with: with:
arch: ${{ matrix.platform.setup-libusb-arch }} arch: ${{ matrix.platform.setup-libusb-arch }}
- uses: mymindstorm/setup-emsdk@v14 - uses: mymindstorm/setup-emsdk@v15
if: ${{ matrix.platform.platform == 'emscripten' }} if: ${{ matrix.platform.platform == 'emscripten' }}
with: with:
version: 3.1.35 version: 3.1.35
- uses: browser-actions/setup-chrome@v1 - uses: browser-actions/setup-chrome@v2
id: setup-chrome id: setup-chrome
if: ${{ matrix.platform.platform == 'emscripten' }} if: ${{ matrix.platform.platform == 'emscripten' }}
with: with:
@@ -84,7 +76,7 @@ jobs:
run: | run: |
# We cannot use GitHub expressions in the controller job # We cannot use GitHub expressions in the controller job
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >>$GITHUB_ENV echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >>$GITHUB_ENV
- uses: actions/setup-java@v4 - uses: actions/setup-java@v5
if: ${{ matrix.platform.java }} if: ${{ matrix.platform.java }}
with: with:
distribution: 'temurin' distribution: 'temurin'
@@ -179,7 +171,7 @@ jobs:
echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT" echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT"
- name: 'Restore ccache' - name: 'Restore ccache'
if: ${{ matrix.platform.ccache }} if: ${{ matrix.platform.ccache }}
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
id: restore-ccache id: restore-ccache
with: with:
path: ${{ runner.temp }}/ccache path: ${{ runner.temp }}/ccache
@@ -327,7 +319,7 @@ jobs:
- name: 'Build (cross-platform-actions, BSD)' - name: 'Build (cross-platform-actions, BSD)'
id: cpactions id: cpactions
if: ${{ matrix.platform.cpactions }} if: ${{ matrix.platform.cpactions }}
uses: cross-platform-actions/action@v0.29.0 uses: cross-platform-actions/action@v0.32.0
with: with:
operating_system: '${{ matrix.platform.cpactions-os }}' operating_system: '${{ matrix.platform.cpactions-os }}'
architecture: '${{ matrix.platform.cpactions-arch }}' architecture: '${{ matrix.platform.cpactions-arch }}'
@@ -357,7 +349,7 @@ jobs:
- name: Add msbuild to PATH - name: Add msbuild to PATH
id: setup-msbuild id: setup-msbuild
if: ${{ matrix.platform.msvc-project != '' }} if: ${{ matrix.platform.msvc-project != '' }}
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v3
- name: Build msbuild - name: Build msbuild
if: ${{ matrix.platform.msvc-project != '' }} if: ${{ matrix.platform.msvc-project != '' }}
run: | run: |
@@ -401,7 +393,7 @@ jobs:
ccache -s ccache -s
- name: 'Save ccache' - name: 'Save ccache'
if: ${{ matrix.platform.ccache }} if: ${{ matrix.platform.ccache }}
uses: actions/cache/save@v4 uses: actions/cache/save@v5
with: with:
path: ${{ runner.temp }}/ccache path: ${{ runner.temp }}/ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }} key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
@@ -421,7 +413,7 @@ jobs:
run: | run: |
find ./ -iname '*.so' | xargs -L1 ./build-scripts/check_elf_alignment.sh find ./ -iname '*.so' | xargs -L1 ./build-scripts/check_elf_alignment.sh
- name: 'Upload binary package' - name: 'Upload binary package'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }} if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }}
with: with:
if-no-files-found: error if-no-files-found: error
@@ -430,14 +422,14 @@ jobs:
build/dist/SDL3* build/dist/SDL3*
build/include* build/include*
- name: 'Upload minidumps' - name: 'Upload minidumps'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
if: ${{ always() && steps.tests.outcome == 'failure' && (matrix.platform.platform == 'msvc' || matrix.platform.platform == 'msys2') }} if: ${{ always() && steps.tests.outcome == 'failure' && (matrix.platform.platform == 'msvc' || matrix.platform.platform == 'msys2') }}
with: with:
if-no-files-found: ignore if-no-files-found: ignore
name: '${{ matrix.platform.artifact }}-minidumps' name: '${{ matrix.platform.artifact }}-minidumps'
path: build/**/*.dmp path: build/**/*.dmp
- name: "Upload Android test apk's" - name: "Upload Android test apk's"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
if: ${{ matrix.platform.enable-artifacts && always() && matrix.platform.artifact != '' && steps.apks.outcome == 'success' }} if: ${{ matrix.platform.enable-artifacts && always() && matrix.platform.artifact != '' && steps.apks.outcome == 'success' }}
with: with:
if-no-files-found: error if-no-files-found: error

View File

@@ -20,15 +20,15 @@ jobs:
src-zip: ${{ steps.releaser.outputs.src-zip }} src-zip: ${{ steps.releaser.outputs.src-zip }}
steps: steps:
- name: 'Set up Python' - name: 'Set up Python'
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version: '3.11'
- name: 'Fetch build-release.py' - name: 'Fetch build-release.py'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
sparse-checkout: 'build-scripts/build-release.py' sparse-checkout: 'build-scripts/build-release.py'
- name: 'Set up SDL sources' - name: 'Set up SDL sources'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
path: 'SDL' path: 'SDL'
fetch-depth: 0 fetch-depth: 0
@@ -43,7 +43,7 @@ jobs:
--github \ --github \
--debug --debug
- name: 'Store source archives' - name: 'Store source archives'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
with: with:
name: sources name: sources
path: '${{ github.workspace}}/dist' path: '${{ github.workspace}}/dist'
@@ -61,7 +61,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -114,15 +114,15 @@ jobs:
dmg: ${{ steps.releaser.outputs.dmg }} dmg: ${{ steps.releaser.outputs.dmg }}
steps: steps:
- name: 'Set up Python' - name: 'Set up Python'
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version: '3.11'
- name: 'Fetch build-release.py' - name: 'Fetch build-release.py'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
sparse-checkout: 'build-scripts/build-release.py' sparse-checkout: 'build-scripts/build-release.py'
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -143,7 +143,7 @@ jobs:
--github \ --github \
--debug --debug
- name: 'Store DMG image file' - name: 'Store DMG image file'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
with: with:
name: dmg name: dmg
path: '${{ github.workspace }}/dist' path: '${{ github.workspace }}/dist'
@@ -153,12 +153,12 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
- name: 'Download ${{ needs.dmg.outputs.dmg }}' - name: 'Download ${{ needs.dmg.outputs.dmg }}'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: dmg name: dmg
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -322,15 +322,15 @@ jobs:
VC-devel: ${{ steps.releaser.outputs.VC-devel }} VC-devel: ${{ steps.releaser.outputs.VC-devel }}
steps: steps:
- name: 'Set up Python' - name: 'Set up Python'
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version: '3.11'
- name: 'Fetch build-release.py' - name: 'Fetch build-release.py'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
sparse-checkout: 'build-scripts/build-release.py' sparse-checkout: 'build-scripts/build-release.py'
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -351,7 +351,7 @@ jobs:
--github ` --github `
--debug --debug
- name: 'Store MSVC archives' - name: 'Store MSVC archives'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
with: with:
name: win32 name: win32
path: '${{ github.workspace }}/dist' path: '${{ github.workspace }}/dist'
@@ -361,16 +361,16 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: 'Fetch .github/actions/setup-ninja/action.yml' - name: 'Fetch .github/actions/setup-ninja/action.yml'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
sparse-checkout: '.github/actions/setup-ninja/action.yml' sparse-checkout: '.github/actions/setup-ninja/action.yml'
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
- name: 'Download MSVC binaries' - name: 'Download MSVC binaries'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: win32 name: win32
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -481,11 +481,11 @@ jobs:
mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }} mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
steps: steps:
- name: 'Set up Python' - name: 'Set up Python'
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version: '3.11'
- name: 'Fetch build-release.py' - name: 'Fetch build-release.py'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
sparse-checkout: 'build-scripts/build-release.py' sparse-checkout: 'build-scripts/build-release.py'
- name: 'Install Mingw toolchain' - name: 'Install Mingw toolchain'
@@ -493,7 +493,7 @@ jobs:
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -513,7 +513,7 @@ jobs:
--github \ --github \
--debug --debug
- name: 'Store MinGW archives' - name: 'Store MinGW archives'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
with: with:
name: mingw name: mingw
path: '${{ github.workspace }}/dist' path: '${{ github.workspace }}/dist'
@@ -527,12 +527,12 @@ jobs:
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
- name: 'Download MinGW binaries' - name: 'Download MinGW binaries'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: mingw name: mingw
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -582,11 +582,11 @@ jobs:
android-aar: ${{ steps.releaser.outputs.android-aar }} android-aar: ${{ steps.releaser.outputs.android-aar }}
steps: steps:
- name: 'Set up Python' - name: 'Set up Python'
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version: '3.11'
- name: 'Fetch build-release.py' - name: 'Fetch build-release.py'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
sparse-checkout: 'build-scripts/build-release.py' sparse-checkout: 'build-scripts/build-release.py'
- name: 'Setup Android NDK' - name: 'Setup Android NDK'
@@ -596,7 +596,7 @@ jobs:
local-cache: false local-cache: false
ndk-version: r28c ndk-version: r28c
- name: 'Setup Java JDK' - name: 'Setup Java JDK'
uses: actions/setup-java@v4 uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '11' java-version: '11'
@@ -605,7 +605,7 @@ jobs:
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y ninja-build sudo apt-get install -y ninja-build
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
@@ -627,7 +627,7 @@ jobs:
--github \ --github \
--debug --debug
- name: 'Store Android archive(s)' - name: 'Store Android archive(s)'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
with: with:
name: android name: android
path: '${{ github.workspace }}/dist' path: '${{ github.workspace }}/dist'
@@ -637,20 +637,20 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Set up Python' - name: 'Set up Python'
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version: '3.11'
- uses: actions/setup-java@v4 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '17' java-version: '17'
- name: 'Download source archives' - name: 'Download source archives'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: sources name: sources
path: '${{ github.workspace }}' path: '${{ github.workspace }}'
- name: 'Download Android .aar archive' - name: 'Download Android .aar archive'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v8
with: with:
name: android name: android
path: '${{ github.workspace }}' path: '${{ github.workspace }}'

20
AGENTS.md Normal file
View File

@@ -0,0 +1,20 @@
AI must not be used to generate code for contributions to this project.
"AI" in this case means a Large Language Model ("LLM"), such as ChatGPT,
Claude, Copilot, Grok, etc.
AI-generated code is based upon sources of unknown origins and may not be
compatible with the Zlib license, or may introduce conflicting license terms
if they include code from other projects.
AI can be used to identify issues with contributions to this project, but the
solutions to those issues should be authored by humans.
We have found that AI will frequently hallucinate issues that are not actually
problems in practice, report incorrect information, and describe problems that
are actually not issues at all. If AI identifies a problem with this codebase,
please make sure you understand what it is saying and have independently
confirmed that the issue exists before submitting a bug report or pull request.
Any pull request to this project will ask you to confirm that you are the
author and that you are contributing your changes under the Zlib license.

22
CLAUDE.md Normal file
View File

@@ -0,0 +1,22 @@
AI must not be used to generate code for contributions to this project.
"AI" in this case means a Large Language Model ("LLM"), such as ChatGPT,
Claude, Copilot, Grok, etc.
AI-generated code is based upon sources of unknown origins and may not be
compatible with the Zlib license, or may introduce conflicting license terms
if they include code from other projects.
AI can be used to identify issues with contributions to this project, but the
solutions to those issues should be authored by humans.
We have found that AI will frequently hallucinate issues that are not actually
problems in practice, report incorrect information, and describe problems that
are actually not issues at all. If AI identifies a problem with this codebase,
please make sure you understand what it is saying and have independently
confirmed that the issue exists before submitting a bug report or pull request.
Any pull request to this project will ask you to confirm that you are the
author and that you are contributing your changes under the Zlib license.

View File

@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
endif() endif()
# See docs/release_checklist.md # See docs/release_checklist.md
project(SDL3 LANGUAGES C VERSION "3.4.0") project(SDL3 LANGUAGES C VERSION "3.4.6")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(SDL3_MAINPROJECT ON) set(SDL3_MAINPROJECT ON)
@@ -46,6 +46,7 @@ endif()
include(CheckLibraryExists) include(CheckLibraryExists)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckLanguage) include(CheckLanguage)
include(CheckSymbolExists) include(CheckSymbolExists)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
@@ -367,7 +368,7 @@ dep_option(SDL_RENDER_D3D12 "Enable the Direct3D 12 render driver" ON "SD
dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;APPLE" OFF) dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;APPLE" OFF)
dep_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON "SDL_RENDER;SDL_GPU" OFF) dep_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON "SDL_RENDER;SDL_GPU" OFF)
dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF) dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
dep_option(SDL_VULKAN "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR WINDOWS" OFF) dep_option(SDL_VULKAN "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR OPENBSD OR WINDOWS" OFF)
dep_option(SDL_RENDER_VULKAN "Enable the Vulkan render driver" ON "SDL_RENDER;SDL_VULKAN" OFF) dep_option(SDL_RENDER_VULKAN "Enable the Vulkan render driver" ON "SDL_RENDER;SDL_VULKAN" OFF)
dep_option(SDL_METAL "Enable Metal support" ON "APPLE" OFF) dep_option(SDL_METAL "Enable Metal support" ON "APPLE" OFF)
set_option(SDL_OPENVR "Use OpenVR video driver" OFF) set_option(SDL_OPENVR "Use OpenVR video driver" OFF)
@@ -378,7 +379,7 @@ dep_option(SDL_DUMMYCAMERA "Support the dummy camera driver" ON SDL_CAME
option_string(SDL_BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" OFF) option_string(SDL_BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" OFF)
option_string(SDL_FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" OFF) option_string(SDL_FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" OFF)
dep_option(SDL_HIDAPI "Enable the HIDAPI subsystem" ON "NOT VISIONOS" OFF) dep_option(SDL_HIDAPI "Enable the HIDAPI subsystem" ON "NOT VISIONOS" OFF)
dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" ON SDL_HIDAPI_LIBUSB_AVAILABLE OFF) dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" ON "SDL_HIDAPI;SDL_HIDAPI_LIBUSB_AVAILABLE" OFF)
dep_option(SDL_HIDAPI_LIBUSB_SHARED "Dynamically load libusb support" ON "SDL_HIDAPI_LIBUSB;SDL_DEPS_SHARED" OFF) dep_option(SDL_HIDAPI_LIBUSB_SHARED "Dynamically load libusb support" ON "SDL_HIDAPI_LIBUSB;SDL_DEPS_SHARED" OFF)
dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF) dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF)
dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF) dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF)
@@ -387,6 +388,10 @@ set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors
set_option(SDL_CCACHE "Use Ccache to speed up build" OFF) set_option(SDL_CCACHE "Use Ccache to speed up build" OFF)
set_option(SDL_CLANG_TIDY "Run clang-tidy static analysis" OFF) set_option(SDL_CLANG_TIDY "Run clang-tidy static analysis" OFF)
if(EMSCRIPTEN)
option_string(SDL_EMSCRIPTEN_PERSISTENT_PATH "Path to mount Emscripten IDBFS at startup or '' to disable" "")
endif()
set(SDL_VENDOR_INFO "" CACHE STRING "Vendor name and/or version to add to SDL_REVISION") set(SDL_VENDOR_INFO "" CACHE STRING "Vendor name and/or version to add to SDL_REVISION")
cmake_dependent_option(SDL_SHARED "Build a shared version of the library" ${SDL_SHARED_DEFAULT} ${SDL_SHARED_AVAILABLE} OFF) cmake_dependent_option(SDL_SHARED "Build a shared version of the library" ${SDL_SHARED_DEFAULT} ${SDL_SHARED_AVAILABLE} OFF)
@@ -658,12 +663,7 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
endif() endif()
endif() endif()
if(APPLE) if(NOT OPENBSD)
check_linker_flag(C "-Wl,-undefined,error" LINKER_SUPPORTS_WL_UNDEFINED_ERROR)
if(LINKER_SUPPORTS_WL_UNDEFINED_ERROR)
sdl_shared_link_options("-Wl,-undefined,error")
endif()
elseif(NOT OPENBSD)
cmake_push_check_state() cmake_push_check_state()
check_linker_flag(C "-Wl,--no-undefined" LINKER_SUPPORTS_WL_NO_UNDEFINED) check_linker_flag(C "-Wl,--no-undefined" LINKER_SUPPORTS_WL_NO_UNDEFINED)
#FIXME: originally this if had an additional "AND NOT (USE_CLANG AND WINDOWS)" #FIXME: originally this if had an additional "AND NOT (USE_CLANG AND WINDOWS)"
@@ -1179,34 +1179,33 @@ if(SDL_LIBC)
check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE) check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE)
check_symbol_exists(posix_spawn_file_actions_addchdir "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR) check_symbol_exists(posix_spawn_file_actions_addchdir "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
check_symbol_exists(posix_spawn_file_actions_addchdir_np "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP) check_symbol_exists(posix_spawn_file_actions_addchdir_np "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
endif()
if(SDL_SYSTEM_ICONV)
check_c_source_compiles("
#define LIBICONV_PLUG 1 /* in case libiconv header is in include path */
#include <stddef.h>
#include <iconv.h>
int main(int argc, char **argv) {
return !iconv_open(NULL,NULL);
}" ICONV_IN_LIBC)
if(SDL_SYSTEM_ICONV) cmake_push_check_state()
check_c_source_compiles(" list(APPEND CMAKE_REQUIRED_LIBRARIES iconv)
#define LIBICONV_PLUG 1 /* in case libiconv header is in include path */ check_c_source_compiles("
#include <stddef.h> #include <stddef.h>
#include <iconv.h> #include <iconv.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {
return !iconv_open(NULL,NULL); return !iconv_open(NULL,NULL);
}" ICONV_IN_LIBC) }" ICONV_IN_LIBICONV)
cmake_pop_check_state()
cmake_push_check_state() if(ICONV_IN_LIBC OR ICONV_IN_LIBICONV)
list(APPEND CMAKE_REQUIRED_LIBRARIES iconv) set(HAVE_ICONV 1)
check_c_source_compiles(" set(HAVE_SYSTEM_ICONV TRUE)
#include <stddef.h> if(ICONV_IN_LIBICONV AND (SDL_LIBICONV OR (NOT ICONV_IN_LIBC)))
#include <iconv.h> sdl_link_dependency(iconv LIBS iconv)
int main(int argc, char **argv) { set(SDL_USE_LIBICONV 1)
return !iconv_open(NULL,NULL); set(HAVE_LIBICONV TRUE)
}" ICONV_IN_LIBICONV)
cmake_pop_check_state()
if(ICONV_IN_LIBC OR ICONV_IN_LIBICONV)
set(HAVE_ICONV 1)
set(HAVE_SYSTEM_ICONV TRUE)
if(ICONV_IN_LIBICONV AND (SDL_LIBICONV OR (NOT ICONV_IN_LIBC)))
sdl_link_dependency(iconv LIBS iconv)
set(SDL_USE_LIBICONV 1)
set(HAVE_LIBICONV TRUE)
endif()
endif() endif()
endif() endif()
@@ -1294,22 +1293,25 @@ sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.h" "${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.h"
) )
# Build uclibc as a static library such that non-used symbols don't end up in the SDL3 shared library.
file(GLOB SDL_UCLIBC_SOURCES "${SDL3_SOURCE_DIR}/src/libm/*.c") file(GLOB SDL_UCLIBC_SOURCES "${SDL3_SOURCE_DIR}/src/libm/*.c")
add_library(SDL_uclibc STATIC "${SDL_UCLIBC_SOURCES}")
target_compile_definitions(SDL_uclibc PRIVATE USING_GENERATED_CONFIG_H)
target_include_directories(SDL_uclibc PRIVATE "${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/build_config")
target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/src")
target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/include")
SDL_AddCommonCompilerFlags(SDL_uclibc)
target_compile_definitions(SDL_uclibc PRIVATE "$<$<CONFIG:Debug>:DEBUG>")
sdl_sources(STATIC "$<TARGET_OBJECTS:SDL_uclibc>")
set_property(TARGET SDL_uclibc PROPERTY UNITY_BUILD OFF)
if(TARGET SDL3-shared) if(TARGET SDL3-shared)
# Build uclibc as a static library such that non-used symbols don't end up in the SDL3 shared library.
add_library(SDL_uclibc STATIC ${SDL_UCLIBC_SOURCES})
set_property(TARGET SDL_uclibc PROPERTY POSITION_INDEPENDENT_CODE TRUE)
target_compile_definitions(SDL_uclibc PRIVATE USING_GENERATED_CONFIG_H)
target_include_directories(SDL_uclibc PRIVATE "${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/build_config")
target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/src")
target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/include")
SDL_AddCommonCompilerFlags(SDL_uclibc)
target_compile_definitions(SDL_uclibc PRIVATE "$<$<CONFIG:Debug>:DEBUG>")
set_property(TARGET SDL_uclibc PROPERTY UNITY_BUILD OFF)
target_link_libraries(SDL3-shared PRIVATE SDL_uclibc) target_link_libraries(SDL3-shared PRIVATE SDL_uclibc)
if(HAVE_GCC_FVISIBILITY)
set_property(TARGET SDL_uclibc PROPERTY C_VISIBILITY_PRESET "hidden")
endif()
endif() endif()
if(HAVE_GCC_FVISIBILITY) if(TARGET SDL3-static)
set_property(TARGET SDL_uclibc PROPERTY C_VISIBILITY_PRESET "hidden") target_sources(SDL3-static PRIVATE ${SDL_UCLIBC_SOURCES})
endif() endif()
# Enable/disable various subsystems of the SDL library # Enable/disable various subsystems of the SDL library
@@ -1653,6 +1655,11 @@ elseif(EMSCRIPTEN)
# project. Uncomment at will for verbose cross-compiling -I/../ path info. # project. Uncomment at will for verbose cross-compiling -I/../ path info.
sdl_compile_options(PRIVATE "-Wno-warn-absolute-paths") sdl_compile_options(PRIVATE "-Wno-warn-absolute-paths")
if(NOT SDL_EMSCRIPTEN_PERSISTENT_PATH STREQUAL "")
set(SDL_EMSCRIPTEN_PERSISTENT_PATH_STRING "${SDL_EMSCRIPTEN_PERSISTENT_PATH}")
sdl_link_dependency(idbfs LIBS idbfs.js)
endif()
sdl_glob_sources( sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/main/emscripten/*.c" "${SDL3_SOURCE_DIR}/src/main/emscripten/*.c"
"${SDL3_SOURCE_DIR}/src/main/emscripten/*.h" "${SDL3_SOURCE_DIR}/src/main/emscripten/*.h"
@@ -1766,6 +1773,7 @@ elseif(EMSCRIPTEN)
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set(SDL_DISABLE_DLOPEN_NOTES TRUE)
if(SDL_DLOPEN_NOTES) if(SDL_DLOPEN_NOTES)
set(CHECK_ELF_DLNOTES_SRC [==[ set(CHECK_ELF_DLNOTES_SRC [==[
#ifndef __ELF__ #ifndef __ELF__
@@ -1778,10 +1786,10 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
return argc + dlnote.hdr.a; return argc + dlnote.hdr.a;
} }
]==]) ]==])
set(SDL_DISABLE_DLOPEN_NOTES FALSE)
check_c_source_compiles("${CHECK_ELF_DLNOTES_SRC}" COMPILER_SUPPORTS_ELFNOTES) check_c_source_compiles("${CHECK_ELF_DLNOTES_SRC}" COMPILER_SUPPORTS_ELFNOTES)
if(NOT COMPILER_SUPPORTS_ELFNOTES) if(COMPILER_SUPPORTS_ELFNOTES)
set(SDL_DISABLE_DLOPEN_NOTES TRUE) set(SDL_DISABLE_DLOPEN_NOTES FALSE)
set(HAVE_DLOPEN_NOTES TRUE)
endif() endif()
endif() endif()
@@ -2710,13 +2718,6 @@ elseif(APPLE)
set(SDL_VIDEO_RENDER_METAL 1) set(SDL_VIDEO_RENDER_METAL 1)
set(HAVE_RENDER_METAL TRUE) set(HAVE_RENDER_METAL TRUE)
endif() endif()
if (SDL_GPU)
set(SDL_GPU_METAL 1)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.m"
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.h"
)
endif()
endif() endif()
endif() endif()
endif() endif()
@@ -3233,6 +3234,7 @@ elseif(PS2)
gskit gskit
dmakit dmakit
ps2_drivers ps2_drivers
atomic
) )
elseif(N3DS) elseif(N3DS)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/n3ds/*.c") sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/n3ds/*.c")
@@ -3529,6 +3531,14 @@ if(SDL_GPU)
set(SDL_GPU_VULKAN 1) set(SDL_GPU_VULKAN 1)
set(HAVE_SDL_GPU TRUE) set(HAVE_SDL_GPU TRUE)
endif() endif()
if(SDL_VIDEO_METAL)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.m"
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.h"
)
set(SDL_GPU_METAL 1)
set(HAVE_SDL_GPU TRUE)
endif()
if(SDL_RENDER_GPU AND HAVE_SDL_GPU) if(SDL_RENDER_GPU AND HAVE_SDL_GPU)
set(SDL_VIDEO_RENDER_GPU 1) set(SDL_VIDEO_RENDER_GPU 1)
set(HAVE_RENDER_GPU TRUE) set(HAVE_RENDER_GPU TRUE)
@@ -3982,6 +3992,7 @@ if(SDL_SHARED)
) )
endif() endif()
endif() endif()
target_link_libraries(SDL3-shared PRIVATE ${SDL_CMAKE_DEPENDS}) target_link_libraries(SDL3-shared PRIVATE ${SDL_CMAKE_DEPENDS})
target_include_directories(SDL3-shared target_include_directories(SDL3-shared
PRIVATE PRIVATE
@@ -3999,6 +4010,8 @@ if(SDL_SHARED)
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL3_SHARED TRUE) set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL3_SHARED TRUE)
set_property(TARGET SDL3-shared APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION") set_property(TARGET SDL3-shared APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}") set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
set_property(TARGET SDL3-shared APPEND PROPERTY EXPORT_PROPERTIES "SDL_FULL_VERSION")
set_property(TARGET SDL3-shared PROPERTY SDL_FULL_VERSION "${PROJECT_VERSION}")
if(NOT CMAKE_VERSION VERSION_LESS "3.16") if(NOT CMAKE_VERSION VERSION_LESS "3.16")
target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>") target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
endif() endif()
@@ -4023,6 +4036,8 @@ if(SDL_STATIC)
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL3_SHARED FALSE) set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL3_SHARED FALSE)
set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION") set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}") set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
set_property(TARGET SDL3-static APPEND PROPERTY EXPORT_PROPERTIES "SDL_FULL_VERSION")
set_property(TARGET SDL3-static PROPERTY SDL_FULL_VERSION "${PROJECT_VERSION}")
if(NOT CMAKE_VERSION VERSION_LESS "3.16") if(NOT CMAKE_VERSION VERSION_LESS "3.16")
target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>") target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
endif() endif()

View File

@@ -1,4 +1,4 @@
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,5 +1,5 @@
/* /*
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -291,9 +291,8 @@ static void DrawSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
static void loop() static void update()
{ {
int i;
SDL_Event event; SDL_Event event;
/* Check for events */ /* Check for events */
@@ -310,20 +309,39 @@ static void loop()
SDLTest_CommonEvent(state, &event, &done); SDLTest_CommonEvent(state, &event, &done);
#endif #endif
} }
fillerup();
}
static void draw()
{
int i;
for (i = 0; i < state->num_windows; ++i) { for (i = 0; i < state->num_windows; ++i) {
if (state->windows[i] == NULL) { if (state->windows[i] == NULL) {
continue; continue;
} }
DrawSprites(state->renderers[i], sprites[i]); DrawSprites(state->renderers[i], sprites[i]);
} }
fillerup(); }
static bool SDLCALL GDKEventWatch(void* userdata, SDL_Event* event)
{
bool *suppressdraw = (bool *)userdata;
SDL_assert(suppressdraw != NULL);
if (event->type == SDL_EVENT_DID_ENTER_BACKGROUND) {
*suppressdraw = true;
SDL_GDKSuspendComplete();
} else if (event->type == SDL_EVENT_WILL_ENTER_FOREGROUND) {
*suppressdraw = false;
}
return true;
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int i; int i;
const char *icon = "icon.bmp"; const char *icon = "icon.png";
char *soundname = NULL; char *soundname = NULL;
bool suppressdraw = false;
/* Initialize parameters */ /* Initialize parameters */
num_sprites = NUM_SPRITES; num_sprites = NUM_SPRITES;
@@ -390,6 +408,9 @@ int main(int argc, char *argv[])
quit(2); quit(2);
} }
/* By this point the renderers are made, so we can now add this watcher */
SDL_AddEventWatch(GDKEventWatch, &suppressdraw);
/* Create the windows, initialize the renderers, and load the textures */ /* Create the windows, initialize the renderers, and load the textures */
sprites = sprites =
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites)); (SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
@@ -441,7 +462,10 @@ int main(int argc, char *argv[])
AddUserSilent(); AddUserSilent();
while (!done) { while (!done) {
loop(); update();
if (!suppressdraw) {
draw();
}
} }
quit(0); quit(0);

View File

@@ -19,10 +19,10 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.4.0</string> <string>3.4.6</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>SDLX</string> <string>SDLX</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>3.4.0</string> <string>3.4.6</string>
</dict> </dict>
</plist> </plist>

View File

@@ -3162,7 +3162,7 @@
CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES; DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 401.0.0; DYLIB_COMPATIBILITY_VERSION = 401.0.0;
DYLIB_CURRENT_VERSION = 401.0.0; DYLIB_CURRENT_VERSION = 401.6.0;
DYLIB_INSTALL_NAME_BASE = "@rpath"; DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES; GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3197,7 +3197,7 @@
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 10.13; MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.4.0; MARKETING_VERSION = 3.4.6;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)"; OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3; PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
PRODUCT_NAME = SDL3; PRODUCT_NAME = SDL3;
@@ -3228,7 +3228,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_ARC = YES;
DYLIB_COMPATIBILITY_VERSION = 401.0.0; DYLIB_COMPATIBILITY_VERSION = 401.0.0;
DYLIB_CURRENT_VERSION = 401.0.0; DYLIB_CURRENT_VERSION = 401.6.0;
DYLIB_INSTALL_NAME_BASE = "@rpath"; DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
@@ -3260,7 +3260,7 @@
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 10.13; MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.4.0; MARKETING_VERSION = 3.4.6;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)"; OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3; PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;

View File

@@ -1,4 +1,4 @@
Title SDL 3.4.0 Title SDL 3.4.6
Version 1 Version 1
Description SDL Library for macOS (http://www.libsdl.org) Description SDL Library for macOS (http://www.libsdl.org)
DefaultLocation /Library/Frameworks DefaultLocation /Library/Frameworks

View File

@@ -69,6 +69,7 @@
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager { -keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager {
void pollInputDevices(); void pollInputDevices();
void joystickSetLED(int, int, int, int);
void pollHapticDevices(); void pollHapticDevices();
void hapticRun(int, float, int); void hapticRun(int, float, int);
void hapticRumble(int, float, float, int); void hapticRumble(int, float, float, int);

View File

@@ -256,6 +256,7 @@ public class HIDDeviceManager {
0x24c6, // PowerA 0x24c6, // PowerA
0x2c22, // Qanba 0x2c22, // Qanba
0x2dc8, // 8BitDo 0x2dc8, // 8BitDo
0x37d7, // Flydigi
0x9886, // ASTRO Gaming 0x9886, // ASTRO Gaming
}; };

View File

@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL"; private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 3; private static final int SDL_MAJOR_VERSION = 3;
private static final int SDL_MINOR_VERSION = 4; private static final int SDL_MINOR_VERSION = 4;
private static final int SDL_MICRO_VERSION = 0; private static final int SDL_MICRO_VERSION = 6;
/* /*
// Display InputType.SOURCE/CLASS of events and devices // Display InputType.SOURCE/CLASS of events and devices
// //
@@ -570,7 +570,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static int getNaturalOrientation() { public static int getNaturalOrientation() {
int result = SDL_ORIENTATION_UNKNOWN; int result = SDL_ORIENTATION_UNKNOWN;
Activity activity = (Activity)getContext(); Activity activity = getContext();
if (activity != null) { if (activity != null) {
Configuration config = activity.getResources().getConfiguration(); Configuration config = activity.getResources().getConfiguration();
Display display = activity.getWindowManager().getDefaultDisplay(); Display display = activity.getWindowManager().getDefaultDisplay();
@@ -590,7 +590,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static int getCurrentRotation() { public static int getCurrentRotation() {
int result = 0; int result = 0;
Activity activity = (Activity)getContext(); Activity activity = getContext();
if (activity != null) { if (activity != null) {
Display display = activity.getWindowManager().getDefaultDisplay(); Display display = activity.getWindowManager().getDefaultDisplay();
switch (display.getRotation()) { switch (display.getRotation()) {
@@ -1270,10 +1270,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
if (Build.MANUFACTURER.equals("MINIX") && Build.MODEL.equals("NEO-U1")) { if (Build.MANUFACTURER.equals("MINIX") && Build.MODEL.equals("NEO-U1")) {
return true; return true;
} }
if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.equals("X96-W")) { if (Build.MANUFACTURER.equals("Amlogic") &&
return true; (Build.MODEL.startsWith("TV") ||
} Build.MODEL.equals("X96-W") ||
if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.startsWith("TV")) { Build.MODEL.equals("A95X-R1"))) {
return true; return true;
} }
return false; return false;
@@ -1292,7 +1292,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static double getDiagonal() public static double getDiagonal()
{ {
DisplayMetrics metrics = new DisplayMetrics(); DisplayMetrics metrics = new DisplayMetrics();
Activity activity = (Activity)getContext(); Activity activity = getContext();
if (activity == null) { if (activity == null) {
return 0.0; return 0.0;
} }
@@ -1940,7 +1940,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
return; return;
} }
Activity activity = (Activity)getContext(); Activity activity = getContext();
if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) { if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
activity.requestPermissions(new String[]{permission}, requestCode); activity.requestPermissions(new String[]{permission}, requestCode);
} else { } else {

View File

@@ -211,7 +211,7 @@ class SDLJoystickHandler {
/** /**
* Handles adding and removing of input devices. * Handles adding and removing of input devices.
*/ */
void pollInputDevices() { synchronized void pollInputDevices() {
int[] deviceIds = InputDevice.getDeviceIds(); int[] deviceIds = InputDevice.getDeviceIds();
for (int device_id : deviceIds) { for (int device_id : deviceIds) {
@@ -307,7 +307,7 @@ class SDLJoystickHandler {
} }
} }
protected SDLJoystick getJoystick(int device_id) { synchronized protected SDLJoystick getJoystick(int device_id) {
for (SDLJoystick joystick : mJoysticks) { for (SDLJoystick joystick : mJoysticks) {
if (joystick.device_id == device_id) { if (joystick.device_id == device_id) {
return joystick; return joystick;
@@ -642,7 +642,7 @@ class SDLHapticHandler {
} }
} }
void pollHapticDevices() { synchronized void pollHapticDevices() {
final int deviceId_VIBRATOR_SERVICE = 999999; final int deviceId_VIBRATOR_SERVICE = 999999;
boolean hasVibratorService = false; boolean hasVibratorService = false;
@@ -690,7 +690,7 @@ class SDLHapticHandler {
} }
} }
protected SDLHaptic getHaptic(int device_id) { synchronized protected SDLHaptic getHaptic(int device_id) {
for (SDLHaptic haptic : mHaptics) { for (SDLHaptic haptic : mHaptics) {
if (haptic.device_id == device_id) { if (haptic.device_id == device_id) {
return haptic; return haptic;
@@ -755,6 +755,9 @@ class SDLGenericMotionListener_API14 implements View.OnGenericMotionListener {
// BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4, and apply SDL_PEN_INPUT_DOWN/SDL_PEN_INPUT_ERASER_TIP // BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4, and apply SDL_PEN_INPUT_DOWN/SDL_PEN_INPUT_ERASER_TIP
int buttons = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30)); int buttons = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
if ((event.getButtonState() & MotionEvent.BUTTON_TERTIARY) != 0) {
buttons |= 0x08;
}
SDLActivity.onNativePen(event.getPointerId(i), getPenDeviceType(event.getDevice()), buttons, action, x, y, p); SDLActivity.onNativePen(event.getPointerId(i), getPenDeviceType(event.getDevice()), buttons, action, x, y, p);
consumed = true; consumed = true;

View File

@@ -65,17 +65,15 @@ class SDLInputConnection extends BaseInputConnection
@Override @Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) { public boolean deleteSurroundingText(int beforeLength, int afterLength) {
if (Build.VERSION.SDK_INT <= 29 /* Android 10.0 (Q) */) { // Workaround to capture backspace key. Ref: http://stackoverflow.com/questions>/14560344/android-backspace-in-webview-baseinputconnection
// Workaround to capture backspace key. Ref: http://stackoverflow.com/questions>/14560344/android-backspace-in-webview-baseinputconnection // and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
// and https://bugzilla.libsdl.org/show_bug.cgi?id=2265 if (beforeLength > 0 && afterLength == 0) {
if (beforeLength > 0 && afterLength == 0) { // backspace(s)
// backspace(s) while (beforeLength-- > 0) {
while (beforeLength-- > 0) { nativeGenerateScancodeForUnichar('\b');
nativeGenerateScancodeForUnichar('\b'); }
} return true;
return true; }
}
}
if (!super.deleteSurroundingText(beforeLength, afterLength)) { if (!super.deleteSurroundingText(beforeLength, afterLength)) {
return false; return false;

View File

@@ -45,6 +45,9 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
// Is SurfaceView ready for rendering // Is SurfaceView ready for rendering
protected boolean mIsSurfaceReady; protected boolean mIsSurfaceReady;
// Is on-screen keyboard visible
protected boolean mKeyboardVisible;
// Pinch events // Pinch events
private final ScaleGestureDetector scaleGestureDetector; private final ScaleGestureDetector scaleGestureDetector;
@@ -208,6 +211,18 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
WindowInsets.Type.displayCutout()); WindowInsets.Type.displayCutout());
SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom); SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom);
if (insets.isVisible(WindowInsets.Type.ime())) {
if (!mKeyboardVisible) {
mKeyboardVisible = true;
SDLActivity.onNativeScreenKeyboardShown();
}
} else {
if (mKeyboardVisible) {
mKeyboardVisible = false;
SDLActivity.onNativeScreenKeyboardHidden();
}
}
} }
// Pass these to any child views in case they need them // Pass these to any child views in case they need them
@@ -280,6 +295,9 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
// BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4, and apply SDL_PEN_INPUT_DOWN/SDL_PEN_INPUT_ERASER_TIP // BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4, and apply SDL_PEN_INPUT_DOWN/SDL_PEN_INPUT_ERASER_TIP
int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30)); int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
if ((event.getButtonState() & MotionEvent.BUTTON_TERTIARY) != 0) {
buttonState |= 0x08;
}
SDLActivity.onNativePen(pointerId, SDLActivity.getMotionListener().getPenDeviceType(event.getDevice()), buttonState, action, x, y, p); SDLActivity.onNativePen(pointerId, SDLActivity.getMotionListener().getPenDeviceType(event.getDevice()), buttonState, action, x, y, p);
} else { // MotionEvent.TOOL_TYPE_FINGER or MotionEvent.TOOL_TYPE_UNKNOWN } else { // MotionEvent.TOOL_TYPE_FINGER or MotionEvent.TOOL_TYPE_UNKNOWN

View File

@@ -267,8 +267,12 @@ class Archiver:
def close(self): def close(self):
# Archiver is intentionally made invalid after this function # Archiver is intentionally made invalid after this function
for zf in self._zip_files:
zf.close()
del self._zip_files del self._zip_files
self._zip_files = None self._zip_files = None
for tf in self._tar_files:
tf.close()
del self._tar_files del self._tar_files
self._tar_files = None self._tar_files = None

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# Simple DirectMedia Layer # Simple DirectMedia Layer
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> # Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
# #
# This software is provided 'as-is', without any express or implied # This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages # warranty. In no event will the authors be held liable for any damages

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# #
# Simple DirectMedia Layer # Simple DirectMedia Layer
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> # Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
# #
# This software is provided 'as-is', without any express or implied # This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages # warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -406,7 +406,7 @@ int main(void)
printf( printf(
"/*\n" "/*\n"
" Simple DirectMedia Layer\n" " Simple DirectMedia Layer\n"
" Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>\n" " Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>\n"
"\n" "\n"
" This software is provided 'as-is', without any express or implied\n" " This software is provided 'as-is', without any express or implied\n"
" warranty. In no event will the authors be held liable for any damages\n" " warranty. In no event will the authors be held liable for any damages\n"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# Simple DirectMedia Layer # Simple DirectMedia Layer
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> # Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
# #
# This software is provided 'as-is', without any express or implied # This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages # warranty. In no event will the authors be held liable for any damages
@@ -36,7 +36,7 @@ my $mem_used = 0;
print <<__EOF__; print <<__EOF__;
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken\@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken\@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# Simple DirectMedia Layer # Simple DirectMedia Layer
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> # Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
# #
# This software is provided 'as-is', without any express or implied # This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages # warranty. In no event will the authors be held liable for any damages
@@ -2912,6 +2912,11 @@ __EOF__
$brief = shift @briefsplit; $brief = shift @briefsplit;
$brief = dewikify($wikitype, $brief); $brief = dewikify($wikitype, $brief);
# Hack: `apropros` doesn't like escaped character things like `\[char46]` for `.`...since almost every
# manpage will end their Brief section with a period and it won't wordwrap to risk being a groff control
# character, just replace it.
$brief =~ s/\\\[char46\]/./g;
if (defined $remarks) { if (defined $remarks) {
$remarks = dewikify($wikitype, join("\n", @briefsplit) . $remarks); $remarks = dewikify($wikitype, join("\n", @briefsplit) . $remarks);
} }

View File

@@ -21,7 +21,7 @@ macro(option_string _NAME _DESC _VALUE)
add_to_alloptions(${_NAME}) add_to_alloptions(${_NAME})
set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}") set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}")
set(HAVE_${_NAME} ${_VALUE}) set(HAVE_${_NAME} ${_VALUE})
ENDMACRO() endmacro()
macro(message_bool_option _NAME _VALUE) macro(message_bool_option _NAME _VALUE)
set(_PAD "\t") set(_PAD "\t")

View File

@@ -457,7 +457,7 @@ macro(CheckX11)
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <X11/extensions/XInput2.h> #include <X11/extensions/XInput2.h>
int event_type = XI_GesturePinchBegin; int event_type = XI_GesturePinchBegin;
XITouchClassInfo *t; XIGesturePinchEvent *t;
Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) { Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) {
return (Status)0; return (Status)0;
} }
@@ -1113,22 +1113,22 @@ macro(CheckUSBHID)
cmake_push_check_state() cmake_push_check_state()
check_library_exists(usbhid hid_init "" LIBUSBHID) check_library_exists(usbhid hid_init "" LIBUSBHID)
if(LIBUSBHID) if(LIBUSBHID)
check_include_file(usbhid.h HAVE_USBHID_H) check_include_files("stdint.h;usbhid.h" HAVE_USBHID_H)
if(HAVE_USBHID_H) if(HAVE_USBHID_H)
set(USB_CFLAGS "-DHAVE_USBHID_H") set(USB_CFLAGS "-DHAVE_USBHID_H")
endif() endif()
check_include_file(libusbhid.h HAVE_LIBUSBHID_H) check_include_files("stdint.h;libusbhid.h" HAVE_LIBUSBHID_H)
if(HAVE_LIBUSBHID_H) if(HAVE_LIBUSBHID_H)
string(APPEND USB_CFLAGS " -DHAVE_LIBUSBHID_H") string(APPEND USB_CFLAGS " -DHAVE_LIBUSBHID_H")
endif() endif()
set(USB_LIBS ${USB_LIBS} usbhid) set(USB_LIBS ${USB_LIBS} usbhid)
else() else()
check_include_file(usb.h HAVE_USB_H) check_include_files("stdint.h;usb.h" HAVE_USB_H)
if(HAVE_USB_H) if(HAVE_USB_H)
set(USB_CFLAGS "-DHAVE_USB_H") set(USB_CFLAGS "-DHAVE_USB_H")
endif() endif()
check_include_file(libusb.h HAVE_LIBUSB_H) check_include_files("stdint.h;libusb.h" HAVE_LIBUSB_H)
if(HAVE_LIBUSB_H) if(HAVE_LIBUSB_H)
string(APPEND USB_CFLAGS " -DHAVE_LIBUSB_H") string(APPEND USB_CFLAGS " -DHAVE_LIBUSB_H")
endif() endif()
@@ -1141,7 +1141,7 @@ macro(CheckUSBHID)
string(APPEND CMAKE_REQUIRED_FLAGS " ${USB_CFLAGS}") string(APPEND CMAKE_REQUIRED_FLAGS " ${USB_CFLAGS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES ${USB_LIBS}) list(APPEND CMAKE_REQUIRED_LIBRARIES ${USB_LIBS})
check_c_source_compiles(" check_c_source_compiles("
#include <sys/types.h> #include <stdint.h>
#if defined(HAVE_USB_H) #if defined(HAVE_USB_H)
#include <usb.h> #include <usb.h>
#endif #endif
@@ -1167,7 +1167,7 @@ macro(CheckUSBHID)
}" HAVE_USBHID) }" HAVE_USBHID)
if(HAVE_USBHID) if(HAVE_USBHID)
check_c_source_compiles(" check_c_source_compiles("
#include <sys/types.h> #include <stdint.h>
#if defined(HAVE_USB_H) #if defined(HAVE_USB_H)
#include <usb.h> #include <usb.h>
#endif #endif
@@ -1195,7 +1195,7 @@ macro(CheckUSBHID)
endif() endif()
check_c_source_compiles(" check_c_source_compiles("
#include <sys/types.h> #include <stdint.h>
#if defined(HAVE_USB_H) #if defined(HAVE_USB_H)
#include <usb.h> #include <usb.h>
#endif #endif
@@ -1270,12 +1270,15 @@ macro(CheckHIDAPI)
cmake_pop_check_state() cmake_pop_check_state()
if(HAVE_LIBUSB_H) if(HAVE_LIBUSB_H)
set(HAVE_LIBUSB TRUE) set(HAVE_LIBUSB TRUE)
target_get_dynamic_library(dynamic_libusb LibUSB::LibUSB) if(SDL_HIDAPI_LIBUSB_SHARED)
if(SDL_HIDAPI_LIBUSB_SHARED AND dynamic_libusb) target_get_dynamic_library(dynamic_libusb LibUSB::LibUSB)
set(HAVE_HIDAPI_LIBUSB_SHARED ON) if(dynamic_libusb)
set(SDL_LIBUSB_DYNAMIC "\"${dynamic_libusb}\"") set(HAVE_HIDAPI_LIBUSB_SHARED ON)
sdl_link_dependency(hidapi INCLUDES $<TARGET_PROPERTY:LibUSB::LibUSB,INTERFACE_INCLUDE_DIRECTORIES>) set(SDL_LIBUSB_DYNAMIC "\"${dynamic_libusb}\"")
else() sdl_link_dependency(hidapi INCLUDES $<TARGET_PROPERTY:LibUSB::LibUSB,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
endif()
if(NOT HAVE_HIDAPI_LIBUSB_SHARED)
sdl_link_dependency(hidapi LIBS LibUSB::LibUSB PKG_CONFIG_SPECS "${LibUSB_PKG_CONFIG_SPEC}" CMAKE_MODULE LibUSB) sdl_link_dependency(hidapi LIBS LibUSB::LibUSB PKG_CONFIG_SPECS "${LibUSB_PKG_CONFIG_SPEC}" CMAKE_MODULE LibUSB)
endif() endif()
endif() endif()

View File

@@ -11,7 +11,7 @@ macro(SDL_DetectCompiler)
if(MSVC) if(MSVC)
set(MSVC_CLANG TRUE) set(MSVC_CLANG TRUE)
endif() endif()
elseif(CMAKE_COMPILER_IS_GNUCC) elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(USE_GCC TRUE) set(USE_GCC TRUE)
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$") elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
set(USE_INTELCC TRUE) set(USE_INTELCC TRUE)

View File

@@ -30,12 +30,12 @@ SDL_LDFLAGS="$( pkg-config sdl3 --libs )"
SDL_STATIC_LDFLAGS="$( pkg-config sdl3 --libs --static )" SDL_STATIC_LDFLAGS="$( pkg-config sdl3 --libs --static )"
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS" compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS" link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_CFLAGS $CFLAGS $SDL_LDFLAGS $LDFLAGS"
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS" static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_CFLAGS $CFLAGS $SDL_STATIC_LDFLAGS $LDFLAGS"
echo "-- CC: $CC" echo "-- CC: $CC"
echo "-- CFLAGS: $CFLAGS" echo "-- CFLAGS: $CFLAGS"
echo "-- LDFLASG: $LDFLAGS" echo "-- LDFLAGS: $LDFLAGS"
echo "-- SDL_CFLAGS: $SDL_CFLAGS" echo "-- SDL_CFLAGS: $SDL_CFLAGS"
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS" echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS" echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"

View File

@@ -168,7 +168,7 @@ build-scripts/create-android-project.py --variant aar com.yourcompany.yourapp <
Customizing your application name Customizing your application name
================================================================================ ================================================================================
To customize your application name, edit AndroidManifest.xml and build.gradle to replace To customize your application name, edit build.gradle to replace
"org.libsdl.app" with an identifier for your product package. "org.libsdl.app" with an identifier for your product package.
Then create a Java class extending SDLActivity and place it in a directory Then create a Java class extending SDLActivity and place it in a directory
@@ -194,6 +194,8 @@ Here's an example of a minimal class file:
Then replace "SDLActivity" in AndroidManifest.xml with the name of your Then replace "SDLActivity" in AndroidManifest.xml with the name of your
class, .e.g. "MyGame" class, .e.g. "MyGame"
Then edit app/src/main/res/values/strings.xml and change the name there.
Customizing your application icon Customizing your application icon
================================================================================ ================================================================================

View File

@@ -346,6 +346,64 @@ all has to live in memory at runtime.
[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html) [Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
gives other options and details, and is worth a read. gives other options and details, and is worth a read.
Please also read the next section on persistent storage, for a little help
from SDL.
## Automount persistent storage
The file tree in Emscripten is provided by MEMFS by default, which stores all
files in RAM. This is often what you want, because it's fast and can be
accessed with the usual synchronous i/o functions like fopen or SDL_IOFromFile.
You can also write files to MEMFS, but when the browser tab goes away, so do
the files. But we want things like high scores, save games, etc, to still
exist if we reload the game later.
For this, Emscripten offers IDBFS, which backs files with the browser's
[IndexedDB](https://en.wikipedia.org/wiki/IndexedDB) functionality.
To use this, the app has to mount the IDBFS filesystem somewhere in the
virtual file tree, and then wait for it to sync up. This needs to be done in
Javascript code. The sync will not complete until at least one (but possibly
several) iterations of the mainloop have passed, which means you can not
access any saved files during main() or SDL_AppInit() by default.
SDL can solve this problem for you: it can be built to automatically mount the
persistent files from IDBFS to a specific place in the file tree and wait
until the sync has completed before calling main() or SDL_AppInit(), so to
your C code, it looks like the files were always available.
To use this functionality, set the CMake variable
`SDL_EMSCRIPTEN_PERSISTENT_PATH` to a path in the filetree where persistent
storage should be mounted:
```bash
mkdir build
cd build
emcmake cmake -DSDL_EMSCRIPTEN_PERSISTENT_PATH=/storage ..
```
You should also link your app with `-lidbfs.js`. If your project links to SDL
using CMake's find_package(SDL3), or uses `pkg-config sdl3 --libs`, this will
be handled for you when used with an SDL built with
`-DSDL_EMSCRIPTEN_PERSISTENT_PATH`.
Now `/storage` will be prepared when your program runs, and SDL_GetPrefPath()
will return a directory under that path. The storage is mounted with the
`autoPersist: true` option, so when you write to that tree, whether with
SDL APIs or other functions like fopen(), Emscripten will know it needs to
sync that data back to the persistent database, and will do so automatically
within the next few iterations of the mainloop.
It's best to assume the sync will take a few frames to complete, and the
data is not safe until it does.
To summarize how to automate this:
- Build with `emcmake cmake -DSDL_EMSCRIPTEN_PERSISTENT_PATH=/storage`
- Link your app with `-lidbfs.js` if not handled automatically.
- Write under `/storage`, or use SDL_GetPrefPath()
## Customizing index.html ## Customizing index.html

View File

@@ -32,7 +32,8 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers
* Single-player games have some additional features available: * Single-player games have some additional features available:
* Call `SDL_GetGDKDefaultUser` to get the default XUserHandle pointer. * Call `SDL_GetGDKDefaultUser` to get the default XUserHandle pointer.
* `SDL_GetPrefPath` still works, but only for single-player titles. * `SDL_GetPrefPath` and `SDL_Storage` still work, but only for single-player titles.
* To enable support for these APIs, use `SDL_SetHint` to set `SDL_GDK_SERVICE_CONFIGURATION_ID` to your SCID string at startup (it should be formatted like `"00000000-0000-0000-0000-000000000000"`)
These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values! These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!

View File

@@ -73,6 +73,7 @@ Embedding the SDL3 Xcode project makes SDL3.framework a target of your app, so i
fi fi
``` ```
3. Below the script entry uncheck the "Run Script:" options "For install builds only" and "Based on dependency analysis" 3. Below the script entry uncheck the "Run Script:" options "For install builds only" and "Based on dependency analysis"
4. Edit the Build Settings and set "User Script Sandboxing" to "No".
TODO: Add information regarding App Store requirements such as icons, etc. TODO: Add information regarding App Store requirements such as icons, etc.
@@ -102,6 +103,19 @@ matrix using the size in points (SDL_GetWindowSize()) can be used in order to
display content at the same scale no matter whether a Retina device is used or not. display content at the same scale no matter whether a Retina device is used or not.
Notes -- Getting full screen resolution
==============================================================================
Make sure that you have a Launch Screen key in your Info.plist, e.g.
```
<key>UILaunchScreen</key>
<dict/>
```
If you don't specify a launch screen, then the OS will assume that your
application needs an older compatibility mode and will get a limited
resolution screen.
Notes -- Application events Notes -- Application events
============================================================================== ==============================================================================

View File

@@ -32,6 +32,10 @@ sudo cmake --install .
Please note that building SDL requires at least Xcode 12.2 and the macOS 11.0 SDK. Please note that building SDL requires at least Xcode 12.2 and the macOS 11.0 SDK.
If you are getting errors building SDL_mfijoystick.m with Xcode 12.2, find your SDKs
directory and move MacOSX10.15.sdk out of the way so it isn't accidentally being used
by the build environment.
To use the library once it's built, you essential have two possibilities: To use the library once it's built, you essential have two possibilities:
use the traditional autoconf/automake/make method, or use Xcode. use the traditional autoconf/automake/make method, or use Xcode.

View File

@@ -1,5 +1,5 @@
/* /*
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -44,6 +44,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
return SDL_APP_FAILURE; return SDL_APP_FAILURE;
} else if (devcount == 0) { } else if (devcount == 0) {
SDL_Log("Couldn't find any camera devices! Please connect a camera and try again."); SDL_Log("Couldn't find any camera devices! Please connect a camera and try again.");
SDL_free(devices);
return SDL_APP_FAILURE; return SDL_APP_FAILURE;
} }

View File

@@ -40,14 +40,14 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
/* Textures are pixel data that we upload to the video hardware for fast drawing. Lots of 2D /* Textures are pixel data that we upload to the video hardware for fast drawing. Lots of 2D
engines refer to these as "sprites." We'll do a static texture (upload once, draw many engines refer to these as "sprites." We'll do a static texture (upload once, draw many
times) with data from a bitmap file. */ times) with data from a png file. */
/* SDL_Surface is pixel data the CPU can access. SDL_Texture is pixel data the GPU can access. /* SDL_Surface is pixel data the CPU can access. SDL_Texture is pixel data the GPU can access.
Load a .png into a surface, move it to a texture from there. */ Load a .png into a surface, move it to a texture from there. */
SDL_asprintf(&png_path, "%ssample.png", SDL_GetBasePath()); /* allocate a string of the full file path */ SDL_asprintf(&png_path, "%ssample.png", SDL_GetBasePath()); /* allocate a string of the full file path */
surface = SDL_LoadPNG(png_path); surface = SDL_LoadPNG(png_path);
if (!surface) { if (!surface) {
SDL_Log("Couldn't load bitmap: %s", SDL_GetError()); SDL_Log("Couldn't load png: %s", SDL_GetError());
return SDL_APP_FAILURE; return SDL_APP_FAILURE;
} }

View File

@@ -66,7 +66,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
/* To update a streaming texture, you need to lock it first. This gets you access to the pixels. /* To update a streaming texture, you need to lock it first. This gets you access to the pixels.
Note that this is considered a _write-only_ operation: the buffer you get from locking Note that this is considered a _write-only_ operation: the buffer you get from locking
might not acutally have the existing contents of the texture, and you have to write to every might not actually have the existing contents of the texture, and you have to write to every
locked pixel! */ locked pixel! */
/* You can use SDL_LockTexture() to get an array of raw pixels, but we're going to use /* You can use SDL_LockTexture() to get an array of raw pixels, but we're going to use

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -92,7 +92,7 @@
#output-container:hover, #output-container:hover,
#output-container:focus-within { #output-container:focus-within {
top: 50%; top: 20%;
} }
#output-container:focus-within { #output-container:focus-within {
@@ -151,7 +151,7 @@
#source-code:hover, #source-code:hover,
#source-code:focus-within { #source-code:focus-within {
top: 50%; top: 20%;
} }
#source-code:focus-within { #source-code:focus-within {
@@ -241,7 +241,7 @@
return function(text) { return function(text) {
var elem = document.getElementById('output-container'); var elem = document.getElementById('output-container');
if (elem.style['top'] == '') { if (elem.style['top'] == '') {
elem.style['top'] = '50%'; elem.style['top'] = '20%';
setTimeout(function() { elem.style['top'] = ''; }, 3000); setTimeout(function() { elem.style['top'] = ''; }, 3000);
} }

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -20,7 +20,7 @@
*/ */
/** /**
* Main include header for the SDL library, version 3.4.0 * Main include header for the SDL library, version 3.4.6
* *
* It is almost always best to include just this one header instead of * It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to * picking out individual headers included here. There are exceptions to

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -136,7 +136,7 @@ extern "C" {
#define SDL_TriggerBreakpoint() __builtin_debugtrap() #define SDL_TriggerBreakpoint() __builtin_debugtrap()
#elif SDL_HAS_BUILTIN(__builtin_trap) #elif SDL_HAS_BUILTIN(__builtin_trap)
#define SDL_TriggerBreakpoint() __builtin_trap() #define SDL_TriggerBreakpoint() __builtin_trap()
#elif (defined(__GNUC__) || defined(__clang__) || defined(__TINYC__)) && (defined(__i386__) || defined(__x86_64__)) #elif (defined(__GNUC__) || defined(__clang__) || defined(__TINYC__) || defined(__slimcc__)) && (defined(__i386__) || defined(__x86_64__))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv) #elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" ) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
@@ -160,7 +160,7 @@ extern "C" {
#ifdef SDL_WIKI_DOCUMENTATION_SECTION #ifdef SDL_WIKI_DOCUMENTATION_SECTION
/** /**
* A macro that reports the current function being compiled. * A constant that contains the current function being compiled.
* *
* If SDL can't figure how the compiler reports this, it will use "???". * If SDL can't figure how the compiler reports this, it will use "???".
* *
@@ -168,13 +168,15 @@ extern "C" {
*/ */
#define SDL_FUNCTION __FUNCTION__ #define SDL_FUNCTION __FUNCTION__
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ #elif !defined(SDL_FUNCTION)
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
# define SDL_FUNCTION __func__ # define SDL_FUNCTION __func__
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__)) #elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
# define SDL_FUNCTION __FUNCTION__ # define SDL_FUNCTION __FUNCTION__
#else #else
# define SDL_FUNCTION "???" # define SDL_FUNCTION "???"
#endif #endif
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION #ifdef SDL_WIKI_DOCUMENTATION_SECTION

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -213,6 +213,8 @@ typedef struct SDL_AsyncIOQueue SDL_AsyncIOQueue;
* \returns a pointer to the SDL_AsyncIO structure that is created or NULL on * \returns a pointer to the SDL_AsyncIO structure that is created or NULL on
* failure; call SDL_GetError() for more information. * failure; call SDL_GetError() for more information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_CloseAsyncIO * \sa SDL_CloseAsyncIO
@@ -531,6 +533,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue)
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LoadFile_IO * \sa SDL_LoadFile_IO

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -156,6 +156,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
*/ */
#define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier() #define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier()
#elif SDL_HAS_BUILTIN(__atomic_signal_fence) || (defined(__GNUC__) && (__GNUC__ >= 5))
#define SDL_CompilerBarrier() __atomic_signal_fence(__ATOMIC_SEQ_CST)
#elif defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__) #elif defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
void _ReadWriteBarrier(void); void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier) #pragma intrinsic(_ReadWriteBarrier)
@@ -167,8 +169,9 @@ void _ReadWriteBarrier(void);
extern __inline void SDL_CompilerBarrier(void); extern __inline void SDL_CompilerBarrier(void);
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact []; #pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
#else #else
/* We don't unlock here to avoid possible infinite recursion */
#define SDL_CompilerBarrier() \ #define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); SDL_UnlockSpinlock(&_tmp); } { SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); }
#endif #endif
/** /**
@@ -275,12 +278,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
*/ */
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() #define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
#elif SDL_HAS_BUILTIN(__atomic_thread_fence) || (defined(__GNUC__) && (__GNUC__ >= 5))
#define SDL_MemoryBarrierRelease() __atomic_thread_fence(__ATOMIC_RELEASE)
#define SDL_MemoryBarrierAcquire() __atomic_thread_fence(__ATOMIC_ACQUIRE)
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
#elif defined(__GNUC__) && defined(__aarch64__) #elif defined(__GNUC__) && defined(__aarch64__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ishld" : : : "memory")
#elif defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
#include <arm64intr.h>
#define SDL_MemoryBarrierRelease() __dmb(_ARM64_BARRIER_ISH)
#define SDL_MemoryBarrierAcquire() __dmb(_ARM64_BARRIER_ISHLD)
#elif defined(__GNUC__) && defined(__arm__) #elif defined(__GNUC__) && defined(__arm__)
#if 0 /* defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID) */ #if 0 /* defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID) */
/* Information from: /* Information from:

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -1349,7 +1349,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
* *
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_SetAudioStreamInputChannelMap * \sa SDL_SetAudioStreamOutputChannelMap
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -469,7 +469,7 @@
#define NULL ((void *)0) #define NULL ((void *)0)
#endif #endif
#endif /* NULL */ #endif /* NULL */
#endif /* ! macOS - breaks precompiled headers */ #endif /* __MACH__ */
#ifndef SDL_FALLTHROUGH #ifndef SDL_FALLTHROUGH
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \ #if (defined(__cplusplus) && __cplusplus >= 201703L) || \

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -48,8 +48,7 @@ extern __inline int _SDL_bsr_watcom(Uint32);
/** /**
* Get the index of the most significant (set) bit in a 32-bit number. * Get the index of the most significant (set) bit in a 32-bit number.
* *
* Result is undefined when called with 0. This operation can also be stated * This operation can also be stated as "count leading zeroes" and "log base 2".
* as "count leading zeroes" and "log base 2".
* *
* Note that this is a forced-inline function in a header, and not a public * Note that this is a forced-inline function in a header, and not a public
* API function available in the SDL library (which is to say, the code is * API function available in the SDL library (which is to say, the code is

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -252,7 +252,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
* \sa SDL_GetClipboardData * \sa SDL_GetClipboardData
* \sa SDL_HasClipboardData * \sa SDL_HasClipboardData
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types); extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char *const *mime_types, size_t num_mime_types);
/** /**
* Clear the clipboard data. * Clear the clipboard data.

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -46,7 +46,7 @@
#if defined(_MSC_VER) && (_MSC_VER >= 1400) #if defined(_MSC_VER) && (_MSC_VER >= 1400)
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, /* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
#if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch) #if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch)
#ifndef __PRFCHWINTRIN_H #ifndef __PRFCHWINTRIN_H
#define __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H
static __inline__ void __attribute__((__always_inline__, __nodebug__)) static __inline__ void __attribute__((__always_inline__, __nodebug__))
@@ -208,7 +208,7 @@ _m_prefetch(void *__P)
#else #else
/* By default, assume that floats words follow the memory system mode. */ /* By default, assume that floats words follow the memory system mode. */
#define SDL_FLOATWORDORDER SDL_BYTEORDER #define SDL_FLOATWORDORDER SDL_BYTEORDER
#endif /* __FLOAT_WORD_ORDER__ */ #endif /* SDL_WIKI_DOCUMENTATION_SECTION */
#endif /* !SDL_FLOATWORDORDER */ #endif /* !SDL_FLOATWORDORDER */

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -1256,15 +1256,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType)
* Poll for currently pending events. * Poll for currently pending events.
* *
* If `event` is not NULL, the next event is removed from the queue and stored * If `event` is not NULL, the next event is removed from the queue and stored
* in the SDL_Event structure pointed to by `event`. The 1 returned refers to * in the SDL_Event structure pointed to by `event`.
* this event, immediately stored in the SDL Event structure -- not an event
* to follow.
* *
* If `event` is NULL, it simply returns 1 if there is an event in the queue, * If `event` is NULL, it simply returns true if there is an event in the
* but will not remove it from the queue. * queue, but will not remove it from the queue.
* *
* As this function may implicitly call SDL_PumpEvents(), you can only call * As this function may implicitly call SDL_PumpEvents(), you can only call
* this function in the thread that set the video mode. * this function in the thread that initialized the video subsystem.
* *
* SDL_PollEvent() is the favored way of receiving system events since it can * SDL_PollEvent() is the favored way of receiving system events since it can
* be done from the main loop and does not suspend the main loop while waiting * be done from the main loop and does not suspend the main loop while waiting

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -241,9 +241,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetUserFolder(SDL_Folder folder);
/** /**
* Types of filesystem entries. * Types of filesystem entries.
* *
* Note that there may be other sorts of items on a filesystem: devices, * Note that there may be other sorts of items on a filesystem: devices, named
* symlinks, named pipes, etc. They are currently reported as * pipes, etc. They are currently reported as SDL_PATHTYPE_OTHER.
* SDL_PATHTYPE_OTHER.
* *
* \since This enum is available since SDL 3.2.0. * \since This enum is available since SDL 3.2.0.
* *
@@ -457,6 +456,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_CopyFile(const char *oldpath, const char *n
/** /**
* Get information about a filesystem path. * Get information about a filesystem path.
* *
* Symlinks, on filesystems that support them, are always followed, so you
* will always get information on what the symlink eventually points to, and
* not the symlink itself.
*
* \param path the path to query. * \param path the path to query.
* \param info a pointer filled in with information about the path, or NULL to * \param info a pointer filled in with information about the path, or NULL to
* check for the existence of a file. * check for the existence of a file.

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -1398,11 +1398,12 @@ typedef struct SDL_GPUViewport
* SDL_DownloadFromGPUTexture are used as default values respectively and data * SDL_DownloadFromGPUTexture are used as default values respectively and data
* is considered to be tightly packed. * is considered to be tightly packed.
* *
* **WARNING**: Direct3D 12 requires texture data row pitch to be 256 byte * **WARNING**: On some older/integrated hardware, Direct3D 12 requires
* aligned, and offsets to be aligned to 512 bytes. If they are not, SDL will * texture data row pitch to be 256 byte aligned, and offsets to be aligned to
* make a temporary copy of the data that is properly aligned, but this adds * 512 bytes. If they are not, SDL will make a temporary copy of the data that
* overhead to the transfer process. Apps can avoid this by aligning their * is properly aligned, but this adds overhead to the transfer process. Apps
* data appropriately, or using a different GPU backend than Direct3D 12. * can avoid this by aligning their data appropriately, or using a different
* GPU backend than Direct3D 12.
* *
* \since This struct is available since SDL 3.2.0. * \since This struct is available since SDL 3.2.0.
* *
@@ -2306,6 +2307,21 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
* useful for targeting Intel Haswell and Broadwell GPUs; other hardware * useful for targeting Intel Haswell and Broadwell GPUs; other hardware
* either supports Tier 2 Resource Binding or does not support D3D12 in any * either supports Tier 2 Resource Binding or does not support D3D12 in any
* capacity. Defaults to false. * capacity. Defaults to false.
* - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER`: Certain
* feature checks are only possible on Windows 11 by default. By setting
* this alongside `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING`
* and vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make
* those feature checks possible on older platforms. The version you provide
* must match the one given in the DLL.
* - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING`: Certain
* feature checks are only possible on Windows 11 by default. By setting
* this alongside
* `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER` and
* vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make those
* feature checks possible on older platforms. The path you provide must be
* relative to the executable path of your app. Be sure not to put the DLL
* in the same directory as the exe; Microsoft strongly advises against
* this!
* *
* With the Vulkan backend: * With the Vulkan backend:
* *
@@ -2321,6 +2337,15 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
* increasing the API version and opting into extensions aside from the * increasing the API version and opting into extensions aside from the
* minimal set SDL requires. * minimal set SDL requires.
* *
* With the Metal backend: -
* `SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN`: By default,
* macOS support requires what Apple calls "MTLGPUFamilyMac2" hardware or
* newer. However, an application can set this property to true to enable
* support for "MTLGPUFamilyMac1" hardware, if (and only if) the application
* does not write to sRGB textures. (For history's sake: MacFamily1 also does
* not support indirect command buffers, MSAA depth resolve, and stencil
* resolve/feedback, but these are not exposed features in SDL_GPU.)
*
* \param props the properties to use. * \param props the properties to use.
* \returns a GPU context on success or NULL on failure; call SDL_GetError() * \returns a GPU context on success or NULL on failure; call SDL_GetError()
* for more information. * for more information.
@@ -2351,8 +2376,11 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDeviceWithProperties(
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN "SDL.gpu.device.create.shaders.metallib" #define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN "SDL.gpu.device.create.shaders.metallib"
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN "SDL.gpu.device.create.d3d12.allowtier1resourcebinding" #define SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN "SDL.gpu.device.create.d3d12.allowtier1resourcebinding"
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic" #define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"
#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN "SDL.gpu.device.create.vulkan.requirehardwareacceleration" #define SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER "SDL.gpu.device.create.d3d12.agility_sdk_version"
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING "SDL.gpu.device.create.d3d12.agility_sdk_path"
#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN "SDL.gpu.device.create.vulkan.requirehardwareacceleration"
#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER "SDL.gpu.device.create.vulkan.options" #define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER "SDL.gpu.device.create.vulkan.options"
#define SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN "SDL.gpu.device.create.metal.allowmacfamily1"
/** /**

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -1392,7 +1392,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_RunHapticEffect * \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects * \sa SDL_StopHapticEffect
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic); extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -402,6 +402,11 @@ extern "C" {
* - "Movie" - Music or sound with dialog * - "Movie" - Music or sound with dialog
* - "Media" - Music or sound without dialog * - "Media" - Music or sound without dialog
* *
* Android's AAudio target supports this hint as of SDL 3.4.4. Android does
* not support the exact same options as WASAPI, but for portability, will
* attempt to map these same strings to the `aaudio_usage_t` constants. For
* example, "Movie" and "Media" will both map to `AAUDIO_USAGE_MEDIA`, etc.
*
* If your application applies its own echo cancellation, gain control, and * If your application applies its own echo cancellation, gain control, and
* noise reduction it should also set SDL_HINT_AUDIO_DEVICE_RAW_STREAM. * noise reduction it should also set SDL_HINT_AUDIO_DEVICE_RAW_STREAM.
* *
@@ -1095,7 +1100,7 @@ extern "C" {
* *
* This hint should be set before SDL is initialized. * This hint should be set before SDL is initialized.
* *
* \since This hint is available since SDL 3.2.0. * \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_HIDAPI_LIBUSB_GAMECUBE "SDL_HIDAPI_LIBUSB_GAMECUBE" #define SDL_HINT_HIDAPI_LIBUSB_GAMECUBE "SDL_HIDAPI_LIBUSB_GAMECUBE"
@@ -1407,6 +1412,26 @@ extern "C" {
*/ */
#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT" #define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT"
/**
* A variable controlling whether GameInput should be used for handling
* GIP devices that require raw report processing, but aren't supported
* by HIDRAW, such as Xbox One Guitars.
*
* Note that this is only supported with GameInput 3 or newer.
*
* The variable can be set to the following values:
*
* - "0": GameInput is not used to handle raw GIP devices.
* - "1": GameInput is used.
*
* The default is "1" when using GameInput 3 or newer, and is "0" otherwise.
*
* This hint should be set before SDL is initialized.
*
* \since This hint is available since SDL 3.4.4.
*/
#define SDL_HINT_JOYSTICK_GAMEINPUT_RAW "SDL_JOYSTICK_GAMEINPUT_RAW"
/** /**
* A variable containing a list of devices known to have a GameCube form * A variable containing a list of devices known to have a GameCube form
* factor. * factor.
@@ -1778,10 +1803,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for HORI licensed Steam * A variable controlling whether the HIDAPI driver for HORI licensed Steam
* controllers should be used. * controllers should be used.
* *
* This variable can be set to the following values: "0" - HIDAPI driver is * The variable can be set to the following values:
* not used "1" - HIDAPI driver is used
* *
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI * - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.2.0.
*/ */
#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI "SDL_JOYSTICK_HIDAPI_STEAM_HORI" #define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI "SDL_JOYSTICK_HIDAPI_STEAM_HORI"
@@ -1789,12 +1820,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for some Logitech wheels * A variable controlling whether the HIDAPI driver for some Logitech wheels
* should be used. * should be used.
* *
* This variable can be set to the following values: * The variable can be set to the following values:
* *
* - "0": HIDAPI driver is not used * - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used * - "1": HIDAPI driver is used.
* *
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI * The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_JOYSTICK_HIDAPI_LG4FF "SDL_JOYSTICK_HIDAPI_LG4FF" #define SDL_HINT_JOYSTICK_HIDAPI_LG4FF "SDL_JOYSTICK_HIDAPI_LG4FF"
@@ -1802,11 +1837,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for 8BitDo controllers * A variable controlling whether the HIDAPI driver for 8BitDo controllers
* should be used. * should be used.
* *
* This variable can be set to the following values: * The variable can be set to the following values:
* *
* "0" - HIDAPI driver is not used. "1" - HIDAPI driver is used. * - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
* *
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI * The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_JOYSTICK_HIDAPI_8BITDO "SDL_JOYSTICK_HIDAPI_8BITDO" #define SDL_HINT_JOYSTICK_HIDAPI_8BITDO "SDL_JOYSTICK_HIDAPI_8BITDO"
@@ -1816,11 +1856,16 @@ extern "C" {
* *
* More info - https://github.com/HandHeldLegend/SInput-HID * More info - https://github.com/HandHeldLegend/SInput-HID
* *
* This variable can be set to the following values: * The variable can be set to the following values:
* *
* "0" - HIDAPI driver is not used. "1" - HIDAPI driver is used. * - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
* *
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI * The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_JOYSTICK_HIDAPI_SINPUT "SDL_JOYSTICK_HIDAPI_SINPUT" #define SDL_HINT_JOYSTICK_HIDAPI_SINPUT "SDL_JOYSTICK_HIDAPI_SINPUT"
@@ -1828,11 +1873,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for ZUIKI controllers * A variable controlling whether the HIDAPI driver for ZUIKI controllers
* should be used. * should be used.
* *
* This variable can be set to the following values: * The variable can be set to the following values:
* *
* "0" - HIDAPI driver is not used. "1" - HIDAPI driver is used. * - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
* *
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI * The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_JOYSTICK_HIDAPI_ZUIKI "SDL_JOYSTICK_HIDAPI_ZUIKI" #define SDL_HINT_JOYSTICK_HIDAPI_ZUIKI "SDL_JOYSTICK_HIDAPI_ZUIKI"
@@ -1840,11 +1890,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for Flydigi controllers * A variable controlling whether the HIDAPI driver for Flydigi controllers
* should be used. * should be used.
* *
* This variable can be set to the following values: * The variable can be set to the following values:
* *
* "0" - HIDAPI driver is not used. "1" - HIDAPI driver is used. * - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
* *
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI * The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI "SDL_JOYSTICK_HIDAPI_FLYDIGI" #define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI "SDL_JOYSTICK_HIDAPI_FLYDIGI"
@@ -2619,8 +2674,8 @@ extern "C" {
* *
* The variable can be set to the following values: * The variable can be set to the following values:
* *
* - "0": Holding a key will open the accents menu for that key. * - "0": Holding a key will repeat the pressed key.
* - "1": Holding a key will repeat the pressed key. (default) * - "1": Holding a key will open the accents menu for that key. (default)
* *
* This hint needs to be set before SDL_Init(). * This hint needs to be set before SDL_Init().
* *
@@ -2717,7 +2772,7 @@ extern "C" {
* (default) * (default)
* - "1": Cursors will automatically match the display content scale (e.g. a * - "1": Cursors will automatically match the display content scale (e.g. a
* 2x sized cursor will be used when the window is on a monitor with 200% * 2x sized cursor will be used when the window is on a monitor with 200%
* scale). This is currently implemented on Windows and Wayland. * scale). This is currently implemented on Windows.
* *
* This hint needs to be set before creating cursors. * This hint needs to be set before creating cursors.
* *
@@ -2976,6 +3031,46 @@ extern "C" {
*/ */
#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" #define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER"
/**
* A variable controlling whether to force an sRGB-capable OpenGL context.
*
* At OpenGL context creation time, some platforms can request an sRGB-capable
* context. However, sometimes any form of the request can cause surprising
* results on some drivers, platforms, and hardware. Usually the surprise is
* in the form of rendering that is either a little darker or a little
* brighter than intended.
*
* This hint allows the user to override the app's sRGB requests and either
* force a specific value, or avoid requesting anything at all, depending on
* what makes things work correctly for their system.
*
* This is meant as a fail-safe; apps should probably not explicitly set this,
* and most users should not, either.
*
* Note that some platforms cannot make this request at all, and on all
* platforms this request can be denied by the operating system.
*
* In addition to attempting to obtain the type of sRGB-capable OpenGL context
* requested by this hint, SDL will try to force the state of
* GL_FRAMEBUFFER_SRGB on the new context, if appropriate.
*
* The variable can be set to the following values:
*
* - "0": Force a request for an OpenGL context that is _not_ sRGB-capable.
* - "1": Force a request for an OpenGL context that _is_ sRGB-capable.
* - "skip": Don't make any request for an sRGB-capable context (don't specify
* the attribute at all during context creation time).
* - any other string is undefined behavior.
*
* If unset, or set to an empty string, SDL will make a request using the
* value the app specified with the SDL_GL_FRAMEBUFFER_SRGB_CAPABLE attribute.
*
* This hint should be set before an OpenGL context is created.
*
* \since This hint is available since SDL 3.4.2.
*/
#define SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER "SDL_OPENGL_FORCE_SRGB_FRAMEBUFFER"
/** /**
* Mechanism to specify openvr_api library location * Mechanism to specify openvr_api library location
* *
@@ -3300,33 +3395,45 @@ extern "C" {
#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED" #define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED"
/** /**
* Variable controlling the width of the PS2's framebuffer in pixels * A variable controlling the width of the PS2's framebuffer in pixels.
* *
* By default, this variable is "640" * By default, the variable is "640".
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_PS2_GS_WIDTH "SDL_PS2_GS_WIDTH" #define SDL_HINT_PS2_GS_WIDTH "SDL_PS2_GS_WIDTH"
/** /**
* Variable controlling the height of the PS2's framebuffer in pixels * A variable controlling the height of the PS2's framebuffer in pixels.
* *
* By default, this variable is "448" * By default, the variable is "448".
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_PS2_GS_HEIGHT "SDL_PS2_GS_HEIGHT" #define SDL_HINT_PS2_GS_HEIGHT "SDL_PS2_GS_HEIGHT"
/** /**
* Variable controlling whether the signal is interlaced or progressive * A variable controlling whether the signal is interlaced or progressive.
*
* The variable can be set to the following values:
* *
* - "0": Image is interlaced. (default) * - "0": Image is interlaced. (default)
* - "1": Image is progressive * - "1": Image is progressive.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_PS2_GS_PROGRESSIVE "SDL_PS2_GS_PROGRESSIVE" #define SDL_HINT_PS2_GS_PROGRESSIVE "SDL_PS2_GS_PROGRESSIVE"
/** /**
* Variable controlling the video mode of the console * A variable controlling the video mode of the console.
*
* The variable can be set to the following values:
* *
* - "": Console-native. (default) * - "": Console-native. (default)
* - "NTSC": 60hz region * - "NTSC": 60hz region.
* - "PAL": 50hz region * - "PAL": 50hz region.
*
* \since This hint is available since SDL 3.4.0.
*/ */
#define SDL_HINT_PS2_GS_MODE "SDL_PS2_GS_MODE" #define SDL_HINT_PS2_GS_MODE "SDL_PS2_GS_MODE"
@@ -4436,6 +4543,23 @@ extern "C" {
*/ */
#define SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS" #define SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS"
/**
* A variable controlling whether the RIDEV_INPUTSINK flag is set when
* enabling Windows raw keyboard events.
*
* This enables the window to still receive input even if not in foreground.
*
* Focused windows that receive text input will still prevent input events from triggering.
*
* - "0": Input is not received when not in focus or foreground. (default)
* - "1": Input will be received even when not in focus or foreground.
*
* This hint can be set anytime.
*
* \since This hint is available since SDL 3.4.4.
*/
#define SDL_HINT_WINDOWS_RAW_KEYBOARD_INPUTSINK "SDL_WINDOWS_RAW_KEYBOARD_INPUTSINK"
/** /**
* A variable controlling whether SDL uses Kernel Semaphores on Windows. * A variable controlling whether SDL uses Kernel Semaphores on Windows.
* *
@@ -4766,7 +4890,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetHintBoolean(const char *name, bool defau
* A callback used to send notifications of hint value changes. * A callback used to send notifications of hint value changes.
* *
* This is called an initial time during SDL_AddHintCallback with the hint's * This is called an initial time during SDL_AddHintCallback with the hint's
* current value, and then again each time the hint's value changes. * current value, and then again each time the hint's value changes. In the
* initial call, the current value is in both `oldValue` and `newValue`.
* *
* \param userdata what was passed as `userdata` to SDL_AddHintCallback(). * \param userdata what was passed as `userdata` to SDL_AddHintCallback().
* \param name what was passed as `name` to SDL_AddHintCallback(). * \param name what was passed as `name` to SDL_AddHintCallback().

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -224,6 +224,8 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate, SDL_AppResult result);
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_SetAppMetadata * \sa SDL_SetAppMetadata
@@ -244,6 +246,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_Init(SDL_InitFlags flags);
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_Init * \sa SDL_Init
@@ -260,6 +264,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
* *
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details. * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_InitSubSystem * \sa SDL_InitSubSystem
@@ -274,6 +280,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_QuitSubSystem(SDL_InitFlags flags);
* \returns a mask of all initialized subsystems if `flags` is 0, otherwise it * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
* returns the initialization status of the specified subsystems. * returns the initialization status of the specified subsystems.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_Init * \sa SDL_Init
@@ -292,6 +300,8 @@ extern SDL_DECLSPEC SDL_InitFlags SDLCALL SDL_WasInit(SDL_InitFlags flags);
* application is shutdown, but it is not wise to do this from a library or * application is shutdown, but it is not wise to do this from a library or
* other dynamically loaded code. * other dynamically loaded code.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_Init * \sa SDL_Init

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -217,9 +217,9 @@
/* Need to do this here because intrin.h has C++ code in it */ /* Need to do this here because intrin.h has C++ code in it */
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
#ifdef __clang__
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, /* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
#if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch)
#ifndef __PRFCHWINTRIN_H #ifndef __PRFCHWINTRIN_H
#define __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H
static __inline__ void __attribute__((__always_inline__, __nodebug__)) static __inline__ void __attribute__((__always_inline__, __nodebug__))

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -102,6 +102,8 @@ typedef struct SDL_Locale
* allocation that should be freed with SDL_free() when it is no * allocation that should be freed with SDL_free() when it is no
* longer needed. * longer needed.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC SDL_Locale ** SDLCALL SDL_GetPreferredLocales(int *count); extern SDL_DECLSPEC SDL_Locale ** SDLCALL SDL_GetPreferredLocales(int *count);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -487,7 +487,8 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
/** /**
* Get the default log output function. * Get the default log output function.
* *
* \returns the default log output callback. * \returns the default log output callback. It should be called with NULL for
* the userdata argument.
* *
* \threadsafety It is safe to call this function from any thread. * \threadsafety It is safe to call this function from any thread.
* *

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -257,7 +257,7 @@
#else #else
/* usually this is empty */ /* usually this is empty */
#define SDLMAIN_DECLSPEC #define SDLMAIN_DECLSPEC
#endif /* SDL_MAIN_EXPORTED */ #endif /* SDL_WIKI_DOCUMENTATION_SECTION */
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) || defined(SDL_MAIN_USE_CALLBACKS) #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) || defined(SDL_MAIN_USE_CALLBACKS)
#define main SDL_main #define main SDL_main
@@ -333,6 +333,9 @@ extern "C" {
* \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
* terminate with success, SDL_APP_CONTINUE to continue. * terminate with success, SDL_APP_CONTINUE to continue.
* *
* \threadsafety This function is called once by SDL, at startup, on a single
* thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_AppIterate * \sa SDL_AppIterate
@@ -537,6 +540,8 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_main(int argc, char *argv[]);
* will not be changed it is necessary to define SDL_MAIN_HANDLED before * will not be changed it is necessary to define SDL_MAIN_HANDLED before
* including SDL.h. * including SDL.h.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_Init * \sa SDL_Init
@@ -629,6 +634,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[]
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
@@ -646,6 +653,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style,
* deregistered when the registration counter in SDL_RegisterApp decrements to * deregistered when the registration counter in SDL_RegisterApp decrements to
* zero through calls to this function. * zero through calls to this function.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void); extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
@@ -655,10 +664,26 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
/** /**
* Callback from the application to let the suspend continue. * Callback from the application to let the suspend continue.
* *
* This should be called from an event watch in response to an
* `SDL_EVENT_DID_ENTER_BACKGROUND` event.
*
* When using SDL_Render, your event watch should be added _after_ creating
* the `SDL_Renderer`; this allows the timing of the D3D12 command queue
* suspension to execute in the correct order.
*
* When using SDL_GPU, this should be called after calling SDL_GDKSuspendGPU.
*
* If you're writing your own D3D12 renderer, this should be called after
* calling `ID3D12CommandQueue::SuspendX`.
*
* This function is only needed for Xbox GDK support; all other platforms will * This function is only needed for Xbox GDK support; all other platforms will
* do nothing and set an "unsupported" error message. * do nothing and set an "unsupported" error message.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*
* \sa SDL_AddEventWatch
*/ */
extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -168,6 +168,8 @@ typedef struct SDL_MessageBoxData
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_ShowSimpleMessageBox * \sa SDL_ShowSimpleMessageBox
@@ -210,6 +212,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *me
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_ShowMessageBox * \sa SDL_ShowMessageBox

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -65,6 +65,8 @@ typedef void *SDL_MetalView;
* \param window the window. * \param window the window.
* \returns handle NSView or UIView. * \returns handle NSView or UIView.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_Metal_DestroyView * \sa SDL_Metal_DestroyView
@@ -80,6 +82,8 @@ extern SDL_DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window *windo
* *
* \param view the SDL_MetalView object. * \param view the SDL_MetalView object.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_Metal_CreateView * \sa SDL_Metal_CreateView
@@ -92,6 +96,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
* \param view the SDL_MetalView object. * \param view the SDL_MetalView object.
* \returns a pointer. * \returns a pointer.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC void * SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); extern SDL_DECLSPEC void * SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -65,6 +65,8 @@ extern "C" {
* \returns true on success or false on failure; call SDL_GetError() for more * \returns true on success or false on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url); extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -308,6 +308,8 @@ typedef struct SDL_Mutex SDL_Mutex;
* \returns the initialized and unlocked mutex or NULL on failure; call * \returns the initialized and unlocked mutex or NULL on failure; call
* SDL_GetError() for more information. * SDL_GetError() for more information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_DestroyMutex * \sa SDL_DestroyMutex
@@ -334,6 +336,8 @@ extern SDL_DECLSPEC SDL_Mutex * SDLCALL SDL_CreateMutex(void);
* *
* \param mutex the mutex to lock. * \param mutex the mutex to lock.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_TryLockMutex * \sa SDL_TryLockMutex
@@ -355,6 +359,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mut
* \param mutex the mutex to try to lock. * \param mutex the mutex to try to lock.
* \returns true on success, false if the mutex would block. * \returns true on success, false if the mutex would block.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockMutex * \sa SDL_LockMutex
@@ -374,6 +380,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQU
* *
* \param mutex the mutex to unlock. * \param mutex the mutex to unlock.
* *
* \threadsafety This call must be paired with a previous locking call on the
* same thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockMutex * \sa SDL_LockMutex
@@ -392,6 +401,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(m
* *
* \param mutex the mutex to destroy. * \param mutex the mutex to destroy.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_CreateMutex * \sa SDL_CreateMutex
@@ -457,6 +468,8 @@ typedef struct SDL_RWLock SDL_RWLock;
* \returns the initialized and unlocked read/write lock or NULL on failure; * \returns the initialized and unlocked read/write lock or NULL on failure;
* call SDL_GetError() for more information. * call SDL_GetError() for more information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_DestroyRWLock * \sa SDL_DestroyRWLock
@@ -497,6 +510,8 @@ extern SDL_DECLSPEC SDL_RWLock * SDLCALL SDL_CreateRWLock(void);
* *
* \param rwlock the read/write lock to lock. * \param rwlock the read/write lock to lock.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockRWLockForWriting * \sa SDL_LockRWLockForWriting
@@ -528,6 +543,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SD
* *
* \param rwlock the read/write lock to lock. * \param rwlock the read/write lock to lock.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockRWLockForReading * \sa SDL_LockRWLockForReading
@@ -553,6 +570,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
* \param rwlock the rwlock to try to lock. * \param rwlock the rwlock to try to lock.
* \returns true on success, false if the lock would block. * \returns true on success, false if the lock would block.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockRWLockForReading * \sa SDL_LockRWLockForReading
@@ -583,6 +602,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
* \param rwlock the rwlock to try to lock. * \param rwlock the rwlock to try to lock.
* \returns true on success, false if the lock would block. * \returns true on success, false if the lock would block.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockRWLockForWriting * \sa SDL_LockRWLockForWriting
@@ -607,6 +628,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
* *
* \param rwlock the rwlock to unlock. * \param rwlock the rwlock to unlock.
* *
* \threadsafety This call must be paired with a previous locking call on the
* same thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_LockRWLockForReading * \sa SDL_LockRWLockForReading
@@ -627,6 +651,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEAS
* *
* \param rwlock the rwlock to destroy. * \param rwlock the rwlock to destroy.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_CreateRWLock * \sa SDL_CreateRWLock
@@ -670,6 +696,8 @@ typedef struct SDL_Semaphore SDL_Semaphore;
* \returns a new semaphore or NULL on failure; call SDL_GetError() for more * \returns a new semaphore or NULL on failure; call SDL_GetError() for more
* information. * information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_DestroySemaphore * \sa SDL_DestroySemaphore
@@ -689,6 +717,8 @@ extern SDL_DECLSPEC SDL_Semaphore * SDLCALL SDL_CreateSemaphore(Uint32 initial_v
* *
* \param sem the semaphore to destroy. * \param sem the semaphore to destroy.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_CreateSemaphore * \sa SDL_CreateSemaphore
@@ -707,6 +737,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
* *
* \param sem the semaphore wait on. * \param sem the semaphore wait on.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_SignalSemaphore * \sa SDL_SignalSemaphore
@@ -726,6 +758,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
* \param sem the semaphore to wait on. * \param sem the semaphore to wait on.
* \returns true if the wait succeeds, false if the wait would block. * \returns true if the wait succeeds, false if the wait would block.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_SignalSemaphore * \sa SDL_SignalSemaphore
@@ -746,6 +780,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
* indefinitely. * indefinitely.
* \returns true if the wait succeeds or false if the wait times out. * \returns true if the wait succeeds or false if the wait times out.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_SignalSemaphore * \sa SDL_SignalSemaphore
@@ -759,6 +795,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Si
* *
* \param sem the semaphore to increment. * \param sem the semaphore to increment.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_TryWaitSemaphore * \sa SDL_TryWaitSemaphore
@@ -773,6 +811,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SignalSemaphore(SDL_Semaphore *sem);
* \param sem the semaphore to query. * \param sem the semaphore to query.
* \returns the current value of the semaphore. * \returns the current value of the semaphore.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem); extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem);
@@ -806,6 +846,8 @@ typedef struct SDL_Condition SDL_Condition;
* \returns a new condition variable or NULL on failure; call SDL_GetError() * \returns a new condition variable or NULL on failure; call SDL_GetError()
* for more information. * for more information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_BroadcastCondition * \sa SDL_BroadcastCondition
@@ -821,6 +863,8 @@ extern SDL_DECLSPEC SDL_Condition * SDLCALL SDL_CreateCondition(void);
* *
* \param cond the condition variable to destroy. * \param cond the condition variable to destroy.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_CreateCondition * \sa SDL_CreateCondition

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -796,6 +796,7 @@
#define SDL_TEXTEDITING_EXT SDL_TEXTEDITING_EXT_renamed_SDL_EVENT_TEXT_EDITING_EXT #define SDL_TEXTEDITING_EXT SDL_TEXTEDITING_EXT_renamed_SDL_EVENT_TEXT_EDITING_EXT
#define SDL_TEXTINPUT SDL_TEXTINPUT_renamed_SDL_EVENT_TEXT_INPUT #define SDL_TEXTINPUT SDL_TEXTINPUT_renamed_SDL_EVENT_TEXT_INPUT
#define SDL_USEREVENT SDL_USEREVENT_renamed_SDL_EVENT_USER #define SDL_USEREVENT SDL_USEREVENT_renamed_SDL_EVENT_USER
#define SDL_WINDOWEVENT SDL_WINDOWEVENT_deprecated_use_SDL_EVENT_WINDOW_NAME
#define SDL_WINDOWEVENT_CLOSE SDL_WINDOWEVENT_CLOSE_renamed_SDL_EVENT_WINDOW_CLOSE_REQUESTED #define SDL_WINDOWEVENT_CLOSE SDL_WINDOWEVENT_CLOSE_renamed_SDL_EVENT_WINDOW_CLOSE_REQUESTED
#define SDL_WINDOWEVENT_DISPLAY_CHANGED SDL_WINDOWEVENT_DISPLAY_CHANGED_renamed_SDL_EVENT_WINDOW_DISPLAY_CHANGED #define SDL_WINDOWEVENT_DISPLAY_CHANGED SDL_WINDOWEVENT_DISPLAY_CHANGED_renamed_SDL_EVENT_WINDOW_DISPLAY_CHANGED
#define SDL_WINDOWEVENT_ENTER SDL_WINDOWEVENT_ENTER_renamed_SDL_EVENT_WINDOW_MOUSE_ENTER #define SDL_WINDOWEVENT_ENTER SDL_WINDOWEVENT_ENTER_renamed_SDL_EVENT_WINDOW_MOUSE_ENTER
@@ -870,6 +871,7 @@
#define SDL_GameControllerBindType SDL_GameControllerBindType_renamed_SDL_GamepadBindingType #define SDL_GameControllerBindType SDL_GameControllerBindType_renamed_SDL_GamepadBindingType
#define SDL_GameControllerButton SDL_GameControllerButton_renamed_SDL_GamepadButton #define SDL_GameControllerButton SDL_GameControllerButton_renamed_SDL_GamepadButton
#define SDL_GameControllerClose SDL_GameControllerClose_renamed_SDL_CloseGamepad #define SDL_GameControllerClose SDL_GameControllerClose_renamed_SDL_CloseGamepad
#define SDL_GameControllerEventState SDL_GameControllerEventState_deprecated_use_SDL_SetGamepadEventsEnabled_true_false
#define SDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_renamed_SDL_GetGamepadFromID #define SDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_renamed_SDL_GetGamepadFromID
#define SDL_GameControllerFromPlayerIndex SDL_GameControllerFromPlayerIndex_renamed_SDL_GetGamepadFromPlayerIndex #define SDL_GameControllerFromPlayerIndex SDL_GameControllerFromPlayerIndex_renamed_SDL_GetGamepadFromPlayerIndex
#define SDL_GameControllerGetAppleSFSymbolsNameForAxis SDL_GameControllerGetAppleSFSymbolsNameForAxis_renamed_SDL_GetGamepadAppleSFSymbolsNameForAxis #define SDL_GameControllerGetAppleSFSymbolsNameForAxis SDL_GameControllerGetAppleSFSymbolsNameForAxis_renamed_SDL_GetGamepadAppleSFSymbolsNameForAxis
@@ -947,6 +949,7 @@
/* ##SDL_hints.h */ /* ##SDL_hints.h */
#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback #define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback
#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK SDL_HINT_ACCELEROMETER_AS_JOYSTICK_deprecated_use_SDL_GamepadHasSensor_and_SDL_SetGamepadSensorEnabled
#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST
#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT
#define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
@@ -957,6 +960,8 @@
#define SDL_HINT_LINUX_HAT_DEADZONES SDL_HINT_LINUX_HAT_DEADZONES_renamed_SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES #define SDL_HINT_LINUX_HAT_DEADZONES SDL_HINT_LINUX_HAT_DEADZONES_renamed_SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
#define SDL_HINT_LINUX_JOYSTICK_CLASSIC SDL_HINT_LINUX_JOYSTICK_CLASSIC_renamed_SDL_HINT_JOYSTICK_LINUX_CLASSIC #define SDL_HINT_LINUX_JOYSTICK_CLASSIC SDL_HINT_LINUX_JOYSTICK_CLASSIC_renamed_SDL_HINT_JOYSTICK_LINUX_CLASSIC
#define SDL_HINT_LINUX_JOYSTICK_DEADZONES SDL_HINT_LINUX_JOYSTICK_DEADZONES_renamed_SDL_HINT_JOYSTICK_LINUX_DEADZONES #define SDL_HINT_LINUX_JOYSTICK_DEADZONES SDL_HINT_LINUX_JOYSTICK_DEADZONES_renamed_SDL_HINT_JOYSTICK_LINUX_DEADZONES
#define SDL_HINT_RENDER_SCALE_QUALITY SDL_HINT_RENDER_SCALE_QUALITY_deprecated_use_SDL_SetTextureScaleMode_with_SDL_SCALEMODE_NEAREST
#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS_deprecated_remove_this_line
/* ##SDL_joystick.h */ /* ##SDL_joystick.h */
#define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMECONTROLLER_renamed_SDL_JOYSTICK_TYPE_GAMEPAD #define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMECONTROLLER_renamed_SDL_JOYSTICK_TYPE_GAMEPAD
@@ -999,6 +1004,7 @@
#define SDL_JoystickSetVirtualButton SDL_JoystickSetVirtualButton_renamed_SDL_SetJoystickVirtualButton #define SDL_JoystickSetVirtualButton SDL_JoystickSetVirtualButton_renamed_SDL_SetJoystickVirtualButton
#define SDL_JoystickSetVirtualHat SDL_JoystickSetVirtualHat_renamed_SDL_SetJoystickVirtualHat #define SDL_JoystickSetVirtualHat SDL_JoystickSetVirtualHat_renamed_SDL_SetJoystickVirtualHat
#define SDL_JoystickUpdate SDL_JoystickUpdate_renamed_SDL_UpdateJoysticks #define SDL_JoystickUpdate SDL_JoystickUpdate_renamed_SDL_UpdateJoysticks
#define SDL_NumJoysticks SDL_NumJoysticks_deprecated_use_SDL_GetJoysticks
/* ##SDL_keyboard.h */ /* ##SDL_keyboard.h */
#define SDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown_renamed_SDL_ScreenKeyboardShown #define SDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown_renamed_SDL_ScreenKeyboardShown
@@ -1147,6 +1153,8 @@
/* ##SDL_render.h */ /* ##SDL_render.h */
#define SDL_GetRendererOutputSize SDL_GetRendererOutputSize_renamed_SDL_GetCurrentRenderOutputSize #define SDL_GetRendererOutputSize SDL_GetRendererOutputSize_renamed_SDL_GetCurrentRenderOutputSize
#define SDL_RENDERER_ACCELERATED SDL_RENDERER_ACCELERATED_deprecated_remove_this_line
#define SDL_RENDERER_PRESENTVSYNC SDL_RENDERER_PRESENTVSYNC_deprecated_use_SDL_SetRenderVSync
#define SDL_RenderCopy SDL_RenderCopy_renamed_SDL_RenderTexture #define SDL_RenderCopy SDL_RenderCopy_renamed_SDL_RenderTexture
#define SDL_RenderCopyEx SDL_RenderCopyEx_renamed_SDL_RenderTextureRotated #define SDL_RenderCopyEx SDL_RenderCopyEx_renamed_SDL_RenderTextureRotated
#define SDL_RenderCopyExF SDL_RenderCopyExF_renamed_SDL_RenderTextureRotated #define SDL_RenderCopyExF SDL_RenderCopyExF_renamed_SDL_RenderTextureRotated
@@ -1291,6 +1299,7 @@
/* ##SDL_thread.h */ /* ##SDL_thread.h */
#define SDL_SetThreadPriority SDL_SetThreadPriority_renamed_SDL_SetCurrentThreadPriority #define SDL_SetThreadPriority SDL_SetThreadPriority_renamed_SDL_SetCurrentThreadPriority
#define SDL_SetWindowInputFocus SDL_SetWindowInputFocus_deprecated_use_SDL_RaiseWindow
#define SDL_TLSCleanup SDL_TLSCleanup_renamed_SDL_CleanupTLS #define SDL_TLSCleanup SDL_TLSCleanup_renamed_SDL_CleanupTLS
#define SDL_TLSGet SDL_TLSGet_renamed_SDL_GetTLS #define SDL_TLSGet SDL_TLSGet_renamed_SDL_GetTLS
#define SDL_TLSSet SDL_TLSSet_renamed_SDL_SetTLS #define SDL_TLSSet SDL_TLSSet_renamed_SDL_SetTLS
@@ -1316,10 +1325,13 @@
#define SDL_GetWindowDisplayIndex SDL_GetWindowDisplayIndex_renamed_SDL_GetDisplayForWindow #define SDL_GetWindowDisplayIndex SDL_GetWindowDisplayIndex_renamed_SDL_GetDisplayForWindow
#define SDL_GetWindowDisplayMode SDL_GetWindowDisplayMode_renamed_SDL_GetWindowFullscreenMode #define SDL_GetWindowDisplayMode SDL_GetWindowDisplayMode_renamed_SDL_GetWindowFullscreenMode
#define SDL_HasWindowSurface SDL_HasWindowSurface_renamed_SDL_WindowHasSurface #define SDL_HasWindowSurface SDL_HasWindowSurface_renamed_SDL_WindowHasSurface
#define SDL_INIT_EVERYTHING SDL_INIT_EVERYTHING_deprecated_list_flags_explicitly
#define SDL_IsScreenSaverEnabled SDL_IsScreenSaverEnabled_renamed_SDL_ScreenSaverEnabled #define SDL_IsScreenSaverEnabled SDL_IsScreenSaverEnabled_renamed_SDL_ScreenSaverEnabled
#define SDL_SetWindowDisplayMode SDL_SetWindowDisplayMode_renamed_SDL_SetWindowFullscreenMode #define SDL_SetWindowDisplayMode SDL_SetWindowDisplayMode_renamed_SDL_SetWindowFullscreenMode
#define SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_ALLOW_HIGHDPI_renamed_SDL_WINDOW_HIGH_PIXEL_DENSITY #define SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_ALLOW_HIGHDPI_renamed_SDL_WINDOW_HIGH_PIXEL_DENSITY
#define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN_DESKTOP_deprecated_use_SDL_SetWindowFullscreen_with_bool
#define SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_INPUT_GRABBED_renamed_SDL_WINDOW_MOUSE_GRABBED #define SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_INPUT_GRABBED_renamed_SDL_WINDOW_MOUSE_GRABBED
#define SDL_WINDOW_SHOWN SDL_WINDOW_SHOWN_deprecated_windows_are_shown_by_default
#define SDL_WINDOW_SKIP_TASKBAR SDL_WINDOW_SKIP_TASKBAR_renamed_SDL_WINDOW_UTILITY #define SDL_WINDOW_SKIP_TASKBAR SDL_WINDOW_SKIP_TASKBAR_renamed_SDL_WINDOW_UTILITY
#endif /* SDL_ENABLE_OLD_NAMES */ #endif /* SDL_ENABLE_OLD_NAMES */

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -54,11 +54,11 @@
* example, some platforms can manage multiple devices at the same time, but * example, some platforms can manage multiple devices at the same time, but
* others will make any connected pens look like a single logical device, much * others will make any connected pens look like a single logical device, much
* how all USB mice connected to a computer will move the same system cursor. * how all USB mice connected to a computer will move the same system cursor.
* cursor. Other platforms might not support pen buttons, or the distance * Other platforms might not support pen buttons, or the distance axis, etc.
* axis, etc. Very few platforms can even report _what_ functionality the pen * Very few platforms can even report _what_ functionality the pen supports in
* supports in the first place, so best practices is to either build UI to let * the first place, so best practices is to either build UI to let the user
* the user configure their pens, or be prepared to handle new functionality * configure their pens, or be prepared to handle new functionality for a pen
* for a pen the first time an event is reported. * the first time an event is reported.
*/ */
#ifndef SDL_pen_h_ #ifndef SDL_pen_h_

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -51,6 +51,8 @@ extern "C" {
* \returns the name of the platform. If the correct platform name is not * \returns the name of the platform. If the correct platform name is not
* available, returns a string beginning with the text "Unknown". * available, returns a string beginning with the text "Unknown".
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC const char * SDLCALL SDL_GetPlatform(void); extern SDL_DECLSPEC const char * SDLCALL SDL_GetPlatform(void);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -93,6 +93,8 @@ typedef enum SDL_PowerState
* \returns the current battery state or `SDL_POWERSTATE_ERROR` on failure; * \returns the current battery state or `SDL_POWERSTATE_ERROR` on failure;
* call SDL_GetError() for more information. * call SDL_GetError() for more information.
* *
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent); extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@@ -111,6 +111,8 @@ typedef enum SDL_PropertyType
* \returns a valid property ID on success or 0 on failure; call * \returns a valid property ID on success or 0 on failure; call
* SDL_GetError() for more information. * SDL_GetError() for more information.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
*/ */
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void); extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);

Some files were not shown because too many files have changed in this diff Show More