Commit Graph

388 Commits

Author SHA1 Message Date
Ray
1777da9056 REVIEWED: Avoid realloc() calls, small security improvement 2025-09-01 20:37:23 +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
04a3ab0ca7 REVIEW: Added warning in case of no [rcore] backend defined 2025-08-24 11:23:15 +02:00
Ray
0dc4ba53dc Minor format tweak 2025-08-16 21:06:13 +02:00
Ray
a9970484f3 Remove trailing spaces 2025-08-14 20:37:18 +02:00
Ray
74339d2008 REVIEWED: IsFileExtension() 2025-08-13 10:43:33 +02:00
Ray
95e4494cfe ADDED: cursorLocked variable and review required code #4940 #4955 2025-08-12 11:33:58 +02:00
Ray
c6241b91a2 REVIEWED: IsFileExtension() to avoid other modules dependency #5071 2025-08-08 23:01:04 +02:00
Nikolas
7267c1c8a1 Make culling distances consistent across raylib 2025-08-05 00:15:52 +02:00
Jeffery Myers
bf536d68e1 Make GetRenderWidth and GetREnderHeight return the FBO size if one is active. 2025-08-02 08:37:11 -07:00
Ray
12f0943bd9 Update rcore.c 2025-07-30 16:07:14 +02:00
Ray
7262be85fd Minor format tweaks 2025-07-26 12:06:24 +02:00
Ray
1abac023bd Update rcore.c 2025-06-20 23:34:41 +02:00
mlorenc
518ad8b018 Fix ScanDirectoryFilesRecursively
Fixes a regression since 5.5, where `ScanDirectoryFilesRecursively` no
longer does the "recursively" part due to `path` being `static`.

