Commit Graph
100 Commits
Author SHA1 Message Date
Sam Lantinga d0926d380e Added SDL_hidapi_steam_triton.c to the GDK Visual Studio project 2025-11-12 11:54:48 -08:00
Sam Lantinga 379c47cc75 Revert "Fix lost KEY_UP events with multiple keyboards using shared scancode state (#14446)"
This reverts commit 3dab15d3b4.

With this commit any repeated key will be reported as held down indefinitely.
2025-11-12 11:51:34 -08:00
Sam Lantinga 0c5f7f6a33 unix: Unref SDL_gtk context on quit 2025-11-12 11:42:02 -08:00
Sam Lantinga e1af623631 Fixed Steam Deck sensor timings 2025-11-12 11:36:37 -08:00
Sam Lantinga 1998b65045 Added support for the new Steam Controller 2025-11-12 11:32:32 -08:00
Sam Lantinga 65989d269e Updated SDL_GPUVulkanOptions documentation 2025-11-11 20:49:14 -08:00
Sam Lantinga 5bed8ec603 Implemented render batching for D3D9 2025-11-11 08:31:37 -08:00
Sam Lantinga 6b07e13fef Fixed spacing 2025-11-10 18:30:59 -08:00
Sam Lantinga fffaf122df Added temporary workaround for failing Emscripten test 2025-11-10 18:30:02 -08:00
Sam Lantinga dde7fa3b17 Validate the output colorspace before setting up a renderer 2025-11-10 18:30:02 -08:00
Sam Lantinga 6baaa0fe87 Destroy the window surface if a software renderer couldn't be created 2025-11-10 18:30:02 -08:00
Sam Lantinga 6a7fb838f4 Return false if we couldn't update the emscripten framebuffer 2025-11-10 18:30:02 -08:00
Sam Lantinga eccd5c03c3 testautomation: added tests to cover linear <-> sRGB colorspace conversion 2025-11-10 18:30:02 -08:00
Sam Lantinga 33c70af2f8 Fixed SDL_COLORSPACE_SRGB_LINEAR being used for RGBA32 textures 2025-11-10 18:30:02 -08:00
Sam Lantinga 1c77304ee9 Fixed getting an 8-bit window surface on Apple platforms
The Metal renderer doesn't support XRGB texture formats, so we ended up matching SDL_PIXELFORMAT_INDEX8 for the window surface.
2025-11-10 18:30:02 -08:00
Sam Lantinga ff890d1733 Fixed crash blitting to an 8-bit surface with no palette 2025-11-10 18:30:02 -08:00
Sam Lantinga 6389f4db4c SDL_FindColor() can be static 2025-11-10 18:30:02 -08:00
Sam Lantinga ead02b08dd Skip tonemapping for render targets with unspecified HDR headroom 2025-11-10 18:30:02 -08:00
Sam Lantinga 4e5ba722fd Change the batch if the color scale changes
The color scale is a shader constant so it can be applied in linear space
2025-11-10 18:30:02 -08:00
Sam Lantinga d29f368ca8 Change the batch if the GPU render state changes 2025-11-10 18:30:02 -08:00
Sam Lantinga 3399bc600e gpu renderer: add color to the point/line vertex data
This allows us to batch color changes in a single draw call
2025-11-10 18:30:02 -08:00
Sam Lantinga 97ebfbf7a0 Only convert color to linear once in VULKAN_QueueDrawPoints() 2025-11-10 18:30:02 -08:00
Sam Lantinga d9be8b9a00 Implemented render batching for D3D11, D3D12, Metal, and Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/7534
2025-11-10 18:30:02 -08:00
Sam Lantinga a96664674f Fixed windows events on 32-bit Windows
When running on 32-bit Windows, DefWindowProc resolves to a function in ntdll.dll, but after the window is created the actual window proc is a function in user32.dll. We solve this by using our own custom default window proc and looking for that instead.

Fixes https://github.com/libsdl-org/SDL/issues/1442
2025-11-09 07:44:45 -08:00
Sam Lantinga 704ac98d3f Make sure the blit mapping is cleared when undoing RLE encoding
This fixes a crash if a surface is RLE encoded, then locked and unlocked.

We also mark the surface as no longer needing to be locked after undoing RLE encoding
2025-11-08 15:38:47 -08:00
Sam Lantinga 089dc86bcf Lazily redo RLE encoding
Also stop lying about the RLE encoding state, which causes crashes if we do RLE blit operations while the surface is locked.
2025-11-08 14:51:27 -08:00
Sam Lantinga cc2a272d6f Enable RLE more often in the software renderer
We don't need to aggressively disable RLE acceleration anymore because the original pixels remain available for operations that aren't supported by the RLE blitter.
2025-11-08 14:51:27 -08:00
Sam Lantinga ac0edbe9d2 Just assert that RLE encoding isn't active
We undo RLE encoding in the calling code, so we shouldn't need to do anything here.
2025-11-08 14:51:27 -08:00
Sam Lantinga 2b365983db Save the original pixels when RLE encoding is enabled
Trying to reconstruct the original image when undoing RLE encoding was never completely accurate.

