5203 Commits

Author SHA1 Message Date
Bruno Cabral
7db5f56e81
[cmake] export automatically raylib definitions and compile/link options (#5179) 2025-09-12 13:07:46 +02:00
Ray
8d3a4b8dd5 REVIEWED: Renamed PLATFORM_DESKTOP_SDL3 to USING_VERSION_SDL3 #5175
Avoid using a new platform flag to address one platform version
2025-09-12 13:03:28 +02:00
Ray
d0c39db6c2 Update rlgl.h 2025-09-12 13:02:13 +02:00
Ray
5a54fc12a2 REVIEWED: Prioritize calloc() calls than malloc() on some cases 2025-09-10 21:03:06 +02:00
Ray
1b9aa0bcf3 Update rmodels.c 2025-09-09 17:30:18 +02:00
Ray
446f015ac5 Review formating 2025-09-05 23:10:13 +02:00
Eike Decker
bd810368b0
Fixing base64 decoding error when input string is bad (#5170)
The following code would crash the previous version when calling MemFree:

	// 53 * A
        const char maliciousBase64Input[] = "AAAAAAAAAAAAAAAAAAAAAAAA"
		"AAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
        int decodedSize = 0;
        unsigned char *decodedData = DecodeDataBase64(
		maliciousBase64Input, &decodedSize);
        if (decodedData) {
		MemFree(decodedData);
        }

The reason is a lack of array bound checks in the decoding loop, which
corrupted here the heap (though this is platform dependent).

Adding the bound checks here prevents the memory corruption.

Tested with encoding random data of sizes 0-1023 and comparing it
with the decoded result.
2025-09-05 23:05:08 +02:00
Ray
8e52aee853 Update rtext.c 2025-09-05 00:13:32 +02:00
Ray
51aa8776bb Update rtext.c 2025-09-04 23:53:26 +02:00
Ray
0203a47bf9 REDESIGNED: LoadTextLines()/UnloadTextLines() 2025-09-04 23:25:42 +02:00
Ray
ba046a5d60 REVIEWED: DecompressData(), fixed buffer copying 2025-09-04 10:44:20 +02:00
Ray
64641c6a01 Update raudio.c 2025-09-04 10:33:26 +02:00
Ray
48eac60171 REVIEWED: Potential issue with animated normals on OpenGL 1.1 2025-09-03 23:14:58 +02:00
Ray
2cb387b50a REVIEWED: Font atlas image generation, added some comments #5141 2025-09-03 18:30:00 +02:00
Ray
f53cd449ce
Update config.h 2025-09-03 18:25:27 +02:00
Ray
d1768d387c Update utils.c 2025-09-03 13:37:08 +02:00
Ray
1fa3c15942 Revert "add const qualifier to the first arg of TextJoin (#5166)"
This reverts commit 4e8d08523fb7c62bce68cd0a2e11d926bf632e79.
2025-09-02 19:00:22 +02:00
JohnnyCena123
4e8d08523f
add const qualifier to the first arg of TextJoin (#5166)
* add const qualifier to the first arg of TextJoin

* Update raylib_api.* by CI

* Update raylib.h

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ray <raysan5@gmail.com>
2025-09-02 18:58:39 +02:00
Ray
29ce5d8aa9 WARNING: BREAKING: LoadFontData() redesigned, added parameter
This redesign is a big improvement on font loading time and memory requirements. It only loads glyphs available on font from requested codepoints and only processes those glyphs for packaging. When processing +10K codepoints (CJK), the loading time improves considerably.
2025-09-02 17:45:39 +02:00
Ray
aa475b1046 REVIEWED: Code sections description for consistency 2025-09-02 12:34:04 +02:00
Ray
8f32c502a7 REVIEWED: Code sections definition 2025-09-02 12:10:40 +02:00
Ray
1777da9056 REVIEWED: Avoid realloc() calls, small security improvement 2025-09-01 20:37:23 +02:00
Ray
708c1539e4 Update rtextures.c 2025-09-01 11:38:57 +02:00
Ray
0a92c863c4 Reverted const codepoints to avoid warnings 2025-09-01 11:27:11 +02:00
Ray
12ce72c32d REVIEWED: ExportImage() 2025-09-01 11:24:53 +02:00
wileyanderssen
998a18b641
removed macro that does nothing (#5163) 2025-09-01 11:17:51 +02:00
0_stamina
7d07d21ee5
Update Camera3D.fovy description in raylib.h (#5164)
Previously stated it was the near plane width in orthographic, in actuality it's the height. The wording has been fixed, with added clarity that it's in world units so no conversion is needed.
2025-09-01 07:56:31 +02:00
Jonathan Marler
f61c2c504d
[rcore][win32] Adding native win32 backend (#4869)
* win32 backend

* [rcore][win32] use SwapBuffers instead of wglSwapLayerBuffers

I don't understand OpenGL well enough to know the difference between
SwapBuffers and wglSwapLayerBuffers but the former seems to double
my FPS (from 2000 to about 4000 in core_vr_simulator).

* [rcore][win32] stop lying to the OS about when our window is updated

Instead of calling BeginPaint/EndPaint in WM_PAINT which signals to the
OS that our window content is updated, now when we encounter the WM_PAINT
message instead we return back to the raylib application which will
trigger it to render a new frame. We've replaced the call to BeginPaint
and EndPaint with a call to ValidateRect in SwapBuffers, which, means
we're now correctly telling the OS when our window content is actually
up-to-date.

Note that this doesn't fix the window content not being updated during
a window resize/move beacuse thos have their own message loop which
doesn't return early when it's time to paint.

* [rcore][win32] fallback to finding functions from opengl32.dll

* [rcore][win32] fixes from review/for gcc

* [rcore][win32] incorporate style conventions

* [rcore][win32] workaround unused function error SetupFramebuffer

* [rcore][win32] re-enable sanitize flags check for MSAA_4X

* [rcore][win32] more style changes and remove old DPI cases

Added some more missing spaces after conditional statements.  Also
made unsupported MSAA_4X an assert instead of an abort and also
removed dpi-aware cases for older OS's.  More changes would be needed
to support those OS versions, namely, removing the dependency
on shcore.

* [rcore][win32] fixes for compling with w64devkit without -DUNICODE

* Update build.zig

* Update build.zig

---------

Co-authored-by: Ray <raysan5@gmail.com>
2025-08-31 12:13:21 +02:00
Ray
ecf032fe4f REVIEW: Avoid warning on fgets() return value 2025-08-31 12:11:48 +02:00
Ray
edce3d41b2 REVERT: Making codepoints const, variable is used to generate list in case it was NULL 2025-08-31 12:11:03 +02:00
Ray
ecedf40da6 REVIEW: const for codepoints arrays passed to function #5159 2025-08-31 11:39:14 +02:00
wileyanderssen
fce888c0c0
changed function params formatting (#5160) 2025-08-31 11:34:39 +02:00
maiphi
d9cb078299
FindNearestConnectorMode: prefer mode with smallest number of unused pixels (#5158)
Co-authored-by: Philipp Maierhoefer <particle@maierhoefer.net>
2025-08-31 11:34:05 +02:00
Ray
bbf884d7b3 Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-29 21:32:34 +02:00
Ray
f0e49787cd minor tweak 2025-08-29 21:32:21 +02:00
JohnnyCena123
0e73e0ea64
reviewed ALL non-external files to follow raylib's convention of no spaces around / or * (#5153) 2025-08-29 14:53:16 +02:00
JohnnyCena123
481daf2423
remove extra backslash in fix_win32_compatibility.h (#5148) 2025-08-28 22:30:25 +02:00
JohnnyCena123
4a4997c615
fix unnecessary warnings in some files (#5152) 2025-08-28 22:28:56 +02:00
Ray
d2f6c4924c ADDED: [rtext] LoadTextLines()/UnloadTextLines() 2025-08-26 10:17:33 +02:00
Ray
04a3ab0ca7 REVIEW: Added warning in case of no [rcore] backend defined 2025-08-24 11:23:15 +02:00
Ray
52980c947d REVIEWED: [rtext] Provide more detailed info on glyphs failing to pack #5141 2025-08-24 11:07:55 +02:00
Siltnamis
3c9c66e72b use RL_MALLOC in stb_truetype 2025-08-23 13:10:27 +03:00
Andreas Rossberg
2deae294c6
[raudio] Properly close FLAC in UnloadMusicStream
Fix  raysan5/raylib#5131.
2025-08-21 13:02:19 +02:00
Ray
99cb82a82c REVIEWED: [rmodels] LoadGLFT(), avoid loading attributes already loaded, issue a warning. FIX: #4996 2025-08-20 16:39:45 +02:00
Ray
5b88e4fe5f
Merge pull request #5124 from JeffM2501/fix_win32_compatibility
[utility] Add helper header to fix compatibility with windows.h
2025-08-19 20:18:00 +02:00
Jeffery Myers
15baf176b2 Add a utility header to external that undefines the parts of windows that conflict with raylib, allowing raylib functions to run unimpeded 2025-08-19 10:39:38 -07:00
Jeffery Myers
572230c8ad Initialize sound alias properties as if it was a new sound 2025-08-19 08:16:20 -07:00
Jan Beukes
8772b0287c Fix SDL3 compilation error with gcc 2025-08-17 23:44:37 +02:00
λxy.x
16bd18070f Fix SDL3 build if using package 2025-08-17 11:11:54 +03:00
Ray
0dc4ba53dc Minor format tweak 2025-08-16 21:06:13 +02:00