Skip to content

Commit e94e7ff

Browse files
authored
Merge branch 'libsdl-org:main' into main
2 parents e990378 + 329b5f2 commit e94e7ff

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

include/SDL3/SDL_begin_code.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@
261261
*
262262
* On compilers without restrict support, this is defined to nothing.
263263
*
264-
* \since This macro is available since SDL 3.2.0.
264+
* \since This macro is available since SDL 3.4.0.
265265
*/
266-
#define SDL_RESTRICT __restrict__
266+
#define SDL_RESTRICT __restrict
267267

268268
/**
269269
* Check if the compiler supports a given builtin functionality.
@@ -325,6 +325,17 @@
325325
/* end of wiki documentation section. */
326326
#endif
327327

328+
/* `restrict` is from C99, but __restrict works with both Visual Studio and GCC. */
329+
#ifndef SDL_RESTRICT
330+
# if defined(restrict) || ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
331+
# define SDL_RESTRICT restrict
332+
# elif defined(_MSC_VER) || defined(__GNUC__) || defined(__clang__)
333+
# define SDL_RESTRICT __restrict
334+
# else
335+
# define SDL_RESTRICT
336+
# endif
337+
#endif
338+
328339
#ifndef SDL_HAS_BUILTIN
329340
#ifdef __has_builtin
330341
#define SDL_HAS_BUILTIN(x) __has_builtin(x)

