From 5aa3de194c5da8725148e6c9322a9d4864797553 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 12 May 2026 20:33:20 +0200 Subject: [PATCH 01/49] Updated miniaudio warnings with emscripten --- src/external/miniaudio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/external/miniaudio.h b/src/external/miniaudio.h index 24e676bb2..441f8de62 100644 --- a/src/external/miniaudio.h +++ b/src/external/miniaudio.h @@ -41495,11 +41495,11 @@ Web Audio Backend #ifdef MA_HAS_WEBAUDIO #include -#if (__EMSCRIPTEN_major__ > 3) || (__EMSCRIPTEN_major__ == 3 && (__EMSCRIPTEN_minor__ > 1 || (__EMSCRIPTEN_minor__ == 1 && __EMSCRIPTEN_tiny__ >= 32))) +#if (__EMSCRIPTEN_MAJOR__ > 3) || (__EMSCRIPTEN_MAJOR__ == 3 && (__EMSCRIPTEN_MINOR__ > 1 || (__EMSCRIPTEN_MINOR__ == 1 && __EMSCRIPTEN_TINY__ >= 32))) #include #define MA_SUPPORT_AUDIO_WORKLETS - #if (__EMSCRIPTEN_major__ > 3) || (__EMSCRIPTEN_major__ == 3 && (__EMSCRIPTEN_minor__ > 1 || (__EMSCRIPTEN_minor__ == 1 && __EMSCRIPTEN_tiny__ >= 70))) + #if (__EMSCRIPTEN_MAJOR__ > 3) || (__EMSCRIPTEN_MAJOR__ == 3 && (__EMSCRIPTEN_MINOR__ > 1 || (__EMSCRIPTEN_MINOR__ == 1 && __EMSCRIPTEN_TINY__ >= 70))) #define MA_SUPPORT_AUDIO_WORKLETS_VARIABLE_BUFFER_SIZE #endif #endif From fd28dc564429872dca6f1d096284b750b6c3e0f2 Mon Sep 17 00:00:00 2001 From: Thomas Anderson <5776225+CrackedPixel@users.noreply.github.com> Date: Wed, 13 May 2026 01:56:13 -0500 Subject: [PATCH 02/49] [rtext] add warning for loadfontex/loadfontfrommemory (#5864) * add warning for loadfontex/loadfontfrommemory * bump to re-run build tests --- src/rtext.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index a3ec016f5..c0434db63 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -580,8 +580,13 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int TRACELOG(LOG_INFO, "FONT: Data loaded successfully (%i pixel size | %i glyphs)", font.baseSize, font.glyphCount); } - else font = GetFontDefault(); + else + { + TRACELOG(LOG_WARNING, "FONT: Font is not supported by LoadFontEx/LoadFontFromMemory or no glyphs found, reverted to default font"); + font = GetFontDefault(); + } #else + TRACELOG(LOG_WARNING, "FONT: Font is not supported by LoadFontEx/LoadFontFromMemory or no glyphs found, reverted to default font"); font = GetFontDefault(); #endif From e274c195afb7cac38c8330f822edf4b717e04300 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 13 May 2026 09:15:50 +0200 Subject: [PATCH 03/49] Update rcore.c --- src/rcore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rcore.c b/src/rcore.c index 0dad0cd96..f5665fca0 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -506,6 +506,7 @@ __declspec(dllimport) void __stdcall Sleep(unsigned long msTimeout); // Required const char *TextFormat(const char *text, ...); // Formatting of text with variables to 'embed' #endif +// NOTE: PLATFORM_DESKTOP defaults to GLFW backend #if defined(PLATFORM_DESKTOP) #define PLATFORM_DESKTOP_GLFW #endif From fbf132d1d1030b1f90c6ebffc6c2e7e4b835b76b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 13 May 2026 09:16:19 +0200 Subject: [PATCH 04/49] Use rlgl provided interface instead of rlsw direct access --- src/platforms/rcore_desktop_rgfw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index f99cab433..987cac560 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -1132,8 +1132,8 @@ void SwapScreenBuffer(void) { if (platform.surface) { - // copy rlsw pixel data to the surface framebuffer - swReadPixels(0, 0, platform.surfaceWidth, platform.surfaceHeight, SW_RGBA, SW_UNSIGNED_BYTE, platform.surfacePixels); + // Copy rlsw pixel data to the surface framebuffer + rlCopyFramebuffer(0, 0, platform.surfaceWidth, platform.surfaceHeight, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, platform.surfacePixels); // Mac wants a different pixel order. I cant seem to get this to work any other way #if defined(__APPLE__) From c4b4fcc17ebd7fb89b13791ca451f1189517879a Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 13 May 2026 09:16:29 +0200 Subject: [PATCH 05/49] Format review --- src/platforms/rcore_desktop_rgfw.c | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 987cac560..1cb38ff61 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -810,8 +810,8 @@ void SetWindowSize(int width, int height) RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); - CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.height = CORE.Window.render.height; #else @@ -1139,9 +1139,9 @@ void SwapScreenBuffer(void) #if defined(__APPLE__) unsigned char temp = 0; unsigned char *p = NULL; - for (int i = 0; i < (platform.surfaceWidth * platform.surfaceHeight); i += 1) + for (int i = 0; i < (platform.surfaceWidth*platform.surfaceHeight); i += 1) { - p = platform.surfacePixels + (i * 4); + p = platform.surfacePixels + (i*4); temp = p[0]; p[0] = p[2]; p[2] = temp; @@ -1357,13 +1357,13 @@ void PollInputEvents(void) if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) { RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); - SetupViewport(platform.window->w * currentMonitor->pixelRatio, platform.window->h * currentMonitor->pixelRatio); + SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); CORE.Window.screen.width = platform.window->w; CORE.Window.screen.height = platform.window->h; - CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; } else { @@ -1406,10 +1406,10 @@ void PollInputEvents(void) #if defined(__APPLE__) RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); - SetupViewport(platform.window->w * currentMonitor->pixelRatio, platform.window->h * currentMonitor->pixelRatio); + SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio); - CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.height = CORE.Window.render.height; #endif @@ -1427,7 +1427,7 @@ void PollInputEvents(void) if (platform.surfacePixels != NULL) { RL_FREE(platform.surfacePixels); - platform.surfacePixels = RL_MALLOC(platform.surfaceWidth * platform.surfaceHeight * 4); + platform.surfacePixels = RL_MALLOC(platform.surfaceWidth*platform.surfaceHeight*4); } if (platform.surface != NULL) @@ -1743,8 +1743,8 @@ int InitPlatform(void) if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) { #if !defined(__APPLE__) - CORE.Window.screen.width = CORE.Window.screen.width * GetWindowScaleDPI().x; - CORE.Window.screen.height = CORE.Window.screen.height * GetWindowScaleDPI().y; + CORE.Window.screen.width = CORE.Window.screen.width*GetWindowScaleDPI().x; + CORE.Window.screen.height = CORE.Window.screen.height*GetWindowScaleDPI().y; #endif } @@ -1828,8 +1828,8 @@ int InitPlatform(void) RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); - CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.height = CORE.Window.render.height; #else @@ -1846,8 +1846,8 @@ int InitPlatform(void) RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); - CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.height = CORE.Window.render.height; #endif @@ -1855,7 +1855,7 @@ int InitPlatform(void) platform.surfaceWidth = CORE.Window.currentFbo.width; platform.surfaceHeight = CORE.Window.currentFbo.height; - platform.surfacePixels = RL_MALLOC(platform.surfaceWidth * platform.surfaceHeight * 4); + platform.surfacePixels = RL_MALLOC(platform.surfaceWidth*platform.surfaceHeight*4); if (platform.surfacePixels == NULL) { TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize software pixel buffer"); From f35f4b9fad06ce5a5000d0c303c5235b8b22da25 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 13 May 2026 09:17:04 +0200 Subject: [PATCH 06/49] REVIEWED: `GetTime()`, small addition for RPI Pico 2 --- src/platforms/rcore_memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platforms/rcore_memory.c b/src/platforms/rcore_memory.c index 6926d8f4e..155073ad1 100644 --- a/src/platforms/rcore_memory.c +++ b/src/platforms/rcore_memory.c @@ -374,6 +374,8 @@ double GetTime(void) unsigned long long nanoSeconds = (unsigned long long)ts.tv_sec*1000000000LLU + (unsigned long long)ts.tv_nsec; time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer() +#elif defined(PICO_RP2350) + time = (double)to_ms_since_boot(get_absolute_time())/1000.0; #endif return time; } From 43366d1c6a80596ee959a2cc4f89fab155d0b924 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 13 May 2026 09:28:08 +0200 Subject: [PATCH 07/49] Some formatting tweaks --- src/external/rlsw.h | 104 +++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index cc786750c..7e153adbc 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -166,16 +166,15 @@ // Fast power-of-two texture wrap (SW_REPEAT mode only) // When defined, textures whose width/height are powers of two use a bitmask -// wrap (`x & (size-1)`) instead of `floorf`-based fractional wrap or the -// signed `%` chain in the linear sampler. Saves a software divide on Xtensa -// and a few instructions everywhere. NPOT textures keep using the original -// path via a runtime `(size & (size-1)) == 0` check, so SW_REPEAT remains -// correct for them. The only observable behavior change is for POT textures -// sampled with negative UV coordinates: bitmask wrap (two's complement) can -// differ from `sw_fract` by one texel. Off by default to keep bit-for-bit -// behavior; opt in if you control your asset UVs. +// wrap (`x & (size-1)`) instead of `floorf`-based fractional wrap or the signed `%` chain in the linear sampler +// Saves a software divide on Xtensa and a few instructions everywhere +// NPOT textures keep using the original path via a runtime `(size & (size-1)) == 0` check, +// so SW_REPEAT remains correct for them +// The only observable behavior change is for POT textures sampled with negative UV coordinates: +// bitmask wrap (two's complement) can differ from `sw_fract` by one texel +// Off by default to keep bit-for-bit behavior; opt in if you control your asset UVs // -// #define SW_TEXTURE_REPEAT_POT_FAST +//#define SW_TEXTURE_REPEAT_POT_FAST //---------------------------------------------------------------------------------- // OpenGL Compatibility Types @@ -860,11 +859,9 @@ SWAPI void swGetFramebufferAttachmentParameteriv(SWattachment attachment, SWatta #endif // ESP-DSP acceleration: ESP-IDF ships an optimized math library that includes -// `dspm_mult_4x4x4_f32` (4x4 matrix multiply) and `dspm_mult_4x4x1_f32` -// (matrix * vector). These are S3-tuned hand-vectorized kernels that beat the -// scalar versions for both throughput and code-size. Detection is opt-in to -// keep the dependency optional: define SW_USE_ESP_DSP from your build system -// (or rely on the `idf_component.yml` example shown in the rlsw docs). +// `dspm_mult_4x4x4_f32` (4x4 matrix multiply) and `dspm_mult_4x4x1_f32` (matrix * vector) +// These are S3-tuned hand-vectorized kernels that beat the scalar versions for both throughput and code-size +// Detection is opt-in to keep the dependency optional: define SW_USE_ESP_DSP from your build system #if defined(ESP_PLATFORM) && defined(SW_USE_ESP_DSP) #define SW_HAS_ESP_DSP #include "dspm_mult.h" @@ -884,41 +881,41 @@ SWAPI void swGetFramebufferAttachmentParameteriv(SWattachment attachment, SWatta #define SW_DEG2RAD (SW_PI/180.0f) #define SW_RAD2DEG (180.0f/SW_PI) -// When clipping a convex polygon against a plane, at most one vertex is added. +// When clipping a convex polygon against a plane, at most one vertex is added // Starting from a quadrilateral (4 vertices), clipped sequentially against // the frustum (6 planes) then the scissor rectangle (4 planes): -// 4 + 6 + 4 = 14 vertices maximum. -#define SW_MAX_CLIPPED_POLYGON_VERTICES 14 -#define SW_CLIP_EPSILON 1e-4f +// 4 + 6 + 4 = 14 vertices maximum +#define SW_MAX_CLIPPED_POLYGON_VERTICES 14 +#define SW_CLIP_EPSILON 1e-4f -#define SW_HANDLE_NULL 0u -#define SW_POOL_SLOT_LIVE 0x80u // bit7 of the generation byte -#define SW_POOL_SLOT_VER_MASK 0x7Fu // bits6:0 = anti-ABA counter +#define SW_HANDLE_NULL 0u +#define SW_POOL_SLOT_LIVE 0x80u // bit7 of the generation byte +#define SW_POOL_SLOT_VER_MASK 0x7Fu // bits6:0 = anti-ABA counter -#define SW_CONCAT(a, b) a##b -#define SW_CONCATX(a, b) SW_CONCAT(a, b) +#define SW_CONCAT(a, b) a##b +#define SW_CONCATX(a, b) SW_CONCAT(a, b) -#define SW_FRAMEBUFFER_COLOR8_GET(c,p,o) SW_CONCATX(sw_pixel_read_color8_, SW_FRAMEBUFFER_COLOR_TYPE)((c),(p),(o)) -#define SW_FRAMEBUFFER_COLOR_GET(c,p,o) SW_CONCATX(sw_pixel_read_color_, SW_FRAMEBUFFER_COLOR_TYPE)((c),(p),(o)) -#define SW_FRAMEBUFFER_COLOR_SET(p,c,o) SW_CONCATX(sw_pixel_write_color_, SW_FRAMEBUFFER_COLOR_TYPE)((p),(c),(o)) +#define SW_FRAMEBUFFER_COLOR8_GET(c,p,o) SW_CONCATX(sw_pixel_read_color8_, SW_FRAMEBUFFER_COLOR_TYPE)((c),(p),(o)) +#define SW_FRAMEBUFFER_COLOR_GET(c,p,o) SW_CONCATX(sw_pixel_read_color_, SW_FRAMEBUFFER_COLOR_TYPE)((c),(p),(o)) +#define SW_FRAMEBUFFER_COLOR_SET(p,c,o) SW_CONCATX(sw_pixel_write_color_, SW_FRAMEBUFFER_COLOR_TYPE)((p),(c),(o)) -#define SW_FRAMEBUFFER_DEPTH_GET(p,o) SW_CONCATX(sw_pixel_read_depth_, SW_FRAMEBUFFER_DEPTH_TYPE)((p),(o)) -#define SW_FRAMEBUFFER_DEPTH_SET(p,d,o) SW_CONCATX(sw_pixel_write_depth_, SW_FRAMEBUFFER_DEPTH_TYPE)((p),(d),(o)) +#define SW_FRAMEBUFFER_DEPTH_GET(p,o) SW_CONCATX(sw_pixel_read_depth_, SW_FRAMEBUFFER_DEPTH_TYPE)((p),(o)) +#define SW_FRAMEBUFFER_DEPTH_SET(p,d,o) SW_CONCATX(sw_pixel_write_depth_, SW_FRAMEBUFFER_DEPTH_TYPE)((p),(d),(o)) -#define SW_FRAMEBUFFER_COLOR_FORMAT SW_CONCATX(SW_PIXELFORMAT_COLOR_, SW_FRAMEBUFFER_COLOR_TYPE) -#define SW_FRAMEBUFFER_DEPTH_FORMAT SW_CONCATX(SW_PIXELFORMAT_DEPTH_, SW_FRAMEBUFFER_DEPTH_TYPE) +#define SW_FRAMEBUFFER_COLOR_FORMAT SW_CONCATX(SW_PIXELFORMAT_COLOR_, SW_FRAMEBUFFER_COLOR_TYPE) +#define SW_FRAMEBUFFER_DEPTH_FORMAT SW_CONCATX(SW_PIXELFORMAT_DEPTH_, SW_FRAMEBUFFER_DEPTH_TYPE) -#define SW_FRAMEBUFFER_COLOR_SIZE SW_PIXELFORMAT_SIZE[SW_FRAMEBUFFER_COLOR_FORMAT] -#define SW_FRAMEBUFFER_DEPTH_SIZE SW_PIXELFORMAT_SIZE[SW_FRAMEBUFFER_DEPTH_FORMAT] +#define SW_FRAMEBUFFER_COLOR_SIZE SW_PIXELFORMAT_SIZE[SW_FRAMEBUFFER_COLOR_FORMAT] +#define SW_FRAMEBUFFER_DEPTH_SIZE SW_PIXELFORMAT_SIZE[SW_FRAMEBUFFER_DEPTH_FORMAT] -#define SW_STATE_SCISSOR_TEST (1 << 0) -#define SW_STATE_TEXTURE_2D (1 << 1) -#define SW_STATE_DEPTH_TEST (1 << 2) -#define SW_STATE_CULL_FACE (1 << 3) -#define SW_STATE_BLEND (1 << 4) +#define SW_STATE_SCISSOR_TEST (1 << 0) +#define SW_STATE_TEXTURE_2D (1 << 1) +#define SW_STATE_DEPTH_TEST (1 << 2) +#define SW_STATE_CULL_FACE (1 << 3) +#define SW_STATE_BLEND (1 << 4) -#define SW_BLEND_FLAG_NOOP (1 << 0) -#define SW_BLEND_FLAG_NEEDS_ALPHA (1 << 1) +#define SW_BLEND_FLAG_NOOP (1 << 0) +#define SW_BLEND_FLAG_NEEDS_ALPHA (1 << 1) //---------------------------------------------------------------------------------- // Module Types and Structures Definition @@ -1175,7 +1172,7 @@ static inline void sw_matrix_mul_rst(float *SW_RESTRICT dst, const float *SW_RES // column-major, so passing them flat is equivalent to passing transposes: // dspm_mult(L^T, R^T) computes (L^T)*(R^T) = (R*L)^T, written back into a // flat array gives the same bit pattern as the column-major product (R*L) - // -- exactly the semantic the scalar fallback below has. + // -- exactly the semantic the scalar fallback below has dspm_mult_4x4x4_f32(left, right, dst); #else float l00 = left[0], l01 = left[1], l02 = left[2], l03 = left[3]; @@ -1248,12 +1245,12 @@ static inline float sw_fract(float x) return (x - floorf(x)); } -// Fast reciprocal: 1-ULP accurate in ~7 instructions on Xtensa using the -// hardware `recip0.s` seed + two Newton-Raphson refinement steps. All work -// stays in FPU registers — no `__divsf3` software call. Hot-path divisions -// in the rasterizer (span/triangle setup, perspective divide, etc.) call -// this. On non-Xtensa targets it transparently expands to `1.0f / x`, so -// generated code is identical to before. +// Xtensa architecture optimization +// Fast reciprocal: 1-ULP accurate in ~7 instructions using the +// hardware `recip0.s` seed + two Newton-Raphson refinement steps +// All work stays in FPU registers — no `__divsf3` software call +// Hot-path divisions in the rasterizer (span/triangle setup, perspective divide, etc.) call this +// On non-Xtensa targets it transparently expands to `1.0f / x`, so generated code is identical to before #if defined(__XTENSA__) __attribute__((always_inline)) static inline float sw_rcp(float x) @@ -3558,8 +3555,8 @@ static inline bool sw_quad_face_culling(void) // winding in the projected space when all w > 0 // A value of 0 for sgnArea means P0, P1, P2 are collinear in (x, y, w) // space, which corresponds to a degenerate triangle projection - // Such quads might also be degenerate or non-planar. They are typically - // not culled by this test (0 < 0 is false, 0 > 0 is false) + // Such quads might also be degenerate or non-planar + // They are typically not culled by this test (0 < 0 is false, 0 > 0 is false) // and should be handled by the clipper if necessary return (RLSW.cullFace == SW_FRONT)? (sgnArea < 0.0f) : (sgnArea > 0.0f); // Cull if winding is "clockwise" : "counter-clockwise" @@ -3879,8 +3876,7 @@ static inline void sw_poly_fill_render(uint32_t state) //------------------------------------------------------------------------------------------- static void sw_immediate_begin(SWdraw mode) { - // NOTE: Any checks to ensure command recording can start - // must be performed before calling this function. + // NOTE: Any checks to ensure command recording can start must be performed before calling this function // Recalculate the MVP if this is needed if (RLSW.isDirtyMVP) @@ -3891,8 +3887,8 @@ static void sw_immediate_begin(SWdraw mode) #ifdef SW_HAS_ESP_DSP // Pre-transpose to row-major so dspm_mult_4x4x1_f32(matMVP_rm, v, out) - // computes M*v directly in the per-vertex hot path. 16 scalar copies - // per MVP update vs. saving ~20 cycles per vertex transform. + // computes M*v directly in the per-vertex hot path; 16 scalar copies + // per MVP update vs saving ~20 cycles per vertex transform for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) @@ -3955,7 +3951,7 @@ static void sw_immediate_push_vertex(const float position[4]) // Calculate clip coordinates #ifdef SW_HAS_ESP_DSP // dspm_mult_4x4x1_f32 declares its inputs non-const; rlsw treats them as - // read-only and the cast is safe (the kernel only loads from B). + // read-only and the cast is safe (the kernel only loads from B) dspm_mult_4x4x1_f32(RLSW.matMVP_rm, (float *)position, vertex->position); #else const float *m = RLSW.matMVP; @@ -5567,7 +5563,7 @@ static void SW_RASTER_TRIANGLE(const sw_vertex_t *v0, const sw_vertex_t *v1, con if (v0->position[1] > v1->position[1]) { const sw_vertex_t *tmp = v0; v0 = v1; v1 = tmp; } // Extracting coordinates from the sorted vertices - // Put x away for safe keeping. Only y is used right now. Silences warnings. + // Put x away for safe keeping; only y is used right now; silences warnings float y0 = v0->position[1]; float y1 = v1->position[1]; float y2 = v2->position[1]; From 5506aed1908d771d4cae378875fa31032f1970b1 Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Thu, 14 May 2026 11:00:40 +0000 Subject: [PATCH 08/49] BINDINGS.md: update golang binding to v6.0 (#5866) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 7d1c43ca8..7d350a9b0 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -37,7 +37,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT | | [raylib.f](https://github.com/cthulhuology/raylib.f) | **5.5** | [Forth](https://forth.com) | Zlib | | [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC | -| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.5** | [Go](https://golang.org) | Zlib | +| [raylib-go](https://github.com/gen2brain/raylib-go) | **6.0** | [Go](https://golang.org) | Zlib | | [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib | | [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** | | [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 | From ea76845ecbefd2c1c38071e0c1aaa604aceb6a6a Mon Sep 17 00:00:00 2001 From: jestarray <34615798+jestarray@users.noreply.github.com> Date: Thu, 14 May 2026 04:02:38 -0700 Subject: [PATCH 09/49] [cmake]: remove GLFW_BUILD warnings for when platform is SDL (#5865) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da1b3bfe7..f1d319e8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ include(CompilerFlags) # Registers build options that are exposed to cmake include(CMakeOptions.txt) -if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web") +if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web" AND NOT "${PLATFORM}" MATCHES "SDL") if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11) message(FATAL_ERROR "Cannot disable both Wayland and X11") endif() From 729327a0786fb5818d2de7324ce3a40a74c7513c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 May 2026 20:05:21 +0200 Subject: [PATCH 10/49] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b5be212d7..848a653b8 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,7 @@ src/external/SDL3 # Emscripten emsdk -# Ignore wasm data in examples/ +# Ignore binaries generated in examples/ examples/**/* !examples/**/*.* !examples/**/*/ From 5ca45bce374a5c1e5602e627a688bd0caf19779e Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 May 2026 20:05:25 +0200 Subject: [PATCH 11/49] Update rcore.c --- src/rcore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index f5665fca0..74774e77b 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -511,7 +511,6 @@ const char *TextFormat(const char *text, ...); // Formatting of text with variab #define PLATFORM_DESKTOP_GLFW #endif - // Include platform-specific submodules #if defined(PLATFORM_DESKTOP_GLFW) #include "platforms/rcore_desktop_glfw.c" @@ -2319,7 +2318,7 @@ bool FileExists(const char *fileName) { bool result = false; - if (ACCESS(fileName) != -1) result = true; + if ((fileName != NULL) && (ACCESS(fileName) != -1)) result = true; // NOTE: Alternatively, stat() can be used instead of access() //#include From 6c090f61934bf6ec843afb5a734a25319e771f9a Mon Sep 17 00:00:00 2001 From: Jairo Correa Date: Fri, 15 May 2026 12:39:27 -0300 Subject: [PATCH 12/49] Fix build.zig building examples all the time (#5869) --- build.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/build.zig b/build.zig index 5485cda47..8d8b2d353 100644 --- a/build.zig +++ b/build.zig @@ -739,7 +739,6 @@ fn addExamples( .root_module = exe_mod, .use_lld = target.result.os.tag == .windows, }); - b.installArtifact(exe); const install_cmd = b.addInstallArtifact(exe, .{ .dest_sub_path = b.fmt("{s}/{s}", .{ module, filename }) }); From c04e57399acfc860a68ac0c11ff6d1c77da9cfda Mon Sep 17 00:00:00 2001 From: Mihai Preda Date: Sat, 16 May 2026 01:40:26 +1000 Subject: [PATCH 13/49] Fix compilation for -DPLATFORM=RGFW (#5870) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling with cmake -S . -B build-desktop-rgfw -DPLATFORM=RGFW -DCMAKE_BUILD_TYPE=Release cmake --build build-desktop-rgfw these errors appeared: raylib/examples/others/raylib_opengl_interop.c:100:5: error: unknown type name ‘GLuint’ 100 | GLuint vao = 0; [etc] --- examples/others/raylib_opengl_interop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/others/raylib_opengl_interop.c b/examples/others/raylib_opengl_interop.c index 540a623ab..3e4cf8839 100644 --- a/examples/others/raylib_opengl_interop.c +++ b/examples/others/raylib_opengl_interop.c @@ -28,7 +28,7 @@ #include "raylib.h" -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_DESKTOP_SDL) +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_DESKTOP_SDL) || defined(PLATFORM_DESKTOP_RGFW) #if defined(GRAPHICS_API_OPENGL_ES2) #include "glad_gles2.h" // Required for: OpenGL functionality #define glGenVertexArrays glGenVertexArraysOES From d31c10a01e53ad14305e52f8abd29d9ef84fe983 Mon Sep 17 00:00:00 2001 From: Anstro Pleuton <121956207+anstropleuton@users.noreply.github.com> Date: Tue, 19 May 2026 22:18:28 +0530 Subject: [PATCH 14/49] Adjust segment calculation in DrawRectangleRounded to be consistent with DrawRectangleRoundedLinesEx (#5875) --- src/rshapes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rshapes.c b/src/rshapes.c index c06f20462..69c1dacea 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -960,7 +960,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)(ceilf(2*PI/th)/4.0f); + segments = (int)(ceilf(2*PI/th)/2.0f); if (segments <= 0) segments = 4; } From be56f2c524100527c624a4e4201831db48afa0c7 Mon Sep 17 00:00:00 2001 From: steampuker <214028729+steampuker@users.noreply.github.com> Date: Tue, 19 May 2026 16:57:42 +0000 Subject: [PATCH 15/49] [rcore][GLFW] Fix `GetClipboardImage()` creating new connection under X11 (#5871) * Improve GetClipboardImage implementation under X11 * Remove code for creating new connection, handle selection in GLFW connection instead. * `GetClipboardImage()`: Small fix to remove unnecessary boolean --- src/platforms/rcore_desktop_glfw.c | 50 ++++++++++++------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index b1e100cf4..6def8e77a 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1042,11 +1042,6 @@ const char *GetClipboardText(void) return glfwGetClipboardString(platform.handle); } -#if SUPPORT_CLIPBOARD_IMAGE && defined(__linux__) && defined(_GLFW_X11) - #include - #include -#endif - // Get clipboard image Image GetClipboardImage(void) { @@ -1066,32 +1061,30 @@ Image GetClipboardImage(void) else image = LoadImageFromMemory(".bmp", (const unsigned char *)bmpData, (int)dataSize); #elif defined(__linux__) && defined(_GLFW_X11) - // REF: https://github.com/ColleagueRiley/Clipboard-Copy-Paste/blob/main/x11.c - Display *dpy = XOpenDisplay(NULL); - if (!dpy) return image; - Window root = DefaultRootWindow(dpy); - Window win = XCreateSimpleWindow( - dpy, // The connection to the X Server - root, // The 'Parent' window (usually the desktop/root) - 0, 0, // X and Y position on the screen - 1, 1, // Width and Height (1x1 pixel) - 0, // Border width - 0, // Border color - 0 // Background color - ); + static Atom clipboard = 0; + static Atom targetType = 0; + static Atom property = 0; - Atom clipboard = XInternAtom(dpy, "CLIPBOARD", False); - Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG - Atom property = XInternAtom(dpy, "RAYLIB_CLIPBOARD_MANAGER", False); + Display *display = glfwGetX11Display(); + XID window = glfwGetX11Window(platform.handle); - // Request the data: "Convert whatever is in CLIPBOARD to image/png and put it in RAYLIB_CLIPBOARD_MANAGER" - XConvertSelection(dpy, clipboard, targetType, property, win, CurrentTime); + // Lazy-load X11 atoms + if(clipboard == 0) + { + clipboard = XInternAtom(display, "CLIPBOARD", False); + targetType = XInternAtom(display, "image/png", False); + property = XInternAtom(display, "RAYLIB_CLIPBOARD_MANAGER", False); + } + + XConvertSelection(display, clipboard, targetType, property, window, CurrentTime); + XSync(display, 0); - // Wait for the SelectionNotify event XEvent ev = { 0 }; - XNextEvent(dpy, &ev); + + // Keep calling until we get SelectionNotify + while (XCheckTypedEvent(display, SelectionNotify, &ev) == False); Atom actualType = { 0 }; int actualFormat = 0; @@ -1099,9 +1092,8 @@ Image GetClipboardImage(void) unsigned long bytesAfter = 0; unsigned char *data = NULL; - // Read the data from our ghost window's property - XGetWindowProperty(dpy, win, property, 0, ~0L, False, AnyPropertyType, - &actualType, &actualFormat, &nitems, &bytesAfter, &data); + XGetWindowProperty(display, window, property, 0, ~0L, False, AnyPropertyType, + &actualType, &actualFormat, &nitems, &bytesAfter, &data); if (data != NULL) { @@ -1109,8 +1101,6 @@ Image GetClipboardImage(void) XFree(data); } - XDestroyWindow(dpy, win); - XCloseDisplay(dpy); #else TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); #endif // _WIN32 From fd1dfd7d651e33ef89930359b9cf9dd325116565 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 May 2026 18:59:23 +0200 Subject: [PATCH 16/49] ADDED: `rprand_get_value_raw()` --- src/external/rprand.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/external/rprand.h b/src/external/rprand.h index cdef03c01..b71395415 100644 --- a/src/external/rprand.h +++ b/src/external/rprand.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* rprand v1.0 - A simple and easy-to-use pseudo-random numbers generator (PRNG) +* rprand v1.1 - A simple and easy-to-use pseudo-random numbers generator (PRNG) * * FEATURES: * - Pseudo-random values generation, 32 bits: [0..4294967295] @@ -118,6 +118,7 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- RPRANDAPI void rprand_set_seed(unsigned long long seed); // Set rprand_state for Xoshiro128**, seed is 64bit RPRANDAPI int rprand_get_value(int min, int max); // Get random value within a range, min and max included +RPRANDAPI int rprand_get_value_raw(void); // Get random value, Xoshiro128** generator (uses global rprand_state) RPRANDAPI int *rprand_load_sequence(unsigned int count, int min, int max); // Load pseudo-random numbers sequence with no duplicates RPRANDAPI void rprand_unload_sequence(int *sequence); // Unload pseudo-random numbers sequence @@ -186,6 +187,13 @@ int rprand_get_value(int min, int max) return value; } +int rprand_get_value_raw(void) +{ + int value = rprand_xoshiro(); + + return value; +} + // Load pseudo-random numbers sequence with no duplicates, min and max included int *rprand_load_sequence(unsigned int count, int min, int max) { From 7d5b61ce016fe70b8ce3248fdd0554899688489d Mon Sep 17 00:00:00 2001 From: Colin James Wood <82226641+NighthowlerStudios@users.noreply.github.com> Date: Wed, 20 May 2026 08:12:20 +0100 Subject: [PATCH 17/49] [rlsw][SEGFAULT] Fix triangle and quad spans applying pixels out of bounds (#5849) * fix triangle and quad spans applying pixels out of bounds * remove off by one errors on x/y LoopMax * apply the RASTER_QUAD offset at the loop start so it increments correctly * fix missing endif * remove include guard to allow dyMin usage * early exit if nothing to draw on a span * incorporate dxStart into xSubstep to make xOffset calculate a single time * remove ghost comment * early exit for quads, with a float cast on the left and top distance calculation * remove duplicate xLoopEnd --- src/external/rlsw.h | 84 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 7e153adbc..85e4e8740 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -5385,6 +5385,17 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t int xEnd = (int)end->position[0]; if (xStart == xEnd) return; + // Intercept the span bounds to ensure we don't write before the framebuffer. + int xLoopStart = (xStart >= 0)? xStart : 0; + int xLoopEnd = (xEnd <= RLSW.colorBuffer->width)? xEnd : RLSW.colorBuffer->width; + // Nothing to draw. + if (xLoopStart >= xLoopEnd) return; + + // Get the current row and skip if outside the framebuffer. + // Maybe this check is better suited elsewhere? + int y = (int)start->position[1]; + if (y < 0 || y >= RLSW.colorBuffer->height) return; + // Compute the inverse horizontal distance along the X axis float dxRcp = sw_rcp(end->position[0] - start->position[0]); @@ -5405,27 +5416,29 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t #endif // Compute the subpixel distance to traverse before the first pixel + // Also step further into them to move away from the colorbuffer edge. float xSubstep = 1.0f - sw_fract(start->position[0]); + float dxStart = (float)(xLoopStart - xStart); + float xOffset = xSubstep + dxStart; - // Initializing the interpolation starting values - float w = start->position[3] + dWdx*xSubstep; + // Initializing the interpolation starting values. + float w = start->position[3] + dWdx*xOffset; float color[4] = { - start->color[0] + dCdx[0]*xSubstep, - start->color[1] + dCdx[1]*xSubstep, - start->color[2] + dCdx[2]*xSubstep, - start->color[3] + dCdx[3]*xSubstep + start->color[0] + dCdx[0]*xOffset, + start->color[1] + dCdx[1]*xOffset, + start->color[2] + dCdx[2]*xOffset, + start->color[3] + dCdx[3]*xOffset }; #ifdef SW_ENABLE_DEPTH_TEST - float z = start->position[2] + dZdx*xSubstep; + float z = start->position[2] + dZdx*xOffset; #endif #ifdef SW_ENABLE_TEXTURE - float u = start->texcoord[0] + dUdx*xSubstep; - float v = start->texcoord[1] + dVdx*xSubstep; + float u = start->texcoord[0] + dUdx*xOffset; + float v = start->texcoord[1] + dVdx*xOffset; #endif // Pre-calculate the starting pointers for the framebuffer row - int y = (int)start->position[1]; - int baseOffset = y*RLSW.colorBuffer->width + xStart; + int baseOffset = y*RLSW.colorBuffer->width + xLoopStart; uint8_t *cPtr = (uint8_t *)(RLSW.colorBuffer->pixels) + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE; #ifdef SW_ENABLE_DEPTH_TEST uint8_t *dPtr = (uint8_t *)(RLSW.depthBuffer->pixels) + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE; @@ -5433,12 +5446,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t #define SW_AFFINE_BLOCK 16 - int x = xStart; - while (x < xEnd) + int x = xLoopStart; + while (x < xLoopEnd) { // Clamp last block to remaining pixels int blockEnd = x + SW_AFFINE_BLOCK; - if (blockEnd > xEnd) blockEnd = xEnd; + if (blockEnd > xLoopEnd) blockEnd = xLoopEnd; float blockLenF = (float)(blockEnd - x); float blockLenRcp = sw_rcp(blockLenF); @@ -5673,6 +5686,14 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, int xMax = (int)br->position[0]; int yMax = (int)br->position[1]; + // Exit early if no pixels to draw. Use these later for loop boundaries + int yLoopMin = (yMin >= 0)? yMin : 0; + int xLoopMin = (xMin >= 0)? xMin : 0; + int yLoopMax = (yMax <= RLSW.colorBuffer->height)? yMax : RLSW.colorBuffer->height; + int xLoopMax = (xMax <= RLSW.colorBuffer->width)? xMax : RLSW.colorBuffer->width; + + if (yLoopMin >= yLoopMax || xLoopMin >= xLoopMax) return; + float w = (float)(xMax - xMin); float h = (float)(yMax - yMin); if ((w <= 0) || (h <= 0)) return; @@ -5726,21 +5747,44 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, uint8_t *dPixels = RLSW.depthBuffer->pixels; #endif - for (int y = yMin; y < yMax; y++) + // Calculate the distance the in-bounds boundary is from the quad's edges, only on the left and top. + float dxMin = (float)(xLoopMin - xMin); + float dyMin = (float)(yLoopMin - yMin); + + // Correct our start by how far we clipped outside the framebuffer. + cRow[0] += dCdx[0]*dxMin + dCdy[0]*dyMin; + cRow[1] += dCdx[1]*dxMin + dCdy[1]*dyMin; + cRow[2] += dCdx[2]*dxMin + dCdy[2]*dyMin; + cRow[3] += dCdx[3]*dxMin + dCdy[3]*dyMin; + #ifdef SW_ENABLE_DEPTH_TEST + zRow += dZdy*dyMin + dZdx*dxMin; + #endif + #ifdef SW_ENABLE_TEXTURE + uRow += dUdy*dyMin + dUdx*dxMin; + vRow += dVdy*dyMin + dVdx*dxMin; + #endif + + for (int y = yLoopMin; y < yLoopMax; y++) { - int baseOffset = y*stride + xMin; + int baseOffset = y*stride + xLoopMin; uint8_t *cPtr = cPixels + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE; #ifdef SW_ENABLE_DEPTH_TEST uint8_t *dPtr = dPixels + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE; + // Copy the cursors so we increment them ourselves without destroying the offset maths. float z = zRow; #endif #ifdef SW_ENABLE_TEXTURE float u = uRow; float v = vRow; #endif - float color[4] = { cRow[0], cRow[1], cRow[2], cRow[3] }; + float color[4] = { + cRow[0], + cRow[1], + cRow[2], + cRow[3] + }; - for (int x = xMin; x < xMax; x++) + for (int x = xLoopMin; x < xLoopMax; x++) { float srcColor[4] = { color[0], color[1], color[2], color[3] }; @@ -5779,6 +5823,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, #ifdef SW_ENABLE_DEPTH_TEST discard: #endif + // We move one pixel over without touching the original "start offset" color[0] += dCdx[0]; color[1] += dCdx[1]; color[2] += dCdx[2]; @@ -5801,6 +5846,9 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, cPtr += SW_FRAMEBUFFER_COLOR_SIZE; } + // The for loop is clamped to the right side of the screen. + // However, these cursor start vars are still on the left. + // That's fine. We just need to advance to the next row. cRow[0] += dCdy[0]; cRow[1] += dCdy[1]; cRow[2] += dCdy[2]; From 0d78f10161f9d3df38b10bd33444451b7ee11eda Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 20 May 2026 09:16:16 +0200 Subject: [PATCH 18/49] Reviewed comments formating --- src/external/rlsw.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 85e4e8740..ffbdaae81 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -5385,13 +5385,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t int xEnd = (int)end->position[0]; if (xStart == xEnd) return; - // Intercept the span bounds to ensure we don't write before the framebuffer. + // Intercept the span bounds to ensure to not write before the framebuffer int xLoopStart = (xStart >= 0)? xStart : 0; int xLoopEnd = (xEnd <= RLSW.colorBuffer->width)? xEnd : RLSW.colorBuffer->width; - // Nothing to draw. - if (xLoopStart >= xLoopEnd) return; + if (xLoopStart >= xLoopEnd) return; // Nothing to draw - // Get the current row and skip if outside the framebuffer. + // Get the current row and skip if outside the framebuffer // Maybe this check is better suited elsewhere? int y = (int)start->position[1]; if (y < 0 || y >= RLSW.colorBuffer->height) return; @@ -5416,12 +5415,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t #endif // Compute the subpixel distance to traverse before the first pixel - // Also step further into them to move away from the colorbuffer edge. + // Also step further into them to move away from the colorbuffer edge float xSubstep = 1.0f - sw_fract(start->position[0]); float dxStart = (float)(xLoopStart - xStart); float xOffset = xSubstep + dxStart; - // Initializing the interpolation starting values. + // Initializing the interpolation starting values float w = start->position[3] + dWdx*xOffset; float color[4] = { start->color[0] + dCdx[0]*xOffset, @@ -5747,11 +5746,11 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, uint8_t *dPixels = RLSW.depthBuffer->pixels; #endif - // Calculate the distance the in-bounds boundary is from the quad's edges, only on the left and top. + // Calculate the distance the in-bounds boundary is from the quad's edges, only on the left and top float dxMin = (float)(xLoopMin - xMin); float dyMin = (float)(yLoopMin - yMin); - // Correct our start by how far we clipped outside the framebuffer. + // Correct our start by how far it's clipped outside the framebuffer cRow[0] += dCdx[0]*dxMin + dCdy[0]*dyMin; cRow[1] += dCdx[1]*dxMin + dCdy[1]*dyMin; cRow[2] += dCdx[2]*dxMin + dCdy[2]*dyMin; @@ -5770,7 +5769,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, uint8_t *cPtr = cPixels + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE; #ifdef SW_ENABLE_DEPTH_TEST uint8_t *dPtr = dPixels + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE; - // Copy the cursors so we increment them ourselves without destroying the offset maths. + // Copy the cursors without destroying the offset maths float z = zRow; #endif #ifdef SW_ENABLE_TEXTURE @@ -5823,7 +5822,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, #ifdef SW_ENABLE_DEPTH_TEST discard: #endif - // We move one pixel over without touching the original "start offset" + // Move one pixel over without touching the original "start offset" color[0] += dCdx[0]; color[1] += dCdx[1]; color[2] += dCdx[2]; @@ -5846,9 +5845,9 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, cPtr += SW_FRAMEBUFFER_COLOR_SIZE; } - // The for loop is clamped to the right side of the screen. - // However, these cursor start vars are still on the left. - // That's fine. We just need to advance to the next row. + // The for loop is clamped to the right side of the screen + // However, these cursor start vars are still on the left + // That's fine, advancing to the next row cRow[0] += dCdy[0]; cRow[1] += dCdy[1]; cRow[2] += dCdy[2]; From f65d5ad7a9682696f96ef7fbca13609126139a71 Mon Sep 17 00:00:00 2001 From: ghera Date: Sun, 24 May 2026 08:55:08 +0200 Subject: [PATCH 19/49] rshapes: fix auto segment rounded-corner math and rounding (#5883) --- src/rshapes.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 69c1dacea..5ef988e38 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -361,7 +361,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -453,7 +453,7 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -579,7 +579,7 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startA { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -670,7 +670,7 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float s { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -960,7 +960,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)(ceilf(2*PI/th)/2.0f); + segments = (int)ceilf((2*PI/th)/4.0f); if (segments <= 0) segments = 4; } @@ -1195,7 +1195,7 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)(ceilf(2*PI/th)/2.0f); + segments = (int)ceilf((2*PI/th)/4.0f); if (segments <= 0) segments = 4; } From f17babfe8af98e7a6bf565f790cccf43177187c6 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 24 May 2026 09:24:26 +0200 Subject: [PATCH 20/49] REVIEWED: #5879 --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index e8164073f..286f33c28 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1164,7 +1164,7 @@ RLAPI bool ChangeDirectory(const char *dirPath); // Change wo RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths, files and directories, no subdirs scan -RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*` +RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths From 7dd72e73284f7d6ed8d9e292ea421071117757a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 07:25:01 +0000 Subject: [PATCH 21/49] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 2 +- tools/rlparser/output/raylib_api.lua | 2 +- tools/rlparser/output/raylib_api.txt | 2 +- tools/rlparser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index aa018051a..b42fd2d61 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -4696,7 +4696,7 @@ }, { "name": "LoadDirectoryFilesEx", - "description": "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`", + "description": "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'", "returnType": "FilePathList", "params": [ { diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index e88db0b7e..859ef38ba 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4207,7 +4207,7 @@ return { }, { name = "LoadDirectoryFilesEx", - description = "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`", + description = "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'", returnType = "FilePathList", params = { {type = "const char *", name = "basePath"}, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 0447edd23..0051c6a14 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1789,7 +1789,7 @@ Function 146: LoadDirectoryFiles() (1 input parameters) Function 147: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList - Description: Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*` + Description: Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index e9db25846..fdc1481ec 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1125,7 +1125,7 @@ - + From 808e6b9b20f76de5af1f512ae2a76af01627de74 Mon Sep 17 00:00:00 2001 From: keyle Date: Mon, 25 May 2026 01:36:12 +1000 Subject: [PATCH 22/49] Raylib-lua version to 5.5 (#5884) raylib-lua from 5.0 to 5.5 in bindings. --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 7d350a9b0..710a7a1ed 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -49,7 +49,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | -| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC | +| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.5 | [Lua](http://www.lua.org) | ISC | | [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC | | [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib | From eaf32c83bf40c873f4ae9b455752a5c5ac05dae0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 25 May 2026 00:26:26 +0200 Subject: [PATCH 23/49] REXM: Latest w64devkit supports `make` directly, simplifying code to avoid `mingw32-make` --- tools/rexm/rexm.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index 71404dcf8..75eb3dc99 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -675,13 +675,12 @@ int main(int argc, char *argv[]) // WARNING 2: raylib.a and raylib.web.a must be available when compiling locally #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", GetFileNameWithoutExt(inFileName)); - //putenv("RAYLIB_DIR=C:\\GitHub\\raylib"); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); #else LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", GetFileNameWithoutExt(inFileName)); - system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); #endif + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); + // Update generated .html metadata LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName)); UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName), @@ -778,10 +777,9 @@ int main(int argc, char *argv[]) // WARNING: EMSDK_PATH must be set to proper location when calling from GitHub Actions #if defined(_WIN32) _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename)); -#else - system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename)); #endif + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename)); + // Update generated .html metadata UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exRename), TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename)); @@ -917,7 +915,7 @@ int main(int argc, char *argv[]) // Set required environment variables //putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath)); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - //putenv("MAKE=mingw32-make"); + //putenv("MAKE=make"); //ChangeDirectory(exBasePath); #endif for (int i = 0; i < exBuildListCount; i++) @@ -933,7 +931,7 @@ int main(int argc, char *argv[]) // Build example for PLATFORM_DESKTOP #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName)); + system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName)); #elif defined(PLATFORM_DRM) LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName); system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1", @@ -949,13 +947,9 @@ int main(int argc, char *argv[]) // Build: raylib.com/examples//_example_name.data // Build: raylib.com/examples//_example_name.wasm // Build: raylib.com/examples//_example_name.js - #if defined(_WIN32) - LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); - #else - LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName); + LOG("INFO: [%s] Building example for PLATFORM_WEB\n", exName); system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); - #endif + // Update generated .html metadata LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName)); UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName), @@ -1312,11 +1306,10 @@ int main(int argc, char *argv[]) #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exInfo->name); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name)); #else LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exInfo->name); - system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name)); #endif + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name)); // Update generated .html metadata LOG("INFO: [%s.html] Updating HTML Metadata...\n", exInfo->name); @@ -1495,7 +1488,7 @@ int main(int argc, char *argv[]) // Set required environment variables //putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath)); //_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - //putenv("MAKE=mingw32-make"); + //putenv("MAKE=make"); //ChangeDirectory(exBasePath); //_putenv("MAKE_PATH=C:\\raylib\\w64devkit\\bin"); //_putenv("EMSDK_PATH = C:\\raylib\\emsdk"); @@ -1592,7 +1585,7 @@ int main(int argc, char *argv[]) // Build: raylib.com/examples//_example_name.js #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B > %s/%s/logs/%s.build.log 2>&1", + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B > %s/%s/logs/%s.build.log 2>&1", exBasePath, exCategory, exName, exBasePath, exCategory, exName)); #else LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName); @@ -1641,13 +1634,13 @@ int main(int argc, char *argv[]) // Set required environment variables //putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath)); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - //putenv("MAKE=mingw32-make"); + //putenv("MAKE=make"); //ChangeDirectory(exBasePath); #endif // Build example for PLATFORM_DESKTOP #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", + system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", exBasePath, exCategory, exName, exBasePath, exCategory, exName)); #elif defined(PLATFORM_DRM) LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName); From 4d845608b8bd6cdda173917521c4c61e7d639f1e Mon Sep 17 00:00:00 2001 From: coal Date: Mon, 25 May 2026 02:32:52 -0400 Subject: [PATCH 24/49] Update listed Raylib version for zig bindings (#5886) As per the README at https://github.com/raylib-zig/raylib-zig, raylib-zig now supports raylib 6.0 --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 710a7a1ed..256c82c2c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -90,7 +90,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib | | [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib | | [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC | -| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT | +| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **6.0** | [Zig](https://ziglang.org) | MIT | | [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT | | [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib | | [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib | From 34b06ca5871d7f6fa39e9e37f7f8f453db9f6cee Mon Sep 17 00:00:00 2001 From: Rgebee Date: Mon, 25 May 2026 15:05:20 +0100 Subject: [PATCH 25/49] Update BINDINGS.md (#5887) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 256c82c2c..bd5d6b213 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -11,7 +11,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | | [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib6.c3l) | **6** | [C3](https://c3-lang.org) | MIT | -| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | +| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **6.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | From 7f9ded76425d4c28d9a53843dfe5acd9bfe128ae Mon Sep 17 00:00:00 2001 From: Fipaan Date: Tue, 26 May 2026 21:13:58 +0500 Subject: [PATCH 26/49] [makefile] ANDROID_ARCH check (#5888) --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile b/src/Makefile index 13f132707..6d918215a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -240,6 +240,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) ifeq ($(ANDROID_ARCH),x86_64) ANDROID_COMPILER_ARCH = x86_64 endif + ifndef ANDROID_COMPILER_ARCH + $(error ANDROID_COMPILER_ARCH: Unknown ANDROID_ARCH=$(ANDROID_ARCH)) + endif endif # Define raylib graphics api depending on selected platform From ef8b3e619532fa95a93040c7e7349f55366689bd Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 26 May 2026 20:46:56 +0200 Subject: [PATCH 27/49] Update rlgl.h --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index ea5673397..e1c0089dc 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -896,7 +896,7 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad // It seems OpenGL ES 2.0 instancing entry points are not defined on Raspberry Pi // provided headers (despite being defined in official Khronos GLES2 headers) // TODO: Avoid raylib platform-dependent code on rlgl, it should be a completely portable library - #if defined(PLATFORM_DRM) + #if defined(PLATFORM_DRM) // Use CONFIG_DRM? typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); From e7edb181dc070e0abf90792204b4b6b02bcdd508 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 27 May 2026 03:20:11 -0400 Subject: [PATCH 28/49] cmake: Reduce minimum CMake version from 3.25 to 3.22 (#5890) There isn't anything in 3.25 that we actually need, so we can reduce the minimum requirement. 3.22 is commonly available across many package managers. For a list of the changes in `FetchContent`, see: https://cmake.org/cmake/help/latest/module/FetchContent.html --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1d319e8d..ca29ce0d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.25) +cmake_minimum_required(VERSION 3.22) #this change avoid the warning that appear when we include raylib using Cmake fatch content project(raylib) From 186d3ce9fb472ae20c1692b30b1245a31a2d1bf1 Mon Sep 17 00:00:00 2001 From: Colin James Wood <82226641+NighthowlerStudios@users.noreply.github.com> Date: Fri, 29 May 2026 17:16:17 +0100 Subject: [PATCH 29/49] [CMake] Properly remove raudio.c and rmodels.c if they're disabled modules (#5878) * only build raudio.c in cmake if it's still enabled * only compile rmodels if it's supported --- src/CMakeLists.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e5dd91ee..55428e882 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,14 +30,22 @@ set(raylib_public_headers # Sources to be compiled set(raylib_sources - raudio.c rcore.c - rmodels.c rshapes.c rtext.c rtextures.c ) +# Only build raudio if it's enabled +if (NOT DEFINED SUPPORT_MODULE_RAUDIO OR SUPPORT_MODULE_RAUDIO) + list(APPEND raylib_sources raudio.c) +endif() + +# Only build rmodels if it's enabled +if (NOT DEFINED SUPPORT_MODULE_RMODELS OR SUPPORT_MODULE_RMODELS) + list(APPEND raylib_sources rmodels.c) +endif() + # /cmake/GlfwImport.cmake handles the details around the inclusion of glfw if (NOT ${PLATFORM} MATCHES "Web") include(GlfwImport) @@ -48,10 +56,10 @@ endif () # Produces a variable LIBS_PRIVATE that will be used later include(LibraryConfigurations) -if (SUPPORT_MODULE_RAUDIO) - MESSAGE(STATUS "Audio Backend: miniaudio") -else () +if (DEFINED SUPPORT_MODULE_RAUDIO AND NOT SUPPORT_MODULE_RAUDIO) MESSAGE(STATUS "Audio Backend: None (-DCUSTOMIZE_BUILD=ON -DSUPPORT_MODULE_RAUDIO=OFF)") +else () + MESSAGE(STATUS "Audio Backend: miniaudio") endif () add_library(raylib ${raylib_sources} ${raylib_public_headers}) From 81c7cb65274bf2a952a97fb32bc153a3c71ba5c1 Mon Sep 17 00:00:00 2001 From: Caleb Seelhoff Date: Fri, 29 May 2026 12:17:04 -0400 Subject: [PATCH 30/49] [rmodels] Fix glTF skinning when joints have non-joint parent nodes (#5876) * [rmodels] Fix glTF skinning when joints have non-joint parent nodes Some glTF exporters (notably wow.export, but also various other DCC pipelines) place skin joints under intermediate non-joint transform nodes that carry part of the bind-pose offset. raylib's existing LoadBoneInfoGLTF and LoadModelAnimationsGLTF only inspected a joint's immediate parent and only sampled joint-local TRS, so any transform stored on an intermediate non-joint ancestor was silently dropped, producing exploded or stretched meshes at runtime. Two surgical changes: LoadBoneInfoGLTF: walk the parent chain past any non-joint ancestors when looking up parentIndex, instead of comparing only against node.parent. Joints whose direct parent is a non-joint were previously treated as skeleton roots. LoadModelAnimationsGLTF: precompute a per-joint extOffset matrix that bakes in the static TRS contribution of any intermediate non-joint nodes between the joint and its nearest joint ancestor. Apply it to each frame's joint TRS before BuildPoseFromParentJoints so the per-frame world transforms match the bind-pose world transforms (LoadGLTF already used cgltf_node_transform_world for bindPose, so this aligns the two code paths). The replaced root-only worldTransform adjustment is a strict subset of the new per-joint extOffset machinery, so it has been removed. Spec-compliant files (the six skeletal-skinning .glb examples shipped with raylib) render bit-identically before and after; previously broken files (e.g. wow.export's babyoctopus.gltf) now match the reference rendering from f3d, the Khronos sample viewer, and three.js. * Resolve review: NULL-check joint offset allocation, fail fast [rmodels] Address review feedback on glTF joint offset handling Resolve the open review points raised on PR #5876 for the per-joint extOffset precompute in LoadModelAnimationsGLTF. * NULL check: validate the extOffset RL_MALLOC result before use, which was previously missing. * Fail-fast handling: detect the allocation failure at its source and abort animation loading (log a warning, free resources, return NULL) instead of propagating a NULL pointer into the per-frame loop. * Brace formatting: expand the collapsed one-line joint-match check (if (...) { isJoint = true; break; }) into raylib's standard Allman brace style. * Readability: break the deeply nested MatrixMultiply(MatrixMultiply(...)) into named nodeScale/nodeRotation/nodeTranslation/nodeTransform locals, mirroring the existing S/R/T composition later in the function. * Spacing/line breaks: add blank lines within the precompute block to match the surrounding code style. --- src/rmodels.c | 100 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 29 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index eb7f30cb8..eeebc3d2b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5375,16 +5375,18 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount) cgltf_node node = *skin.joints[i]; if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name) - 1); - // Find parent bone index + // Find parent bone index by walking up the node tree past any + // non-joint ancestors (intermediate transform nodes used by some + // DCC exporters), until we hit a node that is also in skin.joints. int parentIndex = -1; - - for (unsigned int j = 0; j < skin.joints_count; j++) + cgltf_node *ancestor = node.parent; + while (ancestor != NULL && parentIndex == -1) { - if (skin.joints[j] == node.parent) + for (unsigned int j = 0; j < skin.joints_count; j++) { - parentIndex = (int)j; - break; + if (skin.joints[j] == ancestor) { parentIndex = (int)j; break; } } + if (parentIndex == -1) ancestor = ancestor->parent; } bones[i].parent = parentIndex; @@ -6515,20 +6517,58 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo if (data->skins_count > 0) { cgltf_skin skin = data->skins[0]; + + // Precompute, per joint, the static transform contributed by any + // intermediate non-joint nodes between the joint and its nearest + // joint ancestor. This handles exporters (e.g. wow.export) that + // store bone offsets on dummy parent nodes rather than on the + // joints themselves. Depends only on the skin, not the animation. + int jointCount = (int)skin.joints_count; + Matrix *extOffset = (Matrix *)RL_MALLOC(jointCount*sizeof(Matrix)); + + if (extOffset == NULL) + { + // Allocation failed: abort animation loading at the source rather than + // propagating a NULL pointer into the per-frame transform loop below + TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to allocate joint offset buffer", fileName); + cgltf_free(data); + UnloadFileData(fileData); + *animCount = 0; + return NULL; + } + *animCount = (int)data->animations_count; animations = (ModelAnimation *)RL_CALLOC(data->animations_count, sizeof(ModelAnimation)); - Transform worldTransform = { 0 }; - cgltf_float cgltf_worldTransform[16] = { 0 }; - cgltf_node *node = skin.joints[0]; - cgltf_node_transform_world(node->parent, cgltf_worldTransform); - Matrix worldMatrix = { - cgltf_worldTransform[0], cgltf_worldTransform[4], cgltf_worldTransform[8], cgltf_worldTransform[12], - cgltf_worldTransform[1], cgltf_worldTransform[5], cgltf_worldTransform[9], cgltf_worldTransform[13], - cgltf_worldTransform[2], cgltf_worldTransform[6], cgltf_worldTransform[10], cgltf_worldTransform[14], - cgltf_worldTransform[3], cgltf_worldTransform[7], cgltf_worldTransform[11], cgltf_worldTransform[15] - }; - MatrixDecompose(worldMatrix, &worldTransform.translation, &worldTransform.rotation, &worldTransform.scale); + for (int k = 0; k < jointCount; k++) + { + extOffset[k] = MatrixIdentity(); + cgltf_node *n = skin.joints[k]->parent; + + while (n != NULL) + { + bool isJoint = false; + for (int jj = 0; jj < jointCount; jj++) + { + if (skin.joints[jj] == n) + { + isJoint = true; + break; + } + } + + if (isJoint) break; + + // Compose the intermediate node's local TRS (scale, then rotation, then translation) + Matrix nodeScale = MatrixScale(n->scale[0], n->scale[1], n->scale[2]); + Matrix nodeRotation = QuaternionToMatrix((Quaternion){ n->rotation[0], n->rotation[1], n->rotation[2], n->rotation[3] }); + Matrix nodeTranslation = MatrixTranslate(n->translation[0], n->translation[1], n->translation[2]); + Matrix nodeTransform = MatrixMultiply(MatrixMultiply(nodeScale, nodeRotation), nodeTranslation); + + extOffset[k] = MatrixMultiply(extOffset[k], nodeTransform); + n = n->parent; + } + } for (unsigned int a = 0; a < data->animations_count; a++) { @@ -6637,19 +6677,19 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo } } - animations[a].keyframePoses[j][k] = (Transform){ - .translation = translation, - .rotation = rotation, - .scale = scale - }; - } + // Compose joint local TRS, then prepend the static + // intermediate non-joint offsets so the final TRS is + // expressed relative to the joint's skeleton parent. + Matrix S = MatrixScale(scale.x, scale.y, scale.z); + Matrix R = QuaternionToMatrix(rotation); + Matrix T = MatrixTranslate(translation.x, translation.y, translation.z); + Matrix jointLocal = MatrixMultiply(MatrixMultiply(S, R), T); + Matrix combined = MatrixMultiply(jointLocal, extOffset[k]); - Transform *root = &animations[a].keyframePoses[j][0]; - root->rotation = QuaternionMultiply(worldTransform.rotation, root->rotation); - root->scale = Vector3Multiply(root->scale, worldTransform.scale); - root->translation = Vector3Multiply(root->translation, worldTransform.scale); - root->translation = Vector3RotateByQuaternion(root->translation, worldTransform.rotation); - root->translation = Vector3Add(root->translation, worldTransform.translation); + Transform tr; + MatrixDecompose(combined, &tr.translation, &tr.rotation, &tr.scale); + animations[a].keyframePoses[j][k] = tr; + } BuildPoseFromParentJoints(bones, animations[a].boneCount, animations[a].keyframePoses[j]); } @@ -6658,6 +6698,8 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo RL_FREE(boneChannels); RL_FREE(bones); } + + RL_FREE(extOffset); } if (data->skins_count > 1) From 7b96144716e1c133aa89e473efac2533ae12395e Mon Sep 17 00:00:00 2001 From: Vasilis Narain <79228641+Vasilis-Narain@users.noreply.github.com> Date: Fri, 29 May 2026 18:18:18 +0200 Subject: [PATCH 31/49] [rcore] `GetCurrentMonitor()`, fix for integer overflow in distance calculation (#5842) * Fix signed integer overflow in GetCurrentMonitor distance calc * Revert "Fix signed integer overflow in GetCurrentMonitor distance calc" This reverts commit e0083bc7fe8a4dab23e6c1783402e37aec2661d2. * fix GetCurrentMonitor() distance calc overflow * fix GetCurrentMonitor() distance calc --- src/platforms/rcore_desktop_glfw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 6def8e77a..16f22f605 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -839,7 +839,7 @@ int GetCurrentMonitor(void) // this is probably an overengineered solution for a side case // trying to match SDL behaviour - int closestDist = 0x7FFFFFFF; + unsigned int closestDist = 0xFFFFFFFFu; // Window center position int wcx = 0; @@ -883,7 +883,14 @@ int GetCurrentMonitor(void) int dx = wcx - xclosest; int dy = wcy - yclosest; - int dist = (dx*dx) + (dy*dy); + + // Unsigned to dodge signed overflow UB; (-x)^2 == x^2 mod 2^32 so sign drops out. + // If |dx| or |dy| >= 65536, dist wraps and the wrong monitor may win. + // Not a concern for realistic monitor layouts. + unsigned int ux = (unsigned int)dx; + unsigned int uy = (unsigned int)dy; + unsigned int dist = ux*ux + uy*uy; + if (dist < closestDist) { index = i; From 7c284cc5bc4a573596104a42f34d5518ff080949 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sat, 30 May 2026 03:47:35 -0300 Subject: [PATCH 32/49] Fix warning about unused variables (#5898) --- src/rcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index 74774e77b..9f93ecbbc 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2277,10 +2277,11 @@ int FileMove(const char *srcPath, const char *dstPath) int FileTextReplace(const char *fileName, const char *search, const char *replacement) { int result = 0; + +#if SUPPORT_MODULE_RTEXT char *fileText = NULL; char *fileTextUpdated = { 0 }; -#if SUPPORT_MODULE_RTEXT if (FileExists(fileName)) { fileText = LoadFileText(fileName); From f0d3e9a5c8466bb0971be14ade7730ce0eaec45d Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sat, 30 May 2026 03:49:34 -0300 Subject: [PATCH 33/49] Security fixes (rcore_desktop_win32.c) (#5899) * Security fixes in rcore_desktop_win32.c * Avoid calling strlen() twice --- src/platforms/rcore_desktop_win32.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index a797234ba..33ce1f661 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1257,8 +1257,9 @@ void OpenURL(const char *url) if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); else { - char *cmd = (char *)RL_CALLOC(strlen(url) + 32, sizeof(char)); - sprintf(cmd, "explorer \"%s\"", url); + int len = strlen(url) + 32; + char *cmd = (char *)RL_CALLOC(len, sizeof(char)); + snprintf(cmd, len, "explorer \"%s\"", url); int result = system(cmd); if (result == -1) TRACELOG(LOG_WARNING, "OpenURL() child process could not be created"); RL_FREE(cmd); @@ -2052,8 +2053,11 @@ static void HandleMouseButton(int button, char state) static void HandleRawInput(LPARAM lparam) { RAWINPUT input = { 0 }; + UINT inputSize = 0; + + if (GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &inputSize, sizeof(RAWINPUTHEADER)) != 0) return; + if (inputSize > sizeof(input)) return; - UINT inputSize = sizeof(input); UINT size = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &input, &inputSize, sizeof(RAWINPUTHEADER)); if (size == (UINT)-1) TRACELOG(LOG_ERROR, "WIN32: Failed to get raw input data [ERROR: %lu]", GetLastError()); From 2ee6a764641dd7392d1b8c606519135c14ace1a3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 30 May 2026 12:20:58 +0200 Subject: [PATCH 34/49] REVIEWED: `GetWindowHandle()`, to be consistent between backends, fix #5885 Returns the underlying window handle for platforms with some windowing system. --- src/platforms/rcore_android.c | 3 +- src/platforms/rcore_desktop_glfw.c | 24 ++++++------ src/platforms/rcore_desktop_rgfw.c | 27 +++++++++---- src/platforms/rcore_desktop_sdl.c | 61 ++++++++++++++++++++++++++++- src/platforms/rcore_desktop_win32.c | 2 +- 5 files changed, 94 insertions(+), 23 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 990b2fe6a..78abe9ed6 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -473,8 +473,7 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - TRACELOG(LOG_WARNING, "GetWindowHandle() not implemented on target platform"); - return NULL; + return (void *)platform.app->window; // Type: ANativeWindow* } // Get number of monitors diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 16f22f605..d885acf43 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -115,7 +115,7 @@ typedef struct { // Local storage for the window handle returned by glfwGetX11Window // This is needed as X11 handles are integers and may not fit inside a pointer depending on platform // Storing the handle locally and returning a pointer in GetWindowHandle allows the code to work regardless of pointer width - XID windowHandleX11; + Window windowHandleX11; // Underlying type: unsigned long (XID, Window) #endif } PlatformData; @@ -764,9 +764,10 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { + void *handle = NULL; + #if defined(_WIN32) - // NOTE: Returned handle is: void *HWND (windows.h) - return glfwGetWin32Window(platform.handle); + handle = glfwGetWin32Window(platform.handle); // Type: HWND #endif #if defined(__linux__) #if defined(_GLFW_WAYLAND) @@ -774,28 +775,27 @@ void *GetWindowHandle(void) int platformID = glfwGetPlatform(); if (platformID == GLFW_PLATFORM_WAYLAND) { - return glfwGetWaylandWindow(platform.handle); + handle = (void *)glfwGetWaylandWindow(platform.handle); // Type: struct wl_surface* } else { - platform.windowHandleX11 = glfwGetX11Window(platform.handle); - return &platform.windowHandleX11; + platform.windowHandleX11 = glfwGetX11Window(platform.handle); // Type: Window (unsigned long) + handle = &platform.windowHandleX11; } #else - return glfwGetWaylandWindow(platform.handle); + handle = (void *)glfwGetWaylandWindow(platform.handle); #endif #elif defined(_GLFW_X11) - // Store the window handle localy and return a pointer to the variable instead + // Store the window handle locally and return a pointer to the variable instead platform.windowHandleX11 = glfwGetX11Window(platform.handle); - return &platform.windowHandleX11; + handle = &platform.windowHandleX11; #endif #endif #if defined(__APPLE__) - // NOTE: Returned handle is: (objc_object *) - return (void *)glfwGetCocoaWindow(platform.handle); + handle = (void *)glfwGetCocoaWindow(platform.handle); // Type: NSWindow* #endif - return NULL; + return handle; } // Get number of monitors diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 1cb38ff61..4f54e1708 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -184,6 +184,9 @@ typedef struct { i32 surfaceWidth; i32 surfaceHeight; #endif +#if defined(__linux__) && defined(RGFW_X11) + Window windowHandleX11; // Underlying type: unsigned long +#endif } PlatformData; //---------------------------------------------------------------------------------- @@ -851,15 +854,25 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - if (platform.window == NULL) return NULL; + void *handle = NULL; -#if defined(RGFW_WASM) - return (void *)&platform.window->src.ctx; -#elif defined(RGFW_WAYLAND) - return (void *)platform.window->src.surface; -#else - return (void *)platform.window->src.window; + if (platform.window != NULL) + { +#if defined(_WIN32) + handle = (void *)platform.window->src.window; // Type: HWND +#elif defined(__linux__) + #if defined(RGFW_X11) + platform.windowHandleX11 = platform.window->src.window; // Type: Window (unsigned long) + handle = &platform.window->src.window; + #elif defined(RGFW_WAYLAND) + handle = (void *)platform.window->src.surface; // Type: struct wl_surface* + #endif +#elif defined(__APPLE__) + handle = (void *)platform.window->src.window; // Type: id, NSWindow* #endif + } + + return handle; } // Get number of monitors diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 1b434b5d2..d568ec095 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -56,6 +56,7 @@ #include "SDL3/SDL.h" #elif defined(USING_SDL2_PROJECT) #include "SDL2/SDL.h" + #include "SDL2/SDL_syswm.h" // Required to get window handlers #else #include "SDL.h" #endif @@ -101,6 +102,13 @@ typedef struct { SDL_GameController *gamepad[MAX_GAMEPADS]; SDL_JoystickID gamepadId[MAX_GAMEPADS]; // Joystick instance ids, they do not start from 0 SDL_Cursor *cursor; + +#if defined(__linux__) + // Local storage for the window handle (X11) + // NOTE: On SDL is not possible to know windowing backend at compile time, so, + // just in case, avoiding X11 specific types here + unsigned long windowHandleX11; // Underlying type for: XID, Window +#endif } PlatformData; //---------------------------------------------------------------------------------- @@ -920,9 +928,60 @@ void SetWindowFocused(void) } // Get native window handle +// NOTE: Handle type depends on OS and windowing system void *GetWindowHandle(void) { - return (void *)platform.window; + void *handle = NULL; + +#if defined(USING_SDL3_PROJECT) + // REF: https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_video.h#L1590 + SDL_PropertiesID props = SDL_GetWindowProperties(platform.window); + #if defined(_WIN32) + handle = (void *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); // Type: HWND + #elif defined(__linux__) + unsigned long windowId = (unsigned long)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); // Type: unsigned long (XID, Window) + if (windowId != 0) + { + // X11 window ID + platform.windowHandleX11 = windowId; + handle = &platform.windowHandleX11; + } + else + { + // Wayland, get display surface pointer + // NOTE: Alternative SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER + handle = (void *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); // Type: struct wl_surface* + } + #elif defined(__APPLE__) + handle = (void *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); // Type: NSWindow* + #endif +#elif defined(USING_SDL2_PROJECT) + SDL_SysWMinfo wmInfo = { 0 }; + SDL_VERSION(&wmInfo.version); + if (SDL_GetWindowWMInfo(platform.window, &wmInfo)) + { + #if defined(_WIN32) + handle = (void *)wmInfo.info.win.window; // Type: HWND + #elif defined(__linux__) + if (wmInfo.subsystem == SDL_SYSWM_X11) + { + // X11, get window ID (unsigned long) + platform.windowHandleX11 = (unsigned long)wmInfo.info.x11.window; + handle = &platform.windowHandleX11; + } + else if (wmInfo.subsystem == SDL_SYSWM_WAYLAND) + { + // Wayland, get display surface pointer + // NOTE: Alternative: wmInfo.info.wl.display + handle = (void *)wmInfo.info.wl.surface; // Type: struct wl_surface* + } + #elif defined(__APPLE__) + handle = (void *)wmInfo.info.cocoa.window; // Type: NSWindow* + #endif + } +#endif + + return handle; } // Get number of monitors diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index 33ce1f661..517af1eb8 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1023,7 +1023,7 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - return platform.hwnd; + return (void *)platform.hwnd; } int GetMonitorCount(void) From b7f50b2fb65b3d1a18a0551ef03f4d3845a9bec6 Mon Sep 17 00:00:00 2001 From: Kaggen67 Date: Sat, 30 May 2026 19:39:16 +0200 Subject: [PATCH 35/49] [rtextures] ImageDrawLine() rounding and length fix (#5896) * Fixing ImageDrawLine to be more pixel accurate Changes to ImageDrawLine() function. . Added one pixel to the length of a line so it wont draw lines one pixel short. . Changed rounding by adding 0.5 in 16 bit fixed point to 'j' in for-loop. * Changed ImagDrawLine to be more acurate --- src/rtextures.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index ba50d9d02..bedcdb6a4 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3506,7 +3506,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en } // Initialize variables for drawing loop - int endVal = longLen; + int endVal = longLen + 1; int sgnInc = 1; // Adjust direction increment based on longLen sign @@ -3514,6 +3514,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en { longLen = -longLen; sgnInc = -1; + endVal -= 2; } // Calculate fixed-point increment for shorter length @@ -3523,7 +3524,8 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en if (yLonger) { // If line is more vertical, iterate over y-axis - for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) + // Init j with 0.5 in 16-bit fixed point (1 << 15) for better rounding. + for (int i = 0, j = (1 << 15); i != endVal; i += sgnInc, j += decInc) { // Calculate pixel position and draw it ImageDrawPixel(dst, startPosX + (j >> 16), startPosY + i, color); @@ -3532,7 +3534,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en else { // If line is more horizontal, iterate over x-axis - for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) + for (int i = 0, j = (1 << 15); i != endVal; i += sgnInc, j += decInc) { // Calculate pixel position and draw it ImageDrawPixel(dst, startPosX + i, startPosY + (j >> 16), color); From 10a889c482bc001533536162cc2cc9d193845eae Mon Sep 17 00:00:00 2001 From: Bigfoot <90587919+Bigfoot71@users.noreply.github.com> Date: Sat, 30 May 2026 19:44:45 +0200 Subject: [PATCH 36/49] [rlsw] Replace `SW_TEXTURE_REPEAT_POT_FAST` with `SW_SUPPORT_NPOT_TEXTURE` (#5901) * replace `SW_TEXTURE_REPEAT_POT_FAST` by `SW_SUPPORT_NPOT_TEXTURE` * tweak `SW_SUPPORT_NPOT_TEXTURE` comment * remove extra comment --- src/external/rlsw.h | 124 +++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 64 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index ffbdaae81..b98a3f684 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -164,17 +164,10 @@ #endif #endif -// Fast power-of-two texture wrap (SW_REPEAT mode only) -// When defined, textures whose width/height are powers of two use a bitmask -// wrap (`x & (size-1)`) instead of `floorf`-based fractional wrap or the signed `%` chain in the linear sampler -// Saves a software divide on Xtensa and a few instructions everywhere -// NPOT textures keep using the original path via a runtime `(size & (size-1)) == 0` check, -// so SW_REPEAT remains correct for them -// The only observable behavior change is for POT textures sampled with negative UV coordinates: -// bitmask wrap (two's complement) can differ from `sw_fract` by one texel -// Off by default to keep bit-for-bit behavior; opt in if you control your asset UVs -// -//#define SW_TEXTURE_REPEAT_POT_FAST +// Full NPOT texture support (enabled by default) +// When disabled, SW_REPEAT requires POT on its axis (fast bitmask wrap) +// SW_CLAMP remains supported for any dimension, per-axis +#define SW_SUPPORT_NPOT_TEXTURE true //---------------------------------------------------------------------------------- // OpenGL Compatibility Types @@ -2406,6 +2399,14 @@ static inline bool sw_texture_alloc(sw_texture_t *texture, const void *data, int int bpp = SW_PIXELFORMAT_SIZE[format]; int newSize = w*h*bpp; + if (texture->pixels == NULL) + { + texture->minFilter = SW_NEAREST; + texture->magFilter = SW_NEAREST; + texture->sWrap = SW_CLAMP; + texture->tWrap = SW_CLAMP; + } + if (newSize > texture->allocSz) { void *ptr = SW_REALLOC(texture->pixels, newSize); @@ -2470,38 +2471,25 @@ static inline void sw_texture_sample_nearest(float *SW_RESTRICT color, const sw_ { int x, y; -#ifdef SW_TEXTURE_REPEAT_POT_FAST - if ((tex->sWrap == SW_REPEAT) && ((tex->width & tex->wMinus1) == 0)) - { - x = (int)(u*tex->width) & tex->wMinus1; - } - else -#endif - { - u = (tex->sWrap == SW_REPEAT)? sw_fract(u) : sw_saturate(u); - x = (int)(u*tex->width); - } +#if SW_SUPPORT_NPOT_TEXTURE + if (tex->sWrap == SW_REPEAT) x = (int)(sw_fract(u)*tex->width); + else x = (int)(sw_saturate(u)*tex->width); -#ifdef SW_TEXTURE_REPEAT_POT_FAST - if ((tex->tWrap == SW_REPEAT) && ((tex->height & tex->hMinus1) == 0)) - { - y = (int)(v*tex->height) & tex->hMinus1; - } - else + if (tex->tWrap == SW_REPEAT) y = (int)(sw_fract(v)*tex->height); + else y = (int)(sw_saturate(v)*tex->height); +#else + if (tex->sWrap == SW_REPEAT) x = (int)(u*tex->width) & tex->wMinus1; + else x = (int)(sw_saturate(u)*tex->width); + + if (tex->tWrap == SW_REPEAT) y = (int)(v*tex->height) & tex->hMinus1; + else y = (int)(sw_saturate(v)*tex->height); #endif - { - v = (tex->tWrap == SW_REPEAT)? sw_fract(v) : sw_saturate(v); - y = (int)(v*tex->height); - } tex->readColor(color, tex->pixels, y*tex->width + x); } static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_texture_t *SW_RESTRICT tex, float u, float v) { - // TODO: With a bit more cleverness the number of operations can - // be clearly reduced, but for now it works fine - float xf = (u*tex->width) - 0.5f; float yf = (v*tex->height) - 0.5f; @@ -2514,41 +2502,36 @@ static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_t int x1 = x0 + 1; int y1 = y0 + 1; - if (tex->sWrap == SW_CLAMP) - { - x0 = (x0 > tex->wMinus1)? tex->wMinus1 : x0; - x1 = (x1 > tex->wMinus1)? tex->wMinus1 : x1; - } -#ifdef SW_TEXTURE_REPEAT_POT_FAST - else if ((tex->width & tex->wMinus1) == 0) - { - // POT fast path: bitmask wrap covers negative ints via two's complement - x0 = x0 & tex->wMinus1; - x1 = x1 & tex->wMinus1; - } -#endif - else + if (tex->sWrap == SW_REPEAT) { + #if SW_SUPPORT_NPOT_TEXTURE x0 = (x0%tex->width + tex->width)%tex->width; x1 = (x1%tex->width + tex->width)%tex->width; + #else + x0 = x0 & tex->wMinus1; + x1 = x1 & tex->wMinus1; + #endif } - - if (tex->tWrap == SW_CLAMP) - { - y0 = (y0 > tex->hMinus1)? tex->hMinus1 : y0; - y1 = (y1 > tex->hMinus1)? tex->hMinus1 : y1; - } -#ifdef SW_TEXTURE_REPEAT_POT_FAST - else if ((tex->height & tex->hMinus1) == 0) - { - y0 = y0 & tex->hMinus1; - y1 = y1 & tex->hMinus1; - } -#endif else { + x0 = sw_clamp_int(x0, 0, tex->wMinus1); + x1 = sw_clamp_int(x1, 0, tex->wMinus1); + } + + if (tex->tWrap == SW_REPEAT) + { + #if SW_SUPPORT_NPOT_TEXTURE y0 = (y0%tex->height + tex->height)%tex->height; y1 = (y1%tex->height + tex->height)%tex->height; + #else + y0 = y0 & tex->hMinus1; + y1 = y1 & tex->hMinus1; + #endif + } + else + { + y0 = sw_clamp_int(y0, 0, tex->hMinus1); + y1 = sw_clamp_int(y1, 0, tex->hMinus1); } float c00[4], c10[4], c01[4], c11[4]; @@ -5187,11 +5170,25 @@ void swTexParameteri(int param, int value) case SW_TEXTURE_WRAP_S: { if (!sw_is_texture_wrap_valid(value)) { RLSW.errCode = SW_INVALID_ENUM; return; } + #if !SW_SUPPORT_NPOT_TEXTURE + if (value == SW_REPEAT && (RLSW.boundTexture->width & RLSW.boundTexture->wMinus1) != 0) + { + RLSW.errCode = SW_INVALID_OPERATION; + return; + } + #endif RLSW.boundTexture->sWrap = (SWwrap)value; } break; case SW_TEXTURE_WRAP_T: { if (!sw_is_texture_wrap_valid(value)) { RLSW.errCode = SW_INVALID_ENUM; return; } + #if !SW_SUPPORT_NPOT_TEXTURE + if (value == SW_REPEAT && (RLSW.boundTexture->height & RLSW.boundTexture->hMinus1) != 0) + { + RLSW.errCode = SW_INVALID_OPERATION; + return; + } + #endif RLSW.boundTexture->tWrap = (SWwrap)value; } break; default: RLSW.errCode = SW_INVALID_ENUM; break; @@ -5574,8 +5571,7 @@ static void SW_RASTER_TRIANGLE(const sw_vertex_t *v0, const sw_vertex_t *v1, con if (v1->position[1] > v2->position[1]) { const sw_vertex_t *tmp = v1; v1 = v2; v2 = tmp; } if (v0->position[1] > v1->position[1]) { const sw_vertex_t *tmp = v0; v0 = v1; v1 = tmp; } - // Extracting coordinates from the sorted vertices - // Put x away for safe keeping; only y is used right now; silences warnings + // Extracting Y coordinates from the sorted vertices float y0 = v0->position[1]; float y1 = v1->position[1]; float y2 = v2->position[1]; From f1d602029c86bb36e9b0c28adc86d7c1843ff02b Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 1 Jun 2026 11:25:09 -0700 Subject: [PATCH 37/49] Enable GPU skinning for GL 3.3+, (#5902) only do GPU skinning if the shader supports bone IDs. --- src/config.h | 6 +++++- src/rmodels.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/config.h b/src/config.h index 97f5ba544..86239d47d 100644 --- a/src/config.h +++ b/src/config.h @@ -322,7 +322,11 @@ #endif #ifndef SUPPORT_GPU_SKINNING // GPU skinning disabled by default, some GPUs do not support more than 8 VBOs - #define SUPPORT_GPU_SKINNING 0 + #if defined (GRAPHICS_API_OPENGL_33) || defined (GRAPHICS_API_OPENGL_43) + #define SUPPORT_GPU_SKINNING 1 + #else + #define SUPPORT_GPU_SKINNING 0 + #endif #endif //------------------------------------------------------------------------------------ diff --git a/src/rmodels.c b/src/rmodels.c index eeebc3d2b..e10f888f8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2487,9 +2487,12 @@ static void UpdateModelAnimationVertexBuffers(Model model) float boneWeight = 0.0f; bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated +#if defined (SUPPORT_GPU_SKINNING) + Material material = model.materials[model.meshMaterial[m]]; // Skip if missing bone data or missing anim buffers initialization - if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || + if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) && (mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || (mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue; +#endif for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3) { From 90edc3b0a5fe1304118ba5eb51b08284a008bece Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Jun 2026 20:42:38 +0200 Subject: [PATCH 38/49] Update models_animation_blending.c --- examples/models/models_animation_blending.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/models/models_animation_blending.c b/examples/models/models_animation_blending.c index 63eba61cd..e98547c7e 100644 --- a/examples/models/models_animation_blending.c +++ b/examples/models/models_animation_blending.c @@ -58,7 +58,7 @@ int main(void) Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); - // Assign skinning shader to all materials shaders + // NOTE: Assign skinning shader to all materials shaders //for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader; // Load model animations @@ -244,6 +244,12 @@ int main(void) if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170.0f, 10, 160, 24 }, TextJoin(animNames, animCount, ";"), &animIndex1, dropdownEditMode1)) dropdownEditMode1 = !dropdownEditMode1; + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); + GuiSetStyle(DEFAULT, TEXT_SIZE, GuiGetFont().baseSize*2); + GuiLabel((Rectangle){ 0, GetScreenHeight() - 100.0f, GetScreenWidth(), 40 }, "PRESS SPACE to START BLENDING"); + GuiSetStyle(DEFAULT, TEXT_SIZE, GuiGetFont().baseSize); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); + // Draw playing timeline with keyframes for anim0[] GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 0", TextFormat("FRAME: %.2f / %i", animFrameProgress0, anims[animIndex0].keyframeCount), From f421b74c0f447c641722b8a46a68ce8d8a7f5b13 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Jun 2026 20:42:48 +0200 Subject: [PATCH 39/49] Revert "Enable GPU skinning for GL 3.3+, (#5902)" This reverts commit f1d602029c86bb36e9b0c28adc86d7c1843ff02b. --- src/config.h | 6 +----- src/rmodels.c | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/config.h b/src/config.h index 86239d47d..97f5ba544 100644 --- a/src/config.h +++ b/src/config.h @@ -322,11 +322,7 @@ #endif #ifndef SUPPORT_GPU_SKINNING // GPU skinning disabled by default, some GPUs do not support more than 8 VBOs - #if defined (GRAPHICS_API_OPENGL_33) || defined (GRAPHICS_API_OPENGL_43) - #define SUPPORT_GPU_SKINNING 1 - #else - #define SUPPORT_GPU_SKINNING 0 - #endif + #define SUPPORT_GPU_SKINNING 0 #endif //------------------------------------------------------------------------------------ diff --git a/src/rmodels.c b/src/rmodels.c index e10f888f8..eeebc3d2b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2487,12 +2487,9 @@ static void UpdateModelAnimationVertexBuffers(Model model) float boneWeight = 0.0f; bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated -#if defined (SUPPORT_GPU_SKINNING) - Material material = model.materials[model.meshMaterial[m]]; // Skip if missing bone data or missing anim buffers initialization - if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) && (mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || + if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || (mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue; -#endif for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3) { From 895154bcb2c55540cee9e2aa2de95c0e5ba9b729 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Jun 2026 21:00:17 +0200 Subject: [PATCH 40/49] Clarify that GPU_SKINNING is not enabled by default and the requirements --- examples/models/models_animation_blending.c | 14 +++++++++++--- examples/models/models_animation_gpu_skinning.c | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/examples/models/models_animation_blending.c b/examples/models/models_animation_blending.c index e98547c7e..3fc43711e 100644 --- a/examples/models/models_animation_blending.c +++ b/examples/models/models_animation_blending.c @@ -53,13 +53,19 @@ int main(void) Model model = LoadModel("resources/models/gltf/robot.glb"); // Load character model Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model world position +#if SUPPORT_GPU_SKINNING + // WARNING: SUPPORT_GPU_SKINNING is required to be enabled at raylib compile time (disabled by default) + // It will skip loading CPU required buffers to store animation updated data, so, both modes are exclusive + // Load skinning shader - // WARNING: It requires SUPPORT_GPU_SKINNING enabled on raylib (disabled by default) + // NOTE: It must be a valid shader, following raylib attribs/uniform conventions for GPU skinning Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); - // NOTE: Assign skinning shader to all materials shaders - //for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader; + // Skinning shader could be required to be assigned to all materials shaders, just to make + // sure required uniforms are being updated for the mesh using that material (and shader) + for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader; +#endif // Load model animations int animCount = 0; @@ -275,7 +281,9 @@ int main(void) //-------------------------------------------------------------------------------------- UnloadModelAnimations(anims, animCount); // Unload model animation UnloadModel(model); // Unload model and meshes/material +#if SUPPORT_GPU_SKINNING UnloadShader(skinningShader); // Unload GPU skinning shader +#endif CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/models/models_animation_gpu_skinning.c b/examples/models/models_animation_gpu_skinning.c index b50dd86a3..4349ff0c2 100644 --- a/examples/models/models_animation_gpu_skinning.c +++ b/examples/models/models_animation_gpu_skinning.c @@ -52,12 +52,19 @@ int main(void) Model model = LoadModel("resources/models/gltf/greenman.glb"); // Load character model Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position +#if SUPPORT_GPU_SKINNING + // WARNING: SUPPORT_GPU_SKINNING is required to be enabled at raylib compile time (disabled by default) + // It will skip loading CPU required buffers to store animation updated data, so, both modes are exclusive + // Load skinning shader - // WARNING: GPU skinning must be enabled in raylib with a compilation flag, - // if not enabled, CPU skinning will be used instead + // NOTE: It must be a valid shader, following raylib attribs/uniform conventions for GPU skinning Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION), - TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); - model.materials[1].shader = skinningShader; + TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); + + // Skinning shader could be required to be assigned to all materials shaders, just to make + // sure required uniforms are being updated for the mesh using that material (and shader) + model.materials[1].shader = skinningShader; // Just assigning to materials[1] for this model +#endif // Load gltf model animations int animCount = 0; @@ -111,7 +118,9 @@ int main(void) //-------------------------------------------------------------------------------------- UnloadModelAnimations(anims, animCount); // Unload model animation UnloadModel(model); // Unload model and meshes/material +#if SUPPORT_GPU_SKINNING UnloadShader(skinningShader); // Unload GPU skinning shader +#endif CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- From cef7718468dc0c6cdeb1a2d90cbaab5bf0a72220 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 20:16:12 +0200 Subject: [PATCH 41/49] RENAMED: Some Rectangle parameters with more descriptive names --- src/raylib.h | 12 +++---- src/rmodels.c | 30 ++++++++-------- src/rshapes.c | 6 ++-- src/rtext.c | 4 +-- src/rtextures.c | 96 ++++++++++++++++++++++++------------------------- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 286f33c28..866f2473f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1267,7 +1267,7 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI void SetShapesTexture(Texture2D texture, Rectangle rec); // Set texture and rectangle to be used on shapes drawing RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing @@ -1462,9 +1462,9 @@ RLAPI void SetTextureWrap(Texture2D texture, int wrap); RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a texture (or part of it) that stretches or shrinks nicely // Color/pixel related functions RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal @@ -1605,8 +1605,8 @@ RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by rectangle +RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source rectangle with scaling and rotation // Mesh management functions RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids diff --git a/src/rmodels.c b/src/rmodels.c index eeebc3d2b..861680c00 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3983,22 +3983,22 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float // Draw a billboard void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint) { - Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; + Rectangle rec = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - DrawBillboardRec(camera, texture, source, position, (Vector2){ scale*fabsf((float)source.width/source.height), scale }, tint); + DrawBillboardRec(camera, texture, rec, position, (Vector2){ scale*fabsf((float)rec.width/rec.height), scale }, tint); } // Draw a billboard (part of a texture defined by a rectangle) -void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) +void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint) { // NOTE: Billboard locked on axis-Y Vector3 up = { 0.0f, 1.0f, 0.0f }; - DrawBillboardPro(camera, texture, source, position, up, size, Vector2Scale(size, 0.5), 0.0f, tint); + DrawBillboardPro(camera, texture, rec, position, up, size, Vector2Scale(size, 0.5), 0.0f, tint); } -// Draw a billboard with additional parameters -void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) +// Draw a billboard texture defined by source rectangle with scaling and rotation +void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) { // Compute the up vector and the right vector Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); @@ -4009,20 +4009,20 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector // Flip the content of the billboard while maintaining the counterclockwise edge rendering order if (size.x < 0.0f) { - source.x -= size.x; - source.width *= -1.0; + rec.x -= size.x; + rec.width *= -1.0; right = Vector3Negate(right); origin.x *= -1.0f; } if (size.y < 0.0f) { - source.y -= size.y; - source.height *= -1.0; + rec.y -= size.y; + rec.height *= -1.0; up = Vector3Negate(up); origin.y *= -1.0f; } - // Draw the texture region described by source on the following rectangle in 3D space: + // Draw the texture region described by rec on the following rectangle in 3D space: // // size.x <--. // 3 ^---------------------------+ 2 \ rotation @@ -4054,10 +4054,10 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector } Vector2 texcoords[4]; - texcoords[0] = (Vector2){ (float)source.x/texture.width, (float)(source.y + source.height)/texture.height }; - texcoords[1] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height }; - texcoords[2] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)source.y/texture.height }; - texcoords[3] = (Vector2){ (float)source.x/texture.width, (float)source.y/texture.height }; + texcoords[0] = (Vector2){ (float)rec.x/texture.width, (float)(rec.y + rec.height)/texture.height }; + texcoords[1] = (Vector2){ (float)(rec.x + rec.width)/texture.width, (float)(rec.y + rec.height)/texture.height }; + texcoords[2] = (Vector2){ (float)(rec.x + rec.width)/texture.width, (float)rec.y/texture.height }; + texcoords[3] = (Vector2){ (float)rec.x/texture.width, (float)rec.y/texture.height }; rlSetTexture(texture.id); rlBegin(RL_QUADS); diff --git a/src/rshapes.c b/src/rshapes.c index 5ef988e38..38c8a1fbe 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -90,12 +90,12 @@ static float EaseCubicInOut(float t, float b, float c, float d); // Cubic eas // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -void SetShapesTexture(Texture2D texture, Rectangle source) +void SetShapesTexture(Texture2D texture, Rectangle rec) { // Reset texture to default pixel if required // WARNING: Shapes texture should be probably better validated, // it can break the rendering of all shapes if misused - if ((texture.id == 0) || (source.width == 0) || (source.height == 0)) + if ((texture.id == 0) || (rec.width == 0) || (rec.height == 0)) { texShapes = (Texture2D){ 1, 1, 1, 1, 7 }; texShapesRec = (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; @@ -103,7 +103,7 @@ void SetShapesTexture(Texture2D texture, Rectangle source) else { texShapes = texture; - texShapesRec = source; + texShapesRec = rec; } } diff --git a/src/rtext.c b/src/rtext.c index c0434db63..14a3e39c6 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2672,8 +2672,8 @@ static Font LoadBMFont(const char *fileName) for (int i = 1; i < pageCount; i++) { Rectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; - Rectangle destRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; - ImageDraw(&fullFont, imFonts[i], srcRec, destRec, WHITE); + Rectangle dstRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; + ImageDraw(&fullFont, imFonts[i], srcRec, dstRec, WHITE); } } diff --git a/src/rtextures.c b/src/rtextures.c index bedcdb6a4..d2cfb9f78 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4491,25 +4491,25 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) // Draw a texture with extended parameters void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { - Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - Rectangle dest = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; + Rectangle srcrec = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; + Rectangle dstrec = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; Vector2 origin = { 0.0f, 0.0f }; - DrawTexturePro(texture, source, dest, origin, rotation, tint); + DrawTexturePro(texture, srcrec, dstrec, origin, rotation, tint); } // Draw a part of a texture (defined by a rectangle) -void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint) +void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint) { - Rectangle dest = { position.x, position.y, fabsf(source.width), fabsf(source.height) }; + Rectangle dstrec = { position.x, position.y, fabsf(rec.width), fabsf(rec.height) }; Vector2 origin = { 0.0f, 0.0f }; - DrawTexturePro(texture, source, dest, origin, 0.0f, tint); + DrawTexturePro(texture, rec, dstrec, origin, 0.0f, tint); } // Draw a part of a texture (defined by a rectangle) with 'pro' parameters // NOTE: origin is relative to destination rectangle size -void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint) +void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint) { // Check if texture is valid if (texture.id > 0) @@ -4519,11 +4519,11 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 bool flipX = false; - if (source.width < 0) { flipX = true; source.width *= -1; } - if (source.height < 0) source.y -= source.height; + if (srcrec.width < 0) { flipX = true; srcrec.width *= -1; } + if (srcrec.height < 0) srcrec.y -= srcrec.height; - if (dest.width < 0) dest.width *= -1; - if (dest.height < 0) dest.height *= -1; + if (dstrec.width < 0) dstrec.width *= -1; + if (dstrec.height < 0) dstrec.height *= -1; Vector2 topLeft = { 0 }; Vector2 topRight = { 0 }; @@ -4533,33 +4533,33 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 // Only calculate rotation if needed if (rotation == 0.0f) { - float x = dest.x - origin.x; - float y = dest.y - origin.y; + float x = dstrec.x - origin.x; + float y = dstrec.y - origin.y; topLeft = (Vector2){ x, y }; - topRight = (Vector2){ x + dest.width, y }; - bottomLeft = (Vector2){ x, y + dest.height }; - bottomRight = (Vector2){ x + dest.width, y + dest.height }; + topRight = (Vector2){ x + dstrec.width, y }; + bottomLeft = (Vector2){ x, y + dstrec.height }; + bottomRight = (Vector2){ x + dstrec.width, y + dstrec.height }; } else { float sinRotation = sinf(rotation*DEG2RAD); float cosRotation = cosf(rotation*DEG2RAD); - float x = dest.x; - float y = dest.y; + float x = dstrec.x; + float y = dstrec.y; float dx = -origin.x; float dy = -origin.y; topLeft.x = x + dx*cosRotation - dy*sinRotation; topLeft.y = y + dx*sinRotation + dy*cosRotation; - topRight.x = x + (dx + dest.width)*cosRotation - dy*sinRotation; - topRight.y = y + (dx + dest.width)*sinRotation + dy*cosRotation; + topRight.x = x + (dx + dstrec.width)*cosRotation - dy*sinRotation; + topRight.y = y + (dx + dstrec.width)*sinRotation + dy*cosRotation; - bottomLeft.x = x + dx*cosRotation - (dy + dest.height)*sinRotation; - bottomLeft.y = y + dx*sinRotation + (dy + dest.height)*cosRotation; + bottomLeft.x = x + dx*cosRotation - (dy + dstrec.height)*sinRotation; + bottomLeft.y = y + dx*sinRotation + (dy + dstrec.height)*cosRotation; - bottomRight.x = x + (dx + dest.width)*cosRotation - (dy + dest.height)*sinRotation; - bottomRight.y = y + (dx + dest.width)*sinRotation + (dy + dest.height)*cosRotation; + bottomRight.x = x + (dx + dstrec.width)*cosRotation - (dy + dstrec.height)*sinRotation; + bottomRight.y = y + (dx + dstrec.width)*sinRotation + (dy + dstrec.height)*cosRotation; } rlSetTexture(texture.id); @@ -4569,23 +4569,23 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer // Top-left corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height); - else rlTexCoord2f(source.x/width, source.y/height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); + else rlTexCoord2f(srcrec.x/width, srcrec.y/height); rlVertex2f(topLeft.x, topLeft.y); // Bottom-left corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); - else rlTexCoord2f(source.x/width, (source.y + source.height)/height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); rlVertex2f(bottomLeft.x, bottomLeft.y); // Bottom-right corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height); - else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); + if (flipX) rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); rlVertex2f(bottomRight.x, bottomRight.y); // Top-right corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, source.y/height); - else rlTexCoord2f((source.x + source.width)/width, source.y/height); + if (flipX) rlTexCoord2f(srcrec.x/width, srcrec.y/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); rlVertex2f(topRight.x, topRight.y); rlEnd(); @@ -4599,7 +4599,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 /* rlSetTexture(texture.id); rlPushMatrix(); - rlTranslatef(dest.x, dest.y, 0.0f); + rlTranslatef(dstrec.x, dstrec.y, 0.0f); if (rotation != 0.0f) rlRotatef(rotation, 0.0f, 0.0f, 1.0f); rlTranslatef(-origin.x, -origin.y, 0.0f); @@ -4608,24 +4608,24 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer // Bottom-left corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height); - else rlTexCoord2f(source.x/width, source.y/height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); + else rlTexCoord2f(srcrec.x/width, srcrec.y/height); rlVertex2f(0.0f, 0.0f); // Bottom-right corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); - else rlTexCoord2f(source.x/width, (source.y + source.height)/height); - rlVertex2f(0.0f, dest.height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); + rlVertex2f(0.0f, dstrec.height); // Top-right corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height); - else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); - rlVertex2f(dest.width, dest.height); + if (flipX) rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); + rlVertex2f(dstrec.width, dstrec.height); // Top-left corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, source.y/height); - else rlTexCoord2f((source.x + source.width)/width, source.y/height); - rlVertex2f(dest.width, 0.0f); + if (flipX) rlTexCoord2f(srcrec.x/width, srcrec.y/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); + rlVertex2f(dstrec.width, 0.0f); rlEnd(); rlPopMatrix(); rlSetTexture(0); @@ -4634,15 +4634,15 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 } // Draw a texture (or part of it) that stretches or shrinks nicely using n-patch info -void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) +void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint) { if (texture.id > 0) { float width = (float)texture.width; float height = (float)texture.height; - float patchWidth = ((int)dest.width <= 0)? 0.0f : dest.width; - float patchHeight = ((int)dest.height <= 0)? 0.0f : dest.height; + float patchWidth = ((int)dstrec.width <= 0)? 0.0f : dstrec.width; + float patchHeight = ((int)dstrec.height <= 0)? 0.0f : dstrec.height; if (nPatchInfo.source.width < 0) nPatchInfo.source.x -= nPatchInfo.source.width; if (nPatchInfo.source.height < 0) nPatchInfo.source.y -= nPatchInfo.source.height; @@ -4701,7 +4701,7 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, rlSetTexture(texture.id); rlPushMatrix(); - rlTranslatef(dest.x, dest.y, 0.0f); + rlTranslatef(dstrec.x, dstrec.y, 0.0f); rlRotatef(rotation, 0.0f, 0.0f, 1.0f); rlTranslatef(-origin.x, -origin.y, 0.0f); From e8650c1b8e49783bcbd407603f68bc15d86b6796 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:16:31 +0000 Subject: [PATCH 42/49] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 20 ++++++++++---------- tools/rlparser/output/raylib_api.lua | 20 ++++++++++---------- tools/rlparser/output/raylib_api.txt | 20 ++++++++++---------- tools/rlparser/output/raylib_api.xml | 20 ++++++++++---------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index b42fd2d61..915d5c665 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -5489,7 +5489,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" } ] }, @@ -8913,7 +8913,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" }, { "type": "Vector2", @@ -8927,7 +8927,7 @@ }, { "name": "DrawTexturePro", - "description": "Draw a part of a texture defined by a rectangle with 'pro' parameters", + "description": "Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation", "returnType": "void", "params": [ { @@ -8936,11 +8936,11 @@ }, { "type": "Rectangle", - "name": "source" + "name": "srcrec" }, { "type": "Rectangle", - "name": "dest" + "name": "dstrec" }, { "type": "Vector2", @@ -8971,7 +8971,7 @@ }, { "type": "Rectangle", - "name": "dest" + "name": "dstrec" }, { "type": "Vector2", @@ -10983,7 +10983,7 @@ }, { "name": "DrawBillboardRec", - "description": "Draw a billboard texture defined by source", + "description": "Draw a billboard texture defined by rectangle", "returnType": "void", "params": [ { @@ -10996,7 +10996,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" }, { "type": "Vector3", @@ -11014,7 +11014,7 @@ }, { "name": "DrawBillboardPro", - "description": "Draw a billboard texture defined by source and rotation", + "description": "Draw a billboard texture defined by source rectangle with scaling and rotation", "returnType": "void", "params": [ { @@ -11027,7 +11027,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" }, { "type": "Vector3", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 859ef38ba..d784cb768 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4752,7 +4752,7 @@ return { returnType = "void", params = { {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"} + {type = "Rectangle", name = "rec"} } }, { @@ -6475,19 +6475,19 @@ return { returnType = "void", params = { {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, + {type = "Rectangle", name = "rec"}, {type = "Vector2", name = "position"}, {type = "Color", name = "tint"} } }, { name = "DrawTexturePro", - description = "Draw a part of a texture defined by a rectangle with 'pro' parameters", + description = "Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation", returnType = "void", params = { {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, - {type = "Rectangle", name = "dest"}, + {type = "Rectangle", name = "srcrec"}, + {type = "Rectangle", name = "dstrec"}, {type = "Vector2", name = "origin"}, {type = "float", name = "rotation"}, {type = "Color", name = "tint"} @@ -6500,7 +6500,7 @@ return { params = { {type = "Texture2D", name = "texture"}, {type = "NPatchInfo", name = "nPatchInfo"}, - {type = "Rectangle", name = "dest"}, + {type = "Rectangle", name = "dstrec"}, {type = "Vector2", name = "origin"}, {type = "float", name = "rotation"}, {type = "Color", name = "tint"} @@ -7572,12 +7572,12 @@ return { }, { name = "DrawBillboardRec", - description = "Draw a billboard texture defined by source", + description = "Draw a billboard texture defined by rectangle", returnType = "void", params = { {type = "Camera", name = "camera"}, {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, + {type = "Rectangle", name = "rec"}, {type = "Vector3", name = "position"}, {type = "Vector2", name = "size"}, {type = "Color", name = "tint"} @@ -7585,12 +7585,12 @@ return { }, { name = "DrawBillboardPro", - description = "Draw a billboard texture defined by source and rotation", + description = "Draw a billboard texture defined by source rectangle with scaling and rotation", returnType = "void", params = { {type = "Camera", name = "camera"}, {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, + {type = "Rectangle", name = "rec"}, {type = "Vector3", name = "position"}, {type = "Vector3", name = "up"}, {type = "Vector2", name = "size"}, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 0051c6a14..11f23d80a 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -2182,7 +2182,7 @@ Function 219: SetShapesTexture() (2 input parameters) Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) - Param[2]: source (type: Rectangle) + Param[2]: rec (type: Rectangle) Function 220: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D @@ -3416,16 +3416,16 @@ Function 385: DrawTextureRec() (4 input parameters) Return type: void Description: Draw a part of a texture defined by a rectangle Param[1]: texture (type: Texture2D) - Param[2]: source (type: Rectangle) + Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) Function 386: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void - Description: Draw a part of a texture defined by a rectangle with 'pro' parameters + Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation Param[1]: texture (type: Texture2D) - Param[2]: source (type: Rectangle) - Param[3]: dest (type: Rectangle) + Param[2]: srcrec (type: Rectangle) + Param[3]: dstrec (type: Rectangle) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) @@ -3435,7 +3435,7 @@ Function 387: DrawTextureNPatch() (6 input parameters) Description: Draw a texture (or part of it) that stretches or shrinks nicely Param[1]: texture (type: Texture2D) Param[2]: nPatchInfo (type: NPatchInfo) - Param[3]: dest (type: Rectangle) + Param[3]: dstrec (type: Rectangle) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) @@ -4185,20 +4185,20 @@ Function 495: DrawBillboard() (5 input parameters) Function 496: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void - Description: Draw a billboard texture defined by source + Description: Draw a billboard texture defined by rectangle Param[1]: camera (type: Camera) Param[2]: texture (type: Texture2D) - Param[3]: source (type: Rectangle) + Param[3]: rec (type: Rectangle) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) Function 497: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void - Description: Draw a billboard texture defined by source and rotation + Description: Draw a billboard texture defined by source rectangle with scaling and rotation Param[1]: camera (type: Camera) Param[2]: texture (type: Texture2D) - Param[3]: source (type: Rectangle) + Param[3]: rec (type: Rectangle) Param[4]: position (type: Vector3) Param[5]: up (type: Vector3) Param[6]: size (type: Vector2) diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index fdc1481ec..11ba9fccb 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1352,7 +1352,7 @@ - + @@ -2251,14 +2251,14 @@ - + - + - - + + @@ -2266,7 +2266,7 @@ - + @@ -2797,18 +2797,18 @@ - + - + - + - + From ee71f0f870a1c19d1bb7e476e1d819acac99ab5b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:00:34 +0200 Subject: [PATCH 43/49] REVIEWED: `GetPixelColor()` const --- src/raylib.h | 2 +- src/rtextures.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 866f2473f..8e4d830c8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1481,7 +1481,7 @@ RLAPI Color ColorAlpha(Color color, float alpha); // G RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint RLAPI Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f] RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value -RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format +RLAPI Color GetPixelColor(const void *srcPtr, int format); // Get Color from a source pixel pointer of certain format RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format diff --git a/src/rtextures.c b/src/rtextures.c index d2cfb9f78..1ab5cb3d9 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -5180,7 +5180,7 @@ Color GetColor(unsigned int hexValue) } // Get color from a pixel from certain format -Color GetPixelColor(void *srcPtr, int format) +Color GetPixelColor(const void *srcPtr, int format) { Color color = { 0 }; From 2c690425c9801e70d0d7bdba4ebff732d6a949eb Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:02:59 +0200 Subject: [PATCH 44/49] Reviewed comments, remove article usage --- src/platforms/rcore_memory.c | 4 +-- src/raudio.c | 6 ++-- src/raylib.h | 54 ++++++++++++++++++------------------ src/rcore.c | 36 ++++++++++++------------ src/rgestures.h | 4 +-- src/rmodels.c | 4 +-- src/rtext.c | 4 +-- src/rtextures.c | 6 ++-- 8 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/platforms/rcore_memory.c b/src/platforms/rcore_memory.c index 155073ad1..e7934bd96 100644 --- a/src/platforms/rcore_memory.c +++ b/src/platforms/rcore_memory.c @@ -91,7 +91,7 @@ bool InitGraphicsDevice(void); // Initialize graphics device // Module Internal Functions Declaration //---------------------------------------------------------------------------------- #if !defined(_WIN32) -static int kbhit(void); // Check if a key has been pressed +static int kbhit(void); // Check if key has been pressed static char getch(void) { return getchar(); } // Get pressed character #endif @@ -562,7 +562,7 @@ void ClosePlatform(void) // Module Internal Functions Definition //---------------------------------------------------------------------------------- #if !defined(_WIN32) -// Check if a key has been pressed +// Check if key has been pressed static int kbhit(void) { struct termios oldt = { 0 }; diff --git a/src/raudio.c b/src/raudio.c index ff90d8e43..3ae2fba0f 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1013,7 +1013,7 @@ Sound LoadSoundAlias(Sound source) return sound; } -// Check if a sound is valid (data loaded and buffers initialized) +// Check if sound is valid (data loaded and buffers initialized) bool IsSoundValid(Sound sound) { bool result = false; @@ -1215,7 +1215,7 @@ void StopSound(Sound sound) StopAudioBuffer(sound.stream.buffer); } -// Check if a sound is playing +// Check if sound is playing bool IsSoundPlaying(Sound sound) { bool result = false; @@ -1751,7 +1751,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, return music; } -// Check if a music stream is valid (context and buffers initialized) +// Check if music stream is valid (context and buffers initialized) bool IsMusicValid(Music music) { return ((music.ctxData != NULL) && // Validate context loaded diff --git a/src/raylib.h b/src/raylib.h index 8e4d830c8..cb02d533b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1070,7 +1070,7 @@ RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR s // NOTE: Shader functionality is not available on OpenGL 1.1 RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU) +RLAPI bool IsShaderValid(Shader shader); // Check if shader is valid (loaded on GPU) RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value @@ -1148,7 +1148,7 @@ RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file RLAPI bool FileExists(const char *fileName); // Check if file exists -RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists +RLAPI bool DirectoryExists(const char *dirPath); // Check if directory path exists RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (recommended include point: .png, .wav) RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) @@ -1161,12 +1161,12 @@ RLAPI const char *GetWorkingDirectory(void); // Get curre RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success RLAPI bool ChangeDirectory(const char *dirPath); // Change working directory, return true on success -RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory +RLAPI bool IsPathFile(const char *path); // Check if given path is a file or a directory RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths, files and directories, no subdirs scan RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths -RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window +RLAPI bool IsFileDropped(void); // Check if file has been dropped into window RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths RLAPI unsigned int GetDirectoryFileCount(const char *dirPath); // Get the file count in a directory @@ -1197,23 +1197,23 @@ RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a reco //------------------------------------------------------------------------------------ // Input-related functions: keyboard -RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again -RLAPI bool IsKeyDown(int key); // Check if a key is being pressed -RLAPI bool IsKeyReleased(int key); // Check if a key has been released once -RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed +RLAPI bool IsKeyPressed(int key); // Check if key has been pressed once +RLAPI bool IsKeyPressedRepeat(int key); // Check if key has been pressed again +RLAPI bool IsKeyDown(int key); // Check if key is being pressed +RLAPI bool IsKeyReleased(int key); // Check if key has been released once +RLAPI bool IsKeyUp(int key); // Check if key is NOT being pressed RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI bool IsGamepadAvailable(int gamepad); // Check if gamepad is available RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if gamepad button is NOT being pressed RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed RLAPI int GetGamepadAxisCount(int gamepad); // Get axis count for a gamepad RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get movement value for a gamepad axis @@ -1221,10 +1221,10 @@ RLAPI int SetGamepadMappings(const char *mappings); // Set internal ga RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse -RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once -RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed -RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once -RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed +RLAPI bool IsMouseButtonPressed(int button); // Check if mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Check if mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Check if mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Check if mouse button is NOT being pressed RLAPI int GetMouseX(void); // Get mouse position X RLAPI int GetMouseY(void); // Get mouse position Y RLAPI Vector2 GetMousePosition(void); // Get mouse position XY @@ -1247,7 +1247,7 @@ RLAPI int GetTouchPointCount(void); // Get number of t // Gestures and Touch Handling Functions (Module: rgestures) //------------------------------------------------------------------------------------ RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture has been detected +RLAPI bool IsGestureDetected(unsigned int gesture); // Check if gesture has been detected RLAPI int GetGestureDetected(void); // Get latest detected gesture RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector @@ -1446,9 +1446,9 @@ RLAPI Texture2D LoadTexture(const char *fileName); RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -RLAPI bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU) +RLAPI bool IsTextureValid(Texture2D texture); // Check if texture is valid (loaded in GPU) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) +RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if render texture is valid (loaded in GPU) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data (pixels should be able to fill texture) RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data (pixels and rec should fit in texture) @@ -1495,7 +1495,7 @@ RLAPI Font LoadFont(const char *fileName); RLAPI Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) +RLAPI bool IsFontValid(Font font); // Check if font is valid (font data loaded, WARNING: GPU texture not checked) RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount, int type, int *glyphCount); // Load font data for further use RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) @@ -1594,7 +1594,7 @@ RLAPI void DrawGrid(int slices, float spacing); // Model management functions RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs) +RLAPI bool IsModelValid(Model model); // Check if model is valid (loaded in GPU, VAO/VBOs) RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) @@ -1635,7 +1635,7 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Material loading/unloading functions RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU) +RLAPI bool IsMaterialValid(Material material); // Check if material is valid (shader assigned, map textures loaded in GPU) RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh @@ -1676,7 +1676,7 @@ RLAPI bool IsWaveValid(Wave wave); // Check i RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data RLAPI Sound LoadSoundAlias(Sound source); // Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data -RLAPI bool IsSoundValid(Sound sound); // Check if a sound is valid (data loaded and buffers initialized) +RLAPI bool IsSoundValid(Sound sound); // Check if sound is valid (data loaded and buffers initialized) RLAPI void UpdateSound(Sound sound, const void *data, int frameCount); // Update sound buffer with new data (default data format: 32 bit float, stereo) RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound @@ -1689,7 +1689,7 @@ RLAPI void PlaySound(Sound sound); // Play a RLAPI void StopSound(Sound sound); // Stop playing a sound RLAPI void PauseSound(Sound sound); // Pause a sound RLAPI void ResumeSound(Sound sound); // Resume a paused sound -RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +RLAPI bool IsSoundPlaying(Sound sound); // Check if sound is currently playing RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) @@ -1702,7 +1702,7 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data -RLAPI bool IsMusicValid(Music music); // Check if a music stream is valid (context and buffers initialized) +RLAPI bool IsMusicValid(Music music); // Check if music stream is valid (context and buffers initialized) RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing diff --git a/src/rcore.c b/src/rcore.c index 9f93ecbbc..d31ae25b8 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1293,7 +1293,7 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode) return shader; } -// Check if a shader is valid (loaded on GPU) +// Check if shader is valid (loaded on GPU) bool IsShaderValid(Shader shader) { return ((shader.id > 0) && // Validate shader id (GPU loaded successfully) @@ -2396,7 +2396,7 @@ bool IsFileExtension(const char *fileName, const char *ext) return result; } -// Check if a directory path exists +// Check if directory path exists bool DirectoryExists(const char *dirPath) { bool result = false; @@ -2811,7 +2811,7 @@ bool ChangeDirectory(const char *dirPath) return (result == 0); } -// Check if a given path point to a file +// Check if given path point to a file bool IsPathFile(const char *path) { struct stat result = { 0 }; @@ -2876,7 +2876,7 @@ bool IsFileNameValid(const char *fileName) return valid; } -// Check if a file has been dropped into window +// Check if file has been dropped into window bool IsFileDropped(void) { bool result = false; @@ -3787,7 +3787,7 @@ void PlayAutomationEvent(AutomationEvent event) // Module Functions Definition: Input Handling: Keyboard //---------------------------------------------------------------------------------- -// Check if a key has been pressed once +// Check if key has been pressed once bool IsKeyPressed(int key) { bool pressed = false; @@ -3800,7 +3800,7 @@ bool IsKeyPressed(int key) return pressed; } -// Check if a key has been pressed again +// Check if key has been pressed again bool IsKeyPressedRepeat(int key) { bool repeat = false; @@ -3813,7 +3813,7 @@ bool IsKeyPressedRepeat(int key) return repeat; } -// Check if a key is being pressed (key held down) +// Check if key is being pressed (key held down) bool IsKeyDown(int key) { bool down = false; @@ -3826,7 +3826,7 @@ bool IsKeyDown(int key) return down; } -// Check if a key has been released once +// Check if key has been released once bool IsKeyReleased(int key) { bool released = false; @@ -3839,7 +3839,7 @@ bool IsKeyReleased(int key) return released; } -// Check if a key is NOT being pressed (key not held down) +// Check if key is NOT being pressed (key not held down) bool IsKeyUp(int key) { bool up = false; @@ -3910,7 +3910,7 @@ void SetExitKey(int key) // NOTE: Functions with a platform-specific implementation on rcore_.c //int SetGamepadMappings(const char *mappings) -// Check if a gamepad is available +// Check if gamepad is available bool IsGamepadAvailable(int gamepad) { bool result = false; @@ -3926,7 +3926,7 @@ const char *GetGamepadName(int gamepad) return CORE.Input.Gamepad.name[gamepad]; } -// Check if a gamepad button has been pressed once +// Check if gamepad button has been pressed once bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; @@ -3939,7 +3939,7 @@ bool IsGamepadButtonPressed(int gamepad, int button) return pressed; } -// Check if a gamepad button is being pressed +// Check if gamepad button is being pressed bool IsGamepadButtonDown(int gamepad, int button) { bool down = false; @@ -3952,7 +3952,7 @@ bool IsGamepadButtonDown(int gamepad, int button) return down; } -// Check if a gamepad button has NOT been pressed once +// Check if gamepad button has NOT been pressed once bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; @@ -3965,7 +3965,7 @@ bool IsGamepadButtonReleased(int gamepad, int button) return released; } -// Check if a gamepad button is NOT being pressed +// Check if gamepad button is NOT being pressed bool IsGamepadButtonUp(int gamepad, int button) { bool up = false; @@ -4014,7 +4014,7 @@ float GetGamepadAxisMovement(int gamepad, int axis) //void SetMousePosition(int x, int y) //void SetMouseCursor(int cursor) -// Check if a mouse button has been pressed once +// Check if mouse button has been pressed once bool IsMouseButtonPressed(int button) { bool pressed = false; @@ -4030,7 +4030,7 @@ bool IsMouseButtonPressed(int button) return pressed; } -// Check if a mouse button is being pressed +// Check if mouse button is being pressed bool IsMouseButtonDown(int button) { bool down = false; @@ -4046,7 +4046,7 @@ bool IsMouseButtonDown(int button) return down; } -// Check if a mouse button has been released once +// Check if mouse button has been released once bool IsMouseButtonReleased(int button) { bool released = false; @@ -4062,7 +4062,7 @@ bool IsMouseButtonReleased(int button) return released; } -// Check if a mouse button is NOT being pressed +// Check if mouse button is NOT being pressed bool IsMouseButtonUp(int button) { bool up = false; diff --git a/src/rgestures.h b/src/rgestures.h index 248e1f71a..eeeb6b010 100644 --- a/src/rgestures.h +++ b/src/rgestures.h @@ -127,7 +127,7 @@ void UpdateGestures(void); // Update gestures detec #if defined(RGESTURES_STANDALONE) void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -bool IsGestureDetected(int gesture); // Check if a gesture has been detected +bool IsGestureDetected(int gesture); // Check if gesture has been detected int GetGestureDetected(void); // Get latest detected gesture float GetGestureHoldDuration(void); // Get gesture hold time in seconds @@ -257,7 +257,7 @@ void SetGesturesEnabled(unsigned int flags) GESTURES.enabledFlags = flags; } -// Check if a gesture have been detected +// Check if gesture have been detected bool IsGestureDetected(unsigned int gesture) { if ((GESTURES.enabledFlags & GESTURES.current) == gesture) return true; diff --git a/src/rmodels.c b/src/rmodels.c index 861680c00..32ade139f 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1167,7 +1167,7 @@ Model LoadModelFromMesh(Mesh mesh) return model; } -// Check if a model is valid (loaded in GPU, VAO/VBOs) +// Check if model is valid (loaded in GPU, VAO/VBOs) bool IsModelValid(Model model) { bool result = false; @@ -2228,7 +2228,7 @@ Material LoadMaterialDefault(void) return material; } -// Check if a material is valid (map textures loaded in GPU) +// Check if material is valid (map textures loaded in GPU) bool IsMaterialValid(Material material) { bool result = false; diff --git a/src/rtext.c b/src/rtext.c index 14a3e39c6..f1de75421 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -593,7 +593,7 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int return font; } -// Check if a font is valid (font data loaded) +// Check if font is valid (font data loaded) // WARNING: GPU texture not checked bool IsFontValid(Font font) { @@ -683,7 +683,7 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz // stbtt_GetCodepointBitmapBox() -- how big the bitmap must be // stbtt_MakeCodepointBitmap() -- renders into a provided bitmap - // Check if a glyph is available in the font + // Check if glyph is available in the font // WARNING: if (index == 0), glyph not found, it could fallback to default .notdef glyph (if defined in font) int index = stbtt_FindGlyphIndex(&fontInfo, cp); diff --git a/src/rtextures.c b/src/rtextures.c index 1ab5cb3d9..9a359f0f2 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -1744,7 +1744,7 @@ void ImageResize(Image *image, int newWidth, int newHeight) // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; - // Check if a fast path can be used on image scaling + // Check if fast path can be used on image scaling // It can be for 8 bit per channel images with 1 to 4 channels per pixel if ((image->format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) || (image->format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) || @@ -4295,7 +4295,7 @@ RenderTexture2D LoadRenderTexture(int width, int height) return target; } -// Check if a texture is valid (loaded in GPU) +// Check if texture is valid (loaded in GPU) bool IsTextureValid(Texture2D texture) { bool result = false; @@ -4320,7 +4320,7 @@ void UnloadTexture(Texture2D texture) } } -// Check if a render texture is valid (loaded in GPU) +// Check if render texture is valid (loaded in GPU) bool IsRenderTextureValid(RenderTexture2D target) { bool result = false; From fc824ff6d44696a36912e0820746c6977cd969be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:03:21 +0000 Subject: [PATCH 45/49] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 56 +++++++++++++-------------- tools/rlparser/output/raylib_api.lua | 56 +++++++++++++-------------- tools/rlparser/output/raylib_api.txt | 56 +++++++++++++-------------- tools/rlparser/output/raylib_api.xml | 56 +++++++++++++-------------- 4 files changed, 112 insertions(+), 112 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 915d5c665..1c882cd88 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -3800,7 +3800,7 @@ }, { "name": "IsShaderValid", - "description": "Check if a shader is valid (loaded on GPU)", + "description": "Check if shader is valid (loaded on GPU)", "returnType": "bool", "params": [ { @@ -4528,7 +4528,7 @@ }, { "name": "DirectoryExists", - "description": "Check if a directory path exists", + "description": "Check if directory path exists", "returnType": "bool", "params": [ { @@ -4663,7 +4663,7 @@ }, { "name": "IsPathFile", - "description": "Check if a given path is a file or a directory", + "description": "Check if given path is a file or a directory", "returnType": "bool", "params": [ { @@ -4726,7 +4726,7 @@ }, { "name": "IsFileDropped", - "description": "Check if a file has been dropped into window", + "description": "Check if file has been dropped into window", "returnType": "bool" }, { @@ -4989,7 +4989,7 @@ }, { "name": "IsKeyPressed", - "description": "Check if a key has been pressed once", + "description": "Check if key has been pressed once", "returnType": "bool", "params": [ { @@ -5000,7 +5000,7 @@ }, { "name": "IsKeyPressedRepeat", - "description": "Check if a key has been pressed again", + "description": "Check if key has been pressed again", "returnType": "bool", "params": [ { @@ -5011,7 +5011,7 @@ }, { "name": "IsKeyDown", - "description": "Check if a key is being pressed", + "description": "Check if key is being pressed", "returnType": "bool", "params": [ { @@ -5022,7 +5022,7 @@ }, { "name": "IsKeyReleased", - "description": "Check if a key has been released once", + "description": "Check if key has been released once", "returnType": "bool", "params": [ { @@ -5033,7 +5033,7 @@ }, { "name": "IsKeyUp", - "description": "Check if a key is NOT being pressed", + "description": "Check if key is NOT being pressed", "returnType": "bool", "params": [ { @@ -5076,7 +5076,7 @@ }, { "name": "IsGamepadAvailable", - "description": "Check if a gamepad is available", + "description": "Check if gamepad is available", "returnType": "bool", "params": [ { @@ -5098,7 +5098,7 @@ }, { "name": "IsGamepadButtonPressed", - "description": "Check if a gamepad button has been pressed once", + "description": "Check if gamepad button has been pressed once", "returnType": "bool", "params": [ { @@ -5113,7 +5113,7 @@ }, { "name": "IsGamepadButtonDown", - "description": "Check if a gamepad button is being pressed", + "description": "Check if gamepad button is being pressed", "returnType": "bool", "params": [ { @@ -5128,7 +5128,7 @@ }, { "name": "IsGamepadButtonReleased", - "description": "Check if a gamepad button has been released once", + "description": "Check if gamepad button has been released once", "returnType": "bool", "params": [ { @@ -5143,7 +5143,7 @@ }, { "name": "IsGamepadButtonUp", - "description": "Check if a gamepad button is NOT being pressed", + "description": "Check if gamepad button is NOT being pressed", "returnType": "bool", "params": [ { @@ -5223,7 +5223,7 @@ }, { "name": "IsMouseButtonPressed", - "description": "Check if a mouse button has been pressed once", + "description": "Check if mouse button has been pressed once", "returnType": "bool", "params": [ { @@ -5234,7 +5234,7 @@ }, { "name": "IsMouseButtonDown", - "description": "Check if a mouse button is being pressed", + "description": "Check if mouse button is being pressed", "returnType": "bool", "params": [ { @@ -5245,7 +5245,7 @@ }, { "name": "IsMouseButtonReleased", - "description": "Check if a mouse button has been released once", + "description": "Check if mouse button has been released once", "returnType": "bool", "params": [ { @@ -5256,7 +5256,7 @@ }, { "name": "IsMouseButtonUp", - "description": "Check if a mouse button is NOT being pressed", + "description": "Check if mouse button is NOT being pressed", "returnType": "bool", "params": [ { @@ -5401,7 +5401,7 @@ }, { "name": "IsGestureDetected", - "description": "Check if a gesture has been detected", + "description": "Check if gesture has been detected", "returnType": "bool", "params": [ { @@ -8716,7 +8716,7 @@ }, { "name": "IsTextureValid", - "description": "Check if a texture is valid (loaded in GPU)", + "description": "Check if texture is valid (loaded in GPU)", "returnType": "bool", "params": [ { @@ -8738,7 +8738,7 @@ }, { "name": "IsRenderTextureValid", - "description": "Check if a render texture is valid (loaded in GPU)", + "description": "Check if render texture is valid (loaded in GPU)", "returnType": "bool", "params": [ { @@ -9195,7 +9195,7 @@ "returnType": "Color", "params": [ { - "type": "void *", + "type": "const void *", "name": "srcPtr" }, { @@ -9333,7 +9333,7 @@ }, { "name": "IsFontValid", - "description": "Check if a font is valid (font data loaded, WARNING: GPU texture not checked)", + "description": "Check if font is valid (font data loaded, WARNING: GPU texture not checked)", "returnType": "bool", "params": [ { @@ -10800,7 +10800,7 @@ }, { "name": "IsModelValid", - "description": "Check if a model is valid (loaded in GPU, VAO/VBOs)", + "description": "Check if model is valid (loaded in GPU, VAO/VBOs)", "returnType": "bool", "params": [ { @@ -11433,7 +11433,7 @@ }, { "name": "IsMaterialValid", - "description": "Check if a material is valid (shader assigned, map textures loaded in GPU)", + "description": "Check if material is valid (shader assigned, map textures loaded in GPU)", "returnType": "bool", "params": [ { @@ -11853,7 +11853,7 @@ }, { "name": "IsSoundValid", - "description": "Check if a sound is valid (data loaded and buffers initialized)", + "description": "Check if sound is valid (data loaded and buffers initialized)", "returnType": "bool", "params": [ { @@ -11990,7 +11990,7 @@ }, { "name": "IsSoundPlaying", - "description": "Check if a sound is currently playing", + "description": "Check if sound is currently playing", "returnType": "bool", "params": [ { @@ -12151,7 +12151,7 @@ }, { "name": "IsMusicValid", - "description": "Check if a music stream is valid (context and buffers initialized)", + "description": "Check if music stream is valid (context and buffers initialized)", "returnType": "bool", "params": [ { diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index d784cb768..d5024fd45 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -3626,7 +3626,7 @@ return { }, { name = "IsShaderValid", - description = "Check if a shader is valid (loaded on GPU)", + description = "Check if shader is valid (loaded on GPU)", returnType = "bool", params = { {type = "Shader", name = "shader"} @@ -4084,7 +4084,7 @@ return { }, { name = "DirectoryExists", - description = "Check if a directory path exists", + description = "Check if directory path exists", returnType = "bool", params = { {type = "const char *", name = "dirPath"} @@ -4183,7 +4183,7 @@ return { }, { name = "IsPathFile", - description = "Check if a given path is a file or a directory", + description = "Check if given path is a file or a directory", returnType = "bool", params = { {type = "const char *", name = "path"} @@ -4225,7 +4225,7 @@ return { }, { name = "IsFileDropped", - description = "Check if a file has been dropped into window", + description = "Check if file has been dropped into window", returnType = "bool" }, { @@ -4395,7 +4395,7 @@ return { }, { name = "IsKeyPressed", - description = "Check if a key has been pressed once", + description = "Check if key has been pressed once", returnType = "bool", params = { {type = "int", name = "key"} @@ -4403,7 +4403,7 @@ return { }, { name = "IsKeyPressedRepeat", - description = "Check if a key has been pressed again", + description = "Check if key has been pressed again", returnType = "bool", params = { {type = "int", name = "key"} @@ -4411,7 +4411,7 @@ return { }, { name = "IsKeyDown", - description = "Check if a key is being pressed", + description = "Check if key is being pressed", returnType = "bool", params = { {type = "int", name = "key"} @@ -4419,7 +4419,7 @@ return { }, { name = "IsKeyReleased", - description = "Check if a key has been released once", + description = "Check if key has been released once", returnType = "bool", params = { {type = "int", name = "key"} @@ -4427,7 +4427,7 @@ return { }, { name = "IsKeyUp", - description = "Check if a key is NOT being pressed", + description = "Check if key is NOT being pressed", returnType = "bool", params = { {type = "int", name = "key"} @@ -4461,7 +4461,7 @@ return { }, { name = "IsGamepadAvailable", - description = "Check if a gamepad is available", + description = "Check if gamepad is available", returnType = "bool", params = { {type = "int", name = "gamepad"} @@ -4477,7 +4477,7 @@ return { }, { name = "IsGamepadButtonPressed", - description = "Check if a gamepad button has been pressed once", + description = "Check if gamepad button has been pressed once", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4486,7 +4486,7 @@ return { }, { name = "IsGamepadButtonDown", - description = "Check if a gamepad button is being pressed", + description = "Check if gamepad button is being pressed", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4495,7 +4495,7 @@ return { }, { name = "IsGamepadButtonReleased", - description = "Check if a gamepad button has been released once", + description = "Check if gamepad button has been released once", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4504,7 +4504,7 @@ return { }, { name = "IsGamepadButtonUp", - description = "Check if a gamepad button is NOT being pressed", + description = "Check if gamepad button is NOT being pressed", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4554,7 +4554,7 @@ return { }, { name = "IsMouseButtonPressed", - description = "Check if a mouse button has been pressed once", + description = "Check if mouse button has been pressed once", returnType = "bool", params = { {type = "int", name = "button"} @@ -4562,7 +4562,7 @@ return { }, { name = "IsMouseButtonDown", - description = "Check if a mouse button is being pressed", + description = "Check if mouse button is being pressed", returnType = "bool", params = { {type = "int", name = "button"} @@ -4570,7 +4570,7 @@ return { }, { name = "IsMouseButtonReleased", - description = "Check if a mouse button has been released once", + description = "Check if mouse button has been released once", returnType = "bool", params = { {type = "int", name = "button"} @@ -4578,7 +4578,7 @@ return { }, { name = "IsMouseButtonUp", - description = "Check if a mouse button is NOT being pressed", + description = "Check if mouse button is NOT being pressed", returnType = "bool", params = { {type = "int", name = "button"} @@ -4690,7 +4690,7 @@ return { }, { name = "IsGestureDetected", - description = "Check if a gesture has been detected", + description = "Check if gesture has been detected", returnType = "bool", params = { {type = "unsigned int", name = "gesture"} @@ -6361,7 +6361,7 @@ return { }, { name = "IsTextureValid", - description = "Check if a texture is valid (loaded in GPU)", + description = "Check if texture is valid (loaded in GPU)", returnType = "bool", params = { {type = "Texture2D", name = "texture"} @@ -6377,7 +6377,7 @@ return { }, { name = "IsRenderTextureValid", - description = "Check if a render texture is valid (loaded in GPU)", + description = "Check if render texture is valid (loaded in GPU)", returnType = "bool", params = { {type = "RenderTexture2D", name = "target"} @@ -6635,7 +6635,7 @@ return { description = "Get Color from a source pixel pointer of certain format", returnType = "Color", params = { - {type = "void *", name = "srcPtr"}, + {type = "const void *", name = "srcPtr"}, {type = "int", name = "format"} } }, @@ -6708,7 +6708,7 @@ return { }, { name = "IsFontValid", - description = "Check if a font is valid (font data loaded, WARNING: GPU texture not checked)", + description = "Check if font is valid (font data loaded, WARNING: GPU texture not checked)", returnType = "bool", params = { {type = "Font", name = "font"} @@ -7479,7 +7479,7 @@ return { }, { name = "IsModelValid", - description = "Check if a model is valid (loaded in GPU, VAO/VBOs)", + description = "Check if model is valid (loaded in GPU, VAO/VBOs)", returnType = "bool", params = { {type = "Model", name = "model"} @@ -7809,7 +7809,7 @@ return { }, { name = "IsMaterialValid", - description = "Check if a material is valid (shader assigned, map textures loaded in GPU)", + description = "Check if material is valid (shader assigned, map textures loaded in GPU)", returnType = "bool", params = { {type = "Material", name = "material"} @@ -8055,7 +8055,7 @@ return { }, { name = "IsSoundValid", - description = "Check if a sound is valid (data loaded and buffers initialized)", + description = "Check if sound is valid (data loaded and buffers initialized)", returnType = "bool", params = { {type = "Sound", name = "sound"} @@ -8147,7 +8147,7 @@ return { }, { name = "IsSoundPlaying", - description = "Check if a sound is currently playing", + description = "Check if sound is currently playing", returnType = "bool", params = { {type = "Sound", name = "sound"} @@ -8245,7 +8245,7 @@ return { }, { name = "IsMusicValid", - description = "Check if a music stream is valid (context and buffers initialized)", + description = "Check if music stream is valid (context and buffers initialized)", returnType = "bool", params = { {type = "Music", name = "music"} diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 11f23d80a..e322d5fe7 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1397,7 +1397,7 @@ Function 076: LoadShaderFromMemory() (2 input parameters) Function 077: IsShaderValid() (1 input parameters) Name: IsShaderValid Return type: bool - Description: Check if a shader is valid (loaded on GPU) + Description: Check if shader is valid (loaded on GPU) Param[1]: shader (type: Shader) Function 078: GetShaderLocation() (2 input parameters) Name: GetShaderLocation @@ -1708,7 +1708,7 @@ Function 130: FileExists() (1 input parameters) Function 131: DirectoryExists() (1 input parameters) Name: DirectoryExists Return type: bool - Description: Check if a directory path exists + Description: Check if directory path exists Param[1]: dirPath (type: const char *) Function 132: IsFileExtension() (2 input parameters) Name: IsFileExtension @@ -1774,7 +1774,7 @@ Function 143: ChangeDirectory() (1 input parameters) Function 144: IsPathFile() (1 input parameters) Name: IsPathFile Return type: bool - Description: Check if a given path is a file or a directory + Description: Check if given path is a file or a directory Param[1]: path (type: const char *) Function 145: IsFileNameValid() (1 input parameters) Name: IsFileNameValid @@ -1801,7 +1801,7 @@ Function 148: UnloadDirectoryFiles() (1 input parameters) Function 149: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool - Description: Check if a file has been dropped into window + Description: Check if file has been dropped into window No input parameters Function 150: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles @@ -1920,27 +1920,27 @@ Function 169: PlayAutomationEvent() (1 input parameters) Function 170: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool - Description: Check if a key has been pressed once + Description: Check if key has been pressed once Param[1]: key (type: int) Function 171: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool - Description: Check if a key has been pressed again + Description: Check if key has been pressed again Param[1]: key (type: int) Function 172: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool - Description: Check if a key is being pressed + Description: Check if key is being pressed Param[1]: key (type: int) Function 173: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool - Description: Check if a key has been released once + Description: Check if key has been released once Param[1]: key (type: int) Function 174: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool - Description: Check if a key is NOT being pressed + Description: Check if key is NOT being pressed Param[1]: key (type: int) Function 175: GetKeyPressed() (0 input parameters) Name: GetKeyPressed @@ -1965,7 +1965,7 @@ Function 178: SetExitKey() (1 input parameters) Function 179: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool - Description: Check if a gamepad is available + Description: Check if gamepad is available Param[1]: gamepad (type: int) Function 180: GetGamepadName() (1 input parameters) Name: GetGamepadName @@ -1975,25 +1975,25 @@ Function 180: GetGamepadName() (1 input parameters) Function 181: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool - Description: Check if a gamepad button has been pressed once + Description: Check if gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 182: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool - Description: Check if a gamepad button is being pressed + Description: Check if gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 183: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool - Description: Check if a gamepad button has been released once + Description: Check if gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 184: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool - Description: Check if a gamepad button is NOT being pressed + Description: Check if gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 185: GetGamepadButtonPressed() (0 input parameters) @@ -2028,22 +2028,22 @@ Function 189: SetGamepadVibration() (4 input parameters) Function 190: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool - Description: Check if a mouse button has been pressed once + Description: Check if mouse button has been pressed once Param[1]: button (type: int) Function 191: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool - Description: Check if a mouse button is being pressed + Description: Check if mouse button is being pressed Param[1]: button (type: int) Function 192: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool - Description: Check if a mouse button has been released once + Description: Check if mouse button has been released once Param[1]: button (type: int) Function 193: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool - Description: Check if a mouse button is NOT being pressed + Description: Check if mouse button is NOT being pressed Param[1]: button (type: int) Function 194: GetMouseX() (0 input parameters) Name: GetMouseX @@ -2131,7 +2131,7 @@ Function 209: SetGesturesEnabled() (1 input parameters) Function 210: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool - Description: Check if a gesture has been detected + Description: Check if gesture has been detected Param[1]: gesture (type: unsigned int) Function 211: GetGestureDetected() (0 input parameters) Name: GetGestureDetected @@ -3340,7 +3340,7 @@ Function 372: LoadRenderTexture() (2 input parameters) Function 373: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool - Description: Check if a texture is valid (loaded in GPU) + Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) Function 374: UnloadTexture() (1 input parameters) Name: UnloadTexture @@ -3350,7 +3350,7 @@ Function 374: UnloadTexture() (1 input parameters) Function 375: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool - Description: Check if a render texture is valid (loaded in GPU) + Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) Function 376: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture @@ -3525,7 +3525,7 @@ Function 402: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format - Param[1]: srcPtr (type: void *) + Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) Function 403: SetPixelColor() (3 input parameters) Name: SetPixelColor @@ -3579,7 +3579,7 @@ Function 409: LoadFontFromMemory() (6 input parameters) Function 410: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool - Description: Check if a font is valid (font data loaded, WARNING: GPU texture not checked) + Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) Function 411: LoadFontData() (7 input parameters) Name: LoadFontData @@ -4119,7 +4119,7 @@ Function 486: LoadModelFromMesh() (1 input parameters) Function 487: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool - Description: Check if a model is valid (loaded in GPU, VAO/VBOs) + Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) Function 488: UnloadModel() (1 input parameters) Name: UnloadModel @@ -4353,7 +4353,7 @@ Function 519: LoadMaterialDefault() (0 input parameters) Function 520: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool - Description: Check if a material is valid (shader assigned, map textures loaded in GPU) + Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) Function 521: UnloadMaterial() (1 input parameters) Name: UnloadMaterial @@ -4527,7 +4527,7 @@ Function 547: LoadSoundAlias() (1 input parameters) Function 548: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool - Description: Check if a sound is valid (data loaded and buffers initialized) + Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) Function 549: UpdateSound() (3 input parameters) Name: UpdateSound @@ -4586,7 +4586,7 @@ Function 558: ResumeSound() (1 input parameters) Function 559: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool - Description: Check if a sound is currently playing + Description: Check if sound is currently playing Param[1]: sound (type: Sound) Function 560: SetSoundVolume() (2 input parameters) Name: SetSoundVolume @@ -4651,7 +4651,7 @@ Function 569: LoadMusicStreamFromMemory() (3 input parameters) Function 570: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool - Description: Check if a music stream is valid (context and buffers initialized) + Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) Function 571: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 11ba9fccb..75720ce9f 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -880,7 +880,7 @@ - + @@ -1078,7 +1078,7 @@ - + @@ -1116,7 +1116,7 @@ - + @@ -1133,7 +1133,7 @@ - + @@ -1206,19 +1206,19 @@ - + - + - + - + - + @@ -1231,25 +1231,25 @@ - + - + - + - + - + @@ -1271,16 +1271,16 @@ - + - + - + - + @@ -1325,7 +1325,7 @@ - + @@ -2199,13 +2199,13 @@ - + - + @@ -2326,7 +2326,7 @@ - + @@ -2363,7 +2363,7 @@ - + @@ -2749,7 +2749,7 @@ - + @@ -2916,7 +2916,7 @@ - + @@ -3030,7 +3030,7 @@ - + @@ -3067,7 +3067,7 @@ - + @@ -3110,7 +3110,7 @@ - + From 1a4445f510c20339ea1fcaaad3c6f26ea7327b5b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:03:47 +0200 Subject: [PATCH 46/49] Renamed parameters to align with internal implementations --- src/raylib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index cb02d533b..e63227ef7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1577,10 +1577,10 @@ RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color); // Draw a cylinder/cone RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos -RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color); // Draw a cylinder wires with base at startPos and top at endPos +RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color); // Draw a cylinder/cone wires +RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ From fadcd1fac5b2f8b7003bec3af600a743244cba3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:05:06 +0000 Subject: [PATCH 47/49] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 6 +++--- tools/rlparser/output/raylib_api.lua | 6 +++--- tools/rlparser/output/raylib_api.txt | 6 +++--- tools/rlparser/output/raylib_api.xml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 1c882cd88..1d6b19c3f 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -10564,7 +10564,7 @@ }, { "type": "int", - "name": "slices" + "name": "sides" }, { "type": "Color", @@ -10626,7 +10626,7 @@ }, { "type": "int", - "name": "slices" + "name": "sides" }, { "type": "Color", @@ -10657,7 +10657,7 @@ }, { "type": "int", - "name": "slices" + "name": "sides" }, { "type": "Color", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index d5024fd45..eaae7e493 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -7364,7 +7364,7 @@ return { {type = "float", name = "radiusTop"}, {type = "float", name = "radiusBottom"}, {type = "float", name = "height"}, - {type = "int", name = "slices"}, + {type = "int", name = "sides"}, {type = "Color", name = "color"} } }, @@ -7390,7 +7390,7 @@ return { {type = "float", name = "radiusTop"}, {type = "float", name = "radiusBottom"}, {type = "float", name = "height"}, - {type = "int", name = "slices"}, + {type = "int", name = "sides"}, {type = "Color", name = "color"} } }, @@ -7403,7 +7403,7 @@ return { {type = "Vector3", name = "endPos"}, {type = "float", name = "startRadius"}, {type = "float", name = "endRadius"}, - {type = "int", name = "slices"}, + {type = "int", name = "sides"}, {type = "Color", name = "color"} } }, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index e322d5fe7..ee54892d9 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -4035,7 +4035,7 @@ Function 476: DrawCylinder() (6 input parameters) Param[2]: radiusTop (type: float) Param[3]: radiusBottom (type: float) Param[4]: height (type: float) - Param[5]: slices (type: int) + Param[5]: sides (type: int) Param[6]: color (type: Color) Function 477: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx @@ -4055,7 +4055,7 @@ Function 478: DrawCylinderWires() (6 input parameters) Param[2]: radiusTop (type: float) Param[3]: radiusBottom (type: float) Param[4]: height (type: float) - Param[5]: slices (type: int) + Param[5]: sides (type: int) Param[6]: color (type: Color) Function 479: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx @@ -4065,7 +4065,7 @@ Function 479: DrawCylinderWiresEx() (6 input parameters) Param[2]: endPos (type: Vector3) Param[3]: startRadius (type: float) Param[4]: endRadius (type: float) - Param[5]: slices (type: int) + Param[5]: sides (type: int) Param[6]: color (type: Color) Function 480: DrawCapsule() (6 input parameters) Name: DrawCapsule diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 75720ce9f..798cdd4cb 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -2687,7 +2687,7 @@ - + @@ -2703,7 +2703,7 @@ - + @@ -2711,7 +2711,7 @@ - + From a85c9f489824ffea71e30c8e35b2eea34c446857 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:07:07 +0200 Subject: [PATCH 48/49] REVIEWED: `File*()` functions for consistent return result value NOTE: `SaveFile*()` still follows original convention, returning true on success... --- src/raylib.h | 14 +++++++------- src/rcore.c | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index e63227ef7..7313ffaf3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1141,12 +1141,12 @@ RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custo RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver -RLAPI int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists) -RLAPI int FileRemove(const char *fileName); // Remove file (if exists) -RLAPI int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist -RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist -RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file -RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file +RLAPI int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists), returns 0 on success +RLAPI int FileRemove(const char *fileName); // Remove file (if exists), returns 0 on success +RLAPI int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success +RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success +RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file, returns 0 on success +RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file, returns -1 if index not found or index otherwise RLAPI bool FileExists(const char *fileName); // Check if file exists RLAPI bool DirectoryExists(const char *dirPath); // Check if directory path exists RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (recommended include point: .png, .wav) @@ -1160,7 +1160,7 @@ RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previ RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success -RLAPI bool ChangeDirectory(const char *dirPath); // Change working directory, return true on success +RLAPI int ChangeDirectory(const char *dirPath); // Change working directory, returns 0 on success RLAPI bool IsPathFile(const char *path); // Check if given path is a file or a directory RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths, files and directories, no subdirs scan diff --git a/src/rcore.c b/src/rcore.c index d31ae25b8..137dd99ce 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2205,13 +2205,12 @@ void SetSaveFileTextCallback(SaveFileTextCallback callback) // NOTE: Only rename file name required, not full path int FileRename(const char *fileName, const char *fileRename) { - int result = 0; + int result = -1; if (FileExists(fileName)) { result = rename(fileName, fileRename); } - else result = -1; return result; } @@ -2219,13 +2218,12 @@ int FileRename(const char *fileName, const char *fileRename) // Remove file (if exists) int FileRemove(const char *fileName) { - int result = 0; + int result = -1; if (FileExists(fileName)) { result = remove(fileName); } - else result = -1; return result; } @@ -2234,7 +2232,7 @@ int FileRemove(const char *fileName) // NOTE: If destination path does not exist, it is created! int FileCopy(const char *srcPath, const char *dstPath) { - int result = 0; + int result = -1; int srcDataSize = 0; unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize); @@ -2245,7 +2243,10 @@ int FileCopy(const char *srcPath, const char *dstPath) if (result == 0) // Directory created successfully (or already exists) { if ((srcFileData != NULL) && (srcDataSize > 0)) - result = SaveFileData(dstPath, srcFileData, srcDataSize); + { + bool saved = SaveFileData(dstPath, srcFileData, srcDataSize); + if (saved) result = 0; + } } UnloadFileData(srcFileData); @@ -2261,11 +2262,18 @@ int FileMove(const char *srcPath, const char *dstPath) if (FileExists(srcPath)) { - FileCopy(srcPath, dstPath); - - // Make sure file has been correctly copied before removing - if (FileExists(dstPath) && (GetFileLength(srcPath) == GetFileLength(dstPath))) result = FileRemove(srcPath); - else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to copy file to [%s]", srcPath, dstPath); + result = FileCopy(srcPath, dstPath); + + if (result == 0) + { + // Make sure file has been correctly copied before removing + if (FileExists(dstPath) && (GetFileLength(srcPath) == GetFileLength(dstPath))) + { + result = FileRemove(srcPath); + if (result != 0) TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to remove source file after copy", srcPath); + } + else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to copy file to [%s]", srcPath, dstPath); + } } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Source file does not exist", srcPath); @@ -2276,7 +2284,7 @@ int FileMove(const char *srcPath, const char *dstPath) // WARNING: DEPENDENCY: [rtext] module int FileTextReplace(const char *fileName, const char *search, const char *replacement) { - int result = 0; + int result = -1; #if SUPPORT_MODULE_RTEXT char *fileText = NULL; @@ -2286,7 +2294,8 @@ int FileTextReplace(const char *fileName, const char *search, const char *replac { fileText = LoadFileText(fileName); fileTextUpdated = TextReplaceAlloc(fileText, search, replacement); - result = SaveFileText(fileName, fileTextUpdated); + bool saved = SaveFileText(fileName, fileTextUpdated); + if (saved) result = 0; MemFree(fileTextUpdated); UnloadFileText(fileText); } @@ -2801,14 +2810,16 @@ int MakeDirectory(const char *dirPath) } // Change working directory, returns true on success -bool ChangeDirectory(const char *dirPath) +int ChangeDirectory(const char *dirPath) { - bool result = CHDIR(dirPath); + // NOTE: On success, CHDIR() return 0; on error, returns -1 and errno is set to indicate the error, + // depending on the filesystem, other errors can be returned + int result = CHDIR(dirPath); if (result != 0) TRACELOG(LOG_WARNING, "SYSTEM: Failed to change to directory: %s", dirPath); else TRACELOG(LOG_INFO, "SYSTEM: Working Directory: %s", dirPath); - return (result == 0); + return result; } // Check if given path point to a file From 9ace1489175a375529a6e8510b75f0c8a7b34cc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:07:28 +0000 Subject: [PATCH 49/49] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 16 ++++++++-------- tools/rlparser/output/raylib_api.lua | 16 ++++++++-------- tools/rlparser/output/raylib_api.txt | 16 ++++++++-------- tools/rlparser/output/raylib_api.xml | 14 +++++++------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 1d6b19c3f..0da5fc3e0 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -4427,7 +4427,7 @@ }, { "name": "FileRename", - "description": "Rename file (if exists)", + "description": "Rename file (if exists), returns 0 on success", "returnType": "int", "params": [ { @@ -4442,7 +4442,7 @@ }, { "name": "FileRemove", - "description": "Remove file (if exists)", + "description": "Remove file (if exists), returns 0 on success", "returnType": "int", "params": [ { @@ -4453,7 +4453,7 @@ }, { "name": "FileCopy", - "description": "Copy file from one path to another, dstPath created if it doesn't exist", + "description": "Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success", "returnType": "int", "params": [ { @@ -4468,7 +4468,7 @@ }, { "name": "FileMove", - "description": "Move file from one directory to another, dstPath created if it doesn't exist", + "description": "Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success", "returnType": "int", "params": [ { @@ -4483,7 +4483,7 @@ }, { "name": "FileTextReplace", - "description": "Replace text in an existing file", + "description": "Replace text in an existing file, returns 0 on success", "returnType": "int", "params": [ { @@ -4502,7 +4502,7 @@ }, { "name": "FileTextFindIndex", - "description": "Find text in existing file", + "description": "Find text in existing file, returns -1 if index not found or index otherwise", "returnType": "int", "params": [ { @@ -4652,8 +4652,8 @@ }, { "name": "ChangeDirectory", - "description": "Change working directory, return true on success", - "returnType": "bool", + "description": "Change working directory, returns 0 on success", + "returnType": "int", "params": [ { "type": "const char *", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index eaae7e493..6fa5d9321 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4022,7 +4022,7 @@ return { }, { name = "FileRename", - description = "Rename file (if exists)", + description = "Rename file (if exists), returns 0 on success", returnType = "int", params = { {type = "const char *", name = "fileName"}, @@ -4031,7 +4031,7 @@ return { }, { name = "FileRemove", - description = "Remove file (if exists)", + description = "Remove file (if exists), returns 0 on success", returnType = "int", params = { {type = "const char *", name = "fileName"} @@ -4039,7 +4039,7 @@ return { }, { name = "FileCopy", - description = "Copy file from one path to another, dstPath created if it doesn't exist", + description = "Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success", returnType = "int", params = { {type = "const char *", name = "srcPath"}, @@ -4048,7 +4048,7 @@ return { }, { name = "FileMove", - description = "Move file from one directory to another, dstPath created if it doesn't exist", + description = "Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success", returnType = "int", params = { {type = "const char *", name = "srcPath"}, @@ -4057,7 +4057,7 @@ return { }, { name = "FileTextReplace", - description = "Replace text in an existing file", + description = "Replace text in an existing file, returns 0 on success", returnType = "int", params = { {type = "const char *", name = "fileName"}, @@ -4067,7 +4067,7 @@ return { }, { name = "FileTextFindIndex", - description = "Find text in existing file", + description = "Find text in existing file, returns -1 if index not found or index otherwise", returnType = "int", params = { {type = "const char *", name = "fileName"}, @@ -4175,8 +4175,8 @@ return { }, { name = "ChangeDirectory", - description = "Change working directory, return true on success", - returnType = "bool", + description = "Change working directory, returns 0 on success", + returnType = "int", params = { {type = "const char *", name = "dirPath"} } diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index ee54892d9..97d2350c0 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1667,37 +1667,37 @@ Function 123: SetSaveFileTextCallback() (1 input parameters) Function 124: FileRename() (2 input parameters) Name: FileRename Return type: int - Description: Rename file (if exists) + Description: Rename file (if exists), returns 0 on success Param[1]: fileName (type: const char *) Param[2]: fileRename (type: const char *) Function 125: FileRemove() (1 input parameters) Name: FileRemove Return type: int - Description: Remove file (if exists) + Description: Remove file (if exists), returns 0 on success Param[1]: fileName (type: const char *) Function 126: FileCopy() (2 input parameters) Name: FileCopy Return type: int - Description: Copy file from one path to another, dstPath created if it doesn't exist + Description: Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success Param[1]: srcPath (type: const char *) Param[2]: dstPath (type: const char *) Function 127: FileMove() (2 input parameters) Name: FileMove Return type: int - Description: Move file from one directory to another, dstPath created if it doesn't exist + Description: Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success Param[1]: srcPath (type: const char *) Param[2]: dstPath (type: const char *) Function 128: FileTextReplace() (3 input parameters) Name: FileTextReplace Return type: int - Description: Replace text in an existing file + Description: Replace text in an existing file, returns 0 on success Param[1]: fileName (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) Function 129: FileTextFindIndex() (2 input parameters) Name: FileTextFindIndex Return type: int - Description: Find text in existing file + Description: Find text in existing file, returns -1 if index not found or index otherwise Param[1]: fileName (type: const char *) Param[2]: search (type: const char *) Function 130: FileExists() (1 input parameters) @@ -1768,8 +1768,8 @@ Function 142: MakeDirectory() (1 input parameters) Param[1]: dirPath (type: const char *) Function 143: ChangeDirectory() (1 input parameters) Name: ChangeDirectory - Return type: bool - Description: Change working directory, return true on success + Return type: int + Description: Change working directory, returns 0 on success Param[1]: dirPath (type: const char *) Function 144: IsPathFile() (1 input parameters) Name: IsPathFile diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 798cdd4cb..7fd73e2ed 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1051,27 +1051,27 @@ - + - + - + - + - + - + @@ -1113,7 +1113,7 @@ - +