Commit Graph

12118 Commits

Author SHA1 Message Date
Sam Lantinga
cd6b68a9fb Define the behavior of a negative width or height passed to SDL_RenderFillRect()
The software renderer now matches the 3D renderer behavior by rendering a reversed rectangle (extending width or height in the opposite direction) when width or height is negative. It also now renders no rectangle if the width and height are 0.

Fixes https://github.com/libsdl-org/SDL/issues/13400
2025-09-07 12:28:37 -07:00
Sam Lantinga
ec33da05b3 Added SDL_HINT_RENDER_DIRECT3D11_WARP
Fixes https://github.com/libsdl-org/SDL/issues/13002
2025-09-07 11:00:59 -07:00
Sam Lantinga
466f93aee1 Fixed pitch and chroma issues with the Vulkan planar YUV texture update functions
Fixes https://github.com/libsdl-org/SDL/issues/13734
2025-09-07 10:19:00 -07:00
Frank Praznik
8c4e048a68 x11: Fail gracefully on keymap creation failure 2025-09-07 11:37:56 -04:00
Ryan C. Gordon
2a0e751ff5 gamepad: Fixed Emscripten guide button, after recent changes.
(buttons above 12 all shifted down by four, since the dpad buttons now look
like a hat...the only one above the dpad buttons on a standard layout is the
guide button, index 16. This change moves it to 12.)
2025-09-07 10:25:12 -04:00
Ryan C. Gordon
82a800e266 emscripten: Let joystick dpad-to-hat conversion allow impossible combinations.
This matches what other backends do.
2025-09-07 10:02:20 -04:00
Ryan C. Gordon
b58d0f8e4e gamepad: Fixed Emscripten d-pad, after recent changes. 2025-09-07 10:00:41 -04:00
Sam Lantinga
25d9096d41 Fixed rumble strength on DualSense Edge and Bluetooth connected controllers
Fixes https://github.com/libsdl-org/SDL/issues/13771
2025-09-06 11:53:32 -07:00
Sam Lantinga
fb2daa2f5f Updated the documentation for SDL_GetRenderLogicalPresentation()
Fixes https://github.com/libsdl-org/SDL/issues/13791
2025-09-06 11:21:36 -07:00
Adrian
01e6aceffc Set preferredFrameRateRange in main callbacks CADisplayLink 2025-09-06 10:13:27 -07:00
Sam Lantinga
02fc571cfd Fixed build 2025-09-06 10:12:01 -07:00
Sam Lantinga
5605f85d84 Check the return value of SDL_SW_CopyYUVToRGB() 2025-09-06 10:07:09 -07:00
Sam Lantinga
d21da8644b Revert "Make sure fast path RGB <-> YUV conversions are using the same color primaries"
This reverts commit ee87132385.

The supported conversions assume correct primaries for YUV converted to SRGB
2025-09-06 10:03:41 -07:00
Sam Lantinga
61e41c61dc Select the shader based on the inputs, not colorspace
Fixes https://github.com/libsdl-org/SDL/issues/13880
2025-09-06 08:58:17 -07:00
Ozkan Sezer
baf965c1ca Revert "video/openvr: define OPENVR_API_NODLL"
This reverts commit 976ba1e750.
2025-09-06 04:15:55 +03:00
Ozkan Sezer
976ba1e750 video/openvr: define OPENVR_API_NODLL
.. so that S_API doesn't expand to __declspec(dllimport)
2025-09-06 03:05:50 +03:00
Sam Lantinga
c573326f11 Fixed double-free in the OpenVR video backend 2025-09-05 14:47:20 -07:00
Ryan C. Gordon
a6dc61ab32 joystick: Emscripten can often fake a hat from the d-pad buttons.
Fixes #13817.
2025-09-05 14:46:59 -04:00
Ryan C. Gordon
937bf4d789 alsa: Restart PCM devices after recovery from an overrun/underrun.
snd_pcm_recover() puts the device back in SND_PCM_STATE_PREPARED state; you
have to explicitly restart the device afterwards with snd_pcm_start().

Fixes #13761.
2025-09-05 13:50:06 -04:00
Ryan C. Gordon
b8197a2291 io: rework how we set SDL_IOStream status.
This now relies on the implementation to set these flags on short reads/writes
instead of the higher level checking if SDL_SetError() was called.

Additionally (and crucially), this now sets ERROR or EOF on all short reads,
across all backends, not just when we get a zero-byte return value.

