Merge pull request #4991 from nadako/sdl-3.2.10

Update vendor:sdl3 to version 3.2.10
This commit is contained in:
Jeroen van Rijn
2025-04-02 23:01:03 +02:00
committed by GitHub
38 changed files with 531 additions and 159 deletions

BIN
vendor/sdl3/SDL3.dll vendored

Binary file not shown.

BIN
vendor/sdl3/SDL3.lib vendored

Binary file not shown.

View File

@@ -20,7 +20,7 @@
*/
/**
* Main include header for the SDL library, version 3.2.0
* Main include header for the SDL library, version 3.2.10
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to

View File

@@ -149,6 +149,8 @@ extern "C" {
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
#elif defined(__GNUC__) || defined(__clang__)
#define SDL_TriggerBreakpoint() __builtin_trap() /* older gcc may not support SDL_HAS_BUILTIN(__builtin_trap) above */
#elif defined(__386__) && defined(__WATCOMC__)
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)

View File

@@ -498,7 +498,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v);
*
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
*
* \param a a pointer to an SDL_AtomicInt to increment.
* \param a a pointer to an SDL_AtomicInt to decrement.
* \returns true if the variable reached zero after decrementing, false
* otherwise.
*

View File

@@ -781,7 +781,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePlayback(SDL_AudioDeviceID dev
* Physical devices can not be paused or unpaused, only logical devices
* created through SDL_OpenAudioDevice() can be.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \param devid a device opened by SDL_OpenAudioDevice().
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
@@ -792,7 +792,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePlayback(SDL_AudioDeviceID dev
* \sa SDL_ResumeAudioDevice
* \sa SDL_AudioDevicePaused
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID devid);
/**
* Use this function to unpause audio playback on a specified device.
@@ -809,7 +809,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
* Physical devices can not be paused or unpaused, only logical devices
* created through SDL_OpenAudioDevice() can be.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \param devid a device opened by SDL_OpenAudioDevice().
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
@@ -820,7 +820,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
* \sa SDL_AudioDevicePaused
* \sa SDL_PauseAudioDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid);
/**
* Use this function to query if an audio device is paused.
@@ -832,7 +832,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
* created through SDL_OpenAudioDevice() can be. Physical and invalid device
* IDs will report themselves as unpaused here.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \param devid a device opened by SDL_OpenAudioDevice().
* \returns true if device is valid and paused, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
@@ -842,7 +842,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
* \sa SDL_PauseAudioDevice
* \sa SDL_ResumeAudioDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID devid);
/**
* Get the gain of an audio device.
@@ -1583,6 +1583,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *str
* previously been paused. Once unpaused, any bound audio streams will begin
* to progress again, and audio can be generated.
*
* Remember, SDL_OpenAudioDeviceStream opens device in a paused state, so this
* function call is required for audio playback to begin on such device.
*
* \param stream the audio stream associated with the audio device to resume.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
@@ -1714,7 +1717,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
* audio to the stream during this call; if needed, the request that triggered
* this callback will obtain the new data immediately.
*
* The callback's `approx_request` argument is roughly how many bytes of
* The callback's `additional_amount` argument is roughly how many bytes of
* _unconverted_ data (in the stream's input format) is needed by the caller,
* although this may overestimate a little for safety. This takes into account
* how much is already in the stream and only asks for any extra necessary to
@@ -1759,13 +1762,13 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *
* The callback can (optionally) call SDL_GetAudioStreamData() to obtain audio
* from the stream during this call.
*
* The callback's `approx_request` argument is how many bytes of _converted_
* data (in the stream's output format) was provided by the caller, although
* this may underestimate a little for safety. This value might be less than
* what is currently available in the stream, if data was already there, and
* might be less than the caller provided if the stream needs to keep a buffer
* to aid in resampling. Which means the callback may be provided with zero
* bytes, and a different amount on each call.
* The callback's `additional_amount` argument is how many bytes of
* _converted_ data (in the stream's output format) was provided by the
* caller, although this may underestimate a little for safety. This value
* might be less than what is currently available in the stream, if data was
* already there, and might be less than the caller provided if the stream
* needs to keep a buffer to aid in resampling. Which means the callback may
* be provided with zero bytes, and a different amount on each call.
*
* The callback may call SDL_GetAudioStreamAvailable to see the total amount
* currently available to read from the stream, instead of the total provided

View File

@@ -239,7 +239,7 @@ extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count);
* there _is_ a camera until the user has given you permission to check
* through a scary warning popup.
*
* \param devid the camera device instance ID to query.
* \param instance_id the camera device instance ID.
* \param count a pointer filled in with the number of elements in the list,
* may be NULL.
* \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on
@@ -254,7 +254,7 @@ extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count);
* \sa SDL_GetCameras
* \sa SDL_OpenCamera
*/
extern SDL_DECLSPEC SDL_CameraSpec ** SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count);
extern SDL_DECLSPEC SDL_CameraSpec ** SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *count);
/**
* Get the human-readable device name for a camera.

View File

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

View File

@@ -132,7 +132,7 @@ typedef enum SDL_EventType
/* Window events */
/* 0x200 was SDL_WINDOWEVENT, reserve the number for sdl2-compat */
/* 0x201 was SDL_EVENT_SYSWM, reserve the number for sdl2-compat */
/* 0x201 was SDL_SYSWMEVENT, reserve the number for sdl2-compat */
SDL_EVENT_WINDOW_SHOWN = 0x202, /**< Window has been shown */
SDL_EVENT_WINDOW_HIDDEN, /**< Window has been hidden */
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
* \param numevents if action is SDL_ADDEVENT, the number of events to add
* back to the event queue; if action is SDL_PEEKEVENT or
* SDL_GETEVENT, the maximum number of events to retrieve.
* \param action action to take; see [[#action|Remarks]] for details.
* \param action action to take; see [Remarks](#remarks) for details.
* \param minType minimum value of the event type to be considered;
* SDL_EVENT_FIRST is a safe choice.
* \param maxType maximum value of the event type to be considered;

View File

@@ -29,7 +29,7 @@
* "joysticks" now are actually console-style gamepads. So SDL provides the
* gamepad API on top of the lower-level joystick functionality.
*
* The difference betweena joystick and a gamepad is that a gamepad tells you
* The difference between a joystick and a gamepad is that a gamepad tells you
* _where_ a button or axis is on the device. You don't speak to gamepads in
* terms of arbitrary numbers like "button 3" or "axis 2" but in standard
* locations: the d-pad, the shoulder buttons, triggers, A/B/X/Y (or

View File

@@ -35,13 +35,14 @@
* can render offscreen entirely, perhaps for image processing, and not use a
* window at all.
*
* Next the app prepares static data (things that are created once and used
* Next, the app prepares static data (things that are created once and used
* over and over). For example:
*
* - Shaders (programs that run on the GPU): use SDL_CreateGPUShader().
* - Vertex buffers (arrays of geometry data) and other data rendering will
* need: use SDL_UploadToGPUBuffer().
* - Textures (images): use SDL_UploadToGPUTexture().
* - Vertex buffers (arrays of geometry data) and other rendering data: use
* SDL_CreateGPUBuffer() and SDL_UploadToGPUBuffer().
* - Textures (images): use SDL_CreateGPUTexture() and
* SDL_UploadToGPUTexture().
* - Samplers (how textures should be read from): use SDL_CreateGPUSampler().
* - Render pipelines (precalculated rendering state): use
* SDL_CreateGPUGraphicsPipeline()
@@ -130,7 +131,8 @@
* It is optimal for apps to pre-compile the shader formats they might use,
* but for ease of use SDL provides a separate project,
* [SDL_shadercross](https://github.com/libsdl-org/SDL_shadercross)
* , for performing runtime shader cross-compilation.
* , for performing runtime shader cross-compilation. It also has a CLI
* interface for offline precompilation as well.
*
* This is an extremely quick overview that leaves out several important
* details. Already, though, one can see that GPU programming can be quite
@@ -888,6 +890,10 @@ typedef enum SDL_GPUCubeMapFace
* Unlike textures, READ | WRITE can be used for simultaneous read-write
* usage. The same data synchronization concerns as textures apply.
*
* If you use a STORAGE flag, the data in the buffer must respect std140
* layout conventions. In practical terms this means you must ensure that vec3
* and vec4 fields are 16-byte aligned.
*
* \since This datatype is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUBuffer
@@ -1361,6 +1367,7 @@ typedef struct SDL_GPUTextureLocation
*
* \sa SDL_UploadToGPUTexture
* \sa SDL_DownloadFromGPUTexture
* \sa SDL_CreateGPUTexture
*/
typedef struct SDL_GPUTextureRegion
{
@@ -1489,9 +1496,16 @@ typedef struct SDL_GPUIndirectDispatchCommand
/**
* A structure specifying the parameters of a sampler.
*
* Note that mip_lod_bias is a no-op for the Metal driver. For Metal, LOD bias
* must be applied via shader instead.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUSampler
* \sa SDL_GPUFilter
* \sa SDL_GPUSamplerMipmapMode
* \sa SDL_GPUSamplerAddressMode
* \sa SDL_GPUCompareOp
*/
typedef struct SDL_GPUSamplerCreateInfo
{
@@ -1530,14 +1544,14 @@ typedef struct SDL_GPUSamplerCreateInfo
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_GPUVertexAttribute
* \sa SDL_GPUVertexInputState
* \sa SDL_GPUVertexInputRate
*/
typedef struct SDL_GPUVertexBufferDescription
{
Uint32 slot; /**< The binding slot of the vertex buffer. */
Uint32 pitch; /**< The byte pitch between consecutive elements of the vertex buffer. */
SDL_GPUVertexInputRate input_rate; /**< Whether attribute addressing is a function of the vertex index or instance index. */
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 */
Uint32 instance_step_rate; /**< Reserved for future use. Must be set to 0. */
} SDL_GPUVertexBufferDescription;
/**
@@ -1550,6 +1564,7 @@ typedef struct SDL_GPUVertexBufferDescription
*
* \sa SDL_GPUVertexBufferDescription
* \sa SDL_GPUVertexInputState
* \sa SDL_GPUVertexElementFormat
*/
typedef struct SDL_GPUVertexAttribute
{
@@ -1706,10 +1721,13 @@ typedef struct SDL_GPUTransferBufferCreateInfo
* A structure specifying the parameters of the graphics pipeline rasterizer
* state.
*
* NOTE: Some backend APIs (D3D11/12) will enable depth clamping even if
* enable_depth_clip is true. If you rely on this clamp+clip behavior,
* consider enabling depth clip and then manually clamping depth in your
* fragment shaders on Metal and Vulkan.
* Note that SDL_GPU_FILLMODE_LINE is not supported on many Android devices.
* For those devices, the fill mode will automatically fall back to FILL.
*
* Also note that the D3D12 driver will enable depth clamping even if
* enable_depth_clip is true. If you need this clamp+clip behavior, consider
* enabling depth clip and then manually clamping depth in your fragment
* shaders on Metal and Vulkan.
*
* \since This struct is available since SDL 3.2.0.
*
@@ -1740,8 +1758,8 @@ typedef struct SDL_GPURasterizerState
typedef struct SDL_GPUMultisampleState
{
SDL_GPUSampleCount sample_count; /**< The number of samples to be used in rasterization. */
Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. */
bool enable_mask; /**< Enables sample masking. */
Uint32 sample_mask; /**< Reserved for future use. Must be set to 0. */
bool enable_mask; /**< Reserved for future use. Must be set to false. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1791,6 +1809,8 @@ typedef struct SDL_GPUColorTargetDescription
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_GPUGraphicsPipelineCreateInfo
* \sa SDL_GPUColorTargetDescription
* \sa SDL_GPUTextureFormat
*/
typedef struct SDL_GPUGraphicsPipelineTargetInfo
{
@@ -1809,6 +1829,7 @@ typedef struct SDL_GPUGraphicsPipelineTargetInfo
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUGraphicsPipeline
* \sa SDL_GPUShader
* \sa SDL_GPUVertexInputState
* \sa SDL_GPUPrimitiveType
* \sa SDL_GPURasterizerState
@@ -1836,6 +1857,7 @@ typedef struct SDL_GPUGraphicsPipelineCreateInfo
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUComputePipeline
* \sa SDL_GPUShaderFormat
*/
typedef struct SDL_GPUComputePipelineCreateInfo
{
@@ -2104,7 +2126,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsProperties(
* \sa SDL_DestroyGPUDevice
* \sa SDL_GPUSupportsShaderFormats
*/
extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
SDL_GPUShaderFormat format_flags,
bool debug_mode,
const char *name);
@@ -2152,7 +2174,7 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
* \sa SDL_DestroyGPUDevice
* \sa SDL_GPUSupportsProperties
*/
extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties(
extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDeviceWithProperties(
SDL_PropertiesID props);
#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN "SDL.gpu.device.create.debugmode"
@@ -2275,7 +2297,7 @@ extern SDL_DECLSPEC SDL_GPUShaderFormat SDLCALL SDL_GetGPUShaderFormats(SDL_GPUD
* \sa SDL_BindGPUComputePipeline
* \sa SDL_ReleaseGPUComputePipeline
*/
extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline(
extern SDL_DECLSPEC SDL_GPUComputePipeline * SDLCALL SDL_CreateGPUComputePipeline(
SDL_GPUDevice *device,
const SDL_GPUComputePipelineCreateInfo *createinfo);
@@ -2302,7 +2324,7 @@ extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline
* \sa SDL_BindGPUGraphicsPipeline
* \sa SDL_ReleaseGPUGraphicsPipeline
*/
extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeline(
extern SDL_DECLSPEC SDL_GPUGraphicsPipeline * SDLCALL SDL_CreateGPUGraphicsPipeline(
SDL_GPUDevice *device,
const SDL_GPUGraphicsPipelineCreateInfo *createinfo);
@@ -2329,7 +2351,7 @@ extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeli
* \sa SDL_BindGPUFragmentSamplers
* \sa SDL_ReleaseGPUSampler
*/
extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler(
extern SDL_DECLSPEC SDL_GPUSampler * SDLCALL SDL_CreateGPUSampler(
SDL_GPUDevice *device,
const SDL_GPUSamplerCreateInfo *createinfo);
@@ -2408,7 +2430,7 @@ extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler(
* \sa SDL_CreateGPUGraphicsPipeline
* \sa SDL_ReleaseGPUShader
*/
extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader(
extern SDL_DECLSPEC SDL_GPUShader * SDLCALL SDL_CreateGPUShader(
SDL_GPUDevice *device,
const SDL_GPUShaderCreateInfo *createinfo);
@@ -2469,7 +2491,7 @@ extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader(
* \sa SDL_ReleaseGPUTexture
* \sa SDL_GPUTextureSupportsFormat
*/
extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
extern SDL_DECLSPEC SDL_GPUTexture * SDLCALL SDL_CreateGPUTexture(
SDL_GPUDevice *device,
const SDL_GPUTextureCreateInfo *createinfo);
@@ -2490,6 +2512,10 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
* Note that certain combinations of usage flags are invalid. For example, a
* buffer cannot have both the VERTEX and INDEX flags.
*
* If you use a STORAGE flag, the data in the buffer must respect std140
* layout conventions. In practical terms this means you must ensure that vec3
* and vec4 fields are 16-byte aligned.
*
* For better understanding of underlying concepts and memory management with
* SDL GPU API, you may refer
* [this blog post](https://moonside.games/posts/sdl-gpu-concepts-cycling/)
@@ -2521,7 +2547,7 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
* \sa SDL_DispatchGPUComputeIndirect
* \sa SDL_ReleaseGPUBuffer
*/
extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer(
extern SDL_DECLSPEC SDL_GPUBuffer * SDLCALL SDL_CreateGPUBuffer(
SDL_GPUDevice *device,
const SDL_GPUBufferCreateInfo *createinfo);
@@ -2554,7 +2580,7 @@ extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer(
* \sa SDL_DownloadFromGPUTexture
* \sa SDL_ReleaseGPUTransferBuffer
*/
extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer(
extern SDL_DECLSPEC SDL_GPUTransferBuffer * SDLCALL SDL_CreateGPUTransferBuffer(
SDL_GPUDevice *device,
const SDL_GPUTransferBufferCreateInfo *createinfo);
@@ -2782,7 +2808,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline(
* \sa SDL_SubmitGPUCommandBuffer
* \sa SDL_SubmitGPUCommandBufferAndAcquireFence
*/
extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer(
extern SDL_DECLSPEC SDL_GPUCommandBuffer * SDLCALL SDL_AcquireGPUCommandBuffer(
SDL_GPUDevice *device);
/* Uniform Data */
@@ -2792,6 +2818,10 @@ extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer(
*
* Subsequent draw calls will use this uniform data.
*
* The data being pushed must respect std140 layout conventions. In practical
* terms this means you must ensure that vec3 and vec4 fields are 16-byte
* aligned.
*
* \param command_buffer a command buffer.
* \param slot_index the vertex uniform slot to push data to.
* \param data client data to write.
@@ -2810,6 +2840,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData(
*
* Subsequent draw calls will use this uniform data.
*
* The data being pushed must respect std140 layout conventions. In practical
* terms this means you must ensure that vec3 and vec4 fields are 16-byte
* aligned.
*
* \param command_buffer a command buffer.
* \param slot_index the fragment uniform slot to push data to.
* \param data client data to write.
@@ -2828,6 +2862,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData(
*
* Subsequent draw calls will use this uniform data.
*
* The data being pushed must respect std140 layout conventions. In practical
* terms this means you must ensure that vec3 and vec4 fields are 16-byte
* aligned.
*
* \param command_buffer a command buffer.
* \param slot_index the uniform slot to push data to.
* \param data client data to write.
@@ -2868,7 +2906,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData(
*
* \sa SDL_EndGPURenderPass
*/
extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass(
extern SDL_DECLSPEC SDL_GPURenderPass * SDLCALL SDL_BeginGPURenderPass(
SDL_GPUCommandBuffer *command_buffer,
const SDL_GPUColorTargetInfo *color_target_infos,
Uint32 num_color_targets,
@@ -2978,6 +3016,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer(
*
* The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param render_pass a render pass handle.
* \param first_slot the vertex sampler slot to begin binding from.
* \param texture_sampler_bindings an array of texture-sampler binding
@@ -2986,6 +3027,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer(
* array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers(
SDL_GPURenderPass *render_pass,
@@ -2999,12 +3042,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers(
* These textures must have been created with
* SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param render_pass a render pass handle.
* \param first_slot the vertex storage texture slot to begin binding from.
* \param storage_textures an array of storage textures.
* \param num_bindings the number of storage texture to bind from the array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures(
SDL_GPURenderPass *render_pass,
@@ -3018,12 +3066,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures(
* These buffers must have been created with
* SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param render_pass a render pass handle.
* \param first_slot the vertex storage buffer slot to begin binding from.
* \param storage_buffers an array of buffers.
* \param num_bindings the number of buffers to bind from the array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers(
SDL_GPURenderPass *render_pass,
@@ -3036,6 +3089,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers(
*
* The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param render_pass a render pass handle.
* \param first_slot the fragment sampler slot to begin binding from.
* \param texture_sampler_bindings an array of texture-sampler binding
@@ -3044,6 +3100,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers(
* array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers(
SDL_GPURenderPass *render_pass,
@@ -3057,12 +3115,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers(
* These textures must have been created with
* SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param render_pass a render pass handle.
* \param first_slot the fragment storage texture slot to begin binding from.
* \param storage_textures an array of storage textures.
* \param num_bindings the number of storage textures to bind from the array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures(
SDL_GPURenderPass *render_pass,
@@ -3076,12 +3139,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures(
* These buffers must have been created with
* SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param render_pass a render pass handle.
* \param first_slot the fragment storage buffer slot to begin binding from.
* \param storage_buffers an array of storage buffers.
* \param num_bindings the number of storage buffers to bind from the array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers(
SDL_GPURenderPass *render_pass,
@@ -3245,7 +3313,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass(
*
* \sa SDL_EndGPUComputePass
*/
extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass(
extern SDL_DECLSPEC SDL_GPUComputePass * SDLCALL SDL_BeginGPUComputePass(
SDL_GPUCommandBuffer *command_buffer,
const SDL_GPUStorageTextureReadWriteBinding *storage_texture_bindings,
Uint32 num_storage_texture_bindings,
@@ -3269,6 +3337,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline(
*
* The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param compute_pass a compute pass handle.
* \param first_slot the compute sampler slot to begin binding from.
* \param texture_sampler_bindings an array of texture-sampler binding
@@ -3277,6 +3348,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline(
* array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeSamplers(
SDL_GPUComputePass *compute_pass,
@@ -3290,12 +3363,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeSamplers(
* These textures must have been created with
* SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param compute_pass a compute pass handle.
* \param first_slot the compute storage texture slot to begin binding from.
* \param storage_textures an array of storage textures.
* \param num_bindings the number of storage textures to bind from the array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures(
SDL_GPUComputePass *compute_pass,
@@ -3309,12 +3387,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures(
* These buffers must have been created with
* SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ.
*
* Be sure your shader is set up according to the requirements documented in
* SDL_CreateGPUShader().
*
* \param compute_pass a compute pass handle.
* \param first_slot the compute storage buffer slot to begin binding from.
* \param storage_buffers an array of storage buffer binding structs.
* \param num_bindings the number of storage buffers to bind from the array.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateGPUShader
*/
extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers(
SDL_GPUComputePass *compute_pass,
@@ -3389,7 +3472,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
/**
* Maps a transfer buffer into application address space.
*
* You must unmap the transfer buffer before encoding upload commands.
* You must unmap the transfer buffer before encoding upload commands. The
* memory is owned by the graphics driver - do NOT call SDL_free() on the
* returned pointer.
*
* \param device a GPU context.
* \param transfer_buffer a transfer buffer.
@@ -3399,7 +3484,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer(
extern SDL_DECLSPEC void * SDLCALL SDL_MapGPUTransferBuffer(
SDL_GPUDevice *device,
SDL_GPUTransferBuffer *transfer_buffer,
bool cycle);
@@ -3430,7 +3515,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer(
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass(
extern SDL_DECLSPEC SDL_GPUCopyPass * SDLCALL SDL_BeginGPUCopyPass(
SDL_GPUCommandBuffer *command_buffer);
/**
@@ -3848,6 +3933,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitForGPUSwapchain(
* freed by the user. You MUST NOT call this function from any thread other
* than the one that created the window.
*
* The swapchain texture is write-only and cannot be used as a sampler or for
* another reading operation.
*
* \param command_buffer a command buffer.
* \param window a window that has been claimed.
* \param swapchain_texture a pointer filled in with a swapchain texture
@@ -3866,6 +3954,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitForGPUSwapchain(
*
* \sa SDL_SubmitGPUCommandBuffer
* \sa SDL_SubmitGPUCommandBufferAndAcquireFence
* \sa SDL_AcquireGPUSwapchainTexture
*/
extern SDL_DECLSPEC bool SDLCALL SDL_WaitAndAcquireGPUSwapchainTexture(
SDL_GPUCommandBuffer *command_buffer,
@@ -3922,7 +4011,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SubmitGPUCommandBuffer(
* \sa SDL_SubmitGPUCommandBuffer
* \sa SDL_ReleaseGPUFence
*/
extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence(
extern SDL_DECLSPEC SDL_GPUFence * SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence(
SDL_GPUCommandBuffer *command_buffer);
/**
@@ -4004,6 +4093,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_QueryGPUFence(
/**
* Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence.
*
* You must not reference the fence after calling this function.
*
* \param device a GPU context.
* \param fence a fence.
*
@@ -4054,7 +4145,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsFormat(
* \param device a GPU context.
* \param format the texture format to check.
* \param sample_count the sample count to check.
* \returns a hardware-specific version of min(preferred, possible).
* \returns whether the sample count is supported for this texture format.
*
* \since This function is available since SDL 3.2.0.
*/

View File

@@ -71,6 +71,8 @@ typedef struct SDL_GUID {
* \param pszGUID buffer in which to write the ASCII string.
* \param cbGUID the size of pszGUID, should be at least 33 bytes.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_StringToGUID
@@ -87,6 +89,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID,
* \param pchGUID string containing an ASCII representation of a GUID.
* \returns a SDL_GUID structure.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GUIDToString

View File

@@ -2191,6 +2191,28 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
/**
* A variable containing a list of devices and their desired number of haptic
* (force feedback) enabled axis.
*
* The format of the string is a comma separated list of USB VID/PID pairs in
* hexadecimal form plus the number of desired axes, e.g.
*
* `0xAAAA/0xBBBB/1,0xCCCC/0xDDDD/3`
*
* This hint supports a "wildcard" device that will set the number of haptic
* axes on all initialized haptic devices which were not defined explicitly in
* this hint.
*
* `0xFFFF/0xFFFF/1`
*
* This hint should be set before a controller is opened. The number of haptic
* axes won't exceed the number of real axes found on the device.
*
* \since This hint is available since SDL 3.2.5.
*/
#define SDL_HINT_JOYSTICK_HAPTIC_AXES "SDL_JOYSTICK_HAPTIC_AXES"
/**
* A variable that controls keycode representation in keyboard events.
*
@@ -2349,8 +2371,8 @@ extern "C" {
#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH"
/**
* A variable controlling whether the Option (⌥) key on macOS should be
* remapped to act as the Alt key.
* A variable controlling whether the Option key on macOS should be remapped
* to act as the Alt key.
*
* The variable can be set to the following values:
*
@@ -3585,6 +3607,22 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
/**
* A variable controlling whether SDL should call XSelectInput() to enable
* input events on X11 windows wrapped by SDL windows.
*
* The variable can be set to the following values:
*
* - "0": Don't call XSelectInput(), assuming the native window code has done
* it already.
* - "1": Call XSelectInput() to enable input events. (default)
*
* This hint should be set before creating a window.
*
* \since This hint is available since SDL 3.2.10.
*/
#define SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT"
/**
* A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint
* should be used.
@@ -4360,7 +4398,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void);
* \sa SDL_SetHint
* \sa SDL_SetHintWithPriority
*/
extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name);
extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
/**
* Get the boolean value of a hint variable.

View File

@@ -41,8 +41,8 @@
* "system", "audio", "video", "render", "input", "test", or `*` for any
* unspecified category.
*
* The level can be a numeric level, one of "verbose", "debug", "info",
* "warn", "error", "critical", or "quiet" to disable that category.
* The level can be a numeric level, one of "trace", "verbose", "debug",
* "info", "warn", "error", "critical", or "quiet" to disable that category.
*
* You can omit the category if you want to set the logging level for all
* categories.
@@ -56,6 +56,15 @@
* - Windows: debug output stream
* - Android: log output
* - Others: standard error output (stderr)
*
* You don't need to have a newline (`\n`) on the end of messages, the
* functions will do that for you. For consistent behavior cross-platform, you
* shouldn't have any newlines in messages, such as to log multiple lines in
* one call; unusual platform-specific behavior can be observed in such usage.
* Do one log call per line instead, with no newlines in messages.
*
* Each log call is atomic, so you won't see log messages cut off one another
* when logging from multiple threads.
*/
#ifndef SDL_log_h_

View File

@@ -28,6 +28,9 @@
* should look like this:
*
* ```c
* #include <SDL3/SDL.h>
* #include <SDL3/SDL_main.h>
*
* int main(int argc, char *argv[])
* {
* }
@@ -38,9 +41,9 @@
* This is also where an app can be configured to use the main callbacks, via
* the SDL_MAIN_USE_CALLBACKS macro.
*
* This is a "single-header library," which is to say that including this
* header inserts code into your program, and you should only include it once
* in most cases. SDL.h does not include this header automatically.
* SDL_main.h is a "single-header library," which is to say that including
* this header inserts code into your program, and you should only include it
* once in most cases. SDL.h does not include this header automatically.
*
* For more information, see:
*

View File

@@ -353,7 +353,7 @@ extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetRelativeMouseState(float
*
* \sa SDL_WarpMouseGlobal
*/
extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window *window,
float x, float y);
/**
@@ -514,8 +514,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_CaptureMouse(bool enabled);
* \sa SDL_DestroyCursor
* \sa SDL_SetCursor
*/
extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data,
const Uint8 * mask,
extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 *data,
const Uint8 *mask,
int w, int h, int hot_x,
int hot_y);

View File

@@ -676,6 +676,9 @@ typedef enum SDL_PixelFormat
SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fu, /**< Android video texture format */
/* SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') */
SDL_PIXELFORMAT_MJPG = 0x47504a4du, /**< Motion JPEG */
/* SDL_DEFINE_PIXELFOURCC('M', 'J', 'P', 'G') */
/* Aliases for RGBA byte arrays of color data, for the current platform */
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,

View File

@@ -471,8 +471,6 @@
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_PLATFORM_3DS 1
#undef __3DS__
#endif
#endif /* SDL_platform_defines_h_ */

View File

@@ -79,6 +79,10 @@ typedef enum SDL_PowerState
* It's possible a platform can only report battery percentage or time left
* but not both.
*
* On some platforms, retrieving power supply details might be expensive. If
* you want to display continuous status you could call this function every
* minute or so.
*
* \param seconds a pointer filled in with the seconds of battery life left,
* or NULL to ignore. This will be filled in with -1 if we
* can't determine a value or there is no battery.

View File

@@ -103,7 +103,7 @@ typedef struct SDL_Process SDL_Process;
* \sa SDL_WaitProcess
* \sa SDL_DestroyProcess
*/
extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, bool pipe_stdio);
extern SDL_DECLSPEC SDL_Process * SDLCALL SDL_CreateProcess(const char * const *args, bool pipe_stdio);
/**
* Description of where standard I/O should be directed when creating a
@@ -173,13 +173,13 @@ typedef enum SDL_ProcessIO
* standard input when `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` is set to
* `SDL_PROCESS_STDIO_REDIRECT`.
* - `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER`: an SDL_ProcessIO value
* describing where standard output for the process goes go, defaults to
* describing where standard output for the process goes to, defaults to
* `SDL_PROCESS_STDIO_INHERITED`.
* - `SDL_PROP_PROCESS_CREATE_STDOUT_POINTER`: an SDL_IOStream pointer used
* for standard output when `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` is set
* to `SDL_PROCESS_STDIO_REDIRECT`.
* - `SDL_PROP_PROCESS_CREATE_STDERR_NUMBER`: an SDL_ProcessIO value
* describing where standard error for the process goes go, defaults to
* describing where standard error for the process goes to, defaults to
* `SDL_PROCESS_STDIO_INHERITED`.
* - `SDL_PROP_PROCESS_CREATE_STDERR_POINTER`: an SDL_IOStream pointer used
* for standard error when `SDL_PROP_PROCESS_CREATE_STDERR_NUMBER` is set to
@@ -215,7 +215,7 @@ typedef enum SDL_ProcessIO
* \sa SDL_WaitProcess
* \sa SDL_DestroyProcess
*/
extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcessWithProperties(SDL_PropertiesID props);
extern SDL_DECLSPEC SDL_Process * SDLCALL SDL_CreateProcessWithProperties(SDL_PropertiesID props);
#define SDL_PROP_PROCESS_CREATE_ARGS_POINTER "SDL.process.create.args"
#define SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER "SDL.process.create.environment"
@@ -320,7 +320,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ReadProcess(SDL_Process *process, size_t
* \sa SDL_CreateProcessWithProperties
* \sa SDL_GetProcessOutput
*/
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessInput(SDL_Process *process);
extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_GetProcessInput(SDL_Process *process);
/**
* Get the SDL_IOStream associated with process standard output.
@@ -344,7 +344,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessInput(SDL_Process *proce
* \sa SDL_CreateProcessWithProperties
* \sa SDL_GetProcessInput
*/
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *process);
extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_GetProcessOutput(SDL_Process *process);
/**
* Stop a process.

View File

@@ -371,7 +371,7 @@ SDL_FORCE_INLINE bool SDL_RectEmptyFloat(const SDL_FRect *r)
*
* \sa SDL_RectsEqualFloat
*/
SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, float epsilon)
{
return (a && b && ((a == b) ||
((SDL_fabsf(a->x - b->x) <= epsilon) &&

View File

@@ -490,6 +490,9 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende
* This returns the true output size in pixels, ignoring any render targets or
* logical size and presentation.
*
* For the output size of the current rendering target, with logical size
* adjustments, use SDL_GetCurrentRenderOutputSize() instead.
*
* \param renderer the rendering context.
* \param w a pointer filled in with the width in pixels.
* \param h a pointer filled in with the height in pixels.
@@ -508,9 +511,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer,
* Get the current output size in pixels of a rendering context.
*
* If a rendering target is active, this will return the size of the rendering
* target in pixels, otherwise if a logical size is set, it will return the
* logical size, otherwise it will return the value of
* SDL_GetRenderOutputSize().
* target in pixels, otherwise return the value of SDL_GetRenderOutputSize().
*
* Rendering target or not, the output will be adjusted by the current logical
* presentation state, dictated by SDL_SetRenderLogicalPresentation().
*
* \param renderer the rendering context.
* \param w a pointer filled in with the current width.
@@ -1318,6 +1322,11 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture);
* To stop rendering to a texture and render to the window again, call this
* function with a NULL `texture`.
*
* Viewport, cliprect, scale, and logical presentation are unique to each
* render target. Get and set functions for these states apply to the current
* render target set by this function, and those states persist on each target
* when the current render target changes.
*
* \param renderer the rendering context.
* \param texture the targeted texture, which must be created with the
* `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the
@@ -1351,25 +1360,39 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL
extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
/**
* Set a device independent resolution and presentation mode for rendering.
* Set a device-independent resolution and presentation mode for rendering.
*
* This function sets the width and height of the logical rendering output.
* The renderer will act as if the window is always the requested dimensions,
* scaling to the actual window resolution as necessary.
* The renderer will act as if the current render target is always the
* requested dimensions, scaling to the actual resolution as necessary.
*
* This can be useful for games that expect a fixed size, but would like to
* scale the output to whatever is available, regardless of how a user resizes
* a window, or if the display is high DPI.
*
* Logical presentation can be used with both render target textures and the
* renderer's window; the state is unique to each render target, and this
* function sets the state for the current render target. It might be useful
* to draw to a texture that matches the window dimensions with logical
* presentation enabled, and then draw that texture across the entire window
* with logical presentation disabled. Be careful not to render both with
* logical presentation enabled, however, as this could produce
* double-letterboxing, etc.
*
* You can disable logical coordinates by setting the mode to
* SDL_LOGICAL_PRESENTATION_DISABLED, and in that case you get the full pixel
* resolution of the output window; it is safe to toggle logical presentation
* resolution of the render target; it is safe to toggle logical presentation
* during the rendering of a frame: perhaps most of the rendering is done to
* specific dimensions but to make fonts look sharp, the app turns off logical
* presentation while drawing text.
* presentation while drawing text, for example.
*
* Letterboxing will only happen if logical presentation is enabled during
* SDL_RenderPresent; be sure to reenable it first if you were using it.
* For the renderer's window, letterboxing is drawn into the framebuffer if
* logical presentation is enabled during SDL_RenderPresent; be sure to
* reenable it before presenting if you were toggling it, otherwise the
* letterbox areas might have artifacts from previous frames (or artifacts
* from external overlays, etc). Letterboxing is never drawn into texture
* render targets; be sure to call SDL_RenderClear() before drawing into the
* texture so the letterboxing areas are cleared, if appropriate.
*
* You can convert coordinates in an event into rendering coordinates using
* SDL_ConvertEventToRenderCoordinates().
@@ -1397,6 +1420,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *
* This function gets the width and height of the logical rendering output, or
* the output size in pixels if a logical resolution is not enabled.
*
* Each render target has its own logical presentation state. This function
* gets the state for the current render target.
*
* \param renderer the rendering context.
* \param w an int to be filled with the width.
* \param h an int to be filled with the height.
@@ -1420,6 +1446,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *
* presentation is disabled, it will fill the rectangle with the output size,
* in pixels.
*
* Each render target has its own logical presentation state. This function
* gets the rectangle for the current render target.
*
* \param renderer the rendering context.
* \param rect a pointer filled in with the final presentation rectangle, may
* be NULL.
@@ -1536,6 +1565,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Rendere
*
* The area's width and height must be >= 0.
*
* Each render target has its own viewport. This function sets the viewport
* for the current render target.
*
* \param renderer the rendering context.
* \param rect the SDL_Rect structure representing the drawing area, or NULL
* to set the viewport to the entire target.
@@ -1554,6 +1586,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, c
/**
* Get the drawing area for the current target.
*
* Each render target has its own viewport. This function gets the viewport
* for the current render target.
*
* \param renderer the rendering context.
* \param rect an SDL_Rect structure filled in with the current drawing area.
* \returns true on success or false on failure; call SDL_GetError() for more
@@ -1575,6 +1610,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, S
* whether you should restore a specific rectangle or NULL. Note that the
* viewport is always reset when changing rendering targets.
*
* Each render target has its own viewport. This function checks the viewport
* for the current render target.
*
* \param renderer the rendering context.
* \returns true if the viewport was set to a specific rectangle, or false if
* it was set to NULL (the entire target).
@@ -1613,6 +1651,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, S
/**
* Set the clip rectangle for rendering on the specified target.
*
* Each render target has its own clip rectangle. This function sets the
* cliprect for the current render target.
*
* \param renderer the rendering context.
* \param rect an SDL_Rect structure representing the clip area, relative to
* the viewport, or NULL to disable clipping.
@@ -1631,6 +1672,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, c
/**
* Get the clip rectangle for the current target.
*
* Each render target has its own clip rectangle. This function gets the
* cliprect for the current render target.
*
* \param renderer the rendering context.
* \param rect an SDL_Rect structure filled in with the current clipping area
* or an empty rectangle if clipping is disabled.
@@ -1647,7 +1691,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, c
extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect);
/**
* Get whether clipping is enabled on the given renderer.
* Get whether clipping is enabled on the given render target.
*
* Each render target has its own clip rectangle. This function checks the
* cliprect for the current render target.
*
* \param renderer the rendering context.
* \returns true if clipping is enabled or false if not; call SDL_GetError()
@@ -1673,6 +1720,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *renderer);
* will be handled using the appropriate quality hints. For best results use
* integer scaling factors.
*
* Each render target has its own scale. This function sets the scale for the
* current render target.
*
* \param renderer the rendering context.
* \param scaleX the horizontal scaling factor.
* \param scaleY the vertical scaling factor.
@@ -1690,6 +1740,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, floa
/**
* Get the drawing scale for the current target.
*
* Each render target has its own scale. This function gets the scale for the
* current render target.
*
* \param renderer the rendering context.
* \param scaleX a pointer filled in with the horizontal scaling factor.
* \param scaleY a pointer filled in with the vertical scaling factor.
@@ -2247,15 +2300,21 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
/**
* Read pixels from the current rendering target.
*
* The returned surface should be freed with SDL_DestroySurface()
* The returned surface contains pixels inside the desired area clipped to the
* current viewport, and should be freed with SDL_DestroySurface().
*
* Note that this returns the actual pixels on the screen, so if you are using
* logical presentation you should use SDL_GetRenderLogicalPresentationRect()
* to get the area containing your content.
*
* **WARNING**: This is a very slow operation, and should not be used
* frequently. If you're using this on the main rendering target, it should be
* called after rendering and before SDL_RenderPresent().
*
* \param renderer the rendering context.
* \param rect an SDL_Rect structure representing the area in pixels relative
* to the to current viewport, or NULL for the entire viewport.
* \param rect an SDL_Rect structure representing the area to read, which will
* be clipped to the current viewport, or NULL for the entire
* viewport.
* \returns a new SDL_Surface on success or NULL on failure; call
* SDL_GetError() for more information.
*

View File

@@ -48,9 +48,9 @@
*/
#define SDL_REVISION "Some arbitrary string decided at SDL build time"
#elif defined(SDL_VENDOR_INFO)
#define SDL_REVISION "release-3.2.0-0-g535d80bad (" SDL_VENDOR_INFO ")"
#define SDL_REVISION "release-3.2.10-0-g877399b2b (" SDL_VENDOR_INFO ")"
#else
#define SDL_REVISION "release-3.2.0-0-g535d80bad"
#define SDL_REVISION "release-3.2.10-0-g877399b2b"
#endif
#endif /* SDL_revision_h_ */

View File

@@ -1299,8 +1299,11 @@ extern "C" {
*
* If `size` is 0, it will be set to 1.
*
* If you want to allocate memory aligned to a specific alignment, consider
* using SDL_aligned_alloc().
* If the allocation is successful, the returned pointer is guaranteed to be
* aligned to either the *fundamental alignment* (`alignof(max_align_t)` in
* C11 and later) or `2 * sizeof(void *)`, whichever is smaller. Use
* SDL_aligned_alloc() if you need to allocate memory aligned to an alignment
* greater than this guarantee.
*
* \param size the size to allocate.
* \returns a pointer to the allocated memory, or NULL if allocation failed.
@@ -1323,6 +1326,10 @@ extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_malloc(size_t size);
*
* If either of `nmemb` or `size` is 0, they will both be set to 1.
*
* If the allocation is successful, the returned pointer is guaranteed to be
* aligned to either the *fundamental alignment* (`alignof(max_align_t)` in
* C11 and later) or `2 * sizeof(void *)`, whichever is smaller.
*
* \param nmemb the number of elements in the array.
* \param size the size of each element of the array.
* \returns a pointer to the allocated array, or NULL if allocation failed.
@@ -1357,6 +1364,11 @@ extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void * SDLCALL SDL_calloc(s
* - If it returns NULL (indicating failure), then `mem` will remain valid and
* must still be freed with SDL_free().
*
* If the allocation is successfully resized, the returned pointer is
* guaranteed to be aligned to either the *fundamental alignment*
* (`alignof(max_align_t)` in C11 and later) or `2 * sizeof(void *)`,
* whichever is smaller.
*
* \param mem a pointer to allocated memory to reallocate, or NULL.
* \param size the new size of the memory.
* \returns a pointer to the newly allocated memory, or NULL if allocation
@@ -4243,14 +4255,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STR
/**
* Seeds the pseudo-random number generator.
*
* Reusing the seed number will cause SDL_rand_*() to repeat the same stream
* of 'random' numbers.
* Reusing the seed number will cause SDL_rand() to repeat the same stream of
* 'random' numbers.
*
* \param seed the value to use as a random number seed, or 0 to use
* SDL_GetPerformanceCounter().
*
* \threadsafety This should be called on the same thread that calls
* SDL_rand*()
* SDL_rand()
*
* \since This function is available since SDL 3.2.0.
*
@@ -4701,7 +4713,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_atan2(double y, double x);
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_atan2f
* \sa SDL_atan2
* \sa SDL_atan
* \sa SDL_tan
*/
@@ -4810,7 +4822,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_copysign(double x, double y);
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_copysignf
* \sa SDL_copysign
* \sa SDL_fabsf
*/
extern SDL_DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
@@ -4943,7 +4955,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_expf(float x);
* Range: `0 <= y <= INF`
*
* This function operates on double-precision floating point values, use
* SDL_copysignf for single-precision floats.
* SDL_fabsf for single-precision floats.
*
* \param x floating point value to use as the magnitude.
* \returns the absolute value of `x`.
@@ -4964,7 +4976,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_fabs(double x);
* Range: `0 <= y <= INF`
*
* This function operates on single-precision floating point values, use
* SDL_copysignf for double-precision floats.
* SDL_fabs for double-precision floats.
*
* \param x floating point value to use as the magnitude.
* \returns the absolute value of `x`.
@@ -5016,7 +5028,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_floor(double x);
* Range: `-INF <= y <= INF`, y integer
*
* This function operates on single-precision floating point values, use
* SDL_floorf for double-precision floats.
* SDL_floor for double-precision floats.
*
* \param x floating point value.
* \returns the floor of `x`.
@@ -5073,7 +5085,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_trunc(double x);
* Range: `-INF <= y <= INF`, y integer
*
* This function operates on single-precision floating point values, use
* SDL_truncf for double-precision floats.
* SDL_trunc for double-precision floats.
*
* \param x floating point value.
* \returns `x` truncated to an integer.
@@ -5131,7 +5143,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_fmod(double x, double y);
* Range: `-y <= z <= y`
*
* This function operates on single-precision floating point values, use
* SDL_fmod for single-precision floats.
* SDL_fmod for double-precision floats.
*
* \param x the numerator.
* \param y the denominator. Must not be 0.
@@ -5409,7 +5421,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_pow(double x, double y);
* instead.
*
* This function operates on single-precision floating point values, use
* SDL_powf for double-precision floats.
* SDL_pow for double-precision floats.
*
* This function may use a different approximation across different versions,
* platforms and configurations. i.e, it can return a different value given
@@ -5469,8 +5481,8 @@ extern SDL_DECLSPEC double SDLCALL SDL_round(double x);
*
* Range: `-INF <= y <= INF`, y integer
*
* This function operates on double-precision floating point values, use
* SDL_roundf for single-precision floats. To get the result as an integer
* This function operates on single-precision floating point values, use
* SDL_round for double-precision floats. To get the result as an integer
* type, use SDL_lroundf.
*
* \param x floating point value.
@@ -5499,7 +5511,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_roundf(float x);
* Range: `MIN_LONG <= y <= MAX_LONG`
*
* This function operates on double-precision floating point values, use
* SDL_lround for single-precision floats. To get the result as a
* SDL_lroundf for single-precision floats. To get the result as a
* floating-point type, use SDL_round.
*
* \param x floating point value.
@@ -5528,8 +5540,8 @@ extern SDL_DECLSPEC long SDLCALL SDL_lround(double x);
* Range: `MIN_LONG <= y <= MAX_LONG`
*
* This function operates on single-precision floating point values, use
* SDL_lroundf for double-precision floats. To get the result as a
* floating-point type, use SDL_roundf,
* SDL_lround for double-precision floats. To get the result as a
* floating-point type, use SDL_roundf.
*
* \param x floating point value.
* \returns the nearest integer to `x`.
@@ -5742,7 +5754,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_tan(double x);
* Range: `-INF <= y <= INF`
*
* This function operates on single-precision floating point values, use
* SDL_tanf for double-precision floats.
* SDL_tan for double-precision floats.
*
* This function may use a different approximation across different versions,
* platforms and configurations. i.e, it can return a different value given
@@ -5969,7 +5981,6 @@ char *strdup(const char *str);
their prototype defined (clang-diagnostic-implicit-function-declaration) */
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#define SDL_malloc malloc
#define SDL_calloc calloc

View File

@@ -450,7 +450,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_CloseStorage(SDL_Storage *storage);
*
* This function should be called in regular intervals until it returns true -
* however, it is not recommended to spinwait on this call, as the backend may
* depend on a synchronous message loop.
* depend on a synchronous message loop. You might instead poll this in your
* game's main loop while processing events and drawing a loading screen.
*
* \param storage a storage container to query.
* \returns true if the container is ready, false otherwise.
@@ -636,10 +637,10 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto
* Enumerate a directory tree, filtered by pattern, and return a list.
*
* Files are filtered out if they don't match the string in `pattern`, which
* may contain wildcard characters '*' (match everything) and '?' (match one
* may contain wildcard characters `*` (match everything) and `?` (match one
* character). If pattern is NULL, no filtering is done and all results are
* returned. Subdirectories are permitted, and are specified with a path
* separator of '/'. Wildcard characters '*' and '?' never match a path
* separator of '/'. Wildcard characters `*` and `?` never match a path
* separator.
*
* `flags` may be set to SDL_GLOB_CASEINSENSITIVE to make the pattern matching

View File

@@ -73,7 +73,7 @@ typedef Uint32 SDL_SurfaceFlags;
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_MUSTLOCK(S) ((((S)->flags & SDL_SURFACE_LOCK_NEEDED)) == SDL_SURFACE_LOCK_NEEDED)
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_SURFACE_LOCK_NEEDED) == SDL_SURFACE_LOCK_NEEDED)
/**
* The scaling mode.
@@ -82,6 +82,7 @@ typedef Uint32 SDL_SurfaceFlags;
*/
typedef enum SDL_ScaleMode
{
SDL_SCALEMODE_INVALID = -1,
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
SDL_SCALEMODE_LINEAR /**< linear filtering */
} SDL_ScaleMode;
@@ -120,6 +121,9 @@ typedef enum SDL_FlipMode
* format with a pitch of 32 would consist of 32x32 bytes of Y plane followed
* by 32x16 bytes of UV plane.
*
* When a surface holds MJPG format data, pixels points at the compressed JPEG
* image and pitch is the length of that data.
*
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_CreateSurface
@@ -153,6 +157,8 @@ typedef struct SDL_Surface SDL_Surface;
* \returns the new SDL_Surface structure that is created or NULL on failure;
* call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateSurfaceFrom
@@ -181,6 +187,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_CreateSurface(int width, int heigh
* \returns the new SDL_Surface structure that is created or NULL on failure;
* call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateSurface
@@ -195,6 +203,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_CreateSurfaceFrom(int width, int h
*
* \param surface the SDL_Surface to free.
*
* \threadsafety No other thread should be using the surface when it is freed.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateSurface
@@ -221,11 +231,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
* the same tone mapping that Chrome uses for HDR content, the form "*=N",
* where N is a floating point scale factor applied in linear space, and
* "none", which disables tone mapping. This defaults to "chrome".
* - `SDL_PROP_SURFACE_HOTSPOT_X_NUMBER`: the hotspot pixel offset from the
* left edge of the image, if this surface is being used as a cursor.
* - `SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER`: the hotspot pixel offset from the
* top edge of the image, if this surface is being used as a cursor.
*
* \param surface the SDL_Surface structure to query.
* \returns a valid property ID on success or 0 on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
@@ -233,6 +249,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac
#define SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT "SDL.surface.SDR_white_point"
#define SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT "SDL.surface.HDR_headroom"
#define SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING "SDL.surface.tonemap"
#define SDL_PROP_SURFACE_HOTSPOT_X_NUMBER "SDL.surface.hotspot.x"
#define SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER "SDL.surface.hotspot.y"
/**
* Set the colorspace used by a surface.
@@ -246,6 +264,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceColorspace
@@ -263,6 +283,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface,
* \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if
* the surface is NULL.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfaceColorspace
@@ -291,6 +313,8 @@ extern SDL_DECLSPEC SDL_Colorspace SDLCALL SDL_GetSurfaceColorspace(SDL_Surface
* the surface didn't have an index format); call SDL_GetError() for
* more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetPaletteColors
@@ -307,6 +331,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface *
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreatePalette
@@ -321,6 +347,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL
* \returns a pointer to the palette used by the surface, or NULL if there is
* no palette used.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfacePalette
@@ -344,6 +372,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_RemoveSurfaceAlternateImages
@@ -358,6 +388,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surfa
* \param surface the SDL_Surface structure to query.
* \returns true if alternate versions are available or false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AddSurfaceAlternateImage
@@ -383,6 +415,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasAlternateImages(SDL_Surface *surf
* failure; call SDL_GetError() for more information. This should be
* freed with SDL_free() when it is no longer needed.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AddSurfaceAlternateImage
@@ -399,6 +433,8 @@ extern SDL_DECLSPEC SDL_Surface ** SDLCALL SDL_GetSurfaceImages(SDL_Surface *sur
*
* \param surface the SDL_Surface structure to update.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AddSurfaceAlternateImage
@@ -423,6 +459,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe. The locking referred to by
* this function is making the pixels available for direct
* access, not thread-safe locking.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_MUSTLOCK
@@ -435,6 +475,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_LockSurface(SDL_Surface *surface);
*
* \param surface the SDL_Surface structure to be unlocked.
*
* \threadsafety This function is not thread safe. The locking referred to by
* this function is making the pixels available for direct
* access, not thread-safe locking.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockSurface
@@ -453,6 +497,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroySurface
@@ -471,6 +517,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, bool
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroySurface
@@ -495,6 +543,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LoadBMP_IO
@@ -516,6 +566,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStre
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LoadBMP
@@ -534,6 +586,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *f
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BlitSurface
@@ -550,6 +604,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, bool en
* \param surface the SDL_Surface structure to query.
* \returns true if the surface is RLE enabled, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfaceRLE
@@ -572,6 +628,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceColorKey
@@ -588,6 +646,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, bo
* \param surface the SDL_Surface structure to query.
* \returns true if the surface has a color key, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfaceColorKey
@@ -608,6 +668,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfaceColorKey
@@ -631,6 +693,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Ui
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceColorMod
@@ -649,6 +713,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Ui
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceAlphaMod
@@ -669,6 +735,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Ui
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceAlphaMod
@@ -684,6 +752,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Ui
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceColorMod
@@ -703,6 +773,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Ui
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceBlendMode
@@ -717,6 +789,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, S
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfaceBlendMode
@@ -738,6 +812,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, S
* \returns true if the rectangle intersects the surface, otherwise false and
* blits will be completely clipped.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetSurfaceClipRect
@@ -757,6 +833,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, co
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetSurfaceClipRect
@@ -771,6 +849,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SD
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
@@ -787,6 +867,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipM
* \returns a copy of the surface or NULL on failure; call SDL_GetError() for
* more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroySurface
@@ -806,6 +888,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_DuplicateSurface(SDL_Surface *surf
* \returns a copy of the surface or NULL on failure; call SDL_GetError() for
* more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroySurface
@@ -831,6 +915,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ScaleSurface(SDL_Surface *surface,
* \returns the new SDL_Surface structure that is created or NULL on failure;
* call SDL_GetError() for more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ConvertSurfaceAndColorspace
@@ -857,6 +943,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface(SDL_Surface *surfac
* \returns the new SDL_Surface structure that is created or NULL on failure;
* call SDL_GetError() for more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ConvertSurface
@@ -878,6 +966,10 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Su
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination pixels should not be used from two
* threads at once. It is safe to use the same source pixels
* from multiple threads.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ConvertPixelsAndColorspace
@@ -907,6 +999,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixels(int width, int height, SDL_Pi
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination pixels should not be used from two
* threads at once. It is safe to use the same source pixels
* from multiple threads.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ConvertPixels
@@ -931,6 +1027,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, int h
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination pixels should not be used from two
* threads at once. It is safe to use the same source pixels
* from multiple threads.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear);
@@ -946,6 +1046,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear);
@@ -966,6 +1068,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surfac
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a);
@@ -989,6 +1093,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r,
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_FillSurfaceRects
@@ -1014,6 +1120,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_FillSurfaceRect
@@ -1087,9 +1195,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SD
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1112,9 +1219,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rec
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1137,9 +1243,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, cons
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1163,9 +1268,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const S
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1173,6 +1277,28 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const S
*/
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
/**
* Perform a stretched pixel copy from one surface to another.
*
* \param src the SDL_Surface structure to be copied from.
* \param srcrect the SDL_Rect structure representing the rectangle to be
* copied, may not be NULL.
* \param dst the SDL_Surface structure that is the blit target.
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, may not be NULL.
* \param scaleMode the SDL_ScaleMode to be used.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.4.0.
*
* \sa SDL_BlitSurfaceScaled
*/
extern SDL_DECLSPEC bool SDLCALL SDL_StretchSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
/**
* Perform a tiled blit to a destination surface, which may be of a different
* format.
@@ -1189,9 +1315,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1219,9 +1344,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SD
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1256,9 +1380,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src,
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
* at any given time.
*
* \since This function is available since SDL 3.2.0.
*
@@ -1290,6 +1413,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SD
* \param b the blue component of the pixel in the range 0-255.
* \returns a pixel value.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_MapSurfaceRGBA
@@ -1321,6 +1446,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8
* \param a the alpha component of the pixel in the range 0-255.
* \returns a pixel value.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_MapSurfaceRGB
@@ -1350,6 +1477,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
@@ -1374,6 +1503,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a);
@@ -1397,6 +1528,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface,
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
@@ -1417,6 +1550,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);

View File

@@ -177,7 +177,7 @@ extern "C" {
*
* \returns a newly allocated common state object.
*/
SDLTest_CommonState *SDLCALL SDLTest_CommonCreateState(char **argv, SDL_InitFlags flags);
SDLTest_CommonState * SDLCALL SDLTest_CommonCreateState(char **argv, SDL_InitFlags flags);
/**
* Free the common state object.

View File

@@ -139,7 +139,7 @@ typedef enum SDL_ThreadState
*
* \since This datatype is available since SDL 3.2.0.
*/
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
typedef int (SDLCALL *SDL_ThreadFunction) (void *data);
#ifdef SDL_WIKI_DOCUMENTATION_SECTION

View File

@@ -118,7 +118,7 @@ typedef void (SDLCALL *SDL_TrayCallback)(void *userdata, SDL_TrayEntry *entry);
* \sa SDL_GetTrayMenu
* \sa SDL_DestroyTray
*/
extern SDL_DECLSPEC SDL_Tray *SDLCALL SDL_CreateTray(SDL_Surface *icon, const char *tooltip);
extern SDL_DECLSPEC SDL_Tray * SDLCALL SDL_CreateTray(SDL_Surface *icon, const char *tooltip);
/**
* Updates the system tray icon's icon.
@@ -172,7 +172,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayTooltip(SDL_Tray *tray, const char *
* \sa SDL_GetTrayMenu
* \sa SDL_GetTrayMenuParentTray
*/
extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_CreateTrayMenu(SDL_Tray *tray);
extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_CreateTrayMenu(SDL_Tray *tray);
/**
* Create a submenu for a system tray entry.
@@ -196,7 +196,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_CreateTrayMenu(SDL_Tray *tray);
* \sa SDL_GetTraySubmenu
* \sa SDL_GetTrayMenuParentEntry
*/
extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_CreateTraySubmenu(SDL_TrayEntry *entry);
extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_CreateTraySubmenu(SDL_TrayEntry *entry);
/**
* Gets a previously created tray menu.
@@ -220,7 +220,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_CreateTraySubmenu(SDL_TrayEntry *e
* \sa SDL_CreateTray
* \sa SDL_CreateTrayMenu
*/
extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTrayMenu(SDL_Tray *tray);
extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_GetTrayMenu(SDL_Tray *tray);
/**
* Gets a previously created tray entry submenu.
@@ -244,14 +244,14 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTrayMenu(SDL_Tray *tray);
* \sa SDL_InsertTrayEntryAt
* \sa SDL_CreateTraySubmenu
*/
extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTraySubmenu(SDL_TrayEntry *entry);
extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_GetTraySubmenu(SDL_TrayEntry *entry);
/**
* Returns a list of entries in the menu, in order.
*
* \param menu The menu to get entries from.
* \param size An optional pointer to obtain the number of entries in the
* menu.
* \param count An optional pointer to obtain the number of entries in the
* menu.
* \returns a NULL-terminated list of entries within the given menu. The
* pointer becomes invalid when any function that inserts or deletes
* entries in the menu is called.
@@ -264,7 +264,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTraySubmenu(SDL_TrayEntry *entr
* \sa SDL_RemoveTrayEntry
* \sa SDL_InsertTrayEntryAt
*/
extern SDL_DECLSPEC const SDL_TrayEntry **SDLCALL SDL_GetTrayEntries(SDL_TrayMenu *menu, int *size);
extern SDL_DECLSPEC const SDL_TrayEntry ** SDLCALL SDL_GetTrayEntries(SDL_TrayMenu *menu, int *count);
/**
* Removes a tray entry.
@@ -307,7 +307,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveTrayEntry(SDL_TrayEntry *entry);
* \sa SDL_RemoveTrayEntry
* \sa SDL_GetTrayEntryParent
*/
extern SDL_DECLSPEC SDL_TrayEntry *SDLCALL SDL_InsertTrayEntryAt(SDL_TrayMenu *menu, int pos, const char *label, SDL_TrayEntryFlags flags);
extern SDL_DECLSPEC SDL_TrayEntry * SDLCALL SDL_InsertTrayEntryAt(SDL_TrayMenu *menu, int pos, const char *label, SDL_TrayEntryFlags flags);
/**
* Sets the label of an entry.
@@ -348,7 +348,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryLabel(SDL_TrayEntry *entry, con
* \sa SDL_InsertTrayEntryAt
* \sa SDL_SetTrayEntryLabel
*/
extern SDL_DECLSPEC const char *SDLCALL SDL_GetTrayEntryLabel(SDL_TrayEntry *entry);
extern SDL_DECLSPEC const char * SDLCALL SDL_GetTrayEntryLabel(SDL_TrayEntry *entry);
/**
* Sets whether or not an entry is checked.
@@ -481,7 +481,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyTray(SDL_Tray *tray);
*
* \sa SDL_InsertTrayEntryAt
*/
extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTrayEntryParent(SDL_TrayEntry *entry);
extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_GetTrayEntryParent(SDL_TrayEntry *entry);
/**
* Gets the entry for which the menu is a submenu, if the current menu is a
@@ -501,7 +501,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTrayEntryParent(SDL_TrayEntry *
* \sa SDL_CreateTraySubmenu
* \sa SDL_GetTrayMenuParentTray
*/
extern SDL_DECLSPEC SDL_TrayEntry *SDLCALL SDL_GetTrayMenuParentEntry(SDL_TrayMenu *menu);
extern SDL_DECLSPEC SDL_TrayEntry * SDLCALL SDL_GetTrayMenuParentEntry(SDL_TrayMenu *menu);
/**
* Gets the tray for which this menu is the first-level menu, if the current
@@ -521,7 +521,7 @@ extern SDL_DECLSPEC SDL_TrayEntry *SDLCALL SDL_GetTrayMenuParentEntry(SDL_TrayMe
* \sa SDL_CreateTrayMenu
* \sa SDL_GetTrayMenuParentEntry
*/
extern SDL_DECLSPEC SDL_Tray *SDLCALL SDL_GetTrayMenuParentTray(SDL_TrayMenu *menu);
extern SDL_DECLSPEC SDL_Tray * SDLCALL SDL_GetTrayMenuParentTray(SDL_TrayMenu *menu);
/**
* Update the trays.

View File

@@ -62,7 +62,7 @@ extern "C" {
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_MICRO_VERSION 0
#define SDL_MICRO_VERSION 10
/**
* This macro turns the version numbers into a numeric value.

View File

@@ -226,7 +226,7 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension
extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR* surface);
VkSurfaceKHR *surface);
/**
* Destroy the Vulkan rendering surface of a window.

View File

@@ -83,9 +83,9 @@ foreign lib {
OpenAudioDevice :: proc(devid: AudioDeviceID, spec: ^AudioSpec) -> AudioDeviceID ---
IsAudioDevicePhysical :: proc(devid: AudioDeviceID) -> bool ---
IsAudioDevicePlayback :: proc(devid: AudioDeviceID) -> bool ---
PauseAudioDevice :: proc(dev: AudioDeviceID) -> bool ---
ResumeAudioDevice :: proc(dev: AudioDeviceID) -> bool ---
AudioDevicePaused :: proc(dev: AudioDeviceID) -> bool ---
PauseAudioDevice :: proc(devid: AudioDeviceID) -> bool ---
ResumeAudioDevice :: proc(devid: AudioDeviceID) -> bool ---
AudioDevicePaused :: proc(devid: AudioDeviceID) -> bool ---
GetAudioDeviceGain :: proc(devid: AudioDeviceID) -> f32 ---
SetAudioDeviceGain :: proc(devid: AudioDeviceID, gain: f32) -> bool ---
CloseAudioDevice :: proc(devid: AudioDeviceID) ---

View File

@@ -27,7 +27,7 @@ foreign lib {
GetCameraDriver :: proc(index: c.int) -> cstring ---
GetCurrentCameraDriver :: proc() -> cstring ---
GetCameras :: proc(count: ^c.int) -> [^]CameraID ---
GetCameraSupportedFormats :: proc(devid: CameraID, count: ^c.int) -> [^]^CameraSpec ---
GetCameraSupportedFormats :: proc(instance_id: CameraID, count: ^c.int) -> [^]^CameraSpec ---
GetCameraName :: proc(instance_id: CameraID) -> cstring ---
GetCameraPosition :: proc(instance_id: CameraID) -> CameraPosition ---
OpenCamera :: proc(instance_id: CameraID, spec: ^CameraSpec) -> ^Camera ---

View File

@@ -516,7 +516,7 @@ GPUVertexBufferDescription :: struct {
slot: Uint32, /**< The binding slot of the vertex buffer. */
pitch: Uint32, /**< The byte pitch between consecutive elements of the vertex buffer. */
input_rate: GPUVertexInputRate, /**< Whether attribute addressing is a function of the vertex index or instance index. */
instance_step_rate: Uint32, /**< 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 GPU_VERTEXINPUTRATE_INSTANCE */
instance_step_rate: Uint32, /**< Reserved for future use. Must be set to 0. */
}
GPUVertexAttribute :: struct {
@@ -611,8 +611,8 @@ GPURasterizerState :: struct {
GPUMultisampleState :: struct {
sample_count: GPUSampleCount, /**< The number of samples to be used in rasterization. */
sample_mask: Uint32, /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. */
enable_mask: bool, /**< Enables sample masking. */
sample_mask: Uint32, /**< Reserved for future use. Must be set to 0. */
enable_mask: bool, /**< Reserved for future use. Must be set to false. */
_: Uint8,
_: Uint8,
_: Uint8,

View File

@@ -123,6 +123,7 @@ HINT_JOYSTICK_WGI :: "SDL_JOYSTICK_WGI"
HINT_JOYSTICK_WHEEL_DEVICES :: "SDL_JOYSTICK_WHEEL_DEVICES"
HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED :: "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED"
HINT_JOYSTICK_ZERO_CENTERED_DEVICES :: "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
HINT_JOYSTICK_HAPTIC_AXES :: "SDL_JOYSTICK_HAPTIC_AXES"
HINT_KEYCODE_OPTIONS :: "SDL_KEYCODE_OPTIONS"
HINT_KMSDRM_DEVICE_INDEX :: "SDL_KMSDRM_DEVICE_INDEX"
HINT_KMSDRM_REQUIRE_DRM_MASTER :: "SDL_KMSDRM_REQUIRE_DRM_MASTER"
@@ -197,6 +198,7 @@ HINT_VIDEO_WAYLAND_MODE_SCALING :: "SDL_VIDEO_WAYLAND_MODE_SCALING"
HINT_VIDEO_WAYLAND_PREFER_LIBDECOR :: "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY :: "SDL_VIDEO_WAYLAND_SCALE_TO_DISPLAY"
HINT_VIDEO_WIN_D3DCOMPILER :: "SDL_VIDEO_WIN_D3DCOMPILER"
HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT :: "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT"
HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR :: "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
HINT_VIDEO_X11_NET_WM_PING :: "SDL_VIDEO_X11_NET_WM_PING"
HINT_VIDEO_X11_NODIRECTCOLOR :: "SDL_VIDEO_X11_NODIRECTCOLOR"

View File

@@ -277,6 +277,8 @@ PixelFormat :: enum c.int {
/* SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'), */
EXTERNAL_OES = 0x2053454f, /**< Android video texture format */
/* SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') */
MJPG = 0x47504a4d, /**< Motion JPEG */
/* SDL_DEFINE_PIXELFOURCC('M', 'J', 'P', 'G') */
/* Aliases for RGBA byte arrays of color data, for the current platform */
RGBA32 = RGBA8888 when BYTEORDER == BIG_ENDIAN else ABGR8888,

View File

@@ -22,6 +22,7 @@ MUSTLOCK :: proc "c" (S: ^Surface) -> bool {
}
ScaleMode :: enum c.int {
INVALID = -1,
NEAREST, /**< nearest pixel sampling */
LINEAR, /**< linear filtering */
}
@@ -45,6 +46,11 @@ Surface :: struct {
reserved: rawptr, /**< Reserved for internal use */
}
PROP_SURFACE_SDR_WHITE_POINT_FLOAT :: "SDL.surface.SDR_white_point"
PROP_SURFACE_HDR_HEADROOM_FLOAT :: "SDL.surface.HDR_headroom"
PROP_SURFACE_TONEMAP_OPERATOR_STRING :: "SDL.surface.tonemap"
PROP_SURFACE_HOTSPOT_X_NUMBER :: "SDL.surface.hotspot.x"
PROP_SURFACE_HOTSPOT_Y_NUMBER :: "SDL.surface.hotspot.y"
@(default_calling_convention="c", link_prefix="SDL_")
foreign lib {
@@ -96,6 +102,7 @@ foreign lib {
BlitSurfaceUnchecked :: proc(src: ^Surface, srcrect: Maybe(^Rect), dst: ^Surface, dstrect: Maybe(^Rect)) -> bool ---
BlitSurfaceScaled :: proc(src: ^Surface, srcrect: Maybe(^Rect), dst: ^Surface, dstrect: Maybe(^Rect), scaleMode: ScaleMode) -> bool ---
BlitSurfaceUncheckedScaled :: proc(src: ^Surface, srcrect: Maybe(^Rect), dst: ^Surface, dstrect: Maybe(^Rect), scaleMode: ScaleMode) -> bool ---
StretchSurface :: proc(src: ^Surface, srcrect: Maybe(^Rect), dst: ^Surface, dstrect: Maybe(^Rect), scaleMode: ScaleMode) -> bool ---
BlitSurfaceTiled :: proc(src: ^Surface, srcrect: Maybe(^Rect), dst: ^Surface, dstrect: Maybe(^Rect)) -> bool ---
BlitSurfaceTiledWithScale :: proc(src: ^Surface, srcrect: Maybe(^Rect), scale: f32, scaleMode: ScaleMode, dst: ^Surface, dstrect: Maybe(^Rect)) -> bool ---
BlitSurface9Grid :: proc(src: ^Surface, srcrect: Maybe(^Rect), left_width, right_width, top_height, bottom_height: c.int, scale: f32, scaleMode: ScaleMode, dst: ^Surface, dstrect: Maybe(^Rect)) -> bool ---

View File

@@ -4,7 +4,7 @@ import "core:c"
MAJOR_VERSION :: 3
MINOR_VERSION :: 2
MICRO_VERSION :: 2
MICRO_VERSION :: 10
@(require_results) VERSIONNUM :: #force_inline proc "c" (major, minor, patch: c.int) -> c.int { return (major * 1000000) + (minor * 1000) + patch }
@(require_results) VERSIONNUM_MAJOR :: #force_inline proc "c" (version: c.int) -> c.int { return version / 1000000 }