Commit Graph

2535 Commits

Author SHA1 Message Date
Mohamed Shazan
f4c124e4bf SDL_TriggerBreakpoint() will default to __debugbreak() on MinGW toolchain on windows 2025-08-08 16:20:59 -07:00
Pino Toscano
171885010d Add GNU/Hurd as platform
SDL has been building on GNU/Hurd for a long time, using either drivers
based on external libraries (e.g. X11, pulseaudio, sndio, etc) or dummy
drivers. This commit introduces it explicitly as platform, so it can be
recognized, and tweaked as needed. In particular:
- introduce the SDL_PLATFORM_HURD define
- tighten/improve the platform detection in cmake, and use "Hurd" as
  identifier
- return the platform name in SDL_GetPlatform()
- tweak the CFLAGS/LDFLAGS so pthreads can be used properly
- implement SDL_GetExeName(), using /proc/self/exe as provided by the
  basic Linux-like procfs
- enable GLES 2 in tests (mostly for consistency with Linux)
2025-08-08 12:47:09 -07:00
Simon McVittie
d83503f80e Fix some typos detected by Debian's lintian QA tool
I assume the demoninator is a typo, rather than an indication that
someone has been playing too much Doom :-)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-07 13:55:15 -07:00
Simon McVittie
40b941c826 hints: Rephrase documentation to improve grammar
"This thing allows to do something" is not really grammatically correct.
The closest rephrasing would be "allows one to do something" or "allows
the user to do something", but I think the passive voice reads more
naturally here.

Detected by Debian's lintian QA tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-07 13:55:15 -07:00
Pino Toscano
561c99ee11 SDL_endian.h: extend Linux way for GNU libc
The currently used way to determine the endianness (i.e. include
<endian.h> and use the __BYTE_ORDER macro) is provided in general by
GNU libc. Thus, extend that to any platform/OS based on GNU libc.
2025-08-06 16:13:26 -07:00
Sam Lantinga
aae7736ec6 Added additional examples of paddle and misc buttons (thanks @AL2009man!) 2025-08-05 12:01:31 -07:00
Sam Lantinga
9a71e3fd50 Revert "Add SDL_IsTraySupported"
This reverts commit 47d8bdd1c3.

There are runtime reasons why creating a tray can fail, so the correct approach is not to assume that just because a platform supports a tray that trays are available. Instead, you should create a tray at application startup, for the lifetime of the application, and handle failures at that point.

Closes https://github.com/libsdl-org/SDL/pull/13632
2025-08-04 10:42:43 -07:00
Petar Popovic
faf3bd9991 SDL_enabled_assert(): Use NULL istead of 0 to explicity initialize the pointer members of SDL_AssertData 2025-08-03 13:33:48 -04:00
SDL Wiki Bot
e2392984b2 Sync SDL3 wiki -> header
[ci skip]
2025-07-30 08:06:30 +00:00
Ryan C. Gordon
dec21043a0 docs: Slightly improve virtual joystick docs.
Reference https://github.com/libsdl-org/sdlwiki/issues/78
2025-07-30 00:52:29 -04:00
Ryan C. Gordon
ea04bdb5f3 docs: Added a note about virtual joysticks to CategoryJoystick.
Fixes https://github.com/libsdl-org/sdlwiki/issues/78
2025-07-30 00:44:35 -04:00
SDL Wiki Bot
cd15893ea3 Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:30:05 +00:00
Ryan C. Gordon
acbe86399d docs: Note SDL_EVENT_AUDIO_DEVICE_ADDED is sent for all devices at startup.
Fixes https://github.com/libsdl-org/sdlwiki/issues/721
2025-07-29 23:22:50 -04:00
SDL Wiki Bot
39794ae9cd Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:13:02 +00:00
SDL Wiki Bot
c8ebbb3e92 Sync SDL3 wiki -> header
[ci skip]
2025-07-28 18:58:19 +00:00
Xen
b3ba1c159e Update SDL_clipboard.h
Typo fixes and a small addition to SDL_SetClipboardData about mime_type list usage clarity.
2025-07-28 11:57:25 -07:00
Shootfast
507ee033cc Fixed typo in SDL_scancode.h
The backslash/vertical line key is between the left shift and "Z" key on ISO keyboards
2025-07-27 19:58:13 -07:00
SDL Wiki Bot
2ed1c35ca6 Sync SDL3 wiki -> header
[ci skip]
2025-07-26 21:11:11 +00:00
Sam Lantinga
970234d62d Fixed documentation for aligned structure members 2025-07-25 13:33:49 -07:00
Ryan C. Gordon
c80d6954cb Revert "audio: Added SDL_SetAudioIterationCallbacks()."
This reverts commit 608f706a95.

Didn't end up using this in SDL3_mixer, and it's a super-awkward API if we
don't need it.

I _might_ bite the bullet and let people lock a physical audio device, though,
as I could see that being useful but less awkward for the same reasons I
originally wanted it.
2025-07-25 01:38:21 -04:00
SDL Wiki Bot
6b9dfcc2fd Sync SDL3 wiki -> header
[ci skip]
2025-07-24 15:52:42 +00:00
Ryan C. Gordon
07ef532681 hints: Renamed SDL_HINT_LOG_BACKENDS to SDL_DEBUG_LOGGING.
This still logs backend choices, but we might use it for other things. For
example, what Android device is being used, or all the devices we enumerated,
etc.

