Commit Graph

21225 Commits

Author SHA1 Message Date
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