Skip to content

Commit 69cf377

Browse files
committed
Merge upstream SDL 3.2.8
2 parents 5179baa + f686492 commit 69cf377

File tree

167 files changed

+12944
-2378
lines changed

Some content is hidden

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

167 files changed

+12944
-2378
lines changed

include/SDL3/SDL.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
/**
23-
* Main include header for the SDL library, version 3.2.4
23+
* Main include header for the SDL library, version 3.2.8
2424
*
2525
* It is almost always best to include just this one header instead of
2626
* picking out individual headers included here. There are exceptions to

include/SDL3/SDL_assert.h

+2
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ extern "C" {
149149
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
150150
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
151151
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
152+
#elif defined(__GNUC__) || defined(__clang__)
153+
#define SDL_TriggerBreakpoint() __builtin_trap() /* older gcc may not support SDL_HAS_BUILTIN(__builtin_trap) above */
152154
#elif defined(__386__) && defined(__WATCOMC__)
153155
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
154156
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)

include/SDL3/SDL_dialog.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ typedef struct SDL_DialogFileFilter
8484
* - A pointer to NULL, the user either didn't choose any file or canceled the
8585
* dialog.
8686
* - A pointer to non-`NULL`, the user chose one or more files. The argument
87-
* is a null-terminated list of pointers to C strings, each containing a
88-
* path.
87+
* is a null-terminated array of pointers to UTF-8 encoded strings, each
88+
* containing a path.
8989
*
9090
* The filelist argument should not be freed; it will automatically be freed
9191
* when the callback returns.

include/SDL3/SDL_events.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ typedef enum SDL_EventType
132132