include/SDL3/SDL_gpu.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ typedef struct SDL_GPUTextureRegion
14691469
*/
14701470
typedef struct SDL_GPUBlitRegion
14711471
{
1472-
SDL_GPUTexture *texture; /**< The texture. */
1472+
SDL_GPUTexture *texture; /**< The texture. */
14731473
Uint32 mip_level; /**< The mip level index of the region. */
14741474
Uint32 layer_or_depth_plane; /**< The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. */
14751475
Uint32 x; /**< The left offset of the region. */
@@ -1598,8 +1598,8 @@ typedef struct SDL_GPUSamplerCreateInfo
15981598
SDL_GPUCompareOp compare_op; /**< The comparison operator to apply to fetched data before filtering. */
15991599
float min_lod; /**< Clamps the minimum of the computed LOD value. */
16001600
float max_lod; /**< Clamps the maximum of the computed LOD value. */
1601-
bool enable_anisotropy; /**< true to enable anisotropic filtering. */
1602-
bool enable_compare; /**< true to enable comparison against a reference value during lookups. */
1601+
bool enable_anisotropy; /**< true to enable anisotropic filtering. */
1602+
bool enable_compare; /**< true to enable comparison against a reference value during lookups. */
16031603
Uint8 padding1;
16041604
Uint8 padding2;
16051605

@@ -1704,8 +1704,8 @@ typedef struct SDL_GPUColorTargetBlendState
17041704
SDL_GPUBlendFactor dst_alpha_blendfactor; /**< The value to be multiplied by the destination alpha. */
17051705
SDL_GPUBlendOp alpha_blend_op; /**< The blend operation for the alpha component. */
17061706
SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. */
1707-
bool enable_blend; /**< Whether blending is enabled for the color target. */
1708-
bool enable_color_write_mask; /**< Whether the color write mask is enabled. */
1707+
bool enable_blend; /**< Whether blending is enabled for the color target. */
1708+
bool enable_color_write_mask; /**< Whether the color write mask is enabled. */
17091709
Uint8 padding1;
17101710
Uint8 padding2;
17111711
} SDL_GPUColorTargetBlendState;
@@ -1824,8 +1824,8 @@ typedef struct SDL_GPURasterizerState
18241824
float depth_bias_constant_factor; /**< A scalar factor controlling the depth value added to each fragment. */
18251825
float depth_bias_clamp; /**< The maximum depth bias of a fragment. */
18261826
float depth_bias_slope_factor; /**< A scalar factor applied to a fragment's slope in depth calculations. */
1827-
bool enable_depth_bias; /**< true to bias fragment depth values. */
1828-
bool enable_depth_clip; /**< true to enable depth clip, false to enable depth clamp. */
1827+
bool enable_depth_bias; /**< true to bias fragment depth values. */
1828+
bool enable_depth_clip; /**< true to enable depth clip, false to enable depth clamp. */
18291829
Uint8 padding1;
18301830
Uint8 padding2;
18311831
} SDL_GPURasterizerState;
@@ -1842,7 +1842,7 @@ typedef struct SDL_GPUMultisampleState
18421842
{
18431843
SDL_GPUSampleCount sample_count; /**< The number of samples to be used in rasterization. */
18441844
Uint32 sample_mask; /**< Reserved for future use. Must be set to 0. */
1845-
bool enable_mask; /**< Reserved for future use. Must be set to false. */
1845+
bool enable_mask; /**< Reserved for future use. Must be set to false. */
18461846
bool enable_alpha_to_coverage; /**< true enables the alpha-to-coverage feature. */
18471847
Uint8 padding2;
18481848
Uint8 padding3;
@@ -1863,9 +1863,9 @@ typedef struct SDL_GPUDepthStencilState
18631863
SDL_GPUStencilOpState front_stencil_state; /**< The stencil op state for front-facing triangles. */
18641864
Uint8 compare_mask; /**< Selects the bits of the stencil values participating in the stencil test. */
18651865
Uint8 write_mask; /**< Selects the bits of the stencil values updated by the stencil test. */
1866-
bool enable_depth_test; /**< true enables the depth test. */
1867-
bool enable_depth_write; /**< true enables depth writes. Depth writes are always disabled when enable_depth_test is false. */
1868-
bool enable_stencil_test; /**< true enables the stencil test. */
1866+
bool enable_depth_test; /**< true enables the depth test. */
1867+
bool enable_depth_write; /**< true enables depth writes. Depth writes are always disabled when enable_depth_test is false. */
1868+
bool enable_stencil_test; /**< true enables the stencil test. */
18691869
Uint8 padding1;
18701870
Uint8 padding2;
18711871
Uint8 padding3;
@@ -1900,7 +1900,7 @@ typedef struct SDL_GPUGraphicsPipelineTargetInfo
19001900
const SDL_GPUColorTargetDescription *color_target_descriptions; /**< A pointer to an array of color target descriptions. */
19011901
Uint32 num_color_targets; /**< The number of color target descriptions in the above array. */
19021902
SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. */
1903-
bool has_depth_stencil_target; /**< true specifies that the pipeline uses a depth-stencil target. */
1903+
bool has_depth_stencil_target; /**< true specifies that the pipeline uses a depth-stencil target. */
19041904
Uint8 padding1;
19051905
Uint8 padding2;
19061906
Uint8 padding3;
@@ -2007,8 +2007,8 @@ typedef struct SDL_GPUColorTargetInfo
20072007
SDL_GPUTexture *resolve_texture; /**< The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. */
20082008
Uint32 resolve_mip_level; /**< The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */
20092009
Uint32 resolve_layer; /**< The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */
2010-
bool cycle; /**< true cycles the texture if the texture is bound and load_op is not LOAD */
2011-
bool cycle_resolve_texture; /**< true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */
2010+
bool cycle; /**< true cycles the texture if the texture is bound and load_op is not LOAD */
2011+
bool cycle_resolve_texture; /**< true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */
20122012
Uint8 padding1;
20132013
Uint8 padding2;
20142014
} SDL_GPUColorTargetInfo;
@@ -2065,7 +2065,7 @@ typedef struct SDL_GPUDepthStencilTargetInfo
20652065
SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */
20662066
SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */
20672067
SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */
2068-
bool cycle; /**< true cycles the texture if the texture is bound and any load ops are not LOAD */
2068+
bool cycle; /**< true cycles the texture if the texture is bound and any load ops are not LOAD */
20692069
Uint8 clear_stencil; /**< The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
20702070
Uint8 padding1;
20712071
Uint8 padding2;
@@ -2085,7 +2085,7 @@ typedef struct SDL_GPUBlitInfo {
20852085
SDL_FColor clear_color; /**< The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. */
20862086
SDL_FlipMode flip_mode; /**< The flip mode for the source region. */
20872087
SDL_GPUFilter filter; /**< The filter mode used when blitting. */
2088-
bool cycle; /**< true cycles the destination texture if it is already bound. */
2088+
bool cycle; /**< true cycles the destination texture if it is already bound. */
20892089
Uint8 padding1;
20902090
Uint8 padding2;
20912091
Uint8 padding3;

src/video/x11/SDL_x11keyboard.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,9 @@ void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window, SDL_Prop
762762
break;
763763
}
764764
(void)SDL_snprintf(deeplink, sizeof(deeplink),
765-
"steam://open/keyboard?XPosition=0&YPosition=0&Width=0&Height=0&Mode=%d",
765+
"steam://open/keyboard?XPosition=%i&YPosition=%i&Width=%i&Height=%i&Mode=%d",
766+
window->text_input_rect.x, window->text_input_rect.y,
767+
window->text_input_rect.w, window->text_input_rect.h,
766768
mode);
767769
SDL_OpenURL(deeplink);
768770
videodata->steam_keyboard_open = true;

0 commit comments

Comments
 (0)