Compare commits

...

701 Commits

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

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

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

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

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

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

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

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

Fixes #15057.

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

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

Fixes #15024.

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

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

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

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

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

We'll revisit this in the next SDL release.

Reference Issue #15058.

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

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

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

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

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

Reference Issue #14898.

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

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

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

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

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

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

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

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

Fixes #14898.

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

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

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

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

Fixes #14999.

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

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

Also allow SDL_FUNCTION to be redefined by the application.

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #7470.

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

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

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

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

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

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

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

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

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

Fixes #14878.

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

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

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

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

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

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

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

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

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

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

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

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

Extends commit 83fb7b6636.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Check for XIGesturePinchEvent in the test for enabling
SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE

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

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

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

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

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

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

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

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

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

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

(cherry picked from commit f472f93db8)
2026-01-02 07:37:56 -08:00
Zack Middleton
fd345ae2f9 Improve hint documentation
(cherry picked from commit 6247568a1b)
2026-01-02 07:33:17 -08:00
Kadir
c5dee0feb5 Add ProGuard rule for joystickSetLED method in SDLControllerManager
(cherry picked from commit cbcc565ca9)
2026-01-02 07:31:37 -08:00
Brad Smith
a6ff5646f4 cmake: Enable Vulkan support on OpenBSD
(cherry picked from commit 1d51671cbe)
2026-01-02 00:18:38 +01:00
Sam Lantinga
80c6a5f8d9 Updated copyright for 2026 2026-01-01 09:48:19 -08:00
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
Sam Lantinga
f173fd28f0 Updated to version 3.3.4 for preview release 2025-12-06 14:57:22 -08:00
Sam Lantinga
eba0630907 Fixed the directory in the enumeration callback for Steam storage
This is guaranteed to have a path separator at the end
2025-12-06 14:48:02 -08:00
Sam Lantinga
1978506112 Reverse file iteration in the Steam storage
This prevents us from skipping files if they are deleted from within the callback.
2025-12-06 14:09:58 -08:00
Sam Lantinga
eea8090f84 Steam storage improvements
* Implemented EnumerateStorageDirectory()
* Implemented RemoveStoragePath()
* Fixed init failure if the application previously crashed with a write batch in progress
* Allow creation of multiple Steam storage objects, the write batch is complete when the last storage is closed
* Check to see if a file exists in GetStoragePathInfo()
2025-12-06 13:27:51 -08:00
Ethan Lee
96b5c92780 render: D3D12 Xbox does not have COMPARISON_FUNC_NONE yet 2025-12-06 16:10:35 -05:00
Ethan Lee
b74ba6298c Xbox buildfix for IsWindowsBuildVersionAtLeast 2025-12-06 15:34:17 -05:00
SDL Wiki Bot
9369a341c6 Sync SDL3 wiki -> header
[ci skip]
2025-12-06 18:52:33 +00:00
Ryan C. Gordon
2c11d62d17 camera: Report rotation needed to account for device orientation.
Fixes #11476.
2025-12-06 13:51:10 -05:00
Sam Lantinga
6602f12744 SteamAPI_ISteamRemoteStorage_FileWrite() returns bool 2025-12-06 09:44:04 -08:00
LuncyBloont
ab67be7e5a Fix crash in UploadToTexture() on DX12. 2025-12-05 11:46:41 -08:00
Frank Praznik
3d2b79c096 x11: Drop emulated pointer button events
Drop emulated pointer button events, as scroll valuators are handled natively, and SDL emulates mouse events from touch events on its own.
2025-12-05 14:44:16 -05:00
Sam Lantinga
e047aeeb7c Added a Linux mapping for the ZhiXu GuliKit Controller D 2025-12-05 11:22:38 -08:00
Sam Lantinga
f38d31a811 Removed mappings for Xbox controllers supported by the Linux kernel
The mappings may vary between kernel versions, so we'll use the automatic mapping code to get the right one for the running system.
2025-12-05 11:22:38 -08:00
Sam Lantinga
71147216dc Removed entries for controllers that aren't Xbox controllers 2025-12-05 11:22:38 -08:00
Sam Lantinga
3659b2f100 Documentation tweak 2025-12-05 11:14:38 -08:00
Ryan C. Gordon
ade2720829 docs/README-main-functions: point to SDL3/NonstandardStartup wiki page.
Fixes #14513.
2025-12-05 13:26:43 -05:00
Ryan C. Gordon
69c78a7989 examples/renderer/03-lines: simplified casting on radians calculation. 2025-12-05 12:59:01 -05:00
SDL Wiki Bot
a5aa67882d Sync SDL3 wiki -> header
[ci skip]
2025-12-05 17:45:09 +00:00
Eddy Jansson
37715c4029 Document need to include SDL_revision.h
If you want access to the SDL_REVISION define,
you must explicitly include this header.

Language like this was present in the SDL2 version,
but disappeared in SDL3, even though it's still true.
2025-12-05 09:44:07 -08:00
Sam Lantinga
82593fd6c1 Revert "Add the revision to SDL_version.h"
This reverts commit a3992f504c.

