Commit Graph
100 Commits
Author SHA1 Message Date
Sam Lantinga f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
Sam Lantinga 3197e27b59 testcamera: fixed return codes 2024-12-31 19:27:11 -08:00
Sam Lantinga f18e023317 Added testclipboard 2024-12-31 19:27:11 -08:00
Sam Lantinga 54d4e48539 Get the initial clipboard state at startup 2024-12-31 19:27:11 -08:00
Sam Lantinga 6575b8157b Synchronize clipboard mime types with external clipboard updates
Fixes https://github.com/libsdl-org/SDL/issues/8338
Fixes https://github.com/libsdl-org/SDL/issues/9587
2024-12-31 19:27:11 -08:00
Sam Lantinga 30a22d3fed Allow a NULL size parameter to retrieve null terminated text 2024-12-31 19:27:11 -08:00
Sam Lantinga d666c2d189 Use a consistent error message when video isn't initialized 2024-12-31 19:27:11 -08:00
Sam Lantinga 196e2c6662 Fixed crash if num_mime_types is NULL 2024-12-31 19:27:11 -08:00
Sam Lantinga b902b0527b Renamed n_mime_types to num_mime_types 2024-12-31 19:27:11 -08:00
Sam Lantinga a767952617 Fixed spacing 2024-12-31 19:27:11 -08:00
Sam Lantinga 54c555e394 Send supported mime types for external clipboard contents on Windows 2024-12-31 19:27:11 -08:00
Sam Lantinga 8b155708ff Fixed clipboard memory leak on shutdown 2024-12-31 19:27:11 -08:00
Sam Lantinga 1c04ebe423 Renamed SDL_ASYNCIO_CANCELLED to SDL_ASYNCIO_CANCELED 2024-12-30 19:13:02 -08:00
Sam Lantinga d4d5faedab Added SDL_EVENT_FINGER_CANCELED
Fixes https://github.com/libsdl-org/SDL/issues/10528
2024-12-30 19:13:02 -08:00
Sam Lantinga 8704ab8422 Wait for a display resize event before sending orientation changes
Fixes https://github.com/libsdl-org/SDL/issues/9585
2024-12-30 15:49:10 -08:00
Sam Lantinga 60deaf5f0f Send display mode change events when the orientation changes 2024-12-30 15:24:38 -08:00
Sam Lantinga 5340f2e3fe Updated to the latest version of gradle, with support for Android SDK 35 2024-12-30 13:13:52 -08:00
Sam Lantinga e91c37f4dd Added support for inset handling on Android 15 2024-12-30 12:23:00 -08:00
Sam Lantinga 0410328b15 Fixed warning: ordered comparison of pointer with integer zero 2024-12-29 12:05:34 -08:00
Sam Lantinga 5c84d38822 testcamera: don't pick a frame size larger than the maximum texture size
Ran into this on a Huawei Y6 phone, where the back facing camera can generate 4160x2000 frames, but the maximum texture size was 4096x4096
2024-12-29 09:41:00 -08:00
Sam Lantinga 6e1177ac03 Include tray function prototypes 2024-12-29 08:15:30 -08:00
Sam Lantinga c714b1a38b Fixed public header inclusion in the Xcode project 2024-12-28 08:47:00 -08:00
Sam Lantinga ec29d3fd66 Define NDEBUG in release Xcode builds 2024-12-28 08:25:09 -08:00
Sam Lantinga 92b7054870 Add SDL_tray.h to the public framework headers
Fixes https://github.com/libsdl-org/SDL/issues/11760
2024-12-28 08:15:19 -08:00
Sam Lantinga 9a4d29699d Don't use connection state from the Nintendo Switch Pro report
This isn't reliable for third party controllers like the 8BitDo Pro 2.

