From cd4599b447690c5be3e793fd24ba98fca9aaf7ae Mon Sep 17 00:00:00 2001 From: GnuChanOS <117280480+gnuchanos@users.noreply.github.com> Date: Sat, 9 May 2026 19:48:10 +0300 Subject: [PATCH 1/5] Update BINDINGS.md (#5850) --- BINDINGS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index d6fd107bd..7d1c43ca8 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -105,7 +105,8 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT | | [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT | | [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** | -| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license | +| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license | +| [gclang-raylib](https://github.com/gnuchanos/gcLang_Compiler/tree/main/windows_version/raylib_version)| **6.0** | [gclang](https://github.com/gnuchanos/gcLang_Compiler) | AGPL-3.0 | ### Utility Wrapers From 07b729d5d6d759ef91532b03617cac5939b9b748 Mon Sep 17 00:00:00 2001 From: Faraz Fallahi Date: Sat, 9 May 2026 09:55:02 -0700 Subject: [PATCH 2/5] fix: check fread return value in jar_mod_load_file (#5840) --- src/external/jar_mod.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/external/jar_mod.h b/src/external/jar_mod.h index 7ecf9f437..12b8101c4 100644 --- a/src/external/jar_mod.h +++ b/src/external/jar_mod.h @@ -1538,10 +1538,10 @@ mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename) modctx->modfile = (muchar *) JARMOD_MALLOC(fsize); modctx->modfilesize = fsize; memset(modctx->modfile, 0, fsize); - fread(modctx->modfile, fsize, 1, f); + if(fread(modctx->modfile, fsize, 1, f) != 1) fsize = 0; fclose(f); - if(!jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0; + if(fsize && !jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0; } else fsize = 0; } return fsize; From dcb0ca5d14771d7e26daae8a418c40c2e9c0ce8a Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Sun, 10 May 2026 14:01:38 +0100 Subject: [PATCH 3/5] [raudio]: free converterResidual in UnloadSoundAlias to prevent leak (#5857) The example audio_sound_multi was leaking memory every single time the spacebar was pressed. ```c Direct leak of 576 byte(s) in 9 object(s) allocated from: #0 0x758a41019447 in calloc (/usr/lib/liblsan.so.0+0x19447) (BuildId: 8ee115309adc591d231c961c43d245cfa68d9aa7) #1 0x562dfbd2c4f3 in LoadAudioBuffer (/home/peter/raylib/examples/audio/audio_sound_multi+0xfa4f3) (BuildId: ea2a6f45d724abeccf904143a32012266f259f93) ``` This patch fixes that leak. --- src/raudio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/raudio.c b/src/raudio.c index e4d36611c..ff90d8e43 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1048,6 +1048,7 @@ void UnloadSoundAlias(Sound alias) { UntrackAudioBuffer(alias.stream.buffer); ma_data_converter_uninit(&alias.stream.buffer->converter, NULL); + RL_FREE(alias.stream.buffer->converterResidual); RL_FREE(alias.stream.buffer); } } From ae315eecb9d7fa10edd8cd7aacc1909754a25dc9 Mon Sep 17 00:00:00 2001 From: Thomas Anderson <5776225+CrackedPixel@users.noreply.github.com> Date: Sun, 10 May 2026 12:09:24 -0500 Subject: [PATCH 4/5] added win32 to cmake + examples (#5855) --- CMakeOptions.txt | 2 +- cmake/LibraryConfigurations.cmake | 15 +++++++++++++++ examples/Makefile | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 5eff4c311..9e253dc55 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -6,7 +6,7 @@ if(EMSCRIPTEN) # When configuring web builds with "emcmake cmake -B build -S .", set PLATFORM to Web by default SET(PLATFORM Web CACHE STRING "Platform to build for.") endif() -enum_option(PLATFORM "Desktop;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW;Memory" "Platform to build for.") +enum_option(PLATFORM "Desktop;Win32;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW;Memory" "Platform to build for.") enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0;Software" "Force a specific OpenGL Version?") diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index ad026474f..262150be0 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -91,6 +91,21 @@ if (${PLATFORM} STREQUAL "Desktop") endif () endif () +elseif (${PLATFORM} STREQUAL "Win32") + if ((NOT WIN32) AND (NOT CMAKE_C_COMPILER MATCHES "mingw|mingw32|mingw64")) + message(FATAL_ERROR "Win32 platform requires Windows or a cross compiler.") + endif () + + set(PLATFORM_CPP "PLATFORM_DESKTOP_WIN32") + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + + if (${OPENGL_VERSION} MATCHES "Software") + set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE") + endif () + + find_package(OpenGL QUIET) + set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm) + elseif (${PLATFORM} STREQUAL "Web") set(PLATFORM_CPP "PLATFORM_WEB") if(NOT GRAPHICS) diff --git a/examples/Makefile b/examples/Makefile index 334f59694..3e1844fc3 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -20,6 +20,8 @@ # - Linux (X11 desktop mode) # - macOS/OSX (x64, arm64 (not tested)) # - Others (not tested) +# > PLATFORM_DESKTOP_WIN32 (native Win32): +# - Windows (Win32, Win64) # > PLATFORM_WEB_RGFW: # - HTML5 (WebAssembly) # > PLATFORM_WEB: @@ -794,6 +796,23 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) rm -f *.o endif endif +ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32) + ifeq ($(PLATFORM_OS),WINDOWS) + del *.o *.exe /s + endif + ifeq ($(PLATFORM_OS),BSD) + find . -type f -perm -ugo+x -delete + rm -fv *.o + endif + ifeq ($(PLATFORM_OS),LINUX) + find . -type f -executable -delete + rm -fv *.o + endif + ifeq ($(PLATFORM_OS),OSX) + find . -type f -perm +ugo+x -delete + rm -f *.o + endif +endif ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) find . -type f -executable -delete rm -fv *.o From a005a044dac0d55d6e7b0eb783541e4fa88138d3 Mon Sep 17 00:00:00 2001 From: Tubbles Date: Sun, 10 May 2026 19:20:35 +0200 Subject: [PATCH 5/5] [rcore_android] Restore face-button input on Android gamepads (#5824) The KEYBOARD-source veto added in #5439 drops face-button key events that arrive with both AINPUT_SOURCE_KEYBOARD and AINPUT_SOURCE_GAMEPAD set on the source bitmask. Confirmed reproducible on GameSir X2 Type-C and 8BitDo Ultimate Bluetooth, both reporting source 0x501 on every face-button key event. This source-bit pattern is general AOSP behaviour since Android 3.2 (commit 6f2fba4 in frameworks/base, Feb 2011): EventHub adds InputDeviceClass::KEYBOARD to any device whose evdev keyBitmask claims gamepad buttons (BTN_JOYSTICK..BTN_DIGI), and KeyboardInputMapper::getEventSource stamps the resulting KEYBOARD|GAMEPAD source on every outgoing key event. Use AndroidTranslateGamepadButton(keycode) as the discriminator instead. Recognised gamepad keycodes route to the gamepad path; unknown keycodes fall through to the keyboard handler. Assisted-by: Claude:claude-opus-4-7 --- src/platforms/rcore_android.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index ca0de7239..990b2fe6a 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -1273,27 +1273,28 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) int32_t keycode = AKeyEvent_getKeyCode(event); //int32_t AKeyEvent_getMetaState(event); - // Handle gamepad button presses and releases - // NOTE: Skip gamepad handling if this is a keyboard event, as some devices - // report both AINPUT_SOURCE_KEYBOARD and AINPUT_SOURCE_GAMEPAD flags - if ((FLAG_IS_SET(source, AINPUT_SOURCE_JOYSTICK) || - FLAG_IS_SET(source, AINPUT_SOURCE_GAMEPAD)) && - !FLAG_IS_SET(source, AINPUT_SOURCE_KEYBOARD)) + // Handle gamepad button presses and releases. AOSP stamps the + // KEYBOARD source bit on every key event from a gamepad, so + // discriminate on the keycode rather than gating on source bits. + if (FLAG_IS_SET(source, AINPUT_SOURCE_JOYSTICK) || + FLAG_IS_SET(source, AINPUT_SOURCE_GAMEPAD)) { - // Assuming a single gamepad, "detected" on its input event - CORE.Input.Gamepad.ready[0] = true; - GamepadButton button = AndroidTranslateGamepadButton(keycode); - if (button == GAMEPAD_BUTTON_UNKNOWN) return 1; - - if (AKeyEvent_getAction(event) == AKEY_EVENT_ACTION_DOWN) + if (button != GAMEPAD_BUTTON_UNKNOWN) { - CORE.Input.Gamepad.currentButtonState[0][button] = 1; - } - else CORE.Input.Gamepad.currentButtonState[0][button] = 0; // Key up + // Assuming a single gamepad, "detected" on its input event + CORE.Input.Gamepad.ready[0] = true; - return 1; // Handled gamepad button + if (AKeyEvent_getAction(event) == AKEY_EVENT_ACTION_DOWN) + { + CORE.Input.Gamepad.currentButtonState[0][button] = 1; + } + else CORE.Input.Gamepad.currentButtonState[0][button] = 0; // Key up + + return 1; // Handled gamepad button + } + // Unknown keycode: fall through to the keyboard handler below. } KeyboardKey key = ((keycode > 0) && (keycode < KEYCODE_MAP_SIZE))? mapKeycode[keycode] : KEY_NULL;