Compare commits

..

389 Commits

Author SHA1 Message Date
Sam Lantinga
99a026cfde Clarified SDL_MostSignificantBitIndex32() documentation
Fixes https://github.com/libsdl-org/SDL/issues/15247

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

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

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

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

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

Fixes #15188.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #15057.

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

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

Fixes #15024.

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

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

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

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

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

We'll revisit this in the next SDL release.

Reference Issue #15058.

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

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

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

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

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

Reference Issue #14898.

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

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

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

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

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

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

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

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

Fixes #14898.

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

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

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

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

Fixes #14999.

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

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

Also allow SDL_FUNCTION to be redefined by the application.

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #7470.

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

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

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

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

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

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

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

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

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

Fixes #14878.

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

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

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

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

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

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

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

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

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

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

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

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

Extends commit 83fb7b6636.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Check for XIGesturePinchEvent in the test for enabling
SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE

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

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

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

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

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

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

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

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

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

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

(cherry picked from commit f472f93db8)
2026-01-02 07:37:56 -08:00
Zack Middleton
fd345ae2f9 Improve hint documentation
(cherry picked from commit 6247568a1b)
2026-01-02 07:33:17 -08:00
Kadir
c5dee0feb5 Add ProGuard rule for joystickSetLED method in SDLControllerManager
(cherry picked from commit cbcc565ca9)
2026-01-02 07:31:37 -08:00
Brad Smith
a6ff5646f4 cmake: Enable Vulkan support on OpenBSD
(cherry picked from commit 1d51671cbe)
2026-01-02 00:18:38 +01:00
Sam Lantinga
80c6a5f8d9 Updated copyright for 2026 2026-01-01 09:48:19 -08:00
Sam Lantinga
d15ecb21be Updated to version 3.4.1 for development 2025-12-31 18:18:45 -08:00
Sam Lantinga
a962f40bbb Updated to version 3.4.0 for release 2025-12-31 16:43:54 -08:00
Frank Praznik
cac2460623 x11: Don't dedup move/size events
The event core will do so automatically, and this may end up dropping events in rare cases when exiting fullscreen if an event with the final bordered window size is sent before the event notifying that the borders have come back on.
2025-12-31 17:55:32 -05:00
Ryan C. Gordon
25e33948af emscripten: Handle mouse button events more correctly.
Don't decide if the button is pressed by the `buttons` bitmask, but rather by
event type. On macOS, the trackpad might produce a mousedown event with taps
instead of full clicks--if tapping is enabled in System Preferences--and in
this case might not set the flag in the bitmask.

