Commit Graph

9884 Commits

Author SHA1 Message Date
Jeffery Myers
f1d602029c Enable GPU skinning for GL 3.3+, (#5902)
only do GPU skinning if the shader supports bone IDs.
2026-06-01 20:25:09 +02:00
Bigfoot
10a889c482 [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
2026-05-30 19:44:45 +02:00
Kaggen67
b7f50b2fb6 [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
2026-05-30 19:39:16 +02:00
Ray
2ee6a76464 REVIEWED: GetWindowHandle(), to be consistent between backends, fix #5885
Returns the underlying window handle for platforms with some windowing system.
2026-05-30 12:20:58 +02:00
Alexandre Almeida
f0d3e9a5c8 Security fixes (rcore_desktop_win32.c) (#5899)
* Security fixes in rcore_desktop_win32.c

* Avoid calling strlen() twice
2026-05-30 08:49:34 +02:00
Alexandre Almeida
7c284cc5bc Fix warning about unused variables (#5898) 2026-05-30 08:47:35 +02:00
Vasilis Narain
7b96144716 [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 e0083bc7fe.

* fix GetCurrentMonitor() distance calc overflow

* fix GetCurrentMonitor() distance calc
2026-05-29 18:18:18 +02:00
Caleb Seelhoff
81c7cb6527 [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.
2026-05-29 18:17:04 +02:00
Colin James Wood
186d3ce9fb [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
2026-05-29 18:16:17 +02:00
Rob Loach
e7edb181dc 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
2026-05-27 09:20:11 +02:00
Ray
ef8b3e6195 Update rlgl.h 2026-05-26 20:46:56 +02:00
Fipaan
7f9ded7642 [makefile] ANDROID_ARCH check (#5888) 2026-05-26 18:13:58 +02:00
Rgebee
34b06ca587 Update BINDINGS.md (#5887) 2026-05-25 16:05:20 +02:00
coal
4d845608b8 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
2026-05-25 08:32:52 +02:00
Ray
eaf32c83bf REXM: Latest w64devkit supports make directly, simplifying code to avoid mingw32-make 2026-05-25 00:26:26 +02:00
keyle
808e6b9b20 Raylib-lua version to 5.5 (#5884)
raylib-lua from 5.0 to 5.5 in bindings.
2026-05-24 17:36:12 +02:00
github-actions[bot]
7dd72e7328 rlparser: update raylib_api.* by CI 2026-05-24 07:25:01 +00:00
Ray
f8270483e1 Merge branch 'master' of https://github.com/raysan5/raylib 2026-05-24 09:24:33 +02:00
Ray
f17babfe8a REVIEWED: #5879 2026-05-24 09:24:26 +02:00
ghera
f65d5ad7a9 rshapes: fix auto segment rounded-corner math and rounding (#5883) 2026-05-24 08:55:08 +02:00
Ray
0d78f10161 Reviewed comments formating 2026-05-20 09:16:16 +02:00
Colin James Wood
7d5b61ce01 [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
2026-05-20 09:12:20 +02:00
Ray
b48933b096 Merge branch 'master' of https://github.com/raysan5/raylib 2026-05-19 18:59:30 +02:00
Ray
fd1dfd7d65 ADDED: rprand_get_value_raw() 2026-05-19 18:59:23 +02:00
steampuker
be56f2c524 [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
2026-05-19 18:57:42 +02:00
Anstro Pleuton
d31c10a01e Adjust segment calculation in DrawRectangleRounded to be consistent with DrawRectangleRoundedLinesEx (#5875) 2026-05-19 18:48:28 +02:00
Mihai Preda
c04e57399a Fix compilation for -DPLATFORM=RGFW (#5870)
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💯5: error: unknown type name ‘GLuint’
  100 |     GLuint vao = 0;
[etc]
2026-05-15 17:40:26 +02:00
Jairo Correa
6c090f6193 Fix build.zig building examples all the time (#5869) 2026-05-15 17:39:27 +02:00
Ray
5ca45bce37 Update rcore.c 2026-05-14 20:05:25 +02:00
Ray
729327a078 Update .gitignore 2026-05-14 20:05:21 +02:00
jestarray
ea76845ecb [cmake]: remove GLFW_BUILD warnings for when platform is SDL (#5865) 2026-05-14 13:02:38 +02:00
JupiterRider
5506aed190 BINDINGS.md: update golang binding to v6.0 (#5866) 2026-05-14 13:00:40 +02:00
Ray
43366d1c6a Some formatting tweaks 2026-05-13 09:28:08 +02:00
Ray
f35f4b9fad REVIEWED: GetTime(), small addition for RPI Pico 2 2026-05-13 09:17:04 +02:00
Ray
c4b4fcc17e Format review 2026-05-13 09:16:29 +02:00
Ray
fbf132d1d1 Use rlgl provided interface instead of rlsw direct access 2026-05-13 09:16:19 +02:00
Ray
e274c195af Update rcore.c 2026-05-13 09:15:50 +02:00
Thomas Anderson
fd28dc5644 [rtext] add warning for loadfontex/loadfontfrommemory (#5864)
* add warning for loadfontex/loadfontfrommemory

* bump to re-run build tests
2026-05-13 08:56:13 +02:00
Ray
5aa3de194c Updated miniaudio warnings with emscripten 2026-05-12 20:33:20 +02:00
Keks137
9400199b80 [rcore][RGFW] Add fullscreen behaviour on size 0 window creation (#5859)
* port glfw's behaviour on size 0 window creation to rgfw

* updates with change suggestions

* don't do the FLAG_FULLSCREEN_MODE check twice for no reason

---------

Co-authored-by: CrackedPixel <5776225+CrackedPixel@users.noreply.github.com>
2026-05-11 23:25:00 +02:00
Ray
200d344dee Merge branch 'master' of https://github.com/raysan5/raylib 2026-05-10 19:31:22 +02:00
Ray
094edcd32e Update Makefile 2026-05-10 19:31:19 +02:00
Tubbles
a005a044da [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
2026-05-10 19:20:35 +02:00
Thomas Anderson
ae315eecb9 added win32 to cmake + examples (#5855) 2026-05-10 19:09:24 +02:00
Peter0x44
dcb0ca5d14 [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.
2026-05-10 15:01:38 +02:00
Faraz Fallahi
07b729d5d6 fix: check fread return value in jar_mod_load_file (#5840) 2026-05-09 18:55:02 +02:00
GnuChanOS
cd4599b447 Update BINDINGS.md (#5850) 2026-05-09 18:48:10 +02:00
Ray
b2ea5eae5e REVIEWED: long long usage in all raylib, minimize
REVIEWED: Using `long long` format instead of `long long int`, more consistent with the `short` alternative for smaller `int`, instead of `short int`
2026-05-08 22:59:55 +02:00
mjt
29ff1f02e9 Update Makefile comment (#5846) 2026-05-08 20:19:08 +02:00
Peter0x44
d840a100a7 [CMake] Add configure-time test for libatomic requirement (#5847)
CMake now checks if -latomic is required for 64-bit atomics, and links
it if it's required. Miniaudio is the only thing in raylib that needs
it, so it's put behind SUPPORT_MODULE_RAUDIO.
2026-05-08 20:16:45 +02:00