2314 Commits

Author SHA1 Message Date
Sam Lantinga
747300b356 SDL file times are 64-bit integers representing nanoseconds since the Unix epoch 2024-03-17 13:21:04 -07:00
SDL Wiki Bot
e7b9f75e62 Sync SDL3 wiki -> header 2024-03-17 19:29:22 +00:00
Sam Lantinga
d65ae710a1 Renamed SDL_LogGetOutputFunction() and SDL_LogSetOutputFunction() to match SDL 3.0 naming convention 2024-03-17 12:28:11 -07:00
Sam Lantinga
d8a54cd4f8 Updated "see also" references to be more consistent
Fixes https://github.com/libsdl-org/SDL/issues/9282
2024-03-17 12:28:11 -07:00
SDL Wiki Bot
a206e1e3c0 Sync SDL3 wiki -> header 2024-03-17 15:40:25 +00:00
Sam Lantinga
f460f42e70 Added filesystem operations to SDL_Storage 2024-03-17 08:39:43 -07:00
Sam Lantinga
7a088527c1 Removed the reserved parameter from SDL_EnumerateDirectoryCallback
If someone needs to, say, include an SDL_Storage object, they can simply point userdata at a structure that includes the the storage and any other data needed in enumeration.
2024-03-17 08:39:43 -07:00
Sam Lantinga
ec3ba387d1 Added SDL_OpenFileStorage() for local file storage 2024-03-17 08:39:43 -07:00
Sam Lantinga
db0c1d7aeb Added portable file and directory operations (thanks @icculus!) 2024-03-17 08:39:43 -07:00
Sam Lantinga
fe5c34d4bd Renamed storage functions to match SDL 3.0 naming convention 2024-03-17 08:39:43 -07:00
SDL Wiki Bot
9ccde0def4 Sync SDL3 wiki -> header 2024-03-16 14:20:24 +00:00
Ethan Lee
744227e6ab Add SDL_storage 2024-03-16 07:19:50 -07:00
Frank Praznik
19764ffcc8 wayland: Add the xdg-foreign-unstable-v2 protocol
Add the xdg-foreign-unstable-v2 protocol and use it to create export handles for toplevel windows, which will be used when an external component, such as the file chooser portal, requires it.
2024-03-15 18:30:05 -04:00
Petar Popovic
2b45452dd5 Adding comments to init-flags SDL_INIT_AUDIO and SDL_INIT_SENSOR that they imply SDL_INIT_EVENTS
When initializing SDL with the flag SDL_INIT_AUDIO or SDL_INIT_SENSOR the event subsystem also gets initialized(SDL_INIT_EVENTS). This isn't mentioned in the comments.
This commit adds these two comments.
2024-03-15 13:10:49 -07:00
SDL Wiki Bot
fa7ec59ecd Sync SDL3 wiki -> header 2024-03-15 19:59:26 +00:00
Ryan C. Gordon
b7cda16613
iostream: Final fixes before merging.
- SDL_GetRWProperties -> SDL_GetIOProperties
- SDL_GetRWStatus -> SDL_GetIOStatus
- Some documentation corrections and improvements.
2024-03-15 15:37:03 -04:00
Ryan C. Gordon
c175eb488c
iostream: Note that the new name has nothing to do with C++'s iostream class. 2024-03-15 01:16:31 -04:00
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
3a344cf877
rwops: Fixed some SDL2 symbols that got missed. 2024-03-14 21:57:21 -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
6c11449cd4 Added a note for the SDL_CommonEvent type 2024-03-14 09:00:47 -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
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
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
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
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
Sam Lantinga
fde420a645 Revert "Added SDL_FLIP_DIAGONAL"
This reverts commit b9ab3269823ea329757aada3a20ef97abf1a9f6d.

@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
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
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
Ozkan Sezer
9e89f093d9 remove stale / wrong information from SDL_RWread() documentation 2024-03-08 18:55:19 +03:00
Sam Lantinga
790cd395f5 Make sure the type in the SDL_Event aligns properly across the union 2024-03-07 06:58:43 -08:00
Sam Lantinga
e9ab2d46de Revert "Change SDL_Keycode type to an enum"
SDL_Keycode can actually be any printable character on the keyboard, so isn't limited to the enumerated values of SDL_KeyCode.
2024-03-07 06:58:43 -08:00
Sam Lantinga
33eaddc565 Cleaned up various type conversion issues
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
2024-03-07 06:58:43 -08:00
Sam Lantinga
f53bdc9531 The pixel format in SDL_DisplayMode uses SDL_PixelFormatEnum 2024-03-07 03:39:06 -08:00
SDL Wiki Bot
59ab5c0824 Sync SDL3 wiki -> header 2024-03-07 00:20:27 +00:00
Sam Lantinga
c70710cde8 SDL_GetPixelFormatEnumForMasks() returns SDL_PixelFormatEnum 2024-03-06 16:19:08 -08:00
Susko3
722f4104bf Use enums as types in SDL_*Event structures
The main `SDL_Event` union is not using the enum as
valid user events types are not in the enum.
2024-03-06 15:40:05 -08:00
Susko3
ce44eff3d2 Use SDL_WindowFlags in public headers 2024-03-06 15:08:12 -08:00