Sam Lantinga
e28974124a
Added mappings for the NSO N64/SEGA/SNES controllers
...
These are used on Linux when the HIDAPI driver isn't available.
2025-03-25 14:46:03 -07:00
Sam Lantinga
b88200b797
Fixed face buttons for the NSO SNES controller under the HIDAPI driver
2025-03-25 14:46:03 -07:00
Sam Lantinga
f355c7f217
Allow the progress API to be used on all platforms
...
It's visually only hooked up on Windows for now, but the API will be internally consistent on all platforms.
2025-03-25 11:24:22 -07:00
Sam Lantinga
d6f137b2be
Added a note to tag the wiki when doing feature releases
...
Fixes https://github.com/libsdl-org/SDL/issues/12618
2025-03-24 11:45:20 -07:00
Sam Lantinga
b6ca03611f
Fixed mixed trigger and body rumble for Xbox controllers on Windows
...
Fixes https://github.com/libsdl-org/SDL/issues/12095
2025-03-24 11:06:37 -07:00
Sam Lantinga
69ad66b017
Fixed error messages in GetTaskbarList()
2025-03-23 07:58:03 -07:00
Sam Lantinga
6b13d69105
Improve move/resize visual smoothness on Windows
...
Fixes https://github.com/libsdl-org/SDL/issues/12528
2025-03-21 16:46:25 -07:00
Sam Lantinga
2fbb583290
SDL_ClaimWindowForGPUDevice() should fail for transparent windows
...
The GPU API doesn't currently support transparent windows (transparent swapchain effects doesn't seem possible on D3D12) so we should explicitly fail so users don't expect transparency and then not get it.
Fixes https://github.com/libsdl-org/SDL/issues/12410
2025-03-21 12:14:20 -07:00
Sam Lantinga
fbdb637978
Fixed build when virtual joysticks are disabled
2025-03-21 07:34:57 -07:00
Sam Lantinga
758eb256b9
Fixed DebugLogRenderCommands() output
2025-03-20 21:24:39 -07:00
Sam Lantinga
4ceb02434b
We need to rebind D3D12 resources after updating them
...
Fixes https://github.com/libsdl-org/SDL/issues/12544
2025-03-20 20:22:00 -07:00
Sam Lantinga
3538abfb82
Revert "Don't update a texture twice in the same batch on D3D12"
...
This reverts commit 0681d08817 .
There's a simpler fix for this.
2025-03-20 19:56:59 -07:00
Sam Lantinga
0681d08817
Don't update a texture twice in the same batch on D3D12
...
Fixes https://github.com/libsdl-org/SDL/issues/12544
2025-03-20 19:51:56 -07:00
Sam Lantinga
3fd61b0535
Updated for SDL style
2025-03-20 16:42:40 -07:00
Sam Lantinga
03a53ce0d1
Always show the on-screen keyboard on Steam Deck
...
Steam will eventually have smarts about whether a keyboard is active and will igore the request appropriately.
Fixes https://github.com/libsdl-org/SDL/issues/12595
2025-03-20 16:19:50 -07:00
Sam Lantinga
8caeaaacdd
A Steam Controller might be generating keyboard input
...
We can't use keyboard input as a signal about whether a keyboard is attached. There might be keyboard input from any number of generated inputs or non-keyboard devices.
2025-03-20 16:19:50 -07:00
Sam Lantinga
cbb83be895
Show the on-screen keyboard if we don't have active keyboard input
...
Active keyboard input is based on the input the user has most recently sent.
Fixes https://github.com/libsdl-org/SDL/issues/12595
2025-03-20 16:19:50 -07:00
Sam Lantinga
3ed61f203e
Fixed applications that integrate Qt with SDL joystick support
2025-03-20 12:16:44 -07:00
Sam Lantinga
fe024b8fe3
Fixed typo in build.gradle
2025-03-20 11:22:03 -07:00
Sam Lantinga
10fae8c34b
Fixed Android build warnings
2025-03-20 11:02:33 -07:00
Sam Lantinga
bf7b9b020e
Fixed gradle deprecation warnings
...
"Space-assignment syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0"
2025-03-20 11:02:04 -07:00
Sam Lantinga
ac28702504
Use the android-21 SDK as documented in README-android.md
2025-03-20 10:47:43 -07:00
Sam Lantinga
476e7e54cb
Don't create surfaces with invalid pixel formats
...
Fixes https://github.com/libsdl-org/SDL/issues/12556
2025-03-20 09:42:52 -07:00
Sam Lantinga
f2ed5c7a1b
Fix illegal calls to DwmGetWindowAttribute()
...
DWMWA_WINDOW_CORNER_PREFERENCE and DWMWA_BORDER_COLOR are only supported for DwmSetWindowAttribute(), they can't be queried.
Fixes https://github.com/libsdl-org/SDL/issues/12206
Closes https://github.com/libsdl-org/SDL/pull/12209
2025-03-19 22:00:42 -07:00
Sam Lantinga
96bf12444c
Windows allows windows to be resized to zero height.
...
Changed the window client rect validation to take this into account.
Fixes https://github.com/libsdl-org/SDL/issues/9796
2025-03-19 21:16:35 -07:00
Sam Lantinga
47b0c75470
Make sure we're getting called for the correct window
...
Fixes https://github.com/libsdl-org/SDL/issues/12525
2025-03-19 20:20:36 -07:00
Sam Lantinga
3415bc920a
Fixed crash if a window couldn't be created on Windows
...
Fixes https://github.com/libsdl-org/SDL/issues/11482
2025-03-19 20:10:24 -07:00
Sam Lantinga
8b924df48b
Use an autoreleasepool in Cocoa_GetDisplayUsableBounds()
...
Fixes https://github.com/libsdl-org/SDL/issues/12571
2025-03-18 14:36:48 -07:00
Sam Lantinga
82335fd0e9
Fixed building with SDL_LEAN_AND_MEAN
...
Fixes https://github.com/libsdl-org/SDL/issues/12578
2025-03-18 09:55:23 -07:00
Sam Lantinga
5985f0a327
Fixed infinite recursion in SDL_IsGamepad()
...
SDL_IsGamepad() calls SDL_GetJoystickTypeForID(), which will call SDL_IsGamepad() if it's not a known controller type. The new code which is breaking was added to prevent Logitech FFB wheels from showing up as gamepads, which we check for separately.
2025-03-17 19:10:26 -07:00
Sam Lantinga
4fc9509ab7
Fixed raw input device GUIDs changing randomly between runs
...
On Windows 11, apparently HidD_GetManufacturerString() and HidD_GetProductString() can return TRUE without actually filling in any string data.
Fixes https://github.com/libsdl-org/SDL/issues/12566
2025-03-17 13:54:56 -07:00
Sam Lantinga
715301cef5
Fixed crash if info->path is NULL
2025-03-17 09:46:41 -07:00
Sam Lantinga
501e71f25f
Added unaligned version of SDL_ConvertPixels_SwapNV_std()
...
Fixes https://github.com/libsdl-org/SDL/issues/12546
2025-03-15 09:24:25 -07:00
Sam Lantinga
ad9f9af4ed
Removed accidentally enabled debug code
2025-03-15 09:17:55 -07:00
Sam Lantinga
efe122be4d
Removed width/height parameters from LoadTexture()
...
You can directly access the texture width and height now.
2025-03-14 11:38:13 -07:00
Sam Lantinga
dcb97a5f49
Set a default shader entry point
...
The default should be the entrypoint generated by SDL_shadercross. That way it doesn't need to be hand-specified in the common workflow.
2025-03-14 11:38:13 -07:00
Sam Lantinga
ffe69fc354
Fixed SDL_GPUTextureSupportsSampleCount() documentation
...
Fixes https://github.com/libsdl-org/sdlwiki/issues/751
2025-03-14 09:30:19 -07:00
Sam Lantinga
02faa8f75c
Rename SDL_SetGPURenderStateFragmentUniformData() to SDL_SetGPURenderStateFragmentUniforms()
2025-03-14 09:26:30 -07:00
Sam Lantinga
96194347bc
Added an example of fullscreen shader effects with the GPU renderer
2025-03-14 09:26:30 -07:00
Sam Lantinga
2aee105b43
Added support for custom shaders with the GPU renderer
...
Added an example of MSDF font rendering with the SDL 2D renderer
2025-03-14 09:26:30 -07:00
Sam Lantinga
1ae4ef65e6
Fixed incorrect assert
2025-03-13 22:37:08 -07:00
Sam Lantinga
3e9e22f17d
Added SDL_SCALEMODE_PIXELART
...
This is based on the algorithm presented by t3ssel8r:
https://www.youtube.com/watch?v=d6tp43wZqps
2025-03-13 09:48:37 -07:00
Sam Lantinga
853375da61
Removed texture_size from the GPU renderer vertex shader
...
This isn't used anywhere, and this saves a UV multiply and divide
2025-03-13 09:48:37 -07:00
Sam Lantinga
28ec461ebf
Organize the GPU renderer draw code
2025-03-13 09:48:37 -07:00
Sam Lantinga
af0420d898
Switched GPU renderer shaders to shadercross and HLSL
2025-03-13 09:48:37 -07:00
Sam Lantinga
5e951a230e
windows: Fix WIN_SetWindowAlwaysOnTop causing owner window z-order changes when child windows are created or change top-level status
...
- WIN_SetWindowAlwaysOnTop is always called as part of window creation (normally setting HWND_NOTOPMOST) which also set the z-order for the parent
window when child windows are created. Since HWND_NOTOPMOST is above all non-topmost windows this had the effect of reordering but not focusing
the parent window.
2025-03-12 13:06:31 -07:00
Sam Lantinga
50a397bb45
Removed help for obsolete (and removed) command line option
2025-03-12 12:38:34 -07:00
Sam Lantinga
3235a4eb4f
Initialize the padding of aligned allocations to zero
...
Fixes valgrind uninitialized memory errors when doing SIMD blits
e.g. testautomation --filter surface_testScale
2025-03-12 11:42:02 -07:00
Sam Lantinga
2ce3dfdf1d
Fixed Nintendo controller face button layout under Steam
2025-03-10 17:25:01 -07:00
Sam Lantinga
be6ed6e9c4
Fixed sscanf("026", "%1x%1x%1x", &r, &g, &b)
...
Fixes https://github.com/libsdl-org/SDL/issues/12510
2025-03-10 14:45:08 -07:00
Sam Lantinga
24339524c5
Use sized types when fixing undefined behavior
2025-03-10 09:12:40 -07:00
Sam Lantinga
99336ea378
Fixed memory leak in memory leak tracking
2025-03-08 09:18:25 -08:00
Sam Lantinga
3353b92a96
Fixed pen events on iOS after reinitializing SDL
...
We weren't resetting apple_pencil_id, so not re-registering it later.
2025-03-07 16:32:53 -08:00
Sam Lantinga
d631a3add0
Add a link to docs/INTRO-mingw.md
2025-03-06 16:25:17 -08:00
Sam Lantinga
b99ff00a95
Removed logic forcing vsync on if setting it off fails
...
The platforms that needed this (Windows Phone and Windows RT) are no longer supported, and if this is needed in the future it should be done at the renderer level, not here.
Fixes https://github.com/libsdl-org/SDL/issues/12475
2025-03-06 16:18:02 -08:00
Sam Lantinga
e20e27e1fb
Added SIMD blitters for 8888 -> 8888 format conversion
2025-03-06 02:14:54 -08:00
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