Commit Graph

14900 Commits

Author SHA1 Message Date
Ryan C. Gordon
5a21d87e69
rwops: Changed filenames that reference "rwops" to "iostream". 2024-03-14 23:30:59 -04:00
Ryan C. Gordon
6776b6108a
iostream: "free*" params should be "closeio". 2024-03-14 23:14:46 -04:00
Ryan C. Gordon
5440fd7d12
README-migration.md: Fixed some RWops mistakes. 2024-03-14 23:13:26 -04:00
Ryan C. Gordon
3a344cf877
rwops: Fixed some SDL2 symbols that got missed. 2024-03-14 21:57:21 -04:00
Ryan C. Gordon
5f64cc511e
rwops: Fixed build on Android. 2024-03-14 19:38:15 -04:00
Ryan C. Gordon
fc7afa9cbf
rwops: Renamed SDL_RWops to SDL_IOStream, and other related symbols. 2024-03-14 19:38:12 -04:00
Ryan C. Gordon
fe33b2a81b
rwops: Give implementations access to status value. 2024-03-14 19:37:07 -04:00
Ryan C. Gordon
447c29e65c
include: Added missing RWops documentation. 2024-03-14 19:37:07 -04:00
Ryan C. Gordon
cc58da4c63
rwops: Add SDL_GetRWStatus, make the statuses into an enum. 2024-03-14 19:37:06 -04:00
Ryan C. Gordon
e35c304022
rwops: Add properties for some of the internal implementation details. 2024-03-14 19:37:05 -04:00
Ryan C. Gordon
7d4d8ccde0
rwops: Rename everything from SDL_RWxxx to SDL_XxxRW. 2024-03-14 19:37:04 -04:00
Ryan C. Gordon
655ceb3b31
rwops: Renamed SDL_CreateRW and SDL_DestroyRW to SDL_OpenRW and SDL_CloseRW. 2024-03-14 19:37:01 -04:00
Ryan C. Gordon
525919b315
rwops: Reworked RWops for SDL3.
- SDL_RWops is now an opaque struct.
- SDL_AllocRW is gone. If an app is creating a custom RWops, they pass the
  function pointers to SDL_CreateRW(), which are stored internally.
- SDL_RWclose is gone, there is only SDL_DestroyRW(), which calls the
  implementation's `->close` method before freeing other things.
- There is only one path to create and use RWops now, so we don't have to
  worry about whether `->close` will call SDL_DestroyRW, or if this will
  risk any Properties not being released, etc.
- SDL_RWFrom* still works as expected, for getting a RWops without having
  to supply your own implementation. Objects from these functions are also
  destroyed with SDL_DestroyRW.
- Lots of other cleanup and SDL3ization of the library code.
2024-03-14 19:36:08 -04:00
SDL Wiki Bot
495e432fb9 Sync SDL3 wiki -> header 2024-03-14 22:41:24 +00:00
Semphris
70c2e15615 Add file dialogs 2024-03-14 15:40:25 -07:00
Sam Lantinga
30e93b40c2 If a mapping specifies a crc, don't match for controllers that don't have that CRC
The CRC is used to distinguish between different controllers that have the same VID/PID, so if the CRC doesn't match, it's probably a different controller that we don't know about.