Fixes https://github.com/libsdl-org/SDL/issues/10862
2024-12-27 13:58:49 -08:00
Sam Lantinga 75a24116b5 testcontroller: show gamepad connection state 2024-12-27 13:58:49 -08:00
Sam Lantinga 22f6eed1d9 Use the NVIDIA Shield home button as the guide button 2024-12-27 12:42:06 -08:00
Sam Lantinga c148837546 Added a Bluetooth mapping for the NVIDIA Shield Controller on Linux 2024-12-27 12:18:08 -08:00
Sam Lantinga 82a1e9f6df Fixed the guide button for the NVIDIA Shield Controller on Linux
This works with firmware v1.25 and v1.35
2024-12-27 12:17:51 -08:00
Sam Lantinga 622c3ebb94 Updated Xcode project with new tray files 2024-12-27 09:24:49 -08:00
Sam Lantinga 1413bfb185 Don't overwrite non-CRC gamepad mapping with a new mapping that specifies a CRC
Fixes https://github.com/libsdl-org/SDL/issues/11723
2024-12-26 20:18:26 -08:00
Sam Lantinga 948b16533c testcamera: use the first available cameras 2024-12-26 19:23:43 -08:00
Sam Lantinga c744c8fc0b Document how to check for gamepad capabilities
Fixes https://github.com/libsdl-org/SDL/issues/10593
2024-12-26 17:49:56 -08:00
Sam Lantinga a8d585aac3 Don't try to enumerate possible texture failure reasons.
This can cause misunderstanding about how texture creation works, as seen in https://github.com/libsdl-org/SDL/issues/9504. Instead let people check the error for more information on why creation may have failed.
2024-12-26 17:17:08 -08:00
Sam Lantinga ca17d19f90 Updated iOS file path documentation
Fixes https://github.com/libsdl-org/SDL/issues/10290
2024-12-26 17:00:01 -08:00
Sam Lantinga eb1be89e70 Cleaned up thread state handling and added thread object validation 2024-12-26 10:26:08 -08:00
Sam Lantinga b2178857dc Corrected CoreAudio surround sound channel layouts
Fixes https://github.com/libsdl-org/SDL/issues/11709
2024-12-24 15:03:25 -08:00
Sam Lantinga 76920a230f Fixed Xcode build 2024-12-24 10:49:58 -08:00
Sam Lantinga 8653a5821b Fixed mingw64 Windows build 2024-12-24 08:58:08 -08:00
Sam Lantinga 60dce94583 Fixed building with older Windows SDKs 2024-12-24 08:26:05 -08:00
Sam Lantinga 483e79bf82 Fixed mouse click count for relative mode and multiple mice
We'll track the click count separately for each input source, and the click distance is calculated using a point on an infinite plane that is pushed around by mouse motion deltas, unclamped by the window edge.
2024-12-23 19:00:14 -08:00
Sam Lantinga ed75d9d22a Document that the mouse ID is only valid in mouse relative mode
Fixes https://github.com/libsdl-org/SDL/issues/11259
2024-12-23 17:12:50 -08:00
Sam Lantinga 024e5da6fb Mouse events only get a mouse ID in relative mode 2024-12-23 17:12:50 -08:00
Sam Lantinga 5a2eb60389 Only save the pending flags we will restore when hiding a window
Fixes https://github.com/libsdl-org/SDL/issues/11564
2024-12-23 16:53:54 -08:00
Sam Lantinga 969f03d9f0 Added SDL_PROP_RENDERER_GPU_DEVICE_POINTER
Fixes https://github.com/libsdl-org/SDL/issues/11600
2024-12-23 16:51:43 -08:00
Sam Lantinga 3a1810f9a9 Fixed the Linux mapping for the NVIDIA Controller v1.03 2024-12-23 15:43:17 -08:00
Sam Lantinga 49610fd1e8 Leave mouse relative mode when losing focus
Fixes https://github.com/libsdl-org/SDL/issues/7892
2024-12-23 15:23:11 -08:00
Sam Lantinga 8691408baf Clarify that you shouldn't make any assumptions about the an SDL_FingerID value.
Fixes https://github.com/libsdl-org/SDL/issues/11667
2024-12-23 14:28:54 -08:00
Sam Lantinga 37b87f79fb Fixed Bluetooth Steam Controller detection on iOS and Android 2024-12-23 12:55:25 -08:00
Sam Lantinga 9a43c08146 Allow rendering during the modal resize loop on macOS
Fixes https://github.com/libsdl-org/SDL/issues/11508
2024-12-23 11:46:35 -08:00
Sam Lantinga 225c0e2ad9 Removed unused function declaration 2024-12-23 11:21:00 -08:00
Sam Lantinga 4add7e2005 Round the window size values when using fixed aspect ratio
This won't get you pixel perfect values, since the exact ratio won't necessarily be whole pixel values, but it will be closer, and matches the logic in the other branch.
2024-12-23 09:03:38 -08:00
Sam Lantinga 2e4dc9c109 Disable tracking memory allocation counts by default
Fixes https://github.com/libsdl-org/SDL/issues/11099
2024-12-22 12:20:04 -08:00
Sam Lantinga 33442701ca Use the monitor as the client rect for maximized borderless windows
Fixes https://github.com/libsdl-org/SDL/issues/9588
2024-12-21 09:19:03 -08:00
Sam Lantinga 7e298f50fe Make windows resizable if we're about to maximize them programmatically 2024-12-21 09:19:03 -08:00
Sam Lantinga 34974d4d2b Don't remove the resizable style for borderless windows
The application may have intended the window to be borderless and resizable
2024-12-21 09:19:03 -08:00
Sam Lantinga cadeec9cc9 SDL_SoftStretch() doesn't handle large pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/11534
2024-12-21 09:19:03 -08:00
Sam Lantinga f37eef948c Removed raw mouse events
It's too close the 3.2.0 release for an API change like this.

