12570 Commits
Author SHA1 Message Date
Shane CalimlimandRyan C. Gordon a2e7c76bda emscripten: add main thread proxy for getting audio frequency
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
the rest of the calls were updated in aec86ba but one was missed
2026-07-28 15:52:53 -04:00
Thorbjørn LindeijerandRyan C. Gordon 50b04b2813 Fixed some typos in the audio hints documentation
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-27 17:02:43 -04:00
Ryan C. Gordon 76847b46be alsa: Don't crash when SDL_GetDefaultAudioInfo() is passed a NULL name.
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
Fixes #16011.
2026-07-17 14:30:19 -04:00
Anonymous Maarten 86a636852b ci: don't configure cmake with -Werror
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-07-16 04:15:11 +02:00
Sam CleggandSam Lantinga f6a328a14b [emscripten] Remove support for legacy webkitGetUserMedia
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This modern navigator.mediaDevices.getUserMedia has been
available since Chrome 53 / Firefox 38 / Safari 11.

See https://github.com/emscripten-core/emscripten/pull/27347
2026-07-14 12:32:23 -07:00
Ryan C. Gordon 73fed37c04 assert: make disabled asserts work with bitfield conditions.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
We don't care _what_ the `sizeof` results are, we just want it to vaporize
the condition's code out of the build. So we check it with a `? 1 : 0`, so it
always boils down to a `sizeof (int)`, no matter what data type the condition
actually is.

This works with bitfields, pointers, anything that can be "truthy." If it
isn't truthy, it would fail when assertions are enabled anyhow.

Fixes #15990.

(manually cherry picked from commit daf519ae05)
2026-07-13 18:30:53 -04:00
ExtremelyLazyCatandSam Lantinga 0e802c12c0 Add Mayflash N64 Controller Adapter mapping for SDL2
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-07-07 14:09:14 -07:00
Ozkan Sezer 20d8ca0132 ci: bump freebsd and cross-platform-actions 2026-07-05 23:37:56 +03:00
Ozkan Sezer de433838ad SDL_cocoawindow.m: work-around build error due to -Wgnu-folding-constant 2026-07-05 04:51:10 +03:00
Anonymous Maarten bc518123c7 cmake: disable MSVC RUNTIME CHECKS for no-libc shared SDL2 library 2026-07-05 02:55:29 +02:00
Ryan C. Gordon b8b3f5ef20 gamecontroller: Added docs to SDL_GameControllerBindType, to fix wiki docs.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-22 22:32:16 -04:00
Ryan C. Gordon 1fbce8a06a locale: Fixed \since on SDL_Locale. 2026-06-22 22:11:49 -04:00
Ryan C. Gordon 56846df9b0 locale: Added docs to SDL_Locale struct, to fix wiki docs. 2026-06-22 22:10:02 -04:00
SDL Wiki Bot ca94cb5db0 Sync SDL2 wiki -> header
[ci skip]
2026-06-23 01:36:05 +00:00
Ryan C. Gordon cf83ffd8a1 stdinc: Add a little comment to SDL_bool for wikiheaders. 2026-06-22 21:06:39 -04:00
klirktagandSam Lantinga a442367706 Android: hide system bars via WindowInsetsController on API 30+
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
The immersive-fullscreen code hid the status and navigation bars with the
deprecated View.setSystemUiVisibility() flags plus FLAG_FULLSCREEN. On
Android 15+ (API 35), edge-to-edge is enforced for apps targeting SDK 35+
and those flags are ignored, so the bars never hide (e.g. on a Samsung
S25). Android 14 and below still honour them, which is why older devices
were unaffected.