Fixes #13720.
2025-09-05 12:43:13 -04:00
Aleksey Melekh
129c97f610 xbox: fix build 2025-09-05 09:19:54 -07:00
Sam Lantinga
3572be3998 Improved detection of FlyDigi controllers 2025-09-04 18:21:17 -07:00
Sam Lantinga
9e3d5969e6 Fixed testsoftwaretransparent on platforms using a renderer for window surfaces 2025-09-04 09:24:22 -07:00
Qiang
f2d2cd8152 fix: Blending rendering anomaly when using the software renderer with SDL_WINDOW_TRANSPARENT on Windows. (#13866) 2025-09-04 07:41:45 -07:00
Sam Lantinga
637a9b34ab Added a comment explaining the initialization delay 2025-09-03 15:47:21 -07:00
Sam Lantinga
b6a55c2856 Wait a bit for initialization to complete before requesting calibration data
Fixes https://github.com/libsdl-org/SDL/issues/13856
2025-09-03 15:36:58 -07:00
Cameron Cawley
42f571ea4b Remove unused PSP source files 2025-09-03 15:19:24 -07:00
Sam Lantinga
9abeeebad5 Fixed warning: no previous prototype for function 2025-09-03 11:23:55 -07:00
Simon McVittie
4441d8b0ad x11: Don't include XDestroyImage in the table of exported functions
When linking directly to libX11 as a hard dependency, we assign the
addresses of functions like XDestroyImage to function pointers like
X11_XDestroyImage. However, by default Xutils.h doesn't declare
XDestroyImage as a function: it only provides a macro which looks into
the XImage struct and calls a function pointer directly, similar to
a virtual method.

SDL_x11framebuffer.c was already relying on being able to call the macro
without explicitly linking to libX11, so do the same here.

Fixes: d14cbd7b "Introduce X11 toolkit and make message dialogs use it"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-03 09:22:38 -07:00
eafton
51052245d1 X11TK: Fix locale bug for non-dialog windows 2025-09-03 07:00:59 -07:00
Sam Lantinga
437d78499c Don't set SDL_SURFACE_LOCK_NEEDED until a surface is RLE encoded
Reference https://github.com/libsdl-org/sdl2-compat/issues/476
2025-09-02 21:31:51 -07:00
Sam Lantinga
fbbc29159a Leave letterbox borders set to the frame clear color
Fixes https://github.com/libsdl-org/sdl2-compat/issues/483
2025-09-02 20:14:34 -07:00
Ozkan Sezer
cc9937201e x11: fix a typo after PR/13855 and kill lots of trailing whitespace 2025-09-03 04:37:56 +03:00
Sam Lantinga
ef19c72015 Set the texture scale and address mode when creating a texture
Fixes https://github.com/libsdl-org/sdl2-compat/issues/506
2025-09-02 18:05:31 -07:00
eafton
d14cbd7b50 Introduce X11 toolkit and make message dialogs use it (#13855) 2025-09-02 13:22:48 -07:00
Sam Lantinga
84af0bb53a Updated the 8BitDo Ultimate 2 Wireless Controller dongle update rate
The latest dongle firmware appears to update at 1000Hz
2025-09-02 09:53:09 -07:00
Sam Lantinga
a562e40d2c Revert "Disable rumble for the Ultimate 2 Wireless Controller in dongle mode"
This reverts commit 065fdca953.

8BitDo has fixed the rumble issue with dongle firmware update V1.05
2025-09-02 09:53:09 -07:00
Sam Lantinga
b47572c9bb Fixed build warning with Visual Studio 2025-09-02 09:53:09 -07:00
Ethan Lee
689049f8ec gpu: VK_KHR_get_physical_device_properties2 can be optional 2025-09-02 09:53:01 -07:00
Sam Lantinga
1f007ad5cd Added support for the player LED on Nintendo Switch 2 controllers 2025-09-01 21:11:16 -07:00
Sam Lantinga
4b93e7488f Added support for the Switch 2 Joy-Cons with charging grip 2025-09-01 21:11:16 -07:00
Ryan C. Gordon
7323104f97 openslES: Patched to compile.
(whoops.)
2025-09-01 11:10:02 -04:00
Ryan C. Gordon
0b2a003a35 openslES: OpenSL ES on Android only supports two formats, limit to that.
(Three with the floating point extension, which we use.)

This is according to:

https://developer.android.com/ndk/guides/audio/opensl/opensl-for-android

Previously, this would accept a request for Sint8 or Sint32 and disaster
would ensue.

Fixes #13779.
2025-09-01 10:30:29 -04:00
Frank Praznik
1c8f1e0b4c wayland: Update pointer warp protocol checks and error message 2025-08-31 13:19:32 -04:00
Sam Lantinga
7c8df4ea52 Fixed warnings building with Visual Studio 2025-08-30 10:15:58 -07:00
Sam Lantinga
3cf2350f21 Fixed build 2025-08-30 10:15:32 -07:00
Jordan Saunders
265236d952 Fix two uninitialized variables
Found when running in valgrind looking at another issue.

- RenderPass' depth_stencil_target
    Tripped in SDL_BindGPUFragmentSamplers when not binding a DS target

- VulkanCommandBuffer's swapchainRequested
    Tripped in VULKAN_Submit for the end transition barrier when
    creating an image. The field is only reset when reused, not on first
    use
2025-08-30 06:05:22 -07:00
Frank Praznik
fdfde42db1 fs: Fix OpenBSD path retrieval
Set the path start pointer to point to a valid string.
2025-08-29 19:03:44 -04:00
Frank Praznik
1049426a76 wayland: Add a sigtimedwait() implementation for OpenBSD
sigtimedwait() is an optional part of POSIX.1-2001, and OpenBSD doesn't implement it. Add a replacement implementation based on https://comp.unix.programmer.narkive.com/rEDH0sPT/sigtimedwait-implementation
2025-08-29 18:32:29 -04:00
Vicki Pfau
184f6fa231 switch2: Read calibration data 2025-08-29 05:46:19 -07:00