On the SDL3 backend, when a laptop is connected to an external monitor and then the laptop lid is closed, the original SDL3 monitor ID for the laptop's monitor is invalidated and replaced with a monitor ID that exceeds the total amount of monitors upon reopening the laptop lid. Many of Raylib's functions in the file "rcore_desktop_sdl.c" do not properly handle such a situation, as they return an error message and do not actually run when the following condition is met:
#if defined(USING_VERSION_SDL3)
if((monitor > 0) && (monitor <= monitorCount))
I think the monitor id/number ("monitor") shouln't be validated against the monitor count, but rather the code should attempt to call the SDL3 function "SDL_GetDisplayProperties(monitor)". This function returns a valid property ID on success or 0 on failure, so a returned value other than zero tells you that the monitor id is valid.
See this link for more details: https://wiki.libsdl.org/SDL3/SDL_GetDisplayProperties
On the SDL3 backend, when a laptop is connected to an external monitor and then the laptop lid is closed, the original SDL3 monitor ID for the laptop's monitor is invalidated and replaced with a monitor ID that exceeds the total amount of monitors upon reopening the laptop lid. Many of Raylib's functions in the file "rcore_desktop_sdl.c" do not properly handle such a situation, as they return an error message and do not actually run when the following condition is met:
#if defined(USING_VERSION_SDL3)
if((monitor > 0) && (monitor <= monitorCount))
I think the monitor number ("monitor") should be validated not against the monitor count, but rather the code should attempt to call the SDL3 function "SDL_GetDisplayProperties(monitor)", passing in the monitor id ("monitor"). This function returns a valid property ID on success or 0 on failure, so a returned value other than zero tells you that the monitor id is valid.
see this link for more details: https://wiki.libsdl.org/SDL3/SDL_GetDisplayProperties
On the SDL3 backend, when a laptop is connected to an external monitor and then the laptop lid is closed, the original SDL3 monitor ID for the laptop's monitor is invalidated and replaced with a monitor ID that exceeds the total amount of monitors upon reopening the laptop lid. Many of Raylib's functions in the file "rcore_desktop_sdl.c" do not properly handle such a situation, as they return an error message and do not actually run when the following condition is met:
#if defined(USING_VERSION_SDL3)
if((monitor > 0) && (monitor <= monitorCount))
I think the monitor number ("monitor") should be validated not against the monitor count, but rather the code should attempt to call the SDL3 function "SDL_GetDisplayUsableBounds(monitor, &displayBoundsRectangle)", passing in the monitor number ("monitor") and the "SDL_Rect" object "displayBoundsRectangle" by address. This function returns "true" on success, and tells you that the requested monitor is valid.
* use FLAG_* macros where possible
* rename `FLAG_CHECK()` to `FLAG_IS_SET()`
* remove unnecessary equality checks
* fix issues
---------
Co-authored-by: Ray <raysan5@gmail.com>
* consistency tweak
* unified color and depth buffer
* tweaks
* review the storage of clear values + complete get/set depth value
* copy/blit fast path
* better simd read/write
* framebuffer alignment
* fix 'typo'
my french slipped out