Commit Graph

20609 Commits

Author SHA1 Message Date
Frank Praznik
7c110cb0f1 wayland: Convert alternate images to ARGB8888
The higher-level functions only convert the base image, so alternate scaled images for icons and cursors need to be converted when being copied to the buffers.
2025-10-20 19:00:29 -04:00
Victor Ilyushchenko
544772173f fix crash in Cocoa when SDL_RedrawCursor sends NULL to ShowCursor
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
2025-10-20 18:08:27 -04:00
Ryan C. Gordon
91a5598283 cocoa: Check for duplicate proximity events.
Fixes #12137.
2025-10-20 15:55:24 -04:00
Frank Praznik
3669920fdd win32: Set the number of frames correctly when caching a scaled animated cursor
Fixes #14284
2025-10-20 13:26:19 -04:00
Sam Lantinga
0e351efbbc testcustomcursor: set the hotspot to the middle of the cross 2025-10-20 09:48:03 -07:00
Ryan C. Gordon
f999d8d99f README-emscripten: Added a note about how the 2D API handles vsync differently.
Reference PR #13962.
2025-10-20 12:35:52 -04:00
Sylvain
128baec810 Add option "--quit-after-ms N" to automatically quit application after N ms 2025-10-20 08:41:24 -07:00
Jeong Sang (정상)
792bde98c3 Make SDL3.framework path detection more robust by searching upwards (#14259) 2025-10-20 00:23:21 -07:00
Eddy Jansson
3b0347ac48 Don't do NULL-checks before free() 2025-10-20 00:13:09 -07:00
Eddy Jansson
aaee09d6ed Don't do NULL-checks before SDL_free()
Replaces the pattern

  if (ptr) {
    SDL_free(ptr);
  }

with

  SDL_free(ptr);
2025-10-20 00:13:09 -07:00
Sam Lantinga
2f810e0a5f Copy properties when converting a surface to a new format
This fixes retaining the cursor hotspot when converting cursor frames to SDL_PIXELFORMAT_ARGB8888
2025-10-19 23:51:19 -07:00
Sam Lantinga
23fcf53c53 Treat a single frame animated cursor as a normal color cursor 2025-10-19 23:03:54 -07:00
Sam Lantinga
bd86e85249 Added fallback support for animated cursors 2025-10-19 22:53:10 -07:00
Sam Lantinga
0e87ba163f Fixed crash if the animated cursor had a NULL frame 0 2025-10-19 22:53:10 -07:00
Sam Lantinga
cae27a0ec7 Set an error if a cursor image is too large 2025-10-19 18:25:05 -07:00
Frank Praznik
95c0b49de0 x11: Check for a valid video device pointer before dereferencing the name 2025-10-19 18:39:44 -04:00
Frank Praznik
bad5dced3e x11: Ensure that parent windows for a dialog are from the X11 driver
If the system doesn't have Zenity installed, message boxes can fall back to the X11 toolkit while the Wayland driver is in use, in which case, a Wayland window may be set as a parent to an X11 dialog. Ensure that the parent window for an X11 dialog is actually an X11 window.
2025-10-19 18:16:50 -04:00
SDL Wiki Bot
ac29b02b02 Sync SDL3 wiki -> header
[ci skip]
2025-10-19 18:24:22 +00:00
Ryan C. Gordon
1fe926769c kmsdrm: Restore atomic support. 2025-10-19 14:22:56 -04:00
Sylvain
e4c60c05bf Fixed bug #14233 - Android fix Android_WaitActiveAndLockActivity() to make sure Android_Paused state is refreshed 2025-10-19 07:43:51 -07:00
TheSniperFan
cbcb145eb4 Fix debug mode being set too late
-Early error messages were always being skipped
2025-10-18 08:04:11 -07:00
Vicki Pfau
d635a064aa switch2: Read out serial number 2025-10-18 07:57:30 -07:00
Vicki Pfau
e4b763f9f8 switch2: Enable grip buttons on charging grip 2025-10-18 07:57:30 -07:00
Vicki Pfau
b152c9fb3c switch2: Refactor out flash reading 2025-10-18 07:57:30 -07:00
Vicki Pfau
ee4c2ce120 switch2: The reply to the LED packet is only 8 bytes 2025-10-18 07:57:30 -07:00
Vicki Pfau
82374b4778 switch2: Use report ID 5 for all controllers 2025-10-18 07:57:30 -07:00
Vicki Pfau
061ce935df switch2: Simplify init data array 2025-10-18 07:57:30 -07:00
Frank Praznik
427f838f58 unix: Add ppoll support
Allows for finer grained timeout values, and fixes a FIXME.

This also drops the legacy select() fallback path in favor of presuming that poll() is always available. poll() is part of the POSIX.1-2001 standard, has been available in Unix since some time in the 1980s, the BSDs since at least the early 90s, and Linux since kernel 2.1, which predates kernel support for Pthreads. glibc also has its own emulation using select(), if necessary.
2025-10-17 14:30:10 -04:00
Petar Popovic
201ad7f79b Update comment in SDL_UserEvent for member type 2025-10-17 08:09:46 -07:00
SDL Wiki Bot
474d38b14f Sync SDL3 wiki -> header
[ci skip]
2025-10-17 08:28:31 +00:00
Ethan Lee
2135ecdfcc gpu: Vulkan on private platforms cannot make use of oldSwapchain, destroy the full swapchain on resize 2025-10-16 15:18:07 -04:00
Anonymous Maarten
7a26bee6ee ci: bump macos-13 to macos-14
macos-13 image is getting retired in December 2025
2025-10-16 20:07:18 +02:00
Anonymous Maarten
57ac8fcded release: test CMake config files of frameworks in xcframeworks in dmg releases 2025-10-16 18:07:34 +02:00
Sam Lantinga
b16ad6f10f Allow any init flags to be passed to SDLTest_CommonCreateState() 2025-10-15 21:57:37 -07:00
Sam Lantinga
6109fa6794 The names of joysticks and gamepads are valid after they've been removed 2025-10-15 21:57:37 -07:00
nmlgc
5e1a753f88 windowsdialog: Fix broken ≤XP fallback declarations
The syntax errors in the enum lists tell us that no one ever actually
compiled this `WINVER < _WIN32_WINNT_VISTA` fallback path. 2f5bc17 made
it increasingly unlikely for retro Windows builds to hit this path by
adding a new set of `WINVER` override rules to `SDL_windows.h` that
check for the presence of certain headers. `HAVE_MMDEVICEAPI_H` in
particular will be `#define`d for any CMake build with a ≥Vista-era
SDK, such as Visual Studio 2017's `v141_xp` toolset that 2f5bc17
targeted, and it's also unconditionally defined in the default
`SDL_build_config_windows.h` configuration used by the ready-made
Visual Studio project.

These fixes work for a XP-era configuration that undefines all of the
`HAVE_*_H` macros and `SDL_VIDEO_RENDER_D3D12` to make `SDL_windows.h`
fall through to the `#define _WIN32_WINNT _WIN32_WINNT_WINXP` case, on
both Visual Studio 2022 and Visual Studio 2017's `v141_xp` toolset.
2025-10-15 21:17:59 -07:00
Petar Popovic
79dae1b9d6 Updated comment for event type in SDL_DisplayEvent 2025-10-15 12:26:09 -07:00
SDL Wiki Bot
c66dd17fa3 Sync SDL3 wiki -> header
[ci skip]
2025-10-15 18:42:41 +00:00
Anonymous Maarten
aa57984928 stdinc: add strtok_r prototype for clang-tidy 2025-10-15 14:41:15 -04:00
Frank Praznik
dcb8a6521c Add animated cursor support
Adds support for animated cursors on Cocoa, Wayland, Win32, and X11.

testcursor can take a semicolon separated list of filenames and load an animated cursor from them.
2025-10-15 14:41:15 -04:00
Frank Praznik
69692de8b8 wayland: Refactor animated cursor handling
Generalizes the animated cursor info, so it can be used for custom cursors as well.
2025-10-15 14:41:15 -04:00
nmlgc
2ffabb5150 render: Fix texture format selection for color-keyed indexed surfaces
015cc6a broke texture format selection for this kind of surface if the
renderer's first texture format doesn't happen to have an alpha
channel. This happens for on-screen software renderers on Windows,
whose preferred format is the window's own `SDL_PIXELFORMAT_XRGB8888`.
This fixed check also cover the intent behind 015cc6a, assuming that
indexed and alpha formats are mutually exclusive.
2025-10-14 21:23:09 -07:00
Peter0x44
705ced8cf5 Make D3D math functions static inline to reduce likelihood of linking conflicts
Convert SDL_d3dmath.c functions to static inline in SDL_d3dmath.h to make
it less likely to conflict when static linking SDL. raylib's SDL backend
does not work with a "normal" upstream binary static link. It has these
errors:

/usr/bin/ld: /usr/local/lib64/libSDL3.a(SDL_d3dmath.c.o): in function `MatrixIdentity':
SDL/src/render/SDL_d3dmath.c:35: multiple definition of `MatrixIdentity'; CMakeFiles/raylib.dir/rcore.c.o:rcore.c:(.text+0x18470): first defined here
/usr/bin/ld: /usr/local/lib64/libSDL3.a(SDL_d3dmath.c.o): in function `MatrixMultiply':
SDL/src/render/SDL_d3dmath.c:44: multiple definition of `MatrixMultiply'; CMakeFiles/raylib.dir/rcore.c.o:rcore.c:(.text+0x18540): first defined here
collect2: error: ld returned 1 exit status

It works if these functions aren't emitted, (i.e.
!SDL_VIDEO_RENDER_D3D(11|12|GPU|VULKAN)

Or, if SDL is not linked static. Which I know is preferred anyway.

In raylib's case, it doesn't use this code anyway so it's not a problem
to build it yourself with them disabled. But it's a minor hassle to be
incompatible with static linking libraries from upstream.

I can't see any good reason for these functions to not be static inline
already, so I just put them in the header and deleted the .c.

Raylib's conflicting case is a library with a public function exposed to
users. But SDL's case is not.

- Moved all matrix functions from SDL_d3dmath.c to SDL_d3dmath.h as static inline
- Removed SDL_d3dmath.c from all project files (Visual Studio and Xcode)
- Functions affected: MatrixIdentity, MatrixMultiply, MatrixScaling,
  MatrixTranslation, MatrixRotationX, MatrixRotationY, MatrixRotationZ
2025-10-14 16:56:41 -07:00
Oleksandr Manenko
901173aee6 Fix thread safety attributes for TryLock functions
Changed SDL_TRY_ACQUIRE and SDL_TRY_ACQUIRE_SHARED success value
from 0 to true for functions that now return bool instead of int.
This fixes false positives/negatives in Clang's thread safety analysis.
2025-10-14 12:47:20 -07:00
Sam Lantinga
f844f3e10b Only pass UIPress from game controllers and remotes if the're not open
Fixes https://github.com/libsdl-org/SDL/issues/14080
2025-10-14 12:43:22 -07:00
SDL Wiki Bot
69c5528bde Sync SDL3 wiki -> header
[ci skip]
2025-10-14 18:51:56 +00:00
ROllerozxa
8da5d7bc7c Merge some things from the SupportedPlatforms Wiki page (#12954) 2025-10-14 14:20:39 -04:00
Ryan C. Gordon
48b5da67f4 README-switch.md: Updated to mention Switch 2. 2025-10-14 14:18:35 -04:00
SDL Wiki Bot
4c6f2b887f Sync SDL3 wiki -> header
[ci skip]
2025-10-14 18:08:51 +00:00
Ryan C. Gordon
55167402f4 pen: Improved docs for SDL_PenDeviceType. 2025-10-14 14:07:08 -04:00