The reason SDL_revision.h was not included by SDL.h or SDL_version.h is because SDL_revision.h changes with every git commit, causing a complete SDL rebuild for every trivial git commit.
2025-12-05 09:43:02 -08:00
SDL Wiki Bot
0f37491a8b Sync SDL3 wiki -> header
[ci skip]
2025-12-05 17:42:23 +00:00
Jakub Wasilewski
f5ea8805e1 Change how WinPixEventRuntime.dll is used under D3D12/Windows. (#14600)
* GPU: D3D12: Missing WinPixEventRuntime.dll now logs warning at device creation time.
* GPU: D3D12: Debug label functions are now a no-op when WinPixEventRuntime.dll is missing.
* Docs: GPU: Debug function documentation now notes WinPixEventRuntime.dll is required under D3D12.
2025-12-05 09:40:57 -08:00
Sam Lantinga
a3992f504c Add the revision to SDL_version.h 2025-12-05 09:14:03 -08:00
Sam Lantinga
27744952d1 testyuv: respect the --renderer parameter with --all
Also fixed a memory leak at shutdown
2025-12-05 08:46:58 -08:00
Anonymous Maarten
0e96cbd8ce tests: build tests with C99 standard by default 2025-12-05 08:30:52 -08:00
Sam Lantinga
5c7d549267 testyuv: added comprehensive testing of YUV texture rendering
This tests all supported colorspaces and YUV formats across all available renderers
2025-12-05 08:30:52 -08:00
Sam Lantinga
e41bdfafe4 testyuv: allow loading BMP files 2025-12-05 08:30:52 -08:00
Sam Lantinga
fc8d725367 testyuv: fixed crash if the test file couldn't be loaded 2025-12-05 08:30:52 -08:00
Sam Lantinga
03c932b9a7 testclipboard: load any image format supported by SDL 2025-12-05 08:30:52 -08:00
Sam Lantinga
09304831f6 Fixed issues with YUV texture updates in the 2D renderer 2025-12-05 08:30:52 -08:00
Ryan C. Gordon
8be18741e1 examples/renderer/03-lines: Fix incorrect angle calculation rendering circle.
This fix was contributed by GitHub user hushangazar (thanks!).

Closes #14599.
2025-12-05 10:36:41 -05:00
Vicki Pfau
8e644111c2 gamepad_db: Remove obsolete entry
This autodetects properly with modern SDL as-is
2025-12-04 21:35:59 -08:00
Ozkan Sezer
c7133a6720 stb_image.h: update mainstream issue/1838 patch from mainstream PR/1839
patch authored by @NBickford-NV.
2025-12-05 03:30:10 +03:00
Sam Lantinga
12e3162c5f Use the Vision Pro headset native refresh rate
The headset actually has dynamically adjusting refresh rate, but 90Hz is closer to it's normal operating mode.
2025-12-04 14:08:49 -08:00
Eddy Jansson
2cb9a4fcc1 log: Fix unlikely out-of-bounds issue.
In the unlikely case that the overflow check should fail,
the else clause would switch to the truncated stack message
without updating the len variable. This would contain the
return value from vsnprintf(), meaning it could point beyond
the buffer.

The subsequent code which trims NL and CR from the buffer,
would then read -- and possibly write -- out-of-bounds.

To fix this, we split the two joint conditions into separate
if-clauses, and adjust the len variable in the case where we
know the message buffer was truncated.
2025-12-04 13:19:53 -08:00
Ryan C. Gordon
bc17a8922b emscripten: Allow SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT to be toggled on a window.
Fixes #14567.
2025-12-04 15:39:47 -05:00
Anonymous Maarten
ccdc9231f5 test: allow GNU extensions 2025-12-04 19:22:19 +01:00
Anonymous Maarten
7b74fbb73f test: build testver in with the C90 standard
By building at least one test in C90 mode, we make sure the SDL headers are C90 compatible.
2025-12-04 18:50:19 +01:00
Sam Lantinga
b5dd0ee07b Relax the requirement that test programs be C90 compliant
Fixes https://github.com/libsdl-org/SDL/issues/14588
2025-12-04 07:30:28 -08:00
hwsmm
3b12019892 Fix an inverted condition in Wayland pen tip handling 2025-12-04 07:21:28 -08:00
Sam Lantinga
c61497b744 Account for indexed formats when matching texture formats
Fixes https://github.com/libsdl-org/SDL/issues/14569
2025-12-03 21:21:52 -08:00
Sam Lantinga
d83fa92d58 Added notes on main callbacks with other language bindings 2025-12-03 20:50:59 -08:00
cosmonaut
aae2f74ae6 GPU: Remove erroneous buffer usage flag from defrag process 2025-12-03 15:03:25 -08:00
milkmull
70c2f576c8 fixed issue where video events could be posted while system was quitting (#14572) 2025-12-03 14:17:11 -08:00
Sam Lantinga
f97e53509e Removed SDL_MAIN_AVAILABLE on platforms that don't benefit from it
We already set the main thread when creating a thread or calling SDL_Init(), and applications can call SDL_SetMainReady() themselves for special cases, so there isn't a lot of value of forcing everyone through the SDL_RunApp() flow.

Fixes https://github.com/libsdl-org/SDL/issues/14580
2025-12-03 14:11:25 -08:00
SDL Wiki Bot
36b85ce909 Sync SDL3 wiki -> header
[ci skip]
2025-12-03 20:01:41 +00:00
Jakub Wasilewski
5ae68e9a0f Docs: GPU: Added documentation on the WinPixEventRuntime.dll requirement to affected functions. 2025-12-03 12:00:17 -08:00
Jakub Wasilewski
0c5ad99ec1 GPU: D3D12: Use WinPixEventRuntime.dll for debug events when available.
This prevents validation errors on D3D12 caused by the previous solution
that utilized internal D3D12 functions. This is still the fallback
solution if WinPixEventRuntime.dll is not present in PATH, but a warning
is printed to let you know how to fix these errors.
2025-12-03 12:00:17 -08:00
Simon McVittie
65ef4df6d4 testver: Assert that SDL_GetRevision() starts with SDL-
https://github.com/libsdl-org/SDL/issues/14575

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-12-03 08:48:48 -08:00
Simon McVittie
cc681ffeda build-scripts: Include SDL- prefix in SDL_REVISION when built from tarball
https://github.com/libsdl-org/SDL/issues/14575

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-12-03 08:48:48 -08:00
Anonymous Maarten
3313cb9c4b release: verify SDL_REVISION contains SDL- 2025-12-03 17:13:06 +01:00
Toast
1dea7c801b Added Keychron V5 System Control to the controller blacklist 2025-12-03 07:08:42 -08:00
Toast
adb0013470 Added the Keychron Link reciever to the controller blacklist 2025-12-03 07:08:42 -08:00
Sam Lantinga
bffc4ccc50 Improved keycode documentation 2025-12-02 15:31:34 -08:00
Ryan C. Gordon
505cd6cd22 testautomation_video: Don't do fullscreen toggling tests on Emscripten.
SDL_SetWindowFullscreen now reports failure while a fullscreen transition is
already in progress on Emscripten, upsetting the test when it tries to come
back to windowed mode, but testautomation will never give correct results here
even when we fix the backend to queue pending reversal requests, because
you'll have to return to the Emscripten mainloop before these state changes
will occur.

It's just sort of luck this specific test passed before on this target.
2025-12-02 14:36:27 -05:00
Sam Lantinga
866ec367ad Fixed error messages for Steam storage 2025-12-02 09:43:58 -08:00
Sam Lantinga
f92435cdb9 Vulkan windows get the Vulkan GPU backend in the gpu renderer by default 2025-12-02 07:29:33 -08:00
SDL Wiki Bot
1961b16b78 Sync SDL3 wiki -> header
[ci skip]
2025-12-02 15:26:04 +00:00
Ethan Lee
dedab7b72c cocoa: Add SDL_HINT_MAC_PRESS_AND_HOLD hint 2025-12-02 10:24:39 -05:00
SDL Wiki Bot
6217672bde Sync SDL3 wiki -> header
[ci skip]
2025-12-02 12:36:00 +00:00
Sam Lantinga
e1edeab0c9 Added touch subsystem locking
Fixes https://github.com/libsdl-org/SDL/issues/14563
2025-12-02 01:11:38 -08:00
Sam Lantinga
22decf4783 Fixed some clang thread-safety warnings 2025-12-02 01:11:38 -08:00
Ryan C. Gordon
737be31c63 emscripten: Prevent fullscreen transitions while one is already in progress.
Fixes #14533.
2025-12-01 23:33:30 -05:00
Cameron Gutman
6d99204a82 quit: don't call signal() if we're using sigaction()
At best, this is a no-op.

At worst, it might:
 - Clobber a signal handler someone registered after us
 - Overwrite the signal mask or flags
 - Cause unregistration to fail (sigaction() isn't guaranteed to return the exact pointer passed to signal())
2025-12-01 17:31:55 -06:00
Evan Hemsley
2b1904a849 GPU: Prefer D3D12 over Vulkan when available 2025-12-01 17:50:23 -05:00
Ryan C. Gordon
c1db2b4bb0 Revert "hints: Added SDL_HINT_AUDIO_ENFORCE_MINIMUM_SPEC."
Revert "Sync SDL3 wiki -> header"

This reverts commits b7c8b2f29a and
29213efa65.
2025-12-01 14:39:48 -05:00
SDL Wiki Bot
29213efa65 Sync SDL3 wiki -> header
[ci skip]
2025-12-01 04:28:01 +00:00
unknown
b7c8b2f29a hints: Added SDL_HINT_AUDIO_ENFORCE_MINIMUM_SPEC.
Fixes #14426.
2025-11-30 23:26:02 -05:00
Sam Lantinga
ea1514ab63 testthread: verify that child threads aren't SDL_IsMainThread() 2025-11-30 12:15:48 -08:00
Sam Lantinga
955698c635 testthread: SDL performs thread initialization automatically 2025-11-30 12:15:48 -08:00
Sam Lantinga
1c46c8a3dc Set SDL_MAIN_AVAILABLE for all platforms 2025-11-30 12:15:48 -08:00
Sam Lantinga
778f70c906 Clarify which thread is the main thread
If video is initialized, the main thread is the one that initialized video, otherwise if events are initialized, the main thread is the thread that initialized events, otherwise the main thread is the one that called the main function.

Fixes https://github.com/libsdl-org/SDL/issues/14511
2025-11-30 12:15:48 -08:00
Ozkan Sezer
9c6c2387b9 stb_image.h: apply patches from mainstream PRs 1839, 1862 and 1863.
Patches authored by @NBickford-NV to fix mainstream issues 1838, 1860,
1861.
2025-11-30 23:11:20 +03:00
Sam Lantinga
5e9163592f Correct the sensor axis ordering with the Linux Nintendo driver
Fixes https://github.com/libsdl-org/SDL/issues/14552
2025-11-30 11:35:36 -08:00
Sam Lantinga
b9d794bb37 Fixed pen mouse motion when SDL_HINT_PEN_MOUSE_EVENTS is off (thanks @frenzibyte!)
Fixes https://github.com/libsdl-org/SDL/issues/14554
2025-11-30 10:55:47 -08:00
Salman Alshamrani
7af479bc53 Fix iOS text input not working with password integration 2 2025-11-30 10:30:06 -08:00
Amelia Clarke
defd7895da events: fix SDL_PeepEvents() returning 0 on error
Signed-off-by: Amelia Clarke <selene@perilune.dev>
2025-11-28 07:41:30 -08:00
SDL Wiki Bot
625d090243 Sync SDL3 wiki -> header
[ci skip]
2025-11-26 20:41:22 +00:00
Sam Lantinga
fdcd548612 Added SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER
This lets applications choose which scene their windows are being created in. For example one window might be video output in a scene with a session role of UIWindowSceneSessionRoleExternalDisplayNonInteractive, and video controls in a scene with a session role of UIWindowSceneSessionRoleApplication.
2025-11-26 12:37:58 -08:00
Sam Lantinga
54b15532d3 Set window controller interaction on all windows
We should update all windows, not just the ones in the active scene
2025-11-26 11:50:54 -08:00
Anonymous Maarten
eda8d1d842 JNI_Unload must return the JNI version needed by the native library 2025-11-26 14:04:02 +01:00
Ryan C. Gordon
21f93e127b wikiheaders: generalize some previously-SDL-specific things
Now other projects can use it with their headers, if they provide an options
file with specifics and are willing to follow some SDLish header conventions.

This shouldn't affect SDL satellite projects, etc, since they literally use
the SDL symbols, like `SDLCALL` and such, which are the defaults in the script
if a .wikiheaders-options file doesn't override them.
2025-11-25 23:14:31 -05:00
Anonymous Maarten
1edb850639 Add script to generate macOS and iOS tbds 2025-11-26 01:03:41 +01:00
Sam Lantinga
52a4366e54 x11: don't grab the pointer while buttons are pressed
Grabbing the mouse interrupts touch events in progress, so if someone
enables relative mode while a button is pressed, wait for the button to
be released before grabbing the mouse.
2025-11-25 14:34:58 -08:00
Sam Lantinga
7e5f3330ff Added libxi and libxfixes to the Arch Linux package recommendations 2025-11-25 14:34:58 -08:00
Ryan C. Gordon
9b348ef6e8 android: Better parsing of command line arguments.
Reference Issue #14510.
2025-11-25 15:29:48 -05:00
Ryan C. Gordon
da863ff5f9 uikit: Don't copy argv; the original lives the whole time we need it.
Reference Issue #14510.
2025-11-25 15:29:31 -05:00
Antti Ala-Fossi
29f3844b01 Fix assert in SDL_BeginGPURenderPass 2025-11-25 10:46:53 -08:00
Sam Lantinga
74653b3cd5 Send the normal sensor data for the right Joy-Con controller in combined mode 2025-11-25 10:38:42 -08:00
Sam Lantinga
24fe3c48a0 Fixed events for windows that have had their window proc hooked at creation time 2025-11-24 19:29:13 -08:00
Sam Lantinga
55a566a6b4 Steam expects the gyro data to come before the accelerometer data 2025-11-24 18:04:46 -08:00
Anonymous Maarten
e221905195 Fix check_stdlib_usage.py libc call matching
It now matches libc usage inside statements,
and skips libc-like usage in strings or as struct members.
2025-11-25 01:07:10 +01:00
Sam Lantinga
9896dc18e7 Fixed setting SDL_PROP_DISPLAY_WINDOWS_HMONITOR_POINTER for the initial display 2025-11-24 13:38:21 -08:00
Sam Lantinga
8fa93d64ab Reset the window icon when returning from fullscreen mode
Fixes https://github.com/libsdl-org/SDL/issues/14522
2025-11-24 13:28:36 -08:00
Sam Lantinga
56269cd010 Support PNG icons in the SDL test code 2025-11-24 13:16:16 -08:00
Ryan C. Gordon
4e79d2ad64 blit: Check MSVC's _M_ARM64 define in addition to __aarch64__.
Reference Issue #14519.
2025-11-24 23:56:04 +03:00
Sam Lantinga
6534345d9a Only process events for the window being created at creation time
Fixes https://github.com/libsdl-org/SDL/issues/14524
2025-11-24 12:47:31 -08:00
Ryan C. Gordon
7f0d0d0046 blit: Check MSVC's _M_ARM64 define in addition to __aarch64__.
Reference Issue #14519.
2025-11-24 13:37:10 -05:00
eafton
f7ded3db5e Add fribidi and libthai packages to README-linux.md 2025-11-24 09:18:06 -08:00
Sam Lantinga
ebd3aa5289 testgpu_spinning_cube: fixed error handling if texture creation fails 2025-11-24 08:31:38 -08:00
Sam Lantinga
ba919832e4 testgpu_spinning_cube: removed duplicate calls to clear and present 2025-11-24 08:24:43 -08:00
Ryan C. Gordon
1fdc7975cb visualc: Fixed corrupted SDL.vcxproj.filters file.
Fixes #14526.
2025-11-24 10:34:08 -05:00
Ryan C. Gordon
15f98b2a61 blit: Change ifdefs on NEON functions that use an aarch64-specific opcode.
Fixes #14519.
2025-11-24 10:32:30 -05:00
Ryan C. Gordon
17ab859907 main: Unify command line handling between standard Windows and GDK targets.
Reference Issue #14510.
2025-11-24 10:04:09 -05:00
Ryan C. Gordon
ff44bad9bd main: Restored lost call to SDL_SetMainReady() in Windows SDL_RunApp(). 2025-11-24 01:39:34 -05:00
Ethan Lee
54ef731534 video: Explicitly call DestroyWindowTexture when destroying a window.
This prevents some recursion issues with hashtables, as described in #14499.
2025-11-24 01:25:19 -05:00
Ryan C. Gordon
a37d3f96f4 main: SDL_RunApp now explicitly handles NULL argv in all implementations.
It'll usually replace it with `{ "SDL_app", NULL }`, but things like Win32
can query the OS for the original command line arguments.

This allows apps/scripting languages that provide their own entry points to
use SDL_RunApp and not have to worry about how to compose an argv array on
things like Windows, when SDL was going to do it for them anyhow.

Most things won't experience any change with this commit, including apps that
that want extra control but originate in a standard main()-style entry point
and can just pass the existing argc/argv through to SDL_RunApp.

Windows isn't addressed here, since a previous commit already updated it.
GDK has a different fix here, but we'll unify that in a later commit.

Closes #12676.
2025-11-23 23:38:41 -05:00
Anonymous Maarten
ce5e46c37d Add SDL_(Get|Set)iSurfaceClipRect automation test
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
(cherry picked from commit a65111bd2d)
2025-11-24 00:02:36 +01:00
Ryan C. Gordon
7d5ec38953 main: Restore MINGW32_FORCEALIGN to SDL_RunApp on Windows. 2025-11-23 17:05:31 -05:00
Sam Lantinga
c0a2ae2a4a opengles2: fixed swapped colors when using indexed textures 2025-11-23 11:38:35 -08:00
Ryan C. Gordon
7388054fa2 main: Restore public domain comment in Windows code.
This, strictly speaking, doesn't _need_ to be public domain any more, since
SDL3 no longer inserts this code into apps via a static SDL_main library; it's
just part of the normal zlib-licensed SDL library and called into through a
well-defined entry point at startup, now.

But removing a public domain notice isn't the done thing, so we'll leave it in.

(To a related point: even if others have rewritten good portions of this code,
they're doing it under the assumption that this specific file has a public
domain license.)
2025-11-23 13:41:08 -05:00
Carl Åstholm
d0e70c37ab main: Rewrite the Windows implementation of SDL_RunApp()
This new implementation only parses the command line into an argv when
the provided argv is NULL. This lets programs that don't want to/can't
include `SDL_main.h` to do their own custom argument processing before
explicitly calling `SDL_RunApp()` without having SDL clobber the argv.

If the user includes `SDL_main.h` as normal, the behavior remains the
same as before (because `SDL_main_impl.h` passes a NULL argv).

In addition, this new implementation performs fewer allocations and no
longer leaks on failure.
2025-11-23 13:40:13 -05:00
Sam Lantinga
f0d958d850 Validate parameters to SDL_ReadStorageFile() and SDL_WriteStorageFile() 2025-11-22 18:41:30 -08:00
luckyxxl
6a1218c1cc Fix missing whitespace in surface extension missing error messages 2025-11-22 08:00:45 -08:00
Sam Lantinga
1fc093491a vulkan gpu: set the sample count for depth prepass
Fixes https://github.com/libsdl-org/SDL/issues/14500
2025-11-22 07:53:16 -08:00
SDL Wiki Bot
fed80a0d41 Sync SDL3 wiki -> header
[ci skip]
2025-11-21 18:57:12 +00:00
Esme
b984846dd0 windows: Add property mapping displayID to HMONITOR. (#14494) 2025-11-21 10:55:49 -08:00
Sam Lantinga
67728a5450 Allow resizing test applications on iPadOS 2025-11-21 09:31:10 -08:00
William Horvath
4b0514f087 Make use of GetQueueStatus' result in the Windows raw input loop.
Instead of only using it for the side effect of making MsgWaitForMultipleObjects block on the next call.

This has the added benefit of avoiding an extra MsgWaitForMultipleObjects call if there was actually new raw input in the queue already.
2025-11-21 08:28:09 -08:00
Ryan C. Gordon
029746a3d4 README-emscripten: Added some initial notes about customizing index.html.
Fixes #14485.
2025-11-21 10:25:34 -05:00
Ryan C. Gordon
62a7ac507a README-emscripten: updated notes on audio.
This still had a bunch of text that wasn't updated for SDL3's ability to deal
with pre-user-interaction pages. Same idea, but changed text that suggested
you have to wait to open the audio device.
2025-11-21 10:12:53 -05:00
SDL Wiki Bot
faf1e770dd Sync SDL3 wiki -> header
[ci skip]
2025-11-21 14:41:25 +00:00
Ryan C. Gordon
22df7c66ed wikiheaders: Treat docs/INTRO-* files the same way as the README files.
Closes #14261.
2025-11-21 09:36:56 -05:00
SDL Wiki Bot
d9230f4796 Sync SDL3 wiki -> header
[ci skip]
2025-11-21 13:14:42 +00:00
Ryan C. Gordon
0f76744828 pen: Updated documentation to meet current expectations and realities. 2025-11-21 08:13:16 -05:00
Ryan C. Gordon
3dee60d65f pen: Only allow one pen on Emscripten.
Same deal as the current Windows code: this "fixes" proximity but limits you
to a single pen device. But this is probably okay for most reasonable use
cases.
2025-11-21 08:13:16 -05:00
Ryan C. Gordon
06583ce421 pen: Only allow one pen on Windows.
This "fixes" proximity but limits you to a single pen device. But this is
probably okay for most reasonable use cases.
2025-11-21 08:13:16 -05:00
Ryan C. Gordon
99d7dad7e6 pen: Dramatic improvements to proximity information.
Now everything will attempt to track pens through proximity changes (instead
of removing the pen entirely). testpen.c has been updated to reflect this.

Some platforms and devices are better at this than others, but this seems like
a significant usability improvement across the board.

Fixes #12992.
2025-11-21 08:13:16 -05:00
Ryan C. Gordon
0cc3354731 wayland: Fixed pen button input (was losing button up events). 2025-11-21 08:13:16 -05:00
Edgar San Martin, Jr.
be15de6baa emscripten: Add SDL_SetWindowIcon implementation. (#14490) 2025-11-20 20:16:18 -08:00
Sam Lantinga
082848e945 Use consistent values for the video mode refresh rate
Fixes https://github.com/libsdl-org/SDL/issues/14468
2025-11-20 17:07:47 -08:00
eafton
36976ecb43 X11TK: Introduce Thai support and rewrite/cleanup messagebox positioning code (#14474) 2025-11-20 15:26:46 -08:00
Sam Lantinga
92eaa34277 cocoa: release any mouse buttons not pressed when gaining focus
Fixes https://github.com/libsdl-org/SDL/issues/13134
2025-11-20 13:51:23 -08:00
William Horvath
a7ab3a604b Print the full 64-bit timestamp in SDL_GetEventDescription().
Instead of wrapping at UINT_MAX.
2025-11-20 13:35:28 -08:00
Sam Lantinga
168e4eb532 Fixed typo (thanks @Clownacy!) 2025-11-20 09:47:28 -08:00
Sam Lantinga
a9a24ac000 Fixed the KingKong2 PRO Controller failing to initialize over Bluetooth 2025-11-20 09:24:07 -08:00
Frank Praznik
4a769b6475 wayland: Remove unused function parameters
Input device add/remove events are dispatched unconditionally now, so the boolean parameters that control whether events are sent are unused.
2025-11-20 11:29:39 -05:00
Sam Lantinga
61bf7087f5 Fixed build warnings with Visual Studio 2025-11-19 17:02:33 -08:00
Sam Lantinga
9f444b3981 Fixed initializing EVORETRO GameCube adapters
The HID device needs to be closed while enabling input reports over USB
2025-11-19 16:11:18 -08:00
Susko3
2ef005afe5 Fix WM_SYSKEYDOWN not being trapped by IME message handling
This would cause Alt + <something> not being trapped if handled by the system IME.
2025-11-19 13:39:46 -08:00
Sam Lantinga
d50cda3247 Added mappings for PlayStation VR2 Sense Controllers 2025-11-19 11:48:09 -08:00
Sam Lantinga
fa3467a94d Use the product category if the vendorName isn't available 2025-11-19 11:39:20 -08:00
Sam Lantinga
ef0ae4c903 Revert "fix: use productCategory instead of vendorName for joy name for apple driver"
This reverts commit 964bedfdd9.

The vendorName is more expressive and lets the user distinguish between different controllers of the same type, e.g. "PlayStation VR2 Sense Controller (R)" and "PlayStation VR2 Sense Controller (L)" vs "Spatial Controller"

If the product category is necessary, we can add a property to store that as additional information on the controller.
2025-11-19 11:35:38 -08:00
Sam Lantinga
6d60cc65cf Note that SDL_PLATFORM_IOS is defined for visionOS 2025-11-19 11:28:28 -08:00
Sam Lantinga
0c5655940c SDL_GetPlatform() returns "visionOS" on visionOS 2025-11-19 11:27:27 -08:00
Sam Lantinga
1209abf9dc Fixed macOS build 2025-11-19 10:47:31 -08:00
Sam Lantinga
a1ade13f1e Enable gamepad events on visionOS
Normally the gamepad is used for navigation on visionOS, but when the controller subsystem is enabled we want to receive gamepad input as gamepad events instead.
2025-11-19 10:37:33 -08:00
Sam Lantinga
1e5cbbc1d0 checkkeys: clarify that SDL_HINT_WINDOWS_RAW_KEYBOARD isn't needed 2025-11-19 08:54:43 -08:00
Frank Praznik
168f78b8b7 wayland: Free the cursors before stopping the event thread
An active cursor being destroyed may still have a frame callback referencing the thread queue, so clean it up before destroying the thread queue to ensure that no references to the queue remain when it is destroyed.
2025-11-18 20:36:38 -05:00
Sam Lantinga
cc768f3e88 Allow opening asset paths starting with "./"
Fixes https://github.com/libsdl-org/SDL/issues/13933
2025-11-18 15:29:04 -08:00
Sam Lantinga
908216bbae Set the requested window size on visionOS 2025-11-18 11:06:10 -08:00
Sam Lantinga
47360a9a46 The pixel density on Apple Vision Pro is 2.0 2025-11-18 11:05:55 -08:00
Frank Praznik
64bf432beb wayland: Silence a warning if the event thread exits abnormally
Clean up the termination callback if the flush returns with an unrecoverable error to avoid a "queue destroyed while proxies still attached" warning.
2025-11-18 12:50:23 -05:00
Anonymous Maarten
8f21fe4994 testmouse: avoid use-after-free
Bug was introduced in 17a891daa8
2025-11-18 08:35:56 +01:00
Sam Lantinga
44471b3ea4 Fixed build for iOS and tvOS 2025-11-17 16:55:31 -08:00
Sam Lantinga
4931c675ab Fixed warning C4127 (conditional expression is constant) in Visual Studio 2025-11-17 16:06:58 -08:00
Sam Lantinga
b144c79da2 Added support for resizing windows on visionOS 2025-11-17 16:03:23 -08:00
Anonymous Maarten
8920736df0 cmake: add testrwlock to CTest test suite 2025-11-17 20:00:02 +01:00
Anonymous Maarten
17a891daa8 test: plug leaks of testmouse and testrwlock 2025-11-17 20:00:02 +01:00
Anonymous Maarten
3ba9bdfc01 test: use SDL_test to parse arguments of tests 2025-11-17 20:00:02 +01:00
Anonymous Maarten
14470755b7 tray: plug leak of cache dir path 2025-11-17 20:00:02 +01:00
Frank Praznik
d058781f71 mouse: Fix memory leak if events are sent after shutdown
Only allocate memory for source events if the mouse system is in the initialized state, otherwise, spurious events during shutdown can cause a leak.
2025-11-17 13:28:05 -05:00
Sam Lantinga
c68254927f Fixed the SI GameCube dual stage trigger button mapping
Also moved the second touchpad button to the end of the misc buttons
2025-11-17 09:28:06 -08:00
Ozkan Sezer
a882afafe5 fixed several -Wzero-as-null-pointer-constant warnings from gcc-15 2025-11-17 17:55:10 +03:00
SDL Wiki Bot
f1145186ea Sync SDL3 wiki -> header
[ci skip]
2025-11-16 12:09:05 +00:00
Sam Lantinga
770b38b4f1 Loosened epsilon for color matching
Fixed https://github.com/libsdl-org/SDL/issues/14473
2025-11-15 16:51:19 -08:00
Ozkan Sezer
3f0545587f Revert "Create FUNDING.yml"
This reverts commit 10f6b860ee.
Looks like it was accidental..
2025-11-16 01:15:56 +03:00
Ozkan Sezer
667272e71d Revert "Update README.md"
This reverts commit b83bd80424.
Looks like it was accidental..
2025-11-16 01:15:10 +03:00
Anonymous Maarten
d9d0df2534 wayland: plug mutex leak of cursor thread
Fixes this leak of testsprite:
Allocation 0: 40 bytes
	0x7f4d47b0d43c: SDL_calloc_REAL+0x45
	0x7f4d47d149bc: SDL_CreateMutex_REAL+0x17
	0x7f4d47cab5a7: Wayland_StartCursorThread+0x9f
	0x7f4d47cae028: Wayland_InitMouse+0xa7
	0x7f4d47cb36ea: Wayland_VideoInit+0x187
	0x7f4d47bbee85: SDL_VideoInit+0x358
	0x7f4d47a01bfe: SDL_InitSubSystem_REAL+0xe8
	0x7f4d47a3cdf1: SDL_InitSubSystem+0x19
	0x407366: SDLTest_CommonInit+0x108
	0x402fd0: SDL_AppInit+0x605
	0x7f4d47a8771f: SDL_InitMainCallbacks+0x6a
	0x7f4d47d3e6cf: SDL_EnterAppMainCallbacks_REAL+0x43
	0x7f4d47a396f4: SDL_EnterAppMainCallbacks+0x48
	0x401445: SDL_main+0x33
	0x7f4d47a878c6: SDL_RunApp_REAL+0x42
	0x7f4d47a317be: SDL_RunApp_DEFAULT+0x37
	0x7f4d47a3e769: SDL_RunApp+0x32
	0x40146e: main+0x27
	0x7f4d47811575: __libc_start_call_main+0x75
	0x7f4d47811628: __libc_start_main+0x88
	0x400ff5: _start+0x25
2025-11-15 23:10:35 +01:00
SDL Wiki Bot
abf7a8974b Sync SDL3 wiki -> header
[ci skip]
2025-11-15 19:30:59 +00:00
Sam Lantinga
4bc9ab665d Use a base path of "./" on Android
This allows filesystem operations to use internal storage and the asset system by default.
2025-11-15 11:29:37 -08:00
Sam Lantinga
07f995eb72 Passing NULL path to SDL_OpenFileStorage() gives access to the whole filesystem 2025-11-15 11:29:37 -08:00
Ryan C. Gordon
3ae7a54c94 filesystem: SDL_OpenFileStorage() now deals with relative paths better.
Fixes #13484.
2025-11-15 11:29:37 -08:00
Ryan C. Gordon
b83bd80424 Update README.md 2025-11-15 11:29:37 -08:00
Ryan C. Gordon
10f6b860ee Create FUNDING.yml 2025-11-15 11:29:37 -08:00
tsst-tsst
d4bef0d5ba Add support for tcc to cmake (#14464)
This PR adds support to the cmake build scripts so to allow building SDL with the Tiny C Compiler (tcc).

TinyCC supports the subset of C99 used by SDL and will complete the build once the --version-script linker flag is removed. The changes have been tested with various build configurations, including X11 and Wayland, and using tcc version 0.9.28rc 2025-10-27 mob@f4e01bfc on x86_64 Linux.
2025-11-15 11:24:15 -08:00
Frank Praznik
005cb20e67 wayland: Use defines for timer rollover constants
"static const" being treated as constant in C is an extension that is not always supported, so use defines instead.
2025-11-15 11:24:35 -05:00
Sam Lantinga
c6935f9dcb Fixed EGL framebuffer colors on AMD drivers 2025-11-15 08:05:34 -08:00
Sam Lantinga
a4c269cd10 Fixed handling framebuffer_srgb_capable for EGL and iOS 2025-11-15 08:05:34 -08:00
SDL Wiki Bot
0f763da015 Sync SDL3 wiki -> header
[ci skip]
2025-11-15 15:41:21 +00:00
Susko3
cb6272ed2d windows: Treat absolute mouse as pen events when SDL_HINT_PEN_MOUSE_EVENTS=0.
Some caveats:

- the fake pen will leave proximity only when relative mode is disabled
- unsure if detecting proximity is even possible from raw mouse input

Fixes #12324.
2025-11-14 16:49:49 -05:00
Sam Lantinga
dccf486a0a Fixed potential infinite recursion opening a Steam Controller
This can happen if the controller is opened from an event watcher when the controller is connected.
2025-11-14 13:44:02 -08:00
Ryan C. Gordon
d62f141b29 opengl: Fixes for sRGB framebuffer support.
This changes the default for SDL_GL_FRAMEBUFFER_SRGB_CAPABLE to -1 (for
"don't care"). Minor ABI break, but technically this never worked correctly.

Fixes #13055.
2025-11-14 15:40:25 -05:00
Sam Lantinga
0ae3d7b0b0 Fixed crash in the vulkan renderer when the window is minimized
There's more work to do here in other cases where we can't recreate the swap chain, but this fixes the common minimize case.

Fixes https://github.com/libsdl-org/SDL/issues/14434
2025-11-14 12:35:33 -08:00
Sam Lantinga
ed6d41f55b testcontroller: demonstrate multiple sensors on the virtual controller 2025-11-14 08:18:04 -08:00
Sam Lantinga
cc3b5766fa testsprite: changed return type of LoadSprite() to bool 2025-11-14 08:05:49 -08:00
SDL Wiki Bot
2b2bf85970 Sync SDL3 wiki -> header
[ci skip]
2025-11-14 15:29:18 +00:00
Ryan C. Gordon
367c8d7c7b touch: don't compare mouse_touch_events to zero; it's a bool. 2025-11-14 10:28:16 -05:00
Sam Lantinga
919254cdd1 Fixed comment for the new Steam Controller mapping
Fixes https://github.com/libsdl-org/SDL/issues/14465
2025-11-14 07:09:36 -08:00
Donovan Maas
879f081de3 Improve OpenGL detection checks in CMake (#14443)
The OpenGL headers are not always implicitly available, so this improves the check by calling `find_package` and using the `OPENGL_INCLUDE_DIRS` or `OPENGL_INCLUDE_DIR` var for the `check_c_source_compiles` test.
The minimum CMake version currently set is 3.16, `OPENGL_INCLUDE_DIRS` was only added in 3.29, so the code is set to choose `OPENGL_INCLUDE_DIRS` if it exists. If the minimum CMake version is ever set to >= 3.29 this check can be removed and just the `OPENGL_INCLUDE_DIRS` variable can be chosen.
2025-11-14 00:18:33 -08:00
Vicki Pfau
9fd3dbfc42 switch2: Remove some unneeded init commands
These commands seem to be queries the console sends, not setup
2025-11-13 20:46:46 -08:00
Vicki Pfau
f0d4aca03d switch2: Bring up IMU support 2025-11-13 20:46:46 -08:00
Vicki Pfau
ae6cdea0fa switch2: Refactor and clean up rumble code a bit 2025-11-13 20:46:46 -08:00
Ryan C. Gordon
d66946cee7 wasapi: fix memory leak on unlikely failure case. 2025-11-13 20:58:21 -05:00
Ryan C. Gordon
7db0e48454 wasapi: Minor style tweaks. 2025-11-13 20:58:21 -05:00
Maia
a01d6f109d Add SDL_LoadSurface and SDL_LoadSurface_IO (#14374) 2025-11-13 14:50:37 -08:00
Sylvain Becker
4cc9153df2 Android: remove old cpu-feature code, and fix build (add HAVE_GETAUXV… (#14460) 2025-11-13 09:12:07 -08:00
Sam Lantinga
e2e8f86076 Check for wine_get_version() to detect Wine/Proton
If this application is being run under Wine but Steam doesn't know that, Steam won't set STEAM_COMPAT_PROTON. So we'll use wine_get_version() to detect that we're running under Wine instead.
2025-11-12 22:29:42 -08:00
Sam Lantinga
493bc621e4 Don't check SteamVirtualGamepadInfo when running as Wine
Wine will ignore the Steam Virtual Gamepad if it looks like it has the original (blocked) controller VID/PID.

Fixes https://github.com/libsdl-org/SDL/issues/14410
2025-11-12 22:29:42 -08:00
Sam Lantinga
dafca86123 Cleanup SDL_UDEV_GetProductSerial() 2025-11-12 22:23:27 -08:00
pmx
54f129f765 FIX SDL_GetJoystickSerial() always returning NULL on Linux (UDEV) (#14454) 2025-11-12 14:25:31 -08:00
Ethan Lee
9dbde4542c gpu: Windows 11 guarantees a D3D12 minimum, skip checks accordingly 2025-11-12 16:22:35 -05:00
Ethan Lee
702a1adf4a windows: Add WIN_IsWindows11OrGreater, using a dwBuildNumber helper function 2025-11-12 16:22:35 -05:00
Sam Lantinga
667720d5af Added support for the HORI Taiko Drum Controller For Switch 2025-11-12 12:04:02 -08:00
Sam Lantinga
d0926d380e Added SDL_hidapi_steam_triton.c to the GDK Visual Studio project 2025-11-12 11:54:48 -08:00
Sam Lantinga
379c47cc75 Revert "Fix lost KEY_UP events with multiple keyboards using shared scancode state (#14446)"
This reverts commit 3dab15d3b4.

With this commit any repeated key will be reported as held down indefinitely.
2025-11-12 11:51:34 -08:00
Corentin Recanzone
2079517802 Fix Android TitleStorage: avoid leading '/' and handle NULL base path 2025-11-12 14:45:47 -05:00
Sam Lantinga
0c5f7f6a33 unix: Unref SDL_gtk context on quit 2025-11-12 11:42:02 -08:00
Sam Lantinga
e1af623631 Fixed Steam Deck sensor timings 2025-11-12 11:36:37 -08:00
Sam Lantinga
1998b65045 Added support for the new Steam Controller 2025-11-12 11:32:32 -08:00
Ethan Lee
04a62cba1f gpu: Set up D3D12 device checks to avoid unnecessary queries 2025-11-12 11:19:07 -05:00
Chris Burrows
3dab15d3b4 Fix lost KEY_UP events with multiple keyboards using shared scancode state (#14446) 2025-11-11 23:36:08 -08:00
Sam Lantinga
65989d269e Updated SDL_GPUVulkanOptions documentation 2025-11-11 20:49:14 -08:00
Ethan Lee
b2585ac236 gpu: Vulkan feature/extension lists do not need to be stored in the renderer 2025-11-11 21:24:45 -05:00
Ethan Lee
536507101d gpu: De-duplicate property enumeration for Vulkan features 2025-11-11 20:58:14 -05:00
SDL Wiki Bot
b7ea19d5e5 Sync SDL3 wiki -> header
[ci skip]
2025-11-11 23:54:29 +00:00
TheSniperFan
ac0f77b7e6 Allow SDL GPU to opt into additional Vulkan features (#14204) 2025-11-11 15:53:06 -08:00
Anonymous Maarten
6905714986 android: remove dependency on cpu-features.h
android: remove dependency on cpu-features.h

getauxval got introduced into bionic well before Android 5.0
2025-11-11 23:41:43 +00:00
Ryan C. Gordon
25ab8c99df pen: Offer the current window during promixity events on most platforms.
Fixes #12356.
2025-11-11 16:34:22 -05:00
Anonymous Maarten
7073cfc58e release: don't use legacy Android CMake toolchain file 2025-11-11 21:46:26 +01:00
Sam Lantinga
5bed8ec603 Implemented render batching for D3D9 2025-11-11 08:31:37 -08:00
SDL Wiki Bot
a63e848509 Sync SDL3 wiki -> header
[ci skip]
2025-11-11 15:38:49 +00:00
Maia
5ec6147acb Add missing type suffix to SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION prop 2025-11-11 10:37:27 -05:00
Sam Lantinga
6b07e13fef Fixed spacing 2025-11-10 18:30:59 -08:00
Sam Lantinga
fffaf122df Added temporary workaround for failing Emscripten test 2025-11-10 18:30:02 -08:00
Sam Lantinga
dde7fa3b17 Validate the output colorspace before setting up a renderer 2025-11-10 18:30:02 -08:00
Sam Lantinga
6baaa0fe87 Destroy the window surface if a software renderer couldn't be created 2025-11-10 18:30:02 -08:00
Sam Lantinga
6a7fb838f4 Return false if we couldn't update the emscripten framebuffer 2025-11-10 18:30:02 -08:00
Sam Lantinga
eccd5c03c3 testautomation: added tests to cover linear <-> sRGB colorspace conversion 2025-11-10 18:30:02 -08:00
Sam Lantinga
33c70af2f8 Fixed SDL_COLORSPACE_SRGB_LINEAR being used for RGBA32 textures 2025-11-10 18:30:02 -08:00
Sam Lantinga
1c77304ee9 Fixed getting an 8-bit window surface on Apple platforms
The Metal renderer doesn't support XRGB texture formats, so we ended up matching SDL_PIXELFORMAT_INDEX8 for the window surface.
2025-11-10 18:30:02 -08:00
Sam Lantinga
ff890d1733 Fixed crash blitting to an 8-bit surface with no palette 2025-11-10 18:30:02 -08:00
Sam Lantinga
6389f4db4c SDL_FindColor() can be static 2025-11-10 18:30:02 -08:00
Sam Lantinga
ead02b08dd Skip tonemapping for render targets with unspecified HDR headroom 2025-11-10 18:30:02 -08:00
Sam Lantinga
4e5ba722fd Change the batch if the color scale changes
The color scale is a shader constant so it can be applied in linear space
2025-11-10 18:30:02 -08:00
Sam Lantinga
d29f368ca8 Change the batch if the GPU render state changes 2025-11-10 18:30:02 -08:00
Sam Lantinga
3399bc600e gpu renderer: add color to the point/line vertex data
This allows us to batch color changes in a single draw call
2025-11-10 18:30:02 -08:00
Sam Lantinga
97ebfbf7a0 Only convert color to linear once in VULKAN_QueueDrawPoints() 2025-11-10 18:30:02 -08:00
Sam Lantinga
d9be8b9a00 Implemented render batching for D3D11, D3D12, Metal, and Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/7534
2025-11-10 18:30:02 -08:00
SDL Wiki Bot
01a812cbca Sync SDL3 wiki -> header
[ci skip]
2025-11-11 01:21:27 +00:00
Ethan Lee
b5624e14ff gpu: Add SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION property 2025-11-10 20:20:05 -05:00
Ethan Lee
0b2073d143 gpu: Remove dead code in the Vulkan device ranking system.
This block was a sloppy way of trying to avoid prioritizing lavapipe over another device, but truthfully the only way to guarantee avoiding CPU drivers is to add a property to allow apps to require hardware acceleration.
2025-11-10 18:16:54 -05:00
Ethan Lee
1b79ba9ab6 gpu: Separate device suitability from device rank when enumerating Vulkan devices.
This makes it a bit clearer what the "minimum" is vs. the "best", which should be two separate queries.
2025-11-10 18:16:54 -05:00
Ethan Lee
6976b57988 gpu: Move device ranking to the bottom of IsDeviceSuitable.
This prevents devices without presentation/graphics support from getting ranked.
2025-11-10 18:16:54 -05:00
Ethan Lee
799c6aa629 gpu: Move device ranking to a standalone function.
This allows us to treat Dozen as an "other" driver, rather than blacklisting it outright.
2025-11-10 18:16:54 -05:00
Ethan Lee
0cc2b026e7 gpu: Check for MSFT_layered_driver, skip layered drivers during enumeration 2025-11-10 18:16:54 -05:00
Frank Praznik
f3d39815e7 progressbar: Ensure buffers are large enough for string manipulation 2025-11-09 16:59:35 -05:00
Frank Praznik
f6a05121ec wayland: Handle dispatch errors when showing a window
If a dispatch event when showing a window returns a failure code, handle the display disconnected condition and break out of the loop, otherwise, it will hang forever.
2025-11-09 12:38:05 -05:00
Frank Praznik
5d0236ad51 wayland: Don't leave un-acked configurations when throttling resize events
Compositors that send multiple resize events per frame could result in the most recent configuration requests being left un-acked when the resize ends. Ack the most recent resized state on frame callbacks, so as to always ack the most recent configuration within a reasonable timeframe.
2025-11-09 12:38:04 -05:00
Ryan C. Gordon
2382d3831c cmake: List enabled camera backends. 2025-11-09 12:05:05 -05:00
Sam Lantinga
a96664674f Fixed windows events on 32-bit Windows
When running on 32-bit Windows, DefWindowProc resolves to a function in ntdll.dll, but after the window is created the actual window proc is a function in user32.dll. We solve this by using our own custom default window proc and looking for that instead.

Fixes https://github.com/libsdl-org/SDL/issues/1442
2025-11-09 07:44:45 -08:00
Eddy Jansson
836dad75ae Remove redundant semicolons.
[ci skip]
2025-11-09 07:29:27 -08:00
Marcin Serwin
53ee410d7a Don't divide by zero in slow blitter
Other blitters seem to handle zero width/height destinations correctly.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-11-09 07:26:04 -08:00
Anonymous Maarten
2bc886d0bd testqsort: add custom macro to allow comparing with qsort 2025-11-09 11:24:03 +00:00
Anonymous Maarten
2be18f340f testqsort: use SDLTest_TestSuite 2025-11-09 11:24:03 +00:00
unknown
b9c790949e wasapi: Don't ignore device disconnect events on unopened devices.
Reference Issue #13317.
2025-11-09 01:15:45 -05:00
Ryan C. Gordon
2f41dd7b5c pen: Better pen position precision on Windows 8 and later.
Fixes #12084.
2025-11-09 00:46:45 -05:00
Sam Lantinga
704ac98d3f Make sure the blit mapping is cleared when undoing RLE encoding
This fixes a crash if a surface is RLE encoded, then locked and unlocked.

We also mark the surface as no longer needing to be locked after undoing RLE encoding
2025-11-08 15:38:47 -08:00
Sam Lantinga
089dc86bcf Lazily redo RLE encoding
Also stop lying about the RLE encoding state, which causes crashes if we do RLE blit operations while the surface is locked.
2025-11-08 14:51:27 -08:00
Sam Lantinga
cc2a272d6f Enable RLE more often in the software renderer
We don't need to aggressively disable RLE acceleration anymore because the original pixels remain available for operations that aren't supported by the RLE blitter.
2025-11-08 14:51:27 -08:00
Sam Lantinga
ac0edbe9d2 Just assert that RLE encoding isn't active
We undo RLE encoding in the calling code, so we shouldn't need to do anything here.
2025-11-08 14:51:27 -08:00
Sam Lantinga
2b365983db Save the original pixels when RLE encoding is enabled
Trying to reconstruct the original image when undoing RLE encoding was never completely accurate.

Fixes https://github.com/libsdl-org/SDL/issues/14424
2025-11-08 12:56:25 -08:00
Sam Lantinga
78152d13ee Added SDL_ConvertSurfaceRect() for internal use 2025-11-08 12:56:25 -08:00
Sam Lantinga
d145e78cd6 Improved performance scaling 8-bit surfaces 2025-11-08 12:56:25 -08:00
Sam Lantinga
01d359c1df Don't create a larger surface than we need when scaling 2025-11-08 12:56:25 -08:00
Sam Lantinga
7d628ef76c Fixed scaling YUV surfaces 2025-11-08 12:56:25 -08:00
Sam Lantinga
7553d5892e Fixed software renderer 8-bit scaling and rotation (thanks @jroatch!)
Fixes https://github.com/libsdl-org/SDL/issues/14422
2025-11-08 08:46:58 -08:00
Chris Genova
6a01d6e7d3 D3D12 GPU: Prevent reading out of bounds when uploading textures.
When the upload needs realignment, a new buffer is created to do the
upload, and the source data is copied to the new buffer. This commit
fixes the issue where the memcopy can read off the end of the source
buffer since it is reading based on destination pitch instead of source
pitch.
2025-11-07 17:47:51 -08:00
Sam Lantinga
1fb663b429 Make sure that SDL_PIXELFORMAT_ARGB8888 is the first texture format for OpenGL
Fixes https://github.com/libsdl-org/SDL/issues/1440
2025-11-07 11:13:50 -08:00
Sam Lantinga
3489a45216 Use srcpixel now that we've set it 2025-11-07 11:12:10 -08:00
Sam Lantinga
294beceec7 Fixed error: 'srcpixel' may be used uninitialized 2025-11-07 11:11:31 -08:00
Sam Lantinga
0f21e46586 Added support for SDL_PIXELFORMAT_INDEX8 to SDL_BlitTriangle_Slow()
Fixes https://github.com/libsdl-org/SDL/issues/14419
2025-11-07 11:01:23 -08:00
Sam Lantinga
547b2a2e37 SDL_SetSurfaceRLE() has a boolean parameter 2025-11-07 11:01:23 -08:00
Frank Praznik
950a9a72ab wayland: Use a pool to allocate icon image buffers
Allocate the buffers from a pool to avoid a separate mmap for each image.
2025-11-07 13:53:00 -05:00
Frank Praznik
b3060956c3 wayland: Release the SHM pool after initial cursor buffer creation
The backing memory will be automatically unmapped when the buffer objects are destroyed, so no need to keep the pool around.
2025-11-07 13:53:00 -05:00
Sam Lantinga
9a19cc8323 Fixed unaligned load in Xbox HIDAPI driver 2025-11-07 10:37:58 -08:00
Sam Lantinga
118dcf27ce Added D mode mappings for the 8BitDo 64 Bluetooth Controller
The HID descriptor maps the C buttons as a right thumbstick, but this mapping matches the HIDAPI Nintendo 64 mapping.

The start button resets the controller in both USB and Bluetooth mode on macOS, but I've kept the mapping assuming this is a macOS bug that will be fixed.
2025-11-07 10:18:49 -08:00
Sam Lantinga
9ff737efbd Updated the Nintendo Switch N64 controller mapping
This mapping matches the Linux kernel default mapping.
2025-11-07 10:18:49 -08:00
Sam Lantinga
f211a3bb69 Fixed initial rumble on the 8BitDo 64 Bluetooth Controller 2025-11-07 10:18:49 -08:00
Daniel Ludwig
ef5b1c8f5f Fix DefWindowProc called for events handled in WIN_WindowProc 2025-11-07 07:57:40 -08:00
Sam Lantinga
a2ed1a4197 Fixed blitting bitmaps with a non-zero x offset
Also added basic testautomation coverage of bitmap blits

Fixes https://github.com/libsdl-org/sdl2-compat/issues/546
2025-11-06 22:47:50 -08:00
Frank Praznik
a71b2f0a93 x11: Only correct placement for border offset on the initial window mapping
Correcting it when it is subsequently hidden and re-mapped will cause the position to be double offset by the size of the borders.
2025-11-06 19:35:15 -05:00
Sam Lantinga
2a873be9cd Return false from SDL_SetWindowMouseRect() if it's not supported 2025-11-06 11:59:47 -08:00
Sam Lantinga
599bd1a6aa Fixed building if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO isn't defined 2025-11-06 11:30:59 -08:00
Ryan C. Gordon
f8a959da05 cmake: Add some symbols to the Emscripten preseed cache. 2025-11-06 13:41:55 -05:00
Sam Lantinga
e24eeefbd1 The default render texture format is SDL_PIXELFORMAT_ARGB8888
We do this for consistency across backends
2025-11-06 09:46:43 -08:00
Sam Lantinga
ca072c9fc6 Don't do anything if the window mouse rect hasn't changed 2025-11-06 09:18:58 -08:00
Mathieu Eyraud
de5b8a1c45 Remove useless call to SetTextureAddressMode() 2025-11-06 08:25:00 -08:00
Mathieu Eyraud
7ad4911584 Remove incorrect and useless call to SetTextureScaleMode()
SetTextureScaleMode() is called a few lines below with correct arguments.
2025-11-06 08:25:00 -08:00
Ozkan Sezer
616c21d730 SDL_camera_v4l2.c: fix build against old kernel headers. 2025-11-06 18:28:50 +03:00
Mathieu Eyraud
80af7d3ccd Fix error handling of X11Toolkit_InitWindowPixmap 2025-11-06 07:25:29 -08:00
Mathieu Eyraud
d17b8412f1 Fix potential NULL pointer dereference 2025-11-06 07:24:47 -08:00
Yevgen Abramov
04af745fec Add support for V4L2 XB24 (32-bit RGBX) camera format 2025-11-06 07:13:04 -08:00
Sam Lantinga
c94da8977d Validate SPI read command in the Nintendo Switch HIDAPI driver 2025-11-05 17:34:22 -08:00
Sam Lantinga
9a1745f2c8 Fixed unaligned access in the Nintendo Switch HIDAPI driver 2025-11-05 17:08:22 -08:00
Ryan C. Gordon
720a9d0636 README-emscripten: Note that using the latest stable release is a good idea. 2025-11-05 16:12:01 -05:00
Ryan C. Gordon
7324823b3e emscripten: Send resize events when screen orientation changes.
The canvas _might_ be changing sizes, if you've set up your own CSS for it, or
are using SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT.

Reference Issue #7359.
2025-11-05 15:52:38 -05:00
Yevgen Abramov
b09b557fc6 Fix V4L2 frame rate numerator comparison in SDL3 camera
Signed-off-by: Yevgen Abramov <eabramov84@gmail.com>
2025-11-05 10:56:03 -08:00
Frank Praznik
f5e72c8709 docs: Add XTEST library to the Fedora package list
SDL requires that all the X11 libraries be present for configuration to succeed by default, and the package list was missing this one.
2025-11-04 19:21:34 -05:00
Anonymous Maarten
0da649eb72 release: don't download pre-release dependencies + strict version parsing 2025-11-04 18:00:23 +01:00
Sam Lantinga
49134ecf25 Pass the error through from the SetRelativeMouseMode() implementation 2025-11-03 13:07:17 -08:00
Sam Lantinga
05887f2087 Return false from SDL_SetWindowRelativeMouseMode() if relative mode isn't available
Fixes https://github.com/libsdl-org/SDL/issues/14388
2025-11-03 13:01:41 -08:00
Sam Lantinga
eedc0b19fd Fixed build warning when X11 XInput isn't available 2025-11-03 13:01:41 -08:00
Sam Lantinga
4560fae07e Fail configuration if X11 dependency packages aren't available
It happens fairly often that people enable X11 support but don't install the extension libraries that SDL depends on. This makes those required if not explicitly disabled, which should help prevent accidentally broken builds.
2025-11-03 13:01:41 -08:00
Sam Lantinga
a6351ac474 Added libxtst-dev to Linux CI build dependencies 2025-11-03 13:01:41 -08:00
yuanhecai
dc5b136930 loongarch: add SDL_FillSurfaceRect4LSX opt 2025-11-03 08:45:51 -08:00
yuanhecai
0b1eb4c841 loongarch: add Blit8888to8888PixelAlphaSwizzleLSX opt 2025-11-03 08:45:51 -08:00
aikawayataro
5ad9b6b317 Add bounds checks in SDL_qsort (#10066) 2025-11-03 08:40:30 -08:00
Sam Lantinga
ea8e66ccd1 Don't use getpagesize() on Windows
Fixes https://github.com/libsdl-org/SDL/issues/14328
2025-11-03 08:36:29 -08:00
Sam Lantinga
6493be9eea Removed SDL_AUTO_ENABLE_ENHANCED_FLYDIGI 2025-11-03 08:20:41 -08:00
Joshua T. Fisher
641deb9c0e Initial port to SDL3 audio subsystem 2025-11-03 10:08:50 -05:00
Frank Praznik
05ce978e18 cocoa: Use cached viewport dimensions when querying the window pixel size
Recalculate the backing viewport dimensions in the resize handler, otherwise, this data can be out-of-sync with the logical window size if queried during transition animations.
2025-11-03 09:43:08 -05:00
Sam Lantinga
97e2951875 Removed redundant wait at shutdown in the ALSA audio driver 2025-11-02 18:30:12 -08:00
Sam Lantinga
4db63e323e Save a copy of the D3D12 semantic string
Fixes https://github.com/libsdl-org/SDL/issues/14383
2025-11-02 16:16:20 -08:00
Anonymous Maarten
63cb046d38 release: don't use legacy Android CMake toolchain file
[ci skip]
2025-11-02 23:24:51 +01:00
Sam Lantinga
0882623092 Clamp the audio drain delay to 100 ms
Fixes https://github.com/libsdl-org/SDL/issues/9829
2025-11-02 11:15:25 -08:00
Sam Lantinga
889e4787d6 Clarify when we want to auto-enable Apex 5 enhanced functionality 2025-11-02 11:14:41 -08:00
Sam Lantinga
3336aa95f1 Fixed the paddle mapping for Steam Controllers
Fixes https://github.com/libsdl-org/SDL/issues/14380
2025-11-02 10:06:49 -08:00
Sam Lantinga
b695e5c24b Fixed whitespace 2025-11-02 09:31:55 -08:00
bleeqer
fc6f97f162 Fix NULL pointer dereference in SDL_GlobStorageDirectory 2025-11-02 08:55:52 -08:00
Sam Lantinga
eb87a36940 Fixed the right touchpad calculation for the BLE Steam Controller
Fixes https://github.com/libsdl-org/SDL/issues/14368
2025-11-02 08:31:37 -08:00
Sam Lantinga
6c4f2bd83d Use DefWindowProc for the initial SDL window proc
This makes sure that anything that hooks window creation to set up window proc hooks will call DefWindowProc instead of infinitely recursing when we set up our window proc afterwards.

Fixes https://github.com/libsdl-org/SDL/issues/10529
2025-11-02 07:23:29 -08:00
Sam Lantinga
a82e8a701d Allow dynamically switching mode of the Apex 5 controller
The controller can be in XInput mode or enhanced mode, so it will always show up as an XInput controller, and the enhanced mode controller will come and go as enhanced mode is enabled or disabled in the FlyDigi Space Station app.
2025-11-01 14:49:31 -07:00
Sam Lantinga
28849fd789 Manually enable acquiring the Apex 5 controller if necessary
The FlyDigi Space Station app isn't available on non-Windows platforms, so we need to manually enable acquiring the controller on those platforms.
2025-11-01 14:49:31 -07:00
Sam Lantinga
524739900a Fixed potential double-free when creating a renderer (thanks @Sackzement!)
Closes https://github.com/libsdl-org/SDL/pull/14371
2025-11-01 11:24:14 -07:00
Sam Lantinga
aafbf7183f Copy shader params instead of caching a pointer to them
It's possible for a new texture to be allocated with the same address as a previous one, so we can't just cache the pointer value.

Fixes https://github.com/libsdl-org/SDL/issues/14369
2025-11-01 11:24:14 -07:00
Frank Praznik
3a59163614 wayland: Optimize custom cursor image lookup
Store the images in order from smallest to largest to simplify lookup and be able to early-out of the search loop even if there is no exact match for the scale.
2025-10-31 16:15:12 -04:00
Frank Praznik
6a510d6174 wayland: Set tablet cursors separately from pointer cursors
Some compositors don't implicitly use the pointer cursor when the tablet cursor is not set, and the presence of a tablet doesn't necessarily guarantee pointer capability. Set the cursor for tablet tools independently of pointer cursors.

This required refactoring of cursor state handling, as well as some tablet related structures.
2025-10-31 16:15:12 -04:00
Frank Praznik
ca569bb837 wayland: Use viewports to scale custom cursors
Cache the cursor image data at creation time, and use a viewport to render scaled custom cursors, instead of generating new cursor images for every scale.
2025-10-31 16:15:12 -04:00
Sam Lantinga
de5d8616bf Updated SDL tests XCode project 2025-10-31 10:34:42 -07:00
Sam Lantinga
d97e8bd49b Removed SDL_uikitwindow
This was only needed as a workaround for buggy behavior in iOS 8
2025-10-31 10:34:42 -07:00
Sam Lantinga
b46e26e65a Added support for the UIScene life cycle on Apple platforms
Fixes https://github.com/libsdl-org/SDL/issues/12680
2025-10-31 10:34:42 -07:00
Sam Lantinga
b6f67dd2b2 tests: add a template Info.plist that uses the whole screen
The OS uses the presence of the UILaunchScreen key to determine whether to display the application in compatibility mode or display using the whole screen.
2025-10-31 10:34:42 -07:00
Sam Lantinga
09f00e397c testsymbols: include SDL_main.h 2025-10-31 10:34:42 -07:00
Sam Lantinga
446fb65ca6 Mark the Apex 5 controller as being acquired by SDL 2025-10-30 22:35:06 -07:00
techflashYT
b3dd0995df cmake: don't auto vectorize with AltiVec on PPC
Allowing GCC/Clang to auto-vectorize with AltiVec support breaks support
for non-AltiVec compatible processors.  Adding this option allows the
existing AltiVec specific code to function as it always did, but
prevents the compiler from inserting AltiVec instructions into arbitrary
codepaths that SDL can't gate off via the existing CPUInfo code.
2025-10-30 21:56:52 -07:00
Sam Lantinga
1502c2fd8b Added support for the Flydigi Apex 5 controller (#14218) 2025-10-30 21:20:44 -07:00
Arkadiusz Hiler
0d2f081d41 pulseaudio: Match channel map to SDL's chosen order
pa_channel_map_init_auto() with PA_CHANNEL_MAP_WAVEEX does the wrong
thing as it just takes the lest significant bits of
WAVEFORMATEXTENSIBLE's dwChannelMask in order. This doesn't match SDL's
chosen channel ordering.

The implementation here mirrors what we do for PipeWire.
2025-10-30 13:32:43 -07:00
SDL Wiki Bot
45a1cfde1f Sync SDL3 wiki -> header
[ci skip]
2025-10-30 16:01:56 +00:00
Sam Lantinga
2f5279eb01 Clarify SDL_ConvertEventToRenderCoordinates() documentation
Fixes https://github.com/libsdl-org/SDL/issues/14360
2025-10-30 09:00:14 -07:00
Sam Lantinga
c21b7f8cb8 Check to see if joysticks are actually initialized in SDL_UpdateJoysticks()
Fixes https://github.com/libsdl-org/SDL/issues/14362
2025-10-30 08:53:57 -07:00
Sam Lantinga
a7147f327f Temporarily disable WASAPI device roles
Setting AudioCategory_GameChat breaks audio on several devices, including Behringer U-PHORIA UM2 and RODE NT-USB Mini. We'll disable this for now until we understand more about what's happening.
2025-10-30 07:27:23 -07:00
Simon McVittie
0773e88df5 CI: Make some important libraries mandatory on Steam Linux Runtime 3.0
This means we exercise the non-dlopen()-based code paths for these,
as used in Debian and the Steam Runtime.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-30 07:13:37 -07:00
Simon McVittie
8b64dd67d2 wayland: Fix compile with libdecor 0.2 and SDL_WAYLAND_LIBDECOR_SHARED=OFF
libdecor 0.3, which changes the signature of libdecor_new and
libdecor_decorate to use a const pointer to the interface struct, has
not yet been released. In the latest release, libdecor 0.2.4, the
interface struct is a mutable pointer.

This doesn't affect typical upstream builds with
SDL_WAYLAND_LIBDECOR_SHARED=ON, in which case we're casting a pointer
returned by dlsym(); but Linux distributions that want tighter control
over dependencies often prefer to link them in the normal way, in which
case the build will fail if the signature doesn't match.

Fixes: 33834360 "wayland: Fix libdecor incompatible pointer types"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-30 07:13:37 -07:00
Sam Lantinga
d9ca0457b5 Make sure we don't allocate a TLS ID clobbering an application defined one
Fixes https://github.com/libsdl-org/SDL/issues/14359
2025-10-29 14:05:49 -07:00
Kirill Andriiashin
a76fb7b2fb Add support for GPU RGB565 (B5G6R5_UNORM) textures with DX11 (#14358) 2025-10-29 10:39:58 -07:00
Quentin Thébault
3b80fcd1a0 KMSDRM/EVDEV: add VT switching support for FreeBSD (#14346)
Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
2025-10-29 09:52:32 -07:00
Sam Lantinga
b3612f6462 testautomation: fixed RLE operation test on big endian systems
Fixes https://github.com/libsdl-org/SDL/issues/14348
2025-10-29 16:26:31 +00:00
Sam Lantinga
8b8c51573b Disabled incorrect 16-bit Altivec blitters 2025-10-29 16:11:25 +00:00
Sam Lantinga
84fac6ca44 testautomation: verify that RLE operation output is correct 2025-10-29 09:07:56 -07:00
Sam Lantinga
bf0752a8d7 Fixed converting RLE encoded surfaces to other formats 2025-10-29 09:06:25 -07:00
Sam Lantinga
c4cef905ae Updated internal documentation 2025-10-29 08:39:56 -07:00
Sam Lantinga
cecf4b0d4e Fixed the right shoulder button on the 8BitDo Pro 3 2025-10-28 14:55:06 -07:00
Sam Lantinga
78f9cb44c3 Added a Linux mapping for the 8BitDo Pro 3 2025-10-28 14:13:40 -07:00
Frank Praznik
3383436068 wayland: Fix libdecor incompatible pointer types 2025-10-28 12:01:41 -04:00
Sam Lantinga
2d14a237dc Fixed trying to grab the mouse when losing keyboard focus
Fixes https://github.com/libsdl-org/SDL/issues/14350
2025-10-28 07:15:43 -07:00
SDL Wiki Bot
a57757aaba Sync SDL3 wiki -> header
[ci skip]
2025-10-28 07:10:36 +00:00
Sam Lantinga
933beeb18b Fixed warning: no previous extern declaration for non-static variable 2025-10-27 17:52:05 -07:00
Sam Lantinga
965ac7f406 Fixed warning: implicit conversion loses integer precision: 'long' to 'int' 2025-10-27 17:49:49 -07:00
Sam Lantinga
90242312fe Restored the original OpenBSD Xbox 360 controller mapping 2025-10-27 17:39:29 -07:00
Sam Lantinga
b305534edc Completed removing predefined Xbox 360 mappings for Linux
Also removed them for OpenBSD, since it's not clear which ones, if any, are needed.
2025-10-27 17:34:23 -07:00
Sam Lantinga
be1d44279c Fixed error: incompatible function pointer types passing
SDL/src/sensor/emscripten/SDL_emscriptensensor.c:80:5: error: incompatible function pointer types passing
      'int (*)(int, const EmscriptenDeviceMotionEvent *, void *)' (aka 'int (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') to parameter of type 'em_devicemotion_callback_func' (aka
      'bool (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') [-Wincompatible-function-pointer-types]
   80 |     emscripten_set_devicemotion_callback((void *)0, false, &SDL_EMSCRIPTEN_SensorCallback);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-10-27 10:13:57 -07:00
Dave Wickham
f6c3af9c8c Re-add deleted gamepad mappings to the OpenBSD-specific section 2025-10-27 08:55:03 -07:00
Dave Wickham
0c4c4cfd16 Remove special-case Xbox 360 wireless controller mappings
Fixes https://github.com/libsdl-org/SDL/issues/14324
2025-10-27 08:55:03 -07:00
Eddy Jansson
f773da2273 log: Rework NGAGE logging. (#14321)
This moves the NGAGE file logging into SDL_LogOutput(), following the pattern of the 3DS, VITA, PSP, etc.
2025-10-27 08:48:04 -07:00
SDL Wiki Bot
8ca8887885 Sync SDL3 wiki -> header
[ci skip]
2025-10-27 15:39:21 +00:00
Sam Lantinga
f5966890b0 Added a note that SDL_LoadPNG() is designed for trusted images
Fixes https://github.com/libsdl-org/SDL/issues/14338
2025-10-27 08:38:00 -07:00
Sam Lantinga
01aa1882f8 Added a patch note for SDL_ELF_NOTE_DLOPEN
Fixes https://github.com/libsdl-org/SDL/issues/14337
2025-10-27 08:28:05 -07:00
Anonymous Maarten
5ad12c47dc cmake: make sure VARIABLE of check_linker_supports_version_file ends up in cache 2025-10-27 03:01:57 +01:00
Anonymous Maarten
766532948e cmake: SDL_process on unix needs vfork symbol
Current FIL-C toolchains don't have vfork
2025-10-26 23:22:37 +01:00
SDL Wiki Bot
4e8f93c6f1 Sync SDL3 wiki -> header
[ci skip]
2025-10-26 16:28:36 +00:00
expikr
b4eaf9d96f Add hint for blocking win key when using raw keyboard (#13066)
Co-authored-by: Susko3 <Susko3@protonmail.com>
2025-10-26 09:27:33 -07:00
Sam Lantinga
0ea20a5f86 Fix NULL pointer dereference in SDL_RenderGeometryRaw with NPOT textures (thanks @bleeqer!)
Fixes https://github.com/libsdl-org/SDL/issues/14329
Closes https://github.com/libsdl-org/SDL/pull/14331
2025-10-26 08:10:52 -07:00
antonegas
33f1008d01 Added Emscripten support for Sensor API 2025-10-26 07:58:28 -07:00
Albin Johansson
7381a2b072 Use cast operators in headers to avoid warnings
This avoids compiler warnings when consuming the
headers from C++.
2025-10-25 19:52:23 -04:00
Sam Lantinga
e08edab180 Log object leaks at debug level
End users don't care about this. Developers can enable debug logs, run with DEBUG_INVOCATION=1, or use other leak checking tools to detect these.
2025-10-25 15:13:37 -07:00
Sam Lantinga
ffd0ca4391 Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized.

Fixes https://github.com/libsdl-org/sdl12-compat/issues/365
2025-10-25 13:48:48 -07:00
SDL Wiki Bot
e7e2b26b2e Sync SDL3 wiki -> header
[ci skip]
2025-10-25 19:08:01 +00:00
Ryan C. Gordon
a0fa64a91c wikiheaders: Don't ignore macro symbols that are defined without any content.
Reference PR #12676.
2025-10-25 15:05:36 -04:00
Frank Praznik
acaf53926c wayland: Destroy the seats before stopping the cursor surface event thread
Stopping the thread also destroys the queue used by pointer surfaces, and if any seats still have a surface associated with the queue at that time, it will cause a libwayland warning. Destroying the seats first ensures that all surfaces associated with the thread queue are destroyed before the queue is destroyed.
2025-10-25 12:54:20 -04:00
Gleb Mazovetskiy
38df1c3138 miniz.h: do not overallocate out_buf 2025-10-25 07:44:15 -07:00
DONGGEUN YOO
093fbfd867 Fix uninitialized length in X11_GetClipboardData causing test failures (#14322) 2025-10-25 07:41:58 -07:00
Gleb Mazovetskiy
ac0915bdb5 miniz.h: fix PNG compression when pitch != w 2025-10-25 01:24:14 -07:00
Frank Praznik
537e92b158 wayland: Synthesize repeated keys after processing events
Otherwise, long delays between pumping events can result in repeating keys that were already lifted some time ago.
2025-10-24 15:51:01 -04:00
Sam Lantinga
51b401d418 Fixed OTP text entry on iOS (thanks @pipiwoaini!)
Fixes https://github.com/libsdl-org/SDL/issues/13717
2025-10-24 11:02:37 -07:00
Sam Lantinga
1506c40ec8 Fixed line endings in FindLibUSB.cmake 2025-10-24 10:48:25 -07:00
Sam Lantinga
404ec13fbb Fixed building with libusb on FreeBSD 2025-10-24 10:41:08 -07:00
Dmitry Marakasov
5c56cf110b Add libusb library name for detection on FreeBSD 2025-10-24 10:41:08 -07:00
Frank Praznik
3149533f0c wayland: Remove unused struct member 2025-10-24 13:37:20 -04:00
Sam Lantinga
d2c6aeea7d Add the bundle framework path to the libMoltenVK.dylib paths
Fixes https://github.com/libsdl-org/SDL/issues/14313
2025-10-24 10:33:22 -07:00
Sam Lantinga
c959f9f0d8 Define SDL_FILE as __FILE_NAME__, if available 2025-10-24 10:01:01 -07:00
Dmitry Marakasov
42ce72be3c Fix libusb get_port_numbers signature for FreeBSD 2025-10-24 08:26:17 -07:00
Sam Lantinga
be781fc8f5 Updated to version 3.3.3 for development 2025-10-23 22:41:03 -07:00
Frank Praznik
39aedcef64 events: Pump DBus messages in the main event loop
DBus does not require a video backend, and DBus messages still need to be processed even when a video backend is not initialized. Move the DBus pump call to the main event message pump function so that DBus events are still dispatched, even when a video backend has not been initialized.
2025-10-23 21:03:09 -04:00
1249 changed files with 19466 additions and 9252 deletions

View File

@@ -100,6 +100,7 @@ class JobSpec:
clang_cl: bool = False
gdk: bool = False
vita_gles: Optional[VitaGLES] = None
more_hard_deps: bool = False
JOB_SPECS = {
@@ -116,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", ),
"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", ),
"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, ),
@@ -448,6 +451,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
"libxfixes-dev",
"libxi-dev",
"libxss-dev",
"libxtst-dev",
"libwayland-dev",
"libxkbcommon-dev",
"libdrm-dev",
@@ -483,6 +487,19 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
fpic = True
if spec.more_hard_deps:
# Some distros prefer to make important dependencies
# mandatory, so that SDL won't start up but lack expected
# functionality if they're missing
job.cmake_arguments.extend([
"-DSDL_ALSA_SHARED=OFF",
"-DSDL_FRIBIDI_SHARED=OFF",
"-DSDL_HIDAPI_LIBUSB_SHARED=OFF",
"-DSDL_PULSEAUDIO_SHARED=OFF",
"-DSDL_X11_SHARED=OFF",
"-DSDL_WAYLAND_LIBDECOR_SHARED=OFF",
"-DSDL_WAYLAND_SHARED=OFF",
])
case SdlPlatform.Ios | SdlPlatform.Tvos:
job.brew_packages.extend([
"ccache",

View File

@@ -91,13 +91,21 @@ jobs:
sudo apt-get install -y \
gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev \
libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev \
libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
- name: 'CMake (configure + build + tests + examples)'
run: |
set -e
cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
cmake --build /tmp/build --verbose
ctest --test-dir /tmp/build --no-tests=error --output-on-failure
- name: 'Verify SDL_REVISION contains SDL-'
run: |
set -e
if test "x$(strings /tmp/build/libSDL3.so.0 | grep SDL- | wc -l)" != x1; then
echo "SDL- string not found: must be present in SDL_REVISION"
exit 1
fi
dmg:
needs: [src]
@@ -677,6 +685,7 @@ jobs:
-DTEST_TEST=TRUE \
-DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DANDROID_USE_LEGACY_TOOLCHAIN=0 \
-DANDROID_ABI=${android_abi} \
-DCMAKE_BUILD_TYPE=Release \
-B "${android_abi}"

View File

@@ -112,8 +112,6 @@ ifeq ($(NDK_DEBUG),1)
cmd-strip :=
endif
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
@@ -145,4 +143,3 @@ LOCAL_EXPORT_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)
$(call import-module,android/cpufeatures)

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.2")
project(SDL3 LANGUAGES C VERSION "3.4.2")
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)
@@ -169,12 +170,12 @@ else()
endif()
set(SDL_ASSEMBLY_DEFAULT OFF)
if(USE_CLANG OR USE_GCC OR USE_INTELCC OR MSVC_VERSION GREATER 1400)
if(USE_CLANG OR USE_GCC OR USE_INTELCC OR USE_TCC OR MSVC_VERSION GREATER 1400)
set(SDL_ASSEMBLY_DEFAULT ON)
endif()
set(SDL_GCC_ATOMICS_DEFAULT OFF)
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC OR USE_TCC)
set(SDL_GCC_ATOMICS_DEFAULT ON)
endif()
@@ -349,6 +350,8 @@ dep_option(SDL_X11_XSYNC "Enable Xsync support" ON SDL_X11 OFF)
dep_option(SDL_X11_XTEST "Enable XTest support" ON SDL_X11 OFF)
dep_option(SDL_FRIBIDI "Enable Fribidi support" ON SDL_X11 OFF)
dep_option(SDL_FRIBIDI_SHARED "Dynamically load Fribidi support" ON "SDL_FRIBIDI;SDL_DEPS_SHARED" OFF)
dep_option(SDL_LIBTHAI "Enable Thai support" ON SDL_X11 OFF)
dep_option(SDL_LIBTHAI_SHARED "Dynamically load Thai support" ON "SDL_LIBTHAI;SDL_DEPS_SHARED" OFF)
dep_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS} "SDL_VIDEO" OFF)
dep_option(SDL_WAYLAND_SHARED "Dynamically load Wayland support" ON "SDL_WAYLAND;SDL_DEPS_SHARED" OFF)
dep_option(SDL_WAYLAND_LIBDECOR "Use client-side window decorations on Wayland" ON "SDL_WAYLAND" OFF)
@@ -365,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)
@@ -376,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)
@@ -391,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")
@@ -463,7 +466,10 @@ if(SDL_SHARED)
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
target_compile_features(SDL3-shared PRIVATE c_std_99)
else()
message(WARNING "target_compile_features does not know c_std_99 for C compiler")
# tcc does support the subset of C99 used by SDL
if (NOT USE_TCC)
message(WARNING "target_compile_features does not know c_std_99 for C compiler")
endif()
endif()
endif()
@@ -476,7 +482,9 @@ if(SDL_STATIC)
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
target_compile_features(SDL3-static PRIVATE c_std_99)
else()
message(WARNING "target_compile_features does not know c_std_99 for C compiler")
if (NOT USE_TCC)
message(WARNING "target_compile_features does not know c_std_99 for C compiler")
endif()
endif()
endif()
@@ -510,7 +518,10 @@ check_linker_supports_version_file(HAVE_WL_VERSION_SCRIPT)
if(HAVE_WL_VERSION_SCRIPT)
sdl_shared_link_options("-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym")
else()
if((LINUX AND LIBC_IS_GLIBC) OR ANDROID)
# When building with tcc on Linux+glibc or Android, avoid emitting an error
# for lack of support of the version-script linker flag: the option will be
# silently ignored by the compiler and the build will still succeed.
if(((LINUX AND LIBC_IS_GLIBC) OR ANDROID) AND (NOT USE_TCC))
message(FATAL_ERROR "Linker does not support '-Wl,--version-script=xxx.sym'. This is required on the current host platform (${SDL_CMAKE_PLATFORM}).")
endif()
endif()
@@ -648,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)"
@@ -914,6 +920,7 @@ if(SDL_ASSEMBLY)
set(HAVE_ALTIVEC TRUE)
set(SDL_ALTIVEC_BLITTERS 1)
sdl_compile_options(PRIVATE "-maltivec")
sdl_compile_options(PRIVATE "-fno-tree-vectorize")
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" APPEND PROPERTY COMPILE_DEFINITIONS "SDL_ENABLE_ALTIVEC")
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" PROPERTY SKIP_PRECOMPILE_HEADERS 1)
endif()
@@ -931,7 +938,17 @@ if(SDL_ASSEMBLY)
cmake_pop_check_state()
if(COMPILER_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c" APPEND PROPERTY COMPILE_OPTIONS "-mlsx")
set_property(SOURCE
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c"
"${SDL3_SOURCE_DIR}/src/video/SDL_blit_A.c"
"${SDL3_SOURCE_DIR}/src/video/SDL_fillrect.c"
APPEND PROPERTY COMPILE_OPTIONS "-mlsx")
set_property(SOURCE
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c"
"${SDL3_SOURCE_DIR}/src/video/SDL_blit_A.c"
"${SDL3_SOURCE_DIR}/src/video/SDL_fillrect.c"
PROPERTY SKIP_PRECOMPILE_HEADERS 1)
set(HAVE_LSX TRUE)
endif()
endif()
@@ -1140,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)
@@ -1271,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
@@ -1396,8 +1418,6 @@ if(ANDROID)
"${SDL3_SOURCE_DIR}/src/core/android/*.c"
"${SDL3_SOURCE_DIR}/src/core/android/*.h"
)
sdl_sources("${CMAKE_ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c")
set_property(SOURCE "${CMAKE_ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-declaration-after-statement")
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/misc/android/*.c"
@@ -1715,6 +1735,15 @@ elseif(EMSCRIPTEN)
set(HAVE_CLOCK_GETTIME 1)
endif()
if(SDL_SENSOR)
set(SDL_SENSOR_EMSCRIPTEN 1)
set(HAVE_SDL_SENSORS TRUE)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/sensor/emscripten/*.c"
"${SDL3_SOURCE_DIR}/src/sensor/emscripten/*.h"
)
endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_EMSCRIPTEN 1)
sdl_glob_sources(
@@ -1736,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__
@@ -1748,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()
@@ -1787,6 +1817,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
CheckROCKCHIP()
CheckX11()
CheckFribidi()
CheckLibThai()
# Need to check for EGL first because KMSDRM and Wayland depend on it.
CheckEGL()
CheckKMSDRM()
@@ -3452,7 +3483,10 @@ int main(void)
return 0;
}
" HAVE_POSIX_SPAWN)
if(HAVE_POSIX_SPAWN)
if(NOT APPLE)
check_symbol_exists(vfork "unistd.h" LIBC_HAS_VFORK)
endif()
if(HAVE_POSIX_SPAWN AND (APPLE OR LIBC_HAS_VFORK))
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/process/posix/*.c"
"${SDL3_SOURCE_DIR}/src/process/posix/*.h"
@@ -3796,10 +3830,6 @@ else()
set(ARCH_64 FALSE)
endif()
if(ANDROID)
sdl_include_directories(PRIVATE SYSTEM "${CMAKE_ANDROID_NDK}/sources/android/cpufeatures")
endif()
if(APPLE)
cmake_push_check_state(RESET)
check_c_compiler_flag(-fobjc-arc COMPILER_SUPPORTS_FOBJC_ARC)
@@ -3969,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()
@@ -3993,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()
@@ -4008,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" />
@@ -735,6 +736,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_triton.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
@@ -743,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

@@ -79,6 +79,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_triton.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
@@ -87,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" />
@@ -371,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

View File

@@ -82,16 +82,16 @@
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(ProjectDir)/../../src/core/windows;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(ProjectDir)/../../src/core/windows;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(ProjectDir)/../../src/core/windows;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(ProjectDir)/../../src/core/windows;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
@@ -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" />
@@ -625,6 +626,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_triton.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
@@ -634,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>
@@ -1538,8 +1544,6 @@
</ClCompile>
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c">
<Filter>sensor\windows</Filter>
</ClCompile>
<Filter>render</Filter>
</ClCompile>
<ClCompile Include="..\..\src\render\SDL_render.c">
<Filter>render</Filter>
@@ -1660,6 +1664,9 @@
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
<ClCompile Include="..\..\src\storage\steam\SDL_steamstorage.c" />
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_triton.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp">
<Filter>core\windows</Filter>

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,69 +7,128 @@ 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
Note: On Unix platforms SDL provides ELF notes describing its non-mandatory library dependencies in the format described by https://systemd.io/ELF_DLOPEN_METADATA/. Some of these libraries are quite important, so distribution vendors who package SDL should parse the ELF notes and consider generating dependencies at the packaging level, for example by using https://github.com/systemd/package-notes. Other libraries and games can add similar ELF notes to describe their own dependencies by using the SDL_ELF_NOTE_DLOPEN macro.
---------------------------------------------------------------------------
3.2.22:
---------------------------------------------------------------------------
* SDL_HINT_JOYSTICK_WGI is disabled by default
---------------------------------------------------------------------------
3.2.16:
---------------------------------------------------------------------------
* SDL_HINT_JOYSTICK_RAWINPUT is disabled by default
---------------------------------------------------------------------------
3.2.10:
---------------------------------------------------------------------------
* Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT to control whether XSelectInput() should be called on external windows to enable input events.
---------------------------------------------------------------------------
3.2.4:
---------------------------------------------------------------------------
* Added SDL_StretchSurface()
---------------------------------------------------------------------------
3.2.0:
---------------------------------------------------------------------------

View File

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

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 55;
objects = {
/* Begin PBXAggregateTarget section */
@@ -414,6 +414,7 @@
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 */; };
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 */; };
@@ -529,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 */; };
@@ -997,6 +1002,7 @@
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>"; };
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>"; };
@@ -1111,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>"; };
@@ -1946,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 */,
@@ -1958,10 +1969,12 @@
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 */,
F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */,
F38C72482CEEB1DE000B0A90 /* SDL_hidapi_steam_triton.c */,
A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */,
A7D8A7C623E2513E00DCD162 /* SDL_hidapi_switch.c */,
A7D8A7C623E2513E00DCD163 /* SDL_hidapi_switch2.c */,
@@ -1972,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>";
@@ -2551,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 */,
@@ -2920,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 */,
@@ -3009,6 +3028,7 @@
F316ABD92B5C3185002EF551 /* SDL_memcpy.c in Sources */,
A7D8B97A23E2514400DCD162 /* SDL_render.c in Sources */,
A7D8ABD323E2514100DCD162 /* SDL_stretch.c in Sources */,
F38C72492CEEB1DE000B0A90 /* SDL_hidapi_steam_triton.c in Sources */,
A7D8AC3923E2514100DCD162 /* SDL_blit_copy.c in Sources */,
A7D8B5CF23E2514300DCD162 /* SDL_syspower.m in Sources */,
F3B439512C935C2400792030 /* SDL_dummyprocess.c in Sources */,
@@ -3141,8 +3161,8 @@
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 303.0.0;
DYLIB_CURRENT_VERSION = 303.0.0;
DYLIB_COMPATIBILITY_VERSION = 401.0.0;
DYLIB_CURRENT_VERSION = 401.2.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3177,7 +3197,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.3.2;
MARKETING_VERSION = 3.4.2;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
PRODUCT_NAME = SDL3;
@@ -3207,8 +3227,8 @@
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DYLIB_COMPATIBILITY_VERSION = 303.0.0;
DYLIB_CURRENT_VERSION = 303.0.0;
DYLIB_COMPATIBILITY_VERSION = 401.0.0;
DYLIB_CURRENT_VERSION = 401.2.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -3240,7 +3260,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.3.2;
MARKETING_VERSION = 3.4.2;
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.2
Title SDL 3.4.2
Version 1
Description SDL Library for macOS (http://www.libsdl.org)
DefaultLocation /Library/Frameworks

View File

@@ -31,9 +31,11 @@ if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
else()
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
unset(_sdl_version_h)
unset(_sdl_version_h_path)
unset(_sdl_major_re)
unset(_sdl_major)

View File

@@ -16,6 +16,7 @@ set(_sdl3_version_h "${_sdl3_framework}/Headers/SDL_version.h")
if(NOT EXISTS "${_sdl3_version_h}")
message(AUTHOR_WARNING "Cannot not find ${_sdl3_framework}. This script is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
@@ -36,6 +37,7 @@ if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
else()
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()

View File

@@ -1991,7 +1991,6 @@
dependencies = (
);
name = testatomic;
productName = testalpha;
productReference = 0017958C10741F7900F5D044 /* testatomic.app */;
productType = "com.apple.product-type.application";
};
@@ -2008,7 +2007,6 @@
dependencies = (
);
name = testaudioinfo;
productName = testalpha;
productReference = 001795AD107421BF00F5D044 /* testaudioinfo.app */;
productType = "com.apple.product-type.application";
};
@@ -2025,7 +2023,6 @@
dependencies = (
);
name = testgl;
productName = testalpha;
productReference = 0017972110742F3200F5D044 /* testgl.app */;
productType = "com.apple.product-type.application";
};
@@ -2042,7 +2039,6 @@
dependencies = (
);
name = testhaptic;
productName = testalpha;
productReference = 00179748107430D600F5D044 /* testhaptic.app */;
productType = "com.apple.product-type.application";
};
@@ -2059,7 +2055,6 @@
dependencies = (
);
name = testdraw;
productName = testalpha;
productReference = 0017976E107431B300F5D044 /* testdraw.app */;
productType = "com.apple.product-type.application";
};
@@ -2077,7 +2072,6 @@
dependencies = (
);
name = testime;
productName = testalpha;
productReference = 0017978E107432AE00F5D044 /* testime.app */;
productType = "com.apple.product-type.application";
};
@@ -2094,7 +2088,6 @@
dependencies = (
);
name = testintersections;
productName = testalpha;
productReference = 001797AE1074334C00F5D044 /* testintersections.app */;
productType = "com.apple.product-type.application";
};
@@ -2111,7 +2104,6 @@
dependencies = (
);
name = testloadso;
productName = testalpha;
productReference = 001797D0107433C600F5D044 /* testloadso.app */;
productType = "com.apple.product-type.application";
};
@@ -2129,7 +2121,6 @@
dependencies = (
);
name = testmultiaudio;
productName = testalpha;
productReference = 001798121074355200F5D044 /* testmultiaudio.app */;
productType = "com.apple.product-type.application";
};
@@ -2147,7 +2138,6 @@
dependencies = (
);
name = testnative;
productName = testalpha;
productReference = 001798941074392D00F5D044 /* testnative.app */;
productType = "com.apple.product-type.application";
};
@@ -2164,7 +2154,6 @@
dependencies = (
);
name = testpower;
productName = testalpha;
productReference = 001798B5107439DF00F5D044 /* testpower.app */;
productType = "com.apple.product-type.application";
};
@@ -2181,7 +2170,6 @@
dependencies = (
);
name = testresample;
productName = testalpha;
productReference = 001798F210743BEC00F5D044 /* testresample.app */;
productType = "com.apple.product-type.application";
};
@@ -2199,7 +2187,6 @@
dependencies = (
);
name = testsprite;
productName = testalpha;
productReference = 0017991610743F1000F5D044 /* testsprite.app */;
productType = "com.apple.product-type.application";
};
@@ -2216,7 +2203,6 @@
dependencies = (
);
name = testwm;
productName = testalpha;
productReference = 0017993810743FB700F5D044 /* testwm.app */;
productType = "com.apple.product-type.application";
};
@@ -2233,7 +2219,6 @@
dependencies = (
);
name = testfile;
productName = testalpha;
productReference = 002F341209CA1BFF00EBEB88 /* testfile.app */;
productType = "com.apple.product-type.application";
};
@@ -2251,7 +2236,6 @@
dependencies = (
);
name = testiconv;
productName = testalpha;
productReference = 002F343109CA1F0300EBEB88 /* testiconv.app */;
productType = "com.apple.product-type.application";
};
@@ -2269,7 +2253,6 @@
dependencies = (
);
name = testoverlay;
productName = testalpha;
productReference = 002F344D09CA1FB300EBEB88 /* testoverlay.app */;
productType = "com.apple.product-type.application";
};
@@ -2286,7 +2269,6 @@
dependencies = (
);
name = testplatform;
productName = testalpha;
productReference = 002F346A09CA204F00EBEB88 /* testplatform.app */;
productType = "com.apple.product-type.application";
};
@@ -2509,7 +2491,6 @@
dependencies = (
);
name = testdrawchessboard;
productName = testalpha;
productReference = DB0F48EC17CA51E5008798C5 /* testdrawchessboard.app */;
productType = "com.apple.product-type.application";
};
@@ -2526,7 +2507,6 @@
dependencies = (
);
name = testfilesystem;
productName = testalpha;
productReference = DB0F490117CA5212008798C5 /* testfilesystem.app */;
productType = "com.apple.product-type.application";
};
@@ -2560,7 +2540,6 @@
dependencies = (
);
name = testmessage;
productName = testalpha;
productReference = DB166DD516A1D36A00A1396C /* testmessage.app */;
productType = "com.apple.product-type.application";
};
@@ -2577,7 +2556,6 @@
dependencies = (
);
name = testrelative;
productName = testalpha;
productReference = DB166DEE16A1D50C00A1396C /* testrelative.app */;
productType = "com.apple.product-type.application";
};
@@ -2595,7 +2573,6 @@
dependencies = (
);
name = testrendercopyex;
productName = testalpha;
productReference = DB166E0516A1D57C00A1396C /* testrendercopyex.app */;
productType = "com.apple.product-type.application";
};
@@ -2613,7 +2590,6 @@
dependencies = (
);
name = testrendertarget;
productName = testalpha;
productReference = DB166E1C16A1D5AD00A1396C /* testrendertarget.app */;
productType = "com.apple.product-type.application";
};
@@ -2630,7 +2606,6 @@
dependencies = (
);
name = testrumble;
productName = testalpha;
productReference = DB166E3816A1D64D00A1396C /* testrumble.app */;
productType = "com.apple.product-type.application";
};
@@ -2648,7 +2623,6 @@
dependencies = (
);
name = testscale;
productName = testalpha;
productReference = DB166E5216A1D69000A1396C /* testscale.app */;
productType = "com.apple.product-type.application";
};
@@ -2717,7 +2691,6 @@
dependencies = (
);
name = testhotplug;
productName = testalpha;
productReference = DB89957E18A19ABA0092407C /* testhotplug.app */;
productType = "com.apple.product-type.application";
};
@@ -2734,7 +2707,6 @@
dependencies = (
);
name = testautomation;
productName = testalpha;
productReference = F35E56AA298312CB00A43A5F /* testautomation.app */;
productType = "com.apple.product-type.application";
};
@@ -2751,7 +2723,6 @@
dependencies = (
);
name = testcamera;
productName = testalpha;
productReference = F36C34272C0F85DB00991150 /* testcamera.app */;
productType = "com.apple.product-type.application";
};
@@ -2768,7 +2739,6 @@
dependencies = (
);
name = testpen;
productName = testalpha;
productReference = F3B7FD6A2D73FC630086D1D0 /* testpen.app */;
productType = "com.apple.product-type.application";
};
@@ -2803,7 +2773,6 @@
dependencies = (
);
name = testyuv;
productName = testalpha;
productReference = F3DB65E92E9DA90000568044 /* testyuv.app */;
productType = "com.apple.product-type.application";
};
@@ -4045,7 +4014,7 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
@@ -4056,7 +4025,8 @@
SUPPORTED_PLATFORMS = "xrsimulator xros macosx iphonesimulator iphoneos appletvsimulator appletvos";
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
XROS_DEPLOYMENT_TARGET = 1.3;
};
name = Debug;
};
@@ -4219,7 +4189,7 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
@@ -4229,7 +4199,8 @@
SUPPORTED_PLATFORMS = "xrsimulator xros macosx iphonesimulator iphoneos appletvsimulator appletvos";
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
XROS_DEPLOYMENT_TARGET = 1.3;
};
name = Release;
};
@@ -4726,6 +4697,25 @@
};
name = Release;
};
F37E49E22EB5250B00E508F7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
F37E49E32EB5250B00E508F7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
F3B7FD682D73FC630086D1D0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -5213,8 +5203,8 @@
F3DB65E62E9DA90000568044 /* Build configuration list for PBXNativeTarget "testyuv" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F3DB65E72E9DA90000568044 /* Debug */,
F3DB65E82E9DA90000568044 /* Release */,
F37E49E22EB5250B00E508F7 /* Debug */,
F37E49E32EB5250B00E508F7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;