If/when we re-add these, some things for consideration:
* What use cases does this enable that aren't currently possible?
* What cross-platform API guarantees do we make about the availability of these events? e.g. do we try to simulate them where raw input isn't actually available?
* How is this different from the existing relative mode, and how do we clearly explain when you want these events vs wanting relative mode?

Notes from @expikr:
First observation: the reason I originally passed denominators instead of multipliers was because some rational values cannot be exactly represented by floats (e.g 1/120) so instead let the end-developer decide how to do the dividing themselves. It was the reason why it was using split values with an integer numerator to begin with, instead of having both as floats or even just normalize it in advance.

On the other hand, passing them as multipliers might have hypothetical uses for dynamically passing end-user controlled scaling in a transparent manner without coupling? (Though in that case why not just do that as additional fields appended to `motion` structs in an API-compatible layout?)

So it’s somewhat of a philosophical judgement of what this API of optional availability do we intend for it to present itself as:
- should it be a bit-perfect escape hatch with the absolute minimally-denominal abstraction over platform details just enough to be able to serve the full information (á la HIDPIAPI),
- or a renewed ergonomic API for splitting relative motion from cursor motion (in light of The Great Warping Purge) so that it is unburdened by legacy RelativeMode state machines, in which case it would be more appropriate to just call it `RELATIVE` instead of `RAW` and should be added alongside another new event purely for cursor events?

This alternate API stream was conceived in the context of preserving compatibility of the existing RelativeMode state machine by adding an escape hatch. So given the same context, my taste leans towards the former designation.

However, as The Great Warping Purge has made it potentially viable to do so, if I were allowed to break ABI by nuking the RelativeMode state machine entirely, I would prefer the latter designation unified as one of three separate components split from the old state machine, each independently controlled by platform-dependent availability without any state switching of a leaky melting pot:
- cursor visibility controls (if platform has cursor)
- cursor motion events (if platform has cursor)
- relative motion events (if the platform reports hardware motion)
2024-12-21 05:18:42 -08:00
Sam Lantinga d07bb0e679 Removed raw key events
They weren't adding any value over the existing keyboard events
2024-12-21 05:18:42 -08:00
Sam Lantinga c44fa5bb07 Updated raw input events to match SDL style
Also added raw keyboard events, and implemented raw input events on iOS, OpenBSD console, Linux console, and X11
2024-12-21 05:18:42 -08:00
Sam Lantinga a47b62d1fe Removed PS2 compiler definition
This is already defined as part of the PS2 SDK
2024-12-20 15:51:39 -08:00
Sam Lantinga 42de2ac6a9 Fixed typo 2024-12-19 10:51:02 -08:00
Sam Lantinga e08f34c3be Removed SDL_HINT_MOUSE_RELATIVE_MODE_WARP
This complicated mouse handling and is a rarely tested path. Real relative mode is much better performance and higher precision.
2024-12-19 10:33:02 -08:00
Sam Lantinga 6e0df0af24 Reduce the possibility of SDL_LockMutex getting called on a destroyed mutex after SDL_StopEventLoop 2024-12-19 09:32:31 -08:00
Sam Lantinga f81472d767 Document that you should read from processes before waiting for them to exit.
Fixes https://github.com/libsdl-org/SDL/issues/11645
2024-12-18 16:18:44 -08:00
Sam Lantinga 835b6e0c1a Enable high refresh rates on iOS
Fixes https://github.com/libsdl-org/SDL/issues/7518
2024-12-18 14:36:30 -08:00
Sam Lantinga 080b3002c6 Fixed building with an older Windows SDK 2024-12-16 22:33:31 -08:00
Sam Lantinga 76e7bc4c04 Added support for ALSA dmix audio output (thanks @sylware!)
Fixes https://github.com/libsdl-org/SDL/issues/8577
2024-12-16 12:19:48 -05:00
Sam Lantinga 1944bc7407 Fixed warning C4702: unreachable code 2024-12-12 15:43:42 -08:00
Sam Lantinga 63a498c966 Fixed warning C4189: 'cqe': local variable is initialized but not referenced 2024-12-12 15:43:07 -08:00
Sam Lantinga ce9dddfde2 Don't free properties while modifying the property hashtable
A property cleanup callback might end up trying to set other properties, so we don't want to have a lock held at that point.

Fixes an assertion in testprocess when cleaning up IO stream properties
2024-12-12 14:39:53 -08:00
Sam Lantinga 43a61fec91 Removed external hashtable locking functions
Read-write locks are not recursive and can't be upgraded from one type to another, so it's not safe to lock the hash table and then call functions that operate on it. If you really want this functionality, we'd need to create unlocked versions of the hashtable functions and you would call those once you've taken a lock on the hashtable, and we'd have to assert that the operations you're doing are compatible with the type of lock you've taken.