Fixes https://github.com/libsdl-org/SDL/issues/14424
2025-11-08 12:56:25 -08:00
Sam Lantinga 78152d13ee Added SDL_ConvertSurfaceRect() for internal use 2025-11-08 12:56:25 -08:00
Sam Lantinga d145e78cd6 Improved performance scaling 8-bit surfaces 2025-11-08 12:56:25 -08:00
Sam Lantinga 01d359c1df Don't create a larger surface than we need when scaling 2025-11-08 12:56:25 -08:00
Sam Lantinga 7d628ef76c Fixed scaling YUV surfaces 2025-11-08 12:56:25 -08:00
Sam Lantinga 7553d5892e Fixed software renderer 8-bit scaling and rotation (thanks @jroatch!)
Fixes https://github.com/libsdl-org/SDL/issues/14422
2025-11-08 08:46:58 -08:00
Sam Lantinga 1fb663b429 Make sure that SDL_PIXELFORMAT_ARGB8888 is the first texture format for OpenGL
Fixes https://github.com/libsdl-org/SDL/issues/1440
2025-11-07 11:13:50 -08:00
Sam Lantinga 3489a45216 Use srcpixel now that we've set it 2025-11-07 11:12:10 -08:00
Sam Lantinga 294beceec7 Fixed error: 'srcpixel' may be used uninitialized 2025-11-07 11:11:31 -08:00
Sam Lantinga 0f21e46586 Added support for SDL_PIXELFORMAT_INDEX8 to SDL_BlitTriangle_Slow()
Fixes https://github.com/libsdl-org/SDL/issues/14419
2025-11-07 11:01:23 -08:00
Sam Lantinga 547b2a2e37 SDL_SetSurfaceRLE() has a boolean parameter 2025-11-07 11:01:23 -08:00
Sam Lantinga 9a19cc8323 Fixed unaligned load in Xbox HIDAPI driver 2025-11-07 10:37:58 -08:00
Sam Lantinga 118dcf27ce Added D mode mappings for the 8BitDo 64 Bluetooth Controller
The HID descriptor maps the C buttons as a right thumbstick, but this mapping matches the HIDAPI Nintendo 64 mapping.

The start button resets the controller in both USB and Bluetooth mode on macOS, but I've kept the mapping assuming this is a macOS bug that will be fixed.
2025-11-07 10:18:49 -08:00
Sam Lantinga 9ff737efbd Updated the Nintendo Switch N64 controller mapping
This mapping matches the Linux kernel default mapping.
2025-11-07 10:18:49 -08:00
Sam Lantinga f211a3bb69 Fixed initial rumble on the 8BitDo 64 Bluetooth Controller 2025-11-07 10:18:49 -08:00
Sam Lantinga a2ed1a4197 Fixed blitting bitmaps with a non-zero x offset
Also added basic testautomation coverage of bitmap blits

