Sam Lantinga
4c82b5843e
Added support for SDL_PIXELFORMAT_MJPG to SDL_DuplicateSurface()
...
Fixes https://github.com/libsdl-org/SDL/issues/12472
2025-03-05 23:33:26 -08:00
Sam Lantinga
cb099ebd4f
Make texture scale mode a part of the 2D renderer draw state
...
Also added texture addressing mode support to the PSP and Vita renderers (untested)
Fixes https://github.com/libsdl-org/SDL/issues/12461
2025-03-05 21:35:04 -08:00
Sam Lantinga
49af576940
Disable XTest by default
...
On Ubuntu 24.04 running XWayland, XTestFakeMotionEvent() appears to succeed but doesn't actually move the cursor, even if the cursor is hidden.
2025-03-05 13:23:02 -08:00
Sam Lantinga
794ff283e2
Added support for using XTest to warp the mouse
2025-03-05 13:23:02 -08:00
Sam Lantinga
fae324dacb
Update XSync code to match SDL3 conventions
2025-03-05 13:23:02 -08:00
Sam Lantinga
fe9bdcf508
Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT
2025-03-05 09:07:05 -08:00
Sam Lantinga
8f40dad460
Document the thread safety of SDL surface functions
2025-03-05 07:24:24 -08:00
Sam Lantinga
aef240b2e4
Fixed continuous logging if returning to desktop mode fails on X11
2025-03-04 17:24:29 -08:00
Sam Lantinga
e9632c83c7
Handle XWayland not sending display disconnected events
...
Also updated X11_CheckDisplaysMoved() to handle multiple X11 screens
Fixes https://github.com/libsdl-org/SDL/issues/12462
2025-03-04 17:23:23 -08:00
Sam Lantinga
ca9bc6b164
Revert "Ignore BadRROutput errors from XRRGetOutputInfo()"
...
This reverts commit 0c8ddc1f0a .
The real bug here is that XWayland isn't sending us a display disconnected event, which will be handled in the next commit.
2025-03-04 17:16:35 -08:00
Sam Lantinga
0c8ddc1f0a
Ignore BadRROutput errors from XRRGetOutputInfo()
...
Fixes https://github.com/libsdl-org/SDL/issues/12462
2025-03-04 16:08:41 -08:00
Sam Lantinga
80ae3a7516
Fixed crash when restoring the desktop mode on macOS
...
Fixes https://github.com/libsdl-org/SDL/issues/12460
2025-03-04 14:31:51 -08:00
Sam Lantinga
5f07347e4f
Fixed crash unplugging a HIDAPI controller
2025-03-04 11:42:17 -08:00
Sam Lantinga
82552e5b7c
Make SDL_RegisterEvents() thread-safe
...
Fixes https://github.com/libsdl-org/SDL/issues/12457
2025-03-04 10:27:55 -08:00
Sam Lantinga
5d20bbf348
Presenting while drawing to a render target should fail.
...
People are adding present calls while rendering to render targets, not understanding that this doesn't make sense, and wondering why they get flicker on some systems. If there are programs that relied on the previous behavior we can add a hint to control this.
Fixes https://github.com/libsdl-org/SDL/issues/12432
2025-03-04 08:46:13 -08:00
Sam Lantinga
4bb46e93c8
Fixed clip rect when logical presentation is enabled
...
We don't need to include the logical offset, it's already included in the viewport.
Fixes https://github.com/libsdl-org/SDL/issues/12454
2025-03-04 08:24:18 -08:00
Sam Lantinga
7c29c8b266
Added fullscreen_active to better track fullscreen state
...
This is true if fullscreen is pending or currently active. This is a better check in SDL_SetDesktopDisplayMode() because a fullscreen mode may be pending and complete asynchronously and the window hasn't been set to fullscreen yet.
2025-03-03 21:18:42 -08:00
Sam Lantinga
24ec2ed785
Don't save temporary mode changes to the desktop mode
...
Fixes https://github.com/libsdl-org/SDL/issues/12441
2025-03-03 07:40:55 -08:00
Sam Lantinga
2c7c3d4d7b
Only use VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR on Android
...
This fixes Nintendo Switch where the identity bit isn't available. We only needed this on Android to automatically handle device user orientation.
2025-03-02 09:12:48 -08:00
Sam Lantinga
1a7c206986
Save and restore error messages when rolling back after failed init
...
Fixes https://github.com/libsdl-org/SDL/issues/12439
2025-03-02 07:55:56 -08:00
Sam Lantinga
2c46c3d5b7
Updated dynamic API for new functions
2025-03-02 07:53:51 -08:00
Sam Lantinga
b0df1cbbef
Updated to version 3.3.0 for development
2025-03-01 19:31:00 -08:00
Sam Lantinga
65864190cc
Added testpen to the Xcode test project
2025-03-01 18:49:25 -08:00
Sam Lantinga
292e431748
Updated to version 3.2.6 for release
2025-03-01 18:30:34 -08:00
Sam Lantinga
f0cb78e082
Handle XCreateIC() failing when composition UI is enabled
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/328
2025-03-01 13:54:07 -08:00
Sam Lantinga
55484ef023
Moved WIN_UpdateMouseCapture() to be with the other mouse functions
2025-03-01 12:54:17 -08:00
Sam Lantinga
020664bd10
Update mouse button state when re-entering a window
...
Fixes https://github.com/libsdl-org/SDL/issues/12423
2025-03-01 12:54:17 -08:00
Sam Lantinga
b836ad4d4f
Fix a root signature mismatch for the D3D12 renderer
...
The shaders hadn't been rebuilt after https://github.com/libsdl-org/SDL/commit/c74f273848b0259c4902c97213f5dc0760aecce9
Fixes https://github.com/libsdl-org/SDL/issues/12276
2025-03-01 12:02:49 -08:00
Sam Lantinga
6e4193b743
Note that the file names are UTF-8 encoded
2025-03-01 08:25:31 -08:00
Sam Lantinga
b8c2bc143e
Added build dependencies for Arch Linux
...
These are based on the dependencies listed at:
https://archlinux.org/packages/extra/x86_64/sdl3/
2025-02-28 16:31:10 -08:00
Sam Lantinga
ef23ebfb5a
Fixed the cursor clip rect when toggling window borders on macOS
2025-02-28 11:57:34 -08:00
Sam Lantinga
281f0fae1c
Include the VID/PID of generic keyboard/mouse devices on Windows
2025-02-27 14:03:39 -08:00
Sam Lantinga
eb89d0c8c3
Don't put wired Switch Pro controllers into simple report mode
...
This stops the controller from sending input or responding to queries until it's unplugged.
2025-02-26 17:54:43 -08:00
Sam Lantinga
1ea99bc904
Early out if setting a duplicate window title
...
Setting the window title is an expensive windowing operation, so short circuit it if possible.
2025-02-26 17:10:41 -08:00
Sam Lantinga
cc984c9735
Added a mapping for the 8BitDo SN30 Pro+ controller on macOS
...
This mapping is for Android mode (Start + B at startup)
Fixes https://github.com/libsdl-org/SDL/issues/12126
2025-02-26 12:24:47 -08:00
Sam Lantinga
ba88b6aa06
Fixed reliability of initializing Switch controllers on macOS
...
It looks like both macOS (15.1.1) and SDL are trying to talk to the controller at the same time, which can cause interleaved replies or even locking up the controller. Waiting a bit before talking to the controller seems to take care of this.
2025-02-26 12:24:47 -08:00
Sam Lantinga
66ecdc69ac
Don't update the report mode until the related hint is set
...
Fixes https://github.com/libsdl-org/SDL/issues/12404
2025-02-26 12:24:47 -08:00
Sam Lantinga
cf819ca818
Don't allow further operations on properties while we're destroying them
...
Fixes https://github.com/libsdl-org/SDL/issues/12407
2025-02-26 08:34:14 -08:00
Sam Lantinga
e012573766
Don't fixup mappings for Joy-Con controllers
...
They don't have a D-pad mapping, so look at the paddles instead to see whether we need to fix up the mapping.
Fixes https://github.com/libsdl-org/SDL/issues/12232
2025-02-25 19:14:18 -08:00
Sam Lantinga
34c3734953
Fixed opening one Joy-Con when the other is visible but disconnected
...
This can happen on Windows when the controller is turned off directly. It still shows up in the device list and you can send packets to it, but it's off and doesn't respond. We'll mark this device as broken and open the other as a single Joy-Con.
2025-02-25 19:14:18 -08:00
Sam Lantinga
049a7a04de
Wake the main thread for main function dispatch
...
Also added a test case to catch the main thread waiting indefinitely when a function is pending.
Fixes https://github.com/libsdl-org/SDL/issues/12390
2025-02-25 12:50:41 -08:00
Sam Lantinga
85a302550d
Set an error message if the rect passed to SDL_RenderReadPixels() is entirely outside the viewport
2025-02-25 10:28:57 -08:00
Sam Lantinga
29df99ee38
Clarified SDL_RenderReadPixels() documentation
...
Clarified that the rect to be read is clipped against the current viewport, not actually relative to it.
Also added a note for people using SDL_SetRenderLogicalPresentation() so they know they have to map between logical space and render space if they want to read back.
2025-02-25 10:28:57 -08:00
Sam Lantinga
1c2189c7c9
strings.h isn't available in Windows environments
...
I believe this header isn't necessary for clang-tidy, string.h has all the functions we care about.
Fixes https://github.com/libsdl-org/SDL/issues/12238
2025-02-25 09:41:50 -08:00
Sam Lantinga
ac5fca4ae5
Clarify the expected usage of SDL_StorageReady()
...
Fixes https://github.com/libsdl-org/SDL/issues/12201
2025-02-25 08:56:56 -08:00
Sam Lantinga
ad840e8796
Better document that main functionality is in SDL_main.h
...
Fixes https://github.com/libsdl-org/SDL/issues/12159
2025-02-25 08:38:39 -08:00
Sam Lantinga
6980325310
Added support for the "%n" sscanf format specifier
2025-02-24 20:02:59 -08:00
Sam Lantinga
e6a24fcbb5
fix stbi__parse_png_file() reading too much bytes (thanks @miniupnp!)
...
just "rewind" the bytes that have been read past the IEND chunk.
2025-02-24 17:29:25 -08:00
Sam Lantinga
db4e6c1931
Cocoa metal layers need their size updated before renderer updates
...
Also refactored event watch code so it can be shared between internal window event dispatch and public event watchers.
Fixes https://github.com/libsdl-org/SDL/issues/12376
2025-02-24 15:37:13 -08:00
Sam Lantinga
52e64f816c
Use SDL C runtime functions in OpenVR driver
...
Fixes link errors when building with -DSDL_LIBC=OFF
2025-02-22 12:41:03 -08:00
Sam Lantinga
7224b40407
Fix errors when building stb_image with -DSDL_LIBC=OFF
...
I integrated changes from SDL_image and updated as needed for JPEG memory loading functionality.
Fixes https://github.com/libsdl-org/SDL/issues/12364
2025-02-22 12:41:03 -08:00
Sam Lantinga
e50db698e2
Disable all camera drivers if SDL_CAMERA_DISABLED is defined
...
Fixes https://github.com/libsdl-org/SDL/issues/12182
2025-02-22 09:48:49 -08:00
Sam Lantinga
1ddba3ad55
Replace "8BitDo Tech Ltd" with "8BitDo" in the manufacturer string
...
Fixes the 8BitDo Micro gamepad so it shows up as "8BitDo Bluetooth Wireless Controller" in keyboard mode over Bluetooth.
2025-02-22 09:19:59 -08:00
Sam Lantinga
fdf72d1e45
Use the keyboard/mouse vendor if available
...
Fixes the 8BitDo Micro gamepad so it shows up as "8BitDo HID-compliant mouse" and "8BitDo HID Keyboard Device" in keyboard mode over USB.
2025-02-22 09:19:59 -08:00
Sam Lantinga
a811e0ef0f
Added support for the 8BitDo Micro gamepad
2025-02-22 09:19:59 -08:00
Sam Lantinga
bc85c55350
testcontroller: create window with high pixel density
...
This improves the picture quality when running on an iPhone.
2025-02-22 09:02:01 -08:00
Sam Lantinga
75bbcbf87b
Added support for Motion JPEG pipewire camera capture
2025-02-22 00:23:03 -08:00
Sam Lantinga
fcd41c1d2c
Check desired window area when checking zoom state
...
isZoomed returns true if the window has the size and position that it would if it were maximized, so we need to check to see if our floating state matches that before saying we're zoomed.
This fixes calling zoom:nil on a borderless resizable window that was created with the same size as the usable desktop area, which happens to also be the maximized state.
Fixes https://github.com/libsdl-org/SDL/issues/12228
2025-02-21 18:38:12 -08:00
Sam Lantinga
911e53dece
Retain mouse focus as long as we're getting mouse events
...
Fixes https://github.com/libsdl-org/SDL/issues/12218
Fixes https://github.com/libsdl-org/SDL/issues/12323
2025-02-21 15:35:28 -08:00
Sam Lantinga
3b8cb62283
Make it easier to enable IME debug logs
2025-02-21 15:24:45 -08:00
Sam Lantinga
2e346d7166
Added 32-bit texture formats to Texture_GetBlockWidth() and Texture_GetBlockHeight()
...
Fixes https://github.com/libsdl-org/SDL/issues/12335
2025-02-21 09:29:18 -08:00
Sam Lantinga
5d776c070a
Refactored SDL_CreateJoystickName() into a general SDL_CreateDeviceName()
2025-02-21 09:10:54 -08:00
Sam Lantinga
9267930fea
Added a fast path for converting the same format and pitch
2025-02-20 12:16:26 -08:00
Sam Lantinga
f24f9d3bed
Revert "testcamera: added support for Motion JPEG camera frames"
...
This reverts commit 5ccee77190 .
2025-02-20 12:16:26 -08:00
Sam Lantinga
2e89c53ebc
Added support for decoding MJPG into NV12 textures
2025-02-20 12:16:26 -08:00
Sam Lantinga
06602f4e80
Document that the pitch is the length of the image data for SDL_PIXELFORMAT_MJPG
2025-02-20 12:16:26 -08:00
Sam Lantinga
a792434a37
Added initial MJPG support using stb_image
2025-02-20 12:16:26 -08:00
Sam Lantinga
1a38960eee
Call SDL_DiscardAllCommands() for the software renderer as well
2025-02-20 09:53:11 -08:00
Sam Lantinga
8f4c5e15f1
Finish any drawing when destroying a software renderer
...
Fixes the SDL3 version of https://github.com/libsdl-org/sdl2-compat/issues/373
2025-02-20 08:49:47 -08:00
Sam Lantinga
6ef687c864
Simplified and fixed media foundation buffer handling
2025-02-17 08:14:30 -08:00
Sam Lantinga
de12cb92dc
Fixed crash at shutdown with new hashtable code
2025-02-17 08:14:30 -08:00
Sam Lantinga
1754943596
Fixed camera frame acquisition on Windows 7
...
Fixes https://github.com/libsdl-org/SDL/issues/12210
2025-02-16 08:13:35 -08:00
Sam Lantinga
e3d9f1172c
Remove the reference to the thread when it is detached
...
Fixes https://github.com/libsdl-org/SDL/issues/12301
2025-02-16 07:56:30 -08:00
Sam Lantinga
fd4e6d2949
Don't render 0 sized texture rectangles
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/355
2025-02-15 07:07:56 -08:00
Sam Lantinga
5b98c4a524
Fixed motion events with TOOL_TYPE_UNKNOWN
...
This happens using hand tracking on a VR headset, and should be treated like normal touch interaction.
2025-02-14 11:50:43 -08:00
Sam Lantinga
3de975884a
Document the "trace" log priority
2025-02-12 21:37:30 -08:00
Sam Lantinga
b9d018f2a2
Fixed wayland cursor use-after-free at shutdown
2025-02-12 20:47:31 -08:00
Sam Lantinga
d2b7a84651
Fixed SDL_GetNumGamepadTouchpads() returning 1 for a NULL gamepad
2025-02-12 13:08:41 -08:00
Sam Lantinga
ca29304ce1
Fixed continually resetting keyboard and mouse readings
2025-02-12 13:02:15 -08:00
Sam Lantinga
f67c644649
Fixed reporting hat positions for GameInput controllers
2025-02-12 13:02:15 -08:00
Sam Lantinga
1b35ca9c32
Refactored GameInput initialization
2025-02-12 13:02:15 -08:00
Sam Lantinga
715c18739b
Added an internal hint "SDL_VIDEO_X11_XINPUT2" for sdl2-compat
2025-02-11 15:11:33 -08:00
Sam Lantinga
ce69e98989
Copy SDL2_SYSWMEVENT data into temporary memory for the event
2025-02-11 15:11:33 -08:00
Sam Lantinga
99cf16287a
Fixed the name of SDL_SYSWMEVENT
2025-02-11 09:48:40 -08:00
Sam Lantinga
6c37971521
Removed the mapping for the Sanwa Supply JY-P76USV
...
It turns out the mapping we include doesn't work for real controllers, and they're using a generic chipset and generic name and can't be generally distinguished from other controllers.
See https://github.com/libsdl-org/SDL/issues/8644 for details.
2025-02-11 07:59:25 -08:00
Sam Lantinga
0bce19cf15
The 10-bit texture formats have alpha on Direct3D
...
A similar change was made for Vulkan in https://github.com/libsdl-org/SDL/commit/a036aeda3b27ce7e115ebf25e717adf0bdabe91e
2025-02-10 19:45:02 -08:00
Sam Lantinga
3cfa476d3f
Added support for SDL_PIXELFORMAT_ABGR8888 textures
...
This is the output format of stb_image for image decoding, so let's avoid a texture format conversion where possible.
Also standardized SDL_PIXELFORMAT_ARGB8888 as the default texture format for all renderers.
2025-02-10 19:45:02 -08:00
Sam Lantinga
5ccee77190
testcamera: added support for Motion JPEG camera frames
2025-02-10 17:18:16 -08:00
Sam Lantinga
cf41ccc6ce
Removed stb_image.h from SDL
...
This adds quite a bit of code size to SDL for a niche use-case. This is easily handled in the application instead.
2025-02-10 17:18:16 -08:00
Sam Lantinga
9308404e9a
Removed functions not used by SDL
2025-02-10 17:18:16 -08:00
Sam Lantinga
5e31bbf05e
Remove functions not used when STBI_NO_PNG and STBI_NO_HDR are defined
2025-02-10 17:18:16 -08:00
Sam Lantinga
84b0c13c44
Added support for Motion JPEG camera capture
...
Fixes https://github.com/libsdl-org/SDL/issues/12183
2025-02-10 17:18:16 -08:00
Sam Lantinga
0bc1f87120
Added SDL_PROP_SURFACE_HOTSPOT_X_NUMBER and SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER
2025-02-10 12:15:03 -08:00
Sam Lantinga
ecd089bb69
Don't return short waits from SDL_IOReady()
...
The Wayland keyboard repeat code assumes that if we have a certain timeout then we'll wait at least that long, and generate a key repeat event on timeout. If we wait a shorter time, we won't generate a key repeat event and then return 0, even if we were supposed to wait indefinitely.
Fixes https://github.com/libsdl-org/SDL/issues/12239
2025-02-10 10:29:30 -08:00
Sam Lantinga
f6126e9ea1
Centered joystick axis values should be 0
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/338
2025-02-10 08:36:00 -08:00
Sam Lantinga
982094c85c
Updated to version 3.2.5 for development
2025-02-06 16:40:59 -08:00
Sam Lantinga
b5c3eab6b4
Updated to version 3.2.4 for release
2025-02-06 16:03:43 -08:00
Sam Lantinga
48c00bfe6c
Fixed creating a window with both software and hardware renderer attached
2025-02-06 15:35:38 -08:00
Sam Lantinga
ad8429f1b0
Let the renderer always see window events
...
These are necessary for proper operation of the renderer and shouldn't be blocked by event filters, etc.
2025-02-06 14:38:20 -08:00
Sam Lantinga
c59ac249d2
Revert "wayland: Don't send size events while the window is hidden"
...
This reverts commit 0825d07a43 .
It turns out that resizing while hidden is fine, the real problem in https://github.com/libsdl-org/sdl2-compat/issues/268 is that SDL2 did not send an initial resize event and SDL3 does, which we're fixing in a better way in sdl2-compat.
2025-02-06 14:37:53 -08:00