133133
/* Window events */
134134
/* 0x200 was SDL_WINDOWEVENT, reserve the number for sdl2-compat */
135-
/* 0x201 was SDL_EVENT_SYSWM, reserve the number for sdl2-compat */
135+
/* 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 */
138138
SDL_EVENT_WINDOW_EXPOSED, /**< Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event */
@@ -1108,7 +1108,7 @@ typedef enum SDL_EventAction
11081108
* \param numevents if action is SDL_ADDEVENT, the number of events to add
11091109
* back to the event queue; if action is SDL_PEEKEVENT or
11101110
* SDL_GETEVENT, the maximum number of events to retrieve.
1111-
* \param action action to take; see [[#action|Remarks]] for details.
1111+
* \param action action to take; see [Remarks](#remarks) for details.
11121112
* \param minType minimum value of the event type to be considered;
11131113
* SDL_EVENT_FIRST is a safe choice.
11141114
* \param maxType maximum value of the event type to be considered;

include/SDL3/SDL_gpu.h

+29-12
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
* can render offscreen entirely, perhaps for image processing, and not use a
3636
* window at all.
3737
*
38-
* Next the app prepares static data (things that are created once and used
38+
* Next, the app prepares static data (things that are created once and used
3939
* over and over). For example:
4040
*
4141
* - Shaders (programs that run on the GPU): use SDL_CreateGPUShader().
42-
* - Vertex buffers (arrays of geometry data) and other data rendering will
43-
* need: use SDL_UploadToGPUBuffer().
44-
* - Textures (images): use SDL_UploadToGPUTexture().
42+
* - Vertex buffers (arrays of geometry data) and other rendering data: use
43+
* SDL_CreateGPUBuffer() and SDL_UploadToGPUBuffer().
44+
* - Textures (images): use SDL_CreateGPUTexture() and
45+
* SDL_UploadToGPUTexture().
4546
* - Samplers (how textures should be read from): use SDL_CreateGPUSampler().
4647
* - Render pipelines (precalculated rendering state): use
4748
* SDL_CreateGPUGraphicsPipeline()
@@ -1495,9 +1496,16 @@ typedef struct SDL_GPUIndirectDispatchCommand
14951496
/**
14961497
* A structure specifying the parameters of a sampler.
14971498
*
1499+
* Note that mip_lod_bias is a no-op for the Metal driver. For Metal, LOD bias
1500+
* must be applied via shader instead.
1501+
*
14981502
* \since This function is available since SDL 3.2.0.
14991503
*
15001504
* \sa SDL_CreateGPUSampler
1505+
* \sa SDL_GPUFilter
1506+
* \sa SDL_GPUSamplerMipmapMode
1507+
* \sa SDL_GPUSamplerAddressMode
1508+
* \sa SDL_GPUCompareOp
15011509
*/
15021510
typedef struct SDL_GPUSamplerCreateInfo
15031511
{
@@ -1536,14 +1544,14 @@ typedef struct SDL_GPUSamplerCreateInfo
15361544
* \since This struct is available since SDL 3.2.0.
15371545
*
15381546
* \sa SDL_GPUVertexAttribute
1539-
* \sa SDL_GPUVertexInputState
1547+
* \sa SDL_GPUVertexInputRate
15401548
*/
15411549
typedef struct SDL_GPUVertexBufferDescription
15421550
{
15431551
Uint32 slot; /**< The binding slot of the vertex buffer. */
15441552
Uint32 pitch; /**< The byte pitch between consecutive elements of the vertex buffer. */
15451553
SDL_GPUVertexInputRate input_rate; /**< Whether attribute addressing is a function of the vertex index or instance index. */
1546-
Uint32 instance_step_rate; /**< The number of instances to draw using the same per-instance data before advancing in the instance buffer by one element. Ignored unless input_rate is SDL_GPU_VERTEXINPUTRATE_INSTANCE */
1554+
Uint32 instance_step_rate; /**< Reserved for future use. Must be set to 0. */
15471555
} SDL_GPUVertexBufferDescription;
15481556

15491557
/**
@@ -1713,10 +1721,13 @@ typedef struct SDL_GPUTransferBufferCreateInfo
17131721
* A structure specifying the parameters of the graphics pipeline rasterizer
17141722
* state.
17151723
*
1716-
* NOTE: Some backend APIs (D3D11/12) will enable depth clamping even if
1717-
* enable_depth_clip is true. If you rely on this clamp+clip behavior,
1718-
* consider enabling depth clip and then manually clamping depth in your
1719-
* fragment shaders on Metal and Vulkan.
1724+
* Note that SDL_GPU_FILLMODE_LINE is not supported on many Android devices.
1725+
* For those devices, the fill mode will automatically fall back to FILL.
1726+
*
1727+
* Also note that the D3D12 driver will enable depth clamping even if
1728+
* enable_depth_clip is true. If you need this clamp+clip behavior, consider
1729+
* enabling depth clip and then manually clamping depth in your fragment
1730+
* shaders on Metal and Vulkan.
17201731
*
17211732
* \since This struct is available since SDL 3.2.0.
17221733
*
@@ -1747,8 +1758,8 @@ typedef struct SDL_GPURasterizerState
17471758
typedef struct SDL_GPUMultisampleState
17481759
{
17491760
SDL_GPUSampleCount sample_count; /**< The number of samples to be used in rasterization. */
1750-
Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. */
1751-
bool enable_mask; /**< Enables sample masking. */
1761+
Uint32 sample_mask; /**< Reserved for future use. Must be set to 0. */
1762+
bool enable_mask; /**< Reserved for future use. Must be set to false. */
17521763
Uint8 padding1;
17531764
Uint8 padding2;
17541765
Uint8 padding3;
@@ -1798,6 +1809,8 @@ typedef struct SDL_GPUColorTargetDescription
17981809
* \since This struct is available since SDL 3.2.0.
17991810
*
18001811
* \sa SDL_GPUGraphicsPipelineCreateInfo
1812+
* \sa SDL_GPUColorTargetDescription
1813+
* \sa SDL_GPUTextureFormat
18011814
*/
18021815
typedef struct SDL_GPUGraphicsPipelineTargetInfo
18031816
{
@@ -3920,6 +3933,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitForGPUSwapchain(
39203933
* freed by the user. You MUST NOT call this function from any thread other
39213934
* than the one that created the window.
39223935
*
3936+
* The swapchain texture is write-only and cannot be used as a sampler or for
3937+
* another reading operation.
3938+
*
39233939
* \param command_buffer a command buffer.
39243940
* \param window a window that has been claimed.
39253941
* \param swapchain_texture a pointer filled in with a swapchain texture
@@ -3938,6 +3954,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitForGPUSwapchain(
39383954
*
39393955
* \sa SDL_SubmitGPUCommandBuffer
39403956
* \sa SDL_SubmitGPUCommandBufferAndAcquireFence
3957+
* \sa SDL_AcquireGPUSwapchainTexture
39413958
*/
39423959
extern SDL_DECLSPEC bool SDLCALL SDL_WaitAndAcquireGPUSwapchainTexture(
39433960
SDL_GPUCommandBuffer *command_buffer,

include/SDL3/SDL_hints.h

+22
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,28 @@ extern "C" {
21912191
*/
21922192
#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
21932193

2194+
/**
2195+
* A variable containing a list of devices and their desired number of haptic
2196+
* (force feedback) enabled axis.
2197+
*
2198+
* The format of the string is a comma separated list of USB VID/PID pairs in
2199+
* hexadecimal form plus the number of desired axes, e.g.
2200+
*
2201+
* `0xAAAA/0xBBBB/1,0xCCCC/0xDDDD/3`
2202+
*
2203+
* This hint supports a "wildcard" device that will set the number of haptic
2204+
* axes on all initialized haptic devices which were not defined explicitly in
2205+
* this hint.
2206+
*
2207+
* `0xFFFF/0xFFFF/1`
2208+
*
2209+
* This hint should be set before a controller is opened. The number of haptic
2210+
* axes won't exceed the number of real axes found on the device.
2211+
*
2212+
* \since This hint is available since SDL 3.2.5.
2213+
*/
2214+
#define SDL_HINT_JOYSTICK_HAPTIC_AXES "SDL_JOYSTICK_HAPTIC_AXES"
2215+
21942216
/**
21952217
* A variable that controls keycode representation in keyboard events.
21962218
*

include/SDL3/SDL_log.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
* "system", "audio", "video", "render", "input", "test", or `*` for any
4242
* unspecified category.
4343
*
44-
* The level can be a numeric level, one of "verbose", "debug", "info",
45-
* "warn", "error", "critical", or "quiet" to disable that category.
44+
* The level can be a numeric level, one of "trace", "verbose", "debug",
45+
* "info", "warn", "error", "critical", or "quiet" to disable that category.
4646
*
4747
* You can omit the category if you want to set the logging level for all
4848
* categories.

include/SDL3/SDL_main.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
* should look like this:
2929
*
3030
* ```c
31+
* #include <SDL3/SDL.h>
32+
* #include <SDL3/SDL_main.h>
33+
*
3134
* int main(int argc, char *argv[])
3235
* {
3336
* }
@@ -38,9 +41,9 @@
3841
* This is also where an app can be configured to use the main callbacks, via
3942
* the SDL_MAIN_USE_CALLBACKS macro.
4043
*
41-
* This is a "single-header library," which is to say that including this
42-
* header inserts code into your program, and you should only include it once
43-
* in most cases. SDL.h does not include this header automatically.
44+
* SDL_main.h is a "single-header library," which is to say that including
45+
* this header inserts code into your program, and you should only include it
46+
* once in most cases. SDL.h does not include this header automatically.
4447
*
4548
* For more information, see:
4649
*

include/SDL3/SDL_pixels.h

+3
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@ typedef enum SDL_PixelFormat
676676
SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fu, /**< Android video texture format */
677677
/* SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') */
678678

679+
SDL_PIXELFORMAT_MJPG = 0x47504a4du, /**< Motion JPEG */
680+
/* SDL_DEFINE_PIXELFOURCC('M', 'J', 'P', 'G') */
681+
679682
/* Aliases for RGBA byte arrays of color data, for the current platform */
680683
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
681684
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,

0 commit comments

Comments
 (0)