Fixes #14640.
2025-12-31 17:23:42 -05:00
Sam Lantinga
9698e20399 gpu renderer: fixed memory leak when resizing the backbuffer
Fixes https://github.com/libsdl-org/SDL/issues/14734
2025-12-31 08:00:26 -08:00
Sam Lantinga
0ac6f972f9 Added enhanced support for the Flydigi Vader 5 Pro controller 2025-12-31 07:46:56 -08:00
Anonymous Maarten
d7a2d007d0 Remove superfluous comma from SDL_missing_dependency calls 2025-12-31 04:23:27 +01:00
Frank Praznik
cb4f33b644 gpu: Use the window event watcher list for Vulkan and D3D12
Events won't be delivered to the regular event watcher list callbacks if a client event filter discards events. Use the special window event watcher list to watch for resizes in the GPU renderers, as events are delivered to this list before a client can potentially discard them.
2025-12-30 22:18:19 -05:00
Ryan C. Gordon
4d8f84f161 timer: Use the emscripten-specific code on Emscripten, even with threading.
Fixes #14640.
2025-12-30 18:57:55 -05:00
dwillbarron
618eb57519 DirectInput FFB: Calculate appropriate update flags (#14570)
Anecdotally, some force-feedback wheels have been reported to experience a
reduced "definition", "texture", "precision", or "je ne sais quoi", which
appears to be caused by sending more update flags than necessary to
DirectInput.

This may be related to the fact that there are two USB PID packets that are
sent when updating a device: One contains the "general" force data, and the
other contains the "type-specific" data. My speculation is that many wheels
expect to only receive the latter, and misbehave when receiving both.

This has been tested and validated anecdotally by others who have received
a hacked-together version of PCSX2 that corrects the flags sent to DirectInput,
who noted a significant improvement in the "feeling" of the FFB effects.

The only way to validate this at a technical level is to grab a wheel that uses
the "generic" DirectInput FFB drivers (which map nearly 1:1 with the USB PID
specification), and inspect the USB packets (e.g. with USBPcap) to check whether
redundant data is being sent.
2025-12-30 14:43:49 -08:00
Sam Lantinga
128b9260ec Added SDL_HINT_HIDAPI_LIBUSB_GAMECUBE
Fixes https://github.com/libsdl-org/SDL/issues/14682
2025-12-30 14:14:51 -08:00
Ryan C. Gordon
1a27b5b838 emscripten: set window->w and ->h when creating with external css sizing.
Fixes #14711.
2025-12-30 16:56:45 -05:00
Ryan C. Gordon
7d66d3271b emscriptenaudio: Don't force reset SDL3.audio_recording/audio_playback.
Otherwise, opening devices for recording and playback at the same time will
cause problems.
2025-12-30 15:40:25 -05:00
Ryan C. Gordon
b681862f14 emscripten: Don't pass an argument to MAIN_THREAD_EM_ASM_INT we don't use.
This upsets things, because you end up calling a javascript function with
more arguments than it expects, and if asserts are enabled, Emscripten notices
this and aborts the program when you hit this code.

Reference Issue #14670.
2025-12-30 15:40:25 -05:00
Eddy Jansson
3d354eeaad Prefer SDL_arraysize()
Replace uses of (sizeof(arr)/sizeof(arr[0]), and similar,
with the SDL_arraysize() macro.
2025-12-30 12:22:03 -08:00
Sam Lantinga
d33642b710 Filter libusb devices early in enumeration
Some device drivers crash if you query things like manufacturer and product name, so make sure we only touch devices that we're really interested in.
2025-12-30 10:52:56 -08:00
Frank Praznik
95ac0ff4d6 wayland: Center non-square icon images
Center icon images instead of scaling to preserve the aspect ratio.
2025-12-29 13:35:18 -05:00
MAJigsaw77
cb04dcd6f8 android: Add RGB LED support for joysticks. 2025-12-29 10:32:02 -08:00
Frank Praznik
4fcb92e0df wayland: Scale non-square icon images
Wayland icons must be square, so scale non-square images to fit a square region instead of failing. This matches X11 behavior.

A warning that the image will be scaled will be logged.
2025-12-29 12:56:42 -05:00
Sam Lantinga
48d6c70f2c Revert "Added note for migrating SDL2 code using SDL_ThreadID()"
This reverts commit becd08f376.
2025-12-29 09:50:18 -08:00
Sam Lantinga
d10fe8bf2f Added a Linux mapping for the Nacon GC100 controller (thanks @elkabyliano!) 2025-12-29 09:43:47 -08:00
Sam Lantinga
becd08f376 Added note for migrating SDL2 code using SDL_ThreadID() 2025-12-29 09:39:59 -08:00
Sam Lantinga
38345adff0 Don't set the active texture when creating a palette
Fixes https://github.com/libsdl-org/SDL/issues/14705
2025-12-29 09:36:13 -08:00
Simon McVittie
370e9407b5 wayland: If GTK is disabled, try to avoid libdecor's GTK plugin
As in the previous commit, loading GTK while setuid or setgid would
result in the process exiting. This is equally true if it's loaded
indirectly, for a libdecor plugin.

libdecor doesn't currently have any API by which it can be asked to
avoid specific plugins, but its GTK plugin declines to initialize if it
detects a non-main thread (because GTK documents that it must only be
used from the main thread), resulting in libdecor falling back to the
lower-priority Cairo plugin. We can make use of this by intentionally
initializing libdecor on another thread if we have been asked to avoid
GTK. This is a bit of a hack, but at worst it should be harmless.

Resolves: https://github.com/libsdl-org/sdl2-compat/issues/564
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-28 10:19:33 -08:00
Simon McVittie
b6f4e10bf9 unix: If setuid or setgid, don't use GTK
GTK explicitly doesn't support being used setuid or setgid, and if SDL
loads and initializes GTK, GTK will exit the process if it
detects a setgid executable. This is incompatible with the historical
practice of making game executables setgid in order to write out a
shared high-score table on multi-user systems (which is security theatre
at best, because typical game runtime libraries are not hardened against
an untrusted caller, but making it regress would be a user-observable
regression in sdl2-compat).

Helps: https://github.com/libsdl-org/sdl2-compat/issues/564
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-28 10:19:33 -08:00
Simon McVittie
9e0b31b297 unix: Factor out the check for GTK into an internal function
This will allow the same check to be done by the libdecor integration.

Helps: https://github.com/libsdl-org/sdl2-compat/issues/564
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-28 10:19:33 -08:00
Simon McVittie
76352f2931 Document SDL's policy on setuid/setgid executables
Stated briefly, the policy is: don't.

Resolves: https://github.com/libsdl-org/SDL/issues/14717
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-28 10:14:57 -08:00
Frank Praznik
1fee2a9ae0 wayland: Remove redundant mouse button releases
Any pressed buttons are released in the loop when the pointer leaves a surface, so no need to release them again.
2025-12-28 12:42:09 -05:00
Sam Lantinga
9fe5c1512f Added support for extended buttons on Wayland
Fixes https://github.com/libsdl-org/SDL/issues/14681
2025-12-27 14:50:43 -08:00
anonymix007
89dd2426cf Add SDL_PROP_TEXTURE_CREATE_VULKAN_LAYOUT_NUMBER 2025-12-27 10:23:12 -08:00
Frank Praznik
8c54961de0 wayland: Send mouse coordinates after warping
Currently, no compositor that supports the warp protocol sends a motion event after doing so, so SDL must synthesize one when using the warp protocol, as it did with the locking protocol.

This can be avoided once
https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/340 is completed.
2025-12-26 17:22:42 -05:00
SDL Wiki Bot
bb3d78e260 Sync SDL3 wiki -> header
[ci skip]
2025-12-26 18:14:59 +00:00
Frank Praznik
edec0c2ffd hints: Note an additional method for retrieving display connector names 2025-12-26 13:13:30 -05:00
Anonymous Maarten
bf113bbe2a cmake: break dependency cycle when doing an in-source build 2025-12-24 22:18:57 +01:00
Anonymous Maarten
9dd3e2305e dlnote: embed trailing semicolon in SDL_ELF_NOTE_DLOPEN macro 2025-12-24 23:45:50 +03:00
SDL Wiki Bot
e18b301c51 Sync SDL3 wiki -> header
[ci skip]
2025-12-24 19:24:52 +00:00
Anonymous Maarten
58f534708e dlopennote: don't define SDL_ELF_NOTE_DLOPEN when variadic macro's are not supported
Guard with #ifdef SDL_ELF_NOTE_DLOPEN when using older toolchains
2025-12-24 20:23:28 +01:00
Anonymous Maarten
6840bbef58 dlopennote: update documentation and internal variable names 2025-12-24 20:23:28 +01:00
Nintorch
5c03796ac7 Fix Emscripten joysticks having the same name 2025-12-24 07:19:10 -08:00
Nintorch
0f1a705fda Fix Emscripten joystick rumble being swapped 2025-12-24 07:18:07 -08:00
Edgar San Martin, Jr.
bd29d60d3c GPU: Add bounds validation for slot bindings and uniform data pushes. (#14692) 2025-12-23 08:36:06 -08:00
SDL Wiki Bot
419e8600c8 Sync SDL3 wiki -> header
[ci skip]
2025-12-23 07:45:18 +00:00
Anonymous Maarten
e79cfbe520 testcustomcursor: plug memory leak 2025-12-22 22:43:05 +01:00
Anonymous Maarten
2cd84bd581 testcustomcursor: add --frames argument accepting multiple paths 2025-12-22 22:43:05 +01:00
Sam Lantinga
0b9946d7bf Fixed crash when using the NVIDIA Shield controller 2025-12-22 11:29:47 -08:00
Frank Praznik
7fe81f789f tests: Add clipboard clearing functionality to testclipboard
Use Alt+C/P to clear the clipboard/primary selection in testclipboard.
2025-12-22 13:29:28 -05:00
Frank Praznik
9094395b13 wayland: Use the implicit grab serial when clearing the clipboard
Some compositors won't clear the selection without a valid serial.
2025-12-22 13:29:28 -05:00
SDL Wiki Bot
2bc6cf6efd Sync SDL3 wiki -> header
[ci skip]
2025-12-22 16:26:56 +00:00
Edgar San Martin, Jr.
00fe482efb docs(gpu): document depth texture limitation in SDL_CopyGPUTextureToTexture (#14693) 2025-12-22 08:25:32 -08:00
Alex Schwartz
bd35a1c8e5 docs: fix Fedora 40+ build dependencies 2025-12-22 08:22:40 -08:00
999pingGG
5a257202d2 GPU: Better detection of surface destruction 2025-12-21 17:16:34 -08:00
Sam Lantinga
efc33633e3 Allow the offscreen and dummy drivers to be used as fallback 2025-12-21 16:18:07 -08:00
Frank Praznik
37fca1fdcf video: Unload GL/Vulkan when shutting down the video subsystem
If GL/Vulkan was loaded manually via a SDL_X_LoadLibrary() call instead of via window flags or through the GPU or renderer system, and there is no matching SDL_X_UnloadLibrary() call, the library instance won't be automatically unloaded while shutting down the video system, as the refcount won't go to zero, which can cause problems with some backends, and leaves a leaked DLL/SO handle when the global video object is destroyed.

Ensure that the libraries are unloaded after destroying the windows, but before shutting down the video backend, to prevent a leak and possible driver errors when shutting down the video backend.
2025-12-21 12:44:19 -05:00
SDL Wiki Bot
b14aceea51 Sync SDL3 wiki -> header
[ci skip]
2025-12-21 16:53:21 +00:00
Sam Lantinga
59961d8343 Note that "auto" is the default for SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS
Fixes https://github.com/libsdl-org/SDL/issues/14686
2025-12-21 08:51:26 -08:00
Kaleb Reid
341f60555f Fix building joystick for OpenBSD 2025-12-21 07:58:41 -08:00
Sam Lantinga
0d705ca275 Use the aggregate upower device for power status when available 2025-12-19 17:42:33 -08:00
999pingGG
190b902fac GPU: Fix Android surface and swapchain recreation on app resume (#14676) 2025-12-19 09:54:08 -08:00
Ryan C. Gordon
2c3657a0ce egl: Patched to compile.
Yeehaw, cowboy committer!  🤦
2025-12-17 17:27:51 -05:00
Ryan C. Gordon
46df9ea92a egl: Call SDL_EGL_SetSwapInterval during context creation, not the GL version.
The `GL` version returns early because the context isn't set yet, whereas the
`EGL` version works out here.

Fixes #14642.
2025-12-17 17:16:39 -05:00
Frank Praznik
235f417616 wayland: Update the HDR data on placeholder displays
Update the HDR data on a placeholder display if it hasn't been finalized and added yet, or the HDR data on the added display will be incorrect.
2025-12-17 15:12:27 -05:00
Frank Praznik
d028d8bc3b Fix minor typos in headers. 2025-12-17 12:56:04 -05:00
Sam Lantinga
63636c8403 Fixed warning: implicit conversion loses integer precision 2025-12-16 14:51:19 -08:00
Sam Lantinga
c7508ca2e9 Fixed warning: no previous prototype for function 'ParseDescriptor' 2025-12-16 14:51:19 -08:00
SDL Wiki Bot
9c856aea96 Sync SDL3 wiki -> header
[ci skip]
2025-12-16 17:57:26 +00:00
Sam Lantinga
d583fc88be Updated to version 3.3.7 for development 2025-12-16 09:38:05 -08:00
Ryan C. Gordon
9022d90e01 README-emscripten: corrected comments about vsync. 2025-12-16 12:24:29 -05:00
Sam Lantinga
ef0a604d44 Updated to version 3.3.6 for preview release 2025-12-16 08:54:04 -08:00
Sam Lantinga
aeb4b3d2fc Reverted Vita cliprect changes
Temporarily backing out cliprect changes which caused logical presentation regressions.

Fixes https://github.com/libsdl-org/SDL/issues/14645
Reopens https://github.com/libsdl-org/SDL/issues/13034
2025-12-16 08:47:45 -08:00
Frank Praznik
78d008fcd2 x11: Don't poll the map state when the window was unmapped and borders are toggled
An event flush while a window is being hidden may try to toggle the window borders. Don't poll the mapping state when toggling borders if the window is in the process of being hidden, or the window may already be unmapped, and the wait loop will hang forever.
2025-12-16 11:45:36 -05:00
Nuno Silva
d94cd1efad GPU: Ensure Vulkan doesn't pass unsupported feature structures for requested vulkan version (#14662) 2025-12-15 17:57:49 -08:00
Edgar J San Martin
09a2283b53 Fix SDL_EnumerateDirectory(/) failing on POSIX and Windows. 2025-12-15 17:01:02 -08:00
Anonymous Maarten
6665ebaa2e SDL_test: allow disabling colorized output 2025-12-15 23:19:25 +01:00
Susko3
765a2e9118 Fix using wrong variable by mistake 2025-12-15 13:57:40 -08:00
Evan Hemsley
1260c10aab GPU Vulkan: Only modify surface on window claim or release (#14659) 2025-12-15 12:54:16 -08:00
Jakub Wasilewski
73c9f25867 GPU: Metal: Rebind storage buffers when changing the pipeline moves them. 2025-12-15 11:45:29 -08:00
Frank Praznik
9092ddff3c wayland: Update the color management protocol
No functional changes, just minor updates to track the latest upstream version.
2025-12-15 13:54:31 -05:00
Ryan C. Gordon
db84b948f9 egl: Default to a swap interval of 0.
This matches other platforms.

Also make sure Android explicitly sets vsync on restore, regardless of the
specific setting, to make sure it's consistent.

Fixes #14642.
2025-12-15 12:44:57 -05:00
Ryan C. Gordon
deb85d1fa8 emscripten: find the right SDL_Window during fullscreen events.
Fixes #14629.
2025-12-15 12:08:44 -05:00
Sam Lantinga
64df9cfa47 testmessage: quit if we get a mouse click 2025-12-15 08:56:11 -08:00
Sam Lantinga
bcaedd5781 Fixed messageboxes when using window scenes on Apple platforms 2025-12-15 08:56:11 -08:00
Sam Lantinga
518c98ea01 Pass the window along with evdev touch events
Fixes https://github.com/libsdl-org/SDL/issues/14644
2025-12-15 08:29:36 -08:00
SDL Wiki Bot
de642c8890 Sync SDL3 wiki -> header
[ci skip]
2025-12-14 18:40:08 +00:00
Sam Lantinga
ae8df644d7 Refer to SDL_CreateGPUComputePipeline() appropriately 2025-12-14 10:38:10 -08:00
Sam Lantinga
a3e5335dbf Removed wiki markup 2025-12-14 08:20:00 -08:00
SDL Wiki Bot
16b74a6ffa Sync SDL3 wiki -> header
[ci skip]
2025-12-14 16:03:48 +00:00
Sam Lantinga
517a3d20e8 Support calling SteamAPI_InitEx() before SDL_Init(SDL_INIT_GAMEPAD)
Calling SteamAPI_InitEx() will set environment variables that SDL uses to properly support the Steam virtual gamepad. Make sure that we fall back to the real environment for the variables that Steam sets.
2025-12-13 23:46:27 -08:00
Sam Lantinga
d780fa144a Don't create the SDL environment in SDL_setenv_unsafe()
We might be setting an environment variable along with other application code setting environment variables (like code in SteamAPI_InitEx()) before initializing SDL.
2025-12-13 21:28:05 -08:00
Frank Praznik
5fe69e73ba x11: Use XInput2 to handle pointer input while grabbed and touches are active
Core X11 events are used for absolute motion while the mouse is grabbed, as XInput doesn't receive motion events from the master pointer, and the position from the slave devices lags one report behind. However, pointer events emulated from multitouch events can't be filtered out when using core events, as the XInput flags are not passed through.

Use the absolute position from slave devices in XInput motion events while the mouse is grabbed and touch events are active to allow filtering out pointer events emulated from touch events. Pointer events in this case may be a report behind the master device, but receiving input from both the pointer and touches simultaneously is not likely to be a common occurrence.
2025-12-13 11:15:11 -05:00
Sam Lantinga
a2d19ec7f3 Note that uniforms are local to command buffers (thanks @LittleCodingFox!) 2025-12-12 15:09:56 -08:00
Sam Lantinga
ec19f1e12f Use Uint32 instead of unsigned int for descriptor values 2025-12-12 13:02:39 -08:00
Sam Lantinga
71be323973 Updated Xbox HIDAPI descriptor handling for alternate layout
Fixes https://github.com/libsdl-org/SDL/issues/14597
2025-12-12 13:02:39 -08:00
Fredrik Foss-Indrehus
bdb72bb3f0 cmake: add reftable ref storage support to GetGitRevisionDescription
The script assumed Git's traditional loose refs or packed-refs format.
When cloning with extensions.refstorage=reftable, neither .git/refs/*
nor .git/packed-refs exist, causing cmake configuration to fail.

Fall back to git rev-parse when file-based ref lookup fails.
2025-12-11 16:13:49 -08:00
SDL Wiki Bot
76dfb85407 Sync SDL3 wiki -> header
[ci skip]
2025-12-11 23:15:58 +00:00
Frank Praznik
d6f6421973 Revert "Don't enable the text-input protocol when using Fcitx"
It turns out that some distros set SDL_IM_MODULE globally, which leads to broken text input with this check, and there really is no reason not to use the text input protocol when available.

Reverts 2b375d9704
2025-12-11 12:56:49 -05:00
Anonymous Maarten
f8a4fbf128 Remove mkinstalldirs from automake 2025-12-11 05:48:36 +01:00
Arnoldo Adonaí Barón Robles
e5731f9bac GPU: Fix crash on Android upon returning from the background 2025-12-10 20:58:19 -05:00
Frank Praznik
c2710bd4e8 Don't apply SDL_HINT_MOUSE_DPI_SCALE_CURSORS on Wayland
Wayland cursors are surfaces sized in scaled points, so this hint wouldn't change the size, just prevent larger backbuffers from being used to draw sharper scaled cursors.
2025-12-10 14:50:00 -05:00
Sam Lantinga
450a2cb5e4 Added support for parsing the Xbox report descriptor
This gives us more robust handling of Bluetooth Xbox controllers which may vary the report format between firmware versions.

Firmware versions tested:
Xbox One S: 3.1.1, 4.8.1923, 5.13.3143
Xbox One S/X: 5.11.3118, 5.23.6
Xbox Elite Series 2: 5.22.16, 5.23.6

Fixes https://github.com/libsdl-org/SDL/issues/14597
2025-12-10 10:49:39 -08:00
Sam Lantinga
ef416e84a1 Use SDL_LogDebug() for dumping HID packets 2025-12-10 10:49:39 -08:00
SDL Wiki Bot
5bbf1dcb44 Sync SDL3 wiki -> header
[ci skip]
2025-12-10 01:13:34 +00:00
Sam Lantinga
466ca58b04 Added SDL_HINT_MOUSE_DPI_SCALE_CURSORS
We only want to change cursor display scale if the application or the user opts in by setting a hint. Otherwise cursors could change size unexpectedly when upgrading to SDL 3.4.0.
2025-12-09 17:12:08 -08:00
Frank Praznik
5b572638b8 video: Handle window destruction in event handlers
Windows may be destroyed in event handlers, so check the window validity after pushing window events onto the queue to ensure that the window and its properties are still valid.
2025-12-09 14:10:43 -05:00
Qiu Qiang
62639fdf88 Improve camera frame rate matching on macOS
- Prefer formats with narrower frame rate ranges
- Set frame duration on both device and connection
  for better enforcement
2025-12-08 21:03:09 -08:00
Ryan C. Gordon
b3cdeb942a opengl: default to vsync=0 everywhere.
This reverts commit 3ee29f2e7a, among other
changes. This means getting a scary warning on the javascript console in
Emscripten by default, but this is easily fixed by setting a GL swap
interval at startup or creating a 2D renderer with the appropriate property
(or call to SDL_SetRenderVSync()).

Fixes #14625.
2025-12-08 15:12:17 -05:00
Anonymous Maarten
a296c40867 isfinite is not available on all platforms, so add a bitmasking alternative
Compiler Explorer shows both result in the same assembly.
2025-12-08 20:48:47 +01:00
Anonymous Maarten
f896e26f59 tests: find X11 and wayland-client 2025-12-08 20:48:47 +01:00
Anonymous Maarten
d19b010d4e cmake: only enable building tests when SDL is the main project 2025-12-08 20:48:47 +01:00
Frank Praznik
14aa5cf762 x11: Remove unused function parameter 2025-12-08 13:15:12 -05:00
Frank Praznik
69255b870d x11: Dedup the X11_FindWindow() function
The was duplicated in the XInput2 code, but taking an SDL_VideoData parameter instead of SDL_VideoDevice. Remove the duplicated XInput2 function, and use an SDL_VideoData parameter for X11_FindWindow to avoid an unnecessary dereference.
2025-12-08 13:15:12 -05:00
Cameron Cawley
a4de176e1c Use the correct pixel formats for Vulkan on big endian 2025-12-08 10:07:31 -08:00
Sam Lantinga
9b36a76ee6 Fixed supported pixel formats on big endian systems (thanks @ccawley2011!) 2025-12-08 08:36:32 -08:00
SDL Wiki Bot
a75bf983e5 Sync SDL3 wiki -> header
[ci skip]
2025-12-08 16:27:12 +00:00
Ryan C. Gordon
6f774908fe audio: SDL_GetAudioDeviceName() now works with the default device IDs.
Fixes #14615.
2025-12-08 11:25:15 -05:00
Sam Lantinga
a35639c7b5 Added patch note for SDL_SetWindowFillDocument() 2025-12-08 08:18:34 -08:00
Sam Lantinga
db3ee5d62b Enable building the tests by default
A common use case is asking someone to clone SDL and run a test. This simplifies the instructions so we don't also have to tell them how to enable the tests. Anyone savvy can just add -DSDL_TESTS=OFF if they don't want to have them.
2025-12-08 08:15:12 -08:00
Ryan C. Gordon
08a547e077 WhatsNew.txt: Removed reference to removed property.
Fixes #14623.
2025-12-08 11:03:42 -05:00
SDL Wiki Bot
b428c1834f Sync SDL3 wiki -> header
[ci skip]
2025-12-08 03:26:26 +00:00
Ryan C. Gordon
5813d0ec0a surface: SDL_RotateSurface should update SDL_PROP_SURFACE_ROTATION_FLOAT.
Fixes #14616.
2025-12-07 22:25:08 -05:00
Ryan C. Gordon
4194879df1 surface: Surface rotation property should be float, not int.
Adjusted camera internals to work in floats, too.

Reference Issue #14616.
2025-12-07 22:25:08 -05:00
Ryan C. Gordon
9918d6cb5e emscripten: Move fill-document from hint/property to a window flag.
Fixes #14617.
2025-12-07 21:12:13 -05:00
Qiu Qiang
19988c5faa Fix loop variable bug in V4L2 camera format enumeration 2025-12-07 14:11:27 -08:00
Sam Lantinga
7773157fae Updated to version 3.3.5 for development 2025-12-07 09:30:04 -08:00
Sam Lantinga
9bf86a2db3 Added documentation for the 3.4.0 release 2025-12-07 09:18:29 -08:00
Sam Lantinga
edb81cf84a Fixed whitespace 2025-12-07 09:12:34 -08:00
SDL Wiki Bot
9257df24b5 Sync SDL3 wiki -> header
[ci skip]
2025-12-07 16:05:39 +00:00
Sam Lantinga
97b0b13147 Fixed subdirectories showing in enumeration of Steam storage 2025-12-06 22:35:05 -08:00
Christian Semmler
7e78636e8e Handle SharedArrayBuffer for PNG data
The Emscripten support for setting window icons introduced in #14490 does not work when using pthreads. Using `SetWindowIcon` will cause the program to crash. The reason for that is that the `Blob` constructor does not accept shared memory (`SharedArrayBuffer`).

We need to create a local copy of the icon data if necessary.
2025-12-06 22:11:55 -08:00
1212 changed files with 8368 additions and 4039 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-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", ),
"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-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": 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" ),
"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-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, ),

View File

@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
endif()
# See docs/release_checklist.md
project(SDL3 LANGUAGES C VERSION "3.3.4")
project(SDL3 LANGUAGES C VERSION "3.4.3")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(SDL3_MAINPROJECT ON)
@@ -46,6 +46,7 @@ endif()
include(CheckLibraryExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckLanguage)
include(CheckSymbolExists)
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_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_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_METAL "Enable Metal support" ON "APPLE" 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_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_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_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)
@@ -393,7 +394,7 @@ cmake_dependent_option(SDL_SHARED "Build a shared version of the library" ${SDL_
cmake_dependent_option(SDL_STATIC "Build a static version of the library" ${SDL_STATIC_DEFAULT} ${SDL_STATIC_AVAILABLE} OFF)
option(SDL_TEST_LIBRARY "Build the SDL3_test library" ON)
dep_option(SDL_TESTS "Build the test directory" OFF SDL_TEST_LIBRARY OFF)
dep_option(SDL_TESTS "Build the test directory" ${SDL3_MAINPROJECT} SDL_TEST_LIBRARY OFF)
dep_option(SDL_INSTALL_TESTS "Install test-cases" OFF "SDL_INSTALL;NOT SDL_FRAMEWORK" OFF)
dep_option(SDL_TESTS_LINK_SHARED "link tests to shared SDL library" "${SDL_SHARED}" "SDL_SHARED;SDL_STATIC" "${SDL_SHARED}")
set(SDL_TESTS_TIMEOUT_MULTIPLIER "1" CACHE STRING "Timeout multiplier to account for really slow machines")
@@ -658,12 +659,7 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
endif()
endif()
if(APPLE)
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)
if(NOT OPENBSD)
cmake_push_check_state()
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)"
@@ -1161,6 +1157,8 @@ if(SDL_LIBC)
check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
check_symbol_exists(gethostname "unistd.h" HAVE_GETHOSTNAME)
check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE)
check_symbol_exists(getresgid "unistd.h" HAVE_GETRESGID)
check_symbol_exists(getresuid "unistd.h" HAVE_GETRESUID)
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT)
check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
@@ -1292,22 +1290,25 @@ sdl_glob_sources(
"${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")
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)
# 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)
if(HAVE_GCC_FVISIBILITY)
set_property(TARGET SDL_uclibc PROPERTY C_VISIBILITY_PRESET "hidden")
endif()
endif()
if(HAVE_GCC_FVISIBILITY)
set_property(TARGET SDL_uclibc PROPERTY C_VISIBILITY_PRESET "hidden")
if(TARGET SDL3-static)
target_sources(SDL3-static PRIVATE ${SDL_UCLIBC_SOURCES})
endif()
# Enable/disable various subsystems of the SDL library
@@ -1764,6 +1765,7 @@ elseif(EMSCRIPTEN)
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set(SDL_DISABLE_DLOPEN_NOTES TRUE)
if(SDL_DLOPEN_NOTES)
set(CHECK_ELF_DLNOTES_SRC [==[
#ifndef __ELF__
@@ -1776,10 +1778,10 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
return argc + dlnote.hdr.a;
}
]==])
set(SDL_DISABLE_DLOPEN_NOTES FALSE)
check_c_source_compiles("${CHECK_ELF_DLNOTES_SRC}" COMPILER_SUPPORTS_ELFNOTES)
if(NOT COMPILER_SUPPORTS_ELFNOTES)
set(SDL_DISABLE_DLOPEN_NOTES TRUE)
if(COMPILER_SUPPORTS_ELFNOTES)
set(SDL_DISABLE_DLOPEN_NOTES FALSE)
set(HAVE_DLOPEN_NOTES TRUE)
endif()
endif()
@@ -3997,6 +3999,8 @@ if(SDL_SHARED)
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 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")
target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
endif()
@@ -4021,6 +4025,8 @@ if(SDL_STATIC)
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 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")
target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
endif()
@@ -4036,7 +4042,7 @@ sdl_compile_definitions(
##### Tests #####
if(SDL_TEST_LIBRARY)
file(GLOB TEST_SOURCES "${SDL3_SOURCE_DIR}/src/test/*.c")
file(GLOB TEST_SOURCES "${SDL3_SOURCE_DIR}/src/test/*.c" "${SDL3_SOURCE_DIR}/src/test/*.h")
target_sources(SDL3_test PRIVATE ${TEST_SOURCES})
if(APPLE)
set_target_properties(SDL3_test PROPERTIES

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
warranty. In no event will the authors be held liable for any damages

View File

@@ -469,6 +469,7 @@
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_report_descriptor.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
@@ -744,6 +745,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_zuiki.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_report_descriptor.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />

View File

@@ -88,6 +88,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_zuiki.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_report_descriptor.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
@@ -372,6 +373,7 @@
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_report_descriptor.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />

View File

@@ -195,6 +195,9 @@
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\test\SDL_test_internal.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\test\SDL_test_assert.c" />
<ClCompile Include="..\..\src\test\SDL_test_common.c" />

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

View File

@@ -383,6 +383,7 @@
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_report_descriptor.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
@@ -635,6 +636,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_zuiki.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_report_descriptor.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />

View File

@@ -675,6 +675,9 @@
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h">
<Filter>joystick\hidapi</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\hidapi\SDL_report_descriptor.h">
<Filter>joystick\hidapi</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h">
<Filter>joystick\windows</Filter>
</ClInclude>
@@ -1305,6 +1308,9 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_report_descriptor.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c">
<Filter>joystick\windows</Filter>
</ClCompile>

View File

@@ -161,6 +161,9 @@
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\test\SDL_test_internal.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\test\SDL_test_assert.c" />
<ClCompile Include="..\..\src\test\SDL_test_common.c" />

View File

@@ -7,44 +7,97 @@ This is a list of major changes in SDL's version history.
General:
* Added SDL_CreateAnimatedCursor() to create animated color cursors
* Added SDL_HINT_MOUSE_DPI_SCALE_CURSORS to automatically scale cursors based on the display scale
* Added SDL_SetWindowProgressState(), SDL_SetWindowProgressValue(), SDL_GetWindowProgressState(), and SDL_GetWindowProgressValue() to show progress in the window's taskbar icon on Windows and Linux
* Added SDL_GetGPUDeviceProperties() to get the properties of an SDL GPU device
* Added GPU device creation properties to enable the GPU API on older hardware if you're not using these features:
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN
* Added SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER to enable configuring Vulkan features when creating a GPU device
* Added SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN to allow requiring Vulkan hardware acceleration when creating a GPU device
* Added SDL_GetGPUDeviceProperties() to query information from a GPU device:
- SDL_PROP_GPU_DEVICE_NAME_STRING
- SDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING
- SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING
- SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING
* Added SDL_GetPixelFormatFromGPUTextureFormat() and SDL_GetGPUTextureFormatFromPixelFormat()
* Added SDL_CreateGPURenderer() and SDL_GetGPURendererDevice() to create a 2D renderer for use with GPU rendering.
* Added SDL_CreateGPURenderState(), SDL_SetGPURenderStateFragmentUniforms(), SDL_SetGPURenderState(), and SDL_DestroyGPURenderState() to use fragment shaders with a GPU 2D renderer
* Added SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER to create a 2D texture from an existing GPU texture
* Added SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER to get the GPU texture from a 2D texture when using the GPU 2D renderer
* Added support for YUV textures and HDR colorspaces to the GPU 2D renderer
* Added support for textures with palettes, and SDL_GetTexturePalette() and SDL_SetTexturePalette() to interact with them
* Added SDL_RenderTexture9GridTiled() to do tiled instead of stretched 9-grid texture rendering
* Added SDL_GetDefaultTextureScaleMode() and SDL_SetDefaultTextureScaleMode() to set the texture scale mode for new textures
* Added SDL_GetRenderTextureAddressMode() and SDL_SetRenderTextureAddressMode() to change the texture addressing mode
* Added SDL_TEXTURE_ADDRESS_WRAP to allow wrapping of textures if the renderer has SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN set
* The default YUV colorspace is BT.601 limited range, for compatibility with SDL2
* Added SDL_SCALEMODE_PIXELART as an improved scaling algorithm for pixel art without introducing blurring
* Added SDL_FLIP_HORIZONTAL_AND_VERTICAL to flip a surface both horizontally and vertically
* Added SDL_LoadPNG(), SDL_LoadPNG_IO(), SDL_SavePNG(), and SDL_SavePNG_IO() to load and save PNG images
* Added SDL_LoadSurface() and SDL_LoadSurface_IO() to detect BMP and PNG formats and load them as surfaces
* Added SDL_PROP_SURFACE_ROTATION_FLOAT to indicate the rotation needed to display camera images upright
* Added SDL_RotateSurface() to create a rotated copy of a surface
* SDL_EVENT_WINDOW_EXPOSED now sets data1 to true if it is sent during live resizing
* Added SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED, which is sent when the usable desktop bounds change
* Added SDL_EVENT_SCREEN_KEYBOARD_SHOWN, which is sent when the on-screen keyboard has been shown
* Added SDL_EVENT_SCREEN_KEYBOARD_HIDDEN, which is sent when the on-screen keyboard has been hidden
* Added pinch gesture events: SDL_EVENT_PINCH_BEGIN, SDL_EVENT_PINCH_UPDATE, SDL_EVENT_PINCH_END
* SDL_EVENT_AUDIO_DEVICE_ADDED will be sent during initialization for each audio device
* SDL_GetCameraPermissionState() returns SDL_CameraPermissionState instead of int
* Added SDL_PutAudioStreamDataNoCopy() to do more efficient audio stream processing in some cases
* Added SDL_PutAudioStreamPlanarData() to add planar audio data instead of interleaved data to an audio stream
* Added SDL_HINT_AUDIO_DEVICE_RAW_STREAM to signal that the OS shouldn't do further audio processing, useful for applications that handle noise canceling, etc.
* Added SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN to allow streams that persist beyond the audio subsystem lifetime.
* Added enhanced support for 8BitDo controllers
* Added enhanced support for FlyDigi controllers
* Added enhanced support for Hand Held Legend SInput controllers
* Added support for wired Nintendo Switch 2 controllers when built with libusb
* Added SDL_hid_get_properties() to associate SDL properties with HID devices
* Added SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER to query the libusb handle from an SDL_hid_device, if it's been opened with libusb
* Added SDL_SetRelativeMouseTransform() to add custom mouse input transformation
* Added SDL_GetPenDeviceType() to determine whether a pen is on the screen or on a separate touchpad
* SDL_HINT_MAIN_CALLBACK_RATE may be set to a floating point callback rate
* Added SDL_GetEventDescription() to get an English description of an event, suitable for logging
* Added SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER to allow custom freeing of the memory used by SDL_IOFromMem() and SDL_IOFromConstMem()
* Added SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING to set the working directory for new processes
* Added verbose log output when the DEBUG_INVOCATION environment variable is set to "1"
* Added SDL_AddAtomicU32()
* Added SDL_GetSystemPageSize() to get the system page size
* Added SDL_ALIGNED() to signal that data should have a specific alignment
Windows:
* Added SDL_HINT_RENDER_DIRECT3D11_WARP to enable D3D11 software rasterization
* Using SDL_InsertGPUDebugLabel(), SDL_PushGPUDebugGroup(), and SDL_PopGPUDebugGroup() requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable
* Added SDL_PROP_DISPLAY_WINDOWS_HMONITOR_POINTER so you can query the HMONITOR associated with a display
* SDL_HINT_AUDIO_DEVICE_STREAM_ROLE is used by the WASAPI audio driver to set the audio stream category
* Added SDL_HINT_AUDIO_DEVICE_RAW_STREAM to signal whether the OS audio driver should do additional signal processing
* Added SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS to allow disabling some system hotkeys when in raw input mode
* SDL_HINT_WINDOWS_GAMEINPUT is disabled by default
macOS:
* Added SDL_HINT_MAC_PRESS_AND_HOLD to control whether holding down a key will repeat the pressed key or open the accents menu
Linux:
* Added atomic support for KMSDRM
* Added SDL_HINT_KMSDRM_ATOMIC to control whether KMSDRM will use atomic functionality
* Added SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER so you can query the wl_output associated with a display
Emscripten:
* Added SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT for applications that don't want to be fullscreen, but would like to fill the window
* Added SDL_WINDOW_FILL_DOCUMENT to indicate that windows expand to fill the whole browser window
* Added SDL_SetWindowFillDocument() to change whether windows expand to fill the whole browser window
* Added SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING to allow setting the SDL canvas ID, and SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING to query it on existing windows
* Added SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING to specify where keyboard input is bound, and SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING to query it on existing windows
iOS:
* SDL now supports window scenes, fixing the warning "CLIENT OF UIKIT REQUIRES UPDATE"
* Added SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER to specify the window scene for a window
visionOS:
* The default refresh rate has been increased to 90Hz
* SDL_SetWindowSize() changes the size of the window on Vision Pro headsets
PlayStation 2:
* Added the following hints to control the display parameters: SDL_HINT_PS2_GS_WIDTH, SDL_HINT_PS2_GS_HEIGHT, SDL_HINT_PS2_GS_PROGRESSIVE, SDL_HINT_PS2_GS_MODE

View File

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

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 55;
objects = {
/* Begin PBXAggregateTarget section */
@@ -414,8 +414,8 @@
F386F6F02884663E001840AA /* SDL_utils_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F386F6E52884663E001840AA /* SDL_utils_c.h */; };
F386F6F92884663E001840AA /* SDL_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = F386F6E62884663E001840AA /* SDL_utils.c */; };
F388C95528B5F6F700661ECF /* SDL_hidapi_ps3.c in Sources */ = {isa = PBXBuildFile; fileRef = F388C95428B5F6F600661ECF /* SDL_hidapi_ps3.c */; };
F39344CE2E99771B0056986F /* SDL_dlopennote.h in Headers */ = {isa = PBXBuildFile; fileRef = F39344CD2E99771B0056986F /* SDL_dlopennote.h */; settings = {ATTRIBUTES = (Public, ); }; };
F38C72492CEEB1DE000B0A90 /* SDL_hidapi_steam_triton.c in Sources */ = {isa = PBXBuildFile; fileRef = F38C72482CEEB1DE000B0A90 /* SDL_hidapi_steam_triton.c */; };
F39344CE2E99771B0056986F /* SDL_dlopennote.h in Headers */ = {isa = PBXBuildFile; fileRef = F39344CD2E99771B0056986F /* SDL_dlopennote.h */; settings = {ATTRIBUTES = (Public, ); }; };
F395BF6525633B2400942BFF /* SDL_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = F395BF6425633B2400942BFF /* SDL_crc32.c */; };
F395C1932569C68F00942BFF /* SDL_iokitjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F395C1912569C68E00942BFF /* SDL_iokitjoystick_c.h */; };
F395C19C2569C68F00942BFF /* SDL_iokitjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F395C1922569C68E00942BFF /* SDL_iokitjoystick.c */; };
@@ -530,6 +530,10 @@
F3DDCC5B2AFD42B600B0842B /* SDL_video_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC522AFD42B600B0842B /* SDL_video_c.h */; };
F3DDCC5D2AFD42B600B0842B /* SDL_rect_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */; };
F3E5A6EB2AD5E0E600293D83 /* SDL_properties.c in Sources */ = {isa = PBXBuildFile; fileRef = F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */; };
F3E6C3932EE9F20000A6B39E /* SDL_report_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = F3E6C3922EE9F20000A6B39E /* SDL_report_descriptor.c */; };
F3E6C3942EE9F20000A6B39E /* SDL_hidapi_flydigi.h in Headers */ = {isa = PBXBuildFile; fileRef = F3E6C38F2EE9F20000A6B39E /* SDL_hidapi_flydigi.h */; };
F3E6C3952EE9F20000A6B39E /* SDL_hidapi_sinput.h in Headers */ = {isa = PBXBuildFile; fileRef = F3E6C3902EE9F20000A6B39E /* SDL_hidapi_sinput.h */; };
F3E6C3962EE9F20000A6B39E /* SDL_report_descriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = F3E6C3912EE9F20000A6B39E /* SDL_report_descriptor.h */; };
F3EFA5ED2D5AB97300BCF22F /* SDL_stb_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFA5EA2D5AB97300BCF22F /* SDL_stb_c.h */; };
F3EFA5EE2D5AB97300BCF22F /* stb_image.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFA5EC2D5AB97300BCF22F /* stb_image.h */; };
F3EFA5EF2D5AB97300BCF22F /* SDL_surface_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFA5EB2D5AB97300BCF22F /* SDL_surface_c.h */; };
@@ -998,8 +1002,8 @@
F386F6E52884663E001840AA /* SDL_utils_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_utils_c.h; sourceTree = "<group>"; };
F386F6E62884663E001840AA /* SDL_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_utils.c; sourceTree = "<group>"; };
F388C95428B5F6F600661ECF /* SDL_hidapi_ps3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_ps3.c; sourceTree = "<group>"; };
F39344CD2E99771B0056986F /* SDL_dlopennote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_dlopennote.h; sourceTree = "<group>"; };
F38C72482CEEB1DE000B0A90 /* SDL_hidapi_steam_triton.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_steam_triton.c; sourceTree = "<group>"; };
F39344CD2E99771B0056986F /* SDL_dlopennote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_dlopennote.h; sourceTree = "<group>"; };
F395BF6425633B2400942BFF /* SDL_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_crc32.c; sourceTree = "<group>"; };
F395C1912569C68E00942BFF /* SDL_iokitjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_iokitjoystick_c.h; sourceTree = "<group>"; };
F395C1922569C68E00942BFF /* SDL_iokitjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iokitjoystick.c; sourceTree = "<group>"; };
@@ -1113,6 +1117,10 @@
F3DDCC522AFD42B600B0842B /* SDL_video_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video_c.h; sourceTree = "<group>"; };
F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_impl.h; sourceTree = "<group>"; };
F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_properties.c; sourceTree = "<group>"; };
F3E6C38F2EE9F20000A6B39E /* SDL_hidapi_flydigi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_flydigi.h; sourceTree = "<group>"; };
F3E6C3902EE9F20000A6B39E /* SDL_hidapi_sinput.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_sinput.h; sourceTree = "<group>"; };
F3E6C3912EE9F20000A6B39E /* SDL_report_descriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_report_descriptor.h; sourceTree = "<group>"; };
F3E6C3922EE9F20000A6B39E /* SDL_report_descriptor.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_report_descriptor.c; sourceTree = "<group>"; };
F3EFA5E92D5AB97300BCF22F /* SDL_stb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_stb.c; sourceTree = "<group>"; };
F3EFA5EA2D5AB97300BCF22F /* SDL_stb_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_stb_c.h; sourceTree = "<group>"; };
F3EFA5EB2D5AB97300BCF22F /* SDL_surface_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_surface_c.h; sourceTree = "<group>"; };
@@ -1948,6 +1956,7 @@
children = (
F3395BA72D9A5971007246C8 /* SDL_hidapi_8bitdo.c */,
F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */,
F3E6C38F2EE9F20000A6B39E /* SDL_hidapi_flydigi.h */,
F3395BA72D9A5971007246C9 /* SDL_hidapi_flydigi.c */,
A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */,
F3B6B8092DC3EA54004954FD /* SDL_hidapi_gip.c */,
@@ -1960,6 +1969,7 @@
A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */,
A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */,
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */,
F3E6C3902EE9F20000A6B39E /* SDL_hidapi_sinput.h */,
02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */,
F3984CCF25BCC92800374F43 /* SDL_hidapi_stadia.c */,
A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */,
@@ -1975,6 +1985,8 @@
63124A412E5C357500A53610 /* SDL_hidapi_zuiki.c */,
A7D8A7C423E2513E00DCD162 /* SDL_hidapijoystick.c */,
A7D8A7C723E2513E00DCD162 /* SDL_hidapijoystick_c.h */,
F3E6C3912EE9F20000A6B39E /* SDL_report_descriptor.h */,
F3E6C3922EE9F20000A6B39E /* SDL_report_descriptor.c */,
);
path = hidapi;
sourceTree = "<group>";
@@ -2554,6 +2566,9 @@
F3D46ADB2D20625800D9CBDF /* SDL_pen.h in Headers */,
F3D46ADC2D20625800D9CBDF /* SDL_render.h in Headers */,
F3D46ADD2D20625800D9CBDF /* SDL_assert.h in Headers */,
F3E6C3942EE9F20000A6B39E /* SDL_hidapi_flydigi.h in Headers */,
F3E6C3952EE9F20000A6B39E /* SDL_hidapi_sinput.h in Headers */,
F3E6C3962EE9F20000A6B39E /* SDL_report_descriptor.h in Headers */,
F3D46ADE2D20625800D9CBDF /* SDL_atomic.h in Headers */,
F3D46ADF2D20625800D9CBDF /* SDL_begin_code.h in Headers */,
F3D46AE02D20625800D9CBDF /* SDL_log.h in Headers */,
@@ -2923,6 +2938,7 @@
F3C1BD752D1F1A3000846529 /* SDL_tray_utils.c in Sources */,
F382071D284F362F004DD584 /* SDL_guid.c in Sources */,
A7D8BB8D23E2514500DCD162 /* SDL_touch.c in Sources */,
F3E6C3932EE9F20000A6B39E /* SDL_report_descriptor.c in Sources */,
F31A92D228D4CB39003BFD6A /* SDL_offscreenopengles.c in Sources */,
A1626A3E2617006A003F1973 /* SDL_triangle.c in Sources */,
A7D8B3F223E2514300DCD162 /* SDL_thread.c in Sources */,
@@ -3145,8 +3161,8 @@
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 305.0.0;
DYLIB_CURRENT_VERSION = 305.0.0;
DYLIB_COMPATIBILITY_VERSION = 401.0.0;
DYLIB_CURRENT_VERSION = 401.3.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3181,7 +3197,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.3.4;
MARKETING_VERSION = 3.4.3;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
PRODUCT_NAME = SDL3;
@@ -3211,8 +3227,8 @@
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DYLIB_COMPATIBILITY_VERSION = 305.0.0;
DYLIB_CURRENT_VERSION = 305.0.0;
DYLIB_COMPATIBILITY_VERSION = 401.0.0;
DYLIB_CURRENT_VERSION = 401.3.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -3244,7 +3260,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.3.4;
MARKETING_VERSION = 3.4.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;

