Skip to content

Commit 95ce2a2

Browse files
authored
Merge branch 'libsdl-org:main' into objectvalid
2 parents 2009b82 + 279dabf commit 95ce2a2

File tree

141 files changed

+2049
-721
lines changed

Some content is hidden

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

141 files changed

+2049
-721
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

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) {

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

include/SDL3/SDL_render.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ typedef enum SDL_TextureAddressMode
110110
SDL_TEXTURE_ADDRESS_INVALID = -1,
111111
SDL_TEXTURE_ADDRESS_AUTO, /**< Wrapping is enabled if texture coordinates are outside [0, 1], this is the default */
112112
SDL_TEXTURE_ADDRESS_CLAMP, /**< Texture coordinates are clamped to the [0, 1] range */
113-
SDL_TEXTURE_ADDRESS_WRAP, /**< The texture is repeated (tiled) */
113+
SDL_TEXTURE_ADDRESS_WRAP /**< The texture is repeated (tiled) */
114114
} SDL_TextureAddressMode;
115115

116116
/**

include/SDL3/SDL_video.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_R
18941894
extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect);
18951895

18961896
/**
1897-
* Get the size of a window's client area.
1897+
* Get the aspect ratio of a window's client area.
18981898
*
18991899
* \param window the window to query the width and height from.
19001900
* \param min_aspect a pointer filled in with the minimum aspect ratio of the

include/SDL3/SDL_vulkan.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151
extern "C" {
5252
#endif
5353

54-
/* Avoid including vulkan.h, don't define VkInstance if it's already included */
55-
#ifdef VULKAN_H_
54+
/* Avoid including vulkan_core.h, don't define VkInstance if it's already included */
55+
#ifdef VULKAN_CORE_H_
5656
#define NO_SDL_VULKAN_TYPEDEFS
5757
#endif
5858
#ifndef NO_SDL_VULKAN_TYPEDEFS
5959
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
6060

61-
#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
61+
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64)
6262
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
6363
#else
6464
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;

src/SDL_hints.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void SDLCALL CleanupHintProperty(void *userdata, void *value)
8787
SDL_free(hint);
8888
}
8989

90-
static const char* GetHintEnvironmentVariable(const char *name)
90+
static const char *GetHintEnvironmentVariable(const char *name)
9191
{
9292
const char *result = SDL_getenv(name);
9393
if (!result && name && *name) {

0 commit comments

Comments
 (0)