Hide/show the system bars with WindowInsetsController on API 30+ (using
BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE for sticky-immersive), keeping the
legacy setSystemUiVisibility() path for API < 30. The minimum supported
version is unchanged.
2026-06-21 10:15:54 -05:00
Farmer-MarkusandSam Lantinga 3f1534af43 Android treat FULLSCREEN flag as FULLSCREEN_DESKTOP
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-16 11:56:39 -07:00
QwertyChouskieandSam Lantinga 1414dbf29d SDL_hidapi_xbox360.c: Fix Y axis inversion on macOS (#15792)
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Originally, macOS had opposite Y axis inversion as every other platform, likely to correct for an issue with the virtual gamepad reported by the old 360Controller driver.

Wired Xbox 360 controllers using native macOS drivers were first reported to be broken in https://github.com/libsdl-org/SDL/issues/11002.  The inversion was removed in https://github.com/libsdl-org/SDL/commit/7da728a642f2acfbba9543a3587363908d7aa1c3, presumably breaking 360Controller usage, but fixing wired 360 controller using the new native support in macOS 15 and above.  However, this change was reverted without explanation in https://github.com/libsdl-org/SDL/commit/d7b1ba1bfca7c9bf4f57075258ccfa0e0c6b2051 which added explicit support for the Steam Virtual Gamepad.  Presumably, Steam on macOS reports inverted Y axes to match what SDL expected on the platform.  However, this reversion broke the native macOS controller support.  The incorrect inversion also breaks using off-brand 360-class gamepads via the libusb backend of HIDRAW.

Backport of 157c839139 (https://github.com/libsdl-org/SDL/pull/15792) to SDL2
2026-06-11 16:12:15 -07:00
QwertyChouskieandSam Lantinga 77d2f62c23 Respect SDL_HINT_JOYSTICK_MFI
Backport of 0bd95b0430 (https://github.com/libsdl-org/SDL/pull/15791) to SDL2
2026-06-11 16:12:15 -07:00
tmkkandSam Lantinga 27e5c2e9a5 Bring back support for 360Controller driver on macOS
Backport 50d0e2ede2 (https://github.com/libsdl-org/SDL/pull/14880) to SDL2
2026-06-11 16:12:15 -07:00
Frank Praznik 819f6ae75b EGL: Ensure the platform extensions exist before using them
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
The EXT and KHR variants use the same constant values, but the EXT versions are available a bit further back.
2026-06-11 13:16:25 -04:00
Frank Praznik fea9b348c3 wayland: Explicitly specify EGL platform 2026-06-11 12:55:49 -04:00
Akihiko OdakiandFrank Praznik b3aa7083e2 x11: Explicitly specify EGL platform
Mesa's eglGetDisplay() chooses the native EGL platform from
EGL_PLATFORM, limited autodetection, or the build-time default. If that
selects Wayland while SDL is using the X11 video backend, Mesa can treat
the X11 Display pointer as a wl_display and crash during
eglInitialize().

See: https://gitlab.com/qemu-project/qemu/-/work_items/3540
2026-06-11 12:50:22 -04:00
Anonymous Maarten a0c31c3afc ci: run GDK on older Windows environment 2026-06-11 16:32:27 +02:00
Frank Praznik 79de30a345 wayland: Don't apply display orientation on Sailfish
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-04 18:24:30 -04:00
Ryan C. Gordon 5f25ce9282 x11: SetupWindowData shouldn't add to videodata->windowlist until success.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Fixes #15676.

(cherry picked from commit 22fb9edd5c)
2026-05-27 11:47:51 -04:00
Anonymous MaartenandOzkan Sezer 430cacdb44 _uitoa does not exist
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(manual backport of commit 08e338f45c)
2026-05-25 18:47:32 +03:00
Mark JonasandSam Lantinga 1df9ae4338 directfb: Fix CreateRenderer callback signature
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Update DirectFB_CreateRenderer() to use the current SDL_RenderDriver
API.

Signed-off-by: Mark Jonas <toertel@gmail.com>
2026-05-21 11:34:15 -07:00
Cameron Gutman f0d1101920 atomic: Implement loads on MSVC without RMW operations
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This fixes faults when loading from read-only memory and avoids
cache line bouncing across cores which reduces performance.
2026-05-11 19:52:54 -05:00
MajjcomandGitHub 4b69833bc5 Windows: Fix window caption drawing on borderless windows
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-05-04 08:31:28 -07:00
Stanislav AleksandrovandRyan C. Gordon 039a60c527 video: NULL-check display in SDL_DestroyWindow
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-04-28 07:59:47 -04:00
Cameron Gutman d07d39b0da atomic: Fix infinite recursion in SDL_CompilerBarrier() fallback
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
On some platforms, SDL_MemoryBarrierRelease() is defined to
SDL_CompilerBarrier(). If SDL_CompilerBarrier() is also defined to
the fallback spinlock acquire/release, then we will infinitely
recurse in SDL_UnlockSpinlock(). Avoid this by not unlocking the
temporary spinlock we create.
2026-04-27 19:53:10 -05:00
Cameron Gutman 3ebdcc5b1c atomic: Fix and cleanup SDL_UnlockSpinlock()
- Add missing SDL_MemoryBarrierRelease() in the generic codepath
- Remove Watcom and MSVC x86/x64 cases which are now identical to the generic codepath
- Fix Solaris barrier to ensure prior stores are visible before unlocking
2026-04-27 19:50:19 -05:00
Cameron Gutman dd1e04eedf atomic: Use __atomic_signal_fence() for SDL_CompilerBarrier()
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This is the (slightly) more standard way to accomplish it.
2026-04-26 22:07:57 -05:00
Cameron Gutman 26616cd653 atomic: Fix memory barriers on MSVC ARM32/ARM64
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-04-24 20:22:25 -05:00
Cameron Gutman 15275898f0 atomic: Use acquire/release InterlockedExchange intrinsics on ARM64EC 2026-04-24 19:07:17 -05:00
Cameron Gutman 157ca95985 Fix UWP build 2026-04-24 18:54:30 -05:00
Cameron Gutman 7751494160 atomic: Use DMB ISHLD for aarch64 acquire barrier
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This is a little more efficient than a DMB ISH and matches what
GCC, Clang, and MSVC generate for a C++11 acquire fence.
2026-04-23 21:18:05 -05:00
Cameron Gutman c3b0e62850 atomic: Use __atomic_thread_fence() when available
This avoids requiring inline assembly for each architecture.

It also fixes some weakly ordered architectures which lacked
said inline assembly (RISC-V, MIPS, LoongArch, etc) and were
thus disasterously broken.
2026-04-23 18:59:40 -05:00
atirado.netandSam Lantinga c8ebb1456e Backport VIRPIL Controls device IDs to SDL2
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Backport of SDL3 fix (libsdl-org/SDL#15418).

VIRPIL Controls (VID 0x3344) flight sticks are
misclassified as gamepads by SDL's axis-count
heuristic because they report exactly 6 axes,
matching SDL_GAMEPAD_AXIS_COUNT. Adding them to
the appropriate device lists ensures correct
classification.

Tested on Linux (Fedora 43, kernel 6.19) with:
- R-VPC Stick MT-50CM3 (PID 0x4391)
- L-VPC Stick MT-50CM3 (PID 0x8390)
- VPC VMAX Prime Throttle (PID 0x0196)
2026-04-21 05:24:27 -10:00
Cameron GutmanandRyan C. Gordon 30de669b32 atomic: Fix missing full memory barrier on GCC/Clang
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
__sync_lock_test_and_set() is designed for creating locks, not as
a general atomic exchange function. As a result, it only provides
an acquire memory barrier and isn't guaranteed to actually store
the provided value (though it does on architectures we care about).

__atomic_exchange_n() is supported on GCC/Clang for the last ~10
years, so let's use that instead if available. We will keep the
__sync_lock_test_and_set() fallback around for ancient platforms,
but add a full memory barrier to match the documented behavior.
2026-04-20 06:17:49 -04:00
Ryan C. Gordon 2d28ee6eb7 CLAUDE.md: Just copy the text from AGENTS.md in here for now.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Someone mentioned that Claude sees this file's previous text and adds "look at
AGENTS.md" to it's TODO list instead of treating it as the thing it should do
first.

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

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

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

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

(cherry picked from commit 1124e44e4c)
2026-04-16 12:23:03 -04:00
Ryan C. Gordon 9cab8fb595 AGENTS.md: Change "may not" to "must not".
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(Hat tip to Sean Barrett on the stronger wording here.)

(cherry picked from commit 5bda0ccfb0)
2026-04-15 17:27:57 -04:00
Ryan C. Gordon de3b6143c5 policy: Clarify that "AI" means specific things.
(cherry picked from commit 954e2f3354)
2026-04-15 15:42:38 -04:00
Ryan C. Gordon e9603fe4f9 policy: Updated AI-related text based on excellent feedback.
(cherry picked from commit 4711119605)
2026-04-15 15:42:35 -04:00
Ryan C. Gordon 4e9c6ec24c policy: Added to the PR template, and an AGENTS.md, refusing AI contributions.
Fixes #15350.

(cherry picked from commit 08285d828e)
2026-04-15 15:42:30 -04:00
Cameron Gutman 725db83c23 atomic: Use __atomic_load_n on Android 2026-04-14 18:13:15 -05:00
Cameron Gutman cf5f7965df atomic: Switch to _SDL_HAS_BUILTIN to detect __atomic_load_n 2026-04-14 18:13:15 -05:00
MAJigsaw77andSylvain 6587c12e17 Use singleTop launchMode for SDLActivity on Android
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-04-13 09:28:58 +02:00