View File

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

View File

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

View File

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

View File

@@ -60,8 +60,8 @@ import java.util.Locale;
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 3;
private static final int SDL_MINOR_VERSION = 3;
private static final int SDL_MICRO_VERSION = 4;
private static final int SDL_MINOR_VERSION = 4;
private static final int SDL_MICRO_VERSION = 3;
/*
// 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")) {
return true;
}
if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.equals("X96-W")) {
return true;
}
if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.startsWith("TV")) {
if (Build.MANUFACTURER.equals("Amlogic") &&
(Build.MODEL.startsWith("TV") ||
Build.MODEL.equals("X96-W") ||
Build.MODEL.equals("A95X-R1"))) {
return true;
}
return false;

View File

@@ -6,6 +6,11 @@ import java.util.Comparator;
import java.util.List;
import android.content.Context;
import android.hardware.lights.Light;
import android.hardware.lights.LightsRequest;
import android.hardware.lights.LightsManager;
import android.hardware.lights.LightState;
import android.graphics.Color;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
@@ -25,7 +30,7 @@ public class SDLControllerManager
static native void nativeAddJoystick(int device_id, String name, String desc,
int vendor_id, int product_id,
int button_mask,
int naxes, int axis_mask, int nhats, boolean can_rumble);
int naxes, int axis_mask, int nhats, boolean can_rumble, boolean has_rgb_led);
static native void nativeRemoveJoystick(int device_id);
static native void nativeAddHaptic(int device_id, String name);
static native void nativeRemoveHaptic(int device_id);
@@ -69,6 +74,13 @@ public class SDLControllerManager
mJoystickHandler.pollInputDevices();
}
/**
* This method is called by SDL using JNI.
*/
static void joystickSetLED(int device_id, int red, int green, int blue) {
mJoystickHandler.setLED(device_id, red, green, blue);
}
/**
* This method is called by SDL using JNI.
*/
@@ -139,6 +151,8 @@ class SDLJoystickHandler {
String desc;
ArrayList<InputDevice.MotionRange> axes;
ArrayList<InputDevice.MotionRange> hats;
ArrayList<Light> lights;
LightsManager.LightsSession lightsSession;
}
static class RangeComparator implements Comparator<InputDevice.MotionRange> {
@Override
@@ -197,7 +211,7 @@ class SDLJoystickHandler {
/**
* Handles adding and removing of input devices.
*/
void pollInputDevices() {
synchronized void pollInputDevices() {
int[] deviceIds = InputDevice.getDeviceIds();
for (int device_id : deviceIds) {
@@ -211,6 +225,7 @@ class SDLJoystickHandler {
joystick.desc = getJoystickDescriptor(joystickDevice);
joystick.axes = new ArrayList<InputDevice.MotionRange>();
joystick.hats = new ArrayList<InputDevice.MotionRange>();
joystick.lights = new ArrayList<Light>();
List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();
Collections.sort(ranges, new RangeComparator());
@@ -225,18 +240,30 @@ class SDLJoystickHandler {
}
boolean can_rumble = false;
boolean has_rgb_led = false;
if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) {
VibratorManager manager = joystickDevice.getVibratorManager();
int[] vibrators = manager.getVibratorIds();
VibratorManager vibratorManager = joystickDevice.getVibratorManager();
int[] vibrators = vibratorManager.getVibratorIds();
if (vibrators.length > 0) {
can_rumble = true;
}
LightsManager lightsManager = joystickDevice.getLightsManager();
List<Light> lights = lightsManager.getLights();
for (Light light : lights) {
if (light.hasRgbControl()) {
joystick.lights.add(light);
}
}
if (!joystick.lights.isEmpty()) {
joystick.lightsSession = lightsManager.openSession();
has_rgb_led = true;
}
}
mJoysticks.add(joystick);
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
getVendorId(joystickDevice), getProductId(joystickDevice),
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, can_rumble);
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, can_rumble, has_rgb_led);
}
}
}
@@ -262,6 +289,16 @@ class SDLJoystickHandler {
SDLControllerManager.nativeRemoveJoystick(device_id);
for (int i = 0; i < mJoysticks.size(); i++) {
if (mJoysticks.get(i).device_id == device_id) {
if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) {
if (mJoysticks.get(i).lightsSession != null) {
try {
mJoysticks.get(i).lightsSession.close();
} catch (Exception e) {
// Session may already be unregistered when device disconnects
}
mJoysticks.get(i).lightsSession = null;
}
}
mJoysticks.remove(i);
break;
}
@@ -270,7 +307,7 @@ class SDLJoystickHandler {
}
}
protected SDLJoystick getJoystick(int device_id) {
synchronized protected SDLJoystick getJoystick(int device_id) {
for (SDLJoystick joystick : mJoysticks) {
if (joystick.device_id == device_id) {
return joystick;
@@ -453,6 +490,24 @@ class SDLJoystickHandler {
}
return button_mask;
}
void setLED(int device_id, int red, int green, int blue) {
if (Build.VERSION.SDK_INT < 31 /* Android 12.0 (S) */) {
return;
}
SDLJoystick joystick = getJoystick(device_id);
if (joystick == null || joystick.lights.isEmpty()) {
return;
}
LightsRequest.Builder lightsRequest = new LightsRequest.Builder();
LightState lightState = new LightState.Builder().setColor(Color.rgb(red, green, blue)).build();
for (Light light : joystick.lights) {
if (light.hasRgbControl()) {
lightsRequest.addLight(light, lightState);
}
}
joystick.lightsSession.requestLights(lightsRequest.build());
}
}
class SDLHapticHandler_API31 extends SDLHapticHandler {
@@ -587,7 +642,7 @@ class SDLHapticHandler {
}
}
void pollHapticDevices() {
synchronized void pollHapticDevices() {
final int deviceId_VIBRATOR_SERVICE = 999999;
boolean hasVibratorService = false;
@@ -635,7 +690,7 @@ class SDLHapticHandler {
}
}
protected SDLHaptic getHaptic(int device_id) {
synchronized protected SDLHaptic getHaptic(int device_id) {
for (SDLHaptic haptic : mHaptics) {
if (haptic.device_id == device_id) {
return haptic;
@@ -700,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
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);
consumed = true;

View File

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

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
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);
} else { // MotionEvent.TOOL_TYPE_FINGER or MotionEvent.TOOL_TYPE_UNKNOWN

View File

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

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# 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
# warranty. In no event will the authors be held liable for any damages

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#
# 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
# warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -406,7 +406,7 @@ int main(void)
printf(
"/*\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"
" 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"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# 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
# warranty. In no event will the authors be held liable for any damages
@@ -36,7 +36,7 @@ my $mem_used = 0;
print <<__EOF__;
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,162 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2020-07-26.22; # UTC
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
IFS=" "" $nl"
errstatus=0
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "umask 22"
umask 22
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
echo "umask 22"
umask 22
for file
do
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp=$pathcomp/
done
if test ! -z "$dirmode"; then
echo "chmod $dirmode $file"
chmod "$dirmode" "$file" || errstatus=$?
fi
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# 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
# warranty. In no event will the authors be held liable for any damages

View File

@@ -164,6 +164,22 @@ function(get_git_head_revision _refspecvar _hashvar)
"${GIT_DATA}/grabRef.cmake" @ONLY)
include("${GIT_DATA}/grabRef.cmake")
# Fallback for reftable or other storage formats
if(NOT HEAD_HASH OR HEAD_HASH STREQUAL "")
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE HEAD_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(HEAD_HASH "")
endif()
endif()
endif()
set(${_refspecvar}
"${HEAD_REF}"
PARENT_SCOPE)

View File

@@ -25,19 +25,21 @@ if(HEAD_CONTENTS MATCHES "ref")
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
elseif(EXISTS "@GIT_DIR@/packed-refs")
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
elseif(EXISTS "@GIT_DIR@/reftable/tables.list")
configure_file("@GIT_DIR@/reftable/tables.list" "@GIT_DATA@/reftable-tables.list" COPYONLY)
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
if(NOT HEAD_HASH AND EXISTS "@GIT_DATA@/head-ref")
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

View File

@@ -402,7 +402,7 @@ macro(CheckX11)
endif()
set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
else()
SDL_missing_dependency(XCURSOR, SDL_X11_XCURSOR)
SDL_missing_dependency(XCURSOR SDL_X11_XCURSOR)
endif()
endif()
@@ -411,7 +411,7 @@ macro(CheckX11)
set(HAVE_X11_XDBE TRUE)
set(SDL_VIDEO_DRIVER_X11_XDBE 1)
else()
SDL_missing_dependency(XDBE, SDL_X11_XDBE)
SDL_missing_dependency(XDBE SDL_X11_XDBE)
endif()
endif()
@@ -457,7 +457,7 @@ macro(CheckX11)
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
int event_type = XI_GesturePinchBegin;
XITouchClassInfo *t;
XIGesturePinchEvent *t;
Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) {
return (Status)0;
}
@@ -467,7 +467,7 @@ macro(CheckX11)
endif()
else()
SDL_missing_dependency(XINPUT, SDL_X11_XINPUT)
SDL_missing_dependency(XINPUT SDL_X11_XINPUT)
endif()
endif()
@@ -491,7 +491,7 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_XFIXES 1)
set(HAVE_X11_XFIXES TRUE)
else()
SDL_missing_dependency(XFIXES, SDL_X11_XFIXES)
SDL_missing_dependency(XFIXES SDL_X11_XFIXES)
endif()
endif()
@@ -500,7 +500,7 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_XSYNC 1)
set(HAVE_X11_XSYNC TRUE)
else()
SDL_missing_dependency(XSYNC, SDL_X11_XSYNC)
SDL_missing_dependency(XSYNC SDL_X11_XSYNC)
endif()
endif()
@@ -514,7 +514,7 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
set(HAVE_X11_XRANDR TRUE)
else()
SDL_missing_dependency(XRANDR, SDL_X11_XRANDR)
SDL_missing_dependency(XRANDR SDL_X11_XRANDR)
endif()
endif()
@@ -528,7 +528,7 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
set(HAVE_X11_XSCRNSAVER TRUE)
else()
SDL_missing_dependency(XSCRNSAVER, SDL_X11_XSCRNSAVER)
SDL_missing_dependency(XSCRNSAVER SDL_X11_XSCRNSAVER)
endif()
endif()
@@ -537,7 +537,7 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
set(HAVE_X11_XSHAPE TRUE)
else()
SDL_missing_dependency(XSHAPE, SDL_X11_XSHAPE)
SDL_missing_dependency(XSHAPE SDL_X11_XSHAPE)
endif()
endif()
@@ -1113,22 +1113,22 @@ macro(CheckUSBHID)
cmake_push_check_state()
check_library_exists(usbhid hid_init "" 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)
set(USB_CFLAGS "-DHAVE_USBHID_H")
endif()
check_include_file(libusbhid.h HAVE_LIBUSBHID_H)
check_include_files("stdint.h;libusbhid.h" HAVE_LIBUSBHID_H)
if(HAVE_LIBUSBHID_H)
string(APPEND USB_CFLAGS " -DHAVE_LIBUSBHID_H")
endif()
set(USB_LIBS ${USB_LIBS} usbhid)
else()
check_include_file(usb.h HAVE_USB_H)
check_include_files("stdint.h;usb.h" HAVE_USB_H)
if(HAVE_USB_H)
set(USB_CFLAGS "-DHAVE_USB_H")
endif()
check_include_file(libusb.h HAVE_LIBUSB_H)
check_include_files("stdint.h;libusb.h" HAVE_LIBUSB_H)
if(HAVE_LIBUSB_H)
string(APPEND USB_CFLAGS " -DHAVE_LIBUSB_H")
endif()
@@ -1141,7 +1141,7 @@ macro(CheckUSBHID)
string(APPEND CMAKE_REQUIRED_FLAGS " ${USB_CFLAGS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES ${USB_LIBS})
check_c_source_compiles("
#include <sys/types.h>
#include <stdint.h>
#if defined(HAVE_USB_H)
#include <usb.h>
#endif
@@ -1167,7 +1167,7 @@ macro(CheckUSBHID)
}" HAVE_USBHID)
if(HAVE_USBHID)
check_c_source_compiles("
#include <sys/types.h>
#include <stdint.h>
#if defined(HAVE_USB_H)
#include <usb.h>
#endif
@@ -1195,7 +1195,7 @@ macro(CheckUSBHID)
endif()
check_c_source_compiles("
#include <sys/types.h>
#include <stdint.h>
#if defined(HAVE_USB_H)
#include <usb.h>
#endif
@@ -1270,12 +1270,15 @@ macro(CheckHIDAPI)
cmake_pop_check_state()
if(HAVE_LIBUSB_H)
set(HAVE_LIBUSB TRUE)
target_get_dynamic_library(dynamic_libusb LibUSB::LibUSB)
if(SDL_HIDAPI_LIBUSB_SHARED AND dynamic_libusb)
set(HAVE_HIDAPI_LIBUSB_SHARED ON)
set(SDL_LIBUSB_DYNAMIC "\"${dynamic_libusb}\"")
sdl_link_dependency(hidapi INCLUDES $<TARGET_PROPERTY:LibUSB::LibUSB,INTERFACE_INCLUDE_DIRECTORIES>)
else()
if(SDL_HIDAPI_LIBUSB_SHARED)
target_get_dynamic_library(dynamic_libusb LibUSB::LibUSB)
if(dynamic_libusb)
set(HAVE_HIDAPI_LIBUSB_SHARED ON)
set(SDL_LIBUSB_DYNAMIC "\"${dynamic_libusb}\"")
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)
endif()
endif()

View File

@@ -30,12 +30,12 @@ SDL_LDFLAGS="$( pkg-config sdl3 --libs )"
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"
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_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_CFLAGS $CFLAGS $SDL_STATIC_LDFLAGS $LDFLAGS"
echo "-- CC: $CC"
echo "-- CFLAGS: $CFLAGS"
echo "-- LDFLASG: $LDFLAGS"
echo "-- LDFLAGS: $LDFLAGS"
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"

View File

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

View File

@@ -4,3 +4,4 @@ SDL is fully supported on BSD platforms, and is built using [CMake](README-cmake
If you want to run on the console, you can take a look at [KMSDRM support on BSD](README-kmsbsd.md)
SDL is [not designed to be used in setuid or setgid executables](README-platforms.md#setuid).

View File

@@ -210,12 +210,15 @@ Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
present anything on the screen until your return from your mainloop
function.
Note that on other platforms, SDL will default to vsync _off_ in the 2D render
API. Since changing this will affect how the mainloop runs, the 2D render API
will only change vsync settings if explicitly requested by the app, either
with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER, or calling
SDL_SetRenderVSync(). Otherwise it will default to whatever the Emscripten
mainloop is set to use via emscripten_set_main_loop().
Note that SDL attempts to default to vsync _off_ on all platforms. You almost
certainly do _not_ want this in Emscripten, however, as it will affect the
efficiency of the mainloop. If using OpenGL directly, you should call
SDL_GL_SetSwapInterval(1) sometime near startup; if using the 2D render API,
either create the renderer with with the property
SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER set to 1, or call
SDL_SetRenderVSync(renderer, 1). If you don't explicitly set vsync, you'll get
a higher (but perhaps unstable) framerate, and use more power, but it will
still work. Choosing a vsync of 1 will use requestAnimationFrame if possible.
If you're using the SDL main callbacks, the mainloop defaults to using
requestAnimationFrame (effectively vsync), because it calls
@@ -374,9 +377,9 @@ If you try debugging in Firefox and it doesn't work well for no apparent
reason, try Chrome, and vice-versa. These tools are still relatively new,
and improving all the time.
SDL_Log() (or even plain old printf) will write to the Javascript console,
and honestly I find printf-style debugging to be easier than setting up a build
for proper debugging, so use whatever tools work best for you.
SDL_Log() (or printf) will write to the Javascript console,
so printf-style debugging can be easier than setting up a build
for proper debugging. Use whatever tools work best for you.
## Questions?

View File

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

View File

@@ -73,6 +73,7 @@ Embedding the SDL3 Xcode project makes SDL3.framework a target of your app, so i
fi
```
3. Below the script entry uncheck the "Run Script:" options "For install builds only" and "Based on dependency analysis"
4. Edit the Build Settings and set "User Script Sandboxing" to "No".
TODO: Add information regarding App Store requirements such as icons, etc.

View File

@@ -8,6 +8,7 @@ system does not have the XRandR libraries installed, it will be disabled
at runtime, and you won't get a missing library error, at least with the
default configuration parameters.
SDL is [not designed to be used in setuid or setgid executables](README-platforms.md#setuid).
Build Dependencies
--------------------------------------------------------------------------------
@@ -36,6 +37,8 @@ Fedora 35, all available features enabled:
Fedora 39+ can also add `liburing-devel` to that command line.
Fedora 40+ needs `zlib-ng-compat-static` to be added to that command line.
NOTES:
- The sndio audio target is unavailable on Fedora (but probably not what you
should want to use anyhow).

View File

@@ -73,6 +73,8 @@ NSApplicationDelegate implementation:
}
```
SDL is [not designed to be used in setuid or setgid executables](README-platforms.md#setuid).
# Using the Simple DirectMedia Layer with a traditional Makefile
An existing build system for your SDL app has good chances to work almost

View File

@@ -45,3 +45,18 @@ All of these still work with [SDL2](/SDL2), which is an incompatible API, but an
- OS/2
- WinPhone
- WinRT/UWP
## General notes for Unix platforms
Some aspects of SDL functionality are common to all Unix-based platforms.
### <a name=setuid></a>Privileged processes (setuid, setgid, setcap)
SDL is not designed to be used in programs with elevated privileges,
such as setuid (`chmod u+s`) or setgid (`chmod g+s`) executables,
or executables with file-based capabilities
(`setcap cap_sys_nice+ep` or similar).
It does not make any attempt to avoid trusting environment variables
or other aspects of the inherited execution environment.
Programs running with elevated privileges in an attacker-controlled
execution environment should not call SDL functions.

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
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
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.
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 */
surface = SDL_LoadPNG(png_path);
if (!surface) {
SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
SDL_Log("Couldn't load png: %s", SDL_GetError());
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.
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! */
/* 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
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
warranty. In no event will the authors be held liable for any damages

View File

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

View File

@@ -1,6 +1,6 @@
/*
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
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.3.4
* Main include header for the SDL library, version 3.4.3
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -136,7 +136,7 @@ extern "C" {
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
#elif SDL_HAS_BUILTIN(__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" )
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
@@ -160,7 +160,7 @@ extern "C" {
#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 "???".
*
@@ -168,13 +168,15 @@ extern "C" {
*/
#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__
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
#endif
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION

View File

@@ -1,6 +1,6 @@
/*
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
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
* 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.
*
* \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
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LoadFile_IO

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -577,6 +577,15 @@ extern SDL_DECLSPEC SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevices(int
/**
* Get the human-readable name of a specific audio device.
*
* **WARNING**: this function will work with SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK
* and SDL_AUDIO_DEVICE_DEFAULT_RECORDING, returning the current default
* physical devices' names. However, as the default device may change at any
* time, it is likely better to show a generic name to the user, like "System
* default audio device" or perhaps "default [currently %s]". Do not store
* this name to disk to reidentify the device in a later run of the program,
* as the default might change in general, and the string will be the name of
* a specific device and not the abstract system default.
*
* \param devid the instance ID of the device to query.
* \returns the name of the audio device, or NULL on failure; call
* SDL_GetError() for more information.
@@ -1340,7 +1349,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAudioStreamInputChannelMap
* \sa SDL_SetAudioStreamOutputChannelMap
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -469,7 +469,7 @@
#define NULL ((void *)0)
#endif
#endif /* NULL */
#endif /* ! macOS - breaks precompiled headers */
#endif /* __MACH__ */
#ifndef SDL_FALLTHROUGH
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -48,8 +48,7 @@ extern __inline int _SDL_bsr_watcom(Uint32);
/**
* Get the index of the most significant (set) bit in a 32-bit number.
*
* Result is undefined when called with 0. This operation can also be stated
* as "count leading zeroes" and "log base 2".
* This operation can also be stated as "count leading zeroes" and "log base 2".
*
* Note that this is a forced-inline function in a header, and not a public
* API function available in the SDL library (which is to say, the code is

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -32,21 +32,23 @@
* this CMake snippet to check for support:
*
* ```cmake
* set(CHECK_ELF_DLNOTES_SRC [==[
* #ifndef __ELF__
* ELF DL notes is only supported on ELF platforms
* #endif
* __attribute__ ((used,aligned(4),section(".note.dlopen"))) static const struct {
* struct { int a; int b; int c; } hdr; char name[4]; __attribute__((aligned(4))) char json[24];
* } dlnote = { { 4, 0x407c0c0aU, 16 }, "FDO", "[\\"a\\":{\\"a\\":\\"1\\",\\"b\\":\\"2\\"}]" };
* int main(int argc, char *argv[]) {
* return argc + dlnote.hdr.a;
* }
* ]==])
* check_c_source_compiles("${CHECK_ELF_DLNOTES_SRC}" COMPILER_SUPPORTS_ELFNOTES)
* if(NOT COMPILER_SUPPORTS_ELFNOTES)
* set(SDL_DISABLE_DLOPEN_NOTES TRUE)
* endif()
* include(CheckCSourceCompiles)
* find_package(SDL3 REQUIRED CONFIG COMPONENTS Headers)
* list(APPEND CMAKE_REQUIRED_LIBRARIES SDL3::Headers)
* check_c_source_compiles([==[
* #include <SDL3/SDL_dlopennote.h>
* SDL_ELF_NOTE_DLOPEN("sdl-video",
* "Support for video through SDL",
* SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
* "libSDL-1.2.so.0", "libSDL-2.0.so.0", "libSDL3.so.0"
* )
* int main(int argc, char *argv[]) {
* return argc + argv[0][1];
* }
* ]==] COMPILER_SUPPORTS_SDL_ELF_NOTE_DLOPEN)
* if(NOT COMPILER_SUPPORTS_SDL_ELF_NOTE_DLOPEN)
* add_compile_definitions(-DSDL_DISABLE_DLOPEN_NOTE)
* endif()
* ```
*/
@@ -141,36 +143,37 @@
#define SDL_ELF_NOTE_INTERNAL(json, variable_name) \
SDL_ELF_NOTE_INTERNAL2(json, variable_name)
#define SDL_SONAME_ARRAY1(N1) "[\"" N1 "\"]"
#define SDL_SONAME_ARRAY2(N1,N2) "[\"" N1 "\",\"" N2 "\"]"
#define SDL_SONAME_ARRAY3(N1,N2,N3) "[\"" N1 "\",\"" N2 "\",\"" N3 "\"]"
#define SDL_SONAME_ARRAY4(N1,N2,N3,N4) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\"]"
#define SDL_SONAME_ARRAY5(N1,N2,N3,N4,N5) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\"]"
#define SDL_SONAME_ARRAY6(N1,N2,N3,N4,N5,N6) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\",\"" N6 "\"]"
#define SDL_SONAME_ARRAY7(N1,N2,N3,N4,N5,N6,N7) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\",\"" N6 "\",\"" N7 "\"]"
#define SDL_SONAME_ARRAY8(N1,N2,N3,N4,N5,N6,N7,N8) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\",\"" N6 "\",\"" N7 "\",\"" N8 "\"]"
#define SDL_SONAME_ARRAY_GET(N1,N2,N3,N4,N5,N6,N7,N8,NAME,...) NAME
#define SDL_SONAME_ARRAY(...) \
SDL_SONAME_ARRAY_GET(__VA_ARGS__, \
SDL_SONAME_ARRAY8, \
SDL_SONAME_ARRAY7, \
SDL_SONAME_ARRAY6, \
SDL_SONAME_ARRAY5, \
SDL_SONAME_ARRAY4, \
SDL_SONAME_ARRAY3, \
SDL_SONAME_ARRAY2, \
SDL_SONAME_ARRAY1 \
#define SDL_DLNOTE_JSON_ARRAY1(N1) "[\"" N1 "\"]"
#define SDL_DLNOTE_JSON_ARRAY2(N1,N2) "[\"" N1 "\",\"" N2 "\"]"
#define SDL_DLNOTE_JSON_ARRAY3(N1,N2,N3) "[\"" N1 "\",\"" N2 "\",\"" N3 "\"]"
#define SDL_DLNOTE_JSON_ARRAY4(N1,N2,N3,N4) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\"]"
#define SDL_DLNOTE_JSON_ARRAY5(N1,N2,N3,N4,N5) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\"]"
#define SDL_DLNOTE_JSON_ARRAY6(N1,N2,N3,N4,N5,N6) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\",\"" N6 "\"]"
#define SDL_DLNOTE_JSON_ARRAY7(N1,N2,N3,N4,N5,N6,N7) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\",\"" N6 "\",\"" N7 "\"]"
#define SDL_DLNOTE_JSON_ARRAY8(N1,N2,N3,N4,N5,N6,N7,N8) "[\"" N1 "\",\"" N2 "\",\"" N3 "\",\"" N4 "\",\"" N5 "\",\"" N6 "\",\"" N7 "\",\"" N8 "\"]"
#define SDL_DLNOTE_JSON_ARRAY_GET(N1,N2,N3,N4,N5,N6,N7,N8,NAME,...) NAME
#define SDL_DLNOTE_JSON_ARRAY(...) \
SDL_DLNOTE_JSON_ARRAY_GET( \
__VA_ARGS__, \
SDL_DLNOTE_JSON_ARRAY8, \
SDL_DLNOTE_JSON_ARRAY7, \
SDL_DLNOTE_JSON_ARRAY6, \
SDL_DLNOTE_JSON_ARRAY5, \
SDL_DLNOTE_JSON_ARRAY4, \
SDL_DLNOTE_JSON_ARRAY3, \
SDL_DLNOTE_JSON_ARRAY2, \
SDL_DLNOTE_JSON_ARRAY1 \
)(__VA_ARGS__)
/* Create "unique" variable name using __LINE__,
* so creating elf notes on the same line is not supported
* so creating multiple elf notes on the same line is not supported
*/
#define SDL_ELF_NOTE_JOIN2(A,B) A##B
#define SDL_ELF_NOTE_JOIN(A,B) SDL_ELF_NOTE_JOIN2(A,B)
#define SDL_ELF_NOTE_UNIQUE_NAME SDL_ELF_NOTE_JOIN(s_SDL_dlopen_note_, __LINE__)
#define SDL_DLNOTE_JOIN2(A,B) A##B
#define SDL_DLNOTE_JOIN(A,B) SDL_DLNOTE_JOIN2(A,B)
#define SDL_DLNOTE_UNIQUE_NAME SDL_DLNOTE_JOIN(s_SDL_dlopen_note_, __LINE__)
/**
* Note that your application has dynamic shared library dependencies.
* Add a note that your application has dynamic shared library dependencies.
*
* You can do this by adding the following to the global scope:
*
@@ -180,9 +183,11 @@
* "Support for loading PNG images using libpng (required for APNG)",
* SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
* "libpng12.so.0"
* );
* )
* ```
*
* A trailing semicolon is not needed.
*
* Or if you support multiple versions of a library, you can list them:
*
* ```c
@@ -192,9 +197,12 @@
* "Create windows through SDL video backend",
* SDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED
* "libSDL-1.2.so.0", "libSDL2-2.0.so.0", "libSDL3.so.0"
* );
* )
* ```
*
* This macro is not available for compilers that do not support variadic
* macro's.
*
* \since This macro is available since SDL 3.4.0.
*
* \sa SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED
@@ -206,8 +214,8 @@
"[{\"feature\":\"" feature \
"\",\"description\":\"" description \
"\",\"priority\":\"" priority \
"\",\"soname\":" SDL_SONAME_ARRAY(__VA_ARGS__) "}]", \
SDL_ELF_NOTE_UNIQUE_NAME)
"\",\"soname\":" SDL_DLNOTE_JSON_ARRAY(__VA_ARGS__) "}]", \
SDL_DLNOTE_UNIQUE_NAME);
#elif defined(__GNUC__) && __GNUC__ < 3
@@ -216,7 +224,6 @@
#elif defined(_MSC_VER) && _MSC_VER < 1400
/* Variadic macros are not supported */
#define SDL_ELF_NOTE_DLOPEN
#else

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -46,7 +46,7 @@
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
#if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch)
#if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch)
#ifndef __PRFCHWINTRIN_H
#define __PRFCHWINTRIN_H
static __inline__ void __attribute__((__always_inline__, __nodebug__))
@@ -208,7 +208,7 @@ _m_prefetch(void *__P)
#else
/* By default, assume that floats words follow the memory system mode. */
#define SDL_FLOATWORDORDER SDL_BYTEORDER
#endif /* __FLOAT_WORD_ORDER__ */
#endif /* SDL_WIKI_DOCUMENTATION_SECTION */
#endif /* !SDL_FLOATWORDORDER */

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
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.
*
* 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
* this event, immediately stored in the SDL Event structure -- not an event
* to follow.
* in the SDL_Event structure pointed to by `event`.
*
* If `event` is NULL, it simply returns 1 if there is an event in the queue,
* but will not remove it from 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.
*
* 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
* be done from the main loop and does not suspend the main loop while waiting

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -241,9 +241,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetUserFolder(SDL_Folder folder);
/**
* Types of filesystem entries.
*
* Note that there may be other sorts of items on a filesystem: devices,
* symlinks, named pipes, etc. They are currently reported as
* SDL_PATHTYPE_OTHER.
* Note that there may be other sorts of items on a filesystem: devices, named
* pipes, etc. They are currently reported as SDL_PATHTYPE_OTHER.
*
* \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.
*
* 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 info a pointer filled in with information about the path, or NULL to
* check for the existence of a file.

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -48,6 +48,9 @@
* SDL_INIT_GAMEPAD flag. This causes SDL to scan the system for gamepads, and
* load appropriate drivers.
*
* If you're using SDL gamepad support in a Steam game, you must call
* SteamAPI_InitEx() before calling SDL_Init().
*
* If you would like to receive gamepad updates while the application is in
* the background, you should set the following hint before calling
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
@@ -1278,7 +1281,7 @@ extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_
* You do not normally need to call this function unless you are parsing
* SDL_Gamepad mappings in your own code.
*
* \param str string representing a SDL_Gamepad axis.
* \param str string representing a SDL_Gamepad button.
* \returns the SDL_GamepadButton enum corresponding to the input string, or
* `SDL_GAMEPAD_BUTTON_INVALID` if no match was found.
*
@@ -1492,7 +1495,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *game
* Get the current state of a gamepad sensor.
*
* The number of values and interpretation of the data is sensor dependent.
* See SDL_sensor.h for the details for each type of sensor.
* See the remarks in SDL_SensorType for details for each type of sensor.
*
* \param gamepad the gamepad to query.
* \param type the type of sensor to query.

View File

@@ -1,6 +1,6 @@
/*
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
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
* is considered to be tightly packed.
*
* **WARNING**: Direct3D 12 requires texture data row pitch to be 256 byte
* aligned, and offsets to be aligned to 512 bytes. If they are not, SDL will
* make a temporary copy of the data that is properly aligned, but this adds
* overhead to the transfer process. Apps can avoid this by aligning their
* data appropriately, or using a different GPU backend than Direct3D 12.
* **WARNING**: On some older/integrated hardware, Direct3D 12 requires
* texture data row pitch to be 256 byte aligned, and offsets to be aligned to
* 512 bytes. If they are not, SDL will make a temporary copy of the data that
* is properly aligned, but this adds overhead to the transfer process. Apps
* can avoid this by aligning their data appropriately, or using a different
* GPU backend than Direct3D 12.
*
* \since This struct is available since SDL 3.2.0.
*
@@ -2306,6 +2307,21 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
* useful for targeting Intel Haswell and Broadwell GPUs; other hardware
* either supports Tier 2 Resource Binding or does not support D3D12 in any
* 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:
*
@@ -2321,6 +2337,15 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
* increasing the API version and opting into extensions aside from the
* 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.
* \returns a GPU context on success or NULL on failure; call SDL_GetError()
* 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_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_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_METAL_ALLOW_MACFAMILY1_BOOLEAN "SDL.gpu.device.create.metal.allowmacfamily1"
/**
@@ -2361,7 +2389,7 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDeviceWithProperties(
* When no such structure is provided, SDL will use Vulkan API version 1.0 and
* a minimal set of features. The requested API version influences how the
* feature_list is processed by SDL. When requesting API version 1.0, the
* feature_list is ignored. Only the vulkan_10_phyisical_device_features and
* feature_list is ignored. Only the vulkan_10_physical_device_features and
* the extension lists are used. When requesting API version 1.1, the
* feature_list is scanned for feature structures introduced in Vulkan 1.1.
* When requesting Vulkan 1.2 or higher, the feature_list is additionally
@@ -3139,7 +3167,7 @@ extern SDL_DECLSPEC SDL_GPUCommandBuffer * SDLCALL SDL_AcquireGPUCommandBuffer(
/**
* Pushes data to a vertex uniform slot on the command buffer.
*
* Subsequent draw calls will use this uniform data.
* Subsequent draw calls in this command buffer will use this uniform data.
*
* The data being pushed must respect std140 layout conventions. In practical
* terms this means you must ensure that vec3 and vec4 fields are 16-byte
@@ -3164,7 +3192,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData(
/**
* Pushes data to a fragment uniform slot on the command buffer.
*
* Subsequent draw calls will use this uniform data.
* Subsequent draw calls in this command buffer will use this uniform data.
*
* The data being pushed must respect std140 layout conventions. In practical
* terms this means you must ensure that vec3 and vec4 fields are 16-byte
@@ -3186,7 +3214,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData(
/**
* Pushes data to a uniform slot on the command buffer.
*
* Subsequent draw calls will use this uniform data.
* Subsequent draw calls in this command buffer will use this uniform data.
*
* The data being pushed must respect std140 layout conventions. In practical
* terms this means you must ensure that vec3 and vec4 fields are 16-byte
@@ -3672,7 +3700,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline(
* The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
* SDL_CreateGPUComputePipeline().
*
* \param compute_pass a compute pass handle.
* \param first_slot the compute sampler slot to begin binding from.
@@ -3683,7 +3711,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline(
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
* \sa SDL_CreateGPUComputePipeline
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeSamplers(
SDL_GPUComputePass *compute_pass,
@@ -3698,7 +3726,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeSamplers(
* SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
* SDL_CreateGPUComputePipeline().
*
* \param compute_pass a compute pass handle.
* \param first_slot the compute storage texture slot to begin binding from.
@@ -3707,7 +3735,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeSamplers(
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
* \sa SDL_CreateGPUComputePipeline
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures(
SDL_GPUComputePass *compute_pass,
@@ -3722,7 +3750,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures(
* SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
* SDL_CreateGPUComputePipeline().
*
* \param compute_pass a compute pass handle.
* \param first_slot the compute storage buffer slot to begin binding from.
@@ -3731,7 +3759,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures(
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
* \sa SDL_CreateGPUComputePipeline
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers(
SDL_GPUComputePass *compute_pass,
@@ -3903,6 +3931,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer(
* This copy occurs on the GPU timeline. You may assume the copy has finished
* in subsequent commands.
*
* This function does not support copying between depth and color textures.
* For those, copy the texture to a buffer and then to the destination
* texture.
*
* \param copy_pass a copy pass handle.
* \param source a source texture region.
* \param destination a destination texture region.

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -1392,7 +1392,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects
* \sa SDL_StopHapticEffect
*/
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -787,32 +787,6 @@ extern "C" {
*/
#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
/**
* Dictate that windows on Emscripten will fill the whole browser window.
*
* When enabled, the canvas element fills the entire document. Resize events
* will be generated as the browser window is resized, as that will adjust the
* canvas size as well. The canvas will cover anything else on the page,
* including any controls provided by Emscripten in its generated HTML file
* (in fact, any elements on the page that aren't the canvas will be moved
* into a hidden `div` element).
*
* Often times this is desirable for a browser-based game, but it means
* several things that we expect of an SDL window on other platforms might not
* work as expected, such as minimum window sizes and aspect ratios.
*
* This hint overrides SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN
* properties when creating an SDL window.
*
* This hint only applies to the Emscripten platform.
*
* This hint can be set at any time (before creating the window, or to toggle
* its state later). Only one window can fill the document at a time.
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT "SDL_EMSCRIPTEN_FILL_DOCUMENT"
/**
* A variable that controls whether the on-screen keyboard should be shown
* when text input is active.
@@ -1110,6 +1084,21 @@ extern "C" {
*/
#define SDL_HINT_HIDAPI_LIBUSB "SDL_HIDAPI_LIBUSB"
/**
* A variable to control whether HIDAPI uses libusb for GameCube adapters.
*
* The variable can be set to the following values:
*
* - "0": HIDAPI will not use libusb for GameCube adapters.
* - "1": HIDAPI will use libusb for GameCube adapters if available. (default)
*
* This hint should be set before SDL is initialized.
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_HIDAPI_LIBUSB_GAMECUBE "SDL_HIDAPI_LIBUSB_GAMECUBE"
/**
* A variable to control whether HIDAPI uses libusb only for whitelisted
* devices.
@@ -1789,10 +1778,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for HORI licensed Steam
* controllers should be used.
*
* This variable can be set to the following values: "0" - HIDAPI driver is
* not used "1" - HIDAPI driver is used
* The variable can be set to the following values:
*
* 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"
@@ -1800,12 +1795,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for some Logitech wheels
* 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_LG4FF "SDL_JOYSTICK_HIDAPI_LG4FF"
@@ -1813,11 +1812,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for 8BitDo controllers
* 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"
@@ -1827,11 +1831,16 @@ extern "C" {
*
* 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"
@@ -1839,11 +1848,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for ZUIKI controllers
* 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"
@@ -1851,11 +1865,16 @@ extern "C" {
* A variable controlling whether the HIDAPI driver for Flydigi controllers
* 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"
@@ -2630,8 +2649,8 @@ extern "C" {
*
* The variable can be set to the following values:
*
* - "0": Holding a key will open the accents menu for that key.
* - "1": Holding a key will repeat the pressed key. (default)
* - "0": Holding a key will repeat the pressed key.
* - "1": Holding a key will open the accents menu for that key. (default)
*
* This hint needs to be set before SDL_Init().
*
@@ -2718,6 +2737,24 @@ extern "C" {
*/
#define SDL_HINT_MOUSE_DEFAULT_SYSTEM_CURSOR "SDL_MOUSE_DEFAULT_SYSTEM_CURSOR"
/**
* A variable setting whether we should scale cursors by the current display
* scale.
*
* The variable can be set to the following values:
*
* - "0": Cursors will not change size based on the display content scale.
* (default)
* - "1": Cursors will automatically match the display content scale (e.g. a
* 2x sized cursor will be used when the window is on a monitor with 200%
* scale). This is currently implemented on Windows and Wayland.
*
* This hint needs to be set before creating cursors.
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_MOUSE_DPI_SCALE_CURSORS "SDL_MOUSE_DPI_SCALE_CURSORS"
/**
* A variable controlling whether warping a hidden mouse cursor will activate
* relative mouse mode.
@@ -2969,6 +3006,46 @@ extern "C" {
*/
#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
*
@@ -3293,33 +3370,45 @@ extern "C" {
#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"
/**
* 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"
/**
* 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)
* - "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"
/**
* 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)
* - "NTSC": 60hz region
* - "PAL": 50hz region
* - "NTSC": 60hz region.
* - "PAL": 50hz region.
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_PS2_GS_MODE "SDL_PS2_GS_MODE"
@@ -3549,10 +3638,12 @@ extern "C" {
* prioritized in the list of displays, as exposed by calling
* SDL_GetDisplays(), with the first listed becoming the primary display. The
* naming convention can vary depending on the environment, but it is usually
* a connector name (e.g. 'DP-1', 'DP-2', 'HDMI-A-1',etc...).
* a connector name (e.g. 'DP-1', 'DP-2', 'HDMI-A-1', etc...).
*
* On Wayland and X11 desktops, the connector names associated with displays
* can typically be found by using the `xrandr` utility.
* On Wayland desktops, the connector names associated with displays can be
* found in the `name` property of the info output from `wayland-info -i
* wl_output`. On X11 desktops, the `xrandr` utility can be used to retrieve
* the connector names associated with displays.
*
* This hint is currently supported on the following drivers:
*
@@ -3733,8 +3824,10 @@ extern "C" {
* The variable can be set to the following values:
*
* - "0": Fullscreen windows will not be minimized when they lose focus.
* (default)
* - "1": Fullscreen windows are minimized when they lose focus.
* - "auto": Fullscreen windows are minimized when they lose focus if they use
* exclusive fullscreen modes, so the desktop video mode is restored.
* (default)
*
* This hint can be set anytime.
*
@@ -4425,6 +4518,23 @@ extern "C" {
*/
#define SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS"
/**
* A variable controlling whether the RIDEV_INPUTSINK flag is set when
* enabling Windows raw keyboard events.
*
* This enables the window to still receive input even if not in foreground.
*
* Focused windows that receive text input will still prevent input events from triggering.
*
* - "0": Input is not received when not in focus or foreground. (default)
* - "1": Input will be received even when not in focus or foreground.
*
* This hint can be set anytime.
*
* \since This hint is available since SDL 3.4.4.
*/
#define SDL_HINT_WINDOWS_RAW_KEYBOARD_INPUTSINK "SDL_WINDOWS_RAW_KEYBOARD_INPUTSINK"
/**
* A variable controlling whether SDL uses Kernel Semaphores on Windows.
*
@@ -4755,7 +4865,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetHintBoolean(const char *name, bool defau
* A callback used to send notifications of hint value changes.
*
* This is called an initial time during SDL_AddHintCallback with the hint's
* current value, and then again each time the hint's value changes.
* current value, and then again each time the hint's value changes. In the
* initial call, the current value is in both `oldValue` and `newValue`.
*
* \param userdata what was passed as `userdata` to SDL_AddHintCallback().
* \param name what was passed as `name` to SDL_AddHintCallback().

View File

@@ -1,6 +1,6 @@
/*
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
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
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \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
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \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.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \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 the initialization status of the specified subsystems.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \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
* 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.
*
* \sa SDL_Init

View File

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

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -48,7 +48,7 @@
* by default to SDLK_0...SDLK_9 on AZERTY layouts.
*
* Keys with the `SDLK_EXTENDED_MASK` bit set do not map to a scancode or
* unicode code point.
* Unicode code point.
*
* Many common keycodes are listed below, but this list is not exhaustive.
*

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
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
* longer needed.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_Locale ** SDLCALL SDL_GetPreferredLocales(int *count);

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -487,7 +487,8 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
/**
* Get the default log output function.
*
* \returns the default log output callback.
* \returns the default log output callback. It should be called with NULL for
* the userdata argument.
*
* \threadsafety It is safe to call this function from any thread.
*

View File

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

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
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
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \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
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ShowMessageBox

View File

@@ -1,6 +1,6 @@
/*
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
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.
* \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.
*
* \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.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \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.
* \returns a pointer.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC void * SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);

View File

@@ -1,6 +1,6 @@
/*
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
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
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url);

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -203,10 +203,10 @@ typedef Uint32 SDL_MouseButtonFlags;
* \sa SDL_SetRelativeMouseTransform
*/
typedef void (SDLCALL *SDL_MouseMotionTransformCallback)(
void *userdata,
Uint64 timestamp,
SDL_Window *window,
SDL_MouseID mouseID,
void *userdata,
Uint64 timestamp,
SDL_Window *window,
SDL_MouseID mouseID,
float *x, float *y
);
@@ -593,9 +593,10 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 *data,
* If this function is passed a surface with alternate representations added
* with SDL_AddSurfaceAlternateImage(), the surface will be interpreted as the
* content to be used for 100% display scale, and the alternate
* representations will be used for high DPI situations. For example, if the
* original surface is 32x32, then on a 2x macOS display or 200% display scale
* on Windows, a 64x64 version of the image will be used, if available. If a
* representations will be used for high DPI situations if
* SDL_HINT_MOUSE_DPI_SCALE_CURSORS is enabled. For example, if the original
* surface is 32x32, then on a 2x macOS display or 200% display scale on
* Windows, a 64x64 version of the image will be used, if available. If a
* matching version of the image isn't available, the closest larger size
* image will be downscaled to the appropriate size and be used instead, if
* available. Otherwise, the closest smaller image will be upscaled and be
@@ -730,7 +731,7 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
* You do not have to call SDL_DestroyCursor() on the return value, but it is
* safe to do so.
*
* \returns the default cursor on success or NULL on failuree; call
* \returns the default cursor on success or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety This function should only be called on the main thread.

View File

@@ -1,6 +1,6 @@
/*
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
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
* 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.
*
* \sa SDL_DestroyMutex
@@ -334,6 +336,8 @@ extern SDL_DECLSPEC SDL_Mutex * SDLCALL SDL_CreateMutex(void);
*
* \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.
*
* \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.
* \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.
*
* \sa SDL_LockMutex
@@ -374,6 +380,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQU
*
* \param mutex the mutex to unlock.
*
* \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.
*
* \sa SDL_LockMutex
@@ -392,6 +401,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(m
*
* \param mutex the mutex to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateMutex
@@ -457,6 +468,8 @@ typedef struct SDL_RWLock SDL_RWLock;
* \returns the initialized and unlocked read/write lock or NULL on failure;
* 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.
*
* \sa SDL_DestroyRWLock
@@ -497,6 +510,8 @@ extern SDL_DECLSPEC SDL_RWLock * SDLCALL SDL_CreateRWLock(void);
*
* \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.
*
* \sa SDL_LockRWLockForWriting
@@ -528,6 +543,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SD
*
* \param rwlock the read/write lock to lock.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockRWLockForReading
@@ -553,6 +570,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
* \param rwlock the rwlock to try to lock.
* \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.
*
* \sa SDL_LockRWLockForReading
@@ -583,6 +602,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
* \param rwlock the rwlock to try to lock.
* \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.
*
* \sa SDL_LockRWLockForWriting
@@ -607,6 +628,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
*
* \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.
*
* \sa SDL_LockRWLockForReading
@@ -627,6 +651,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEAS
*
* \param rwlock the rwlock to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateRWLock
@@ -670,6 +696,8 @@ typedef struct SDL_Semaphore SDL_Semaphore;
* \returns a new semaphore or NULL on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroySemaphore
@@ -689,6 +717,8 @@ extern SDL_DECLSPEC SDL_Semaphore * SDLCALL SDL_CreateSemaphore(Uint32 initial_v
*
* \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.
*
* \sa SDL_CreateSemaphore
@@ -707,6 +737,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
*
* \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.
*
* \sa SDL_SignalSemaphore
@@ -726,6 +758,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
* \param sem the semaphore to wait on.
* \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.
*
* \sa SDL_SignalSemaphore
@@ -746,6 +780,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
* indefinitely.
* \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.
*
* \sa SDL_SignalSemaphore
@@ -759,6 +795,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Si
*
* \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.
*
* \sa SDL_TryWaitSemaphore
@@ -773,6 +811,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SignalSemaphore(SDL_Semaphore *sem);
* \param sem the semaphore to query.
* \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.
*/
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem);
@@ -806,6 +846,8 @@ typedef struct SDL_Condition SDL_Condition;
* \returns a new condition variable or NULL on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BroadcastCondition
@@ -821,6 +863,8 @@ extern SDL_DECLSPEC SDL_Condition * SDLCALL SDL_CreateCondition(void);
*
* \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.
*
* \sa SDL_CreateCondition

View File

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

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages
@@ -54,11 +54,11 @@
* example, some platforms can manage multiple devices at the same time, but
* others will make any connected pens look like a single logical device, much
* how all USB mice connected to a computer will move the same system cursor.
* cursor. Other platforms might not support pen buttons, or the distance
* axis, etc. Very few platforms can even report _what_ functionality the pen
* supports in the first place, so best practices is to either build UI to let
* the user configure their pens, or be prepared to handle new functionality
* for a pen the first time an event is reported.
* Other platforms might not support pen buttons, or the distance axis, etc.
* Very few platforms can even report _what_ functionality the pen supports in
* the first place, so best practices is to either build UI to let the user
* configure their pens, or be prepared to handle new functionality for a pen
* the first time an event is reported.
*/
#ifndef SDL_pen_h_

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
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
* 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.
*/
extern SDL_DECLSPEC const char * SDLCALL SDL_GetPlatform(void);

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
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;
* call SDL_GetError() for more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);

View File

@@ -1,6 +1,6 @@
/*
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
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,6 +1,6 @@
/*
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
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
* 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.
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);

View File

@@ -1,6 +1,6 @@
/*
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
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`.
* \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.
*
* \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
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \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);
@@ -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
* 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.
*/
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.
* \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.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
@@ -423,9 +431,11 @@ SDL_FORCE_INLINE bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b
* \param B an SDL_FRect structure representing the second rectangle.
* \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.
*
* \sa SDL_GetRectIntersection
* \sa SDL_GetRectIntersectionFloat
*/
extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
@@ -440,6 +450,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A
* rectangles `A` and `B`.
* \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.
*
* \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
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \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);
@@ -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
* 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.
*/
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.
* \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.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);

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