Fixes https://github.com/libsdl-org/sdl2-compat/issues/546
2025-11-06 22:47:50 -08:00
Sam Lantinga 2a873be9cd Return false from SDL_SetWindowMouseRect() if it's not supported 2025-11-06 11:59:47 -08:00
Sam Lantinga 599bd1a6aa Fixed building if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO isn't defined 2025-11-06 11:30:59 -08:00
Sam Lantinga e24eeefbd1 The default render texture format is SDL_PIXELFORMAT_ARGB8888
We do this for consistency across backends
2025-11-06 09:46:43 -08:00
Sam Lantinga ca072c9fc6 Don't do anything if the window mouse rect hasn't changed 2025-11-06 09:18:58 -08:00
Sam Lantinga c94da8977d Validate SPI read command in the Nintendo Switch HIDAPI driver 2025-11-05 17:34:22 -08:00
Sam Lantinga 9a1745f2c8 Fixed unaligned access in the Nintendo Switch HIDAPI driver 2025-11-05 17:08:22 -08:00
Sam Lantinga 49134ecf25 Pass the error through from the SetRelativeMouseMode() implementation 2025-11-03 13:07:17 -08:00
Sam Lantinga 05887f2087 Return false from SDL_SetWindowRelativeMouseMode() if relative mode isn't available
Fixes https://github.com/libsdl-org/SDL/issues/14388
2025-11-03 13:01:41 -08:00
Sam Lantinga eedc0b19fd Fixed build warning when X11 XInput isn't available 2025-11-03 13:01:41 -08:00
Sam Lantinga 4560fae07e Fail configuration if X11 dependency packages aren't available
It happens fairly often that people enable X11 support but don't install the extension libraries that SDL depends on. This makes those required if not explicitly disabled, which should help prevent accidentally broken builds.
2025-11-03 13:01:41 -08:00
Sam Lantinga a6351ac474 Added libxtst-dev to Linux CI build dependencies 2025-11-03 13:01:41 -08:00
Sam Lantinga ea8e66ccd1 Don't use getpagesize() on Windows
Fixes https://github.com/libsdl-org/SDL/issues/14328
2025-11-03 08:36:29 -08:00
Sam Lantinga 6493be9eea Removed SDL_AUTO_ENABLE_ENHANCED_FLYDIGI 2025-11-03 08:20:41 -08:00
Sam Lantinga 97e2951875 Removed redundant wait at shutdown in the ALSA audio driver 2025-11-02 18:30:12 -08:00
Sam Lantinga 4db63e323e Save a copy of the D3D12 semantic string
Fixes https://github.com/libsdl-org/SDL/issues/14383
2025-11-02 16:16:20 -08:00
Sam Lantinga 0882623092 Clamp the audio drain delay to 100 ms
Fixes https://github.com/libsdl-org/SDL/issues/9829
2025-11-02 11:15:25 -08:00
Sam Lantinga 889e4787d6 Clarify when we want to auto-enable Apex 5 enhanced functionality 2025-11-02 11:14:41 -08:00
Sam Lantinga 3336aa95f1 Fixed the paddle mapping for Steam Controllers
Fixes https://github.com/libsdl-org/SDL/issues/14380
2025-11-02 10:06:49 -08:00
Sam Lantinga b695e5c24b Fixed whitespace 2025-11-02 09:31:55 -08:00
Sam Lantinga eb87a36940 Fixed the right touchpad calculation for the BLE Steam Controller
Fixes https://github.com/libsdl-org/SDL/issues/14368
2025-11-02 08:31:37 -08:00
Sam Lantinga 6c4f2bd83d Use DefWindowProc for the initial SDL window proc
This makes sure that anything that hooks window creation to set up window proc hooks will call DefWindowProc instead of infinitely recursing when we set up our window proc afterwards.

Fixes https://github.com/libsdl-org/SDL/issues/10529
2025-11-02 07:23:29 -08:00
Sam Lantinga a82e8a701d Allow dynamically switching mode of the Apex 5 controller
The controller can be in XInput mode or enhanced mode, so it will always show up as an XInput controller, and the enhanced mode controller will come and go as enhanced mode is enabled or disabled in the FlyDigi Space Station app.
2025-11-01 14:49:31 -07:00
Sam Lantinga 28849fd789 Manually enable acquiring the Apex 5 controller if necessary
The FlyDigi Space Station app isn't available on non-Windows platforms, so we need to manually enable acquiring the controller on those platforms.
2025-11-01 14:49:31 -07:00
Sam Lantinga 524739900a Fixed potential double-free when creating a renderer (thanks @Sackzement!)
Closes https://github.com/libsdl-org/SDL/pull/14371
2025-11-01 11:24:14 -07:00
Sam Lantinga aafbf7183f Copy shader params instead of caching a pointer to them
It's possible for a new texture to be allocated with the same address as a previous one, so we can't just cache the pointer value.