All of that complicates working with hashtables, so if you need that type of access, you should probably just use external locking.
2024-12-12 14:39:53 -08:00
Sam Lantinga 61511c48a4 SDL_HashTable is now optionally thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/11635
2024-12-12 14:39:53 -08:00
Sam Lantinga 962268ca21 Fixed Chinese locales on PSP (thanks @ccawley2011!) 2024-12-10 14:47:31 -08:00
Sam Lantinga 09428688b9 Added a reminder to sign the source archives when creating a release 2024-12-07 11:50:42 -08:00
Sam Lantinga ddb1e66d90 Updated the release checklist documentation 2024-12-06 20:18:30 -08:00
Sam Lantinga caf0348b26 Enable ApplePressAndHoldEnabled
Fixes https://github.com/libsdl-org/SDL/issues/3622
2024-12-06 17:33:10 -08:00
Sam Lantinga 900627f7fc Enable the SDL_HINT_MOUSE_DOUBLE_CLICK_TIME and SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS hints on macOS
Fixes https://github.com/libsdl-org/SDL/issues/4000
2024-12-06 17:07:16 -08:00
Sam Lantinga 6d1dac1404 Removed unused math code from the Visual Studio projects 2024-12-06 16:28:23 -08:00
Sam Lantinga df48af22d4 Removed unused math code from the Xcode project 2024-12-06 16:20:13 -08:00
Sam Lantinga 08de6656fc Document the pixel layout of YUV format surfaces
Fixes https://github.com/libsdl-org/SDL/issues/10530
2024-12-06 16:14:05 -08:00
Sam Lantinga 846eb9a886 Added SDL_RenderTextureAffine() to the exported API 2024-12-06 14:16:16 -08:00
Sam Lantinga 8d8578785c SDL_asyncio.h is a public header and should be included in the framework 2024-12-06 13:46:31 -08:00
Sam Lantinga ffb9b30e84 The metal renderer doesn't actually support RGB texture formats
Fixes https://github.com/libsdl-org/SDL/issues/11576
2024-12-06 09:47:50 -08:00
Sam Lantinga 3060105cfa Don't filter out controllers when launched by Steam under Proton
Fixes https://github.com/libsdl-org/SDL/issues/11579
2024-12-05 19:50:15 -08:00
Sam Lantinga 23828b62d4 Added SDL_IsMainThread() and SDL_RunOnMainThread() 2024-12-05 13:53:51 -08:00
Sam Lantinga bc4185c685 Document that video and input functions should be called on the main thread.
This is a hard requirement on Apple platforms and while most other platforms don't have a concept of main thread, all video and input functions should be called on the same thread.
2024-12-05 13:53:51 -08:00
Sam Lantinga fffa6c7a2b Add missing include of fcntl.h
Fixes https://github.com/libsdl-org/SDL/issues/11590
2024-12-05 13:45:17 -08:00
Sam Lantinga 235e5c6a6c Fixed crash if a device doesn't have a USB product or manufacturer string
This happens with the Razer Huntsman V3 Pro Tenkeyless keyboard
2024-12-05 10:42:02 -08:00
Sam Lantinga 045e31178f Added SDL_dialog.c to the Xcode project 2024-12-04 15:12:44 -08:00
Sam Lantinga 1377cdb3f2 Fix the Indonesian language code on Android 2024-12-03 15:04:29 -08:00
Sam Lantinga 6aab5a089d Fixed potential buffer overflow 2024-12-03 08:33:51 -08:00
Sam Lantinga 6fab61b69d hidapi: check each usage on a device before ignoring it completely 2024-11-25 10:49:05 -08:00
Sam Lantinga c508396e33 Avoid usage of CreateEventEx in WASAPI code
This also uses FALSE as parameters consistently for CreateEvent()
2024-11-24 17:49:17 -08:00
Sam Lantinga 5ee4d176f1 Added support for the Razer Wolverine V3 Pro 2024-11-21 05:51:57 -08:00
Sam Lantinga 932bb968d7 Fixed infinite recursion when the microphone is unavailable 2024-11-20 16:07:43 -08:00
Sam Lantinga 1413848f41 Fixed crash if a window ends up without a display 2024-11-20 13:27:43 -08:00
Sam Lantinga 35e6c92c3c Added the ROG Ally X to the list of Xbox controllers
This prevents Steam from opening the DirectInput versions of this controller that are added by installing Zenless Zone Zero.
2024-11-20 12:09:30 -08:00
Sam Lantinga 7a074f582e Steam Controller handling improvements
* Only handle the controller interfaces on a Steam Controller and wireless dongle
* Wait until we get the connected status when initializing a wireless dongle
2024-11-18 21:36:23 -08:00
Sam Lantinga 0c53d9a1ee Implemented SendEffect for Steam Controllers 2024-11-18 18:26:07 -08:00