Fixes https://github.com/libsdl-org/SDL/issues/9265
2024-03-14 13:26:56 -07:00
Sam Lantinga
6c11449cd4 Added a note for the SDL_CommonEvent type 2024-03-14 09:00:47 -07:00
Sam Lantinga
209a87bf24 Added missing default case (thanks @sezero!) 2024-03-14 08:52:59 -07:00
Sam Lantinga
442073f379 Added missing reserved field in SDL_CameraDeviceEvent (thanks @Saalvage!) 2024-03-14 08:51:48 -07:00
Sam Lantinga
9bef331dc8 Note that SDL_UserEvent and SDL_Event type are intentionally Uint32 2024-03-14 08:49:02 -07:00
Frank Praznik
717f297849 Add 'wl_list_for_each_safe' to the clang-format macro list
...and fix the formatting when it is used.
2024-03-14 10:22:23 -04:00
Sam Lantinga
3875ef4552 Removed duplicated line (thanks @sechshelme!)
Fixes https://github.com/libsdl-org/SDL/issues/9264
2024-03-13 13:47:32 -07:00
Frank Praznik
4686a737a9 wayland: Minor cursor code cleanup
Clean up variable declarations and fix some formatting issues.
2024-03-13 12:39:00 -04:00
Dimitriy Ryazantcev
1973edb9b7 WIN_UpdateKeymap: cleanup code a bit 2024-03-13 09:09:59 -07:00
Anthony
0a86f8eb6e
Move some code blocks inside SDL_VIDEO_RENDER_SW, where it belongs (#9259)
There was some software renderer specific code that can be excluded with SDL_LEAN_AND_MEAN. This contributes towards #9206
2024-03-12 21:15:46 -07:00
Frank Praznik
c2e9693de5 wayland: Add cursor-shape-v1 protocol support 2024-03-12 20:54:55 -04:00
Frank Praznik
9bdb992925 wayland: Allocate the cursor shared memory buffer entirely in memory, if possible.
Use memfd_create() to allocate the temporary SHM backing file in memory, and set the size with posix_fallocate(), which will return an error on insufficient space vs ftruncate(), which will silently succeed and allow a SIGBUS error to occur if the unbacked memory is accessed.

Additionally, make the legacy path more robust by unlinking the temp file, so it won't persist after close, and unmapping the shared memory buffer.
2024-03-12 20:54:55 -04:00
Sam Lantinga
41b7036f37 testffmpeg: added support for EGL OES frame formats 2024-03-12 16:13:04 -07:00
Sam Lantinga
d79f865251 Removed incorrect mapping for a HORI controller
This broke support for the Hori Fighting Stick EX2, which gets a good mapping if the automatic mapping is allowed to create one.

If the original controller needs a mapping, it should be added with a crc, since that VID/PID combination is used by several HORI controllers.
2024-03-11 17:11:20 -07:00
Sam Lantinga
d78a24a5ce testffmpeg: added verbose logging of ffmpeg messages 2024-03-11 15:48:52 -07:00
Sam Lantinga
7c5f79e7ea testffmpeg: removed redundant enumeration of hardware device types 2024-03-11 15:31:47 -07:00
Anonymous Maarten
bee8a95571 Fix SDL_LEAN_AND_MEAN build 2024-03-11 13:46:16 -07:00
Sam Lantinga
d4794cc714 Fix crash in SDL_UpdateFullscreenMode calling SetWindowFullscreen with a null display
- This mirrors the check above for fullscreen=true in the unlikely case where there is no primary display detected
2024-03-11 11:17:45 -07:00
Sam Lantinga
ab5351f5d6 Fixed leaving the cursor clip set when changing window focus
While the focus change happens, Windows appears to reset the cursor clip rectangle, and then restore it if the application that has focus has the clip rectangle set.

This fixes resetting the clip rectangle while changing focus between windows in the same application, e.g. the Source 2 editor.
2024-03-11 10:58:40 -07:00
Sam Lantinga
b322d27f62 Missed SDL_NumJoystickBalls() rename in SDL_migration.cocci 2024-03-10 21:31:19 -07:00
Sam Lantinga
efbbafb3f1 Re-added balls to the SDL joystick API
It turns out these were being used on Linux and at least one virtual driver was making use of them (thanks @mrfixit2001!)
2024-03-10 21:30:14 -07:00
Sam Lantinga
53e86be22f Minor cleanup with the new PS3 driver for windows 2024-03-10 20:12:11 -07:00
Riccardo Marcangelo
6534029691
Add DualShock 3 HIDAPI support on Windows (#9144)
This adds HIDAPI support for DualShock 3 controllers on Windows, addressing the current absence of this feature in SDL. To utilize this functionality, the official Sony driver 'sixaxis.sys' must be installed. HID offers several advantages over DirectInput, including rumble support and the ability to control the LED lights that display the controller number.
2024-03-10 20:08:36 -07:00
r4nx
feadbffb67 Destroy properties after applying them to avoid memory leakage 2024-03-10 18:16:40 -07:00
Anonymous Maarten
b5eb704fa8 cmake: we only need a C++ compiler for Android, Haiku and UWP
Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
2024-03-11 00:27:54 +01:00
Sam Lantinga
fde420a645 Revert "Added SDL_FLIP_DIAGONAL"
This reverts commit b9ab326982.

@rainerdeyke pointed out:
"This commit is incorrect. Flipping both horizontally and vertically is not equivalent to flipping diagonally."
2024-03-10 15:20:36 -07:00
Sam Lantinga
e3cf2e4794 Turn HIDAPI joystick support off by default on mobile platforms
On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers.

Fixes https://github.com/libsdl-org/SDL/issues/9241
2024-03-10 15:00:49 -07:00
Sam Lantinga
ed463b41e1 Unified the software renderer creation path
Previously there were two different paths for renderer creation, and the HDR metadata initialization was missing when creating a software renderer for a surface. Now all the cases are handled in a single path, so regardless of whether you create a software renderer by name, a software renderer for a surface, or fall back to a software renderer, you'll get the correct initialization in all cases.

Fixes https://github.com/libsdl-org/SDL/issues/9221
2024-03-10 11:05:26 -07:00
RPP-dev
b9ab326982 Added SDL_FLIP_DIAGONAL
Since SDL_RenderFlip is an enum, SDL_FLIP_HORIZONTAL and SDL_FLIP_VERTICAL can not be OR'ed to get the "SDL_FLIP_DIAGONAL".
Render code is actually able to perform these 3 kind of "flipping" so I just added a new enum called SDL_FLIP_DIAGONAL with the OR'ed value (3) so it can be used.
2024-03-10 09:27:14 -07:00
Anonymous Maarten
7341d5f361 cmake: allow hidapi to use libusb on Windows
When using SDL_HIDAPI_LIBUSB_SHARED=ON, extract the dll file name
from the import library.
2024-03-10 09:07:33 -07:00
Anonymous Maarten
3bc27d3856 hidapi_libusb: use SDL_wcscmp and SDL_wcslcpy from SDL 2024-03-10 09:07:33 -07:00
Anonymous Maarten
0e6fcf947a cmake: find libusb through LibUSB cmake module 2024-03-10 09:07:33 -07:00
Tolik708
2a775cad6f Named typedef-ed structs Gave name to structs that were defined like anonymous struct with name given by typedef. Example 'typedef struct {...} Foo;' -> 'typedef struct Foo {...} Foo;' 2024-03-10 09:04:18 -07:00
Sam Lantinga
37d066b99b Clarify what pitch means (thanks @zlago!) 2024-03-10 09:02:59 -07:00
Frosty-J
f9d018c808 Add flag to registerReceiver on Android 2024-03-10 09:01:07 -07:00