Fixes https://github.com/libsdl-org/SDL/issues/14369
2025-11-01 11:24:14 -07:00
Sam Lantinga de5d8616bf Updated SDL tests XCode project 2025-10-31 10:34:42 -07:00
Sam Lantinga d97e8bd49b Removed SDL_uikitwindow
This was only needed as a workaround for buggy behavior in iOS 8
2025-10-31 10:34:42 -07:00
Sam Lantinga b46e26e65a Added support for the UIScene life cycle on Apple platforms
Fixes https://github.com/libsdl-org/SDL/issues/12680
2025-10-31 10:34:42 -07:00
Sam Lantinga b6f67dd2b2 tests: add a template Info.plist that uses the whole screen
The OS uses the presence of the UILaunchScreen key to determine whether to display the application in compatibility mode or display using the whole screen.
2025-10-31 10:34:42 -07:00
Sam Lantinga 09f00e397c testsymbols: include SDL_main.h 2025-10-31 10:34:42 -07:00
Sam Lantinga 446fb65ca6 Mark the Apex 5 controller as being acquired by SDL 2025-10-30 22:35:06 -07:00
Sam Lantinga 1502c2fd8b Added support for the Flydigi Apex 5 controller (#14218) 2025-10-30 21:20:44 -07:00
Sam Lantinga 2f5279eb01 Clarify SDL_ConvertEventToRenderCoordinates() documentation
Fixes https://github.com/libsdl-org/SDL/issues/14360
2025-10-30 09:00:14 -07:00
Sam Lantinga c21b7f8cb8 Check to see if joysticks are actually initialized in SDL_UpdateJoysticks()
Fixes https://github.com/libsdl-org/SDL/issues/14362
2025-10-30 08:53:57 -07:00
Sam Lantinga a7147f327f Temporarily disable WASAPI device roles
Setting AudioCategory_GameChat breaks audio on several devices, including Behringer U-PHORIA UM2 and RODE NT-USB Mini. We'll disable this for now until we understand more about what's happening.
2025-10-30 07:27:23 -07:00
Sam Lantinga d9ca0457b5 Make sure we don't allocate a TLS ID clobbering an application defined one
Fixes https://github.com/libsdl-org/SDL/issues/14359
2025-10-29 14:05:49 -07:00
Sam Lantinga b3612f6462 testautomation: fixed RLE operation test on big endian systems
Fixes https://github.com/libsdl-org/SDL/issues/14348
2025-10-29 16:26:31 +00:00
Sam Lantinga 8b8c51573b Disabled incorrect 16-bit Altivec blitters 2025-10-29 16:11:25 +00:00
Sam Lantinga 84fac6ca44 testautomation: verify that RLE operation output is correct 2025-10-29 09:07:56 -07:00
Sam Lantinga bf0752a8d7 Fixed converting RLE encoded surfaces to other formats 2025-10-29 09:06:25 -07:00
Sam Lantinga c4cef905ae Updated internal documentation 2025-10-29 08:39:56 -07:00
Sam Lantinga cecf4b0d4e Fixed the right shoulder button on the 8BitDo Pro 3 2025-10-28 14:55:06 -07:00
Sam Lantinga 78f9cb44c3 Added a Linux mapping for the 8BitDo Pro 3 2025-10-28 14:13:40 -07:00
Sam Lantinga 2d14a237dc Fixed trying to grab the mouse when losing keyboard focus
Fixes https://github.com/libsdl-org/SDL/issues/14350
2025-10-28 07:15:43 -07:00
Sam Lantinga 933beeb18b Fixed warning: no previous extern declaration for non-static variable 2025-10-27 17:52:05 -07:00
Sam Lantinga 965ac7f406 Fixed warning: implicit conversion loses integer precision: 'long' to 'int' 2025-10-27 17:49:49 -07:00
Sam Lantinga 90242312fe Restored the original OpenBSD Xbox 360 controller mapping 2025-10-27 17:39:29 -07:00
Sam Lantinga b305534edc Completed removing predefined Xbox 360 mappings for Linux
Also removed them for OpenBSD, since it's not clear which ones, if any, are needed.
2025-10-27 17:34:23 -07:00
Sam Lantinga be1d44279c Fixed error: incompatible function pointer types passing
SDL/src/sensor/emscripten/SDL_emscriptensensor.c:80:5: error: incompatible function pointer types passing
      'int (*)(int, const EmscriptenDeviceMotionEvent *, void *)' (aka 'int (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') to parameter of type 'em_devicemotion_callback_func' (aka
      'bool (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') [-Wincompatible-function-pointer-types]
   80 |     emscripten_set_devicemotion_callback((void *)0, false, &SDL_EMSCRIPTEN_SensorCallback);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-10-27 10:13:57 -07:00
Sam Lantinga f5966890b0 Added a note that SDL_LoadPNG() is designed for trusted images
Fixes https://github.com/libsdl-org/SDL/issues/14338
2025-10-27 08:38:00 -07:00
Sam Lantinga 01aa1882f8 Added a patch note for SDL_ELF_NOTE_DLOPEN
Fixes https://github.com/libsdl-org/SDL/issues/14337
2025-10-27 08:28:05 -07:00
Sam Lantinga 0ea20a5f86 Fix NULL pointer dereference in SDL_RenderGeometryRaw with NPOT textures (thanks @bleeqer!)
Fixes https://github.com/libsdl-org/SDL/issues/14329
Closes https://github.com/libsdl-org/SDL/pull/14331
2025-10-26 08:10:52 -07:00
Sam Lantinga e08edab180 Log object leaks at debug level
End users don't care about this. Developers can enable debug logs, run with DEBUG_INVOCATION=1, or use other leak checking tools to detect these.
2025-10-25 15:13:37 -07:00
Sam Lantinga ffd0ca4391 Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized.

Fixes https://github.com/libsdl-org/sdl12-compat/issues/365
2025-10-25 13:48:48 -07:00
Sam Lantinga 51b401d418 Fixed OTP text entry on iOS (thanks @pipiwoaini!)
Fixes https://github.com/libsdl-org/SDL/issues/13717
2025-10-24 11:02:37 -07:00
Sam Lantinga 1506c40ec8 Fixed line endings in FindLibUSB.cmake 2025-10-24 10:48:25 -07:00