3 Revize 8c8efd4ccd ... d3672b0c3a

Autor SHA1 Zpráva Datum
  BurstRange d3672b0c3a Fixed typo to "pseudo" před 1 dnem
  Frank Praznik 5880b8a283 Log failure reasons during early X11 and Wayland initialization před 1 dnem
  SDL Wiki Bot 75c9b082ef Sync SDL3 wiki -> header před 1 dnem

+ 12 - 11
include/SDL3/SDL_render.h

@@ -2970,19 +2970,20 @@ extern SDL_DECLSPEC SDL_GPURenderState * SDLCALL SDL_CreateGPURenderState(SDL_Re
 /**
  * Set sampler bindings variables in a custom GPU render state.
  *
- * The data is copied and will be binded using
- * SDL_BindGPUFragmentSamplers() during draw call execution.
+ * The data is copied and will be binded using SDL_BindGPUFragmentSamplers()
+ * during draw call execution.
  *
  * \param state the state to modify.
- * \param num_sampler_bindings The number of additional fragment samplers to bind
- * \param sampler_bindings Additional fragment samplers to bind
+ * \param num_sampler_bindings The number of additional fragment samplers to
+ *                             bind.
+ * \param sampler_bindings Additional fragment samplers to bind.
  * \returns true on success or false on failure; call SDL_GetError() for more
  *          information.
  *
  * \threadsafety This function should be called on the thread that created the
  *               renderer.
  *
- * \since This function is available since SDL 3.4.x.
+ * \since This function is available since SDL 3.6.0.
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_SetGPURenderStateSamplerBindings(SDL_GPURenderState *state, int num_sampler_bindings, const SDL_GPUTextureSamplerBinding *sampler_bindings);
 
@@ -2993,15 +2994,15 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetGPURenderStateSamplerBindings(SDL_GPURen
  * SDL_BindGPUFragmentStorageTextures() during draw call execution.
  *
  * \param state the state to modify.
- * \param num_storage_textures The number of storage textures to bind
- * \param storage_textures Storage textures to bind
+ * \param num_storage_textures The number of storage textures to bind.
+ * \param storage_textures Storage textures to bind.
  * \returns true on success or false on failure; call SDL_GetError() for more
  *          information.
  *
  * \threadsafety This function should be called on the thread that created the
  *               renderer.
  *
- * \since This function is available since SDL 3.4.x.
+ * \since This function is available since SDL 3.6.0.
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_SetGPURenderStateStorageTextures(SDL_GPURenderState *state, int num_storage_textures, SDL_GPUTexture *const *storage_textures);
 
@@ -3012,15 +3013,15 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetGPURenderStateStorageTextures(SDL_GPURen
  * SDL_BindGPUFragmentStorageBuffers() during draw call execution.
  *
  * \param state the state to modify.
- * \param num_storage_buffers The number of storage buffers to bind
- * \param storage_buffers Storage buffers to bind
+ * \param num_storage_buffers The number of storage buffers to bind.
+ * \param storage_buffers Storage buffers to bind.
  * \returns true on success or false on failure; call SDL_GetError() for more
  *          information.
  *
  * \threadsafety This function should be called on the thread that created the
  *               renderer.
  *
- * \since This function is available since SDL 3.4.x.
+ * \since This function is available since SDL 3.6.0.
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_SetGPURenderStateStorageBuffers(SDL_GPURenderState *state, int num_storage_buffers, SDL_GPUBuffer *const *storage_buffers);
 

+ 5 - 5
include/SDL3/SDL_stdinc.h

@@ -4360,7 +4360,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_randf(void);
 /**
  * Generate 32 pseudo-random bits.
  *
- * You likely want to use SDL_rand() to get a psuedo-random number instead.
+ * You likely want to use SDL_rand() to get a pseudo-random number instead.
  *
  * There are no guarantees as to the quality of the random sequence produced,
  * and this should not be used for security (cryptography, passwords) or where
@@ -4445,7 +4445,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_randf_r(Uint64 *state);
 /**
  * Generate 32 pseudo-random bits.
  *
- * You likely want to use SDL_rand_r() to get a psuedo-random number instead.
+ * You likely want to use SDL_rand_r() to get a pseudo-random number instead.
  *
  * There are no guarantees as to the quality of the random sequence produced,
  * and this should not be used for security (cryptography, passwords) or where
@@ -4684,7 +4684,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_atanf(float x);
  *
  * Domain: `-INF <= x <= INF`, `-INF <= y <= INF`
  *
- * Range: `-Pi <= y <= Pi`
+ * Range: `-Pi <= z <= Pi`
  *
  * This function operates on double-precision floating point values, use
  * SDL_atan2f for single-precision floats.
@@ -4698,8 +4698,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_atanf(float x);
  *
  * \param y floating point value of the numerator (y coordinate).
  * \param x floating point value of the denominator (x coordinate).
- * \returns arc tangent of of `y / x` in radians, or, if `x = 0`, either
- *          `-Pi/2`, `0`, or `Pi/2`, depending on the value of `y`.
+ * \returns arc tangent of `y / x` in radians, or, if `x = 0`, either `-Pi/2`,
+ *          `0`, or `Pi/2`, depending on the value of `y`.
  *
  * \threadsafety It is safe to call this function from any thread.
  *

+ 5 - 2
src/video/wayland/SDL_waylandvideo.c

@@ -42,6 +42,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <errno.h>
 #include <xkbcommon/xkbcommon.h>
 
 #include <wayland-util.h>
@@ -548,10 +549,11 @@ static SDL_VideoDevice *Wayland_CreateDevice(bool require_preferred_protocols)
                                                  SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL);
     bool display_is_external = !!display;
 
-    // Are we trying to connect to or are currently in a Wayland session?
+    // Are we trying to connect to, or are currently in, a Wayland session?
     if (!SDL_getenv("WAYLAND_DISPLAY")) {
         const char *session = SDL_getenv("XDG_SESSION_TYPE");
         if (session && SDL_strcasecmp(session, "wayland") != 0) {
+            SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Wayland initialization failed: no Wayland session available");
             return NULL;
         }
     }
@@ -564,6 +566,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(bool require_preferred_protocols)
         display = WAYLAND_wl_display_connect(NULL);
         if (!display) {
             SDL_WAYLAND_UnloadSymbols();
+            SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Failed to connect to the Wayland display server: %s", strerror(errno));
             return NULL;
         }
     }
@@ -610,7 +613,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(bool require_preferred_protocols)
 
     if (!display_is_external) {
         SDL_SetPointerProperty(SDL_GetGlobalProperties(),
-                        SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display);
+                               SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display);
     }
 
     device->internal = data;

+ 8 - 0
src/video/x11/SDL_x11video.c

@@ -107,6 +107,14 @@ static SDL_VideoDevice *X11_CreateDevice(void)
 
     if (!x11_display) {
         SDL_X11_UnloadSymbols();
+
+        const char *session = SDL_getenv("XDG_SESSION_TYPE");
+        if (session && SDL_strcasecmp(session, "wayland") == 0) {
+            SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Failed to connect to the X11 (XWayland) display server");
+        } else {
+            SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Failed to connect to the X11 display server");
+        }
+
         return NULL;
     }