Commit graph raylib/src
Author SHA1 Message Date
Jeffery Myers
41aeb313bf more fixes for web 2026-07-03 17:28:57 -07:00
Jeffery Myers
635c6c48c7 fix web 2026-07-03 17:16:02 -07:00
Jeffery Myers
f95bd9d997 Let the platform handle the game loop in case it has some existing callback method (like web does) 2026-07-03 11:08:34 -07:00
Jeff Myers
41a3934f2a try to respect the FPS cap when doing refresh updates 2026-07-01 09:16:45 -07:00
Jeff Myers
159136a6eb call the render callback on window size and move. 2026-06-30 21:11:26 -07:00
Jeffery Myers
200968a2ab Test out an optional render callback 2026-06-30 19:42:23 -07:00
greymoth
67359073ca
[rcore] Add gamepad >= 0 lower-bound guard to six sibling functions (#5938)
Commit 3edfe194 added a `gamepad >= 0` lower-bound check to
GetGamepadAxisCount() and GetGamepadName(), but six sibling functions
were left with only the upper-bound check (`gamepad < MAX_GAMEPADS`).
A negative signed int passes that check and triggers out-of-bounds
access on CORE.Input.Gamepad.ready[gamepad] and related arrays (UB in C).

Apply the same `(gamepad >= 0) &&` guard added in 3edfe194 to:
- IsGamepadAvailable
- IsGamepadButtonPressed
- IsGamepadButtonDown
- IsGamepadButtonReleased
- IsGamepadButtonUp
- GetGamepadAxisMovement
2026-06-27 21:06:49 +02:00
Brandon Arrendondo
3edfe19438
[rcore] Bounds-check gamepad index in GetGamepadAxisCount() and GetGamepadName() (#5937)
* [rcore] Bounds-check gamepad index in GetGamepadAxisCount() and GetGamepadName()

Both public getters indexed CORE.Input.Gamepad.axisCount[gamepad] / .name[gamepad]
with an unvalidated gamepad argument -- an out-of-bounds read for gamepad < 0 or
gamepad >= MAX_GAMEPADS. Every sibling gamepad accessor (IsGamepadAvailable,
IsGamepadButton*, GetGamepadAxisMovement) already guards the index; add the same
check, returning a safe default (0 / NULL).

* Refactor GetGamepadName/GetGamepadAxisCount to single-return pattern

---------

Co-authored-by: Brandon Arrendondo <brandon.arrendondo@bissell.com>
2026-06-24 17:40:28 +02:00
Brandon Arrendondo
9215540015
[rtext] Fix buffer overflow in TextReplaceBetween() (#5936)
The MAX_TEXT_BUFFER_LENGTH guard present in TextReplace()/TextInsert() was
missing here, so the three strncpy() calls could write past the 1024-byte
static buffer for long inputs. Add the same length check before copying.

Co-authored-by: Brandon Arrendondo <brandon.arrendondo@bissell.com>
2026-06-24 16:41:19 +02:00
Brandon Arrendondo
83cb4cc210
[rlgl] Fix matrix stack overflow in rlPushMatrix() (#5935)
The RL_MAX_MATRIX_STACK_SIZE check logged an error but did not return, so
RLGL.State.stack[stackCounter] = *currentMatrix still executed when the stack
was full -- writing one element past stack[RL_MAX_MATRIX_STACK_SIZE] and
corrupting the adjacent RLGL.State members (stackCounter, etc.). rlPopMatrix()
already guards the symmetric underflow case; add the missing early return.

Co-authored-by: Brandon Arrendondo <brandon.arrendondo@bissell.com>
2026-06-24 16:38:08 +02:00
Ray
d1a14bee5d Update rmodels.c 2026-06-24 10:38:20 +02:00
eu
ba3b8f8370
Add comments for GenMeshTorus (#5934) 2026-06-24 10:36:30 +02:00
Ray
87a6e9693c Format tweaks 2026-06-19 12:27:02 +02:00
Ray
f9c41a0866 Reemove trailing spaces 2026-06-16 21:12:12 +02:00
Ray
fa8aca8789 Update rlgl.h 2026-06-16 13:06:16 +02:00
Ray
efef4e31dd REVIEWED: LoadImageFromTexture() for Wasm https://github.com/raysan5/rguistyler/issues/10
Let's see if it breaks on some other platform...
2026-06-16 13:01:50 +02:00
Ray
4d2b1d51e4 Update rcore_desktop_glfw.c 2026-06-15 23:19:27 +02:00
Ray
8713741782 Update rcore.c 2026-06-13 09:21:39 +02:00
InviseDivine
ac6526b731
[rcore] Fix `FileCopy` doesn't copy file when directory exists (#5920)
* Fix FileCopy result

* fix code style
2026-06-13 09:18:41 +02:00
Thomas Anderson
94897c4eca
[platform/RGFW] update rgfw (#5919)
* update rgfw + platform v1

* added drop events

* updates
2026-06-10 08:56:07 +02:00
Ray
aeea213873 Update raudio.c 2026-06-09 13:19:19 +02:00
Thomas Anderson
8d31d0c3cc
remove extra drflac_free (#5916) 2026-06-09 13:16:41 +02:00
Ray
aebfd788c7 WARNING: BREAKING: REDESIGNED: ImageDraw() API, align with DrawTexture() 2026-06-07 21:53:07 +02:00
Ray
d9335f6a95 ADDED: TODO: ImageDrawCircleGradient() 2026-06-07 21:51:02 +02:00
Ray
e57663c937 Update raylib.h 2026-06-07 21:29:26 +02:00
Ray
68c4b8a60f Removed old compatibility hack 2026-06-07 21:26:59 +02:00
Ray
ca0ba55050 Reviewed parameter names, added comment about order 2026-06-07 21:26:32 +02:00
Ray
236618f87b Reorder functions by drawing vertex/sides 2026-06-07 21:06:53 +02:00
Ray
4724e5fec3 ADDED: ImageDrawLineStrip() 2026-06-07 18:48:41 +02:00
Ray
d3d1b0cbcc ADDED: DrawCircleLinesEx(), simpler naming than DrawRing() 2026-06-07 18:48:16 +02:00
Ray
a41bb7c07a Reorder shapes drawing API functions by number of vertices
NOTE: Consistency between shapes and Image drawing functionality is being aligned (as much as possible)
2026-06-07 18:47:14 +02:00
Ray
869251e590 REVIEWED: Parameter name, shorter 2026-06-07 18:42:50 +02:00
Ray
15d25242be REVIEWED: Comments to be more descriptive 2026-06-07 18:41:44 +02:00
rvnfml
796e1ad22a
Use CORE.Input.Keyboard.exitKey instead of KEY_ESCAPE (#5911)
... in rcore_desktop_win32 when handling window closing
2026-06-06 22:25:48 +02:00
Luis
acfcf2f1d1
[rmodels] Fix minimum rings validation in DrawCapsule and DrawCapsuleWires (#5909)
Ensure rings is at least 1 to prevent rendering issues or crashes when 0 or negative values are passed.
2026-06-06 19:47:57 +02:00
fyl2xp1
ca46387b64
use inverse bind matrices for bind pose in gltf loader (#5832) 2026-06-05 09:27:05 +02:00
Luis
fd79b81918
Fix memory leak in UnloadModel() (#5907) 2026-06-04 23:32:52 +02:00
Ray
a85c9f4898 REVIEWED: File*() functions for consistent return result value
NOTE: `SaveFile*()` still follows original convention, returning true on success...
2026-06-03 21:07:07 +02:00
Ray
1a4445f510 Renamed parameters to align with internal implementations 2026-06-03 21:03:47 +02:00
Ray
2c690425c9 Reviewed comments, remove article usage 2026-06-03 21:02:59 +02:00
Ray
ee71f0f870 REVIEWED: GetPixelColor() const 2026-06-03 21:00:34 +02:00
Ray
cef7718468 RENAMED: Some Rectangle parameters with more descriptive names 2026-06-03 20:16:12 +02:00
Ray
f421b74c0f Revert "Enable GPU skinning for GL 3.3+, (#5902)"
This reverts commit f1d602029c.
2026-06-01 20:42:48 +02:00
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