Skip to content

Commit 9f185fa

Browse files
committed
Merge branch 'main' of github.com:libsdl-org/SDL
2 parents 3e14b2b + 3492834 commit 9f185fa

File tree

150 files changed

+2125
-797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+2125
-797
lines changed

.wikiheaders-options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ versionfname = include/SDL3/SDL_version.h
99
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
1010
versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
1111
versionmicroregex = \A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z
12+
apipropertyregex = \A\s*\#\s*define\s+SDL_PROP_
1213
selectheaderregex = \ASDL.*?\.h\Z
1314
projecturl = https://libsdl.org/
1415
wikiurl = https://wiki.libsdl.org

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,9 +1358,7 @@ if(ANDROID)
13581358
set(HAVE_SDL_HAPTIC TRUE)
13591359
endif()
13601360

1361-
if(SDL_HIDAPI)
1362-
CheckHIDAPI()
1363-
endif()
1361+
CheckHIDAPI()
13641362

13651363
if(SDL_JOYSTICK)
13661364
set(SDL_JOYSTICK_ANDROID 1)

build-scripts/wikiheaders.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
my $incsubdir = 'include';
3333
my $readmesubdir = undef;
3434
my $apiprefixregex = undef;
35+
my $apipropertyregex = undef;
3536
my $versionfname = 'include/SDL_version.h';
3637
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
3738
my $versionminorregex = '\A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z';
@@ -110,6 +111,7 @@
110111
$srcpath = $val, next if $key eq 'srcpath';
111112
$wikipath = $val, next if $key eq 'wikipath';
112113
$apiprefixregex = $val, next if $key eq 'apiprefixregex';
114+
$apipropertyregex = $val, next if $key eq 'apipropertyregex';
113115
$projectfullname = $val, next if $key eq 'projectfullname';
114116
$projectshortname = $val, next if $key eq 'projectshortname';
115117
$wikisubdir = $val, next if $key eq 'wikisubdir';
@@ -1366,7 +1368,7 @@ sub generate_quickref {
13661368
# update strings now that we know everything pending is to be applied to this declaration. Add pending blank lines and the new text.
13671369

13681370
# At Sam's request, don't list property defines with functions. (See #9440)
1369-
my $is_property = /\A\s*\#\s*define\s+SDL_PROP_/;
1371+
my $is_property = (defined $apipropertyregex) ? /$apipropertyregex/ : 0;
13701372
if (!$is_property) {
13711373
if ($blank_lines > 0) {
13721374
while ($blank_lines > 0) {

cmake/sdlchecks.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,14 @@ endmacro()
11081108

11091109
# Check for HIDAPI support
11101110
macro(CheckHIDAPI)
1111+
if(ANDROID)
1112+
enable_language(CXX)
1113+
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
1114+
endif()
1115+
if(IOS OR TVOS)
1116+
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
1117+
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
1118+
endif()
11111119
if(SDL_HIDAPI)
11121120
set(HAVE_HIDAPI ON)
11131121
if(SDL_HIDAPI_LIBUSB)
@@ -1140,14 +1148,6 @@ macro(CheckHIDAPI)
11401148
endif()
11411149

11421150
if(HAVE_HIDAPI)
1143-
if(ANDROID)
1144-
enable_language(CXX)
1145-
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
1146-
endif()
1147-
if(IOS OR TVOS)
1148-
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
1149-
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
1150-
endif()
11511151
set(HAVE_SDL_HIDAPI TRUE)
11521152

11531153
if(SDL_JOYSTICK AND SDL_HIDAPI_JOYSTICK)

docs/README-cmake.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Configure your project with `-DSDL_LIBC=ON` to make use of sanitizers.
328328
### CMake fails to build without X11 or Wayland support
329329
330330
Install the required system packages prior to running CMake.
331-
See [README-linux](linux#build-dependencies) for the list of dependencies on Linux.
331+
See [README-linux.md](README-linux.md#build-dependencies) for the list of dependencies on Linux.
332332
Other unix operating systems should provide similar packages.
333333
334334
If you **really** don't need to show windows, add `-DSDL_UNIX_CONSOLE_BUILD=ON` to the CMake configure command.

docs/README-linux.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ openSUSE Tumbleweed:
4646
libgbm-devel pipewire-devel libpulse-devel sndio-devel Mesa-libEGL-devel
4747

4848
Arch:
49+
4950
sudo pacman -S alsa-lib cmake hidapi ibus jack libdecor libgl libpulse libusb libx11 libxcursor libxext libxinerama libxkbcommon libxrandr libxrender libxss libxtst mesa ninja pipewire sndio vulkan-driver vulkan-headers wayland wayland-protocols
5051

5152

include/SDL3/SDL_audio.h

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
10211021
/**
10221022
* Query an audio stream for its currently-bound device.
10231023
*
1024-
* This reports the audio device that an audio stream is currently bound to.
1024+
* This reports the logical audio device that an audio stream is currently
1025+
* bound to.
10251026
*
10261027
* If not bound, or invalid, this returns zero, which is not a valid device
10271028
* ID.
@@ -1063,6 +1064,17 @@ extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_Au
10631064
/**
10641065
* Get the properties associated with an audio stream.
10651066
*
1067+
* The application can hang any data it wants here, but the following
1068+
* properties are understood by SDL:
1069+
*
1070+
* - `SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN`: if true (the default), the
1071+
* stream be automatically cleaned up when the audio subsystem quits. If set
1072+
* to false, the streams will persist beyond that. This property is ignored
1073+
* for streams created through SDL_OpenAudioDeviceStream(), and will always
1074+
* be cleaned up. Streams that are not cleaned up will still be unbound from
1075+
* devices when the audio subsystem quits. This property was added in SDL
1076+
* 3.4.0.
1077+
*
10661078
* \param stream the SDL_AudioStream to query.
10671079
* \returns a valid property ID on success or 0 on failure; call
10681080
* SDL_GetError() for more information.
@@ -1073,6 +1085,9 @@ extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_Au
10731085
*/
10741086
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
10751087

1088+
#define SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN "SDL.audiostream.auto_cleanup"
1089+
1090+
10761091
/**
10771092
* Query the current format of an audio stream.
10781093
*
@@ -1149,14 +1164,14 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
11491164
*
11501165
* The frequency ratio is used to adjust the rate at which input data is
11511166
* consumed. Changing this effectively modifies the speed and pitch of the
1152-
* audio. A value greater than 1.0 will play the audio faster, and at a higher
1153-
* pitch. A value less than 1.0 will play the audio slower, and at a lower
1154-
* pitch.
1167+
* audio. A value greater than 1.0f will play the audio faster, and at a
1168+
* higher pitch. A value less than 1.0f will play the audio slower, and at a
1169+
* lower pitch. 1.0f means play at normal speed.
11551170
*
11561171
* This is applied during SDL_GetAudioStreamData, and can be continuously
11571172
* changed to create various effects.
11581173
*
1159-
* \param stream the stream the frequency ratio is being changed.
1174+
* \param stream the stream on which the frequency ratio is being changed.
11601175
* \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01
11611176
* and 100.
11621177
* \returns true on success or false on failure; call SDL_GetError() for more
@@ -1332,7 +1347,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStre
13321347
* Channel maps are optional; most things do not need them, instead passing
13331348
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
13341349
*
1335-
* The output channel map reorders data that leaving a stream via
1350+
* The output channel map reorders data that is leaving a stream via
13361351
* SDL_GetAudioStreamData.
13371352
*
13381353
* Each item in the array represents an input channel, and its value is the

include/SDL3/SDL_events.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ typedef enum SDL_EventType
135135
/* 0x201 was SDL_SYSWMEVENT, reserve the number for sdl2-compat */
136136
SDL_EVENT_WINDOW_SHOWN = 0x202, /**< Window has been shown */
137137
SDL_EVENT_WINDOW_HIDDEN, /**< Window has been hidden */
138-
SDL_EVENT_WINDOW_EXPOSED, /**< Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event */
138+
SDL_EVENT_WINDOW_EXPOSED, /**< Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event.
139+
data1 is 1 for live-resize expose events, 0 otherwise. */
139140
SDL_EVENT_WINDOW_MOVED, /**< Window has been moved to data1, data2 */
140141
SDL_EVENT_WINDOW_RESIZED, /**< Window has been resized to data1xdata2 */
141142
SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED,/**< The pixel size of the window has changed to data1xdata2 */

include/SDL3/SDL_iostream.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value);
823823
*
824824
* \param src the stream from which to read data.
825825
* \param value a pointer filled in with the data read.
826-
* \returns true on successful write or false on failure; call SDL_GetError()
826+
* \returns true on successful read or false on failure; call SDL_GetError()
827827
* for more information.
828828
*
829829
* \threadsafety This function is not thread safe.
@@ -846,7 +846,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
846846
*
847847
* \param src the stream from which to read data.
848848
* \param value a pointer filled in with the data read.
849-
* \returns true on successful write or false on failure; call SDL_GetError()
849+
* \returns true on successful read or false on failure; call SDL_GetError()
850850
* for more information.
851851
*
852852
* \threadsafety This function is not thread safe.
@@ -869,7 +869,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value)
869869
*
870870
* \param src the stream from which to read data.
871871
* \param value a pointer filled in with the data read.
872-
* \returns true on successful write or false on failure; call SDL_GetError()
872+
* \returns true on successful read or false on failure; call SDL_GetError()
873873
* for more information.
874874
*
875875
* \threadsafety This function is not thread safe.
@@ -892,7 +892,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
892892
*
893893
* \param src the stream from which to read data.
894894
* \param value a pointer filled in with the data read.
895-
* \returns true on successful write or false on failure; call SDL_GetError()
895+
* \returns true on successful read or false on failure; call SDL_GetError()
896896
* for more information.
897897
*
898898
* \threadsafety This function is not thread safe.
@@ -915,7 +915,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value)
915915
*
916916
* \param src the stream from which to read data.
917917
* \param value a pointer filled in with the data read.
918-
* \returns true on successful write or false on failure; call SDL_GetError()
918+
* \returns true on successful read or false on failure; call SDL_GetError()
919919
* for more information.
920920
*
921921
* \threadsafety This function is not thread safe.
@@ -938,7 +938,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
938938
*
939939
* \param src the stream from which to read data.
940940
* \param value a pointer filled in with the data read.
941-
* \returns true on successful write or false on failure; call SDL_GetError()
941+
* \returns true on successful read or false on failure; call SDL_GetError()
942942
* for more information.
943943
*
944944
* \threadsafety This function is not thread safe.
@@ -961,7 +961,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value)
961961
*
962962
* \param src the stream from which to read data.
963963
* \param value a pointer filled in with the data read.
964-
* \returns true on successful write or false on failure; call SDL_GetError()
964+
* \returns true on successful read or false on failure; call SDL_GetError()
965965
* for more information.
966966
*
967967
* \threadsafety This function is not thread safe.
@@ -984,7 +984,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
984984
*
985985
* \param src the stream from which to read data.
986986
* \param value a pointer filled in with the data read.
987-
* \returns true on successful write or false on failure; call SDL_GetError()
987+
* \returns true on successful read or false on failure; call SDL_GetError()
988988
* for more information.
989989
*
990990
* \threadsafety This function is not thread safe.
@@ -1007,7 +1007,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value)
10071007
*
10081008
* \param src the stream from which to read data.
10091009
* \param value a pointer filled in with the data read.
1010-
* \returns true on successful write or false on failure; call SDL_GetError()
1010+
* \returns true on successful read or false on failure; call SDL_GetError()
10111011
* for more information.
10121012
*
10131013
* \threadsafety This function is not thread safe.
@@ -1030,7 +1030,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
10301030
*
10311031
* \param src the stream from which to read data.
10321032
* \param value a pointer filled in with the data read.
1033-
* \returns true on successful write or false on failure; call SDL_GetError()
1033+
* \returns true on successful read or false on failure; call SDL_GetError()
10341034
* for more information.
10351035
*
10361036
* \threadsafety This function is not thread safe.
@@ -1053,7 +1053,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value)
10531053
*
10541054
* \param src the stream from which to read data.
10551055
* \param value a pointer filled in with the data read.
1056-
* \returns true on successful write or false on failure; call SDL_GetError()
1056+
* \returns true on successful read or false on failure; call SDL_GetError()
10571057
* for more information.
10581058
*
10591059
* \threadsafety This function is not thread safe.
@@ -1076,7 +1076,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
10761076
*
10771077
* \param src the stream from which to read data.
10781078
* \param value a pointer filled in with the data read.
1079-
* \returns true on successful write or false on failure; call SDL_GetError()
1079+
* \returns true on successful read or false on failure; call SDL_GetError()
10801080
* for more information.
10811081
*
10821082
* \threadsafety This function is not thread safe.

include/SDL3/SDL_main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[]
618618
* \param name the window class name, in UTF-8 encoding. If NULL, SDL
619619
* currently uses "SDL_app" but this isn't guaranteed.
620620
* \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
621-
* currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
622-
* what is specified here.
621+
* currently uses `(CS_BYTEALIGNCLIENT \| CS_OWNDC)` regardless
622+
* of what is specified here.
623623
* \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
624624
* will use `GetModuleHandle(NULL)` instead.
625625
* \returns true on success or false on failure; call SDL_GetError() for more

0 commit comments

Comments
 (0)