The issue was once already fixed in
5530a3ceb8
but recently made it back it in.
2025-06-20 01:39:01 +02:00
Ray
59bcf680aa Code gardening... 2025-06-07 20:14:24 +02:00
M374LX
3418172617 Update comments 2025-05-29 23:01:48 -03:00
Ray
341bfb22cc REVIEWED: MAX_GAMEPAD_AXEX for consistency #4960 2025-05-29 12:25:00 +02:00
M374LX
299f5350a4 Remove unused variable 2025-05-28 19:49:57 -03:00
Ray
d7148f5f9d REDESIGNED: Base64 encoding/decoding functions
Found some issues with output size when padding required, just re-implemented both functions from scratch.
2025-05-28 17:19:19 +02:00
Ray
5ddd13b775 REVIEWED: Hexadecimal formatting to be consistent 2025-05-28 17:18:02 +02:00
Ray
afb52b19a4 WARNING: REDESIGNED: EncodeDataBase64(), NULL terminated string returned
Note that returned output size considers the NULL terminator as an additional byte.
2025-05-22 17:06:55 +02:00
Ray
f7d03efb49 REVIEWED: DecodeDataBase64(), follow convention:
- All `char *` refer to text strings
- All `unsigned char *` refer to generic byte arrays
2025-05-11 11:05:25 +02:00
Ray
693c9c292a Formatting tweaks 2025-05-10 22:45:08 +02:00
Bigfoot71
38aec920b5 makes path static in ScanDirectoryFilesRecursively 2025-05-04 14:47:52 +02:00
Bigfoot71
03988d2ce8 added a NULL check in UnloadDirectoryFiles 2025-05-04 14:46:39 +02:00
AndrewHamel111
fdb92b373b Warning to direct users to appropriate function 2025-04-15 21:08:35 -04:00
Ray
cc5739a6d7 REVIEWED: Some PRs formating 2025-04-13 20:55:38 +02:00
Jeffery Myers
60eb3a14d7 Only scale the screenshot by the DPI scale if we are doing automatic High DPI scaling, otherwise the native resolution is correct. 2025-04-10 13:59:09 -07:00
Ray
909c83fd4a Avoid path filtering on TakeScreenshot() 2025-03-25 16:22:46 +01:00
sleeptightAnsiC
8e9c3ceb57 [rcore] fix: TRACELOG upon successfully changing directory
InitWindow() prints CWD during initialization,
but ChangeDirectory() does not, which is quite confusing when you start
messing with CWD. Now said function should log similar message.
2025-03-22 21:20:17 +01:00
Ray
266fba1111 Minor tweaks 2025-03-21 17:07:55 +01:00
Ray
749a512f13 REVIEWED: ScanDirectoryFiles*() #4833 2025-03-12 12:44:40 +01:00
MykBamberg
daa2921476 [rcore] Use snprintf to prevent buffer overflow in path construction 2025-03-12 01:38:39 +01:00
Ray
4c8c72778d Remove trailing spaces 2025-03-10 17:04:29 +01:00
sleeptightAnsiC
34159399cf [rcore] fix crash in InitWindow, due to unchecked result of InitPlatform (#4803)
* [rcore] fix crash in InitWindow, due to unchecked result of InitPlatform

Check the result of InitPlatform(), if it isn't 0, report the Error
and return. This prevent crashes and allows for gracefully aborting
or recovering by checking IsWindowReady().

Partially-fixes: https://github.com/raysan5/raylib/issues/4801

* [rcore] style: store the result of InitPlatform() before checking it

Small style change that doesn't impact how the code behaves here.
Variable 'result' is not used anywhere else in this block,
it's just for compliance with Raylib's coding conventions.

Requested in PR: https://github.com/raysan5/raylib/pull/4803#discussion_r1976502788

* [rcore] use LOG_WARNING when InitPlatform() fails

...as this is preferred over LOG_ERROR.

Requested-by: https://github.com/raysan5/raylib/pull/4803#discussion_r1976651724
2025-03-02 17:05:09 +01:00
Ray
557d071fa2 Reviewed shader loading message 2025-02-25 17:50:46 +01:00
Rico P
1e2fd94209 fix linkage warnings under windows (#4766) 2025-02-24 13:54:17 +01:00
mannikim
ee946b2f16 use strstr instead of TextFindIndex (#4764) 2025-02-14 00:58:33 +01:00
Ray
74256943a4 REVIEWED: MAX_GAMEPAD_NAME_LENGTH #4695 2025-01-18 19:39:50 +01:00
Ray
2b2694a89f Fix #4680 2025-01-10 22:36:11 +01:00
Ray
fa0eada61a Update year to 2025 2025-01-01 00:02:52 +01:00
Ray
c0f2067dba REVIEWED: LoadShaderFromMemory(), use default locations for default shader #4641 2024-12-28 16:35:42 +01:00
Ray
6f0d8611fe Formating tweaks 2024-12-23 19:24:07 +01:00
Colleague Riley
58004723d8 [rcore][RGFW] Add new backend option: PLATFORM_WEB_RGFW and update RGFW (#4480)
* add PLATFORM_WEB_RGFW

* fix some bugs

* fix web_rgfw gamepad

* send fake screensize

* fix gamepad bugs (linux) | add L3 + R3 (gamepad)

* fix?

* update RGFW (again)

* update raylib (merge)

* fix xinput stuff

* delete makefile added by mistake

* update RGFW

* update RGFW (rename joystick to gamepad to avoid misunderstandings

* update RGFW (fix X11 bug)

* update RGFW

* use RL_MALLOC for RGFW

* update RGFW (fixes xdnd bug)

* fix some formating
2024-12-18 12:03:42 +01:00
Ray
6b220f2798 Review formating 2024-12-12 12:13:17 +01:00
Michael
d2cd2a0152 [rlgl][rmodels] Add instranceTransform shader location index #4538 (#4579) 2024-12-08 12:48:54 +01:00
Ray
1f45e7af76 REVIEWED: Coding conventions 2024-12-03 19:14:14 +01:00
Ray
962f1c26ff Review formatting to follow raylib conventions 2024-12-01 23:10:59 +01:00
Everton Jr.
5cc06f4ba4 [rcore]: Issue an warning instead of an error when checking SUPPORT_CLIPBOARD_IMAGE necessary support detection (#4477) 2024-11-11 19:47:25 +01:00