Ideally this eventually logs all the stuff we often have to ask followup
questions about.
2025-07-22 13:19:30 -04:00
Ryan C. Gordon
af1c05fd58 filesystem: Check SDL_GetPrefPath parameters at the higher level.
...so the backends don't have to do it.

Also added a stern warning about `org` being omitted, but leaving it as
allowed so as not to break existing apps (more than they are already broken,
at least).

Fixes #13322.
2025-07-22 12:28:01 -04:00
SDL Wiki Bot
55e14a2ced Sync SDL3 wiki -> header
[ci skip]
2025-07-21 17:16:40 +00:00
Maia
08fd165dd2 Add POINTER suffix to SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC 2025-07-21 10:15:46 -07:00
SDL Wiki Bot
b0b12b3b09 Sync SDL3 wiki -> header
[ci skip]
2025-07-21 16:55:47 +00:00
Semphris
47d8bdd1c3 Add SDL_IsTraySupported 2025-07-21 12:54:51 -04:00
SDL Wiki Bot
631aa697e6 Sync SDL3 wiki -> header
[ci skip]
2025-07-17 16:00:47 +00:00
Marcin Serwin
8451ce86c1 iostream: Add optional free_func pointer property to memory streams
Fixes https://github.com/libsdl-org/SDL/issues/13368

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-07-17 08:59:42 -07:00
BurntRanch
ee6d8f78f4 Clarify SDL_GPUVertexBufferDescription.pitch comment (#13381) 2025-07-17 08:53:35 -07:00
SDL Wiki Bot
1d9fc5f2c8 Sync SDL3 wiki -> header
[ci skip]
2025-07-17 07:20:27 +00:00
SDL Wiki Bot
1b4fd3aa83 Sync SDL3 wiki -> header
[ci skip]
2025-07-17 07:05:50 +00:00
SDL Wiki Bot
504107ad0e Sync SDL3 wiki -> header
[ci skip]
2025-07-16 01:36:42 +00:00
mitchellcairns
18eeaea054 Implement SInput Device Support (#13343)
This implements a new SDL HID driver for a format developed by Hand Held Legend for their gamepad devices called SInput

Devices that are supported by this change with well-defined mappings

GC Ultimate ( https://gcultimate.com )
ProGCC ( https://handheldlegend.com/products/progcc-kit-wireless-wired-bundle )

The SInput format is documented here: https://github.com/HandHeldLegend/SInput-HID
2025-07-15 18:35:47 -07:00
Ryan C. Gordon
f2ae6503c0 audio: Binding an SDL_AudioStream will set missing formats.
It _must_ have the format set for the opposite side from the device (so
playback needs the src format set, and recording needs the dst format set),
since the stream gets mangled by the device thread if not. So if it has never
been set (stream created with NULL audiospec), just set it to match the device.
If the stream is just meant to buffer and not convert, this is desired
behavior, even if it didn't also fix a bug.

Binding the audio stream will always set the device side's format, as usual;
this does not need to be set by the caller at all.

Fixes #13363.
2025-07-15 06:40:09 -04:00
SDL Wiki Bot
d5efb11f97 Sync SDL3 wiki -> header
[ci skip]
2025-07-14 23:50:35 +00:00
Ryan C. Gordon
10004ab0ea hints: Added SDL_HINT_LOG_BACKENDS.
Fixes #13354.
2025-07-14 19:49:38 -04:00
Ryan C. Gordon
a2dcdfcb2d stdinc: Docs said "macro" but meant "datatype." 2025-07-11 14:24:12 -04:00
SDL Wiki Bot
45cc80f02c Sync SDL3 wiki -> header
[ci skip]
2025-07-11 18:20:01 +00:00
Ryan C. Gordon
530639aa4a docs: Documentation for SDL_Swap64 was reporting the wrong return type.
Fixes #13309.
2025-07-02 09:29:40 -04:00
SDL Wiki Bot
2606b08036 Sync SDL3 wiki -> header
[ci skip]
2025-07-01 21:25:27 +00:00
nightmareci
9e6a6c01e4 Add support for floating point main callback rates 2025-07-01 13:31:39 -04:00
SDL Wiki Bot
34928341d0 Sync SDL3 wiki -> header
[ci skip]
2025-06-28 12:31:32 +00:00
Petar Popovic
3cd979b353 SDL_render.h: enum SDL_TextureAddressMode: Removed trailing comma 2025-06-24 21:56:20 +03:00
SDL Wiki Bot
603118c340 Sync SDL3 wiki -> header
[ci skip]
2025-06-23 04:18:24 +00:00
Sam Lantinga
aa4f916b71 Renamed SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN to SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN 2025-06-22 21:17:06 -07:00
SDL Wiki Bot
6cfe211142 Sync SDL3 wiki -> header
[ci skip]
2025-06-23 04:07:09 +00:00
Ryan C. Gordon
274aa0242e audio: Let apps save an audio stream from destruction during SDL_Quit(). (#13244)
This is a special-case piece of functionality, generally these are expected
to go away during shutdown, but maybe someone is switching between audio
subsystems or something...
2025-06-22 21:06:15 -07:00
Sasha Szpakowski
e80d084766 expose events originating from a live-resize set the data1 field to 1.
Fixes #13243.
2025-06-21 07:33:25 -07:00
SDL Wiki Bot
d06b6e42d2 Sync SDL3 wiki -> header
[ci skip]
2025-06-20 21:02:26 +00:00