Compare commits

...

179 Commits

Author SHA1 Message Date
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
1181 changed files with 4063 additions and 2643 deletions

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, ),

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.1") project(SDL3 LANGUAGES C VERSION "3.4.2")
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)
@@ -658,12 +659,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)"
@@ -1294,22 +1290,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
@@ -1766,6 +1765,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 +1778,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()
@@ -3999,6 +3999,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 +4025,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

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.1</string> <string>3.4.2</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>SDLX</string> <string>SDLX</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>3.4.1</string> <string>3.4.2</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.1.0; DYLIB_CURRENT_VERSION = 401.2.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.1; MARKETING_VERSION = 3.4.2;
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.1.0; DYLIB_CURRENT_VERSION = 401.2.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.1; MARKETING_VERSION = 3.4.2;
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.1 Title SDL 3.4.2
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

@@ -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 = 1; private static final int SDL_MICRO_VERSION = 2;
/* /*
// Display InputType.SOURCE/CLASS of events and devices // Display InputType.SOURCE/CLASS of events and devices
// //
@@ -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;

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

@@ -280,6 +280,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

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

@@ -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

@@ -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

@@ -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.1 * Main include header for the SDL library, version 3.4.2
* *
* 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

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

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

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 queue,
* but will not remove it from the 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
@@ -242,8 +242,7 @@ 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,
* symlinks, named pipes, etc. They are currently reported as * named 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 texture
* aligned, and offsets to be aligned to 512 bytes. If they are not, SDL will * data row pitch to be 256 byte aligned, and offsets to be aligned to 512 bytes.
* make a temporary copy of the data that is properly aligned, but this adds * If they are not, SDL will make a temporary copy of the data that is properly
* overhead to the transfer process. Apps can avoid this by aligning their * aligned, but this adds overhead to the transfer process. Apps can avoid this
* data appropriately, or using a different GPU backend than Direct3D 12. * 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

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
@@ -1095,7 +1095,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"
@@ -1778,10 +1778,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 +1795,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 +1812,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 +1831,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 +1848,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 +1865,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 +2649,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().
* *
@@ -2976,6 +3006,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 +3370,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"

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

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

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
@@ -333,6 +333,8 @@ 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 +539,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 +633,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 +652,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);
@@ -658,6 +666,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
* 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.
*/ */
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,8 @@ 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 +400,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 +467,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 +509,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 +542,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 +569,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 +601,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 +627,8 @@ 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 +649,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 +694,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 +715,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 +735,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 +756,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 +778,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 +793,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 +809,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 +844,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 +861,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

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
@@ -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);

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
@@ -237,6 +237,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, cons
* rectangles `A` and `B`. * rectangles `A` and `B`.
* \returns true if there is an intersection, false otherwise. * \returns true if there is an intersection, false otherwise.
* *
* \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_HasRectIntersection * \sa SDL_HasRectIntersection
@@ -253,6 +255,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, cons
* \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.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
@@ -272,6 +276,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_R
* \returns true if any points were enclosed or false if all the points were * \returns true if any points were enclosed or false if all the points were
* outside of the clipping rectangle. * outside of the clipping rectangle.
* *
* \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 bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result); extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);
@@ -292,6 +298,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *poi
* \param Y2 a pointer to the ending Y-coordinate of the line. * \param Y2 a pointer to the ending Y-coordinate of the line.
* \returns true if there is an intersection, false otherwise. * \returns true if there is an intersection, false otherwise.
* *
* \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 bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2); extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
@@ -423,6 +431,8 @@ SDL_FORCE_INLINE bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b
* \param B an SDL_FRect structure representing the second rectangle. * \param B an SDL_FRect structure representing the second rectangle.
* \returns true if there is an intersection, false otherwise. * \returns true if there is an intersection, false otherwise.
* *
* \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_GetRectIntersection * \sa SDL_GetRectIntersection
@@ -440,6 +450,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A
* rectangles `A` and `B`. * rectangles `A` and `B`.
* \returns true if there is an intersection, false otherwise. * \returns true if there is an intersection, false otherwise.
* *
* \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_HasRectIntersectionFloat * \sa SDL_HasRectIntersectionFloat
@@ -456,6 +468,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A
* \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.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
@@ -476,6 +490,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const
* \returns true if any points were enclosed or false if all the points were * \returns true if any points were enclosed or false if all the points were
* outside of the clipping rectangle. * outside of the clipping rectangle.
* *
* \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 bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result); extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result);
@@ -497,6 +513,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoin
* \param Y2 a pointer to the ending Y-coordinate of the line. * \param Y2 a pointer to the ending Y-coordinate of the line.
* \returns true if there is an intersection, false otherwise. * \returns true if there is an intersection, false otherwise.
* *
* \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 bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2); extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);

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
@@ -2509,6 +2509,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
* \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.4.0. * \since This function is available since SDL 3.4.0.
* *
* \sa SDL_RenderGeometry * \sa SDL_RenderGeometry
@@ -2530,6 +2532,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderTextureAddressMode(SDL_Renderer *r
* \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.4.0. * \since This function is available since SDL 3.4.0.
* *
* \sa SDL_SetRenderTextureAddressMode * \sa SDL_SetRenderTextureAddressMode
@@ -2963,7 +2967,7 @@ typedef struct SDL_GPURenderState SDL_GPURenderState;
* \sa SDL_SetGPURenderState * \sa SDL_SetGPURenderState
* \sa SDL_DestroyGPURenderState * \sa SDL_DestroyGPURenderState
*/ */
extern SDL_DECLSPEC SDL_GPURenderState * SDLCALL SDL_CreateGPURenderState(SDL_Renderer *renderer, SDL_GPURenderStateCreateInfo *createinfo); extern SDL_DECLSPEC SDL_GPURenderState * SDLCALL SDL_CreateGPURenderState(SDL_Renderer *renderer, const SDL_GPURenderStateCreateInfo *createinfo);
/** /**
* Set fragment shader uniform variables in a custom GPU render state. * Set fragment shader uniform variables in a custom GPU render state.

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
@@ -254,12 +254,6 @@ void *alloca(size_t);
/** /**
* Macro useful for building other macros with strings in them. * Macro useful for building other macros with strings in them.
* *
* For example:
*
* ```c
* #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")`
* ```
*
* \param arg the text to turn into a string literal. * \param arg the text to turn into a string literal.
* *
* \since This macro is available since SDL 3.2.0. * \since This macro is available since SDL 3.2.0.
@@ -5821,6 +5815,8 @@ typedef struct SDL_iconv_data_t *SDL_iconv_t;
* \returns a handle that must be freed with SDL_iconv_close, or * \returns a handle that must be freed with SDL_iconv_close, or
* SDL_ICONV_ERROR on failure. * SDL_ICONV_ERROR on failure.
* *
* \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_iconv * \sa SDL_iconv
@@ -5836,6 +5832,8 @@ extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
* \param cd The character set conversion handle. * \param cd The character set conversion handle.
* \returns 0 on success, or -1 on failure. * \returns 0 on success, or -1 on failure.
* *
* \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_iconv * \sa SDL_iconv
@@ -5874,6 +5872,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
* \param outbytesleft The number of bytes in the output buffer. * \param outbytesleft The number of bytes in the output buffer.
* \returns the number of conversions on success, or a negative error code. * \returns the number of conversions on success, or a negative error code.
* *
* \threadsafety Do not use the same SDL_iconv_t from two threads at once.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_iconv_open * \sa SDL_iconv_open
@@ -5909,6 +5909,8 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
* \param inbytesleft the size of the input string _in bytes_. * \param inbytesleft the size of the input string _in bytes_.
* \returns a new string, converted to the new encoding, or NULL on error. * \returns a new string, converted to the new encoding, or NULL on error.
* *
* \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_iconv_open * \sa SDL_iconv_open
@@ -5932,6 +5934,8 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
* \param S the string to convert. * \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error. * \returns a new string, converted to the new encoding, or NULL on error.
* *
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0. * \since This macro is available since SDL 3.2.0.
*/ */
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
@@ -5946,6 +5950,8 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
* \param S the string to convert. * \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error. * \returns a new string, converted to the new encoding, or NULL on error.
* *
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0. * \since This macro is available since SDL 3.2.0.
*/ */
#define SDL_iconv_utf8_ucs2(S) SDL_reinterpret_cast(Uint16 *, SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)) #define SDL_iconv_utf8_ucs2(S) SDL_reinterpret_cast(Uint16 *, SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1))
@@ -5960,6 +5966,8 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
* \param S the string to convert. * \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error. * \returns a new string, converted to the new encoding, or NULL on error.
* *
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0. * \since This macro is available since SDL 3.2.0.
*/ */
#define SDL_iconv_utf8_ucs4(S) SDL_reinterpret_cast(Uint32 *, SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)) #define SDL_iconv_utf8_ucs4(S) SDL_reinterpret_cast(Uint32 *, SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1))
@@ -5974,6 +5982,8 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
* \param S the string to convert. * \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error. * \returns a new string, converted to the new encoding, or NULL on error.
* *
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0. * \since This macro is available since SDL 3.2.0.
*/ */
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", SDL_reinterpret_cast(const char *, S), (SDL_wcslen(S)+1)*sizeof(wchar_t)) #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", SDL_reinterpret_cast(const char *, S), (SDL_wcslen(S)+1)*sizeof(wchar_t))

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
@@ -86,6 +86,8 @@ typedef bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
* \param callback the SDL_WindowsMessageHook function to call. * \param callback the SDL_WindowsMessageHook function to call.
* \param userdata a pointer to pass to every iteration of `callback`. * \param userdata a pointer to pass to every iteration of `callback`.
* *
* \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_WindowsMessageHook * \sa SDL_WindowsMessageHook
@@ -169,6 +171,8 @@ typedef bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
* \param callback the SDL_X11EventHook function to call. * \param callback the SDL_X11EventHook function to call.
* \param userdata a pointer to pass to every iteration of `callback`. * \param userdata a pointer to pass to every iteration of `callback`.
* *
* \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_SetX11EventHook(SDL_X11EventHook callback, void *userdata); extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata);
@@ -186,6 +190,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback,
* \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.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
@@ -202,6 +208,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int
* \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.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
@@ -264,6 +272,8 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata);
* \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_SetiOSEventPump * \sa SDL_SetiOSEventPump
@@ -277,6 +287,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window,
* *
* \param enabled true to enable the event pump, false to disable it. * \param enabled true to enable the event pump, false to disable it.
* *
* \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_SetiOSAnimationCallback * \sa SDL_SetiOSAnimationCallback
@@ -370,6 +382,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidActivity(void);
* *
* \returns the Android API level. * \returns the Android API level.
* *
* \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 int SDLCALL SDL_GetAndroidSDKVersion(void); extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
@@ -379,6 +393,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
* *
* \returns true if this is a Chromebook, false otherwise. * \returns true if this is a Chromebook, false otherwise.
* *
* \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 bool SDLCALL SDL_IsChromebook(void); extern SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void);
@@ -388,6 +404,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void);
* *
* \returns true if this is a DeX docking station, false otherwise. * \returns true if this is a DeX docking station, false otherwise.
* *
* \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 bool SDLCALL SDL_IsDeXMode(void); extern SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void);
@@ -605,6 +623,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int para
* *
* \returns true if the device is a tablet, false otherwise. * \returns true if the device is a tablet, false otherwise.
* *
* \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 bool SDLCALL SDL_IsTablet(void); extern SDL_DECLSPEC bool SDLCALL SDL_IsTablet(void);
@@ -616,6 +636,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsTablet(void);
* *
* \returns true if the device is a TV, false otherwise. * \returns true if the device is a TV, false otherwise.
* *
* \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 bool SDLCALL SDL_IsTV(void); extern SDL_DECLSPEC bool SDLCALL SDL_IsTV(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

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

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
@@ -208,6 +208,8 @@ typedef int (SDLCALL *SDL_ThreadFunction) (void *data);
* new thread could not be created; call SDL_GetError() for more * new thread could not be created; 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_CreateThreadWithProperties * \sa SDL_CreateThreadWithProperties
@@ -274,6 +276,8 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn,
* new thread could not be created; call SDL_GetError() for more * new thread could not be created; 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_CreateThread * \sa SDL_CreateThread
@@ -329,6 +333,8 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_Prop
* new thread could not be created; call SDL_GetError() for more * new thread could not be created; 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.
*/ */
extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadRuntime(SDL_ThreadFunction fn, const char *name, void *data, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread); extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadRuntime(SDL_ThreadFunction fn, const char *name, void *data, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread);
@@ -343,6 +349,8 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadRuntime(SDL_ThreadFunct
* new thread could not be created; call SDL_GetError() for more * new thread could not be created; 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.
*/ */
extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread); extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread);
@@ -363,6 +371,8 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S
* \returns a pointer to a UTF-8 string that names the specified thread, or * \returns a pointer to a UTF-8 string that names the specified thread, or
* NULL if it doesn't have a name. * NULL if it doesn't have a name.
* *
* \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_GetThreadName(SDL_Thread *thread); extern SDL_DECLSPEC const char * SDLCALL SDL_GetThreadName(SDL_Thread *thread);
@@ -379,6 +389,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetThreadName(SDL_Thread *thread);
* *
* \returns the ID of the current thread. * \returns the ID of the current thread.
* *
* \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_GetThreadID * \sa SDL_GetThreadID
@@ -396,6 +408,8 @@ extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void);
* \returns the ID of the specified thread, or the ID of the current thread if * \returns the ID of the specified thread, or the ID of the current thread if
* `thread` is NULL. * `thread` is NULL.
* *
* \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_GetCurrentThreadID * \sa SDL_GetCurrentThreadID
@@ -413,6 +427,8 @@ extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread *thread);
* \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.
*/ */
extern SDL_DECLSPEC bool SDLCALL SDL_SetCurrentThreadPriority(SDL_ThreadPriority priority); extern SDL_DECLSPEC bool SDLCALL SDL_SetCurrentThreadPriority(SDL_ThreadPriority priority);
@@ -445,6 +461,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetCurrentThreadPriority(SDL_ThreadPriority
* function by its 'return', or -1 if the thread has been * function by its 'return', or -1 if the thread has been
* detached or isn't valid, may be NULL. * detached or isn't valid, may be NULL.
* *
* \threadsafety It is safe to call this function from any thread, but only
* a single thread can wait any specific thread to finish.
*
* \since This function is available since SDL 3.2.0. * \since This function is available since SDL 3.2.0.
* *
* \sa SDL_CreateThread * \sa SDL_CreateThread
@@ -459,6 +478,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status)
* \returns the current state of a thread, or SDL_THREAD_UNKNOWN if the thread * \returns the current state of a thread, or SDL_THREAD_UNKNOWN if the thread
* isn't valid. * isn't valid.
* *
* \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_ThreadState * \sa SDL_ThreadState
@@ -491,6 +512,8 @@ extern SDL_DECLSPEC SDL_ThreadState SDLCALL SDL_GetThreadState(SDL_Thread *threa
* *
* It is safe to pass NULL to this function; it is a no-op. * It is safe to pass NULL to this function; it is a no-op.
* *
* \threadsafety It is safe to call this function from any thread.
*
* \param thread the SDL_Thread pointer that was returned from the * \param thread the SDL_Thread pointer that was returned from the
* SDL_CreateThread() call that started this thread. * SDL_CreateThread() call that started this thread.
* *

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