Commit Graph

9830 Commits

Author SHA1 Message Date
Colin James Wood
080f5c94bd [rlsw][rcore_drm] Silence warnings when using PLATFORM_DRM and GRAPHICS_API_OPENGL_SOFTWARE (#5839)
* fix warnings: goto label not used outside of SW_ENABLE_DEPTH_TEST

* comment out x coordinates that aren't used in SW_RASTER_TRIANGLE

* silence warnings: unused DrmModeConnector functions in rcore_drm.c when using GRAPHICS_API_OPENGL_SOFTWARE
2026-05-07 15:17:20 +02:00
Jens Roth
7207c03c72 [rlsw] ESP32 optimizations (#5827)
* [rlsw] Add sw_rcp helper using Xtensa recip0.s for hot-path divisions

Adds a `sw_rcp(x)` inline reciprocal that on Xtensa (ESP32 / ESP32-S3
LX6/LX7) emits a `recip0.s` seed plus two Newton-Raphson refinement
steps -- 1-ULP accurate in ~7 instructions, all in FPU registers.
On every other target it expands to plain `1.0f/x`, so generated code
is byte-identical to before for non-Xtensa builds.

Replaces the hot-path `1.0f/x` calls that were previously compiling to
the `__divsf3` software helper on Xtensa:

  - perspective divide (1/w) in triangle clip-and-project (PCT and PC paths)
  - line and point clip-and-project NDC conversion
  - triangle span setup: dxRcp, blockLenRcp, wRcpA, wRcpB
  - triangle scanline setup: h02Rcp, h01Rcp, h12Rcp
  - axis-aligned quad: wRcp, hRcp
  - line rasterizer: stepRcp

Other `1.0f/x` uses (matrix translate/normalize, texture init `tx`/`ty`,
sw_matrix_rotate inverse-length) are not on the per-pixel hot path and
are left untouched.

Measured on ESP32-S3 @ 240 MHz, R5G6B5 240x240, textured 3D model:
contributes to a ~10-15% rasterization speedup.

Made-with: Cursor

* [rlsw] Use ESP-DSP for 4x4 matrix multiply and per-vertex MVP transform

Adds an opt-in ESP-DSP code path for ESP32 / ESP32-S3 builds. ESP-DSP is
ESP-IDF's official optimized math library and ships hand-vectorized
kernels that beat the scalar implementations on Xtensa.

Two integration points:

  1. `sw_matrix_mul_rst` -> `dspm_mult_4x4x4_f32` for any 4x4*4x4 multiply
     (used for MVP build, gluLookAt, push/multiply, etc.). rlsw stores
     matrices column-major and ESP-DSP reads row-major; the comment on the
     call site explains why the flat-buffer call still produces the
     correct column-major product (transpose-of-transposes equivalence).

  2. `sw_immediate_push_vertex` -> `dspm_mult_4x4x1_f32` for the per-vertex
     clip-space transform. Because ESP-DSP expects a row-major matrix in
     this case, a row-major copy `matMVP_rm[16]` is maintained alongside
     `matMVP` and refreshed once per `isDirtyMVP` rebuild in
     `sw_immediate_begin`. Cost is 16 scalar copies per matrix update,
     amortized over thousands of vertices per frame.

Detection is **opt-in** via `SW_USE_ESP_DSP` so existing ESP-IDF projects
that don't depend on the `esp-dsp` component keep building unchanged.
A user enables it from CMakeLists.txt (or anywhere before including
rlgl.h):

    target_compile_definitions(${COMPONENT_LIB} PRIVATE SW_USE_ESP_DSP=1)

and adds the dependency to `idf_component.yml`:

    espressif/esp-dsp: "^1.4.0"

Measured on ESP32-S3 @ 240 MHz, R5G6B5 240x240, textured 3D model:
contributes meaningfully to the overall frame-time improvement
(combined with sw_rcp).

Made-with: Cursor

* [rlsw] Add SW_TEXTURE_REPEAT_POT_FAST opt-in for POT bitmask wrap

Adds an opt-in compile-time flag that replaces the SW_REPEAT wrap chain
with a bitmask (`x & (size-1)`) for power-of-two textures. NPOT textures
keep using the original `sw_fract` / signed-modulo paths via a runtime
`(size & (size-1)) == 0` check, so SW_REPEAT remains correct for them.

Affects two samplers:

  - `sw_texture_sample_nearest`: drops the `floorf` + multiply + cast for
    POT textures in REPEAT mode (saves a software call on Xtensa).
  - `sw_texture_sample_linear`: replaces the `(x % w + w) % w` two-step
    modulo (a software divide on Xtensa) with a single bitwise AND for
    POT textures in REPEAT mode. Two's-complement int wrap covers
    negative coordinates correctly.

Off by default: for POT textures sampled with negative UVs, bitmask wrap
can differ from `sw_fract` wrap by one texel at the boundary. That is
imperceptible at typical resolutions but technically a behavior change,
so existing users get bit-for-bit identical output. Opt in if you
control your asset UVs and want the speedup:

    #define SW_TEXTURE_REPEAT_POT_FAST

This addresses the long-standing TODO comment "If the textures are POT,
avoid the division for SW_REPEAT" in `sw_texture_sample_linear`.

Made-with: Cursor
2026-05-06 12:38:52 +02:00
Ray
cf9f27db54 Update raymath.h 2026-05-02 09:09:50 +02:00
Ray
0a2b81b128 Update rcore_web.c 2026-05-02 09:09:40 +02:00
Tanguy
05c15c8ba7 SDL: Use precise mouse wheel values (#5830) 2026-05-01 19:29:51 +02:00
Lam Wei Lun
d768dae402 [build] Shift __cplusplus check to a higher level for bool type define (#5804)
* Adds a missing macro definition check

* Shifts __cplusplus check to a higher level for bool define

* Copy same change to rgestures.h and rlgl.h

* Fixes float comparison issues in raymath functions

* Revert "Fixes float comparison issues in raymath functions"

This reverts commit a266d0bbaa.
2026-04-29 18:02:49 +02:00
alphahex99
d580c47504 [raymath.h] Add missing (float * Vector) operator overloads (#5815) 2026-04-29 17:49:23 +02:00
LLM Vector Engineer
7b7ded566c Fix directory navigation in core_directory_files (#5823)
Co-authored-by: zhanlong9890 <lichuang59559890@gmail.com>
2026-04-29 17:45:25 +02:00
Ray
d9427b1e6f REVIEWED: Avoid static variable floating around and include it to PlatformData struct 2026-04-29 17:42:51 +02:00
nate
da55d9067c added NPOT check to rlLoadTexture to match rlGenTextureMipmaps and WebGL 1.0 standard (#5820) 2026-04-29 08:43:50 +02:00
Jeremiah Donley
e5702a716f Update DenoRaylib550 to Deno-Raylib with version 6.0 (#5821) 2026-04-29 08:41:48 +02:00
Ray
2dd8d7e8b1 Update rcore_desktop_sdl.c 2026-04-29 01:08:16 +02:00
Huang Zhaobin
168e2c43d0 fix(rcore): correct string boundary handling (#5812)
Co-authored-by: Huang Zhaobin <xcpky@proton.me>
2026-04-29 00:18:33 +02:00
surrealism
638c1cb339 Update BINDINGS.md (#5819)
Raylib 6.0 support has been released for C3
2026-04-28 23:10:15 +02:00
Jim Price
6a430eb834 [examples] Update build.zig to support wasm examples (#5811)
* Include resource preloads when building wasm examples with Zig.

List of resources derived from examples/Makefile.Web

* Move resource list to zon file to reduce build.zig bloat
2026-04-28 12:26:30 +02:00
Ebben Feagan
3c82b48b1f Update BINDINGS.md to reflect raylib4fb project supporting 6.0 (#5813) 2026-04-27 22:27:13 +02:00
Ray
72a341a37f Update rtext.c 2026-04-27 12:34:43 +02:00
github-actions[bot]
79d5353cfd rlparser: update raylib_api.* by CI 2026-04-27 09:48:08 +00:00
Ray
98efce4b0d WARNING: RENAMED: GetSplinePointBezierQuad() to GetSplinePointBezierQuadratic()
Consistent with similar spline functions and avoid confusion with `Quad` related functions.
2026-04-27 11:47:48 +02:00
Ray
c9c26d8071 REVIEWED: ImageColorContrast() parameter type, consistent with other Image*() functions 2026-04-27 11:46:43 +02:00
Ray
0e68f812b5 WARNING: REDESIGNED: ImageDrawRectangleLines(), consistency with DrawRectangleLines()
ADDED: `ImageDrawRectangleLinesEx()`
2026-04-27 11:45:50 +02:00
Ray
2752837839 REVIEWED: UpdateSound(), missleading parameter name! 2026-04-27 11:44:14 +02:00
github-actions[bot]
a627cd5b65 rlparser: update raylib_api.* by CI 2026-04-27 09:43:37 +00:00
Ray
361dcb2a1f WARNING: REVIEWED: DrawCapsule()/DrawCapsuleWires() parameter order
for consistency with `DrawSphere*()`
2026-04-27 11:42:53 +02:00
github-actions[bot]
5082f5a813 rlparser: update raylib_api.* by CI 2026-04-27 09:40:32 +00:00
Ray
3d2008c70b RENAMED: ImageDrawTriangleEx() to ImageDrawTriangleGradient()
For consistency with the new `DrawTriangleGradient()`
2026-04-27 11:40:14 +02:00
github-actions[bot]
a685b812d9 rlparser: update raylib_api.* by CI 2026-04-27 09:38:41 +00:00
Ray
3b70f83c7d Update raylib.h 2026-04-27 11:38:23 +02:00
Ray
a28b924f94 Merge branch 'master' of https://github.com/raysan5/raylib 2026-04-27 11:38:00 +02:00
Ray
636269f6af ADDED: DrawTriangleGradient() 2026-04-27 11:37:48 +02:00
github-actions[bot]
826ca42d83 rlparser: update raylib_api.* by CI 2026-04-27 09:36:49 +00:00
Ray
620b21bfce REVIEWED: Several functions const correctness 2026-04-27 11:36:32 +02:00
github-actions[bot]
52dc7658da rlparser: update raylib_api.* by CI 2026-04-27 09:35:19 +00:00
Ray
06621eb3b7 REVIEWED: Comments for consistency and spelling 2026-04-27 11:34:58 +02:00
Ray
3b9ee2e9f3 Merge branch 'master' of https://github.com/raysan5/raylib 2026-04-27 10:23:44 +02:00
Ray
6ae16c9895 REVIEWED: FileMove(), additional security checks 2026-04-27 10:23:28 +02:00
github-actions[bot]
aa1100817a rlparser: update raylib_api.* by CI 2026-04-27 08:23:03 +00:00
Ray
725c8b57ae Merge branch 'master' of https://github.com/raysan5/raylib 2026-04-27 10:22:42 +02:00
Ray
00f3af78e3 UPDATED: Set version to raylib 6.1-dev to avoid confusions 2026-04-27 10:22:31 +02:00
github-actions[bot]
3d3e6996b0 rlparser: update raylib_api.* by CI 2026-04-27 08:22:08 +00:00
Ray
47bb749ce9 RVIEWED: Comment to avoid invalid json gneration #5809 2026-04-27 10:21:50 +02:00
RaZe
ba72d25867 [examples] Improve core_smooth_pixelperfect (#5803)
* Improve smooth pixel-perfect example: add overscan and smoothing toggles

* Add render size
2026-04-27 10:08:12 +02:00
Jeffery Myers
8e82249f65 Update to latest DR libs to fix some warnings in MSVC (#5808) 2026-04-26 20:16:35 +02:00
Luca Duran
dff07d020c Fix FileMove from delete file if FileCopy did not work (#5806) 2026-04-26 20:15:33 +02:00
Ray
0f98d78a67 Update README.md 2026-04-25 21:02:34 +02:00
bielern
c2ea6a38b5 Fix: Add NULL check to CheckCollisionLines (#5802) 2026-04-25 19:53:34 +02:00
Steven Schveighoffer
ccc0d7452a chore(bindings): Update binding version for raylib-d to 6.0 (#5799) 2026-04-25 14:49:29 +02:00
Brett Chalupa
386eabb932 Update sola-raylib Raylib supported version to 6 (#5795)
I just published crate version 6.0.0 which supports Raylib 6's new
functions and platforms.
2026-04-24 22:22:34 +02:00
Caleb Norton
4ee2013169 various rlparser fixes (#5794) 2026-04-24 21:08:20 +02:00
Ray
d892f3ba4a Update shapes_ball_physics.c 2026-04-24 15:11:39 +02:00