View File

@@ -10,5 +10,7 @@
// This allows you to set DEVELOPMENT_TEAM for all targets, for example.
#include? "build.xcconfig"
INFOPLIST_FILE = test-Info.plist
CONFIG_FRAMEWORK_LDFLAGS = -lSDL3_test

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchScreen</key>
<dict>
<key>UIColorName</key>
<string></string>
<key>UIImageName</key>
<string></string>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>

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

@@ -60,7 +60,7 @@ 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_MINOR_VERSION = 4;
private static final int SDL_MICRO_VERSION = 2;
/*
// 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

@@ -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
@@ -1028,6 +1032,7 @@ class Releaser:
# NDK 21e does not support -ffile-prefix-map
# f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
# f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
f"-DANDROID_USE_LEGACY_TOOLCHAIN=0",
f"-DCMAKE_EXE_LINKER_FLAGS={extra_link_options}",
f"-DCMAKE_SHARED_LINKER_FLAGS={extra_link_options}",
f"-DCMAKE_TOOLCHAIN_FILE={cmake_toolchain_file}",
@@ -1126,8 +1131,7 @@ class Releaser:
for dep, depinfo in self.release_info.get("dependencies", {}).items():
startswith = depinfo["startswith"]
dep_repo = depinfo["repo"]
# FIXME: dropped "--exclude-pre-releases"
dep_string_data = self.executer.check_output(["gh", "-R", dep_repo, "release", "list", "--exclude-drafts", "--json", "name,createdAt,tagName", "--jq", f'[.[]|select(.name|startswith("{startswith}"))]|max_by(.createdAt)']).strip()
dep_string_data = self.executer.check_output(["gh", "-R", dep_repo, "release", "list", "--exclude-drafts", "--exclude-pre-releases", "--json", "name,createdAt,tagName", "--jq", f'[.[]|select(.name|startswith("{startswith}"))]|max_by(.createdAt)']).strip()
dep_data = json.loads(dep_string_data)
dep_tag = dep_data["tagName"]
dep_version = dep_data["name"]

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
@@ -29,7 +29,7 @@ import sys
SDL_ROOT = pathlib.Path(__file__).resolve().parents[1]
STDLIB_SYMBOLS = [
STDLIB_SYMBOLS = (
'abs',
'acos',
'acosf',
@@ -147,8 +147,8 @@ STDLIB_SYMBOLS = [
'wcsncasecmp',
'wcsncmp',
'wcsstr',
]
RE_STDLIB_SYMBOL = re.compile(rf"\b(?P<symbol>{'|'.join(STDLIB_SYMBOLS)})\b\(")
)
RE_STDLIB_SYMBOL = re.compile(rf"(?<!->)\b(?P<symbol>{'|'.join(STDLIB_SYMBOLS)})\b\(")
def find_symbols_in_file(file: pathlib.Path) -> int:
@@ -220,13 +220,19 @@ def find_symbols_in_file(file: pathlib.Path) -> int:
line_comment += line[pos_line_comment:]
line = line[:pos_line_comment]
if m := RE_STDLIB_SYMBOL.match(line):
override_string = f"This should NOT be SDL_{m['symbol']}()"
if override_string not in line_comment:
print(f"{filename}:{line_i}")
print(f" {line}")
print(f"")
match_count += 1
if matches := tuple(RE_STDLIB_SYMBOL.finditer(line)):
text_string = " or ".join(f"SDL_{m.group(1)}" for m in matches)
first_quote = line.find("\"")
last_quote = line.rfind("\"")
first_occurrence = min(m.span()[0] for m in matches)
last_occurrence = max(m.span()[1] for m in matches)
if first_quote == -1 or not (first_quote < first_occurrence and last_quote > last_occurrence):
override_string = f"This should NOT be {text_string}"
if override_string not in line_comment:
print(f"{filename}:{line_i}")
print(f" {line}")
print(f"")
match_count += 1
except UnicodeDecodeError:
print(f"{file} is not text, skipping", file=sys.stderr)
@@ -235,7 +241,7 @@ def find_symbols_in_file(file: pathlib.Path) -> int:
def find_symbols_in_dir(path: pathlib.Path) -> int:
match_count = 0
for entry in path.glob("*"):
for entry in path.iterdir():
if entry.is_dir():
match_count += find_symbols_in_dir(entry)
else:
@@ -249,7 +255,10 @@ def main():
print(f"Looking for stdlib usage in {args.path}...")
match_count = find_symbols_in_dir(args.path)
if args.path.is_file():
match_count = find_symbols_in_file(args.path)
else:
match_count = find_symbols_in_dir(args.path)
if match_count:
print("If the stdlib usage is intentional, add a '// This should NOT be SDL_<symbol>()' line comment.")

142
build-scripts/create_tbds.py Executable file
View File

@@ -0,0 +1,142 @@
#!/usr/bin/env python3
import argparse
import dataclasses
import enum
from pathlib import Path
import json
import subprocess
import sys
import tempfile
SDL_ROOT = Path(__file__).resolve().parents[1]
@dataclasses.dataclass
class TbdInfo:
install_name: str
target_infos: list[dict[str, str]]
class TbdPlatform(enum.StrEnum):
MACOS = "macOS"
IOS = "iOS"
TBDINFOS = {
TbdPlatform.MACOS: TbdInfo(
install_name="@rpath/SDL3.framework/Versions/A/SDL3",
target_infos=[
{
"min_deployment": "10.13",
"target": "arm64-macos",
},
{
"min_deployment": "10.13",
"target": "x86_64-macos",
},
]
),
TbdPlatform.IOS: TbdInfo(
install_name="@rpath/SDL3.framework/SDL3",
target_infos=[
{
"min_deployment": "11.0",
"target": "arm64-ios",
},
{
"min_deployment": "11.0",
"target": "arm64-ios-simulator",
},
{
"min_deployment": "11.0",
"target": "x86_64-ios-simulator",
},
{
"min_deployment": "11.0",
"target": "arm64-tvos",
},
{
"min_deployment": "11.0",
"target": "arm64-tvos-simulator",
},
{
"min_deployment": "11.0",
"target": "x86_64-tvos-simulator",
},
{
"min_deployment": "1.3",
"target": "arm64-xros",
},
{
"min_deployment": "1.3",
"target": "arm64-xros-simulator",
},
]
),
}
def create_sdl3_tbd(symbols: list[str], tbd_info: TbdInfo):
return {
"main_library": {
"compatibility_versions": [
{
"version": "201"
}
],
"current_versions": [
{
"version": "201"
}
],
"exported_symbols": [
{
"text": {
"global": symbols
}
}
],
"flags": [
{
"attributes": [
"not_app_extension_safe"
]
}
],
"install_names": [
{
"name": tbd_info.install_name
}
],
"target_info": tbd_info.target_infos
},
"tapi_tbd_version": 5
}
def main():
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("--output", "-o", type=Path, help="Output path (default is stdout)")
parser.add_argument("--platform", type=TbdPlatform, required=True,
choices=[str(e) for e in TbdPlatform], help="Apple Platform")
args = parser.parse_args()
with tempfile.NamedTemporaryFile() as f_temp:
f_temp.close()
subprocess.check_call([sys.executable,SDL_ROOT / "src/dynapi/gendynapi.py", "--dump", f_temp.name],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
with open(f_temp.name) as f_json:
sdl3_json = json.load(f_json)
sdl3_macos_symbols = [f"_{symbol_info['name']}" for symbol_info in sdl3_json]
sdl3_macos_symbols.sort()
tbd = create_sdl3_tbd(symbols=sdl3_macos_symbols, tbd_info=TBDINFOS[args.platform])
with (args.output.open("w", newline="") if args.output else sys.stdout) as f_out:
json.dump(tbd, fp=f_out, indent=2)
f_out.write("\n")
if __name__ == "__main__":
raise SystemExit(main())

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
@@ -33,9 +33,9 @@
#cmakedefine SDL_VENDOR_INFO "@SDL_VENDOR_INFO@"
#if defined(SDL_VENDOR_INFO)
#define SDL_REVISION "@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
#else
#define SDL_REVISION "@<@PROJECT_REVISION@>@"
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@"
#endif
#endif /* SDL_revision_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
@@ -48,9 +48,9 @@
*/
#define SDL_REVISION "Some arbitrary string decided at SDL build time"
#elif defined(SDL_VENDOR_INFO)
#define SDL_REVISION "@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
#else
#define SDL_REVISION "@<@PROJECT_REVISION@>@"
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@"
#endif
#endif /* SDL_revision_h_ */

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
@@ -37,6 +37,11 @@ my $versionfname = 'include/SDL_version.h';
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
my $versionminorregex = '\A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z';
my $versionmicroregex = '\A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z';
my $wikidocsectionsym = 'SDL_WIKI_DOCUMENTATION_SECTION';
my $forceinlinesym = 'SDL_FORCE_INLINE';
my $deprecatedsym = 'SDL_DEPRECATED';
my $declspecsym = '(?:SDLMAIN_|SDL_)?DECLSPEC';
my $callconvsym = 'SDLCALL';
my $mainincludefname = 'SDL.h';
my $selectheaderregex = '\ASDL.*?\.h\Z';
my $projecturl = 'https://libsdl.org/';
@@ -147,6 +152,12 @@ if (defined $optionsfname) {
$envvardesc = $val, next if $key eq 'envvardesc';
$envvarsymregex = $val, next if $key eq 'envvarsymregex';
$envvarsymreplace = $val, next if $key eq 'envvarsymreplace';
$wikidocsectionsym = $val, next if $key eq 'wikidocsectionsym';
$forceinlinesym = $val, next if $key eq 'forceinlinesym';
$deprecatedsym = $val, next if $key eq 'deprecatedsym';
$declspecsym = $val, next if $key eq 'declspecsym';
$callconvsym = $val, next if $key eq 'callconvsym';
}
}
close(OPTIONS);
@@ -750,6 +761,7 @@ sub print_undocumented_section {
}
}
# !!! FIXME: generalize this for other libraries to use.
sub strip_fn_declaration_metadata {
my $decl = shift;
$decl =~ s/SDL_(PRINTF|SCANF)_FORMAT_STRING\s*//; # don't want this metadata as part of the documentation.
@@ -1153,7 +1165,7 @@ while (my $d = readdir(DH)) {
} elsif ($ignoring_lines) {
push @contents, $_;
next;
} elsif (/\A\s*\#\s*ifndef\s+SDL_WIKI_DOCUMENTATION_SECTION\s*\Z/) {
} elsif (/\A\s*\#\s*ifndef\s+$wikidocsectionsym\s*\Z/) {
$ignoring_lines = 1;
push @contents, $_;
next;
@@ -1162,13 +1174,13 @@ while (my $d = readdir(DH)) {
#print("CATEGORY FOR '$dent' CHANGED TO " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n");
push @contents, $_;
next;
} elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC/) { # a function declaration without a doxygen comment?
} elsif (/\A\s*extern\s+(?:$deprecatedsym\s+|)$declspecsym/) { # a function declaration without a doxygen comment?
$symtype = 1; # function declaration
@templines = ();
$decl = $_;
$str = '';
$has_doxygen = 0;
} elsif (/\A\s*SDL_FORCE_INLINE/) { # a (forced-inline) function declaration without a doxygen comment?
} elsif (/\A\s*$forceinlinesym/) { # a (forced-inline) function declaration without a doxygen comment?
$symtype = 1; # function declaration
@templines = ();
$decl = $_;
@@ -1235,9 +1247,9 @@ while (my $d = readdir(DH)) {
$lineno++ if defined $decl;
$decl = '' if not defined $decl;
chomp($decl);
if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC/) {
if ($decl =~ /\A\s*extern\s+(?:$deprecatedsym\s+|)$declspecsym/) {
$symtype = 1; # function declaration
} elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
} elsif ($decl =~ /\A\s*$forceinlinesym/) {
$symtype = 1; # (forced-inline) function declaration
} elsif ($decl =~ /\A\s*\#\s*define\s+/) {
$symtype = 2; # macro
@@ -1274,7 +1286,7 @@ while (my $d = readdir(DH)) {
}
$headercategorydocs{$current_wiki_category} = $sym;
} elsif ($symtype == 1) { # a function
my $is_forced_inline = ($decl =~ /\A\s*SDL_FORCE_INLINE/);
my $is_forced_inline = ($decl =~ /\A\s*$forceinlinesym/);
if ($is_forced_inline) {
if (not $decl =~ /\)\s*(\{.*|)\s*\Z/) {
@@ -1311,14 +1323,14 @@ while (my $d = readdir(DH)) {
my $paramsstr = undef;
if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC\w*\s+(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
$sym = $8;
$rettype = "$3$4$5$6";
$paramsstr = $9;
} elsif ($is_forced_inline && $decl =~ /\A\s*SDL_FORCE_INLINE\s+(SDL_DEPRECATED\s+|)(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(.*?)\s*\((.*?)\);/) {
if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(?:$deprecatedsym\s+|)$declspecsym\w*\s+(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(\*?)\s*$callconvsym\s+(.*?)\s*\((.*?)\);/) {
$sym = $6;
$rettype = "$2$3$4$5";
$rettype = "$1$2$3$4$5";
$paramsstr = $7;
} elsif ($is_forced_inline && $decl =~ /\A\s*$forceinlinesym\s+(?:$deprecatedsym\s+|)(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(.*?)\s*\((.*?)\);/) {
$sym = $5;
$rettype = "$1$2$3$4";
$paramsstr = $6;
} else {
#print "Found doxygen but no function sig:\n$str\n\n";
foreach (@templines) {
@@ -1384,7 +1396,7 @@ while (my $d = readdir(DH)) {
$decl = $_;
$temp = $decl;
$temp =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC\w*\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
$temp =~ s/\Aextern\s+(?:$deprecatedsym\s+|)$declspecsym\w*\s+(.*?)\s+(\*?)$callconvsym\s+/$1$2 /;
$shrink_length = length($decl) - length($temp);
$decl = $temp;
} else {
@@ -1449,7 +1461,7 @@ while (my $d = readdir(DH)) {
}
$decl .= $additional_decl;
} elsif ($symtype == 2) { # a macro
if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)\s+/) {
if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)(\s+|\Z)/) {
$sym = $1;
} else {
#print "Found doxygen but no macro:\n$str\n\n";
@@ -2149,7 +2161,7 @@ if ($copy_direction == 1) { # --copy-to-headers
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
while (readdir(DH)) {
my $dent = $_;
if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-".
if ($dent =~ /\A(README|INTRO)\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-" or "INTRO-".
filecopy("$wikipath/$dent", "$readmepath/$dent", "\n");
}
}
@@ -2259,10 +2271,10 @@ if ($copy_direction == 1) { # --copy-to-headers
$desc =~ s/[\s\n]+\Z//ms;
if (0) { # !!! FIXME: disabled because it's not currently suitable for general use, but for manually inspecting the output, it can be useful.
if (($desc =~ /\A[A-Z]/) && (not $desc =~ /\ASDL_/)) {
print STDERR "WARNING: $sym\'s '\\param $arg' text starts with a capital letter: '$desc'. Fixing.\n";
$desc = lcfirst($desc);
if (0) {
if (($desc =~ /\A[a-z]/) && (not $desc =~ /$apiprefixregex/)) {
print STDERR "WARNING: $sym\'s '\\param $arg' text starts with a lowercase letter: '$desc'. Fixing.\n";
$desc = ucfirst($desc);
}
}
@@ -2306,8 +2318,8 @@ if ($copy_direction == 1) { # --copy-to-headers
}
$desc =~ s/[\s\n]+\Z//ms;
if (0) { # !!! FIXME: disabled because it's not currently suitable for general use, but for manually inspecting the output, it can be useful.
if (($desc =~ /\A[A-Z]/) && (not $desc =~ /\ASDL_/)) {
if (0) {
if (($desc =~ /\A[A-Z]/) && (not $desc =~ /$apiprefixregex/)) {
print STDERR "WARNING: $sym\'s '\\returns' text starts with a capital letter: '$desc'. Fixing.\n";
$desc = lcfirst($desc);
}
@@ -2451,7 +2463,7 @@ if ($copy_direction == 1) { # --copy-to-headers
} else {
die("Unexpected symbol type $symtype!");
}
my $str = "This $symtypename is available since SDL 3.0.0.";
my $str = "This $symtypename is available since $projectshortname 3.0.0.";
$sections{'Version'} = wordwrap(wikify($wikitype, $str)) . "\n";
}
}
@@ -2762,7 +2774,7 @@ __EOF__
opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n");
while (my $d = readdir(DH)) {
my $dent = $d;
if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-".
if ($dent =~ /\A(README|INTRO)\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-" or "INTRO".
filecopy("$readmepath/$dent", "$wikipath/$dent", "\n");
}
}
@@ -2772,7 +2784,7 @@ __EOF__
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
while (my $d = readdir(DH)) {
my $dent = $d;
if ($dent =~ /\A(README\-.*?)\.md\Z/) {
if ($dent =~ /\A((README|INTRO)\-.*?)\.md\Z/) {
push @pages, $1;
}
}
@@ -2916,7 +2928,7 @@ __EOF__
$str .= ".\\\" Please report issues in this manpage's content at:\n";
$str .= ".\\\" $bugreporturl\n";
$str .= ".\\\" Please report issues in the generation of this manpage from the wiki at:\n";
$str .= ".\\\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$sym\n";
$str .= ".\\\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$sym\n"; # !!! FIXME: if this becomes a problem for other projects, we'll generalize this.
$str .= ".\\\" $projectshortname can be found at $projecturl\n";
# Define a .URL macro. The "www.tmac" thing decides if we're using GNU roff (which has a .URL macro already), and if so, overrides the macro we just created.

View File

@@ -1,73 +1,73 @@
include(FindPackageHandleStandardArgs)
set(LibUSB_PKG_CONFIG_SPEC libusb-1.0>=1.0.16)
set(LibUSB_MIN_API_VERSION 0x01000102)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_LibUSB ${LibUSB_PKG_CONFIG_SPEC})
endif()
find_library(LibUSB_LIBRARY
NAMES usb-1.0 libusb-1.0
HINTS ${PC_LibUSB_LIBRARY_DIRS}
)
find_path(LibUSB_INCLUDE_PATH
NAMES libusb.h
PATH_SUFFIXES libusb-1.0
HINTS ${PC_LibUSB_INCLUDE_DIRS}
)
set(LibUSB_API_VERSION "LibUSB_API_VERSION-NOTFOUND")
if(LibUSB_INCLUDE_PATH AND EXISTS "${LibUSB_INCLUDE_PATH}/libusb.h")
file(READ "${LibUSB_INCLUDE_PATH}/libusb.h" LIBUSB_H_TEXT)
if("${LIBUSB_H_TEXT}" MATCHES "#define[ \t]+LIBUSBX?_API_VERSION[ \t]+(0x[0-9a-fA-F]+)" )
set(LibUSB_API_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
if(LibUSB_API_VERSION)
math(EXPR LibUSB_MIN_API_VERSION_decimal "${LibUSB_MIN_API_VERSION}")
math(EXPR LibUSB_API_VERSION_decimal "${LibUSB_API_VERSION}")
if(NOT LibUSB_MIN_API_VERSION_decimal LESS_EQUAL LibUSB_API_VERSION_decimal)
set(LibUSB_LIBRARY "LibUSB_LIBRARY-NOTFOUND")
endif()
else()
set(LibUSB_LIBRARY "LibUSB_LIBRARY-NOTFOUND")
endif()
set(LibUSB_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of LibUSB")
set(LibUSB_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of LibUSB")
set(LibUSB_LINK_FLAGS "" CACHE STRING "Extra link flags of LibUSB")
if(LibUSB_LIBRARY AND LibUSB_INCLUDE_PATH)
if(PC_LibUSB_FOUND)
set(LibUSB_VERSION "${PC_LibUSB_VERSION}")
else()
set(LibUSB_VERSION "1.0.16-or-higher")
endif()
else()
set(LibUSB_VERSION "LibUSB_VERSION-NOTFOUND")
endif()
find_package_handle_standard_args(LibUSB
VERSION_VAR LibUSB_VERSION
REQUIRED_VARS LibUSB_LIBRARY LibUSB_INCLUDE_PATH
)
if(LibUSB_FOUND AND NOT TARGET LibUSB::LibUSB)
add_library(LibUSB::LibUSB IMPORTED UNKNOWN)
set_target_properties(LibUSB::LibUSB
PROPERTIES
IMPORTED_LOCATION "${LibUSB_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LibUSB_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${LibUSB_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${LibUSB_LINK_LIBRARIES}"
INTERFACE_LINK_OPTIONS "${LibUSB_LINK_OPTIONS}"
)
endif()
include(FindPackageHandleStandardArgs)
set(LibUSB_PKG_CONFIG_SPEC libusb-1.0>=1.0.16)
set(LibUSB_MIN_API_VERSION 0x01000102)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_LibUSB ${LibUSB_PKG_CONFIG_SPEC})
endif()
find_library(LibUSB_LIBRARY
NAMES usb-1.0 libusb-1.0 usb
HINTS ${PC_LibUSB_LIBRARY_DIRS}
)
find_path(LibUSB_INCLUDE_PATH
NAMES libusb.h
PATH_SUFFIXES libusb-1.0
HINTS ${PC_LibUSB_INCLUDE_DIRS}
)
set(LibUSB_API_VERSION "LibUSB_API_VERSION-NOTFOUND")
if(LibUSB_INCLUDE_PATH AND EXISTS "${LibUSB_INCLUDE_PATH}/libusb.h")
file(READ "${LibUSB_INCLUDE_PATH}/libusb.h" LIBUSB_H_TEXT)
if("${LIBUSB_H_TEXT}" MATCHES "#define[ \t]+LIBUSBX?_API_VERSION[ \t]+(0x[0-9a-fA-F]+)" )
set(LibUSB_API_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
if(LibUSB_API_VERSION)
math(EXPR LibUSB_MIN_API_VERSION_decimal "${LibUSB_MIN_API_VERSION}")
math(EXPR LibUSB_API_VERSION_decimal "${LibUSB_API_VERSION}")
if(NOT LibUSB_MIN_API_VERSION_decimal LESS_EQUAL LibUSB_API_VERSION_decimal)
set(LibUSB_LIBRARY "LibUSB_LIBRARY-NOTFOUND")
endif()
else()
set(LibUSB_LIBRARY "LibUSB_LIBRARY-NOTFOUND")
endif()
set(LibUSB_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of LibUSB")
set(LibUSB_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of LibUSB")
set(LibUSB_LINK_FLAGS "" CACHE STRING "Extra link flags of LibUSB")
if(LibUSB_LIBRARY AND LibUSB_INCLUDE_PATH)
if(PC_LibUSB_FOUND)
set(LibUSB_VERSION "${PC_LibUSB_VERSION}")
else()
set(LibUSB_VERSION "1.0.16-or-higher")
endif()
else()
set(LibUSB_VERSION "LibUSB_VERSION-NOTFOUND")
endif()
find_package_handle_standard_args(LibUSB
VERSION_VAR LibUSB_VERSION
REQUIRED_VARS LibUSB_LIBRARY LibUSB_INCLUDE_PATH
)
if(LibUSB_FOUND AND NOT TARGET LibUSB::LibUSB)
add_library(LibUSB::LibUSB IMPORTED UNKNOWN)
set_target_properties(LibUSB::LibUSB
PROPERTIES
IMPORTED_LOCATION "${LibUSB_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LibUSB_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${LibUSB_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${LibUSB_LINK_LIBRARIES}"
INTERFACE_LINK_OPTIONS "${LibUSB_LINK_OPTIONS}"
)
endif()

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

@@ -153,7 +153,7 @@ if(EMSCRIPTEN)
set(HAVE_O_CLOEXEC "1" CACHE INTERNAL "Test HAVE_O_CLOEXEC")
set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR "1" CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR")
set(COMPILER_SUPPORTS_GCC_ATOMICS "1" CACHE INTERNAL "Test COMPILER_SUPPORTS_GCC_ATOMICS")
set(LINKER_SUPPORTS_VERSION_SCRIPT "" CACHE INTERNAL "Test LINKER_SUPPORTS_VERSION_SCRIPT")
set(HAVE_WL_VERSION_SCRIPT "" CACHE INTERNAL "Test HAVE_WL_VERSION_SCRIPT")
set(LINKER_SUPPORTS_WL_NO_UNDEFINED "" CACHE INTERNAL "Test LINKER_SUPPORTS_WL_NO_UNDEFINED")
set(ICONV_IN_LIBC "1" CACHE INTERNAL "Test ICONV_IN_LIBC")
set(ICONV_IN_LIBICONV "" CACHE INTERNAL "Test ICONV_IN_LIBICONV")
@@ -175,5 +175,11 @@ if(EMSCRIPTEN)
set(HAVE_MEMFD_CREATE "" CACHE INTERNAL "Have symbol memfd_create")
set(HAVE_POSIX_FALLOCATE "1" CACHE INTERNAL "Have symbol posix_fallocate")
set(HAVE_DLOPEN_IN_LIBC "1" CACHE INTERNAL "Have symbol dlopen")
set(HAVE_FDATASYNC "1" CACHE INTERNAL "Have symbol fdatasync")
set(HAVE_GETHOSTNAME "1" CACHE INTERNAL "Have symbol gethostname")
set(HAVE_SIGTIMEDWAIT "1" CACHE INTERNAL "Have symbol sigtimedwait")
set(HAVE_PPOLL "" CACHE INTERNAL "Have symbol ppoll")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR "" CACHE INTERNAL "Have symbol posix_spawn_file_actions_addchdir")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP "1" CACHE INTERNAL "Have symbol posix_spawn_file_actions_addchdir_np")
endfunction()
endif()

View File

@@ -155,7 +155,7 @@ if(NGAGESDK)
#set(HAVE_O_CLOEXEC "" CACHE INTERNAL "Test HAVE_O_CLOEXEC")
#set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR "" CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR")
set(COMPILER_SUPPORTS_GCC_ATOMICS "" CACHE INTERNAL "Test COMPILER_SUPPORTS_GCC_ATOMICS")
set(LINKER_SUPPORTS_VERSION_SCRIPT "" CACHE INTERNAL "Test LINKER_SUPPORTS_VERSION_SCRIPT")
set(HAVE_WL_VERSION_SCRIPT "" CACHE INTERNAL "Test HAVE_WL_VERSION_SCRIPT")
set(LINKER_SUPPORTS_WL_NO_UNDEFINED "" CACHE INTERNAL "Test LINKER_SUPPORTS_WL_NO_UNDEFINED")
set(ICONV_IN_LIBC "" CACHE INTERNAL "Test ICONV_IN_LIBC")
set(ICONV_IN_LIBICONV "" CACHE INTERNAL "Test ICONV_IN_LIBICONV")

View File

@@ -296,15 +296,15 @@ endfunction()
function(check_linker_supports_version_file VAR)
SDL_detect_linker()
if(CMAKE_C_COMPILER_LINKER_ID MATCHES "^(MSVC)$")
set(LINKER_SUPPORTS_VERSION_SCRIPT FALSE)
set(${VAR} FALSE)
else()
cmake_push_check_state(RESET)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/dummy.sym" "n_0 {\n global:\n func;\n local: *;\n};\n")
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/dummy.sym")
check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" LINKER_SUPPORTS_VERSION_SCRIPT FAIL_REGEX "(unsupported|syntax error|unrecognized option)")
check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" ${VAR} FAIL_REGEX "(unsupported|syntax error|unrecognized option)")
cmake_pop_check_state()
endif()
set(${VAR} "${LINKER_SUPPORTS_VERSION_SCRIPT}" PARENT_SCOPE)
set(${VAR} "${${VAR}}" PARENT_SCOPE)
endfunction()
if(CMAKE_VERSION VERSION_LESS 3.18)
@@ -399,6 +399,7 @@ function(SDL_PrintSummary)
PrintEnabledBackends("GPU drivers" "^SDL_GPU_([A-Z0-9]*)$")
PrintEnabledBackends("Audio drivers" "^SDL_AUDIO_DRIVER_([A-Z0-9]*)$")
PrintEnabledBackends("Joystick drivers" "^SDL_JOYSTICK_([A-Z0-9]*)$")
PrintEnabledBackends("Camera drivers" "^SDL_CAMERA_DRIVER_([A-Z0-9]*)$")
message(STATUS "")
if(UNIX)
@@ -417,7 +418,7 @@ function(SDL_PrintSummary)
"Most likely, this is not wanted."
"\n"
"On Linux, install the packages listed at "
"https://github.com/libsdl-org/SDL/blob/main/docs/README-linux.md#build-dependencies "
"https://wiki.libsdl.org/SDL3/README-linux#build-dependencies "
"\n"
"If you really don't need desktop windows, the documentation tells you how to skip this check. "
"https://github.com/libsdl-org/SDL/blob/main/docs/README-cmake.md#cmake-fails-to-build-without-x11-or-wayland-support\n"
@@ -427,6 +428,22 @@ function(SDL_PrintSummary)
endif()
endfunction()
function(SDL_missing_dependency NAME OPTION)
if(LINUX)
message( FATAL_ERROR
"Couldn't find dependency package for ${NAME}. Please install the needed packages or configure with -D${OPTION}=OFF"
"\n"
"The full set of dependencies is available at "
"https://wiki.libsdl.org/SDL3/README-linux#build-dependencies "
"\n"
)
else()
message( FATAL_ERROR
"Couldn't find dependency package for ${NAME}. Please install the needed packages or configure with -D${OPTION}=OFF"
)
endif()
endfunction()
function(SDL_install_pdb TARGET DIRECTORY)
get_property(type TARGET ${TARGET} PROPERTY TYPE)
if(type MATCHES "^(SHARED_LIBRARY|EXECUTABLE)$")

View File

@@ -392,72 +392,83 @@ macro(CheckX11)
check_include_file("X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBLIB)
if(SDL_X11_XCURSOR AND HAVE_XCURSOR_H AND XCURSOR_LIB)
set(HAVE_X11_XCURSOR TRUE)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"")
if(SDL_X11_XCURSOR)
if (HAVE_XCURSOR_H AND XCURSOR_LIB)
set(HAVE_X11_XCURSOR TRUE)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"")
else()
sdl_link_dependency(xcursor LIBS X11::Xcursor CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xcursor_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
else()
sdl_link_dependency(xcursor LIBS X11::Xcursor CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xcursor_PKG_CONFIG_SPEC})
SDL_missing_dependency(XCURSOR SDL_X11_XCURSOR)
endif()
set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
endif()
if(SDL_X11_XDBE AND HAVE_XDBE_H)
set(HAVE_X11_XDBE TRUE)
set(SDL_VIDEO_DRIVER_X11_XDBE 1)
if(SDL_X11_XDBE)
if(HAVE_XDBE_H)
set(HAVE_X11_XDBE TRUE)
set(SDL_VIDEO_DRIVER_X11_XDBE 1)
else()
SDL_missing_dependency(XDBE SDL_X11_XDBE)
endif()
endif()
if(SDL_X11_XINPUT AND HAVE_XINPUT2_H AND XI_LIB)
set(HAVE_X11_XINPUT TRUE)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"")
if(SDL_X11_XINPUT)
if(HAVE_XINPUT2_H AND XI_LIB)
set(HAVE_X11_XINPUT TRUE)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"")
else()
sdl_link_dependency(xi LIBS X11::Xi CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xi_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
# Check for scroll info
check_c_source_compiles("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
XIScrollClassInfo *s;
int main(int argc, char **argv) {}" HAVE_XINPUT2_SCROLLINFO)
if(HAVE_XINPUT2_SCROLLINFO)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO 1)
endif()
# Check for multitouch
check_c_source_compiles_static("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
int event_type = XI_TouchBegin;
XITouchClassInfo *t;
Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) {
return (Status)0;
}
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT2_MULTITOUCH)
if(HAVE_XINPUT2_MULTITOUCH)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1)
endif()
# Check for gesture
check_c_source_compiles("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
int event_type = XI_GesturePinchBegin;
XIGesturePinchEvent *t;
Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) {
return (Status)0;
}
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT2_GESTURE)
if(HAVE_XINPUT2_GESTURE)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE 1)
endif()
else()
sdl_link_dependency(xi LIBS X11::Xi CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xi_PKG_CONFIG_SPEC})
SDL_missing_dependency(XINPUT SDL_X11_XINPUT)
endif()
set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
# Check for scroll info
check_c_source_compiles("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
XIScrollClassInfo *s;
int main(int argc, char **argv) {}" HAVE_XINPUT2_SCROLLINFO)
if(HAVE_XINPUT2_SCROLLINFO)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO 1)
endif()
# Check for multitouch
check_c_source_compiles_static("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
int event_type = XI_TouchBegin;
XITouchClassInfo *t;
Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) {
return (Status)0;
}
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT2_MULTITOUCH)
if(HAVE_XINPUT2_MULTITOUCH)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1)
endif()
# Check for gesture
check_c_source_compiles("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
int event_type = XI_GesturePinchBegin;
XITouchClassInfo *t;
Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) {
return (Status)0;
}
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT2_GESTURE)
if(HAVE_XINPUT2_GESTURE)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE 1)
endif()
endif()
# check along with XInput2.h because we use Xfixes with XIBarrierReleasePointer
@@ -470,54 +481,78 @@ macro(CheckX11)
BarrierEventID b;
int main(int argc, char **argv) { return 0; }" HAVE_XFIXES_H)
endif()
if(SDL_X11_XFIXES AND HAVE_XFIXES_H AND HAVE_XINPUT2_H AND XFIXES_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES "\"${XFIXES_LIB_SONAME}\"")
if(SDL_X11_XFIXES)
if (HAVE_XFIXES_H AND HAVE_XINPUT2_H AND XFIXES_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES "\"${XFIXES_LIB_SONAME}\"")
else()
sdl_link_dependency(xfixes LIBS X11::Xfixes CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xfixes_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XFIXES 1)
set(HAVE_X11_XFIXES TRUE)
else()
sdl_link_dependency(xfixes LIBS X11::Xfixes CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xfixes_PKG_CONFIG_SPEC})
SDL_missing_dependency(XFIXES SDL_X11_XFIXES)
endif()
set(SDL_VIDEO_DRIVER_X11_XFIXES 1)
set(HAVE_X11_XFIXES TRUE)
endif()
if(SDL_X11_XSYNC AND HAVE_XSYNC_H AND XEXT_LIB)
set(SDL_VIDEO_DRIVER_X11_XSYNC 1)
set(HAVE_X11_XSYNC TRUE)
endif()
if(SDL_X11_XRANDR AND HAVE_XRANDR_H AND XRANDR_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
if(SDL_X11_XSYNC)
if(HAVE_XSYNC_H AND XEXT_LIB)
set(SDL_VIDEO_DRIVER_X11_XSYNC 1)
set(HAVE_X11_XSYNC TRUE)
else()
sdl_link_dependency(xrandr LIBS X11::Xrandr CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xrandr_PKG_CONFIG_SPEC})
SDL_missing_dependency(XSYNC SDL_X11_XSYNC)
endif()
set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
set(HAVE_X11_XRANDR TRUE)
endif()
if(SDL_X11_XSCRNSAVER AND HAVE_XSS_H AND XSS_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"")
if(SDL_X11_XRANDR)
if(HAVE_XRANDR_H AND XRANDR_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
else()
sdl_link_dependency(xrandr LIBS X11::Xrandr CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xrandr_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
set(HAVE_X11_XRANDR TRUE)
else()
sdl_link_dependency(xss LIBS X11::Xss CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xss_PKG_CONFIG_SPEC})
SDL_missing_dependency(XRANDR SDL_X11_XRANDR)
endif()
set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
set(HAVE_X11_XSCRNSAVER TRUE)
endif()
if(SDL_X11_XSHAPE AND HAVE_XSHAPE_H)
set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
set(HAVE_X11_XSHAPE TRUE)
endif()
if(SDL_X11_XTEST AND HAVE_XTEST_H AND XTST_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST "\"${XTST_LIB_SONAME}\"")
if(SDL_X11_XSCRNSAVER)
if(HAVE_XSS_H AND XSS_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"")
else()
sdl_link_dependency(xss LIBS X11::Xss CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xss_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
set(HAVE_X11_XSCRNSAVER TRUE)
else()
sdl_link_dependency(xtst LIBS X11::Xtst CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xtst_PKG_CONFIG_SPEC})
SDL_missing_dependency(XSCRNSAVER SDL_X11_XSCRNSAVER)
endif()
endif()
if(SDL_X11_XSHAPE)
if(HAVE_XSHAPE_H)
set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
set(HAVE_X11_XSHAPE TRUE)
else()
SDL_missing_dependency(XSHAPE SDL_X11_XSHAPE)
endif()
endif()
if(SDL_X11_XTEST)
if(HAVE_XTEST_H AND XTST_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST "\"${XTST_LIB_SONAME}\"")
else()
sdl_link_dependency(xtst LIBS X11::Xtst CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xtst_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XTEST 1)
set(HAVE_X11_XTEST TRUE)
else()
SDL_missing_dependency(XTEST SDL_X11_XTEST)
endif()
set(SDL_VIDEO_DRIVER_X11_XTEST 1)
set(HAVE_X11_XTEST TRUE)
endif()
endif()
endif()
@@ -553,6 +588,31 @@ macro(CheckFribidi)
endif()
endmacro()
macro(CheckLibThai)
if(SDL_LIBTHAI)
set(LIBTHAI_PKG_CONFIG_SPEC libthai)
set(PC_LIBTHAI_FOUND FALSE)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBTHAI IMPORTED_TARGET ${LIBTHAI_PKG_CONFIG_SPEC})
endif()
if(PC_LIBTHAI_FOUND)
set(HAVE_LIBTHAI TRUE)
set(HAVE_LIBTHAI_H 1)
if(SDL_LIBTHAI_SHARED AND NOT HAVE_SDL_LOADSO)
message(WARNING "You must have SDL_LoadObject() support for dynamic libthai loading")
endif()
FindLibraryAndSONAME("thai" LIBDIRS ${PC_LIBTHAI_LIBRARY_DIRS})
if(SDL_LIBTHAI_SHARED AND THAI_LIB AND HAVE_SDL_LOADSO)
set(SDL_LIBTHAI_DYNAMIC "\"${THAI_LIB_SONAME}\"")
set(HAVE_LIBTHAI_SHARED TRUE)
sdl_include_directories(PRIVATE SYSTEM $<TARGET_PROPERTY:PkgConfig::PC_LIBTHAI,INTERFACE_INCLUDE_DIRECTORIES>)
else()
sdl_link_dependency(libthai LIBS PkgConfig::PC_LIBTHAI PKG_CONFIG_PREFIX PC_LIBTHAI PKG_CONFIG_SPECS ${LIBTHAI_PKG_CONFIG_SPEC})
endif()
endif()
endif()
endmacro()
macro(WaylandProtocolGen _SCANNER _CODE_MODE _XML _PROTL)
set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c")
set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h")
@@ -765,13 +825,29 @@ macro(CheckOpenVR)
endif()
endmacro()
# Requires
# - N/A
macro(FindOpenGLHeaders)
find_package(OpenGL MODULE)
# OPENGL_INCLUDE_DIRS is preferred over OPENGL_INCLUDE_DIR, but was only added in 3.29,
# If the CMake minimum version is changed to be >= 3.29, the second check should be removed.
if(OPENGL_INCLUDE_DIRS)
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIRS})
elseif(OPENGL_INCLUDE_DIR)
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR})
endif()
endmacro()
# Requires:
# - nada
macro(CheckGLX)
if(SDL_OPENGL)
cmake_push_check_state()
FindOpenGLHeaders()
check_c_source_compiles("
#include <GL/glx.h>
int main(int argc, char** argv) { return 0; }" HAVE_OPENGL_GLX)
cmake_pop_check_state()
if(HAVE_OPENGL_GLX AND NOT HAVE_ROCKCHIP)
set(SDL_VIDEO_OPENGL_GLX 1)
endif()
@@ -805,10 +881,13 @@ endmacro()
# - nada
macro(CheckOpenGL)
if(SDL_OPENGL)
cmake_push_check_state()
FindOpenGLHeaders()
check_c_source_compiles("
#include <GL/gl.h>
#include <GL/glext.h>
int main(int argc, char** argv) { return 0; }" HAVE_OPENGL)
cmake_pop_check_state()
if(HAVE_OPENGL)
set(SDL_VIDEO_OPENGL 1)
set(SDL_VIDEO_RENDER_OGL 1)
@@ -821,6 +900,7 @@ endmacro()
macro(CheckOpenGLES)
if(SDL_OPENGLES)
cmake_push_check_state()
FindOpenGLHeaders()
list(APPEND CMAKE_REQUIRED_INCLUDES "${SDL3_SOURCE_DIR}/src/video/khronos")
check_c_source_compiles("
#include <GLES/gl.h>
@@ -1033,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()
@@ -1061,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
@@ -1087,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
@@ -1115,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
@@ -1190,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

@@ -3,6 +3,7 @@ macro(SDL_DetectCompiler)
set(USE_GCC FALSE)
set(USE_INTELCC FALSE)
set(USE_QCC FALSE)
set(USE_TCC FALSE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang|IntelLLVM")
set(USE_CLANG TRUE)
# Visual Studio 2019 v16.2 added support for Clang/LLVM.
@@ -16,6 +17,8 @@ macro(SDL_DetectCompiler)
set(USE_INTELCC TRUE)
elseif(CMAKE_C_COMPILER_ID MATCHES "QCC")
set(USE_QCC TRUE)
elseif(CMAKE_C_COMPILER_ID MATCHES "TinyCC")
set(USE_TCC TRUE)
endif()
endmacro()
@@ -39,7 +42,7 @@ function(SDL_AddCommonCompilerFlags TARGET)
cmake_pop_check_state()
endif()
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC OR USE_TCC)
if(MINGW)
# See if GCC's -gdwarf-4 is supported
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101377 for why this is needed on Windows
@@ -159,6 +162,10 @@ function(SDL_AddCommonCompilerFlags TARGET)
sdl_target_compile_option_all_languages(${TARGET} "-fdiagnostics-color=always")
endif()
endif()
if(USE_TCC)
sdl_target_compile_option_all_languages(${TARGET} "-DSTBI_NO_SIMD")
endif()
endfunction()
function(check_x86_source_compiles BODY VAR)

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

@@ -22,7 +22,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>")
# This assumes the SDL source is available in vendored/SDL
add_subdirectory(vendored/SDL EXCLUDE_FROM_ALL)
# on Web targets, we need CMake to generate a HTML webpage.
# on Web targets, we need CMake to generate a HTML webpage.
if(EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html" CACHE INTERNAL "")
endif()

View File

@@ -1,6 +1,6 @@
# Introduction to SDL with MinGW
Without getting deep into the history, MinGW is a long running project that aims to bring gcc to Windows. That said, there's many distributions, versions, and forks floating around. We recommend installing [MSYS2](https://www.msys2.org/), as it's the easiest way to get a modern toolchain with a package manager to help with dependency management. This would allow you to follow the MSYS2 section below.
Without getting deep into the history, MinGW is a long running project that aims to bring gcc to Windows. That said, there's many distributions, versions, and forks floating around. We recommend installing [MSYS2](https://www.msys2.org/), as it's the easiest way to get a modern toolchain with a package manager to help with dependency management. This would allow you to follow the MSYS2 section below.
Otherwise you'll want to follow the "Other Distributions" section below.
@@ -89,7 +89,7 @@ This should print out which library directory we'll need to use when compiling,
Now we should have everything needed to compile and run our program. You'll need to ensure to replace `<version>` with the version of the release of SDL3 you downloaded, as well as use the `<arch>` we learned in the previous section.
```sh
gcc hello.c -o hello.exe -I SDL3-<version>/<arch>/include -L SDL3-<version>/<arch>/lib -lSDL3 -mwindows
gcc hello.c -o hello.exe -I SDL3-<version>/<arch>/include -L SDL3-<version>/<arch>/lib -lSDL3 -mwindows
cp SDL3-<version>/<arch>/bin/SDL3.dll SDL3.dll
./hello.exe
```

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

@@ -169,31 +169,33 @@ for several reasons, not the least of which being that no one likes when a
random browser tab suddenly starts making noise and the user has to scramble
to figure out which and silence it.
SDL will allow you to open the audio device for playback in this
circumstance, and your audio callback will fire, but SDL will throw the audio
data away until the user interacts with the page. This helps apps that depend
on the audio callback to make progress, and also keeps audio playback in sync
SDL will allow you to open the audio device for playback in this circumstance,
and your audio streams will consume data, but SDL will throw the audio data
away until the user interacts with the page. This helps apps that depend on
the audio callback to make progress, and also keeps audio playback in sync
once the app is finally allowed to make noise.
There are two reasonable ways to deal with the silence at the app level:
if you are writing some sort of media player thing, where the user expects
there to be a volume control when you mouseover the canvas, just default
that control to a muted state; if the user clicks on the control to unmute
it, on this first click, open the audio device. This allows the media to
it, on this first click, adjust your app's volume appropriately, and SDL will
also start actually feeding the data to the browser. This allows the media to
play at start, and the user can reasonably opt-in to listening.
Many games do not have this sort of UI, and are more rigid about starting
audio along with everything else at the start of the process. For these, your
best bet is to write a little Javascript that puts up a "Click here to play!"
UI, and upon the user clicking, remove that UI and then call the Emscripten
app's main() function. As far as the application knows, the audio device was
available to be opened as soon as the program started, and since this magic
happens in a little Javascript, you don't have to change your C/C++ code at
all to make it happen.
Many games do not have this sort of UI. For these, your best bet might be to
write a little Javascript that puts up a "Click here to play!" UI, and upon
the user clicking, remove that UI and then call the Emscripten app's main()
function. As far as the application knows, audio was able to play as soon as
the program started, and since this magic happens in a little Javascript, you
don't have to change your C/C++ code at all to make it happen.
Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385
for some Javascript code to steal for this approach.
But if a game can just do without audio until the user clicks on the page,
it will still operate correctly, as if the page was merely muted before then.
## Rendering
@@ -208,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
@@ -226,9 +231,14 @@ most efficient, consistent, and correct way to run a game in a web browser.
## Building SDL/emscripten
Use the latest stable Emscripten release!
SDL currently requires at least Emscripten 3.16.0 to build. Newer versions
are likely to work, as well.
It's possible to build SDL with older Emscripten releases, such as 3.x, but
several things will be silently broken, as bugs got fixed and web standards
solidified over time. At the time of this writing, Emscripten 4.0.x is the
current stable release. You're encouraged to install the latest stable release
(`emsdk install latest ; emsdk activate latest` if using Emscripten's setup
script), and make sure you're reasonably up to date as time goes on.
Build:
@@ -337,6 +347,22 @@ all has to live in memory at runtime.
gives other options and details, and is worth a read.
## Customizing index.html
You don't have to use the HTML that Emscripten produces; the above examples
use `emcc -o index.html`, but you can `-o index.js` instead to just output
code without an HTML page, and then provide your own. This is desirable for
shipping products, even though the Emscripten-provided HTML is fine for
prototyping. Certain things _must_ be in the HTML file or your program will
not function correctly (or function at all). The specifics are beyond the
scope of this document, but it's likely best to start with the Emscripten HTML
and customize it, instead of starting from scratch.
The `<canvas>` element in the HTML _must not_ have a border or padding, or
things will break in unexpected ways. This can be surprising when customizing
the page's look. Plan accordingly.
## Debugging
Debugging web apps is a mixed bag. You should compile and link with
@@ -351,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

@@ -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
--------------------------------------------------------------------------------
@@ -19,7 +20,7 @@ Ubuntu 18.04, all available features enabled:
libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev` to that command line.
@@ -28,14 +29,16 @@ Fedora 35, all available features enabled:
sudo dnf install gcc git-core make cmake \
alsa-lib-devel fribidi-devel pulseaudio-libs-devel pipewire-devel \
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
libXi-devel libXScrnSaver-devel dbus-devel ibus-devel \
libXi-devel libXScrnSaver-devel libXtst-devel dbus-devel ibus-devel \
systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \
mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \
libdrm-devel mesa-libgbm-devel libusb1-devel libdecor-devel \
pipewire-jack-audio-connection-kit-devel
pipewire-jack-audio-connection-kit-devel libthai-devel
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).
@@ -44,11 +47,11 @@ openSUSE Tumbleweed:
sudo zypper in libunwind-devel libusb-1_0-devel Mesa-libGL-devel libxkbcommon-devel libdrm-devel \
libgbm-devel pipewire-devel libpulse-devel sndio-devel Mesa-libEGL-devel alsa-devel xwayland-devel \
wayland-devel wayland-protocols-devel
wayland-devel wayland-protocols-devel libthai-devel fribidi-devel
Arch:
sudo pacman -S alsa-lib cmake hidapi ibus jack libdecor libgl libpulse libusb libx11 libxcursor libxext libxinerama libxkbcommon libxrandr libxrender libxss libxtst mesa ninja pipewire sndio vulkan-driver vulkan-headers wayland wayland-protocols
sudo pacman -S alsa-lib cmake hidapi ibus jack libdecor libthai fribidi libgl libpulse libusb libx11 libxcursor libxext libxfixes libxi libxinerama libxkbcommon libxrandr libxrender libxss libxtst mesa ninja pipewire sndio vulkan-driver vulkan-headers wayland wayland-protocols
Joystick does not work

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

@@ -206,6 +206,13 @@ The SDL_AppResult value that terminated the app is provided here, in case
it's useful to know if this was a successful or failing run of the app.
## Using main functions from other languages
If you're not using C/C++, using SDL's entry points is still possible but is
more complex. Please refer to https://wiki.libsdl.org/SDL3/NonstandardStartup
for the technical details.
## Summary and Best Practices
- **Always Include SDL_main.h in One Source File:** When working with SDL,

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

@@ -265,7 +265,7 @@ static void draw(SDL_Renderer *renderer, const float (*edges)[6], const Player p
SDL_RenderLine(renderer, hor_origin-10, ver_origin, hor_origin+10, ver_origin);
}
}
SDL_SetRenderClipRect(renderer, 0);
SDL_SetRenderClipRect(renderer, NULL);
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDL_RenderDebugText(renderer, 0, 0, debug_string);
SDL_RenderPresent(renderer);

View File

@@ -77,8 +77,9 @@ SDL_AppResult SDL_AppIterate(void *appstate)
const float size = 30.0f;
const float x = 320.0f;
const float y = 95.0f - (size / 2.0f);
const float r = (float) i * (SDL_PI_F / 180.0f);
SDL_SetRenderDrawColor(renderer, SDL_rand(256), SDL_rand(256), SDL_rand(256), SDL_ALPHA_OPAQUE);
SDL_RenderLine(renderer, x, y, x + SDL_sinf((float) i) * size, y + SDL_cosf((float) i) * size);
SDL_RenderLine(renderer, x, y, x + SDL_cosf(r) * size, y + SDL_sinf(r) * size);
}
SDL_RenderPresent(renderer); /* put it all on the screen! */

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.2
* Main include header for the SDL library, version 3.4.2
*
* 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(__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,15 +168,17 @@ 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
#ifndef SDL_FILE
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro that reports the current file being compiled.
@@ -184,16 +186,21 @@ extern "C" {
* This macro is only defined if it isn't already defined, so to override it
* (perhaps with something that doesn't provide path information at all, so
* build machine information doesn't leak into public binaries), apps can
* define this macro before including SDL_assert.h. For example, Clang and GCC
* can define this to `FILE_NAME` to get just the source filename instead of
* the full path.
* define this macro before including SDL.h or SDL_assert.h.
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_FILE __FILE_NAME__
#elif !defined(SDL_FILE)
#ifdef __FILE_NAME__
#define SDL_FILE __FILE_NAME__
#else
#define SDL_FILE __FILE__
#endif
#endif
#ifndef SDL_ASSERT_FILE
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro that reports the current file being compiled, for use in
@@ -208,6 +215,9 @@ extern "C" {
* \since This macro is available since SDL 3.4.0.
*/
#define SDL_ASSERT_FILE SDL_FILE
#elif !defined(SDL_ASSERT_FILE)
#define SDL_ASSERT_FILE SDL_FILE
#endif

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.
@@ -1336,7 +1345,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
* \threadsafety It is safe to call this function from any thread, as it holds
* a stream-specific mutex while running. Don't change the
* stream's format to have a different number of channels from a
* a different thread at the same time, though!
* different thread at the same time, though!
*
* \since This function is available since SDL 3.2.0.
*

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

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
@@ -140,11 +140,11 @@ typedef void (SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * cons
* \param window the window that the dialog should be modal for, may be NULL.
* Not all platforms support this option.
* \param filters a list of filters, may be NULL. See the
* [`SDL_DialogFileFilter` documentation for
* examples](SDL_DialogFileFilter#code-examples). Not all
* platforms support this option, and platforms that do support
* it may allow the user to ignore the filters. If non-NULL, it
* must remain valid at least until the callback is invoked.
* [`SDL_DialogFileFilter`](SDL_DialogFileFilter#code-examples)
* documentation for examples]. Not all platforms support this
* option, and platforms that do support it may allow the user
* to ignore the filters. If non-NULL, it must remain valid at
* least until the callback is invoked.
* \param nfilters the number of filters. Ignored if filters is NULL.
* \param default_location the default folder or file to start the dialog at,
* may be NULL. Not all platforms support this option.

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

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
@@ -818,6 +818,9 @@ typedef struct SDL_PinchFingerEvent
* is there." The pen touching and lifting off from the tablet while not
* leaving the area are handled by SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP.
*
* Not all platforms have a window associated with the pen during proximity
* events. Some wait until motion/button/etc events to offer this info.
*
* \since This struct is available since SDL 3.2.0.
*/
typedef struct SDL_PenProximityEvent
@@ -1069,7 +1072,7 @@ typedef union SDL_Event
} SDL_Event;
/* Make sure we haven't broken binary compatibility */
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding));
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof((SDL_static_cast(SDL_Event *, NULL))->padding));
/* Function prototypes */
@@ -1253,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,
* 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
@@ -77,6 +77,9 @@ extern "C" {
* - `parent`: the containing directory of the bundle. For example:
* `/Applications/SDLApp/`
*
* **Android Specific Functionality**: This function returns "./", which
* allows filesystem operations to use internal storage and the asset system.
*
* **Nintendo 3DS Specific Functionality**: This function returns "romfs"
* directory of the application as it is uncommon to store resources outside
* the executable. As such it is not a writable directory.
@@ -239,8 +242,7 @@ 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.
* named pipes, etc. They are currently reported as SDL_PATHTYPE_OTHER.
*
* \since This enum is available since SDL 3.2.0.
*
@@ -454,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.
*
@@ -2294,7 +2295,7 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
* - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN`: The app is able to
* provide Metal shader libraries if applicable.
*
* With the D3D12 renderer:
* With the D3D12 backend:
*
* - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to
* use for all vertex semantics, default is "TEXCOORD".
@@ -2306,6 +2307,44 @@ 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:
*
* - `SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN`:
* By default, Vulkan device enumeration includes drivers of all types,
* including software renderers (for example, the Lavapipe Mesa driver).
* This can be useful if your application _requires_ SDL_GPU, but if you can
* provide your own fallback renderer (for example, an OpenGL renderer) this
* property can be set to true. Defaults to false.
* - `SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER`: a pointer to an
* SDL_GPUVulkanOptions structure to be processed during device creation.
* This allows configuring a variety of Vulkan-specific options such as
* 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()
@@ -2337,6 +2376,39 @@ 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_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"
/**
* A structure specifying additional options when using Vulkan.
*
* 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_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
* scanned for compound feature structs such as
* VkPhysicalDeviceVulkan11Features. The device and instance extension lists,
* as well as vulkan_10_physical_device_features, are always processed.
*
* \since This struct is available since SDL 3.4.0.
*/
typedef struct SDL_GPUVulkanOptions
{
Uint32 vulkan_api_version; /**< The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. */
void *feature_list; /**< Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)*/
void *vulkan_10_physical_device_features; /**< Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. */
Uint32 device_extension_count; /**< Number of additional device extensions to require. */
const char **device_extension_names; /**< Pointer to a list of additional device extensions to require. */
Uint32 instance_extension_count; /**< Number of additional instance extensions to require. */
const char **instance_extension_names; /**< Pointer to a list of additional instance extensions to require. */
} SDL_GPUVulkanOptions;
/**
* Destroys a GPU context previously returned by SDL_CreateGPUDevice.
@@ -2901,6 +2973,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName(
*
* Useful for debugging.
*
* On Direct3D 12, using SDL_InsertGPUDebugLabel requires
* WinPixEventRuntime.dll to be in your PATH or in the same directory as your
* executable. See
* [here](https://devblogs.microsoft.com/pix/winpixeventruntime/)
* for instructions on how to obtain it.
*
* \param command_buffer a command buffer.
* \param text a UTF-8 string constant to insert as the label.
*
@@ -2919,6 +2997,11 @@ extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel(
* Each call to SDL_PushGPUDebugGroup must have a corresponding call to
* SDL_PopGPUDebugGroup.
*
* On Direct3D 12, using SDL_PushGPUDebugGroup requires WinPixEventRuntime.dll
* to be in your PATH or in the same directory as your executable. See
* [here](https://devblogs.microsoft.com/pix/winpixeventruntime/)
* for instructions on how to obtain it.
*
* On some backends (e.g. Metal), pushing a debug group during a
* render/blit/compute pass will create a group that is scoped to the native
* pass rather than the command buffer. For best results, if you push a debug
@@ -2938,6 +3021,11 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup(
/**
* Ends the most-recently pushed debug group.
*
* On Direct3D 12, using SDL_PopGPUDebugGroup requires WinPixEventRuntime.dll
* to be in your PATH or in the same directory as your executable. See
* [here](https://devblogs.microsoft.com/pix/winpixeventruntime/)
* for instructions on how to obtain it.
*
* \param command_buffer a command buffer.
*
* \since This function is available since SDL 3.2.0.
@@ -3079,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
@@ -3104,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
@@ -3126,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
@@ -3612,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.
@@ -3623,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,
@@ -3638,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.
@@ -3647,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,
@@ -3662,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.
@@ -3671,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,
@@ -3843,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

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,28 +787,6 @@ extern "C" {
*/
#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
/**
* Dictate that newly-created windows will fill the whole browser window.
*
* 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. 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 should be set before creating a window.
*
* \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.
@@ -1106,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.
@@ -1785,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"
@@ -1796,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"
@@ -1809,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"
@@ -1823,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"
@@ -1835,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"
@@ -1847,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"
@@ -2620,6 +2643,21 @@ extern "C" {
*/
#define SDL_HINT_MAC_SCROLL_MOMENTUM "SDL_MAC_SCROLL_MOMENTUM"
/**
* A variable controlling whether holding down a key will repeat the pressed
* key or open the accents menu on macOS.
*
* The variable can be set to the following values:
*
* - "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().
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_MAC_PRESS_AND_HOLD "SDL_MAC_PRESS_AND_HOLD"
/**
* Request SDL_AppIterate() be called at a specific rate.
*
@@ -2699,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.
@@ -2950,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
*
@@ -3274,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"
@@ -3530,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:
*
@@ -3714,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.
*
@@ -4384,6 +4496,28 @@ extern "C" {
*/
#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD"
/**
* A variable controlling whether or not the RIDEV_NOHOTKEYS flag is set when
* enabling Windows raw keyboard events.
*
* This blocks any hotkeys that have been registered by applications from
* having any effect beyond generating raw WM_INPUT events.
*
* This flag does not affect system-hotkeys like ALT-TAB or CTRL-ALT-DEL, but
* does affect the Windows Logo key since it is a userland hotkey registered
* by explorer.exe.
*
* The variable can be set to the following values:
*
* - "0": Hotkeys are not excluded. (default)
* - "1": Hotkeys are excluded.
*
* This hint can be set anytime.
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS"
/**
* A variable controlling whether SDL uses Kernel Semaphores on Windows.
*

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
@@ -268,6 +268,7 @@ _m_prefetch(void *__P)
#endif /* compiler version */
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro to decide if the compiler supports `__attribute__((target))`.
*
@@ -280,12 +281,14 @@ _m_prefetch(void *__P)
* \sa SDL_TARGETING
*/
#define SDL_HAS_TARGET_ATTRIBS
#elif defined(__loongarch64) && defined(__GNUC__) && (__GNUC__ >= 15)
/* LoongArch requires GCC 15+ for target attribute support */
# define SDL_HAS_TARGET_ATTRIBS
#elif defined(__clang__) && defined(__has_attribute)
# if __has_attribute(target)
# define SDL_HAS_TARGET_ATTRIBS
# endif
#elif defined(__GNUC__) && (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4) /* gcc >= 4.9 */
#elif defined(__GNUC__) && !defined(__loongarch64) && (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4) /* gcc >= 4.9 */
# define SDL_HAS_TARGET_ATTRIBS
#elif defined(__ICC) && __ICC >= 1600
# define SDL_HAS_TARGET_ATTRIBS

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
@@ -45,10 +45,12 @@
* `SDLK_*` constant for those keys that do not generate characters.
*
* A special exception is the number keys at the top of the keyboard which map
* to SDLK_0...SDLK_9 on AZERTY layouts.
* 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.
*
* \since This datatype is available since SDL 3.2.0.
*

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

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
@@ -110,7 +110,8 @@
* Even if available, an app can define SDL_MAIN_HANDLED and provide their
* own, if they know what they're doing.
*
* This macro is used internally by SDL, and apps probably shouldn't rely on it.
* This macro is used internally by SDL, and apps probably shouldn't rely on
* it.
*
* \since This macro is available since SDL 3.2.0.
*/
@@ -125,10 +126,11 @@
* This macro is defined by `SDL_main.h`, which is not automatically included
* by `SDL.h`.
*
* Even if required, an app can define SDL_MAIN_HANDLED and provide their
* own, if they know what they're doing.
* Even if required, an app can define SDL_MAIN_HANDLED and provide their own,
* if they know what they're doing.
*
* This macro is used internally by SDL, and apps probably shouldn't rely on it.
* This macro is used internally by SDL, and apps probably shouldn't rely on
* it.
*
* \since This macro is available since SDL 3.2.0.
*/
@@ -165,12 +167,10 @@
*/
#define SDL_MAIN_NEEDED
#elif defined(SDL_PLATFORM_IOS)
/* On iOS SDL provides a main function that creates an application delegate
and starts the iOS application run loop.
#elif defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS)
/* On iOS and tvOS SDL provides a main function that creates an application delegate and starts the application run loop.
To use it, just #include SDL_main.h in the source file that contains your
main() function.
To use it, just #include <SDL3/SDL_main.h> in the source file that contains your main() function.
See src/video/uikit/SDL_uikitappdelegate.m for more details.
*/
@@ -333,6 +333,8 @@ 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 +539,8 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_main(int argc, char *argv[]);
* will not be changed it is necessary to define SDL_MAIN_HANDLED before
* including SDL.h.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Init
@@ -553,6 +557,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetMainReady(void);
* using SDL_main (like when using SDL_MAIN_HANDLED). When using this, you do
* *not* need SDL_SetMainReady().
*
* If `argv` is NULL, SDL will provide command line arguments, either by
* querying the OS for them if possible, or supplying a filler array if not.
*
* \param argc the argc parameter from the application's main() function, or 0
* if the platform's main-equivalent has no argc.
* \param argv the argv parameter from the application's main() function, or
@@ -626,6 +633,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[]
* \returns true on success or false on failure; call SDL_GetError() for more
* 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);
@@ -643,6 +652,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style,
* deregistered when the registration counter in SDL_RegisterApp decrements to
* 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,6 +666,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
* 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.
*/
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.

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