2679 Commits

Author SHA1 Message Date
Ray
2a295210fb Update shaders_spotlight.c 2025-09-03 19:58:38 +02:00
Ray
1008066644 Removed core_loading_thread project 2025-09-03 19:58:26 +02:00
Ray
a7e62e73d8 REXM: REMOVE: example: core_loading_thread
This example was POSIX only and had some special requirements for web, it made it more difficult to be managed from collection standard examples format.

It will be re-added in the `others` category, that is not processed for web.
2025-09-03 19:00:33 +02:00
Ray
5cbe013273 REXM: RENAME: example: models_skybox --> models_skybox_rendering 2025-09-03 18:48:20 +02:00
Ray
d8ee8a45c4 REXM: RENAME: example: textures_draw_tiled --> textures_tiled_drawing 2025-09-03 18:45:50 +02:00
Ray
33327760f1 REXM: RENAME: example: text_draw_3d --> text_3d_drawing 2025-09-03 18:43:17 +02:00
Ray
785ad4015c REXM: RENAME: example: textures_polygon --> textures_polygon_drawing 2025-09-03 18:40:53 +02:00
Ray
cadd28e5a0 REXM: RENAME: example: text_raylib_fonts -> text_sprite_fonts 2025-09-03 18:33:33 +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
Nikolas
b7eda8159c [build.zig] Make X11 the default display backend instead of choosing at runtime (#5168) 2025-09-03 18:17:07 +02:00
Ray
64d6a90d48 REXM: RENAME: example: text_unicode --> text_unicode_emojis 2025-09-03 18:14:47 +02:00
Ray
3a0c8009af Update rexm.c 2025-09-03 18:14:18 +02:00
Ray
d1768d387c Update utils.c 2025-09-03 13:37:08 +02:00
Ray
c579eef4b7 REVIEWED: Examples section comments, for better organization and consistency 2025-09-03 10:40:31 +02:00
Ray
1fa3c15942 Revert "add const qualifier to the first arg of TextJoin (#5166)"
This reverts commit 4e8d08523f.
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
cb6a64843c Remove raylib logs 2025-09-02 18:52:10 +02:00
Ray
4fa8e23efc Update rexm.c 2025-09-02 18:52:00 +02:00
Ray
1dfff2252d rexm update 2025-09-02 18:44:27 +02:00
Ray
cf61a8b888 REXM: Update examples report 2025-09-02 18:38:20 +02:00
Ray
bcd46fb36b Update rexm.c 2025-09-02 18:38:04 +02:00
Ray
9fab2c8a13 REVIEWED: example: text_unicode_ranges 2025-09-02 18:34:58 +02:00
Ray
0fd5a1a3f5 REDESIGNED: example: text_unicode_ranges 2025-09-02 17:47:25 +02:00
Ray
d5ea6a87d9 Merge branch 'master' of https://github.com/raysan5/raylib 2025-09-02 17:47:13 +02:00
github-actions[bot]
17d9927a4f Update raylib_api.* by CI 2025-09-02 15:46:09 +00:00
Ray
b16d14f5ed Update text_font_sdf.c 2025-09-02 17:45:52 +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
8b3c68f8b5 Update core_random_sequence.c 2025-09-02 12:18:19 +02:00
Ray
8f32c502a7 REVIEWED: Code sections definition 2025-09-02 12:10:40 +02:00
Ray
b6ae380260 REVIEWED: Examples comments, consistent code sections 2025-09-02 12:10:16 +02:00
Ray
864459cbd2 Update core_3d_camera_fps.c 2025-09-01 20:59:37 +02:00
Ray
e18d167c8f REVIEWED: New examples added renaming, avoid duplicated .sln GUIDs 2025-09-01 20:47:59 +02:00
Ray
1777da9056 REVIEWED: Avoid realloc() calls, small security improvement 2025-09-01 20:37:23 +02:00
Ray
6226abb0d3 Merge branch 'master' of https://github.com/raysan5/raylib 2025-09-01 11:39:20 +02:00
Ray
708c1539e4 Update rtextures.c 2025-09-01 11:38:57 +02:00
github-actions[bot]
917533224f Update raylib_api.* by CI 2025-09-01 09:27:38 +00: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
github-actions[bot]
223feca13a Update raylib_api.* by CI 2025-09-01 05:56:44 +00: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
Ray
82d65e110a Update build status badges 2025-08-31 12:22:50 +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
github-actions[bot]
d7f82aa7ae Update raylib_api.* by CI 2025-08-31 10:11:18 +00: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
github-actions[bot]
f2adb0272d Update raylib_api.* by CI 2025-08-31 09:39:29 +00: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
HaxSam
0d29d8d4b1 [build.zig]: a concrete approach to build for web with zig-build (#5157) 2025-08-31 11:32:19 +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
Hamza RAHAL
507c85900f fix: [digital_clock] minute hand doesn't appear (#5151) 2025-08-28 22:32:41 +02:00
Artem V. Ageev
03617e0bdd Add raylib-ada to BINDINGS.md (#5150) 2025-08-28 22:31:39 +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
github-actions[bot]
7103703313 Update raylib_api.* by CI 2025-08-26 08:17:48 +00:00
Ray
d2f6c4924c ADDED: [rtext] LoadTextLines()/UnloadTextLines() 2025-08-26 10:17:33 +02:00
Ray
ed3b5b2649 Update rexm.c 2025-08-26 09:23:18 +02:00
Ray
42abcb9492 Updated examples init window title 2025-08-26 00:36:32 +02:00
Ray
a72b4b177b Updated examples short description 2025-08-26 00:32:24 +02:00
Ray
a67b49498f Update rexm.c 2025-08-26 00:24:01 +02:00
Ray
3b16a72302 REXM: Allow building web examples locally on Windows platform 2025-08-25 21:23:30 +02:00
Ray
6343251857 Update rexm.c 2025-08-25 21:13:44 +02:00
Ray
60ac8f2a86 Renamed example 2025-08-25 21:11:37 +02:00
Ray
47db1da9ea REXM: RENAMED: example: core_3d_fps_controller to core_3d_camera_fps 2025-08-25 20:58:09 +02:00
Ray
8b68d548c9 Reviewing some examples titles 2025-08-25 20:57:18 +02:00
Ray
b04a94d1e1 Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-25 20:56:20 +02:00
Ray
f9af011965 Update core_window_letterbox.c 2025-08-25 20:56:05 +02:00
annaymone
99c4d4b597 Add pub to compileRaylib (#5143)
This is necessary to allow for using the function in dependent `build.zig`s.
2025-08-25 00:55:13 +02:00
Ray
79497e1c88 REXM: Updated reports 2025-08-24 12:02:24 +02:00
Ray
2e95cdb2b5 Minor comment tweaks 2025-08-24 12:01:58 +02:00
Ray
c9564c0de8 Update update_examples.yml 2025-08-24 12:01:46 +02:00
JohnnyCena123
e796b00eb0 [workflows] (almost) rewrite update_examples.yml workflow (#5130)
* debug print the working directory

* trigger it on any branch (temporarily)

* nope, wrong fix

* dummy commit to trigger the workflow

* lets see if this works

* trigger the workflow when updating it

* nice typo

* add missing dollar signs

* debug list the contents of the repository

* dir/s instead of ls

* remove this, no longer needed

* backslashes maybe? windows...

* this should be a forward slash

* remove no longer needed spam

* debug check if examples dir exists

* LOG is disabled apparently

* ...

* temporarily disable this step to save time

* ubuntu maybe

* bash

* install deps

* link libc

* link libm

* now to test the rest

* emsdk is back

* add missing shaders

* Update examples collection

* add indentation

* remove emsdk cache

* ignore emsdk cache

* Update examples collection

* fix errors with the find command

* remove emsdk cache now

* i forgot to actually add it to gitignore

* fix error with git not finding anything to commit

* global config instead of repo specific

* clone raylib.com repo under the same owner as the raylib repo owner

* add proper access token

* reorganize it all

* remove non-existent example

* clone raylib.com before running rexm

* no extra slash

* Update examples collection

* copy updated examples to the right place

* remove unnecessary debug line from rexm.c

* Update examples collection

* Update examples collection

* use hardcoded absolute path to make

* add debug line

* semicolon

* fix wrong handling of make path

* fix wrong cwd

* rebuild raylib for web after installing it

* cleanuo

* conditionally push to repos, never on PR

* build rexm with make for consistency

* remove workflow run results

* add back the examples report files

* pause automatic commits

* revert makefile changes

* readd removed vs2022 project file

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-24 11:56:49 +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
Ray
4d0c3affaa REXM: Update examples and lists 2025-08-24 10:53:47 +02:00
Ray
0e5837fb86 REXM: Fixed some issues, improved make call defining base path 2025-08-24 10:53:19 +02:00
Ray
f60333d9b2 Update update_examples.yml 2025-08-23 22:19:51 +02:00
Ray
785965fcef Update update_examples.yml 2025-08-23 22:18:17 +02:00
Ray
d0e6f60ef3 Update update_examples.yml 2025-08-23 22:13:18 +02:00
Ray
6c4f220e89 Update update_examples.yml 2025-08-23 22:07:39 +02:00
Ray
c95630b7d0 Update update_examples.yml 2025-08-23 22:00:06 +02:00
Ray
e9f655d002 Update update_examples.yml 2025-08-23 21:54:09 +02:00
Ray
41211b0c8c Update update_examples.yml 2025-08-23 21:45:50 +02:00
Ray
d320a029c8 REXM: Reviewed building, using default examples Makefile/Makefile.Web 2025-08-23 21:44:28 +02:00
Ray
f83c5cb6e1 Merge pull request #5138 from maiconpintoabreu/fix-glsl100
[examples][shaders] set glsl100 back to 100
2025-08-23 14:59:32 +02:00
Maicon Santana
69021939e6 fix write_depth.fs glsl120 2025-08-23 13:06:56 +01:00
Ray
9cc9f3bbbe Merge pull request #5139 from Siltnamis/stbtt_rl_malloc
use RL_MALLOC in stb_truetype
2025-08-23 13:07:04 +02:00
Siltnamis
3c9c66e72b use RL_MALLOC in stb_truetype 2025-08-23 13:10:27 +03:00
Maicon Santana
c6d7694286 set glsl100 back to 100 2025-08-23 10:17:11 +01:00
Ray
11bf3996cf REDM: Add web metadata validation and update 2025-08-23 02:00:21 +02:00
Ray
a7aeb2f2b5 REXM: Add example build option 2025-08-23 01:59:24 +02:00
Ray
500494f791 Update core_3d_fps_controller.c 2025-08-23 00:02:19 +02:00
Ray
1d17be6c1c Merge pull request #5137 from feive7/master
Clamp camera pitch
2025-08-22 23:41:34 +02:00
Ray
ce1cd0d7e6 Merge pull request #5128 from CashWasabi/zig-0.15
[build] Update `build.zig` (breaking)
2025-08-22 08:19:35 +02:00
Marcel Ochs
566eb34ff8 Update build.zig 2025-08-21 23:15:05 +02:00
feive7
8b0cbb6f47 Clamp camera pitch 2025-08-21 11:10:13 -07:00
Ray
ce8bcb332b Using internal defined File*() functions 2025-08-21 19:37:59 +02:00
Ray
fc082edccc Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-21 19:37:10 +02:00
Ray
4e71e91a4a REXM: Replace example name on project file 2025-08-21 19:30:44 +02:00
Ray
18c50bb01b Merge pull request #5136 from alexander-nichols/fix-shader_normal_map-solution
[build] Fixed VS2022 broken build
2025-08-21 19:29:15 +02:00
Ray
09bd2df17b Merge pull request #5133 from rossberg/patch-1
[raudio] Properly close FLAC in UnloadMusicStream
2025-08-21 19:24:05 +02:00
Ray
0aa5e8169d Merge pull request #5132 from maiconpintoabreu/fix-examples
[examples][core] refactoring core_input_mouse.c to use IsCursorHidden function for consistency
2025-08-21 19:23:15 +02:00
alexander-nichols
5d9c8c365e [build] Fixed VS2022 broken build
Fixed bad references to shaders_normalmap in the project raylib\projects\VS2022\examples\shaders_normal_map.vcxproj

Changed GUID for shaders_normal_map as it coincided with that for core_3d_fps_controller {6B1A933E-71B8-4C1F-9E79-02D98830E671}
2025-08-21 17:42:07 +01:00
Andreas Rossberg
2deae294c6 [raudio] Properly close FLAC in UnloadMusicStream
Fix  raysan5/raylib#5131.
2025-08-21 13:02:19 +02:00
Maicon Santana
238163c6ca swap local variable isCursorHidden to use new method IsCursorHidden() 2025-08-21 11:31:40 +01: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
c3c33e9654 Merge pull request #5125 from JohnnyCena123/missing-vox-shaders
add missing shaders for glsl100, glsl120
2025-08-20 12:34:05 +02:00
Johnny Cena
a99649b455 remove unneeded checks 2025-08-20 12:18:51 +02:00
Johnny Cena
df200b942c add versions to new shaders 2025-08-20 12:16:57 +02:00
Johnny Cena
cb05945e76 add missing shaders 2025-08-20 12:09:30 +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
Ray
d9392b94c4 Merge pull request #5123 from JeffM2501/clean_sound_alias
[raudio] Initialize sound alias properties as if it was a new sound
2025-08-19 17:26:51 +02:00
Jeffery Myers
572230c8ad Initialize sound alias properties as if it was a new sound 2025-08-19 08:16:20 -07:00
Ray
fd44c26584 Merge pull request #5122 from JohnnyCena123/workflow-typo
fix typo in workflow name
2025-08-19 13:26:28 +02:00
Ray
0658abc64c Update text_raylib_fonts.c 2025-08-19 13:22:15 +02:00
Ray
8ba4ff2143 Renamed directory for sprite fonts 2025-08-19 13:22:04 +02:00
Ray
25d00130a8 REVIEWED: example: text_unicode_ranges 2025-08-19 13:17:50 +02:00
Johnny Cena
01c68d7e75 fix typo in workflow name 2025-08-19 12:30:07 +02:00
Ray
291042352b Merge pull request #4886 from GuvaCode/master
[examples] Possible improvements for `text_codepoints_loading`, adding ranges
2025-08-19 12:00:25 +02:00
Ray
44207b293e RENAMED: GitHub Actions files, clearer naming 2025-08-19 11:54:32 +02:00
Ray
8562841c63 Update linux_examples.yml 2025-08-19 11:51:57 +02:00
Ray
f1796ff143 Update examples_update.yml 2025-08-19 11:50:41 +02:00
Ray
4492707e0e Update webassembly.yml 2025-08-19 11:50:38 +02:00
Ray
e3d714ae41 Update GitHub Actions names 2025-08-19 11:45:19 +02:00
Ray
df886a8abb REXM: Added VS2022 project for GitHub Actions building 2025-08-19 11:38:29 +02:00
Ray
915c02adf3 Update examples_update.yml 2025-08-19 11:20:38 +02:00
Ray
f0471aaddb Update examples_update.yml 2025-08-19 11:20:19 +02:00
Ray
e38e7a8141 Update examples_update.yml 2025-08-19 11:18:38 +02:00
Ray
df1244688e Revert "Update examples collection"
This reverts commit 87d3066428.
2025-08-19 11:17:59 +02:00
github-actions[bot]
87d3066428 Update examples collection 2025-08-19 09:15:28 +00:00
Ray
8bc9f30d87 Update examples_update.yml 2025-08-19 11:14:04 +02:00
Ray
e9b1bb25ab Create examples_update.yml 2025-08-19 11:02:01 +02:00
Ray
304045c63a REXM: Allow external path definition for VS solution file 2025-08-19 11:00:22 +02:00
Ray
a3da39cd81 REXM: Store example resource paths, could be useful... 2025-08-19 10:38:07 +02:00
Ray
87731e3db4 Create rexm.rc.data 2025-08-19 10:36:59 +02:00
Ray
cf1217f5c1 Update Makefile 2025-08-19 10:36:56 +02:00
Ray
a338b9694c Update build_example_web.bat 2025-08-19 10:36:31 +02:00
Ray
1098f41885 Update parse.yml 2025-08-19 10:36:22 +02:00
Ray
b1f6ab38b5 Merge pull request #5119 from jan-beukes/master
Fix SDL3 compilation error with gcc
2025-08-18 20:43:11 +02:00
Ray
595befec40 Update models_mesh_picking.c 2025-08-18 20:37:07 +02:00
Ray
0a513e6fbe Comment unused script instructions... 2025-08-18 15:04:50 +02:00
Ray
60b46062c6 REXM: Reviewed example rename on examples.js 2025-08-18 15:00:54 +02:00
Ray
6bf8249f75 Update examples_report.md 2025-08-18 15:00:24 +02:00
Ray
a8dfd9db76 REXM: RENAMED: shaders_normalmap --> shaders_normal_map 2025-08-18 14:35:04 +02:00
Jan Beukes
8772b0287c Fix SDL3 compilation error with gcc 2025-08-17 23:44:37 +02:00
Ray
284d9ddd89 Merge pull request #5118 from slendidev/sdl3fixes
Fix SDL3 build if using package
2025-08-17 21:35:35 +02:00
Ray
dcd012e00f REXM: Generate second report with examples with issues 2025-08-17 21:32:05 +02:00
Ray
24d1d64417 REXM: REVIEWED: ScanExampleResources() avoid resources to be saved by the program 2025-08-17 21:31:05 +02:00
Ray
6da0a180e6 REXM: Using Makefile.Web for specific web versions generation, only with required resources for every example 2025-08-17 21:30:16 +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
Ray
e4dfb6dbb5 Update rl_gputex.h 2025-08-16 20:24:54 +02:00
Ray
2e652bbef1 Merge pull request #5115 from maiconpintoabreu/web_resizable_window_mouse_issue
[rcore][web] Work around to fix mouse positioning on scaled window
2025-08-15 12:51:15 +02:00
Ray
5236b2420a Update rexm.c 2025-08-15 12:43:45 +02:00
Maicon Santana
73950befca Work around to fix mouse positioning on scaled window 2025-08-15 10:57:44 +01:00
Ray
d1b535c7b8 Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-14 21:23:08 +02:00
Ray
ed06cdbbe4 Update examples_report.md 2025-08-14 21:22:57 +02:00
Ray
81615a91a6 Merge pull request #5111 from didas72/master
Adds more filters for conditional build of GetWindowHandle with GLFW
2025-08-14 21:13:27 +02:00
Ray
6252d92f79 Update rexm.c 2025-08-14 21:11:30 +02:00
Ray
a65bdd6cca REXM: Reviewed automatic validation and update -WIP- 2025-08-14 21:07:36 +02:00
Ray
afdc7972d6 REXM: Automatic validation and update of examples 2025-08-14 21:07:10 +02:00
Diogo Diniz
3ef5ee878c Adjusted formatting to comply with contribution guidelines 2025-08-14 19:58:22 +01:00
Ray
28b804a6ba REXM: Validate examples list against existing examples in repo 2025-08-14 20:38:27 +02:00
Ray
7037f131dc REVIEWED: example: core_3d_fps_controller 2025-08-14 20:37:52 +02:00
Ray
a9970484f3 Remove trailing spaces 2025-08-14 20:37:18 +02:00
Ray
be974bb67e Update CONVENTIONS.md 2025-08-14 20:36:08 +02:00
Diogo Diniz
eae1296b08 Fixed bad macro logic 2025-08-14 18:56:31 +01:00
Diogo Diniz
59c979a59d Added suggestions by planetis-m 2025-08-14 18:46:45 +01:00
Didas72
93f86fa074 fixes #5110
Adds more filters for conditional build of GetWindowHandle with glfw
2025-08-14 14:30:29 +01:00
Ray
3c9d3d9bef REXM: REVIEWED: Update examples status report when examples Updated 2025-08-13 23:54:44 +02:00
Ray
f0131f6ee6 Added missing project to solution 2025-08-13 23:53:35 +02:00
Ray
b17f00b6d9 REXM: Avoid external tool for UUIDv4 generation, implement custom function 2025-08-13 13:25:27 +02:00
Ray
ddebf5d7ac Update Makefile.Web 2025-08-13 12:34:55 +02:00
Ray
a7e66df56d Using define for buffers size 2025-08-13 12:33:38 +02:00
Ray
800be084b6 REXM: Implemented AddVSProjectToSolution() 2025-08-13 12:33:12 +02:00
Ray
ef81145776 Update examples_list.txt 2025-08-13 11:35:23 +02:00
Ray
74339d2008 REVIEWED: IsFileExtension() 2025-08-13 10:43:33 +02:00
Ray
8c7b3b7323 Update examples_report.md 2025-08-13 10:38:04 +02:00
Ray
601091b69e Update raylib.sln 2025-08-13 09:56:22 +02:00
Ray
388bc5075e Update raylib.sln 2025-08-13 08:56:50 +02:00
Ray
b7265c3df1 Update rexm.ico 2025-08-13 08:24:57 +02:00
Ray
cd1c206676 Update rl_gputex.h 2025-08-13 08:22:00 +02:00
Ray
76284f1a16 Corrected typo 2025-08-13 08:13:18 +02:00
Ray
dd19b8d2c2 REVIEWED: Requested window flags application after window initialization 2025-08-12 11:44:20 +02:00
Ray
195b968b86 Merge pull request #4837 from Andersama/support_all_window_flags_at_initialization
[rcore] Support window flags with initialization issues
2025-08-12 11:38:22 +02:00
Ray
95e4494cfe ADDED: cursorLocked variable and review required code #4940 #4955 2025-08-12 11:33:58 +02:00
Ray
c4414fa1ed Revert "Merge pull request #4945 from Moros1138/master"
This reverts commit bab234a160, reversing
changes made to 13e384ce71.
2025-08-12 10:58:56 +02:00
Ray
bab234a160 Merge pull request #4945 from Moros1138/master
[rcore][web] Review resizable canvas on `FLAG_WINDOW_RESIZABLE`
2025-08-12 10:31:12 +02:00
Ray
db2abfb9be Merge branch 'master' into master 2025-08-12 10:28:52 +02:00
Ray
13e384ce71 Merge pull request #5004 from nezvers/example_quake_controller
[examples] New example: `core_3d_fps_controller`
2025-08-12 09:54:23 +02:00
Ray
9aa1b86fdf Merge pull request #5109 from maiconpintoabreu/julia_set
[examples] Increasing julia_set maxInterations glsl100 to 255
2025-08-11 20:26:24 +02:00
Ray
503e6d8bb5 Merge branch 'master' into julia_set 2025-08-11 20:26:16 +02:00
Ray
9b598f6bcf REVIEWED: Shaders formating to follow raylib code conventions 2025-08-11 20:22:31 +02:00
Ray
8dae39fbda ADDED: Missing GLSL120 shaders 2025-08-11 20:22:02 +02:00
Maicon Santana
00f7121b1c Increasing maxInterations glsl100 to 255 to match with glsl330 and add glsl120 2025-08-11 18:16:00 +01:00
Ray
705ce45a33 FIX: Added callback broke keyboard input on web... #5107 2025-08-10 19:59:33 +02:00
Ray
9ff8862826 Merge pull request #5108 from lassade/fix-qoa-music-from-mem
fix: QOA when using with LoadMusicStreamFromMemory
2025-08-10 19:27:08 +02:00
Felipe Jorge
71b7734ce4 fix: QOA when using with LoadMusicStreamFromMemory, reduced the number of allocs and memcpy 2025-08-10 10:05:03 -03:00
Ray
e17e0933af Merge pull request #5104 from matthijskooijman/fix-ssh-backspace
Fix backspace key in Rpi SSH keyboard
2025-08-10 13:22:06 +02:00
Ray
27d7e61f28 Update rexm.c 2025-08-10 09:54:45 +02:00
Matthijs Kooijman
9582d25217 Fix backspace key in Rpi SSH keyboard
There was a typo in the generated keycode.
2025-08-09 21:04:09 +02:00
Ray
852c51343d Merge pull request #5103 from Not-Nik/raylib-zig-update
Update raylib-zig in BINDINGS.md
2025-08-09 19:08:17 +02:00
Nikolas
7bc22f71bd Update raylib-zig in BINDINGS.md 2025-08-09 19:04:00 +02:00
github-actions[bot]
60826855c4 Update raylib_api.* by CI 2025-08-08 21:09:03 +00:00
Ray
5daeffd91b Update parse.yml 2025-08-08 23:08:42 +02:00
Ray
e11bf1c978 Update Makefile 2025-08-08 23:07:08 +02:00
Ray
c6241b91a2 REVIEWED: IsFileExtension() to avoid other modules dependency #5071 2025-08-08 23:01:04 +02:00
Ray
f73b04c42c REXM: Copy examples web-build files to raylib.com 2025-08-08 21:54:15 +02:00
Ray
d6f9988e82 Update Makefile 2025-08-08 13:52:56 +02:00
Ray
c2f2878575 Merge pull request #5099 from JohnnyCena123/raysan-typo
fix typo in 'Ramon Santamaria'
2025-08-08 07:16:07 +02:00
JohnnyCena123
c25e9f641d fix typo in 'Ramon Santamaria' 2025-08-08 03:04:33 +03:00
Ray
17aec580f8 Merge pull request #5096 from wileyanderssen/master
removed unneeded comma
2025-08-07 19:01:53 +02:00
wileyanderssen
c6171d339c removed unneeded comma
hope this gets merged
2025-08-07 19:55:46 +03:00
Ray
df40357f19 Update linux.yml 2025-08-07 18:37:11 +02:00
Ray
570082deba WARNING: **NEW** raylib code CONVENTION: Comments do not end with '.' 2025-08-07 18:23:20 +02:00
Ray
6792e6e2dd Updated required files for new example: shaders_normalmap 2025-08-07 17:50:18 +02:00
Ray
2365ac8def REVIEWED: Example shaders_normalmap #5032 2025-08-07 17:31:11 +02:00
Ray
54473e2c2b REVIEWED: Example shaders_normalmap, it crashes #5032 2025-08-07 17:28:25 +02:00
Ray
47d1cc200d Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-07 17:19:39 +02:00
Ray
8da4887c2d Update examples_list.txt 2025-08-07 17:19:27 +02:00
Ray
ea3932949c Merge pull request #5032 from Sir-Irk/normalmap_example
[examples] New example: `shaders_normalmap`
2025-08-07 17:17:29 +02:00
Ray
a06962ee38 Merge branch 'master' into normalmap_example 2025-08-07 17:17:12 +02:00
Ray
c19c6fc6e0 Merge pull request #5093 from maiconpintoabreu/check-newname-category
[remx] Add check for category on new name
2025-08-07 17:14:45 +02:00
Ray
948b48430d Merge pull request #5092 from maiconpintoabreu/fix-rename-missing-newname
[remx] Add warning for missing new name to avoid segmentation fault
2025-08-07 17:13:27 +02:00
Ray
881c68e323 Merge pull request #5091 from Auios/patch-2
fix: buffer overflow in jar_mod.h memcopy
2025-08-07 17:13:00 +02:00
Ray
ca61b8d555 Merge pull request #5090 from Auios/patch-1
Remove binding link for https://github.com/Rabios/raylib-v7
2025-08-07 17:09:20 +02:00
Ray
f0889a74fe EXAMPLES: Format tweaks 2025-08-07 17:08:22 +02:00
Ray
9f07cfe0b7 Update textures_image_kernel.c 2025-08-07 17:08:02 +02:00
Ray
f02c7fca8a Update shapes_double_pendulum.c 2025-08-07 17:07:45 +02:00
Ray
d45b00b191 Update shaders_rounded_rectangle.c 2025-08-07 17:07:26 +02:00
Ray
7e597dd574 Update rlgl_compute_shader.c 2025-08-07 17:07:10 +02:00
Ray
9003cd32ba Update models_rlgl_solar_system.c 2025-08-07 17:06:50 +02:00
Ray
366887b863 Update models_loading_vox.c 2025-08-07 17:06:39 +02:00
Ray
64fbf07e7b Update audio_sound_multi.c 2025-08-07 17:06:11 +02:00
Ray
5d4a233f52 Update examples_template.c 2025-08-07 17:05:57 +02:00
Ray
fd79b44920 Create distortion.fs 2025-08-07 17:05:50 +02:00
Ray
5eacc872c7 Update README.md 2025-08-07 17:05:45 +02:00
Ray
1fadc67fb3 ADDED: Missing resources on some examples 2025-08-07 17:05:25 +02:00
Ray
ff1087480c ADDED: New projects to VS2022 solution 2025-08-07 17:04:49 +02:00
Ray
c91c185221 Update examples_report.md 2025-08-07 17:04:22 +02:00
Ray
89e6ed2697 REXM: Reviewed VS project adding to solution, no tool to do it! -WIP- 2025-08-07 17:03:54 +02:00
Maicon Santana
fa5560881e Check for category on new name 2025-08-07 12:39:12 +01:00
Maicon Santana
36dc70443a Add warning for missing new name to avoid segmentation fault 2025-08-07 12:01:21 +01:00
Connor O'Connor
1c2ecfd6ab fix: buffer overflow in jar_mod.h memcopy 2025-08-06 23:13:05 -04:00
Connor O'Connor
5dc304b5a7 Remove binding link for https://github.com/Rabios/raylib-v7
This repo (and user) does not exist. Remove it.
2025-08-06 22:41:37 -04:00
Ray
a6f29e4f19 Update examples_report.md 2025-08-06 18:42:33 +02:00
Ray
b3513e4719 ADDED: Missing example VS2022 projects 2025-08-06 18:42:27 +02:00
Ray
c3a4217148 Update rexm.c 2025-08-06 18:25:58 +02:00
Ray
533f06109d Update README.md 2025-08-06 18:23:42 +02:00
Ray
c6f8f06f7e Update rexm.c 2025-08-06 18:20:34 +02:00
Ray
f64d405ef3 Update Makefile.Web 2025-08-06 18:18:39 +02:00
Ray
c477c68419 REXM: Automatically fix not found VS2022 project / solution 2025-08-06 18:14:52 +02:00
Ray
2878f7db22 Create examples_report.md 2025-08-06 15:43:15 +02:00
Ray
8bc1d62e88 REXM: Added legend info to report 2025-08-06 15:43:13 +02:00
Ray
59546eb54a REXM: Support examples data validation and **report generation** 2025-08-06 14:04:30 +02:00
Ray
c95fd5a803 REXM: Support paths customization with environment variables 2025-08-06 14:03:32 +02:00
Ray
c3cad65d30 Update examples_list.txt 2025-08-06 14:02:51 +02:00
Ray
095319602c REVIEWED: Compule for OpenGL 1.1 #5088 2025-08-06 13:09:56 +02:00
Ray
68a1190bf2 REXM: ADDED: Examples validation 2025-08-06 00:56:29 +02:00
Ray
64921e2d8a Merge pull request #5086 from maiconpintoabreu/ignore-compiled-rexm
[rexm] Add compiled rexm to gitignore
2025-08-05 13:18:20 +02:00
Maicon Santana
81eb48cad8 Add compiled rexm to gitignore 2025-08-05 11:44:41 +01:00
Ray
f306685469 Update rexm.c 2025-08-05 12:38:30 +02:00
Ray
99a43457e8 REXM: ADDED: Command; update to validate+update required files 2025-08-05 12:38:11 +02:00
Ray
90cf6a18da REXM: Renamed some variables 2025-08-05 12:37:11 +02:00
Ray
1f2b5d6282 Update examples_template.c 2025-08-05 10:04:54 +02:00
Ray
7b93591676 Added some notes to avoid platform-dependant .BAT scripts 2025-08-05 09:54:51 +02:00
Ray
02992ce63b UPDATE: Get example info from example header when added, to be added to collection 2025-08-05 09:54:17 +02:00
Ray
b683af298c Update examples_template.c 2025-08-05 09:40:01 +02:00
Ray
cdbe9d75ef Merge pull request #5085 from Not-Nik/culling_consistency
Make culling distances consistent across raylib
2025-08-05 00:45:47 +02:00
Nikolas
7267c1c8a1 Make culling distances consistent across raylib 2025-08-05 00:15:52 +02:00
Ray
e09c9ce281 Minor tweaks 2025-08-04 23:36:07 +02:00
Ray
945f1410d2 MOVED: rexm to tools directory 2025-08-04 23:24:43 +02:00
Ray
f5e95029b1 Update rexm.c 2025-08-04 20:44:22 +02:00
Ray
47c186dd87 WARNING: **BREAKING**: Moved raylib parser to tools/parser directory 2025-08-04 20:26:19 +02:00
Ray
cdfb9d7a0b Added some notes for example collection validation 2025-08-04 19:29:28 +02:00
Ray
a436d935f1 Update README.md 2025-08-04 19:28:07 +02:00
Ray
1293461f5e REXM: Some code reviews, README.md generation improvements 2025-08-04 19:27:48 +02:00
Ray
a457ab154e ADDED: Example resources for automatic removal
WARNING: Some of those resources could be shared by other examples in the category so for now we leave removed manual by users...
2025-08-04 18:11:57 +02:00
Ray
1f5fec851d UPDATE: Added Makefile.Web per-example target generation including used resources 2025-08-04 17:52:22 +02:00
Ray
bc0f93baea UPDATE: Added resources scanning from examples for automated copying 2025-08-04 17:51:48 +02:00
Ray
e130775e0d Updated for resources scanning system 2025-08-04 14:13:17 +02:00
Ray
80dd72ce12 REVIEWED: For automation simplification 2025-08-04 13:23:57 +02:00
Ray
d8952958db Update Makefile 2025-08-04 13:23:14 +02:00
Ray
72de562542 REVIEWED: Examples for automation processes 2025-08-04 13:23:04 +02:00
Ray
d43470a3d4 Minor comment reviews 2025-08-03 23:49:52 +02:00
Ray
d182ae7837 UPDATED: Support example removal 2025-08-03 23:32:54 +02:00
Ray
b11d089202 UPDATED: Implementing file rename requirements
Moved files update from collection to separate function
2025-08-03 22:56:15 +02:00
Ray
d194b8d503 ADDED: Some security checks to verify examples categories provided 2025-08-03 21:20:35 +02:00
Ray
8f8a5ada60 REVIEWED: Make sure environment is set in same process and not a child one 2025-08-03 21:19:55 +02:00
Ray
b4ecfb648d Merge pull request #5084 from kariem2k/fix_cmake_sdl3
Removed verbose logging on SDL3.
2025-08-03 19:53:53 +02:00
Karim Ahmed
603219d6d6 Removed verbose logging on SDL3. Happens every time the property is read! 2025-08-03 18:48:24 +01:00
Ray
c146be16cb Update rexm.c 2025-08-03 09:43:38 +02:00
Ray
6ddc9251c2 UPDATE: README.md example addition working 2025-08-03 01:18:19 +02:00
Ray
73baaeeb2e REVIEWED: LoadTextLines() 2025-08-03 01:17:50 +02:00
Ray
361e730f83 Merge pull request #5083 from JeffM2501/obj_double_load
[rModels] Don't Double Upload Meshes in LoadObj,
2025-08-03 00:29:20 +02:00
Jeff Myers
ffe76a4b67 Don't Upload Meshes in LoadObj, LoadModel will upload them. None of the other interchange format readers upload 2025-08-02 14:58:05 -07:00
Ray
1948453394 Update README.md 2025-08-02 20:11:31 +02:00
Ray
b044b52955 UPDATED: examples.js example addition working 2025-08-02 19:43:27 +02:00
Ray
528ad4964d UPDATE: Makefile example addition working 2025-08-02 19:21:36 +02:00
Ray
e76c5f7d64 Update rexm.c 2025-08-02 18:11:30 +02:00
Ray
0533987f80 Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-02 18:01:32 +02:00
Ray
e01f3f158e Remove some testing code 2025-08-02 18:01:23 +02:00
github-actions[bot]
42619ea2df Update raylib_api.* by CI 2025-08-02 16:01:00 +00:00
Ray
c60763d19e UPDATED: LoadExamplesData() to support filtering and sorting 2025-08-02 18:00:41 +02:00
Ray
1c8eef9b0b Update raylib and generate ARM64 libraries for Windows, Linux, macOS 2025-08-02 17:59:34 +02:00
Ray
d3fe9e5036 Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-02 17:58:47 +02:00
Ray
159a9eac4a Update build_example_web.bat 2025-08-02 17:58:44 +02:00
Ray
c4d733e864 Merge pull request #5082 from JeffM2501/render_target_size
[CORE} Make GetRenderWidth/Height return the FBO size if one is active
2025-08-02 17:40:37 +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
b01c8a7a90 UPDATE: Implementing examples commands -WIP- 2025-08-02 00:36:17 +02:00
Ray
a36905607c Update linux.yml 2025-08-01 20:19:35 +02:00
Ray
3e65b23f89 Update windows.yml 2025-08-01 20:10:35 +02:00
Ray
8adccfd521 Update windows.yml 2025-08-01 20:09:49 +02:00
Ray
fde3166e6a Merge pull request #5075 from killerdevildog/add-linux-arm64-builds
[build] Add ARM64 support to Linux builds
2025-08-01 20:07:56 +02:00
Ray
9477838193 ADDED: Some useful functions for examples info loading, using examples_list 2025-08-01 19:40:44 +02:00
Ray
cb91c02bea Merge branch 'master' of https://github.com/raysan5/raylib 2025-08-01 19:40:25 +02:00
Ray
a872de82ed Create examples_list, to be used by rexm or other tools for reference
NOTE: This file should be the source of truth for raylib examples collection, everything will be generated using this file as primary reference.
2025-08-01 19:39:30 +02:00
github-actions[bot]
9d07be6bde Update raylib_api.* by CI 2025-08-01 17:38:20 +00:00
Ray
234f4b2b10 Update raylib.h 2025-08-01 19:38:02 +02:00
Ray
10079e4e65 Reviewed minor formating issues 2025-08-01 18:58:24 +02:00
Ray
6b0174d034 REVIEWED: Examples Makefile to locate examples list: #EXAMPLES_LIST_* 2025-08-01 18:58:05 +02:00
Ray
9fa53aac6f Update examples_template.c 2025-08-01 18:56:54 +02:00
Ray
43bc00379c removed trailing spaces 2025-08-01 10:26:28 +02:00
Ray
ba798e9155 Merge pull request #5079 from zet23t/fixing-obj-loader-crash
[rmodels] Fixing OBJ loading crash when there are no normals present
2025-08-01 08:57:55 +02:00
Eike Decker
121c996c6e fixing OBJ loading crash when there are no normals present 2025-08-01 08:49:48 +02:00
Ray
e7bd177826 Merge pull request #5077 from lpow100/master
Added certain variable assigment to the rename option and fixed some arugment based logs
2025-08-01 01:27:43 +02:00
lpow100
65e3d67eb9 Merge branch 'master' of https://github.com/raysan5/raylib 2025-07-31 16:16:10 -07:00
lpow100
58e3c8604a Added setup for the rename command (NOT TESTED) 2025-07-31 16:16:07 -07:00
Ray
e0b58b7eee Update rexm.c 2025-08-01 01:08:31 +02:00
Ray
d88f27f08d NEW: ADDED: rexm - A simple command-line tool to manage raylib examples -WIP- 2025-08-01 00:30:01 +02:00
Ray
4b2654f851 Create examples_template.png 2025-07-31 23:55:50 +02:00
Ray
968385b5f4 Update examples_template.c 2025-07-31 23:55:46 +02:00
Ray
38ff5d00a0 Create build_example_web.bat 2025-07-31 23:55:26 +02:00
Quaylyn Rimer
11ccf11814 [build] Add ARM64 support to Linux builds
- Add ubuntu-24.04-arm runner for native ARM64 compilation
- Support building both static and shared libraries for ARM64
- Maintain backwards compatibility with existing x86/x64 builds
- Addresses issue #5051 for ARM64 pre-compiled binaries

Expected output: raylib-X.X-linux_arm64.tar.gz in releases
2025-07-30 22:40:54 -06:00
Ray
305c7a2ef9 Merge pull request #5073 from Luca-coder07/master
[examples] Add screenshot for core_basic_window_web
2025-07-31 00:26:26 +02:00
RANDRIA Luca
b273ba930b Add screenshot for core_basic_window_web
The veritable screenshot is this
2025-07-31 01:05:00 +03:00
RANDRIA Luca
756203581e Merge branch 'raysan5:master' into master 2025-07-31 01:00:02 +03:00
Ray
50acba3ce8 REVIEWED: rcore_web, cleaning and reorganizing 2025-07-30 17:31:49 +02:00
Ray
18ae6a377c Merge pull request #4956 from Moros1138/consume-keyboard-events
[rcore][web] Add `EmscriptenKeyboardCallback()` to consume key events
2025-07-30 17:03:10 +02:00
RANDRIA Luca
e662ac80d5 Merge branch 'raysan5:master' into master 2025-07-30 17:37:15 +03:00
Ray
12f0943bd9 Update rcore.c 2025-07-30 16:07:14 +02:00
Ray
b40e53f11c Remove double line spacing 2025-07-30 16:07:08 +02:00
Ray
414235dd17 Update shaders_multi_sample2d.c 2025-07-30 16:06:43 +02:00
RANDRIA Luca
37104195b4 add screenshot core_basic_window_web
There are no screenshot for this and the alt is seen
2025-07-30 16:54:06 +03:00
Ray
138010c1eb Merge branch 'master' of https://github.com/raysan5/raylib 2025-07-28 23:38:00 +02:00
Ray
5ca6bff8ca Update rl_gputex.h 2025-07-28 23:37:48 +02:00
Ray
70daf39eaf Merge pull request #5066 from lepasona/master
[glfw] Update `mappings.h`
2025-07-27 21:23:53 +02:00
Ray
47df461047 Merge pull request #5068 from lepasona/patch-1
[examples] typo: hardcoded gamepad ids in `core_input_gamepad.c`
2025-07-27 21:22:37 +02:00
lepasona
b230720842 example core_input_gamepad.c: fix hardcoded gamepad 0 2025-07-27 14:35:38 +00:00
lepasona
1da6b281de Update glfw mappings.h 2025-07-27 07:37:07 +00:00
Ray
1fc0b4955f REVIEWED: rl_gputex.h, added some info for future improvements 2025-07-26 13:36:03 +02:00
Ray
eb7f8912f8 Minor format tweaks 2025-07-26 12:50:29 +02:00
Ray
8343aed4f6 Avoid fatal errors on OBJ model loading 2025-07-26 12:50:12 +02:00
Ray
c9f9219fa6 REVIEWED: DRM cache buffers support #4988 2025-07-26 12:49:49 +02:00
Ray
5c680739bd Removed platform-specific flag from config.h #4988 2025-07-26 12:49:03 +02:00
Ray
86d9afc10c Merge pull request #4988 from rob-bits/master
[rcore][drm] Replace DRM swap buffer implementation with asynchronous page-flipping and triple framebuffer caching
2025-07-26 12:14:21 +02:00
Ray
715e174d13 Merge pull request #5062 from danilwhale/feat/get-proc-address
[rlgl] Add rlGetProcAddress
2025-07-26 12:07:43 +02:00
Ray
7262be85fd Minor format tweaks 2025-07-26 12:06:24 +02:00
Ray
4da399141a Merge pull request #5063 from kariem2k/fix_cmake_sdl3
Fixed: CMake support for SDL3
2025-07-26 11:49:05 +02:00
Ray
d7893141f3 REVIEWED: rl_gputex.h library to be usable standalone 2025-07-26 11:44:36 +02:00
Ray
94d8d7133b Merge pull request #5045 from sleeptightAnsiC/fix_gputex_logging
[rl_gputex] fix: decouple logging and memory allocation from Raylib
2025-07-26 11:25:58 +02:00
Karim Ahmed
32960af1dc Fixed:
Added CMake support for SDL3.
Now supports including SDL2 or SDL3 as a subdirectory within the project. The system will first check for SDL3, then SDL2. If neither is found, it will attempt find_package(SDL3), followed by find_package(SDL2). If all these checks fail, the process will terminate with an error.
2025-07-24 09:48:52 +01:00
Ray
9a042bc9ad Merge pull request #5061 from myQwil/zig_manual_module
[build][zig] use `addLibrary()` and set root modules manually
2025-07-23 22:13:29 +02:00
danil
d6a897e551 [rlgl]: Add rlGetProcAddress 2025-07-23 21:41:45 +03:00
Mike Will
dfa21c2d1f [build][zig] use addLibrary() and set root modules manually
These changes will be required by Zig version 0.15.0.
2025-07-23 11:56:58 -04:00
Ray
5434ae1100 Merge pull request #5057 from Joecheong2006/example-double-pendulum
[examples]: New example: `shapes_double_pendulum`
2025-07-22 21:01:31 +02:00
Joecheong2006
10fadd9185 Replaced scalar to float 2025-07-22 11:59:46 -07:00
Joecheong2006
b6ae5af4e3 Removed redefined RAD and DEG 2025-07-22 11:57:16 -07:00
Joecheong2006
8a0ab163d3 Changed to 4 spaces 2025-07-22 11:50:48 -07:00
JoeCheong
f3854cb406 Fixed typo 2025-07-22 11:39:24 -07:00
Joecheong2006
f1714a6234 [examples]: New shapes example - double pendulum 2025-07-21 14:59:51 -07:00
Ray
7b017b60d9 Move global variable to right code section 2025-07-21 10:57:21 +02:00
Ray
dedf382f64 Merge pull request #5053 from didas72/master
[rcore][linux] Fixes GetWindowHandle returning a bad handle under Linux X11
2025-07-20 21:23:32 +02:00
Didas72
36364192d5 Fixes GetWindowHandle returning a bad handle under Linux X11 2025-07-19 22:29:08 +01:00
Ray
9b6c09c32f Merge pull request #5049 from wwderw/master
[build] Update Makefile
2025-07-19 12:29:39 +02:00
wwderw
0b125a5fd7 Update Makefile
Remove .bc file removal from clean shell for windows configuration.
2025-07-19 04:54:05 -05:00
Ray
0b7dda8ab1 Merge pull request #5050 from katanya04/master
Update font load message
2025-07-19 11:44:11 +02:00
Catania
3d93b30262 Update font load message 2025-07-18 15:20:38 +02:00
Ray
78a06990c7 Merge pull request #5041 from PanicTitan/master
[example][web] Fix core_custom_frame_control.c to properly register inputs on web platform
2025-07-17 19:01:27 +02:00
Ray
82b80a6998 Review formatting, avoid variable 2025-07-17 18:49:58 +02:00
Ray
71b302846a Review formatting, avoid variable 2025-07-17 18:49:54 +02:00
Ray
8823aba9df Update rprand.h 2025-07-17 18:49:34 +02:00
Ray
6b9a685bae Merge pull request #5048 from veins1/patch-4
[raudio] Fix: music stopping early. Fix: GetMusicTimePlayed for short music
2025-07-17 18:44:29 +02:00
Ray
14582a9f06 Merge pull request #5047 from RomainPlmg/#5009-fix-colorreplace-alpha
[rtextures] Fix ImageColorReplace() alpha issue replacement
2025-07-17 18:43:10 +02:00
wwderw
093e5200d0 Update Makefile
Clean up library build for the web
2025-07-17 05:19:39 -05:00
veins1
0405de794a Fix for music stopping too early 2025-07-16 14:22:57 +00:00
veins1
d03ac97eff GetMusicTimePlayed fix for music shorter than buffer size 2025-07-16 14:18:38 +00:00
Romain Plumaugat
34af70866c [rtextures] Fix ImageColorReplace() alpha issue #5009 2025-07-15 23:19:39 +02:00
Ray
e00c5eb8b1 Merge pull request #5043 from vinnyhorgan/master
Fix warning log macro in rlgl
2025-07-15 20:20:27 +02:00
Ray
cbea2ff502 Merge pull request #5046 from maiconpintoabreu/updatestream-music
[raudio] Prevent UpdateMusicStream to run without music playing
2025-07-15 20:18:46 +02:00
Maicon Santana
3320a2c837 Fix to prevent UpdateMusicStream to run without music playing 2025-07-15 19:07:15 +01:00
katonar
8388160c32 - fixing SUPPORT_DRM_CACHE define check at the end of InitPlatform() 2025-07-15 13:58:23 +02:00
Ray
e7c043529c Merge pull request #5044 from backspaceoverload/fix-HalfToFloat
[rtextures] Fix HalfToFloat Mantissa hex value
2025-07-15 13:12:46 +02:00
sleeptightAnsiC
85bf04c7bf [rl_gputex] fix: decouple logging and memory allocation from Raylib
- make sure that src/external/rl_gputex.h uses it's own macros
    for printing warnings and allocating memory
- add few additional macros in order to decouple rl_gputex from headers
    that are being included by Raylib (e.g. *_MEMSET, *_NULL and so on)
- make sure that rl_gputex uses RL_*ALLOC, TRACELOG and RLAPI macros
    when (and only when) being included by src/rtextures.c
- replace LOG() and RL_GPUTEX_SHOW_LOG_INFO macros with: RL_GPUTEX_WARN
    and RL_GPUTEX_SHOW_WARN_INFO (this is a breaking change, but it was
    broken and unusable anyway, see:
    https://github.com/raysan5/raylib/issues/5039#issuecomment-3065732596 )
- fixes issue all issues mentioned in:
    https://github.com/raysan5/raylib/issues/5039#issuecomment-3065732596
- remove logging upon successfully saving a file; Raylib does this
    anyway and we want rl_gputex to only print WARNings upon failures;
    see: https://discord.com/channels/426912293134270465/541710686468702250/1394406734306480352
- add additional condition when saving a file; now checks for both
    fwrite() and fclose() failures; before it would warn about both,
    but only return result based on fclose()
- add some notes about the current state of compiling rl_gputex
    without depending on Raylib (spoiler: it's still broken...)
- bump rl_gputex version to 1.1 since this is a potential breaking
    change (only for people attempting to use it without Raylib)

Fixes: https://github.com/raysan5/raylib/issues/5039
Reference: https://discord.com/channels/426912293134270465/541710686468702250/1394403611852931255
2025-07-15 07:53:50 +02:00
backspaceoverload
44ebf32389 Fix HalfToFloat Mantissa hex value 2025-07-15 00:52:47 -03:00
Daniel Vincent Horgan
901afadbf1 fix warning log macro in rlgl 2025-07-14 15:36:02 +02:00
Ray
f34e240688 Merge pull request #5042 from Sir-Irk/ImageDrawLineEx_fix
[rtextures] Fix `ImageDrawLineEx()` line thickness
2025-07-14 10:30:34 +02:00
Jeremy Montgomery
fce3102f1c Remove excess comments 2025-07-14 00:11:17 -05:00
sir-irk
9f03d7c426 fixing comments 2025-07-13 23:02:02 -05:00
sir-irk
0c69c43c3a fix ImageDrawLineEx to be able to draw even numbered thicknesses 2025-07-13 22:37:41 -05:00
PanicTitan
9e908e4a76 Update core_custom_frame_control.c to work properly on web 2025-07-14 00:27:56 -03:00
Ray
20a07a65d7 Merge pull request #5037 from garrisonhh/fix-gaussian-blur
[rtextures] fix integer overflow in cast for `ImageBlurGaussian`
2025-07-10 19:06:34 +02:00
garrisonhh
8dbacafbe6 fix overflow in cast for ImageBlurGaussian 2025-07-10 12:48:29 -04:00
Ray
55a5674714 Merge pull request #5036 from sleeptightAnsiC/update_glfw_mappings_h
[glfw] update mappings.h using GenerateMappings.cmake
2025-07-10 09:02:13 +02:00
sleeptightAnsiC
930890555c [glfw] update mappings.h using GenerateMappings.cmake
I did this with the intention of fixing
https://github.com/raysan5/raylib/issues/5027
but it's hard to tell if it will help in that case or not.
Anyway, bumping the header with mappings should be done once in a while.

I haven't found any Raylib script for doing this, so here's how I did it
step-by-step with CMake rule provided by GLFW (I'm on Linux, but this
should be similar on any other POSIX system):
```sh
$ git clone https://github.com/raysan5/raylib.git
$ cd raylib/src/external/glfw/
$ cmake -B ./build -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -G "Unix Makefiles"
$ make -C ./build update_mappings
$ rm -fr ./build
```
then I checked, if any mappings were deleted (without updating) with
following shell one-liner:
```sh
  # you must be at 'raylib/src/external/glfw/' when executing this
$ for i in $(git diff ./src/mappings.h | sed -n -e 's/^-"\([0-9a-z]*\),.*$/\1/p'); do grep <./src/mappings.h "$i" > /dev/null || echo "$i"; done;
```
which gave me the following IDs:
```txt
0300000066f700000500000000000000
030000000d0f00001600000000007803
03000000efbe0000edfe000000000000
03000000786901006e70000000000000
050000005e040000e002000030110000
03000000790000000600000010010000
030000000d0f00000d00000000010000
030000000d0f0000d800000072056800
03000000c0160000dc27000001010000
030000008916000000fd000024010000
```
I have checked all those IDs with `git log -p` against
https://github.com/mdqinc/SDL_GameControllerDB
and it seems that all of them were deleted by upstream (I was afraid that
maybe some mappings were added manually by a Raylib contributor and then
overwritten by my patch, but they weren't; All good!)
2025-07-10 01:37:25 +02:00
Ray
defbeee1a7 Merge pull request #5020 from Emil2010/master
update dr_libs
2025-07-08 21:45:17 +02:00
Ray
d972582bc7 Merge pull request #5025 from zedeckj/master
Fixed typo in example
2025-07-08 21:43:54 +02:00
Ray
5957564983 Merge pull request #5026 from jonathandw743/sdlfix
fixed compile error for PLATFORM sdl
2025-07-08 21:43:30 +02:00
Ray
eaea8e0b0a Merge pull request #5033 from wwderw/master
Update raudio.c
2025-07-08 21:42:47 +02:00
wwderw
8ef51850bf Update raudio.c
Allow for the use of raudio stand alone
2025-07-08 08:51:33 -05:00
sir-irk
32026ca78b fix preview image file name 2025-07-08 06:34:25 -05:00
sir-irk
86d2db2aa9 fix typo on UI and preview image 2025-07-08 05:51:14 -05:00
sir-irk
9a578dbce0 fix formatting 2025-07-08 05:47:11 -05:00
sir-irk
a94feef6d0 update readme 2025-07-08 05:36:39 -05:00
sir-irk
897a8fbc9f adding preview image 2025-07-08 05:28:15 -05:00
sir-irk
510dc763e9 adding normal map example 2025-07-08 05:05:30 -05:00
Ray
a92f67bf34 Merge pull request #5031 from AmityWilder/safety-comments
Safety Comments for Sound/Texture Update Functions
2025-07-08 08:49:11 +02:00
Amy Wilder
205b6a0926 Merge branch 'raysan5:master' into safety-comments 2025-07-07 21:52:54 -04:00
github-actions[bot]
9f6d37ecb4 Update raylib_api.* by CI 2025-07-08 01:51:52 +00:00
Amy Wilder
d4f09984ac Add safety notes to 'Update_' functions 2025-07-07 21:51:27 -04:00
katonar
5b182139ae - implementing Raylib coding convention 2025-07-07 17:55:32 +02:00
katonar
de62be0ec5 - created complier flag SUPPORT_DRM_CACHE, to enable triple buffered DRM caching 2025-07-07 17:28:23 +02:00
jonathandw743
79c29cbe24 fixed compile error for PLATFORM sdl 2025-07-06 11:36:44 +01:00
Jordan Zedeck
e91a3697ff Fixed typo 2025-07-06 01:59:03 -04:00
EmilSylveon
910f4083e1 update dr_libs 2025-07-05 00:53:01 +03:00
Ray
7f8dfc6c69 Merge pull request #5018 from maiconpintoabreu/fix-zig-wasm-win-mac
[Zig] Fix issue on zig build Emscripten run if no emsdk installed
2025-07-04 14:34:07 +02:00
Maicon
f1600a0c7e Fix issue on zig build emscripten run if the user has not installed emsdk 2025-07-04 10:24:32 +01:00
Ray
46f01e315d Merge pull request #5013 from maiconpintoabreu/zig-examples
[zig] Add run examples using zig and emscripten for web
2025-07-01 22:53:22 +02:00
Ray
2e74133a62 Merge pull request #5014 from fosskers/colin/cl-binding
docs: mention another Common Lisp binding
2025-07-01 22:52:52 +02:00
Ray
7f32b9a964 Merge pull request #5015 from Sir-Irk/gltf_model_fix
[rmodels] Fixing offset for processing tangents for GLTF/GLB loading
2025-07-01 22:50:30 +02:00
Ray
8cf932c822 Merge pull request #5016 from Sir-Irk/fix_pbr_example_tangents
[example] Fix pbr example shaders to use vec4 for vertexTangent
2025-07-01 22:48:59 +02:00
sir-irk
ed509193d9 remving w multiply on the tangent itself 2025-07-01 15:30:50 -05:00
sir-irk
f86295732a fixing shader tangents to be vec4 2025-07-01 15:18:11 -05:00
sir-irk
bee524e5e6 fixing offset for processing tangents for gltf loading 2025-07-01 13:23:05 -05:00
Maicon Santana
eef1bac3e2 fix misspelling 2025-06-30 19:38:34 +01:00
Maicon
0cae8890b8 Remove -fno-stack-protector as it is not needed and add requestFullscreen on exported methods 2025-06-30 09:54:20 +01:00
Colin Woodbury
1db006b082 docs: mention another Common Lisp binding 2025-06-30 05:40:17 +09:00
Maicon
8f50436dc9 Fix comments 2025-06-29 09:11:41 +01:00
Maicon
6e9c3acaa4 Add run examples using zig and emscripten for web 2025-06-29 09:04:58 +01:00
Ray
bdda18656b Merge pull request #5011 from maiconpintoabreu/update-emsdk-fix-touch
[zig] Update emsdk version for zig build to fix the issue with the EM_BOOL
2025-06-27 10:18:26 +02:00
Maicon
d659037fbe Update emsdk version for zig build to fix the issue with the EM_BOOL 2025-06-27 08:35:55 +01:00
Ray
c35e136471 Merge branch 'master' of https://github.com/raysan5/raylib 2025-06-24 20:11:37 +02:00
Ray
44f670899c REVIEWED: Avoid rtext dependency on rcore_desktop_sdl #4959 2025-06-24 20:11:35 +02:00
Ray
e09dcf6112 Merge pull request #5006 from ElDigoXD/patch-1
Fix typo on config.h
2025-06-24 19:53:56 +02:00
Diego Sanz
6266d0f419 Fix typo on config.h 2025-06-24 13:48:20 +02:00
Agnis Aldiņš "NeZvērs
ed022e89e5 fix preview crop 2025-06-23 16:22:14 +03:00
Agnis Aldiņš "NeZvērs
f6b7168ed4 Add preview image 2025-06-23 16:06:46 +03:00
Agnis Aldiņš "NeZvērs
fa9653d179 Fix function call 2025-06-23 13:50:24 +03:00
Agnis Aldiņš "NeZvērs
fca2317640 remove //#define PLATFORM_WEB 2025-06-23 13:44:50 +03:00
Agnis Aldiņš "NeZvērs
a2cf878190 cleanup variable shadowing 2025-06-23 13:43:38 +03:00
Agnis Aldiņš "NeZvērs
4233544670 Update core_3d_fps_controller.c 2025-06-23 13:32:08 +03:00
Agnis Aldiņš "NeZvērs
4d5a56a5f8 change game's resolution 2025-06-23 13:15:14 +03:00
Agnis Aldiņš "NeZvērs
eee9dd8c94 Example: core_3d_fps_controller
Quake like camera animations and strafe jump movement
2025-06-23 13:03:35 +03:00
Ray
b677376088 Delete shader in case compilation fails 2025-06-22 23:52:34 +02:00
Ray
1abac023bd Update rcore.c 2025-06-20 23:34:41 +02:00
Ray
8b0230f5b1 Merge pull request #5002 from mlorenc227/master
[rcore] Fix ScanDirectoryFilesRecursively
2025-06-20 23:32:31 +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
4bc8d3761c Merge pull request #4999 from danilwhale/raylib-cs.bleedingedge
bindings: add Raylib-cs.BleedingEdge
2025-06-17 16:50:14 +02:00
danil
43bad2612b docs: add Raylib-cs.BleedingEdge to the bindings 2025-06-17 17:15:09 +03:00
Ray
fd4375a74e Merge pull request #4992 from M374LX/rgfw-update
Update RGFW
2025-06-17 11:53:36 +02:00
Ray
17a618758f Merge pull request #4995 from Not-Nik/zig-raygui-options
Allow passing options to raygui in build.zig
2025-06-15 01:46:36 +02:00
Ray
abf255fbe7 Merge pull request #4993 from Marcos-cat/master
add uiua bindings to the list
2025-06-13 05:46:09 +02:00
Marcos Grzesiak
106bcf460a add uiua bindings to the list 2025-06-12 23:41:57 -04:00
M374LX
96c898852c Update RGFW 2025-06-12 19:23:12 -03:00
Ray
3e336e4470 Reviewed warning 2025-06-11 19:52:35 +02:00
Ray
59bcf680aa Code gardening... 2025-06-07 20:14:24 +02:00
Ray
8a3a8ee8e3 Update shapes_digital_clock.c 2025-06-07 20:14:10 +02:00
Ray
533c12c386 Small security tweaks 2025-06-07 15:33:35 +02:00
katonar
060bd787b1 Refactor: Replace DRM swap buffer implementation with asynchronous page-flipping and framebuffer caching
The original implementation created/destroyed framebuffers (FBs) per-frame, leading to kernel overhead and screen tearing. This commit replaces it with a different approach using:
- Asynchronous `drmModePageFlip()` with vblank sync
- Framebuffer caching to reduce repeated FB creation/removal operations
- Proper resource management through BO callbacks and buffer release synchronization
- Added error handling for busy displays, cache overflows, and flip failures
- Event-driven cleanup via page_flip_handler to prevent GPU/scanout conflicts

Co-authored-by: rob-bits
2025-06-05 15:50:07 +02:00
Ray
5f497d0687 REVIEWED: shapes_digital_clock example 2025-06-03 20:42:27 +02:00
Ray
cb369f8df7 Merge pull request #4985 from hmz-rhl/master
[examples] : adding new fancy clock
2025-06-03 20:22:08 +02:00
Hamza RAHAL
3f228f4594 [examples] : adding new fancy clock 2025-06-03 11:40:44 +02:00
Ray
8d319b1004 Merge pull request #4983 from M374LX/miniaudio-update
Update miniaudio to v0.11.22
2025-06-02 18:52:59 +02:00
Ray
d218db9eec Merge pull request #4982 from LainLayer/rgfw-timeout
Change `RGFW_window_eventWait` timeout to -1 to fix `EnableEventWaiting`
2025-06-02 18:50:11 +02:00
github-actions[bot]
59338c2c29 Update raylib_api.* by CI 2025-06-02 16:37:46 +00:00
Ray
714de02a88 Merge pull request #4980 from williewillus/pr4980
[rshapes] Fix incorrect parameter names in DrawRectangleGradientEx
2025-06-02 18:37:34 +02:00
Ray
c81097505c Merge pull request #4981 from garrisonhh/add-build-zig-zon-license
Add LICENSE to build.zig.zon
2025-06-02 18:36:11 +02:00
Ray
53faf7ae74 Merge pull request #4977 from jestarray/patch-2
add const qualifier to ImageDrawTriangleFan and ImageDrawTriangleStrip arguments
2025-06-02 18:35:08 +02:00
M374LX
bb5b5434a7 Update miniaudio to v0.11.22 2025-06-01 14:37:01 -03:00
alqeeu
51958d6e2c changed RGFW_window_eventWait timeout to -1 2025-06-01 17:37:31 +03:00
garrisonhh
b52a9f8a04 Add LICENSE to build.zig.zon 2025-06-01 10:11:42 -04:00
Vincent Lee
19ae6f2c2d [rshapes] Fix incorrect parameter names in DrawRectangleGradientEx
Examining the code shows that the rectangle is drawn winding counterclockwise, starting
with the top left. Therefore the colors used should be in the order: topLeft, bottomLeft,
bottomRight, topRight.

However, the variables actually being used are topLeft, bottomLeft, topRight,
bottomRight. I was confused by this as I was getting striping where I didn't expect any.
Put another way, the last two parameters are misnamed.

This diff swaps the parameter names and their usages. The result is that no runtime
behaviour changes: the same parameter order yields the same visual result both before and
after this change, but the parameter names now correctly reflect what they are actually
used for.

You can actually see this in the implementation of DrawRectangleGradientV, which
(correctly) passes top, bottom, bottom, top to DrawRectangleGradientEx.
2025-05-31 23:00:40 -07:00
github-actions[bot]
58a6846c8f Update raylib_api.* by CI 2025-05-31 21:26:50 +00:00
jestarray
296e3af470 add const qualifier to ImageDrawTriangleFan and ImageDrawTriangleStrip arguments 2025-05-31 14:24:56 -07:00
Ray
924c87db33 Merge pull request #4976 from M374LX/rgfw-update-dev
Update RGFW to 1.7.5-dev
2025-05-31 21:47:54 +02:00
M374LX
6eeaf1dd5b Update RGFW to 1.7.5-dev 2025-05-31 16:43:25 -03:00
Ray
c1bb53738e Merge pull request #4974 from M374LX/rgfw-escape-fix
RGFW: fix Escape always closing the window
2025-05-31 20:43:40 +02:00
Ray
9bf4388a4f Merge pull request #4965 from M374LX/rgfw-update
Update RGFW to 1.7
2025-05-31 20:42:08 +02:00
github-actions[bot]
3414d96eaf Update raylib_api.* by CI 2025-05-31 18:41:49 +00:00
Ray
20c0c92bdb Merge pull request #4963 from meowstr/master
[rshapes] Add DrawEllipseV and DrawEllipseLinesV
2025-05-31 20:41:37 +02:00
M374LX
bc2b2864e0 RGFW: fix Escape always closing the window 2025-05-31 14:24:38 -03:00
Nikolas
b26f6d34ba Allow passing options to raygui in build.zig 2025-05-30 14:30:24 +02:00
Ray
b9c2ecc447 Merge pull request #4969 from M374LX/update-comments
Update comments
2025-05-30 08:05:20 +02:00
github-actions[bot]
8f2ecfba4d Update raylib_api.* by CI 2025-05-30 02:04:09 +00:00
M374LX
3418172617 Update comments 2025-05-29 23:01:48 -03:00
Ray
015db1641f Merge pull request #4964 from M374LX/axes-comment
Update comment (gamepad axes)
2025-05-29 22:45:45 +02:00
M374LX
a9525bfbc2 Update RGFW to 1.7 2025-05-29 16:03:39 -03:00
M374LX
16f398b464 Update comment (gamepad axes) 2025-05-29 15:01:01 -03:00
Meowster
6d5aedbd38 Add DrawEllipseV and DrawEllipseLinesV 2025-05-29 07:10:52 -04:00
Ray
913c236487 REVIEWED: MAX_GAMEPAD_AXES 2025-05-29 12:51:08 +02:00
Ray
341bfb22cc REVIEWED: MAX_GAMEPAD_AXEX for consistency #4960 2025-05-29 12:25:00 +02:00
Ray
2afae1b3e1 Merge pull request #4962 from M374LX/rgfw-rctrl
RGFW backend: add missing Right Control key
2025-05-29 12:09:01 +02:00
Ray
f9fa63366c Merge pull request #4958 from M374LX/unused-var
Remove unused variable
2025-05-29 12:07:14 +02:00
M374LX
c0cf57f8f0 RGFW backend: add missing Right Control key 2025-05-28 22:38:16 -03:00
M374LX
299f5350a4 Remove unused variable 2025-05-28 19:49:57 -03:00
Moros Smith
f7fe8b88cb add EmscriptenKeyboardCallback to consume key events 2025-05-28 17:47:18 -04:00
github-actions[bot]
2d952d8e94 Update raylib_api.* by CI 2025-05-28 15:19:32 +00: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
Moros Smith
8ef6473d33 return to ray's expected resize behavior 2025-05-25 18:58:35 -04:00
Moros Smith
cf2099f18a the holy grail 2025-05-24 20:33:27 -04:00
github-actions[bot]
8d9c1cecb7 Update raylib_api.* by CI 2025-05-22 15:07:11 +00: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
21f0fe2a73 Removed some spaces 2025-05-21 19:06:04 +02:00
Ray
e3b9dbe75b Merge pull request #4947 from padmadevd/master
[rcore] Fixed bug in hovering and input for android
2025-05-19 11:59:14 +02:00
Padmadev D
b6daa48a9c Update rcore_android.c
corrected coding conventions.
2025-05-19 15:09:58 +05:30
Ray
a1d57e83f0 Merge pull request #4948 from parzivail/bug/meshnormals
Fix typo in mesh animNormals
2025-05-19 07:16:48 +02:00
Colby Newman
21e711b13f Fix typo in mesh animNormals 2025-05-18 19:35:21 -04:00
Padmadev D
5da2d10118 Update rcore_android.c
Bug Fix Update
Code to Ignore Hovering Inputs Completely
2025-05-18 18:53:28 +05:30
Ray
2be18e2c54 Merge pull request #4944 from Pivok7/master
[examples] Basic pbr example fix
2025-05-18 15:09:47 +02:00
Moros Smith
358917ffc3 trigger resize event when going into and out of fullscreen mode 2025-05-17 21:08:57 -04:00
Moros Smith
d0d42e78ea inform glfw that a change of window size has taken place 2025-05-17 21:08:35 -04:00
Moros Smith
b618d7b35b use parentElement's dimensions for width/height 2025-05-17 21:08:07 -04:00
Pivok
0ffc8c517f Pbr example fix 2025-05-17 12:32:17 +02:00
Ray
8c99a508c6 REVIEWED: WindowSizeCallback(), GLFW
It is called on window minification and setting internal width/height to 0, that can break things
2025-05-14 23:49:24 +02:00
Ray
a51d334440 Merge branch 'master' of https://github.com/raysan5/raylib 2025-05-14 23:47:32 +02:00
Ray
9d4c31533d Update rtext.c 2025-05-14 23:47:03 +02:00
Ray
15a0cf89b8 Merge pull request #4936 from lumenkeyes/master
build.zig fixes for android targets
2025-05-13 20:54:13 +02:00
Ray
ba31219141 Merge pull request #4937 from Bigfoot71/fix-gen-tangents
[rmodels] Fix and improve `GenMeshTangents`
2025-05-13 20:52:51 +02:00
Ray
5076d5743b Merge pull request #4938 from JeffM2501/const_save_callback
[utils] fix const warning with SaveFileText callback
2025-05-13 20:51:47 +02:00
github-actions[bot]
4a1e9931a6 Update raylib_api.* by CI 2025-05-13 02:55:19 +00:00
Jeffery Myers
aa684a33de make save file callback match const correctness of calling function 2025-05-12 19:54:34 -07:00
Bigfoot71
d135eef462 fix and improve GenMeshTangents 2025-05-12 23:16:06 +02:00
Lumen Keyes
6f11e27bbe fix typo 2025-05-12 11:19:08 -06:00
Lumen Keyes
dea6a24777 build.zig fix: link EGL for Android 2025-05-12 11:13:32 -06:00
github-actions[bot]
63b988ade9 Update raylib_api.* by CI 2025-05-11 09:05:50 +00: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
3083f0cd43 REVIEWED: SaveFileText(), const input text 2025-05-11 11:03:49 +02:00
Ray
693c9c292a Formatting tweaks 2025-05-10 22:45:08 +02:00
Ray
4ac31f7cde Merge pull request #4928 from JeffM2501/unload_default_font
[rtext] Properly clean up the default font on unload
2025-05-10 21:47:53 +02:00
Jeffery Myers
ebaa922f6b Properly clean up the default font on unload, it may be reused if the window is created again 2025-05-08 09:57:31 -07:00
Ray
7e07278368 Update rprand.h 2025-05-08 17:06:29 +02:00
Ray
1402e830b4 Merge pull request #4926 from karl-zylinski/draw-sphere-normals
Add normals to DrawSphereEx
2025-05-08 00:26:21 +02:00
Ray
6fad12db73 Merge pull request #4927 from lumenkeyes/master
build.zig fixes for android targets
2025-05-06 18:41:53 +02:00
lumenkeyes
35de7b26a4 catch error in build.zig 2025-05-06 10:08:12 -06:00
lumenkeyes
eae3fd83d5 properly detect if abi is android 2025-05-06 10:04:54 -06:00
lumenkeyes
c4b9c0e039 properly generate android triple in build.zig 2025-05-06 09:46:42 -06:00
Karl Zylinski
a15548fb5a Add normals to DrawSphereEx 2025-05-06 13:09:05 +02:00
Ray
3d6e24af4f Merge pull request #4906 from Bigfoot71/fix-clip
[rlgl] Proposed fix for default near/far clipping range
2025-05-06 11:12:35 +02:00
Ray
512b1bed4f Merge pull request #4925 from JeffM2501/animated_meshes_GL11
[rmodels] support CPU animation in OpenGL 1.1
2025-05-06 00:54:54 +02:00
Jeffery Myers
e07e3354a3 Merge branch 'animated_meshes_GL11' of github.com:JeffM2501/raylib into animated_meshes_GL11 2025-05-05 15:51:13 -07:00
Jeffery Myers
ee2ab11cc5 Use the animated verts and normals in GL 1.1 if they exist 2025-05-05 15:49:23 -07:00
Jeffery Myers
95c96b345c Use the animated verts and normals in GL 1.1 if they exist 2025-05-05 14:54:35 -07:00
Ray
31d63d08e2 Merge pull request #4922 from Bigfoot71/review-file-dir-2
[rcore] Some adjustments for `FilePathList`
2025-05-05 16:57:22 +02:00
Ray
a7ad2d1965 Merge pull request #4918 from JeffM2501/default_font_image_leaks
[rText] Fix issues with default font being used before InitWindow in the image API.
2025-05-05 12:06:55 +02:00
Ray
3d292a6c3c Merge pull request #4923 from JeffM2501/gltf_bone_fix
[rmodels] Fix GLTF bone weight assignments for meshes that are parented to armature bones.
2025-05-05 10:22:21 +02:00
Jeffery Myers
e53a43b7b5 Assign meshes without bone weights to the bone they are attached to so they animate. 2025-05-04 17:32:37 -07: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
Le Juez Victor
c087144385 Merge branch 'raysan5:master' into fix-clip 2025-05-04 12:29:19 +02:00
Ray
82c87d1f69 Merge pull request #4920 from MrScautHD/patch-1
Update BINDINGS.md
2025-05-04 11:41:06 +02:00
MrScautHD
8533d284c1 Update BINDINGS.md 2025-05-04 11:20:11 +02:00
Jeffery Myers
94c5de33a0 Make the default font loadable before InitWindow, for use with the image API.
Make the default font loader early out if we have already loaded parts of it, so we don't leak memory
2025-04-30 17:56:30 -07:00
Ray
3a1d6261e2 Merge pull request #4916 from daniel-abbott/audio_sound_positioning_fix
[examples] PR for #4904, calculate 'right' Vector3 to correctly perform audio positioning.
2025-04-30 19:41:15 +02:00
Daniel Abbott
696f225f29 Update audio_sound_positioning.c
Calculate `right` Vector3 for correct audio stereo positioning.
2025-04-30 10:12:35 -06:00
Ray
1ec281e86f Merge pull request #4914 from Servall4/master
[raudio] fix: GetMusicTimePlayed returns incorrect time after restarting a paused track
2025-04-28 23:13:31 +02:00
Ray
d1a3f93077 Merge pull request #4915 from rael346/cmake-replace-custom-variable
cmake: replace custom variable with built-in one
2025-04-28 23:11:56 +02:00
Duy Tran
f0de896f36 cmake: replace custom variable with built-in one 2025-04-28 11:57:53 -04:00
Ivan Ugryumov
ec5ce8c7fe Update raudio.c 2025-04-28 14:29:51 +03:00
Ray
1d020d6db1 Merge pull request #4913 from rael346/cmake-uninstall-conflict
Only create uninstall target when raylib is top level
2025-04-27 21:12:10 +02:00
Duy Tran
629d4c1721 only create uninstall target when raylib is top level 2025-04-27 14:35:30 -04:00
Ray
27a4fe8851 Merge pull request #4910 from marler8997/fixEmscripten
build.zig: fix building raylib for emscripten
2025-04-26 22:50:49 +02:00
Jonathan Marler
8d03636132 build.zig: fix building raylib for emscripten
build.zig doesn't support the examples for the emscripten OS but it does
support the raylib library. However, the examples panic if emscripten
is configured which prevents it from building the library. I've replaced
this panic with a fail step to fix this.
2025-04-26 10:37:11 -06:00
Ray
5c954c1f52 Merge pull request #4909 from gfaster/alt_fix
Revert GLFW_SCALE_FRAMEBUFFER to pre GLFW 4.3 behavior
2025-04-26 15:14:58 +02:00
Ray
7c6537a34f Merge pull request #4907 from ZeanKey/master
[example] Closes #4901, Fix Problems in 'text_draw_3d.c'
2025-04-26 15:12:44 +02:00
Gavin Rohrer
10478ff756 Revert GLFW_SCALE_FRAMEBUFFER to pre GLFW 4.3 behavior 2025-04-25 14:32:02 -04:00
Z-AKey
12bf30ce04 Merge branch 'raysan5:master' into master 2025-04-22 16:49:12 -04:00
Zean Key
77f31178ed fixed text_draw_3d 2025-04-22 16:48:50 -04:00
Le Juez Victor
461c9c9d90 review tabs 2025-04-22 15:02:09 +02:00
Le Juez Victor
a7333a9dae review near/far 2025-04-22 15:00:54 +02:00
Ray
688a81d333 Update ROADMAP.md 2025-04-20 13:15:28 +02:00
Ray
f3b68184c0 Merge pull request #4903 from JeffM2501/audio_code_formatting
[RAUDIO]Fix code formatting issue from PR #4898
2025-04-20 11:20:28 +02:00
Jeffery Myers
0f6b9ee738 format math the way ray likes it 2025-04-18 07:27:20 -07:00
Ray
b185f482d0 Merge pull request #4896 from mUnicorn/fix_bones_animation_scale
[rmodels] Fix bones animation scale
2025-04-18 10:46:00 +02:00
Ray
73030e02d4 Merge pull request #4895 from AndrewHamel111/descriptive-window-flag-warning
Add Warning to direct users to appropriate WindowState / ConfigFlag function
2025-04-18 10:43:24 +02:00
Ray
cf1713e6dd REVIEWED: VS2022 projects use a custom resource file...
...instead of relying in src/raylib provided one. #4900
2025-04-18 10:25:40 +02:00
Ray
6b85aa7f72 Merge pull request #4900 from JeffM2501/duplicate_resource
[Examples] Remove duplicate resource file
2025-04-18 10:04:49 +02:00
Ray
fdc835d294 Merge pull request #4898 from JeffM2501/better_buffer_defaults
[RAUDIO] Better computation of the default audio stream buffer size
2025-04-18 09:59:14 +02:00
Ray
f6d05cc5e6 Merge pull request #4899 from JeffM2501/examples_casting_4-26-25
[Examples] Fix cast warnings in examples.
2025-04-18 09:56:37 +02:00
Zean Key
869ae8bbd2 [example] fix text size in text_draw_3d 2025-04-17 14:40:36 -04:00
Jeffery Myers
0b37251fbd Remove duplicate resource file 2025-04-16 18:26:06 -07:00
Jeffery Myers
eb3d96a36a Fix cast warnings in examples. 2025-04-16 18:23:55 -07:00
Jeffery Myers
5185d4c427 use the device channels and sample size when computing the default buffer size. 2025-04-16 18:13:41 -07:00
d.isakov
42a40b3920 move first mesh bones calculation under check for its presense 2025-04-16 08:04:58 +02:00
d.isakov
b4f1ff9a00 #4888 fix UpdateModelAnimationBones scale transform 2025-04-16 07:49:26 +02:00
AndrewHamel111
fdb92b373b Warning to direct users to appropriate function 2025-04-15 21:08:35 -04:00
Ray
5b940692ea REVIEWED: ExportFontAsCode() not checking isGpuReady #4894 2025-04-15 13:09:44 +02:00
Ray
80fcca4155 Update rcore_desktop_glfw.c 2025-04-14 12:37:06 +02:00
Ray
cc5739a6d7 REVIEWED: Some PRs formating 2025-04-13 20:55:38 +02:00
Ray
cb111ad15e Merge pull request #4883 from JeffM2501/highdpi_screenshot
[RCORE] Fix issue with screenshots on HIGHDPI displays
2025-04-12 20:56:36 +02:00
Ray
ab901c58bb Merge pull request #4881 from Bigfoot71/raylib-sound-positioning
[examples] Add 3D sound spatialization example
2025-04-12 20:55:29 +02:00
Ray
618adb858a Merge pull request #4884 from eutro/racket-raylib-5.5
Update `racket-raylib` version in BINDING.md
2025-04-12 20:54:43 +02:00
Ray
5000f9f6f8 Merge pull request #4887 from marler8997/buildZigFormat
build.zig: run zig fmt
2025-04-12 20:52:41 +02:00
Gunko Vadim
53cbd3cb11 rename 2025-04-12 07:10:14 +05:00
Gunko Vadim
0d86084709 Update text_unicode_font_example.c
The creation of the array has been rewritten, the size of the example has been reduced
2025-04-12 07:07:14 +05:00
Jonathan Marler
3d792f3363 build.zig: run zig fmt 2025-04-11 09:44:44 -06:00
Gunko Vadim
4184a5b251 Update text_unicode_font_example.c 2025-04-11 18:43:12 +05:00
Gunko Vadim
5d7e8010a5 example unicode font
A review of the code is required.  Since I'm not sure what's written correctly at all.
2025-04-11 14:39:06 +05:00
eutro
7a6b3ebf3a Update racket-raylib version in BINDING.md 2025-04-11 00:06:18 +01: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
Bigfoot71
59dc53d20e update readme 2025-04-09 18:09:50 +02:00
Bigfoot71
d5733ffb9a update example makefiles 2025-04-09 18:09:32 +02:00
Ray
a5639bb186 Merge pull request #4861 from luis605/view-depth-texture
[examples] Added new shader example: `shader_depth_texture`
2025-04-09 17:57:20 +02:00
Bigfoot71
a554ef339b add audio_sound_positionning example 2025-04-09 17:27:45 +02:00
Ray
5aa3f0ccc3 Merge pull request #4879 from brccabral/cmake_config_verbose
[cmake] set correct description for verbose option
2025-04-07 11:30:26 +02:00
Bruno Cabral
636e239e07 [cmake] set correct description for verbose option 2025-04-06 22:33:46 -07:00
luis605
4960cc74e0 [examples] Reviewed shader view depth 2025-04-04 22:41:34 +01:00
Ray
ceb1a5ea2b REVIEWED: Temporaly fix for issue #4874 2025-04-03 18:31:05 +02:00
Ray
f4f860b343 Merge pull request #4873 from zet23t/bugfix-4872-sdl-touch-handling-error
[rcore][SDL2] First touch position is overwritten with mouse pos
2025-04-02 19:19:54 +02:00
Eike Decker
1c4aa1378f [rcore][SDL2] First touch position is overwritten with mouse pos
I believe it makes sense to only do this when there are no known
touch points. I am not even sure if this should be done at all.

See https://github.com/raysan5/raylib/issues/4872 for more information.
2025-04-01 23:10:19 +02:00
Ray
b529f52dab Merge pull request #4871 from lumenkeyes/add-zig-android-target
small build.zig fix
2025-04-01 20:00:16 +02:00
Lumen Keyes
d0cf8961d3 fix typo 2025-04-01 10:54:51 -06:00
Lumen Keyes
33b2829a89 fix android-libc.txt generation
Previously, the libc paths file `android-libc.txt` was written to
the folder from which the user ran `zig build`. This caused
problems when using raylib as a dependency in other zig
projects, since raylib is not built in the project root, but the
`android-libc.txt` file was still generated in the project root. The file
should now be generated in .zig-cache, which should fix the isssue (and
leave the project root folder cleaner).
2025-04-01 10:43:22 -06:00
Ray
11e15ab2ac Merge pull request #4870 from lumenkeyes/add-zig-android-target
Add Android Target to build.zig
2025-04-01 01:28:20 +02:00
Ray
1a67dcb578 REVIEWED: RGB order on SDL3 #3568 2025-04-01 01:26:51 +02:00
Lumen Keyes
d52687eeee Add Android Target to build.zig
Added an Android target to the zig build script.
This allows a user to easily build with only Android-supported
libraries.
Library paths are automatically inferred as much as possible.
2025-03-31 13:36:51 -06:00
Ray
d4202a09e6 Merge pull request #4868 from marler8997/coreWindowFlagsBorderless
core_window_flags example: add borderless windowed toggle
2025-03-31 19:24:55 +02:00
Jonathan Marler
f19d4c71ab core_window_flags example: add borderless windowed toggle 2025-03-31 10:23:34 -06:00
Ray
902ffde898 Merge pull request #4865 from marler8997/core_highdpi_example
[examples] Adding `core_high_dpi` example
2025-03-29 16:42:45 +01:00
Jonathan Marler
336fd78f74 Add core_highdpi example
This example enables HIGHDPI and renders a scale showing how the logical
size compares to the pixel size of the window.
2025-03-28 16:48:21 -06:00
Ray
9a049d1d27 Merge pull request #4859 from MikiZX1/master
Update rcore_desktop_sdl.c
2025-03-28 18:03:32 +01:00
Ray
61aea2495a Merge pull request #4863 from marler8997/fixImmediateRestore
Prevent immediate window restore from minimize in core_window_flags
2025-03-28 18:02:12 +01:00
Ray
57a00b09b2 Merge pull request #4862 from marler8997/coreFlagsFps
Uncomment SetTargetFPS in core_window_flags
2025-03-28 17:56:30 +01:00
Ray
1f9d7c6f88 Merge pull request #4866 from marler8997/restoreWindowDesc
Improve description of RestoreWindow
2025-03-28 17:55:45 +01:00
Jonathan Marler
af16f7823a Improve description of RestoreWindow
Restore window currently says it sets the window state to:

   "not minimized/maximized"

However, if a window is maximized and then minimized, it's typical that
it would restore back to being maximized, which is what seems to happen
from my testing. I've reworded the description to better reflect
this behavior.
2025-03-28 10:39:22 -06:00
Ray
44f4400f5b Merge pull request #4864 from marler8997/excludeRglfw
[build] only include rglfw.c for glfw platform
2025-03-27 08:30:32 +01:00
Jonathan Marler
508ca5c80f [build] only include rglfw.c for glfw platform
It looks like raylib doesn't require rglfw.c if you're using the RGFW
backend.  I'm guessing the same is true for SDL but I haven't tested.
Excluding this one file brings the raylib library down from 6.9 MB to
6.3 MB for RGFW.

However, one of the examples requires the symbols from rglfw.c,
to accomodate this I added a function that will check whether raylib has
already included rglfw and if not include it for that one example.
2025-03-26 21:14:46 -06:00
Jonathan Marler
00fb09cebf Prevent immediate window restore from minimize in core_window_flags
The core_window_flags example automatically restores the window from
being minimized after 3 seconds. However, it only resets the frameCounter
if the window is minimized through the app from inputting KEY_N.  This
means if you miminize the window by other means (like pressing the minimize
button) then the example will immediately restore the window because the
frame counter wasn't reset. I've fixed this by setting the frameCounter
back to 0 once it's expired. I also added a note in the UI that the example
automatically restores the window so it's not a surprise.
2025-03-26 20:02:03 -06:00
Jonathan Marler
8749ba9ebf Uncomment SetTargetFPS in core_window_flags
I think this line was accidently commented out in this commit:

3d1ae3500c

The FPS limit is needed to get the desired wait time for the "hide window"
test, which uses the frame counter to hide the window for 3 seconds. On
my machine without this limit it runs at over 1000 FPS and it appears
like the hide window state is broken.

I also added some text that tells the user that it only hides the window
for 3 seconds so they're not surprised when the window automatically
reappears.
2025-03-26 16:35:31 -06:00
luis605
8ec52e3b25 Added example to build system 2025-03-26 19:47:45 +00:00
luis605
eeda7a4b82 Added shaders_view_depth example to the build system 2025-03-26 17:41:04 +00:00
Ray
001e78014c Merge pull request #4860 from marler8997/fixDivide0
Avoid divide by 0 in core_custom_frame_control example
2025-03-26 18:01:37 +01:00
luis605
e08fc8ab80 Added new example - [shader] render depth texture 2025-03-26 16:59:05 +00:00
Jonathan Marler
611c43719f Avoid divide by 0 in core_custom_frame_control example 2025-03-26 10:58:59 -06:00
MikiZX1
55c6864092 Update rcore_desktop_sdl.c
raylib app crashing when started and a gamepad is already connected to the PC (even if the gamepad is not used in the app). I only tested this with a gamepad that has a layout which is not recognized. Using SDL3 as backend.
2025-03-26 14:06:58 +01:00
Ray
beaadc9185 Merge pull request #4856 from marler8997/oneBuild
[build] remove examples/build.zig, incorporate into main build.zig
2025-03-25 22:39:13 +01:00
Ray
3d83c1c796 Format tweak 2025-03-25 19:27:55 +01:00
Jonathan Marler
ac17de5074 [build] remove examples/build.zig, incorporate into main build.zig
Removes the second build.zig in the examples directory and incorporates it
into the main build.zig. This gives the zig build system the data needed to
know if the raylib library needs to be rebuilt when running any example.
2025-03-25 11:05:59 -06:00
Ray
909c83fd4a Avoid path filtering on TakeScreenshot() 2025-03-25 16:22:46 +01:00
Ray
32c8f396c2 Merge branch 'master' of https://github.com/raysan5/raylib 2025-03-25 16:21:53 +01:00
Ray
63e608d485 comment tweak 2025-03-24 15:07:36 +01:00
Ray
f5c96302d5 Merge pull request #4850 from sleeptightAnsiC/fix_rcore__ChangeDirectory_TRACELOG
[rcore] fix: TRACELOG upon successfully changing directory
2025-03-23 19:13:12 +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
46cd07d2c7 WARNING: REVERTED CHANGE THAT BROKE BATCHING!!! #4849
I'm sorry... I did not detect this change was breaking batching... :(
2025-03-21 17:17:45 +01:00
Ray
266fba1111 Minor tweaks 2025-03-21 17:07:55 +01:00
Ray
add4da8fb3 Merge pull request #4845 from bamless/log-zoom
[examples] use logarithmic zoom scaling in 2d camera examples
2025-03-20 10:38:59 +01:00
Fabrizio Pietrucci
e140aca1b5 Increase zoom factor in core_2d_camera.c
This compensate for slower zoom speed due to log scaling
2025-03-19 20:19:19 +01:00
Fabrizio Pietrucci
8b84c999d2 Use logarithmic zoom scaling in 2d camera zoom examples 2025-03-19 19:48:04 +01:00
Ray
cd9206956c Merge pull request #4843 from theundergroundsorcerer/DrawCircleSector-quickfix
Add early return when angles are equal in DrawCircleSector and DrawCircleSectorLine functions.
2025-03-18 11:29:32 +01:00
Myrddin Krustowski
589ad0a33d Add early return to circle sector functions when angles are equal.
Prevents unnecessary work and division by zero (when segments=0) in DrawCircleSector/DrawCircleSectorLines when startAngle equals endAngle, matching existing behavior in DrawRing/DrawRingLines.
2025-03-18 11:51:58 +02:00
Ray
2f63a15630 Merge pull request #4836 from JeffM2501/unscale_on_resize
[rcore] Correctly handle window size on resize in auto-scaled HIGHDPI environment
2025-03-14 17:15:14 +01:00
Jeffery Myers
d56ab670c3 spaces not tabs 2025-03-14 08:18:26 -07:00
Ray
bbbdd1f080 Merge pull request #4839 from aidonmaster/patch-1
Converting int to char
2025-03-14 08:09:49 +01:00
Aidon
513753c394 Converting int to char
Fixes warning: narrowing conversion caused by trying to convert int to unsigned char
2025-03-13 21:50:20 -03:00
Ray
cb830bed72 Increased depth size and clip distances to avoid z-fighting issues 2025-03-13 16:34:39 +01:00
Ray
d0e638cc31 REVIEWED: Platform DRM messages... 2025-03-13 11:42:16 +01:00
Alex Anderson
99a9ecfaac [rcore] Support window flags with initialization issues
This may not be the correct approach, however this appears to work. The idea is that before modifying `CORE.Window.flags` when first creating the window we keep a copy of the flags in order to call `SetWindowState` after initialization has completed, which should behave as if `MaximizeWindow` or `MinimizeWindow`, or conceptually any other flag modifying function were called after `InitWindow`.

This pull request only performs this for the windows platform, modify as needed in the switch statement at the end for others.
2025-03-12 14:56:02 -07:00
Jeffery Myers
4bed3741c1 Unscale the window size on resize if we are doing automatic HighDPI scaling. 2025-03-12 14:16:50 -07:00
Ray
749a512f13 REVIEWED: ScanDirectoryFiles*() #4833 2025-03-12 12:44:40 +01:00
Ray
654d5c80c2 Merge pull request #4833 from MykBamberg/master
[rcore] Use snprintf to prevent buffer overflow in path construction
2025-03-12 12:40:25 +01:00
Ray
a0318e67aa Merge pull request #4835 from NiamhNightglow/master
Guard against DEBUG Redefinition
2025-03-12 11:29:11 +01:00
Nia Nightglow
fffbbad2f7 Guard against DEBUG Redefinition
Undefine DEBUG to avoid external redefinition
warnings/conflicts.  This is probably a common
definition for many external build systems'
debug configurations.

This ensures raylib will not emit
a warning about the DEBUG definition being
redefined in external build systems.
2025-03-12 00:13:01 -05:00
MykBamberg
daa2921476 [rcore] Use snprintf to prevent buffer overflow in path construction 2025-03-12 01:38:39 +01:00
Ray
b80250bee4 Merge pull request #4807 from RicoP/RicoP/sinfl_bsr
[rcore] sinfl_bsr fix for TCC
2025-03-11 08:32:32 +01:00
Rico P
0934cdba48 fix C++ style cast 2025-03-11 07:09:10 +01:00
Rico P
7dc409d060 potential fix for MSVC compile error 2025-03-11 07:03:57 +01:00
Rico P
e7872a700d update sinfl_bsr 2025-03-10 20:57:48 +01:00
Ray
7f8bf2233c REVIEWED: Formating to follow raylib conventions 2025-03-10 17:08:18 +01:00
Ray
bd8e59f18d Replace size_t by unsigned int 2025-03-10 17:07:18 +01:00
Ray
4c8c72778d Remove trailing spaces 2025-03-10 17:04:29 +01:00
Ray
9c62a7823b Update Makefile 2025-03-10 17:04:14 +01:00
Colleague Riley
0853c5b03f [rcore][RGFW] bug fixes (#4798)
* update RGFW to 1.6

* properly handle RGFW_quit events

* fix rcore_desktop_rgfw bugs

* update

* update

* uncomment out
2025-03-10 16:50:40 +01:00
Amy Wilder
61a026f7ef [examples] Reorganize some conditions to fix overlap bugs (#4829)
* Reorganize some conditions to fix overlap bugs

* Fix edge case where control point selection outlives mouse down
2025-03-09 11:40:24 +01:00
Ray
5bda46960c REVIEWED: Linux workflow to run on ubuntu-latest
Previous runner `ubuntu-20.04` is deprecated and being removed soon: https://github.com/actions/runner-images/issues/11101
2025-03-08 18:49:50 +01:00
David Vanderson
bbeade636c build.zig.zon: update hashes (#4826) 2025-03-08 12:42:17 +01:00
10aded
097e80d1c4 added comment to fingerprint line per recommendation from the standard 'build.zig.zon' file generated by 'zig init' in Zig 0.14.0 (#4827) 2025-03-08 02:21:50 +01:00
sleeptightAnsiC
f430d72a8c [examples] fix: use quotation marks when including raylib.h (#4821)
...so it will always prioritize local version of raylib instead of
system-wide installations, which is a huge problem when testing any
changes done locally to raylib as it might cause silent mismatch issues.
There were only 4 examples affected by this issue which were using
`#include <raylib.h>`. Other examples use proper `#include "raylib.h"`

Fixes: https://github.com/raysan5/raylib/issues/4820
2025-03-07 19:24:53 +00:00
zewenn
590f793755 Update build.zig.zon to use the new zig v0.14 version (#4819) 2025-03-07 19:24:01 +00:00
Kaluub
9ba0cdbe6d Fix GetCurrentMonitor comments. (#4812) 2025-03-07 19:21:08 +00:00
Ashish Bhattarai
f1385f3aec Fix stb_truetype composite glyph scaling logic (#4811) 2025-03-04 18:53:11 +01:00
Ray
cb3168a048 Wow! We surpassed the **8000** commits! AMAZING! :D 2025-03-02 17:42:10 +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
Rico P
539c45ee23 sinfl_bsr fix for TCC 2025-03-02 16:20:49 +01:00
Ray
b99c2848c1 Merge branch 'master' of https://github.com/raysan5/raylib 2025-03-02 13:43:32 +01:00
Ray
654131799e Minor tweaks 2025-03-02 13:43:15 +01:00
sleeptightAnsiC
a20d9dedf3 [desktop_glfw] fix InitPlatform crash caused by glfwCreateWindow... (#4804)
...returning NULL. This was causing a crash few lines later.

Refs: https://github.com/raysan5/raylib/issues/4801#issuecomment-2691201072
Partially-fixes: https://github.com/raysan5/raylib/issues/4801
2025-03-01 23:42:07 +01:00
Bruno Cabral
eb8a343e31 [cmake] Use STATIC lib ON by default (#4799)
* search raylib in custom directory

* avoid loading dynamic library when both are installed

* raylib_USE_STATIC_LIBS as option ON
2025-02-26 07:48:59 +01:00
Colleague Riley
e4dcdfa1f2 update RGFW to 1.6 (#4795) 2025-02-25 21:49:37 +01:00
Ray
e4993c5557 Merge branch 'master' of https://github.com/raysan5/raylib 2025-02-25 17:50:54 +01:00
Ray
557d071fa2 Reviewed shader loading message 2025-02-25 17:50:46 +01:00
jordan4ibanez
7cae259a6d Reviewed shaders comment wording (#4793) 2025-02-25 14:26:52 +01:00
Ray
da8a08006a Added some comments on latest change 2025-02-25 12:46:06 +01:00
Destructor17
27af359d1c [rlgl] Preserve texture on mode switching (#4364)
* Fix textures on draw mode switch

* formatting fix

* ident
2025-02-25 12:39:00 +01:00
Ray
e1ec595251 ADDED: Resource file to example projects #4790 2025-02-25 12:06:34 +01:00
Ray
0037ee5420 Merge branch 'master' of https://github.com/raysan5/raylib 2025-02-25 11:43:32 +01:00
Ray
256953957f Update Makefile 2025-02-25 11:43:25 +01:00
Ray
a979b10966 Minor format tweak 2025-02-25 11:43:22 +01:00
Rico P
1e2fd94209 fix linkage warnings under windows (#4766) 2025-02-24 13:54:17 +01:00
Slendi
8edbd07b5e Do not check GUI libs for DRM (#4792)
Signed-off-by: Slendi <slendi@socopon.com>
2025-02-24 13:53:30 +01:00
Ray
294da26042 Update raymath.h 2025-02-23 23:07:12 +01:00
Ray
fc5ff8db5c Update raymath.h 2025-02-23 23:06:31 +01:00
Ray
a5907bfdca REVIEWED: MatrixDeterminant() #4780 2025-02-23 23:04:52 +01:00
Mario Nachbaur
85a87baf69 Support IsWindowHidden() on web. (#4789) 2025-02-23 18:19:42 +01:00
Jay Rhoden
015ab9df18 Amend comment to explain what LoadCodepoints is doing. (#4787)
As a beginner, it was not clear to me what the purpose of the LoadCodepoints function is. I am trying to help past me.
2025-02-23 18:19:10 +01:00
Peter0x44
99d2119dd6 [build] Add CI for ARM64 with Visual Studio (#4781)
* [build] Add ARM64 configuration to raylib.sln

* [build] Add ARM64 to windows.yml
2025-02-21 15:31:50 +01:00
Ralph Caraveo
4522ecae1a [raudio] Fixed memory leak on early-return of WaveFormat func (#4779)
In the case of a failure within miniaudio on the function: ma_convert_frames, the dynamic memory allocated for the `data` variable  will leak on the early return.
2025-02-21 15:29:12 +01:00
Colleague Riley
c34ef35433 Update RGFW and ensure it's consistent with the GLFW backend (#4783)
* 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

* Update RGFW

* update RGFW

* undo change

* undo change

* undo change

* undo change

* have .scroll be 0 by default

* update RGFW

* update RGFW

* update RGFW

* fix year

* fix wasm key event bug

* update RGFW

* link to IOKit

* update
2025-02-21 12:32:09 +01:00
Ray
5ea60dd3ce Minor tweaks 2025-02-20 18:10:01 +01:00
Ray
32fcfd3549 Minor tweaks 2025-02-19 13:38:22 +01:00
sleeptightAnsiC
77df0ab1e8 [rcore_desktop_glfw.c] fix: make sure that GLFW uses RL_*alloc macros (#4777)
Raylib allows for providing custom allocators via macros.
GLFW supports this too, but via function pointers.

Make sure that GLFW uses those Raylib macros, by wrapping them in
function calls and setting them up inside of InitPlatform().
This is possible because of glfwInitAllocator() and GLFWallocator.

Fixes: https://github.com/raysan5/raylib/issues/4776
Relates-to: https://github.com/raysan5/raylib/issues/4751
2025-02-18 22:53:18 +01:00
Brian E
11090ab6cb [raylib.h] Added space after comma (#4774)
args for ImageResizeNN were missing a space in the arguments after a comma, i just added one.
2025-02-17 12:12:59 +01:00
vict-Yang
b49c079b1d Fix typo in rshapes.c (#4772) 2025-02-16 15:43:32 +01:00
Le Juez Victor
2b59e7475f Implement Android-specific functions (#4769)
`GetWindowScaleDPI` and monitor physical dimensions
2025-02-15 19:34:51 +01:00
Le Juez Victor
c647d33703 Better default values for normals and tangents (VBOs) (#4763) 2025-02-14 01:00:05 +01:00
mannikim
ee946b2f16 use strstr instead of TextFindIndex (#4764) 2025-02-14 00:58:33 +01:00
veins1
1d87932d93 TextSubtext fixes (#4759)
Fix buffer write overflow
Fix reading past the end of text
2025-02-12 23:12:10 +01:00
Thomas Anderson
a1de60f3ba added missing file (#4754) 2025-02-08 11:23:15 +01:00
github-actions[bot]
a61c710b45 Update raylib_api.* by CI 2025-02-08 10:22:50 +00:00
goto40
6a644b48f0 doc: audio stream processor, number of channels (#4753)
* doc: audio stream processor

* fixed accidental encoding effect
2025-02-08 11:22:34 +01:00
Ray
cceabf6961 Formatting review 2025-02-02 13:00:20 +01:00
Ray
cfe96931f5 REVIEWED: Formatting #4739 2025-02-02 12:59:34 +01:00
Nikolas
bddb5df0d4 [rmodels] Separate GLTF roughness and metallic channels on load (#4739) 2025-02-02 12:48:18 +01:00
Gil Reis
5a254e3d5e Set PLATFORM to Web by default when configuring web builds with emcmake (#4748) 2025-02-02 12:46:28 +01:00
Henrik A. Glass
4f5a20a634 Add missing increments of k in LoadImageDataNormalized() (#4745) 2025-02-01 21:30:21 +01:00
Chris Dill
1958de4a12 Update raylib-cs binding link (#4746) 2025-02-01 21:29:27 +01:00
whaley
e85ae86f70 [platforms/glfw] fix: allow GetGamepadButtonPressed() to return GAMEPAD_BUTTON_LEFT_TRIGGER_2 / GAME_PAD_BUTTON_RIGHT_TRIGGER_2 if they are pressed (#4742) 2025-02-01 10:50:25 +01:00
sleeptightAnsiC
99dfec070a [rtext] fix: misuse of cast in GetCodepointCount (#4741)
I was really wondering what is going on here :D I believe this code
tried initially to out-cast 'const' specifier but this is not needed here
at all. Currently, it just confuses whoever reads this so I changed it.
The old code would also trigger -Wcast-qual warning on some compilers.
2025-01-31 14:44:23 +01:00
Eike Decker
1f6de0c507 Replacing hardcoded canvas id references with module variable usages (#4735)
Should also have the benefit of being faster.
2025-01-31 00:34:51 +01:00
Ray
d46ba9a671 Merge branch 'master' of https://github.com/raysan5/raylib 2025-01-28 16:19:39 +01:00
Ray
9789ff123b REVERTING: emscripten_sleep() previous removal #4713 2025-01-28 16:19:30 +01:00
Peter0x44
2492dd3d0a [build] [Makefile]: Undefine _GNU_SOURCE for rglfw.c (#4732)
Currently, a warning about _GNU_SOURCE being redefined is emitted when
compiling rglfw.c

In file included from rglfw.c:99:
external/glfw/src/posix_poll.c:27:9: warning: "_GNU_SOURCE" redefined
   27 | #define _GNU_SOURCE
      |         ^~~~~~~~~~~
<command-line>: note: this is the location of the previous definition

This can be avoided by not defining _GNU_SOURCE on the command line for
this file.

Defining feature test macros in source code is not really good practice
so this should probably reviewed in glfw itself, at least to maybe check
 #ifdef _GNU_SOURCE first. But for now this change will suffice.

Fixes #4725
2025-01-27 23:15:09 +01:00
elite0OG
5504983c91 Update CMakeLists.txt (#4727)
Cmake warn remove
2025-01-27 09:20:10 +01:00
Asdqwe
f6f31a9f21 [rtextures] Fix HalfToFloat() and FloatToHalf() dereferencing issues with an union (#4729)
* Fix HalfToFloat() and FloatToHalf() dereferencing issues with an union

* Remove unnecessary initialization

* Moved the union to inside the functions
2025-01-26 21:26:18 +01:00
Ray
53ea275b9c Merge branch 'master' of https://github.com/raysan5/raylib 2025-01-26 19:43:01 +01:00
Ray
861ebafe62 Update shaders_mesh_instancing.c 2025-01-26 19:42:52 +01:00
Asdqwe
139de05e9d [rcore] [SDL2] Fix gamepad event handling by adding joystick instance id tracking (#4724)
* Fix gamepad SDL_JOYDEVICEADDED and SDL_JOYDEVICEREMOVED event handling for PLATFORM_DESKTOP_SDL by adding joystick instance id tracking

* Fix gamepad button handling
2025-01-25 20:49:42 +01:00
Nikolas
49d37b035f [rtexture] Cubemap mipmap loading improvements (#4721)
* [rtextures] Only build cubemap mipmaps when necessary

* [rtextures] Assign correct mipmap count to cubemaps
2025-01-24 10:41:32 +01:00
Anstro Pleuton
7bfc8e8ca7 [example] Add shaders_rounded_rectangle example (#4719)
* Add shaders_rounded_rectangle example

* Minor tweaks to example template (add star, more)

* Combine shaders

* Fix changes after review

---------

Co-authored-by: Anstro Pleuton <anstropleuton@github.com>
2025-01-23 10:51:36 +01:00
Ray
87f17538d0 Reviewed warning on shared library generation for web 2025-01-21 19:23:16 +01:00
sleeptightAnsiC
322ba54c08 Fix(WEB): Makefile: throw an error when trying to build SHARED library (#4718)
When asking Makefile to create SHARED library for WEB
	$ make TARGET_PLATFORM=PLATFORM_WEB RAYLIB_LIBTYPE=SHARED
it would instead silently create STATIC library
thus not fulfilling the request as expected

This commit adds an error in this case and stops further execution.

This is not consistent with Cmake, because Cmake throws the warning and
does not stop, but Cmake can easily recover from this case and people
probably does not even notice it. However, Makefile is something that
you have to handle yourself and you have to recover from any issues so
having an error and aborting with exit code 1 is more expected.
Otherwise people may spend a lot of time debugging Makefile in order to
understand what's even going on.

Fixes: https://github.com/raysan5/raylib/issues/4717
2025-01-21 19:20:51 +01:00
Ray
2c50da9a6a REVIEWED: -sASSERTIONS usage by linker #4717 2025-01-21 19:18:23 +01:00
Ray
d48b8afbb5 Update rcore_web.c 2025-01-20 14:01:57 +01:00
Anthony Carbajal
77c509db6e removed hardcoded sleep (#4713) 2025-01-20 12:14:18 +01:00
Anstro Pleuton
773e3f5f9f Update more examples inconsistencies (#4711)
Co-authored-by: Anstro Pleuton <anstropleuton@github.com>
2025-01-19 17:17:38 +01:00
sleeptightAnsiC
10d0616d1f fix(rtextures): TCC not being able to compile due to: 'emmintrin.h' not found (#4707)
define STBIR_NO_SIMD when __TINYC__ is defined so stb_image_resize2 will
not include *mmintrin which are not supported by all compilers.

There are similar checks for __TINYC__ already elswere in raylib
and they are also mostly there to disable SIMD headers.

Additionally, move similar check for stb_image, to be a little bit
deeper. Before it was defining STBI_NO_SIMD without including stb_image
It was also clashing with note, causing said note to make no sense.

Fixes: https://github.com/raysan5/raylib/discussions/2994
Reference: https://github.com/nothings/stb/issues/1738
2025-01-19 12:06:27 +01:00
github-actions[bot]
e70f9157bc Update raylib_api.* by CI 2025-01-18 19:25:01 +00:00
Chris
09272e2e11 Updted the comment for SetShaderValueTexture to reflect the difference between SetShaderValue using sampler2d and SetShaderValueTexture is the automatic bind of the texture. (#4703) 2025-01-18 20:24:48 +01:00
Ray
a16e26a52a Merge branch 'master' of https://github.com/raysan5/raylib 2025-01-18 20:19:13 +01:00
Ray
896ff68540 REVIEWED: Text functions usage notes #4704 2025-01-18 20:19:11 +01:00
Anstro Pleuton
945f181f1d [examples] Update examples to be consistent (#4699)
* Update examples inconsistencies

* Happy new years, examples!

* Missed one inconsistency

* Update final few examples inconsistencies

---------

Co-authored-by: Anstro Pleuton <anstropleuton@github.com>
2025-01-18 19:41:56 +01:00
Ray
74256943a4 REVIEWED: MAX_GAMEPAD_NAME_LENGTH #4695 2025-01-18 19:39:50 +01:00
Auz
8575150747 Bump BINDINGS.md version number for Raylib.nelua (#4698) 2025-01-18 19:26:47 +01:00
Ray
0275d13aa8 Update README.md 2025-01-17 11:32:23 +01:00
Anthony Carbajal
27e530eb18 update examples with difficulty stars (#4694)
* update examples with difficulty stars

* manual fix script issues

* manual fix script issues
2025-01-17 10:42:30 +01:00
Ray
7c7b087efb REVIEWED: example: shaders_deferred_render -WIP-
Not working but shader compiles and example runs... not sure if deferred rendering could be supported in OpenGL ES 2.0.
2025-01-16 19:48:31 +01:00
Ray
313067d749 Update rlgl.h 2025-01-16 19:47:21 +01:00
Ray
94f261c6d7 Update rmodels.c 2025-01-16 19:47:12 +01:00
Ray
7b570bdfdd Update models_point_rendering.c 2025-01-16 19:47:06 +01:00
Colleague Riley
6bf40eee4f Update to RGFW 1.5 (#4688)
* 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

* Update RGFW

* update RGFW

* undo change

* undo change

* undo change

* undo change

* have .scroll be 0 by default

* update RGFW

* update RGFW

* update RGFW

* fix year

* fix wasm key event bug
2025-01-16 00:34:27 +01:00
Eike Decker
5c1cce28a7 Using Module provided canvas id for event binding (#4690)
This change is replacing the hardcoded "#canvas" element references in
rcore_web to allow using canvas elements that use different names
(which is necessary when using multiple canvas elements on one page).

Also adding a cursor hiding example to mouse example.
2025-01-16 00:32:58 +01:00
Michael Kearns
35a9257d20 Update BINDINGS.md for official V language binding change (#4691)
The bindings from @EmmaTheMartian were moved to official status, so the link is updated. 
The name was normalized to be consistent with other 'vendored' names in other languages.
2025-01-15 12:00:06 +01:00
Ray
cfbba79bd3 REVIEWED: example: models_textures_tiling shaders 2025-01-12 20:59:12 +01:00
Ray
fddfb58f85 REVIEWED: Potential shader issues 2025-01-12 20:39:07 +01:00
Ray
af163ba22a REVIEWED: example: shaders_julia_set 2025-01-12 20:29:46 +01:00
tea☆
1cdf3bb791 [rshapes] Allow DrawRectangleRounded() to draw rectangles with a size < 1 (#4683)
Closes #4673
2025-01-12 18:46:49 +01:00
Ray
da5a868e2a REMOVED: example: core_gamepad_info 2025-01-12 18:21:59 +01:00
Ray
2f6230e366 Formatting review and examples review 2025-01-12 18:02:36 +01:00
Ray
4bceddd4de ADDED: example: models_tesseract 2025-01-12 16:19:32 +01:00
Ray
a1896c7a90 REVIEWED: Code/Web-Makefile formatting 2025-01-12 16:19:10 +01:00
github-actions[bot]
43db59d1aa Update raylib_api.* by CI 2025-01-11 22:38:42 +00:00
Ray
e227371265 REVIEWED: TextJoin(), convert const char ** to char**
It generates multiple issues: https://c-faq.com/ansi/constmismatch.html
2025-01-11 23:38:21 +01:00
Ray
8e450e4446 Reviewed shaders formating to follow raylib coding conventions 2025-01-11 19:36:46 +01:00
Ray
49b905077d remove trailing spaces 2025-01-11 19:36:26 +01:00
Ray
62d8969a56 Reviewed shader formating 2025-01-10 22:56:25 +01:00
Ray
2b2694a89f Fix #4680 2025-01-10 22:36:11 +01:00
veins1
08b089f620 Reviewed shaders_deferred_render (#4676)
Fixed: g-buffer textures binding
Fixed: Clearing screen with white would leak onto g-buffer textures
Reviewed comments
2025-01-10 17:41:40 +01:00
Michael Kearns
34f431b422 Update xcode-frameworks dependency for latest zig (#4675)
* Update build.zig.zon for latest framework commit

* Update build.zig.zon with correct hash

* Update build.zig.zon with the 'really' correct hash
2025-01-10 17:40:48 +01:00
Hakunamawatta
43dbaf21e7 [examples] Fix broken link (#4674) 2025-01-10 17:40:13 +01:00
Le Juez Victor
eee86dd7c9 [build][CMake] Fix cmake configuration issue for Android (#4671)
* fix cmake configuration issue for Android

* review comment
2025-01-10 17:37:57 +01:00
Le Juez Victor
b554b53ede fix pixel offset issue with DrawRectangleLines (#4669) 2025-01-10 17:36:52 +01:00
github-actions[bot]
433cc23ea4 Update raylib_api.* by CI 2025-01-10 12:06:46 +00:00
Ray
bf8962dbc7 REVIEWED: Remove some const from text buffer return values
Lately got some compilation `errors` related, it seems GCC 14 interprets some `const`-missmatch as errors instead of warnings (as previous versions).

But in any case, I don't see why an user won't be able to operate directly over of those returned buffers; `const` adds a restriction (for security reasons?) that in my opinion is useless.

From an expert on compilers (w64devkit creator), here there are some notes I agree with:

```
No const. It serves no practical role in optimization, and I cannot recall an instance where it caught, or would have caught, a mistake. I held out for awhile as prototype documentation, but on reflection I found that good parameter names were sufficient. Dropping const has made me noticeably more productive by reducing cognitive load and eliminating visual clutter. I now believe its inclusion in C was a costly mistake.

(One small exception: I still like it as a hint to place static tables in read-only memory closer to the code. I’ll cast away the const if needed. This is only of minor importance.)
```

Ref: https://nullprogram.com/blog/2023/10/08/
2025-01-10 13:06:28 +01:00
Le Juez Victor
ddd86a3387 [rshapes] Fix pixel offset issue with line drawing (#4666)
* fix pixel offset issue with `DrawRectangleRoundedLinesEx`

* improve fix - (pixel offset issue with `DrawRectangleRoundedLinesEx`)

* revert radius tweak (`DrawRectangleRoundedLines`)
2025-01-09 00:07:59 +01:00
K. Adam Christensen
5d9aed5d40 [rlgl] Optimize rlReadScreenPixels (#4667)
This optimization works in the following ways:

1. Reduces calls to malloc to 1. Instead of needing an extra array, we
can just swap the top half with the bottom half of the one array.

2. Unroll the inner for loop and remove a condition. Unrolling loops
buys some performance wins, but the real goal was to remove the if check
and just set the alpha channel to 255.

On my hidpi arm64 laptop, I saw ~60% improvement in performance in my
debug build (29 FPS vs 47 FPS). When optimized, the gains were roughly
10% (75 FPS vs 83%).

Signed-off-by: K. Adam Christensen <pope@shifteleven.com>
2025-01-08 18:53:27 +01:00
Maicon Santana
fc29bc27fd Fix Touch pointCount reduction (#4661) 2025-01-06 11:29:24 +01:00
Asdqwe
ad035edfac Fix camera initial position (#4657) 2025-01-05 12:30:43 +01:00
rexept
2f95e8382b typo fix (#4656) 2025-01-05 12:30:06 +01:00
Brian E
05c4d8a652 [rlgl.h] Fixed typo in top comment (#4658)
"renderer" to "rendered"
2025-01-05 12:29:31 +01:00
veins1
97fa3a73e8 Fix: Alt-Tab not working in borderless fullscreen (#3865) (#4655) 2025-01-03 17:36:48 +01:00
Peter0x44
0f6e85a975 [build] CMake: Don't build examples using audio if audio is disabled (#4652) 2025-01-01 12:18:11 +01:00
Ray
fa0eada61a Update year to 2025 2025-01-01 00:02:52 +01:00
Peter Zmanovsky
d1315e8a04 [rmodels] Fix leaks in LoadIQM() and LoadModelAnimationsIQM() (#4649)
Add calls to UnloadFileData() before return in cases of invalid IQM file.
2024-12-29 21:06:40 +01:00
Jeffery Myers
f355d6f1db Transform the vertex normals by the animated matrix (#4646) 2024-12-29 01:07:52 +01:00
Ray
c0f2067dba REVIEWED: LoadShaderFromMemory(), use default locations for default shader #4641 2024-12-28 16:35:42 +01:00
Asdqwe
5b822585e5 [rcore] [GLFW] [SDL2] Updates CORE.Window.eventWaiting and FLAG_WINDOW_ALWAYS_RUN handling (#4642)
* Add implementation for CORE.Window.eventWaiting on PLATFORM_DESKTOP_SDL

* Optimize GetFrameTime() reset

* Optimize FLAG_WINDOW_ALWAYS_RUN and GetFrameTime() reset for PLATFORM_DESKTOP_GLFW
2024-12-28 15:59:05 +01:00
Johannes
75b6b825df using addCMacro instead of defineCMacro (#4620)
Co-authored-by: Johannes Rønning <johannes@picterus.com>
2024-12-28 15:57:10 +01:00
Jeffery Myers
e062dc085c Add filters and platform files so they show up in MSVC for ease of editing (#4644) 2024-12-28 15:56:04 +01:00
Mario Nachbaur
7ecc47d12e Fix IsWindowFocused() on web. (#4640) 2024-12-26 20:12:53 +01:00
Asdqwe
4758867815 [rcore] [SDL2] Add implementation for FLAG_WINDOW_ALWAYS_RUN (#4598)
* Enable FLAG_WINDOW_ALWAYS_RUN by default on PLATFORM_DESKTOP_GLFW

* Revert enabling FLAG_WINDOW_ALWAYS_RUN by default on PLATFORM_DESKTOP_GLFW

* Add implementation for FLAG_WINDOW_ALWAYS_RUN on PLATFORM_DESKTOP_SDL

* Add reset for GetFrameTime()
2024-12-26 19:02:57 +01:00
Bot Randomness
51b9a0acfc Updated BINDINGS.md for Ruby (#4639)
Added a Ruby binding known as raylib-ruby on 4.5. (https://github.com/wilsonsilva/raylib-ruby)
2024-12-26 18:55:38 +01:00
Antonis Geralis
b07967993f Update version number for the nim wrapper (#4638) 2024-12-25 22:08:42 +01:00
Colleague Riley
c333e80497 Update RGFW (#4637)
* 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

* Update RGFW

* update RGFW

* undo change

* undo change

* undo change

* undo change

* have .scroll be 0 by default
2024-12-25 21:19:51 +01:00
Le Juez Victor
873bf31be3 [rmodels] Fix normal transform in UpdateModelAnimationBones (#4634)
* remove duplicate calculation of `invRotation` in `UpdateModelAnimationBones`

* fix normal transform in `UpdateModelAnimation`
2024-12-24 20:17:37 +01:00
Ray
ae3c0df206 Reviewed formating, removed assert() #4635 2024-12-24 20:14:54 +01:00
Jett
a7686c47b3 resolved a few segfaults with animation system (#4635)
* Update rmodels.c

resolves segfault with missing bone weights or bone IDs

* Update rmodels.c segfault with animation and missing normals/animnormals

* correct place.
2024-12-24 20:11:17 +01:00
Fancy2209
7868d600f4 [rtext] Fix default font alpha on Big Endian systems (#4624)
* Fix rtext default font alpha on Big Endian

* Endian Indepence
2024-12-23 22:25:22 +01:00
James Doyle
4fc908b38f Update BINDINGS.md (#4633)
Add some missing bindings for 5.5
2024-12-23 20:51:11 +01:00
veins1
e5d8de7c63 Fix: Setting flags disables fullscreen #4618 (#4619) 2024-12-23 19:26:50 +01:00
JupiterRider
a3a25da594 Update BINDINGS.md (#4628) 2024-12-23 19:25:41 +01:00
Ray
67b164bc04 Merge branch 'master' of https://github.com/raysan5/raylib 2024-12-23 19:24:09 +01:00
Ray
6f0d8611fe Formating tweaks 2024-12-23 19:24:07 +01:00
Jett
0212ed0a4b setting MAX_LEVEL based on actual mipcount input (#4622) 2024-12-20 14:14:13 +01:00
Fancy2209
26e12d6b35 Fix Typo in rcore_desktop_sdl.c (#4621) 2024-12-20 13:53:51 +01:00
Ray
ab83e6dd41 Image manipulation functions depend on a flag 2024-12-19 13:24:30 +01:00
Ray
03ff864087 Formating tweaks 2024-12-18 18:44:23 +01:00
Le Juez Victor
6eb1206660 fix shaders_deffered_render.c for OpenGL ES 3 (#4617)
This fixes an incomplete framebuffer issue due to the use of a texture format not supported in ES 3.
This commit also adds more information on how to manage deferred rendering.
2024-12-18 18:07:48 +01:00
Asdqwe
99cb4cbc36 Fix SetGamepadVibration() TRACELOG message (#4615) 2024-12-18 14:53:50 +01:00
Ray
783ca612cc Update Makefile 2024-12-18 12:51:00 +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
de6c09ee7a WARNING: REVIEWED: Use libraylib.web.a naming on PLATFORM_WEB
This change allows to have in same directory (currently `raylib/src`) two raylib build versions: Desktop and Web
2024-12-18 11:45:55 +01:00
Ray
f76734fc50 REVIEWED: UpdateModelAnimationBones(), break on first mesh found and formating 2024-12-18 11:43:43 +01:00
Kirandeep-Singh-Khehra
35c2408413 [rmodels] Optimized UpdateModelAnimationBones() function (#4602)
- Updating bones only once instead for each mesh.
 - Updating only one `model.meshes[].boneMatrices` and then using deep copy for other meshes instead of calculating for each bone in each mesh.

**Other points:**
 - Makes it a clean base/template/reference for bone updation functions. Because if using this as template then some calculations done in one mesh can affect bones in other mesh in next iteration(doubles the effect in for next mesh).

Signed-off-by: Kirandeep-Singh-Khehra <kirandeepsinghkhehra@gmail.com>
2024-12-18 11:39:50 +01:00
Asdqwe
cdaff163cb Fix show, hide, focus and unfocus window/flags states for SDL2 (#4610) 2024-12-18 11:39:30 +01:00
JupiterRider
714cd5ef5c add SetGamepadVibration to rgfw and template (#4612) 2024-12-18 11:38:11 +01:00
Asdqwe
bdfbd6e8cc Fix maximizing, minimizing and restoring windows for SDL2 (#4607) 2024-12-16 22:19:00 +01:00
Le Juez Victor
79facde353 fix rlActiveDrawBuffers for OpenGL ES 3 (#4605) 2024-12-16 00:51:42 +01:00
Per Hallsmark
d0504800d2 install rcamera.h (#4603)
Signed-off-by: Per Hallsmark <per.hallsmark@bitjuggler.se>
2024-12-15 11:16:08 +01:00
Jeffery Myers
93a1e75741 Disable the threading example in MSVC for release and debug build (was disabled for dll builds already) (#4594) 2024-12-13 09:21:45 +01:00
github-actions[bot]
0a26d9a26f Update raylib_api.* by CI 2024-12-13 08:21:27 +00:00
__hexmaster111
8a5a95c13a Removed inaccurate comment about negitves not being supported with TextToFloat And TextToInt Methods (#4596) 2024-12-13 09:21:13 +01:00
Ray
1f704be4e4 Review comments spacing for better alignment 2024-12-12 12:13:38 +01:00
Ray
6b220f2798 Review formating 2024-12-12 12:13:17 +01:00
Legendary Redfox
b747eeefa4 [documentation] Adding a related project (#4589)
* updated raylib-lua version

* Updated some bindings

* removed 404 bindings

* adding my bindings project to the list

* Adding a related project

* fixing the license foi ReiLua
2024-12-10 20:05:46 +01:00
Legendary Redfox
aeb33e6301 Adding my bindings to the list (#4586)
* updated raylib-lua version

* Updated some bindings

* removed 404 bindings

* adding my bindings project to the list
2024-12-08 15:24:02 +01:00
github-actions[bot]
83f6f3dabe Update raylib_api.* by CI 2024-12-08 11:52:21 +00:00
Rico P
2a2acff2d5 Make sure ShaderUniformDataType matches rlShaderUniformDataType (#4577)
* Make sure ShaderUniformDataType matches rlShaderUniformDataType

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ray <raysan5@gmail.com>
2024-12-08 12:52:06 +01:00
github-actions[bot]
732da949b7 Update raylib_api.* by CI 2024-12-08 11:49:07 +00:00
Michael
d2cd2a0152 [rlgl][rmodels] Add instranceTransform shader location index #4538 (#4579) 2024-12-08 12:48:54 +01:00
Asdqwe
93a67417b3 Fix examples Makefile PLATFORM define (#4582) 2024-12-08 12:46:43 +01:00
danil
2820fcc29e [examples] improve input_virtual_controls example (#4584) 2024-12-08 08:52:09 +01:00
0riginaln0
ca6c5f4f3c Update BINDINGS.md | Fennel Bindings (#4585) 2024-12-07 21:28:08 +01:00
Ray
602583bcdb Merge branch 'master' of https://github.com/raysan5/raylib 2024-12-03 19:14:29 +01:00
Ray
1f45e7af76 REVIEWED: Coding conventions 2024-12-03 19:14:14 +01:00
Caleb Heydon
5feccb1bab [rmodels] Fixed null pointer dereference in LoadGLTF (#4564)
* [rmodels] Fixed null pointer dereference in LoadGLTF

* [rmodels] Add parenthesis around conditionals in LoadGLTF
2024-12-03 18:35:24 +01:00
Legendary Redfox
1f0325b52c [documentation] Removing 404 repos from bindings (#4572)
* updated raylib-lua version

* Updated some bindings

* removed 404 bindings
2024-12-03 13:30:17 +01:00
Legendary Redfox
e9e463e8b2 [documentation] Updating keybindings versions (#4570)
* updated raylib-lua version

* Updated some bindings
2024-12-03 12:03:36 +01:00
Legendary Redfox
83587e94c8 updated raylib-lua version (#4567) 2024-12-02 21:01:22 +01:00
JupiterRider
402eab3837 Update BINDINGS.md (#4566) 2024-12-02 18:50:24 +01:00
ahmedqarmout2
87b3085f5c Added new Jai bindings to BINDINGS.md (#4565)
Co-authored-by: Ahmed Qarmout <ahmed.qarmout@mail.utoronto.ca>
2024-12-02 18:48:24 +01:00
Caleb Heydon
f3f5f38c0f [rmodels] Fix crash when NULL is passed to LoadImageFromCgltfImage (#4563) 2024-12-02 13:35:54 +01:00
github-actions[bot]
e5e2bc83c3 Update raylib_api.* by CI 2024-12-01 22:25:46 +00:00
Ray
b50d418ec7 Merge branch 'master' of https://github.com/raysan5/raylib 2024-12-01 23:25:27 +01:00
Ray
dd26df0be8 REVIEWED: Parser issue with comment #4558 2024-12-01 23:25:12 +01:00
Rico P
ff71e3a513 use unused variable. Fixes #4560 (#4561) 2024-12-01 23:22:46 +01:00
Ryan Johnston
e181069c62 Update BINDINGS.md (#4559)
Include CLIPSraylib in the list of language bindings.
2024-12-01 23:12:00 +01:00
Ray
962f1c26ff Review formatting to follow raylib conventions 2024-12-01 23:10:59 +01:00
Caleb Heydon
9047630ae7 [rmodels] Fix null pointer dereference in LoadImageFromCgltfImage (#4557) 2024-12-01 22:46:26 +01:00
Ray
503cd7ba34 Update raymath.h 2024-12-01 22:45:09 +01:00
Jonathan Akaba
1b4e73cf2f Update documentation for Vector2Angle (#4556) 2024-12-01 22:43:32 +01:00
Ray
6fbf08cc1f Update pbr.fs 2024-12-01 22:41:38 +01:00
Ray
f9cf684356 Update pbr.vs 2024-12-01 22:40:46 +01:00
Ray
698bfc48fe Update pbr.fs 2024-12-01 22:40:23 +01:00
Ray
6c59dc4a65 Update BINDINGS.md 2024-12-01 22:39:09 +01:00
devdad
645f9e31c9 I've created bindings for raylib 5.5 for c3-lang at https://c3-lang.org (#4555)
* basic pbr example

pbr implementation  includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file  currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve

* Unloading PBRMAterial

I forgot unloading PBRMaterial

* fix small issue with texOffset assigment.

value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset .

* Changed size of textures and file name changed

Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c ,
Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh);
but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh

* Update to 5.5 version  of eexample and fix to work in web

set GLSL_VERSION            100

set precision highp float;
removed in keyword
fix for loop has to use only constant

* Update shader_basic_pbr example to work on web

changed to GLSL_VERSION            100
update glsl100 shader
set float  precision  to highp
removed keyword  in
change for loop tu use constant value  gives an error

* Update shader_basic_pbr example to work on web

changed to GLSL_VERSION            100
update glsl100 shader
set float  precision  to highp
removed keyword  in
change for loop tu use constant value  gives an error

* removed rpbr.h

removed rpbr.h

* Bindings for c3-lang    raylib 5.5 and raylib 5.0

I've created raylib 5.5 binding for c3-Lang  https://c3-lang.org
2024-12-01 22:37:28 +01:00
Mossieur-Patate
9d318a6fbf Update CONTRIBUTING.md + FAQ.md: small misprints (#4553)
* Update CONTRIBUTING.md: small misprint

* Update FAQ.md: small misprint
2024-12-01 22:35:19 +01:00
Caleb Heydon
58fe34d9cc [raudio] Fixed buffer overflow when loading WAV files (#4539) 2024-11-28 22:58:35 +01:00
RealDoigt
cd16c9ea91 Add the D Object Oriented Raylib wrapper to the list of BINDINGS.md (#4550)
* add the D Object Oriented Raylib wrapper to the list of BINDINGS.md

* copy pasted correct url

I couldn't do it from the web ui for some reason
2024-11-28 22:50:44 +01:00
github-actions[bot]
31a1047782 Update raylib_api.* by CI 2024-11-28 21:50:14 +00:00
Mossieur-Patate
2c4c6e6201 GetKeyName prototype (#4544)
* Update raylib.h: GeyKeyName prototype

Prototype for GetKeyName, which is already implemented elsewhere.

* Update raylib_to_parse.h: GetKeyName prototype
2024-11-28 22:50:00 +01:00
Kacper Zybała
ba1e14625a [build] CMake: Set CMake version to 3.12 (#4547) 2024-11-28 22:47:39 +01:00
Tymoteusz Moryto
949c31605b CMakeOptions.txt: Added a missing ) (#4545) 2024-11-28 22:46:52 +01:00
glowiak
623c4376cc The Jaylib binding is at 5.5 (#4546) 2024-11-28 22:46:04 +01:00
Ray
abb3c8e9f7 Revert "[build][cmake] Improve cmake config file generation (#4541)"
This reverts commit c53dd8a931.
2024-11-28 22:44:42 +01:00
Leonardo Guilherme de Freitas
c53dd8a931 [build][cmake] Improve cmake config file generation (#4541)
* Improve cmake config file generation

This allows for finding raylib on a non-standard location (eg, not in /usr/lib{,64})

* Only have glfw as private if using internal glfw and not static
2024-11-27 11:39:36 +01:00
Anthony Carbajal
79188f570b fixed spacing in sha1 comment (#4540) 2024-11-25 20:17:22 +01:00
Jeffery Myers
6141489b00 Fixes casting warnings with RGFW platform. (#4534) 2024-11-24 16:25:36 +01:00
listeria
e494c545b8 raymath: fix C++ operator overloads (#4535)
Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
2024-11-24 16:24:34 +01:00
HaxSam
a9aa6b4988 [build.zig] improve build system for zig (#4531)
Is now possible to switch platform

Is now possible to diable raudio, rmodels, and so on

Made getOptions public so it can be used for zig wrappers
2024-11-24 16:22:51 +01:00
Ray
47f83aa58f Merge branch 'master' of https://github.com/raysan5/raylib 2024-11-22 11:06:53 +01:00
Ray
da6fa1d756 Fix #4529 2024-11-22 11:06:34 +01:00
github-actions[bot]
65e0d2cfda Update raylib_api.* by CI 2024-11-22 10:01:29 +00:00
Ray
50a2afff9e Update raylib version to 5.6-dev to avoid confusions with release 2024-11-22 11:01:10 +01:00
Asdqwe
a53a8958f2 Add implementation to GetWindowScaleDPI() for PLATFORM_WEB (#4526) 2024-11-22 10:52:55 +01:00
Ray
0d39e7137b Fix #4527 2024-11-21 12:38:29 +01:00
veins1
11429b48eb Fix for #4521 (#4523) 2024-11-20 21:28:46 +01:00
Gael Pérez
415a98965a update raymath.h: add Vector2CrossProduct function (#4520) 2024-11-20 11:27:14 +01:00
kimierik
532167d28b build.zig: fix raygui inclusion in windows crosscompilation (#4489) 2024-11-20 11:26:29 +01:00
devdad
6af664c04e Update shaders_basic_pbr example to work on web (#4516)
* basic pbr example

pbr implementation  includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file  currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve

* Unloading PBRMAterial

I forgot unloading PBRMaterial

* fix small issue with texOffset assigment.

value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset .

* Changed size of textures and file name changed

Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c ,
Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh);
but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh

* Update to 5.5 version  of eexample and fix to work in web

set GLSL_VERSION            100

set precision highp float;
removed in keyword
fix for loop has to use only constant

* Update shader_basic_pbr example to work on web

changed to GLSL_VERSION            100
update glsl100 shader
set float  precision  to highp
removed keyword  in
change for loop tu use constant value  gives an error

* Update shader_basic_pbr example to work on web

changed to GLSL_VERSION            100
update glsl100 shader
set float  precision  to highp
removed keyword  in
change for loop tu use constant value  gives an error

* removed rpbr.h

removed rpbr.h
2024-11-20 11:25:31 +01:00
Jorge A. Gomes
57edbc3bab Update BINDINGS.md for raylib-py 5.5 (#4519) 2024-11-20 11:24:47 +01:00
Philipp
a145779e21 Update BINDINGS.md: fortran-raylib is on v5.5 (#4518) 2024-11-19 22:42:34 +01:00
Alexandre B A Villares
481095226d Update BINDINGS.md: github.com/electronstudio/raylib-python-cffi now 5.5 (#4517) 2024-11-19 22:41:14 +01:00
Ray
26548c1062 Remove trail-spaces 2024-11-19 12:33:13 +01:00
Ray
9e4f513a43 Reviewed formating 2024-11-19 12:31:57 +01:00
Ray
c78757a959 REVIEWED: GetClipboardImage(), make symbol available on all platforms 2024-11-19 12:31:49 +01:00
Ray
10789a4d49 Update rlgl.h 2024-11-19 12:31:14 +01:00
mikeemm
95e766472f [rmodels] Improve OBJ vertex data precision and lower memory usage by ExportMesh() (#4496)
* increased vertex data precision to match blender exports

* modified memory allocation to better fit higher precision data

* now accounting for newline characters during allocation

* now accounting for potentially higher vertex counts

* removed unnecessary final newline
2024-11-19 10:35:47 +01:00
Jannis
bd706dfcf2 Update BINDINGS.md for raylib-beef (#4514) 2024-11-19 10:35:10 +01:00
Andrew Dunbar
7127cba5cc typo/spello: arribes->arrives (#4515) 2024-11-19 10:33:36 +01:00
Alexandre B A Villares
21575856f4 Update BINDINGS.md: raylib-python-cffi is on v5.0 (#4512)
According to https://github.com/electronstudio/raylib-python-cffi
2024-11-19 09:05:39 +01:00
kovidomi
65f955a4dc Add missing VS2022 example projects for models_bone_socket and shaders_vertex_displacement (#4510) 2024-11-19 09:05:09 +01:00
Mute
f979cc62ee Fixed grammar mistakes in core_3d_camera_first_person.c (#4508)
Changed line 118 from, "// For advance camera controls, it's reecommended to compute camera movement manually", to, "// For advanced camera controls, it's recommended to compute camera movement manually".
2024-11-19 09:04:14 +01:00
Steven Schveighoffer
05b2603c45 Update raylib-d binding to 5.5 (#4506) 2024-11-19 09:03:39 +01:00
Rob Loach
fde3779ebd BINDINGS: raylib-cpp supports raylib 5.5 (#4511)
[raylib-cpp](https://github.com/RobLoach/raylib-cpp) has been updated to use the new raylib 5.5 functions. This is a great release! Thanks so much.
2024-11-19 00:37:33 +01:00
Ray
8375581f87 Update README.md 2024-11-19 00:19:39 +01:00
Gunko Vadim
71e0b8b581 Update BINDINGS.md (#4504) 2024-11-18 14:38:28 +01:00
Ray
c1ab645ca2 Update HISTORY.md 2024-11-18 13:21:10 +01:00
Ray
68503ed96f Update webassembly.yml 2024-11-16 19:00:28 +01:00
github-actions[bot]
88c922f433 Update raylib_api.* by CI 2024-11-16 17:45:33 +00:00
Ray
938b805bfb Update raylib.h 2024-11-16 18:45:16 +01:00
Ray
162efc1ec7 Update core_basic_window.c 2024-11-16 18:45:12 +01:00
Ray
da7ab04052 Update HISTORY.md 2024-11-16 18:44:48 +01:00
Ray
dd688d81a6 Thanks @everyone for everything 😄 2024-11-16 18:16:00 +01:00
Ray
d567b35d9a Update HISTORY.md 2024-11-16 17:57:00 +01:00
Ray
816b605054 Update CHANGELOG 2024-11-16 13:18:04 +01:00
Eike Decker
7c5d74e98e Fixing an OBJ loader bug that fragmented the loaded meshes (#4494)
The nextShapeEnd integer is a pointer in the OBJ data structures.
The faceVertIndex is a vertex index counter for the mesh we are
about to create. Both integers are not compatible, which causes
the code to finish the meshes too early, thus writing the OBJ data
incompletely into the target meshes.

It wasn't noticed because for the last mesh, it process all remaining
data, causing the last mesh to contain all remaining triangles.

This would have been noticed if the OBJ meshes used different textures
for each mesh.
2024-11-15 16:40:14 +01:00
Oussama Teyib
4f091f44a8 Fix typo in BINDINGS.md (#4493) 2024-11-15 08:26:22 +01:00
Jeffery Myers
a2f6ae6796 Fix warnings in examples (#4492)
Move shapes/shapes_rectangle_advanced to the correct folder in MSVC project
Add core_input_virtual_controls.vcxproj back into sln file
2024-11-15 08:25:09 +01:00
Ray
5e6cdf3a73 Update emsdk path on Windows to match new raylib installer package 2024-11-14 18:41:37 +01:00
Ray
76016aae20 Update raylib.ico 2024-11-14 16:40:04 +01:00
Ray
15eb8221e3 Updated raylib resource data 2024-11-14 16:39:58 +01:00
Ray
928535a828 Commented code issuing warnings on w64devkit (GCC)
Tested with w64devkit/MSVC and all seem to work as expected
2024-11-14 16:39:38 +01:00
Ray
637debb62d Updated Notepad++ autocomplete list for raylib 5.5 2024-11-14 16:38:55 +01:00
Ray
14d3bbbb86 Update raygui.h 2024-11-14 16:38:27 +01:00
Asdqwe
700e2c5e5d Fix touch count reset (#4488) 2024-11-14 10:49:35 +01:00
Ray
8af7985ece Update CHANGELOG 2024-11-14 10:46:34 +01:00
Ray
0c7edbc2ee Update HISTORY.md 2024-11-14 10:45:56 +01:00
Ray
2841eaba3e Merge branch 'master' of https://github.com/raysan5/raylib 2024-11-14 10:45:24 +01:00
Ray
f76a5e2b10 Update CHANGELOG 2024-11-14 10:45:19 +01:00
Asdqwe
377248b1ac Fix Makefile.Web (#4487) 2024-11-13 22:21:10 +01:00
kimierik
7053970f7b build.zig: remove raygui from options and re add adding raygui as a (#4485)
function
2024-11-13 18:52:12 +01:00
Ray
4ddf4679b4 Update CHANGELOG 2024-11-11 20:28:25 +01:00
Jeffery Myers
10fd4de258 Fix the example lighting shaders to use both frag and diffuse colors so they work with shapes and meshes. (#4482) 2024-11-11 19:55:33 +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
Jeffery Myers
fb69b39d54 Fix a typecast warning in glfw clipboard access (#4479) 2024-11-11 19:46:54 +01:00
Jeffery Myers
2af4f31712 Fix the X axis of the second vertex of the Y negative cap of a cylinders, triangle fan (#4478) 2024-11-10 22:04:58 +01:00
Ray
09570a05b3 Merge branch 'master' of https://github.com/raysan5/raylib 2024-11-10 17:54:02 +01:00
Ray
85de743d1c Improved logos size 2024-11-10 17:53:50 +01:00
Tomas Slusny
ce3b121f07 build.zig: Remove addRaylib and fix raygui builds when using raylib as dep (#4475)
- addRaylib just duplicates what adding raylib as dependency already does
  so it do not needs to exist
- move raygui build to standard build process when flag is enabled. this
  works correctly when using raylib as dependency and having raygui as
  dependency as well. problem with previous approach was that raygui was in
  options but it was doing nothing because you had to also use addRaygui for
  it to be effective

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-11-10 13:47:15 +01:00
github-actions[bot]
d8feef5279 Update raylib_api.* by CI 2024-11-09 18:40:56 +00:00
Everton Jr.
00396e3436 [rcore] Clipboard Image Support (#4459)
* [rcore] add 'GetClipboardImage' for windows

* [rcore] GetClipboardImage removed some unneeded defines

* [rcore] PLATFORM_SDL: create a compatility layer for SDL3

* external: add win32_clipboard.h header only lib

* [rcore] using win32_clipboard on platforms rlfw and rgfw

* [rcore] fix warnings in SDL3 compatibility layer

* Makefile: Allow specifying SDL_LIBRARIES to link, this helps with SDL3

* Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW

* Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW

* [rcore]: PLATFORM_SDL: improve clipboard data retrieval

* external: remove unused function from win32_clipboard.h

* Makefile: allow for extra flags necessary when compiling for SDL3

* [rcore]: fix string typo

* [rcore]: Properly handle NULL dpi passing. As is allowed in SDL2

* external: fix arch finding on win32_clipboard.h to allow compilation on msvc cmake CI

* [rcore]: PLATFORM_SDL: Treat monitor as an ID in SDL3 as opposed to an index as in SDL2

* [rcore]: typo
2024-11-09 19:40:41 +01:00
Tomas Slusny
53b929cbfb Improve cross-compilation with zig builds (#4468)
- Add xcode_frameworks when cross compiling for mac (ref:
https://github.com/hexops/mach/blob/main/build.zig)
- Add emsdk when cross compiling for wasm (ref:
https://github.com/floooh/sokol-zig/blob/master/build.zig)

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-11-08 14:31:31 +01:00
Jett
dc489786b0 UpdateModelAnimation speedup (#4470)
If we borrow from the GPU skinned animation code, we can just multiply the vertex by the matrix * weight and shave a chunk of CPU time.
2024-11-08 14:28:39 +01:00
Jeffery Myers
55a64f51b8 fix float casting warnings (#4471) 2024-11-07 21:42:59 +01:00
Ray
a617e1e217 Update core_2d_camera_mouse_zoom.c 2024-11-06 12:00:39 +01:00
Ray
b47fffb48b Update Makefile.Web 2024-11-05 00:09:12 +01:00
decromo
281ee51aff implemented new linear gradient generation function (#4462) 2024-11-04 15:57:50 +01:00
Ray
ec953240b1 Update CHANGELOG 2024-11-03 21:02:13 +01:00
waveydave
66a4f2e90b Fix for issue 4454, MatrixDecompose() gave incorrect output for certain combinations of scale and rotation (#4461) 2024-11-03 20:36:32 +01:00
github-actions[bot]
6028052c7e Update raylib_api.* by CI 2024-11-03 12:12:25 +00:00
Ray
be360d2ad1 RENAMED: UpdateModelAnimationBoneMatrices() to UpdateModelAnimationBones()
Still, not fully convinced of those functions naming, despite quite descriptive, sounds a bit confusing to me...
2024-11-03 13:12:01 +01:00
Ray
24724d33bb Added last week commits info 2024-11-03 12:30:02 +01:00
MikiZX1
8e5d5f89c2 Update rmodels.c - 'fix' for GenMeshSphere artifact (#4460)
When creating a new sphere mesh with high number of slices/rings the top and bottom parts of the generated sphere are removed. This happens because the triangles in those parts, due to high resolution, end up being very small and are removed as part of the 'par_shapes' library's optimization. Adding par_shapes_set_epsilon_degenerate_sphere(0.0); before generating the sphere mesh sets the threshold for removal of small triangles is removed and the sphere is returned to raylib correctly.
2024-11-01 22:35:35 +01:00
Ray
9e2591e612 Update Makefile 2024-11-01 12:14:06 +01:00
Ray
b7ef2fd580 Update HISTORY.md 2024-11-01 12:07:27 +01:00
Asdqwe
b8c0842b2e Fix SetWindowSize() for PLATFORM_WEB (#4452) 2024-10-30 22:21:37 +01:00
Arche Washi
3bad05aa7b fix the issue with GetScreenWidth/GetScreenHeight that was identified on other platforms (#4451) 2024-10-30 20:13:53 +01:00
Everton Jr.
ad79d4a884 [shapes] Add shapes_rectangle_advanced example implementing a DrawRectangleRoundedGradientH function (#4435)
* [rshapes] Add  function

* "[shapes] rectangle advanced: fix screen width and height to fit with other examples"
2024-10-29 22:23:51 +01:00
Ray
d15e583460 Update rtext.c 2024-10-29 09:37:38 +01:00
Ray
10c8e4e435 Update rcore_desktop_glfw.c 2024-10-29 09:37:33 +01:00
Jeffery Myers
743e557e1e Fix inconsistent dll linkage warning on windows (#4447) 2024-10-29 09:34:57 +01:00
mpv-enjoyer
de7ab83f5a Fix empty input string for MeasureTextEx (#4448) 2024-10-29 09:33:03 +01:00
Ray
f59e185d7a Update README.md 2024-10-27 22:27:18 +01:00
Jeffery Myers
0e1fc33c5c Fix signed/unsigned mismatch in rlgl (#4443) 2024-10-26 22:59:50 +02:00
Colleague Riley
7fe5f7126b Fix MSVC errors for PLATFORM_DESKTOP_RGFW (#4441)
* (rcore_desktop_rgfw.c) fix errors when compiling with mingw

* define WideCharToMultiByte

* update RGFW

* move stdcall def to windows only

* fix raw cursor input

* Fix warnings, update RGFW, fix msvc errors (make sure windows macro _WIN32 is correct)
2024-10-26 22:59:10 +02:00
Nikolas
38cf9f3224 [rtextures] LoadTextureCubemap(): Copy image before generating mipmaps, to avoid dangling re-allocated pointers (#4439) 2024-10-26 22:52:24 +02:00
NishiOwO
ff66b49c19 fix (#4440) 2024-10-26 15:10:35 +02:00
Ray
7ad8fa689f REVIEWED: LoadTextureCubemap() to avoid crash #4429 2024-10-26 13:51:10 +02:00
Ray
8b9ea8cd5f Update Makefile 2024-10-26 13:46:56 +02:00
NishiOwO
3dcddaedd7 Fix examples Makefile for NetBSD (#4438)
* fix makefile

* moving to LDPATHS

* fix clean and ldlibs stuff
2024-10-26 13:41:54 +02:00
Ray
ec79bffa20 Update stb_truetype.h 2024-10-26 13:13:05 +02:00
Ray
dc679cd1c7 Update stb_image_resize2.h 2024-10-26 13:12:38 +02:00
Ray
28e7e2cffd Update stb_image.h 2024-10-26 13:12:36 +02:00
Ray
d0e11a8c92 Update qoa.h 2024-10-26 13:12:33 +02:00
Ray
e70bf2bce1 Update dr_wav.h 2024-10-26 13:12:30 +02:00
Ray
c085c73014 Update dr_mp3.h 2024-10-26 13:12:26 +02:00
Ray
c6b1ecc593 Update cgltf.h 2024-10-26 13:12:24 +02:00
Ray
1f6b3384fa Reviewed formatting, remove end-line points, for consistency with comments 2024-10-26 12:26:00 +02:00
Ray
80b490c8f1 Reviewed formating to follow raylib conventions #4429 2024-10-26 12:15:06 +02:00
Nikolas
7fedf9e0b8 [rtextures/rlgl] Load mipmaps for cubemaps (#4429)
* [rlgl] Load cubemap mipmaps

* [rtextures] Only generate mipmaps that don't already exist

* [rtextures] ImageDraw(): Implement drawing to mipmaps

* [rtextures] Load cubemap mipmaps
2024-10-26 12:09:38 +02:00
Asdqwe
91a4f04794 Use mingw32-make for Windows (#4436) 2024-10-26 11:39:24 +02:00
Ray
4e3fc84050 Minor format tweaks 2024-10-26 00:52:22 +02:00
Ray
22c77d17b7 REVIEWED: WebGL2 (OpenGL ES 3.0) backend flags (PLATFORM_WEB) #4330 2024-10-26 00:51:37 +02:00
Ray
7ac36e20cd Update Makefile.Web 2024-10-25 23:55:31 +02:00
Asdqwe
8b36253e2f [build] [web] Fix examples Makefile for PLATFORM_WEB (#4434)
* Fix examples Makefile for PLATFORM_WEB

* Replace shell with assignment operator

* Replace tab with spaces
2024-10-25 23:47:55 +02:00
Peter0x44
204872de09 [build] CMake: Don't build for wayland by default (#4432)
This is to align with the behavior of #4369, see #4371 for rationale on
disabling Wayland by default.
2024-10-25 09:47:35 +02:00
Jeffery Myers
f03f093909 Add input_virtual_controls to MSVC projects (#4433)
Fix input_virtual_controls example to use correct default font sizes
2024-10-25 09:47:04 +02:00
Jeffery Myers
728ccc96bc Use the vertex color as part of the base shader in GLSL330 (#4431) 2024-10-24 23:49:30 +02:00
Jeffery Myers
6c3b1fa1de Add shadow map example to MSVC projects (#4430) 2024-10-24 23:37:23 +02:00
IcyLeave6109
15f6c47f07 Use free camera in model shader example (#4428) 2024-10-24 17:49:47 +02:00
Ray
16368cd353 REVIEWED: DrawRectangleLines(), considering view matrix for lines "alignment" 2024-10-24 13:11:39 +02:00
RadsammyT
385187f795 [rshapes] Review DrawRectangleLines() pixel offset (#4261)
* [rshapes] Remove `DrawRectangleLines()`'s + 1 offset

* ... and replace it with a -/+ 0.5 offset divided by current cam's zoom.
2024-10-24 13:08:12 +02:00
Ray
530bb3dc57 Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-24 12:53:24 +02:00
Ray
6962364bfb Update emsdk paths to latest versions 2024-10-24 12:53:16 +02:00
github-actions[bot]
cb73970f08 Update raylib_api.* by CI 2024-10-24 10:46:22 +00:00
Ray
6ff0b03629 REVIEWED: UpdateModelAnimationBoneMatrices() comments 2024-10-24 12:46:02 +02:00
Ray
5065b85d33 Update rlgl.h 2024-10-24 12:45:12 +02:00
Ray
6760d1bff8 Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-24 12:25:14 +02:00
Ray
b0140b876b REVIEWED: GPU skninning on Web, some gotchas! #4412 2024-10-24 12:25:05 +02:00
github-actions[bot]
865265b832 Update raylib_api.* by CI 2024-10-24 09:58:05 +00:00
Ray
670fbd8c10 Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-24 11:57:44 +02:00
Ray
3483a4d9cb Update raylib.h 2024-10-24 11:57:36 +02:00
github-actions[bot]
b0e77c7afd Update raylib_api.* by CI 2024-10-24 09:50:59 +00:00
Ray
5706cfd600 Update Makefile 2024-10-24 11:50:42 +02:00
Ray
d85c6fe2c0 Update raylib.h 2024-10-24 11:50:30 +02:00
Ray
26dfd4c3f8 Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-24 10:01:06 +02:00
Ray
0f5e76f91f Update CHANGELOG 2024-10-24 10:00:57 +02:00
github-actions[bot]
c6a58d9744 Update raylib_api.* by CI 2024-10-24 08:00:11 +00:00
Ray
2072b4fa04 Update raylib.h 2024-10-24 09:59:54 +02:00
Ray
51bc6ca834 Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-24 09:59:32 +02:00
Ray
4abc6c3989 Update CHANGELOG 2024-10-24 09:59:21 +02:00
Ray
f80a44c729 Update HISTORY.md 2024-10-24 09:58:37 +02:00
Jeffery Myers
0b650f62a6 [RTEXTURES] Remove the panorama cubemap layout option (#4425)
* Remove the panorama cubemap layout, it was not implemented.
Left a todo in the code for some aspiring developer to finish.

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-24 09:06:24 +02:00
Ray
eb04154c98 Update Makefile 2024-10-24 01:35:44 +02:00
Ray
00c1f0836b Update Makefile 2024-10-24 01:35:37 +02:00
Ray
ea81436bef Update CHANGELOG 2024-10-24 00:14:36 +02:00
Ray
6184a2db3d ADDED: CHANGELOG for raylib 5.5 -WIP- 2024-10-23 23:29:49 +02:00
Ray
708089f560 Reviewed and reverted unneeded module check, rtextures should not depend on rtext 2024-10-23 23:29:05 +02:00
Ray
de6487b177 Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-23 23:28:08 +02:00
Ray
cd845368d8 Update skinning.fs 2024-10-23 23:28:01 +02:00
Asdqwe
157ee79a8e Add drawing for generic gamepad on core_input_gamepad example (#4424) 2024-10-23 20:31:57 +02:00
Franz
6f4407cb15 Fix typo in rshapes.c (#4421) 2024-10-23 17:04:15 +02:00
Cypress
df38564f62 Grammar fix in CONTRIBUTING.md (#4423)
"Can you write some tutorial/example?"
"Can you write some tutorials/examples?"
2024-10-23 17:03:50 +02:00
Asdqwe
fe6da67066 [examples] Add deadzone handling to core_input_gamepad example (#4422)
* Add deadzone handling to core_input_gamepad example

* Rename variables
2024-10-23 16:31:27 +02:00
Asdqwe
7a4a84a561 [rcore] Fix #4405 (#4420)
* Fix #4405 at runtime

* Add parameter validation

* Remove default global deadzone
2024-10-23 00:59:50 +02:00
Asdqwe
75a4c5bf20 Update core_input_gamepad example (#4416) 2024-10-23 00:28:20 +02:00
github-actions[bot]
ebcfc7f49e Update raylib_api.* by CI 2024-10-22 22:21:35 +00:00
Ray
4b60ce700f Update raylib.h 2024-10-23 00:21:14 +02:00
Ray
352f4ce2c4 Update config.h 2024-10-23 00:21:06 +02:00
Ray
79e2be68c2 Reviewed skinning shaders #4412 2024-10-23 00:20:59 +02:00
Sage Hane
53f7da2506 build.zig: Fix a minor issue with -Dconfig (#4418) 2024-10-22 18:31:26 +02:00
Sage Hane
55249faa58 build.zig: Re-add OpenGL to Linux deps (#4417) 2024-10-22 17:35:08 +02:00
Asdqwe
4cd243f0a3 Simplify EmscriptenResizeCallback() (#4415) 2024-10-22 13:44:53 +02:00
Sage Hane
b89bf0185a build.zig: Better specify Linux dependencies (#4406) 2024-10-22 13:20:09 +02:00
Ray
b2dca724c7 REVIEWED: skinning shader for GLSL 100 #4412 2024-10-22 10:41:43 +02:00
Anthony Carbajal
fe66bfb785 moved update out of draw area (#4413) 2024-10-22 10:31:44 +02:00
github-actions[bot]
2a0963ce09 Update raylib_api.* by CI 2024-10-21 22:06:52 +00:00
Asdqwe
f8f6aa0907 [rcore] Adds implementation to SetGamepadVibration() on PLATFORM_WEB and updates it on PLATFORM_DESKTOP_SDL to handle duration (#4410)
* Updates SetGamepadVibration()

* Handle MAX_GAMEPAD_VIBRATION_TIME

* Revert low/high parameters back to left/rightMotor

* Fix missin semicolon

* Convert duration to seconds

* Add SetGamepadVibration() implementation to PLATFORM_WEB
2024-10-22 00:06:37 +02:00
github-actions[bot]
ae150e9640 Update raylib_api.* by CI 2024-10-21 18:47:41 +00:00
Ray
cd3de0af0c Merge branch 'master' of https://github.com/raysan5/raylib 2024-10-21 20:47:10 +02:00
Ray
f4cbc1fbae REVIEWED: GetGestureHoldDuration() comments 2024-10-21 20:47:08 +02:00
Jeffery Myers
a2fcbc94fd [Raymath] Add matrix operators to raymath for C++ (#4409)
* Add matrix operators to raymath for C++

* Fix spaces
2024-10-21 18:38:42 +02:00
Ray
f60c6d472c Update raymath.h 2024-10-21 17:26:42 +02:00
Ray
f141c75cde Removed trailing spaces 2024-10-21 17:00:52 +02:00
Ray
c935ca3168 Reviewed formatting #4408 2024-10-21 16:59:55 +02:00
Rapha
f402147a63 Updated instanced rendering support loading (#4408) 2024-10-21 16:56:19 +02:00
Ray
7601468211 REVIEWED: Formatting and raymath version #4385 2024-10-21 16:25:45 +02:00
Jeffery Myers
72f8c354b0 [Raymath] Add C++ operator overloads for common math function (#4385)
* Update raylib_api.* by CI

* Add math operators for C++ to raymath

* better #define for disabling C++ operators

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-21 16:17:50 +02:00
Sage Hane
110ee74875 build.zig: Merge src/build.zig to build.zig (#4393)
* build.zig: Move `src/build.zig` to `build.zig`

* build.zig: Remove uses of `@src`

* build.zig: Update entry point
2024-10-21 12:57:11 +02:00
Asdqwe
9d0b1f0171 Adds SetWindowOpacity() implementation for PLATFORM_WEB (#4403) 2024-10-21 09:47:19 +02:00
Asdqwe
cb21fe88d3 Fix MaximizeWindow() for PLATFORM_WEB (#4404) 2024-10-21 09:45:46 +02:00
Asdqwe
4290a0d9f2 [rcore] [web] Updates SetWindowState() and ClearWindowState() to handle FLAG_WINDOW_MAXIMIZED for PLATFORM_WEB (#4402)
* Updates SetWindowState() and ClearWindowState() to handle FLAG_WINDOW_MAXIMIZED for PLATFORM_WEB

* Update MaximizeWindow() and RestoreWindow() to set/unset the FLAG_WINDOW_MAXIMIZED
2024-10-21 01:04:32 +02:00
Anthony Carbajal
680238689b removed extra update command (#4401) 2024-10-21 01:03:01 +02:00
Nikolas
51ff6586f4 [rtextures] ImageDraw(): Don't try to blend images without alpha (#4395) 2024-10-21 00:31:01 +02:00
Asdqwe
3dbbe60376 Adds MaximizeWindow() and RestoreWindow() implementation for PLATFORM_WEB (#4397) 2024-10-21 00:29:32 +02:00
Sage Hane
ce9259cd02 build.zig: Fix various issues around -Dconfig (#4398)
* build.zig: Fix various issues around `-Dconfig`

* build.zig: Parse all relevant flags from `src/config.h` at comptime
2024-10-21 00:27:25 +02:00
Le Juez Victor
23354e1551 correction of comments (#4400)
The indication of locations for bone ids and bone weights did not correspond to their default values ​​in config.h
2024-10-21 00:26:15 +02:00
Nikolas
902d3c92e3 [rl_gputex] Correctly load mipmaps from DDS files (#4399) 2024-10-21 00:25:33 +02:00
Sage Hane
dc5e6e0ad0 build.zig: Clean up my mess (#4387) 2024-10-18 21:03:27 +02:00
github-actions[bot]
c6d67f006d Update raylib_api.* by CI 2024-10-17 23:15:33 +00:00
Anthony Carbajal
80393c0fb6 [rcore] added sha1 implementation (#4390)
* added sha1 implementation

* added missing part

* fixed issue

* fix to match other implementations
2024-10-18 01:15:19 +02:00
Alan Arrecis
b201b74c3f Fix VSCode Makefile to support multiple .c files (#4391)
Updated the VSCode Makefile to allow compilation of multiple .c files instead of just one (main.c).
- Replaced `SRC` and `OBJS` definitions to dynamically include all .c and .h files in the project.
- This change enables automatic handling of any number of source files specifically in the VSCode setup.
2024-10-18 01:08:07 +02:00
Asdqwe
a2e31c4e1b Fix #4388 (#4392) 2024-10-17 15:35:49 +02:00
github-actions[bot]
d6399622a0 Update raylib_api.* by CI 2024-10-16 17:26:49 +00:00
Ray
8cbf34ddc4 WARNING: BREAKING: Renamed several functions for data validation #3930 2024-10-16 19:26:12 +02:00
github-actions[bot]
9b3d019502 Update raylib_api.* by CI 2024-10-16 14:50:42 +00:00
Ray
361b0e85c1 ADDED: Utility functions: ComputeCRC32() and ComputeMD5() 2024-10-16 16:49:50 +02:00
Jojaby
c9c830cb97 Fix rectangle width and height check to account for squares (#4382) 2024-10-15 19:04:30 +02:00
R-YaTian
8d267aaf23 qoi: Added support for image of channels 3 (#4384) 2024-10-15 19:03:17 +02:00
yuval_dev
99ff770edc Fix the type mismatch caused due to unsupported ?[]const u8 (#4383)
Co-authored-by: Yuval Herman <yuvalherman99@gmail.com>
2024-10-15 19:02:20 +02:00
Sage Hane
c18677e70f build.zig: Very minor fixes (#4381) 2024-10-13 20:24:39 +02:00
Ray
735308f8eb REVIEWED: CodepointToUTF8(), clean static buffer #4379 2024-10-13 20:02:40 +02:00
Sage Hane
bac3798ad3 build.zig: Fix @src logic and a few things (#4380) 2024-10-13 18:58:42 +02:00
Anand Swaroop
59417636ca Update BINDINGS.md (#4378) 2024-10-12 13:14:35 +02:00
github-actions[bot]
f5328a9bb6 Update raylib_api.* by CI 2024-10-10 19:17:48 +00:00
Ray
d29eb34cfb REMOVED: LoadImageSvg() 2024-10-10 21:17:31 +02:00
Ray
1effe92129 WARNING: REMOVED: SVG files loading and drawing, moving it to raylib-extras 2024-10-10 20:37:46 +02:00
Sage Hane
d3f86eb957 build.zig: Improve logic (#4375)
* build.zig: Fix `@src` logic

* build.zig: Clarify build error

* build.zig: Add option for enabling `raygui`

* build.zig: Expose `Options` type
2024-10-10 18:56:43 +02:00
William Culver
c4be013294 Fix build.zig (#4374) 2024-10-10 18:56:29 +02:00
Harald Scheirich
454acca84b Some update to gltf loading (#4373)
Only warns when there are more animations than currently implemented
Allows mesh indices to be unsigned char
2024-10-10 18:53:02 +02:00
Ray
3fb1ba25ac Removed tabs and triple line-breaks 2024-10-08 18:45:52 +02:00
Colleague Riley
44e37c5f97 Update RGFW (#4372)
* (rcore_desktop_rgfw.c) fix errors when compiling with mingw

* define WideCharToMultiByte

* update RGFW

* move stdcall def to windows only

* fix raw cursor input
2024-10-08 18:39:15 +02:00
Anthony Carbajal
712ab798d1 updated makefile to disable wayland by default (#4369) 2024-10-08 18:33:33 +02:00
Ray
89a37cd315 Update CHANGELOG 2024-10-07 21:03:55 +02:00
Anthony Carbajal
43b109a4e3 removed old comment (#4370) 2024-10-07 09:32:04 +02:00
Visen
b290d47bd5 [zig] Fix build.zig bug (#4366)
* fixed zig config.h bug

* zig fmt
2024-10-06 15:52:01 +02:00
Magnus Oblerion
74ce90ce67 [example] Input virtual controls example (#4342)
* Add files via upload

* Update core_input_gamepad_virtual.c

* Add files via upload

* Update and rename core_input_gamepad_virtual.c to core_virtual_Dpad.c

* Update and rename core_virtual_Dpad.c to core_input_virtual_controls.c

* Delete examples/core/core_input_gamepad_virtual.png

* Add files via upload

* Update Makefile

* Update Makefile.Web

* Update README.md

* Update README.md

* Create core_input_virtual_controls.vcxproj

* Delete projects/VS2022/examples/core_input_virtual_controls.vcxproj
2024-10-06 15:47:47 +02:00
Ray
f9e709915a Fix #4355 2024-10-04 11:24:02 +02:00
Anthony Carbajal
d06287d562 taken from FluxFlus PR (#4363) 2024-10-04 11:16:03 +02:00
Anthony Carbajal
da95f88c36 updated camera speeds with GetFrameTime (#4362) 2024-10-04 11:15:43 +02:00
Kacper Zybała
cded378205 [build] CMake: Fix GRAPHICS check (#4359) 2024-10-04 11:08:12 +02:00
Nikolas
0ef0791854 Allow Zig build script to change desktop backend (#4358) 2024-10-04 11:05:19 +02:00
Ashley Chekhov
20ce8ba046 Typo fix (#4356)
Seemed to be a typo. Hope this helps.
2024-10-04 11:04:26 +02:00
Asdqwe
96d91a3892 [rlgl] Fix rlgl standalone defaults (#4357)
* Fix rlgl standalone defaults

* Fix rmodels
2024-10-02 11:41:21 +02:00
Jeffery Myers
09987b01cc [MODELS] Better fix for GPU skinning issues (#4353)
* Make the max VBO match the animation flag.

* re-enable GPU skinning for mac, and fix the max buffer to be correct based on the GPU skinning support flag.
2024-10-02 10:49:56 +02:00
Asdqwe
d9c10ed264 Fixes GetClipboardText() memory leak for PLATFORM_DESKTOP_SDL (#4354) 2024-10-02 10:49:06 +02:00
Asdqwe
282d6478ba Complements the #4348 GPU skinning fix (#4352) 2024-10-01 12:09:06 +02:00
Jeffery Myers
0e7bcd5639 [MODELS] Disable GPU skinning for MacOS platform (#4348)
* Update raylib_api.* by CI

* Disable GPU skinning on MacOS
Add GPU skinning example to MSVC Projects.

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-30 12:10:02 +02:00
Ray
84a4d93bc4 Fix #4349 2024-09-30 12:06:53 +02:00
Jeffery Myers
0573ef0382 [SHAPES] Add more detail to comment for DrawPixel (#4344)
* Update raylib_api.* by CI

* Add comment that draw pixel uses geometry and may be slow

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-27 23:06:54 +02:00
Menno van der Graaf
55e83468c9 Fix isGpuReady flag on android (#4340) 2024-09-24 20:02:54 +02:00
Ray
13178b9373 Update rcore.c 2024-09-22 23:01:22 +02:00
Ray
291063c98f Update rcore.c 2024-09-22 22:56:21 +02:00
Ray
24a1cd8c5b Update rcore.c 2024-09-22 22:50:47 +02:00
Ray
352c450ad0 Update rcore.c 2024-09-22 22:43:35 +02:00
Ray
a643dd058b Merge branch 'master' of https://github.com/raysan5/raylib 2024-09-22 22:36:26 +02:00
Ray
100f6624d6 Update rcore.c 2024-09-22 22:36:17 +02:00
github-actions[bot]
1c7b18923c Update raylib_api.* by CI 2024-09-22 20:11:24 +00:00
Ray
55a25ac04b ADDED: MakeDirectory() 2024-09-22 22:11:08 +02:00
Ray
1eb8ff5e54 LoadFontDefault(): Initialize glyphs and recs to zero #4319 2024-09-22 18:05:58 +02:00
Daniil Kisel
7d3f04ca35 Update BINDINGS.md (#4337)
Updated Lean4 bindings
2024-09-22 14:36:06 +02:00
Daniil Kisel
daaca40416 Update parser's readme to mirror fixed help text (#4336) 2024-09-22 13:45:10 +02:00
Ridge3Dproductions
9337913766 Projects: Fix CMake example project (#4332)
* Update CMakeLists.txt

Add missing link flags

* Update README.md

Remove unneeded flag because this flag is defined in the updated CMakeList file

* Update CMakeLists.txt
2024-09-21 23:12:48 +02:00
Asdqwe
212b1e5fe7 Fix rlgl standalone defaults (#4334) 2024-09-21 23:11:40 +02:00
Ray
e5d0cc978a Some minor tweaks 2024-09-20 17:32:01 +02:00
github-actions[bot]
c09dadd9b5 Update raylib_api.* by CI 2024-09-20 15:30:53 +00:00
Daniel Holden
86ead96263 [rmodels] Optional GPU skinning (#4321)
* Added optional GPU skinning

* Added skinned bone matrices support for different file formats.

* Moved new shader locations to end of enum to avoid breaking existing examples. Added gpu skinning on drawing of instanced meshes.

* Added GPU skinning example.

* Removed variable declaration to avoid shadowing warning.
2024-09-20 17:30:37 +02:00
Brian E
2f0cf8fbe1 [BINDINGS.md] Added raylib-bqn, moved rayed-bqn (#4331)
* [BINDINGS.md] Added raylib-bqn, moved rayed-bqn

rayed-bqn has had a lot of progress and I've realized it has diverged too much from raylib, and so I made raylib-bqn to be a simple binding, while rayed-bqn will be a utility wrapper.

* removed accidental newline
2024-09-20 09:01:15 +02:00
github-actions[bot]
c762a99bd5 Update raylib_api.* by CI 2024-09-17 15:30:59 +00:00
Ray
0a03ed913b Update raylib.h 2024-09-17 17:30:40 +02:00
Ray
c2bd1845eb Reviewed #4323 2024-09-17 10:30:26 +02:00
Ray
627e76cf7b REVIEWED: Directory filter tag #4323 2024-09-17 10:26:32 +02:00
Ray
186787e311 Merge branch 'master' of https://github.com/raysan5/raylib 2024-09-15 13:21:22 +02:00
Ray
0e4ebaf89d REVIEWED: DrawTexturePro() to avoid negative dest rec #4316 2024-09-15 13:20:43 +02:00
github-actions[bot]
7ec1c288be Update raylib_api.* by CI 2024-09-15 11:05:15 +00:00
foxblock
16e9317220 [rcore] Add filtering folders to LoadDirectoryFilesEx()/ScanDirectoryFiles() (#4302)
* Add filtering folders in ScanDirectoryFiles and ScanDirectoryFilesRecursively

Add define FILTER_FOLDER for that purpose
Fix folder names matching filter being added to result

* Move FILTER_FOLDER define to internals of rcore and document option in comment
2024-09-15 13:05:01 +02:00
Ray
329b2df4f2 Merge branch 'master' of https://github.com/raysan5/raylib 2024-09-15 13:03:38 +02:00
Ray
e9bbf02b2b Update rtextures.c 2024-09-15 13:03:12 +02:00
github-actions[bot]
8d92e65773 Update raylib_api.* by CI 2024-09-15 11:02:18 +00:00
Ray
b807f633d9 REVIEWED: ColorLerp() formatting #4310 2024-09-15 13:01:59 +02:00
github-actions[bot]
68e7cadabc Update raylib_api.* by CI 2024-09-15 10:56:01 +00:00
SusgUY446
ddc523ffbe [rtextures] add MixColors. a function to mix 2 colors together (#4310)
* added MixColors function to mix 2 colors together (Line 1428 raylib.h and Line 4995 in rtextures.c)

* renamed MixColors to ColorLerp (https://github.com/raysan5/raylib/pull/4310#issuecomment-2340121038)

* changed ColorLerp to be more like other functions

---------

Co-authored-by: CI <-ci@not-real.com>
2024-09-15 12:55:45 +02:00
base
d02fcc5262 chore: GetApplicationDirectory definition for FreeBSD (#4318) 2024-09-15 12:51:20 +02:00
Jett
ed702673ea fix for hardcoded index values in vboID array (#4312)
changing any of the #defines in CONFIG.H would cause issues when rendering.
2024-09-11 22:57:19 +02:00
Alex
fd961deba7 Update BINDINGS.md (#4311)
I've updated the bindings
2024-09-10 07:44:25 +02:00
masnm
0656440e38 fix vld1q_f16 undeclared in arm on stb_image_resize2.h v2.10 (#4309) 2024-09-08 20:24:53 +02:00
masnm
10b01ba7c2 Change implicit conversion to explicit conversion to remove warning (#4308) 2024-09-06 23:16:17 +02:00
Chris Warren-Smith
ed61bdb568 Fix seg fault with long comment lines (#4306)
#4304
2024-09-04 13:07:00 +02:00
Michał Jaskólski
42022c3531 fix: In certain cases the connector status is reported UNKNOWN, should be conisdered as CONNECTED (#4305)
Co-authored-by: Michal Jaskolski <michal.jaskolski@hexagon.com>
2024-09-03 14:38:12 +02:00
carverdamien
59b44a4908 Add uConsole mapping (#4297) 2024-09-02 10:01:30 +02:00
hanaxars
5f49ec3d64 Fix missing equal sign (#4294)
I just noticed there is a missing equal sign. This PR fixes this.
2024-08-28 18:35:35 +02:00
Hesham Abourgheba
8ea5db3ec4 fix(rcore/android): Allow main() to return it its caller on configuration changes. (#4288) 2024-08-25 18:51:08 +02:00
Jeffery Myers
91a9888baa [rModels] Correctly split obj meshes by material (#4285)
* Correctly split meshes from tinyobj by material so they can be represented by raylib correctly

* PR Feedback
2024-08-25 18:49:52 +02:00
Ray
f5ef357810 Update rtext.c 2024-08-25 13:55:53 +02:00
Ray
5604f6d8a3 Update rlgl.h 2024-08-25 12:57:05 +02:00
Ray
157c7c21d4 ADDED: more uniform data type options #4137 2024-08-25 12:52:27 +02:00
Ray
dec7f12b14 Update raylib.h 2024-08-25 12:51:55 +02:00
Tchan0
8dbf371244 Examples makefiles: align /usr/local with /src Makefile (#4286)
* align /usr/local with src Makefile

Align /usr/local with the /src Makefile, where it can be overriden.

* /usr/local: allow override

align /usr/local with the /src Makefile, where it can be overriden
2024-08-25 11:23:08 +02:00
Tchan0
d314afc451 rlgl.h: glint64 did not exist before OpenGL 3.2 (#4284)
Compilation breaks on rlgl.h for early OpenGL versions.
Glint64 did not exist on those versions (< OpenGL 3.2)
2024-08-24 20:35:49 +02:00
Dave Green
0c06a08e07 [rcore][desktop_glfw] Keeping CORE.Window.position properly in sync with glfw window position (#4190)
* WindowPosCallback added.

CORE.Window.position is now properly kept in sync with the glfw window position.

* Update rcore_desktop_glfw.c

Comments updated.

* Setting CORE.Window.position correctly in InitPlatform() as well.

This also fixes not centering the window correctly when the high dpi flag was enabled.

* Fixes centering the window in the SetWindowMonitor() function.

Here the render size has to be used again in case the high dpi flag is enabled.

* Update Window Position

Update Window Position right away in ToggleFullscreen() & ToggleBorderlessWindowed() functions
2024-08-24 20:33:21 +02:00
Jeffery Myers
0aba21f71c [RCORE] Update comments on fullscreen and boderless window to describe what they do (#4280)
* Update raylib_api.* by CI

* update fullscreen and borderless comments to better describe what they do.

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-24 20:31:28 +02:00
Ray
4c9282b090 ADDED: isGpuReady flag, allow font loading with no GPU acceleration 2024-08-24 18:59:24 +02:00
Ray
78e86b6ea5 Update rlgl.h 2024-08-24 18:58:43 +02:00
Ray
414133dbe7 Update models_point_rendering.c 2024-08-24 18:56:06 +02:00
Colleague Riley
bc0bd98763 (rcore_desktop_rgfw.c) fix errors when compiling with mingw (#4282)
* (rcore_desktop_rgfw.c) fix errors when compiling with mingw

* define WideCharToMultiByte
2024-08-24 18:43:46 +02:00
github-actions[bot]
dfd8055270 Update raylib_api.* by CI 2024-08-24 16:42:52 +00:00
Reese Gallagher
7bde76ca2c [rmodels] More performant point cloud rendering with DrawModelPoints() (#4203)
* Added the ability to draw a model as a point cloud

* Added example to demonstrate drawing a model as a point cloud

* polished the demo a bit

* picture for example

* adhere to conventions for example

* update png to match aspect ratio

* minor changes

* address code convention comments

* added point rendering to makefiles

* added point rendering to readme and renumbered examples

* comment formatting

---------

Co-authored-by: Reese Gallagher <re325479@ucf.edu.com>
Co-authored-by: Ray <raysan5@gmail.com>
2024-08-24 18:42:38 +02:00
konstruktor227
b0c3013b51 [raudio] Support 24-bit FLACs in LoadMusicStreamFromMemory (#4279)
Force conversion to 16-bit, same as how it is done in `LoadMusicStream`.
This fixes the problem where 24-bit FLACs play silence or broken sound.
2024-08-23 22:51:29 +02:00
Menno van der Graaf
3079c69725 Replace deprecated Android function ALooper_pollAll with ALooper_pollOnce (#4275) 2024-08-23 22:32:20 +02:00
Peter0x44
ecf863969c [build] CMake: Fix warnings in projects/CMake/CMakeLists.txt (#4278)
Currently, when building, the cmake example in projects/CMake gives this
warning, with CMake 3.30.2

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(raylib) is deprecated, call
  FetchContent_MakeAvailable(raylib) instead.  Policy CMP0169 can be set to
  OLD to allow FetchContent_Populate(raylib) to be called directly for now,
  but the ability to call it with declared details will be removed completely
  in a future version.
Call Stack (most recent call first):
  CMakeLists.txt:20 (FetchContent_Populate)
This warning is for project developers.  Use -Wno-dev to suppress it.

Changing FetchContent_Populate to FetchContent_MakeAvailable didn't
cause any issues I could observe when building. I'm not sure why it
wasn't like that to begin with.
2024-08-23 22:29:40 +02:00
Bugsia
77172e34db Fixing GenImagePerlinNoise() being stretched, if Image is not rectangular (#4276) 2024-08-23 22:22:36 +02:00
Peter0x44
74350fa7cf [build] CMake: Delete BuildOptions.cmake (#4277)
This file seems to not do anything useful. From what I can tell the
OSX_FATLIB option sets CMAKE_OSX_ARCHITECTURES to "x86_64;i386". This
doesn't account for the arm that apple now has, as well as 32 bit
support being completely removed, and I think it's entirely reasonable
to expect users to pass the necessary architectures they want
themselves. It's possible this could break some users who rely on this,
but I sincerely doubt anyone does. The solution is trivial either way
(put -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" on the command line
yourself)

The second part of BuildOptions.cmake claims to set PLATFORM to "Web" if
the emscripten toolchain file is used (if (EMSCRIPTEN)), but it does not
work correctly anyway. Currently, glfw searches for wayland and x11
libraries and fails likeso:

CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:
   - wayland-client>=0.2.7
   - wayland-cursor>=0.2.7
   - wayland-egl>=0.2.7
   - xkbcommon>=0.5.0

Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  src/external/glfw/src/CMakeLists.txt:163 (pkg_check_modules)

Considering this code doesn't work as described, it's okay to delete it.
I think a better check should be implemented, but that is for a
different PR.
2024-08-23 22:21:22 +02:00
listeria
cc88e0b780 rtext: always multiply by sign in TextToFloat() (#4273)
Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
2024-08-21 17:45:14 +02:00
Jeffery Myers
c8bee7c439 [rmodels] Add a warning when loading an OBJ with multiple materials. (#4271)
* Update raylib_api.* by CI

* Add a temp warning about material assignments during OBJ loading if the file has more than one material. To be replaced when the OBJ translation code is fixed.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-21 17:11:59 +02:00
github-actions[bot]
bae0af241e Update raylib_api.* by CI 2024-08-21 12:08:09 +00:00
Paperdomo101
fa3f73d881 [rshapes] Review DrawGradient color parameter names (#4270)
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4);

Have been changed to:

void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer);
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom);
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right);
void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight);
2024-08-21 14:07:52 +02:00
Ray
039df36f4b REVIEWED: Automation events mouse wheel #4263 2024-08-20 19:13:18 +02:00
hanaxars
7fab03c0b4 Fix warnings (#4264)
Fix following gcc warnings when SVG enabled:

rtextures.c: In function 'LoadImageSvg':
rtextures.c:374:52: warning: pointer targets in passing argument 1 of 'nsvgParse' differ in signedness [-Wpointer-sign]
  374 |             struct NSVGimage *svgImage = nsvgParse(fileData, "px", 96.0f);
      |                                                    ^~~~~~~~
      |                                                    |
      |                                                    unsigned char *
In file included from rtextures.c:230:
external/nanosvg.h:2952:28: note: expected 'char *' but argument is of type 'unsigned char *'
 2952 | NSVGimage* nsvgParse(char* input, const char* units, float dpi)
      |                      ~~~~~~^~~~~
rtextures.c:407:43: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
  407 |         if (isSvgStringValid && (fileData != fileNameOrString)) UnloadFileData(fileData);
      |                                           ^~
rtextures.c: In function 'LoadImageFromMemory':
rtextures.c:614:52: warning: passing argument 1 of 'nsvgParse' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  614 |             struct NSVGimage *svgImage = nsvgParse(fileData, "px", 96.0f);
      |                                                    ^~~~~~~~
external/nanosvg.h:2952:28: note: expected 'char *' but argument is of type 'const unsigned char *'
 2952 | NSVGimage* nsvgParse(char* input, const char* units, float dpi)
      |                      ~~~~~~^~~~~
2024-08-19 13:41:20 +02:00
Colleague Riley
b432aa2b9c Update RGFW (#4259)
* update RGFW

* fix bug with GetCurrentMonitor

* update RGFW

* update RGFW

* clean up merge

* update RGFW
2024-08-17 14:00:54 +02:00
Lázaro Albuquerque
308b77cd42 Fix warnings (#4251)
* Update rmodels.c

fix these warnings:

```
/src/rmodels.c:5744:17: warning: missing initializer for field 'w' of 'Vector4' [-Wmissing-field-initializers]
[build]  5744 |                 Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2]};
[build]       |                 ^~~~~~~
```

* Update rcore_web.c

fix warnings
2024-08-17 01:07:23 +02:00
Ray
f70d8a33cb REVIEWED: Shader load failing returns 0, instead of fallback 2024-08-17 00:46:08 +02:00
Ray
fa374f9cc9 Update webassembly.yml 2024-08-17 00:44:33 +02:00
Brian E
63ae57d2e3 Added raylib-APL to BINDINGS.md (#4253)
* Added raylib-APL to BINDINGS.md

* added back the newline

* Made APL binding be version 5.0 instead of auto

Also alligned the bars of the new entry.
2024-08-15 10:05:34 +02:00
Lázaro Albuquerque
6e644a27fc Change some global variables to have internal linkage (#4252)
* Change some global variables to have internal linkage

* Update rcore.c

* Update rcore.c
2024-08-13 19:16:07 +02:00
hanaxars
65c4003546 Make camera movement independant of framerate (#4247)
Instead of moving camera with constant speed per frame, speed is multiplied with delta time before movement.
2024-08-12 18:47:52 +02:00
Anthony Carbajal
418b878053 [Examples] set FPS to 60 (#4235)
* set FPS to 60

* remove extra commented lines
2024-08-10 20:07:23 +02:00
Asdqwe
46cb6af437 Fix core_input_gamepad_info example so all buttons are displayed within the window (#4241) 2024-08-09 19:03:14 +02:00
Maxim Knyazkin
13491a485a Fixed compilation for OpenGL ES (#4243) 2024-08-09 19:02:18 +02:00
Anthony Carbajal
e4529ff8f9 update text input box (#4229) 2024-08-09 09:18:00 +02:00
Anthony Carbajal
3c5bdae7ab update shapes bouncing ball (#4226) 2024-08-09 09:16:05 +02:00
Anthony Carbajal
06aeb21429 update shaders basic pbr (#4225) 2024-08-09 09:15:07 +02:00
Anthony Carbajal
85c6489d81 update models box collisions (#4224) 2024-08-09 09:12:26 +02:00
Anthony Carbajal
243801c2d1 update text writing anim (#4230) 2024-08-09 09:07:56 +02:00
Maxim Knyazkin
2590a30d04 [rlgl] Adding warnings in case OpenGL 4.3 is not enabled (#4202)
* Adding warnings for OpenGL 4.3

* Removed logging from frequently called functions
2024-08-09 09:05:46 +02:00
NishiOwO
fe9e371f27 [miniaudio] Fixing miniaudio and Makefile for NetBSD (#4212)
* fixing miniaudio

* another fix for NetBSD

* adding wl-r. should not affect other bsd
2024-08-09 09:04:18 +02:00
Anthony Carbajal
070c1c9d63 update examples missing unloadtexture (#4234) 2024-08-09 09:03:27 +02:00
Anthony Carbajal
5233b80fb7 update raygui (#4238) 2024-08-09 08:55:16 +02:00
Jeffery Myers
9ef678d90a Fix warnings (#4239)
* Update raylib_api.* by CI

* Fix typecast warnings

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-09 08:54:22 +02:00
freakmangd
cae0946764 Fix build.zig and use zig fmt (#4242)
+ `std.mem.split` is deprecated, `splitScalar` seems like the intended choice here
+ zig files should be formatted according to `zig fmt`
2024-08-09 08:53:29 +02:00
kai-z99
97c02b2425 [examples] Fix some examples (#4211)
* Add text

* small typo
2024-08-07 01:05:53 +02:00
Ray
5af331d708 REVIEWED #4206 2024-08-07 01:01:45 +02:00
Ray
db8b199363 Reviewed shader 2024-08-06 18:32:14 +02:00
CDM15y
b44b759b8f [examples][shaders_raymarching] Add raymarching.fs for GLSL120 (#4183)
* Create raymarching.fs

* Update raymarching.fs

* Update raymarching.fs

* Update raymarching.fs

Remove `fragColor` as it is unused

Move the license to the top of the code to improve readability.
2024-08-06 18:30:15 +02:00
Anthony Carbajal
4b84b5563e Update audio mixed processor (#4214)
* updated audio mixed processor

* remove float cast, better parenthesis
2024-08-06 18:29:10 +02:00
lnc3l0t
8b714e9dd9 [build.zig] check if wayland-scanner is installed (#4217)
#4150 introduced a default value for linux_display_backend,
which makes X11-only systems fail to build.
2024-08-06 18:28:33 +02:00
Ray
9c2ba3bfb7 REVIEWED: possible overflow... again #4206 2024-08-04 23:22:27 +02:00
Ray
923f983719 REVIEWED: Possible overflow #4206 2024-08-04 22:08:38 +02:00
Ray
b657001e0d REVIEWED: shaders_vertex_displacement 2024-08-04 22:06:20 +02:00
lnc3l0t
b2d48ff172 [build.zig] Override config.h definitions (#4193)
* [build.zig] Overridable definitions from config.h
The new Options field "config" holds a string the user can set in the
format "-Dflag_a=1 -Dflag_b=0 ..." to override the values set in
`config.h`.
The file is parsed and the default values are appended to the
compilation flags, if the user doesn't override them.
The user string is appended to the compilation flags.
The "-DEXTERNAL_CONFIG_FLAGS" is added to prevent "config.h" inclusion.

Note: a certain format is assumed for the formatting of config.h
Note: this commit references the closed issue #3516

* [build.zig] Only SUPPORT_* definitions are overridable

Lines from `config.h` which contains "SUPPORT" are added to compilation after being parsed:
- remove whitespace
- format to preprocessor option https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

The user supplied flags have priority over the ones read from the file.

NOTE: extension to commit 4da7f82e6f, the logic is simplified
because the SUPPORT flags only have binary values, which makes them easier to parse.
2024-08-04 22:01:28 +02:00
Dave Green
596cc3a645 [rcore][desktop_glfw] Set AUTO_ICONIFY flag to false per default (#4188)
* GLFW AUTO_ICONIFY flag is now set to false per default.

Previously AUTO_ICONIFY was only disabled if the user requested a Fullscreen window from the start. After that it was not possible to change this behavior on the user side anymore, even when changing to a Fullscreen window.

The AUTO_ICONIFY causes problems on macOS. On macOS if the window is minimized because of AUTO_ICONIFY than the only way to restore it is to click on the icon in the dock. In other words when AUTO_ICONIFY is enabled alt/cmd-tabbing through windows does not work correctly. On windows it works even when AUTO_ICONIFY is enabled.

Additionally if a raylib window is in Fullscreen mode on another monitor the AUTO_ICONIFY behavior is a problem because the user might want to window to stay on the monitor even if it loses focus. (problem on all OS's)

AUTO_ICONIFY also restores the monitor hardware resolution if a fullscreen window loses focus.

* Update rcore_desktop_glfw.c

Extra space removed and comments updated with a space at the beginning
2024-08-04 21:59:48 +02:00
Alex ZH
43b0c9410e [examples] Add new example: shaders_vertex_displacement (#4186)
* shaders-vertex_displacement init

* implement simulation of wave in ocean

* update examples/README & add some comments

* update comments

* add gl100 shaders
2024-08-04 21:58:26 +02:00
Randy Palamar
92f60a99f6 [rlgl] use GLint64 for glGetBufferParameteri64v (#4197) 2024-08-04 21:53:56 +02:00
Anthony Carbajal
6595bab8ff update make for examples (#4209) 2024-08-04 21:45:50 +02:00
Rico P
a8ec8472ff replace unicode characters by ascii characters in jar_xml to avoid warning in MSVC (#4196) 2024-08-02 21:04:33 +02:00
maxmutant
9e39788e07 [rcore] fix gamepad axis movement and its automation event recording (#4184)
* [rcore] fix gamepad axis movement and its automation event recording

This commit fixes 2 issues:
- Automation events aren't recorded for negative axis movements on
  gamepads (e.g. stick going left/up)
- 'GetGamepadAxisMovement' drift check isn't working correctly for
  triggers. Axis values between [-0.1, 0.1] are clamped to 0.0

Behaviour change:
- 'GetGamepadAxisMovement' returns default value for each axis, even
  if gamepad isn't attached.

* [rcore] inline body of 'GetGamepadAxisMovementDefault' and remove it
2024-07-28 22:07:47 +02:00
Dave Green
e5a1fc4f20 No longer set the RL_TEXTURE_FILTER_LINEAR when high dpi flag is enabled. (#4189) 2024-07-27 20:19:05 +02:00
Ray
efce4d69ce Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-25 11:44:59 +02:00
Ray
5041d20f00 Update rcore_desktop_glfw.c 2024-07-25 11:44:49 +02:00
Jutastre
f5d2f8d545 Warning on invalid image data (#4179)
* Adds log warnings on invalid file data

* Separate error on missing file extension

* Changed LOG_ERROR to LOG_WARNING

---------

Co-authored-by: Jutastre <pukarlindgren@gmail.com>
2024-07-24 21:21:45 +02:00
Lázaro Albuquerque
bbcb0109e1 Add default vertex/fragment shader to OpenGL ES 3.0 based on the ones from OpenGL 3.3 (#4178) 2024-07-23 21:10:23 +02:00
Lázaro Albuquerque
30f9ca7eb6 A better default that saves the whopping amount of 28KB on the final bundle (#4177) 2024-07-22 22:23:03 +02:00
Colleague Riley
f1f08861a1 Update RGFW (#4176)
* update RGFW

* fix bug with GetCurrentMonitor

* update RGFW

* update RGFW

* clean up merge
2024-07-22 22:19:09 +02:00
Jaen
047a4da696 Fix Carp link - BINDINGS.md (#4175)
The current link 404's. Replace it with a fork.
2024-07-21 13:44:34 +02:00
github-actions[bot]
ad72e3ec8f Update raylib_api.* by CI 2024-07-21 08:28:53 +00:00
Ray
474ab48f8b Update rtextures.c 2024-07-21 10:28:34 +02:00
Ray
fde0dcd0ab ADDED: Working directory info at initialization 2024-07-21 10:28:23 +02:00
Ray
fc5eab5676 Update version to avoid confusions...
...considering that `raylib 5.5` official release could still take some time...
2024-07-21 10:28:01 +02:00
CDM15y
2d94d8d06d [examples] Fix PBR and Shadowmap example shaders for GLSL 1.20 (#4167)
* Update pbr.fs

remove presicion mediump float because it is for GLES, and not desktop GL

* Fix shadowmap.fs

also suffers the same problem as pbr.fs
2024-07-20 10:42:55 +02:00
Julianiolo
aa70d32786 Fix a dependance of rtexture to rtext (#4171) 2024-07-20 10:39:14 +02:00
Ray
996f50393e Minor tweaks 2024-07-19 00:39:58 +02:00
Ray
61393fff1f Update rcore_desktop_glfw.c 2024-07-19 00:39:11 +02:00
_Tradam
50000f4b01 added brainfuck bindings (#4169) 2024-07-18 21:06:18 +02:00
Lázaro Albuquerque
24726a4bc2 Removes the redundant USE_AUDIO flag (#4158) 2024-07-16 14:16:41 +02:00
red thing
0c03cbff90 Update BINDINGS.md: dray binding supports raylib 5.0 (#4163) 2024-07-16 14:00:30 +02:00
MrScautHD
576bee5cce Adding GetKeyName(int key) (WIP) (#4161) 2024-07-16 14:00:00 +02:00
jkaup
5ede47618b Fix crash when switching playback device (#4102)
Co-authored-by: jj <noname@nomail.fi>
2024-07-13 23:10:28 +02:00
Kai Kitagawa-Jones
8d5374a443 Replace glGetInteger64v with glGetBufferParameteri64v (#4154) 2024-07-11 21:31:13 +02:00
InventorXtreme
44c6cd2d37 [build.zig] GLFW Platform Detection Support (#4150)
* Zig Both Linux Desktop Platform Support

* Formating and Default Fix
Made formating fit within raylib standards and changed the default option to support both X11 and wayland on Linux.

* caught one hiding tab
2024-07-11 09:59:26 +02:00
Jeffery Myers
74680748b9 [Shapes] Remove duplicate color calls in DrawGrid (#4148)
* Update raylib_api.* by CI

* No need to call the color 4 times in a row, it's batched

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-09 19:45:07 +02:00
SuperUserNameMan
174313acbf WindowSizeCallback() should not try to handle DPI since already managed by GLFW (#4143)
If `FLAG_WINDOW_HIGHDPI` is set, `InitPlatform()` will aks GLFW to handle resize window content area based on the monitor content scale using : ` glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); `

So `WindowSizeCallback()` does not have to handle it a second time.
2024-07-09 09:23:14 +02:00
Ray
fa03246d0e REVIEWED: Code formatting to follow raylib conventions 2024-07-09 09:21:57 +02:00
Colleague Riley
98662b6a4a update RGFW to RGFW 1.0 (#4144)
* update RGFW

* fix bug with GetCurrentMonitor
2024-07-09 09:12:03 +02:00
Ray
3abe728712 Minor tweaks 2024-07-08 22:54:19 +02:00
NishiOwO
598b7f5210 Add workaround for NetBSD (#4139) 2024-07-08 22:47:35 +02:00
Ray
9764fef262 Update models_billboard.c 2024-07-07 21:02:35 +02:00
Ray
43fe992b94 Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-07 21:02:29 +02:00
Ray
b8e5179431 Update rmodels.c 2024-07-07 21:02:20 +02:00
github-actions[bot]
bc6cf61794 Update raylib_api.* by CI 2024-07-07 18:57:40 +00:00
Ray
df4ff4e78b REVIEWED: Direction must be normalized #4131 2024-07-07 20:57:18 +02:00
bohonghuang
6dd2a0e645 [rmodels] Consistent DrawBillboardPro with DrawTexturePro (#4132)
* [rmodels] Re-implement `DrawBillboardPro`

* [rmodels] Add comments to `DrawBillboardPro`

* [rmodels] Make `DrawBillboardPro` consistent with `DrawTexturePro`

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-07 20:27:51 +02:00
Ninad Sachania
b61303244c Fix Reddit badge (#4136) 2024-07-07 10:47:44 +02:00
Ray
a8240722c6 REVIEWED: CheckCollisionPointRec() 2024-07-07 09:09:34 +02:00
kai-z99
1039e3c1bd [rshapes] Give CheckCollisionPointCircle() its own implementation (#4135)
* remove function call

* fix
2024-07-07 09:05:25 +02:00
Ray
9a280cda0b Update rlgl.h 2024-07-04 11:12:24 +02:00
Ray
c95b2e88b7 Example review 2024-07-04 11:12:20 +02:00
Frank Kartheuser
8fbb447a6d Change SDL_Joystick to SDL_GameController (#4129)
With SDL_Joystick my game controller wasn't working properly. That's why I changed it to SDL_GameController.
2024-07-04 00:01:40 +02:00
Jeffery Myers
9d3bd43c6e [CORE] Fix MSVC warnings/errors and raymath.h in C++ (#4125)
* Update raylib_api.* by CI

* Fix MSVC warnings.
Make raymath.h work in C++ in MSVC

* whitespace cleanup

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-01 22:03:21 +02:00
Ray
ab20b2179f Update Makefile 2024-07-01 18:56:06 +02:00
Ray
9f47e562d9 Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-01 18:49:54 +02:00
Ray
18d726be65 Update Makefile 2024-07-01 18:49:47 +02:00
github-actions[bot]
899d03e77e Update raylib_api.* by CI 2024-07-01 16:31:58 +00:00
Ray
2efd36a124 Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-01 18:31:33 +02:00
Ray
2f49250baf WARNING: UPDATE: Starting works on raylib 5.5 release 2024-07-01 18:31:16 +02:00
github-actions[bot]
6d30220acc Update raylib_api.* by CI 2024-07-01 16:30:47 +00:00
Ray
fbd79cde5f Reverted memory allocators additional checks 2024-07-01 18:30:22 +02:00
Ray
d243094ede WARNING: BREAKING: Renamed PLATFORM_DESKTOP to PLATFORM_DESKTOP_GLFW
This could potentially be a breaking change, for consistency, now every possible desktop backend has the proper name assigned: GLFW, SDL, RGFW
raylib build system has been reviewed to fallback to `PLATFORM_DESKTOP_GLFW` by default when `PLATFORM_DESKTOP` defined
2024-07-01 18:28:44 +02:00
github-actions[bot]
1fb0565148 Update raylib_api.* by CI 2024-07-01 11:06:39 +00:00
Ray
2bc75b877a WARNING: TEST: Security check to address potential overflow cocerns 2024-07-01 13:06:15 +02:00
Ray
a1d516354e Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-01 13:06:00 +02:00
Ray
61cfd1afcb Minor tweaks 2024-07-01 13:05:20 +02:00
Bruno Cabral
b5473d5ffd [rtextures] advance k in LoadImageColors (#4120)
Some formats are not advancing k to get pixels values
2024-07-01 12:24:01 +02:00
Mike Will
9e22fddf1a [build.zig] Make emscripten build compatible with Zig 0.13.0 (#4121) 2024-07-01 12:22:12 +02:00
Ray
c8313d9ebc Update Storage base path, use provided SDL base path 2024-07-01 11:44:20 +02:00
github-actions[bot]
4c90fc6eff Update raylib_api.* by CI 2024-06-30 09:38:16 +00:00
Ray
1e1061d5c7 REVIEWED: Formatting, follow raylib coding conventions 2024-06-30 11:37:58 +02:00
Ray
13e3092511 REVIEWED: DrawSphereEx(), added educational info 2024-06-30 11:15:45 +02:00
smalltimewizard
953df38ac4 [rmodels] DrawSphereEx() optimization (#4106)
* Optimize DrawSphereEx()

Precalculates sin/cos to eliminate unnecessary calls.

* Formatting correction to previous commit

* Bugfix to optimized DrawSphereEx()

OBO error -- added 1 additional precalculated cos/sin value to each array to complete the 360-degree wraparound. Technically the value of these last elements will always be the same as the first element due to 360-degree wraparound, but this is the simplest solution.

* Corrected missing free()

* Formatting correction

* New DrawSphereEx() algorithm
2024-06-30 11:09:21 +02:00
github-actions[bot]
d8214c916e Update raylib_api.* by CI 2024-06-30 09:07:57 +00:00
Ray
17cbc75aa7 REVIEWED: Formatting, follow raylib coding conventions 2024-06-30 11:07:38 +02:00
github-actions[bot]
a805f46f55 Update raylib_api.* by CI 2024-06-30 08:33:45 +00:00
Bruno Cabral
6e2661f92d [rtextures] Created ImageFromChannel() (#4105)
* created ImageFromChannel

Adds the possibility to extract a specific channel from an image

* naming convention

* example window height

* removed threshold

* removed alpha channel

* channel example organization

* updated channel example image
2024-06-30 10:33:32 +02:00
VitoTringolo
5b8efd68ba [rmodels] Return true if no need to interpolate to avoid log flooding (#4118) 2024-06-30 09:50:12 +02:00
Jeffery Myers
c1ea32655a [EXAMPLES] Default Skybox example to not use HDR (#4115)
* Update raylib_api.* by CI

* Default to not use HDR, and note that HDR support requires that raylib be built with HDR enabled.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-28 19:08:55 +02:00
SuperUserNameMan
a3ef381b3e rmodels.c, LoadImageFromCgltfImage() : fix base64 padding support (#4112)
* rmodels.c, LoadImageFromCgltfImage() : fix base64 padding support

This should fix the issue related to `.gltf` embeded image in base64 format, by ignoring `=` padding and calculating the data size in bytes correctly.

* follow guidelin convention

* try to follow guideline convention as much as possible

* clarify comments

i hope it's clear ennough
2024-06-28 09:56:27 +02:00
Colleague Riley
84971d81f3 Update RGFW and replace long switch in rcore_desktop_rgfw.c with a lookup table (#4108)
* Fix Makefile issues (RGFW) (linux) (macOS)

* Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW)

* remove #define RGFWDEF and make the #undefs only happen for their OS

* Update RGFW.h

* fix to match the RGFW updates

* remove line that shows the cursor for no reason

* Update RGFW, replace long switch with an array, update rgfw platform for RGFW

* update RGFW (fix reported glitch with drag and drop files) (linux)

* remove u16
2024-06-28 09:55:14 +02:00
VitoTringolo
05d76c74a6 Fix GLTF animations (#4107)
Co-authored-by: Vito Tringolo <vito.tringolo@recognitionrobotics.com>
2024-06-28 09:53:29 +02:00
InKryption
5e91444e3e [build.zig] pass the real build.zig file (#4113)
`@This()` was naively passed to `dependencyFromBuildZig` while inside
a file that is not actually the build file, causing a panic when
actually used. Passing `@import("../build.zig")` fixes this.
2024-06-27 22:25:15 +02:00
InKryption
57b5f11e2a [build.zig] Leverage dependencyFromBuildZig (#4109) 2024-06-27 11:52:36 +02:00
jspast
37205bba84 [web] Fix undesired scrollbars on shell files (#4104) 2024-06-25 22:15:29 +02:00
Ray
0979eafa84 WARNING: REMOVED: Default font fallback 2024-06-25 21:40:41 +02:00
Ray
4239e66c55 Update rshapes.c 2024-06-25 21:39:43 +02:00
Peter0x44
dfabbd8ba8 [rtext] Don't return default font if LoadFontEx fails (#4077)
It is currently impossible to check a font loaded successfully with
IsFontReady because LoadFontEx will always return a valid font.

DrawTextEx has this check:
if (font.texture.id == 0) font = GetFontDefault();  // Security check in case of not valid font

So anyone relying on the default font as a fallback for fonts failing to
load should still be covered.
2024-06-25 21:38:55 +02:00
Ray
3e441ae98b REVIEWED: DrawLine() #4075 2024-06-25 16:37:20 +02:00
github-actions[bot]
ec95ee85a3 Update raylib_api.* by CI 2024-06-24 16:42:01 +00:00
Ray
385e60dd41 Minor tweaks 2024-06-24 18:41:33 +02:00
Jeffery Myers
e96bab7ce6 [Build] Fix warnings when building in VS 2022 (#4095)
* Update raylib_api.* by CI

* Fix warnings when building examples in MSVC 2022

* fix auto-format that sneaked in there.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-24 17:47:32 +02:00
Peter0x44
4311db5ba5 [rmodels] Fix -Wstringop-truncation warning (#4096)
rmodels.c: In function ‘LoadBoneInfoGLTF.isra’:
rmodels.c:4874:32: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]
 4874 |         if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name));
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-06-24 09:29:10 +02:00
github-actions[bot]
f947f89061 Update raylib_api.* by CI 2024-06-24 07:28:17 +00:00
Le Juez Victor
c2df169847 [rtextures] Adding ImageDrawLineEx function (#4097)
* adding `ImageDrawLineEx` function
also review other functions for drawing lines in images

* fix `ImageDrawLineV`
2024-06-24 09:27:59 +02:00
github-actions[bot]
c7bda3d10f Update raylib_api.* by CI 2024-06-23 20:51:38 +00:00
Le Juez Victor
7e50270d49 [rtextures] Adding triangle drawing function for images (#4094)
* adding triangle drawing function for images

* remove unnecessary check

* fix an iteration mistake
2024-06-23 22:51:24 +02:00
SuperUserNameMan
7773254022 LoadIQM() set model.meshMaterial[] (#4092) 2024-06-23 21:14:03 +02:00
Paul Melis
d582becbc2 [rmodels] Initial work to correctly handle the node hierarchy in a glTF file (#4037)
* Initial work to correctly handle the node hierarchy in a glTF file.
Static meshes seem to work fine in my tests. Haven't tried anything
animated yet, but it's almost certainly broken.

* Fix variable naming, some comment tweaks

* Only count primitives made up of triangles in glTF meshes

* Update processing of gltf mesh animation data, to match earlier
changes to vertex/normal/tangent data
2024-06-22 19:42:11 +02:00
manuel5975p
5ba18575de [build] CMake: pass -sFULL_ES3 instead of -sFULL_ES3=1 (#4090)
* Allow ES3 in LibraryConfigurations.cmake

* Put FULL_ES3 as linker option

* Remove =1
2024-06-22 19:20:33 +02:00
Alice Nyaa
b0d49579c1 fixed LoadCodepoints returning a freed ptr when count is 0 (#4089) 2024-06-22 19:17:31 +02:00
Peter0x44
28f88fd984 Fix mistakes in example usages in raylib_parser help text (#4084) 2024-06-22 19:16:36 +02:00
Anthony Carbajal
0d59235ade add warning log multiple of 4 (#4080) 2024-06-22 19:15:21 +02:00
manuel5975p
e7acdd12d8 [build] CMake: support OpenGL ES3 in LibraryConfigurations.cmake (#4079)
* Allow ES3 in LibraryConfigurations.cmake

* Put FULL_ES3 as linker option
2024-06-21 09:07:01 +02:00
Anthony Carbajal
52f2a10db6 fixed issue with GetScreenWidth/GetScreenHeight (#4074) 2024-06-17 13:42:53 +02:00
Ray
dcf2f6a8e9 Added note about performace #4067 2024-06-16 11:17:34 +02:00
Lázaro Albuquerque
307c998495 [build] Making config.h fully available to CMake users (#4044)
* Create ParseConfigHeader.cmake

This script parses the config.h file to automate the process of exposing the configuration flags and configuration values found in the latter.

* Update CompileDefinitions.cmake

Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent.

* Update CMakeOptions.txt

Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent.

* Update CMakeLists.txt

Changes required to make possible building raylib for web on Windows 10.

* Update LibraryConfigurations.cmake

Removes a warning that linker-only flags were being passed to the compiler, which is in accordance to https://emscripten.org/docs/tools_reference/settings_reference.html.

* Update CMakeOptions.txt

Removed clutter.

* Update CompileDefinitions.cmake

Removed clutter.

* Update CompileDefinitions.cmake

Some applications might check for PLATFORM_WEB instead of __EMSCRIPTEN__.

* Update CompileDefinitions.cmake

Reverting

* Update CMakeLists.txt

USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO.

* Update CompileDefinitions.cmake

USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO.

* Update ParseConfigHeader.cmake

* Revert "Update CMakeLists.txt"

This reverts commit 1785fc06b5.

* Revert "Update CompileDefinitions.cmake"

This reverts commit 62f9a3a0ea.

* Revert "Update CMakeLists.txt"

This reverts commit 3e7912144e.

* Revert "Update LibraryConfigurations.cmake"

This reverts commit bcc4310c49.
2024-06-16 10:49:59 +02:00
kai-z99
a29d334734 [rmodels] Read uninitialized values in GenMeshTangents() - fix bounding case (#4066)
* fix

* assert
2024-06-16 10:44:31 +02:00
Lázaro Albuquerque
cc40a91343 [build] Fix some warnings on web builds and remove some redundant flags. (#4069)
* update

* Revert "update"

This reverts commit e8adcabd94.

* update

* remove a not stricly required flag
2024-06-16 10:42:50 +02:00
Ray
04735fa9bb Merge branch 'master' of https://github.com/raysan5/raylib 2024-06-16 10:42:02 +02:00
Ray
715633e0de REVIEWED: Spline cubic bezier example 2024-06-16 10:41:47 +02:00
github-actions[bot]
32c98717b1 Update raylib_api.* by CI 2024-06-16 08:23:57 +00:00
Ray
4119b6dd66 Update raylib.h 2024-06-16 10:23:38 +02:00
Santiago Pelufo
640eaca8bf [rshapes] Fix multisegment Bezier splines. (#3744)
* [rshapes] Fix multisegment Bezier splines.

It seems to me that these functions are wrong, if you step the index by 1 you move to a control point instead of the next segment.

* Fix example shapes/shapes_splines_drawing for bezier splines.

* Draw circles to fill gaps between bezier segments.
2024-06-16 10:21:54 +02:00
Mike Will
81ff879b04 zig: run examples from their directories (#4063)
So that they can find their respective resource folders.
2024-06-16 09:38:54 +02:00
Viktor Pocedulić
eff7b065eb [build.zig] Fix raygui build when using addRaygui externally (#4027)
When addRaygui is used from an external build, for example in a
bindings project, the build of a generated `raygui.c` fails with
"raylib.h not found" error from the compiler.

I've traced this down to a raylib step not adding its `src/` to the
shared list of include paths using `addIncludePath` but relying on
`addCSourceFiles` `.root` to provide the implicit include path for
raylib proper's own files.

If raygui is later added to the step the compiler won't know where
to look for `raylib.h` and friends and will fail to build.

This change simply adds raylib's `src/` to the include path list.
2024-06-16 09:37:45 +02:00
ShalokShalom
b4fbdc0283 Update Julia Bindings (#4068) 2024-06-14 22:46:50 +02:00
kai-z99
fca53c7799 optimize (#4065) 2024-06-14 08:19:17 +02:00
listeria
df849d2fb0 [raudio] fix mapping of wave data in LoadWaveSamples() (#4062)
Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
2024-06-13 16:05:22 +02:00
TokyoSU
735c0160b5 Update rlgl.h (#4059)
- The function rlGetMatrixProjectionStereo and rlGetMatrixViewOffsetStereo have RLAPI for the function declaration and cause error when compiling using RLGL_IMPLEMENTATION.
2024-06-12 19:36:25 +02:00
Alexey Kutepov
33c598123c [raudio] Add 24 bits samples support for FLAC format (#4058)
Similarly to how it's done for WAV format, by forcing the conversion
to s16 on UpdateMusicStream().
2024-06-12 11:42:41 +02:00
Karl Zylinski
fffae1a975 Fix fragPosition using wrong matrix in lighting_instancing.vs (#4056)
fragPosition was multiplied by mvp*instanceTransform, but it should only be multiplied by instanceTransform. Compare to lighting.vs, there we only use mvp for gl_Position, but matModel for the fragPosition.
2024-06-11 20:55:13 +02:00
Jeffery Myers
2609211207 [SHAPES] Make functions that draw point arrays take them as const (#4051)
* Update raylib_api.* by CI

* make functions that take a pointer to an array take them as const pointers

* Update raylib_api.* by CI

* fix comment alignment.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-11 11:51:49 +02:00
VitoTringolo
0fc4b61906 LoadBoneInfoGLTF add check for animation name being NULL (#4053)
Co-authored-by: Vito Tringolo <vito.tringolo@recognitionrobotics.com>
2024-06-11 11:50:42 +02:00
Lázaro Albuquerque
c636618d77 Update Makefile (#4054)
Since the flag CUSTOM_CFLAGS should allow users customize things, in particular the optimization level, I figured it should come after other default ones.

Based on: "If you use multiple -O options, with or without level numbers, the last such option is the one that is effective."

Source: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
2024-06-10 20:50:09 +02:00
MrScautHD
29ac31f409 Removed Raylib.NET (#4050) 2024-06-09 18:03:05 +02:00
carverdamien
a0a81fddee Make addRaylib use options.opengl_version (#4049) 2024-06-09 13:29:09 +02:00
Ray
8cbde7f84c tweaks 2024-06-09 13:16:29 +02:00
Ray
6b3c1148bf REVIEWED: Animation name being NULL #4037 2024-06-09 13:16:18 +02:00
Colleague Riley
8c712f82d1 Update RGFW (#4048)
* Fix Makefile issues (RGFW) (linux) (macOS)

* Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW)

* remove #define RGFWDEF and make the #undefs only happen for their OS

* Update RGFW.h

* fix to match the RGFW updates

* remove line that shows the cursor for no reason
2024-06-08 22:26:46 +02:00
fruzitent
7b92b5bde7 fix: infer CMAKE_MODULE_PATH in super-build (#4042) 2024-06-07 10:22:24 +02:00
Konrad Gutvik Grande
3948656d84 The example always showed a xbox controller, never a ps3 controller (#4040) 2024-06-07 10:21:02 +02:00
jgabaut
f05316b11d [rlgl] Rename near, far variables (#4039) 2024-06-06 15:29:15 +02:00
Sprix
e74d13e6db Fix examples not building with gestures system disabled (#4020)
Build no longer fails with -DSUPPORT_GESTURES_SYSTEM=OFF and -DBUILD_EXAMPLES=ON
2024-06-06 11:47:07 +02:00
Ray
38018192b8 RENAME: near, far vaiables 2024-06-06 10:12:23 +02:00
Ray
5767c4cd05 Update rcore_desktop.c 2024-06-04 23:00:12 +02:00
Paul Melis
e1379afb01 Fix #4024, cylinder drawing was incorrect due to imprecise angle (#4034)
* Fix #4024, cylinder drawing was incorrect due to imprecise angle
stepping (mostly noticeable with semi-transparent cylinders)

* Fix var name and spacing
2024-06-04 11:46:57 +02:00
IoIxD
39f12859dc rtext: added functions for camel case and snake case (reopened due to formatting errors) (#4033)
* rtext: added functions for camel case and snake case

* Update raylib_api.* by CI

* rtext: removed always false comparison

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-03 20:13:28 +02:00
Jett
06f8c4f733 LoadIQM: attempt to load texture from IQM at loadtime. (#4029)
tries to load the texture with the base path of the original IQM file, relative paths should work.
2024-06-03 09:03:33 +02:00
MrScautHD
0cad25f798 Update Raylib-CSharp to 5.1-dev. (#4030)
* Update BINDINGS.md

* Update BINDINGS.md

* Update BINDINGS.md
2024-06-03 08:52:51 +02:00
David Holland
11202bf299 [rmodels] Send full matModel to shader in DrawMesh (#4005) (#4022) 2024-06-02 11:52:00 +02:00
Jett
2998f8671b LoadModelAnimationsIQM: fix corrupted animation names (#4026)
Correctly copies animation names from IQM animation to raylib animation.
2024-06-02 11:51:25 +02:00
github-actions[bot]
1344979c70 Update raylib_api.* by CI 2024-05-30 06:24:58 +00:00
kai-z99
606cc1d897 [rshapes]Circle line collision function (#4018)
* inital function

* working 1

* optimize

* optimized dot product

* simplify

* cleanup

* cleanup

* cleanup

* comment

* var name change

* epsilon
2024-05-30 08:24:44 +02:00
vaezim
d7a8af144d Fix typos in markdowns and comments, Fix invalid links in HISTORY.md (#4017) 2024-05-30 08:22:07 +02:00
Le Juez Victor
f2344cd089 review color tint functions (#4015) 2024-05-29 23:44:20 +02:00
Ray
c04629f6d4 Update raylib.h 2024-05-29 17:38:19 +02:00
Ray
e37d19ab1e REVIEWED: ExportFontAsCode(), avoid const #4013 2024-05-29 17:28:55 +02:00
DarkAssassin23
2804e75869 [rtext] Added cast to ExportFontAsCode output to fix C++ compiler errors (#4013) 2024-05-29 17:22:59 +02:00
Dylan
2e38069475 [build.zig] Fix Zig emscripten build (#4012)
* Fix for issue #4010

Split the code for Zig's master branch and >= 0.12.0 due to changes in https://github.com/ziglang/zig/pull/19623

* Restore the cache_include path which was removed in error

Accidently removed a couple lines I didn't mean to 🙈
2024-05-29 17:07:28 +02:00
github-actions[bot]
a942a3bc70 Update raylib_api.* by CI 2024-05-29 15:02:00 +00:00
Ray
c335c3c52c ADDED: IsFileNameValid() 2024-05-29 17:01:42 +02:00
Le Juez Victor
797de0f9ad [rmodels] Multiplication of colors in DrawModelEx which can be simplified (#4002)
* simplifies color multiplication `DrawModelEx`

* add explicit casts
2024-05-29 13:16:19 +02:00
avx0
9cc7e3528f [parser] MemoryCopy() calls: Prevent buffer overflow by replacing hard-coded arguments (#4011)
In future, if a dev edits the second arg and miscalulates the corresponding 3rd arg, there will be a buffer overflow or the string (2nd arg) will be cut short. This commit prevents that.
2024-05-29 11:30:28 +02:00
Lionel Briand
785ec74b92 Update BINDINGS.md (#4004)
Add L-Briand/raylib-zig-bindings to the Language Bindings table
2024-05-24 18:26:17 +02:00
listeria
b429dbdc4b fix WaveCrop(): update wave->frameCount (#4003)
also allow `finalFrame = wave->frameCount' as the range of frames does
not include it.

Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
2024-05-24 18:24:40 +02:00
Antonis Geralis
d9c5066382 nim bindings are in 5.1-dev, remove umaintained repos (#3999)
* nim bindings are in 5.1-dev, remove umaintained repos

* Update BINDINGS.md

* move to umaintained

* Update BINDINGS.md

* github editor is pranking me
2024-05-21 21:51:19 +02:00
Ray
b212750b85 Update rcore_desktop_sdl.c 2024-05-21 20:53:51 +02:00
Ray
3abb6d9eaf REVIEWED: ColorToInt() PR 2024-05-21 20:52:48 +02:00
JupiterRider
c7f098f4d2 Call SDL_GL_SetSwapInterval() after GL context creation (#3997) 2024-05-21 20:48:48 +02:00
OetkenPurveyorOfCode
9ef29aff9a [rtextures] Fix Undefined behaviour in ColorToInt (#3996) 2024-05-21 15:44:02 +02:00
Salvador Galindo
c4a51a3ebd fixed out of bounds error in GenMeshTangents (#3990) 2024-05-21 13:47:26 +02:00
Ray
b2f4f4d8fd Update BINDINGS.md 2024-05-21 13:10:38 +02:00
Carmine Pietroluongo
fc9634a4de Update BINDINGS.md (#3995) 2024-05-21 13:07:31 +02:00
IoIxD
74d7e78b70 BINDINGS.md: raylib-rs now at 5.0 (#3991) 2024-05-21 12:53:05 +02:00
github-actions[bot]
272a142ee5 Update raylib_api.* by CI 2024-05-21 06:14:05 +00:00
listeria
bb9bd73f43 fix WaveCrop() and use frames instead of samples (#3994)
Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
2024-05-21 08:13:46 +02:00
Ray
9d67f4734b REVIEWED: LoadBMFont(), issue on not glyph data initialized 2024-05-18 07:41:37 +02:00
Ray
00ac9b6c53 Update config.h 2024-05-18 07:40:59 +02:00
FishingHacks
3d70d6179c [raudio] Removed drwav_uninit in LoadMusicStream to fix a crash (#3986) 2024-05-16 19:47:39 +02:00
Cemal Gönültaş
1d52985943 [rcore_web] Relative mouse mode issues. (#3940)
* [rcore_web] Relative mouse mode issues.

* Review formatting.
2024-05-16 12:01:27 +02:00
Jeffery Myers
f26bfa0c8e [RAYMATH] Revert Extern 'C' in raymath (#3985)
* Update raylib_api.* by CI

* Remove Extern C for raymath, it breaks some cases in mingw-w64 and does not fix any warning issues.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-16 07:42:52 +02:00
CosmicBagel
d6b22b17ae LazyPath.path has been deprecated, using b.path() (#3983)
This works in zig 0.12, LazyPath.path has been removed in zig 0.13

Co-authored-by: CosmicBagel <>
2024-05-15 23:20:34 +02:00
Ray
02d98a3e44 REVIEWED: 2d camera zoom, add alternative method #3977 2024-05-15 16:33:06 +02:00
Ray
479bd84400 Update shaders_palette_switch.c 2024-05-15 16:19:53 +02:00
Mike Will
46f9806359 Use logarithmic scaling for a 2d example with zoom functionality (#3977) 2024-05-15 16:19:22 +02:00
Peter0x44
bf5eecc71f [parser] Don't crash for files that don't end in newlines (#3981)
The parser assumes all lines end in newlines, but sometimes this isn't
true. Check for a null terminator along with '\n' when stripping leading
spaces.
2024-05-15 16:16:45 +02:00
Jeffery Myers
3d885ef919 [raymath] Add extern "C" to raymath header for C++ (#3978)
* Update raylib_api.* by CI

* Add an extern C to raymath to prevent warnings in C++

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 00:36:23 +02:00
Filyus
3f13f7921d Fix parsing of empty parentheses (#3974)
Co-authored-by: Filyus <fahmedyanov@dpg.email>
2024-05-13 00:33:09 +02:00
Alexei Mozaidze
f4b5622ba3 feat(zig): add opengl_version option (#3979)
Added `opengl_version` option to `src/build.zig`.
2024-05-13 00:27:02 +02:00
Ray
7a1cad3e61 Reviewed input params #3974 2024-05-12 13:31:38 +02:00
Colleague Riley
f62202198e remove #define RGFWDEF and make the #undefs only happen for their OS (RGFW) (#3971)
* Fix Makefile issues (RGFW) (linux) (macOS)

* Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW)

* remove #define RGFWDEF and make the #undefs only happen for their OS
2024-05-10 21:09:22 +02:00
Colleague Riley
8a5fd3ac1d Do not use "nanosleep" on windows at all (PLATFORM_DESKTOP_RGFW) (#3970)
* Fix Makefile issues (RGFW) (linux) (macOS)

* Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW)

---------

Co-authored-by: ColleagueRiley <ColleagueRiley@gmail.com>
2024-05-09 16:35:26 +02:00
Colleague Riley
6ec925554c Fix Makefile issues (RGFW) (linux) (macOS) (#3969)
Co-authored-by: ColleagueRiley <ColleagueRiley@gmail.com>
2024-05-09 14:18:18 +02:00
veins1
1aa3559155 Fixes for loading Music (#3966)
* Fixes for loading Music

Fix for #3889
Fixes for QOA crashes.
Memory leak FIX on unsuccessful .wav loading.

* Added comments
2024-05-07 20:44:41 +02:00
Ray
08ae888722 Update Makefile 2024-05-07 20:40:41 +02:00
Colleague Riley
9805fe0b1a make RGFW a custom platform (#3941)
* fix minor bugs and errors (x86) for the RGFW platform, update RGFW platform license, update makefile info for RGFW platform

* revert

* (RGFW) (winapi) fix mouse hide bug when cursor changes

* ensure PLATFORM_SHELL is defined (PLATFORM_RGFW)

---------

Co-authored-by: ColleagueRiley <ColleagueRiley@gmail.com>
2024-05-07 20:30:52 +02:00
gabriel-marques
fa2b1c8f09 Implementing GetMonitorWidth/Height for DRM (#3956)
* Implementing GetMonitorWidth/Height and GetMonitorPhysicalWidth/Height for drm

Added implementation for DRM for functions :
 - GetMonitorWidth()
 - GetMonitorHeight()
 - GetMonitorPhysicalWidth()
 - GetMonitorPhysicalHeight()
 - GetMonnitorName()

These functions take an argument but only the value 0 is accepted. This is because the DRM platform implementation manages only one screen for now

* Refactor "GetMonitor" properties for DRM Platform

Refactored GetMonitorHeight, GetMonitorWidth, GetMonitorPhysicalHeight,
GetMonitorPhysicalWidth and GetMonitorName to accept only argument "0"
as more than one screen is not supported in DRM platform.
2024-05-07 10:33:56 +02:00
MrScautHD
f69ae58304 Update BINDINGS.md (#3963) 2024-05-06 12:50:05 +02:00
Christian Haas
3d9aafed3b [rcore_desktop] Fix 3693 initial window geometry (#3950)
* Rework window placement and dimensions for multi-monitor setups;

- fullscreen apps use primary monitor, exclusively
- non-fullscreen apps come in two variants:
a) pre-determined window size by user
b) use-active-monitor dimensions by user specifying 0x0
Either way, the window shall be centred at the monitor where it was created

This may have been the original intent, yet the primary monitor was used also for the second case, regardless where the window opened.

* Clean up code, handle error, fix integer-overflow for centering windowed fullscreen
2024-05-05 20:22:58 +02:00
bohonghuang
23385231c6 [rlgl] Fix incorrect matrix multiplication order in rlMultMatrixf (#3935) 2024-05-05 20:19:25 +02:00
Ray
34d00d5217 Minor formatting tweaks 2024-05-05 19:46:31 +02:00
Ray
f1007554a0 Set default init values for random #3954 2024-05-01 22:58:33 +02:00
Ray
33b32ca53a Default shader attrib locations need to be exposed
They need to be exposed on `rlgl.h` header section (not implementation section) because with some specific use cases (custom config.h, rmodels module enabled), building fails otherwise.
2024-05-01 18:41:28 +02:00
Ray
c21edadab0 Update rprand.h 2024-05-01 18:39:38 +02:00
Ray
763129e96b Reviewed some warnings 2024-05-01 18:12:57 +02:00
github-actions[bot]
27a015d022 Update raylib_api.* by CI 2024-04-30 21:47:28 +00:00
UmgefallenesGlas
7246d798ad Changed one minor Comment (#3949) 2024-04-30 23:47:11 +02:00
Ray
b03c8ba945 WARNING: BREAKING: REDESIGN: SetTextLineSpacing()
Redesigned function to only consider separation between the end of vertical size of one line and the beginning of next line
2024-04-28 23:07:21 +02:00
Ray
e0027eb767 REVIEWED: DrawLine() to avoid pixel rounding issues #3931 2024-04-28 22:59:35 +02:00
github-actions[bot]
915dd95d88 Update raylib_api.* by CI 2024-04-28 20:39:44 +00:00
Tomas Fabrizio Orsi
80d318461f Made comments on raylib.h match those present in rcamera.h (#3942)
Signed-off-by: Tomas Fabrizio Orsi <torsi@fi.uba.ar>
2024-04-28 22:39:28 +02:00
OetkenPurveyorOfCode
f78721991f Use builtin_clz for clang on windows (#3939) 2024-04-28 20:29:45 +02:00
Tomas Fabrizio Orsi
10e702facd FIX: Added CAMERA_CUSTOM check in UpdateCamera(Camera *camera, int mode) (#3938)
Signed-off-by: Tomas Fabrizio Orsi <torsi@fi.uba.ar>
2024-04-28 20:28:19 +02:00
Ray
e47ebec661 FIX: Issue with texcoords loading for glTF 2024-04-24 17:02:03 +02:00
Ray
2e77443209 WARNING: Fix breaking issue (introduced some days ago) 2024-04-23 22:55:51 +02:00
Ray
f15455552d Review formatting 2024-04-23 19:38:45 +02:00
KotzaBoss
4b0e25d3af Add rlCullDistance variables/getters and rlSetClipPlanes function (#3912)
The `RL_CULL_DISTANCE_` definition remains as the initial value
of the variables.

Basic usage can be:
```c
#include <raylib.h>
#include <rlgl.h>

rlSetClipPlanes(RL_CULL_DISTANCE_NEAR, MY_CULL_DISTANCE_FAR);

if (must_reset_clip_planes)
    rlSetClipPlanes(RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR);
```
2024-04-23 14:24:37 +02:00
bohonghuang
d80febde7d [rlgl] Implement vertex normals for RLGL immediate drawing mode (#3866)
* Fix several non-functional `target_compile_definitions`

* Avoid hardcoding the default vertex attribute locations

* Implement functional `rlNormal3f`

* Add normal definitions for `DrawCube`

* Update the basic lighting example to use `DrawCube` and `DrawPlane`
2024-04-23 14:22:29 +02:00
freakmangd
e0f6faa151 [build.zig] Drop support for 0.11.0 and use more idiomatic build script code (#3927)
* Remove support for 0.11.0, and make build script more idiomatic
+ remove all 0.11.0 compatibility functions
+ remove most LazyPath .path variants
  + I didn't touch emscripten, I don't know if its relative or absolute
+ change all absolute paths to use .cwd_relative
+ only use the builder allocator
+ have local dependencies use the package manager
+ make adding raygui more flexible
+ use zig-cache for generated wayland files

* Remove support for 0.11.0 in examples/build.zig

* update examples further and add clarifying comment on addRaygui
2024-04-22 09:13:01 +02:00
Ray
3caa424ad4 Review formatting 2024-04-21 12:29:09 +02:00
Ray
cf47fbb20b REVIEWED: LoadImageRaw() #3926 2024-04-20 23:58:22 +02:00
Ray
8f24d86c1f REVIEWED: LoadImageRaw() #3926 2024-04-20 23:44:07 +02:00
Ray
f795941521 REVIEWED: rlSetVertexAttribute(), define last parameter as offset #3800 2024-04-20 23:37:31 +02:00
Ray
5cfcf13d4b REVIEWED: LoadGLTF(), support 2nd texture coordinates loading 2024-04-20 23:23:30 +02:00
Ray
e543b78bb7 REVIEWED: LoadGLTF(), support additional vertex attributes data formats #3890 2024-04-20 22:01:59 +02:00
Ray
6435ef43f5 REVIEWED: LoadGLTF(), JOINTS loading #3836
Support all JOINT formats supported by glTF specs
2024-04-20 21:22:49 +02:00
Ray
f6d85e5df7 Update project 2024-04-20 21:21:31 +02:00
Ray
77cabc8bf2 Update shapes_draw_rectangle_rounded.c 2024-04-20 20:32:37 +02:00
Ray
e85f245ad4 REVIEWED: Remove final punctuation in code comments 2024-04-20 20:31:06 +02:00
Ray
c1943f0f7c REVIEWED: Move some functions, made them static 2024-04-20 20:30:35 +02:00
Christian Haas
d80a622972 [raudio] Fix 3664: crash in raudio from multithreading issues (#3907)
* Flip release of buffer;

First it needs to be taken out of the processing chain, then it can be released. The inverse of the initialization.

* Add mutex locks to audio buffer functions; Separate those used from both threads

* Flip release of buffer;

First it needs to be taken out of the processing chain, then it can be released. The inverse of the initialization.

* Remove TODO marker; The buffer is in stopped state and its data won't be accessed

* Add mutex locks to music/stream functions directly operating on buffer

* Secure UpdateMusicStream/PlayMusicStream/UpdateAudioStream;

This change is twofold:
* Add locks to UpdateMusicStream/UpdateAudioStream (second one needed separation)
* Remove unnecessary hack to restart music - inlining the statements resulted in a no-op

Especially the second part made it easier to ensure thread-safety overall

* Remove redundant check; Already checked at beginning of function
2024-04-20 20:15:09 +02:00
Ray
d95d4d4ad5 Merge branch 'master' of https://github.com/raysan5/raylib 2024-04-20 19:59:41 +02:00
Ray
68201c10c2 Update models_cubicmap.c 2024-04-20 19:58:14 +02:00
Ray
41b0c5c4f9 REVIEWED: DrawRectangleLines() pixel offset
This could be actually very tricky and GPU/drivers dependant...
2024-04-20 19:58:10 +02:00
github-actions[bot]
349ff16600 Update raylib_api.* by CI 2024-04-20 17:54:14 +00:00
Ray
b51f4db8c2 REVIEWED: DrawRectangleLines() #3884
For consistency, now _almost_ all `Draw*Lines()` functions use `RL_LINES` mode for drawing. It solves the linked issue but it can have other implications, as mentioned in the WARNING comment in `DrawRectangleLines()`.

Side note: `DrawRectangleRoundedLines()` now should be reviewed for consistency.
2024-04-20 19:53:59 +02:00
Ray
29ce13b777 Code gardening
- Review formatting
 - Improve readability for some functions result return
 - Minimize early returns
 - Align LoadFileData() to UnloadFileData()
2024-04-20 13:53:13 +02:00
Ray
2754c80596 Added security checks #3924 2024-04-20 13:50:34 +02:00
Ray
a17a81f05b Review code formating 2024-04-19 21:13:52 +02:00
Ray
51486a0606 Update rtext.c 2024-04-19 21:13:36 +02:00
Ray
b88365fb01 Disable some font formats support 2024-04-19 21:13:28 +02:00
Rafael Bordoni
88f7762921 Fix window not initializing on primary monitor on GLFW backend (#3923)
The way the current code worked was by calling `GetCurrentMonitor()`,
which would always return the monitor at position (0,0). This isn't the
primary monitor on all platforms, on Linux in particular it isn't the
case.

This isn't the case on the SDL backend, after calling `InitWindow()` the
window would always show up on the primary monitor. Even on the GLFW
backend, if the full screen flag was set it would attempt to put it on
the primary monitor as it would call `glfwGetPrimaryMonitor()` to do it,
so for consistency's sake we should do it on windowed mode too.
2024-04-19 15:17:22 +02:00
Benji
b00e467494 Revert "Build specific example using -DBUILD_EXAMPLE cmake flag (#3921)" (#3922)
This reverts commit c1fd98591d.
2024-04-19 08:43:24 +02:00
Benji
c1fd98591d Build specific example using -DBUILD_EXAMPLE cmake flag (#3921) 2024-04-17 19:26:18 +02:00
Ray
112ce672e1 FIX: #3918 2024-04-17 19:12:47 +02:00
Ray
a6a08c75eb Update corrupted-header sounds #3554 2024-04-17 18:30:02 +02:00
Benji
4491ff0426 Replaced SQUAD quat interpolation with cubic hermite to align with gltf 2.0 spec (#3920) 2024-04-17 08:10:48 +02:00
Arthur
e42f9263b8 Fix GetKeyPressed for PLATFORM_DESKTOP_SDL (#3869)
The key handling in PLATFORM_DESKTOP_SDL was faulty in two ways, which
led to GetKeyPressed returning incorrect data.

CORE.Input.Keyboard.keyPressedQueue was updated only on SDL_TEXTINPUT,
meaning only text characters were registered as a pressed key, but not
function keys (eg. tab, backspace...). Also on such event, both
CORE.Input.Keyboard.keyPressedQueue and
CORE.Input.Keyboard.charPressedQueue were assigned the key's
corresponding codepoint, when CORE.Input.Keyboard.keyPressedQueue
should get the raylib keycode instead.

CORE.Input.Keyboard.keyPressedQueue is now updated on SDL_KEYDOWN event
instead.

Co-authored-by: Arthur <hi@thenightwat.ch>
2024-04-15 23:09:20 +02:00
Benji
4e37c8e370 Added missing interpolation types for GLTF animation channels (#3919) 2024-04-15 23:08:09 +02:00
veins1
289e7d3a6c Reset music.ctxType if loading wasn't succesful (#3917)
Fixes some crashes, e.g. calling StopMusicStream after trying to load Music from a non-existant .mp3 file
2024-04-14 00:15:50 +02:00
Dylan
583f81f458 Fix FileNotFound: .../src/raylib.h (#3915) 2024-04-13 23:35:23 +02:00
freakmangd
ba2a103011 [build.zig] Fix local dependency breakage (#3913)
* fix local dependency breakage

* revert accidental change in include path
2024-04-13 23:34:14 +02:00
Mute
214b1997a8 Changed RLGL_VERSION from "4.5" to "5.0 (#3914)
Line 110 of file rlgl.h is the one in question.
2024-04-13 23:33:21 +02:00
freakmangd
b3dfa2d8ab Update to latest zig and simplify build.zig (#3905)
* update to latest zig, and don't use srcdir

* preserve compatibility, simplify Child.run compatibility
2024-04-10 10:36:18 +02:00
Yousif
a4819f99cb Update shaders_hybrid_render.c (#3908)
Fix typo
2024-04-10 10:36:03 +02:00
Aria
a1f5e34d81 Update rcore_android.c (#3910)
add gamepad previous button state tracking to Android
2024-04-10 10:34:05 +02:00
Ray
04afba260f REVIEWED: Window positioning, avoid out-of-screen window-bar 2024-04-08 11:27:56 +02:00
Nikolas
892e57d46e Update raylib-zig version (#3902) 2024-04-07 23:03:39 +02:00
Belllg
3e658ef502 Update Makefile RAYLIB_VERSION (#3901)
Changed the raylib version from 4.2.0 to 5.1-dev, just like the raylib.h file
2024-04-07 14:48:32 +02:00
Ray
8bcf044983 Remove broken-link bindings #3899 2024-04-07 10:01:25 +02:00
Ray
aca9ab0ebb Update cgltf.h 2024-04-07 09:47:28 +02:00
jtainer
1b14c082ed Remove redundant axis length calculation (#3900) 2024-04-06 13:56:20 +02:00
iarkn
414229bcf9 Fix #3891 breaking builds for Zig v0.11.0 (#3896)
The changes brought by #3891 uses `std.process.Child.run` which was
renamed from `std.process.Child.exec` in Zig version 0.11.0. This commit
adds a version check to use the appropriate function names.

Additionally, the `linux_display_backend` configuration option is added
so users can set it when running `zig build` with the `-D` option or
when using raylib as a dependency.
2024-04-05 12:55:23 +02:00
Ray
890058abcd Update raylib.h 2024-04-04 13:18:28 +02:00
github-actions[bot]
1987c90c73 Update raylib_api.* by CI 2024-04-03 18:10:31 +00:00
Ray
d30cfea82d REVIEWED: GetScreenToWorldRayEx() 2024-04-03 20:10:15 +02:00
Rob Loach
9070eb9a13 Fix framerate recording for .gifs (#3894) 2024-04-03 12:10:52 +02:00
Ray
c9d71689ed Remove TABS 2024-04-02 09:40:19 +02:00
Ray
646d70e93a Remove trailing spaces 2024-04-02 09:38:06 +02:00
github-actions[bot]
1b047995d1 Update raylib_api.* by CI 2024-04-01 16:01:29 +00:00
Ray
fdf9ac66da Merge branch 'master' of https://github.com/raysan5/raylib 2024-04-01 18:01:02 +02:00
Ray
3b353da3ab Address parsing issue when generating XML #3893 2024-04-01 18:00:52 +02:00
Nikolas Mauropoulos
d374457040 Fixes zig build that was broken on #3863 (#3891)
* Fixes zig build that was broken on #3863

* Make this work with wayland
2024-03-30 19:36:30 +01:00
github-actions[bot]
7c75746b91 Update raylib_api.* by CI 2024-03-29 00:40:37 +00:00
MrMugame
eda239cc97 Fixing gamepad buttons not working in drm backend (#3888)
* Fixing gamepad buttons in drm backend

* Remove trailing spaces

* Axis enumeration now works properly
2024-03-29 01:40:20 +01:00
Ray
07128896af Update rcore_drm.c 2024-03-28 19:55:55 +01:00
MrMugame
30781c423b Organizing the drm backend to only use one api to allow for more devices (#3879)
* Updating rcore_drm.c to only use one api for input

* Change RPI log prefix to DRM

* Remove relative checking which is not supported currently

* Loop should continue on invalid event in drm backend

* Fixed and cleaned up PollKeyboardEvents() in drm backend
2024-03-28 13:14:21 +01:00
proberge-dev
b905dafca0 [rtextures] Fix LoadImageFromScreen scaling (#3881) 2024-03-26 08:47:25 +01:00
Ray
35252fceef Merge branch 'master' of https://github.com/raysan5/raylib 2024-03-21 15:43:08 +01:00
Ray
dcb9db5fe6 Update rcore.c 2024-03-21 15:43:00 +01:00
Kacper Zybała
9cf408f77c Remove redundant rlDisableVertexAttribute for SHADER_LOC_VERTEX_COLOR (#3871) 2024-03-18 18:37:09 +01:00
Ray
28c232d856 Update rcore_desktop.c 2024-03-18 09:13:34 +01:00
Jeffery Myers
9bb3d9977a Put GLFW in relative mouse mode when the cursor is disabled. (#3874) 2024-03-18 09:12:36 +01:00
Ray
d7ff0175c1 Fix #3876 and also rlgl review on #3783 2024-03-18 09:09:26 +01:00
Ray
8b0dd44316 Fix #3876 and also rlgl review on #3783 2024-03-18 09:08:51 +01:00
Alexandre Almeida
9a8d73e6c3 Fix GLFW runtime platform detection (#3863)
* Fix GLFW runtime platform detection

* Add libwayland-dev package to workflows

* Add libxkbcommon-dev package to workflows

* Add libwayland-bin package to codeql.yml

* Add libwayland-client0 and libwayland-cursor0 packages to codeql.yml

* Use libwayland-dev in codeql.yml

* Add libxkbcommon-dev to codeql.yml

* Remove libwayland-bin from linux.yml and linux_examples.yml (libwayland-dev includes it as a dependency)

---------

Co-authored-by: Ray <raysan5@gmail.com>
2024-03-14 16:54:39 +01:00
joyousblunder
42db6badd0 Update BINDINGS.md (#3868)
Odin's binding were bumped to 5.0 back in November 2023
2024-03-13 23:33:10 +01:00
Ray
17d631f508 Update codeql.yml 2024-03-12 22:51:16 +01:00
iP
1fad8277a3 optimisation of the "bone socket" tutorial (#3864)
Less matrix operations doing.
2024-03-10 21:49:04 +01:00
Peter0x44
f072497551 Implement IsCursorOnScreen for PLATFORM_DESKTOP_SDL (#3862)
I did some testing and this seems to work okay, but it *is* different to
GLFW. GLFW seems to lose "IsCursorOnScreen" for one frame upon pressing
alt+tab over the window, without a different window covering it. SDL
seems to have a more reasonable behavior for this case. Either way it's
an edge case and I don't know the exact way to fix, likely requires
internal GLFW changes.
2024-03-09 11:43:29 +01:00
Rob Loach
ba066656f7 [cmake] Disable SDL rlgl_standalone example (#3861)
* cmake: For SDL, disable rlgl_standalone

* cmake: Only build rlgl_standalone when on Desktop, and not shared libs
2024-03-08 12:33:40 +01:00
Ray
30604080ef Update rmodels.c 2024-03-07 12:33:45 +01:00
Ray
93a828f744 REVIEWED: GetMouseRay() functions rename #3830 2024-03-07 12:33:37 +01:00
github-actions[bot]
b1029a40b2 Update raylib_api.* by CI 2024-03-07 11:28:26 +00:00
aiafrasinei
3b7be85151 Screen space related functions consistency (#3830)
* Screen/world-space related functions rename

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-07 12:28:11 +01:00
Rob Loach
fccdfa7926 cmake: For SDL build, link the glfw dependency (#3860) 2024-03-07 12:11:46 +01:00
Ray
c1c9b69290 Implemented fix for #3859 2024-03-07 12:10:26 +01:00
Ray
1904873838 Merge branch 'master' of https://github.com/raysan5/raylib 2024-03-07 12:10:18 +01:00
Ray
68b553cfc1 Update raylib.h 2024-03-07 12:10:02 +01:00
Ray
c7b362d19d Update cmake.yml 2024-03-05 14:04:32 +01:00
Ray
38bdcafea1 Update cmake.yml 2024-03-05 14:02:57 +01:00
Ray
2114e48393 Update cmake.yml 2024-03-05 14:00:56 +01:00
Ray
36dabe485c Update cmake.yml 2024-03-05 13:59:36 +01:00
Ray
7584b6aa0b Update cmake.yml 2024-03-04 20:08:59 +01:00
Alexandre Almeida
85a46e42bd CMake: Remove USE_WAYLAND option (#3851)
* CMake: Remove USE_WAYLAND option

* Consistency fix

* Fix oversight
2024-03-04 19:59:26 +01:00
Ray
6e9dcdb599 Update linux_examples.yml 2024-03-04 19:59:04 +01:00
Ray
c970afeccd Update linux.yml 2024-03-04 19:58:49 +01:00
Caleb Barger
25caf14be8 Fix fix-build-paths (#3849) 2024-03-01 12:43:19 +01:00
Alexandre Almeida
dc1cec8bab Remove GLFW mouse passthrough hack and increase GLFW version in CMake (#3852) 2024-03-01 08:34:53 +01:00
Ray
449f7d3fa6 Merge branch 'master' of https://github.com/raysan5/raylib 2024-02-29 18:50:55 +01:00
Ray
fea3395fc1 Review formatting 2024-02-29 18:50:44 +01:00
github-actions[bot]
d3f2d94f23 Update raylib_api.* by CI 2024-02-29 17:40:30 +00:00
Ray
1e8450665c ADDED: New function ColorIsEqual() 2024-02-29 18:40:10 +01:00
mooff
94c79917e3 Fix SDL multitouch tracking (#3810)
The fingerId from SDL was used as an index into the CORE.Input.Touch
arrays, but it's an opaque / arbitrary int64, way bigger
than MAX_TOUCH_POINTS, so the first non-simulated touch event would segfault.
2024-02-29 18:30:38 +01:00
Alexandre Almeida
6589311a0b Update GLFW to 3.4 (#3827)
* Update GLFW to 3.4 (draft)

* Add _glfwConnectNull() function to rglfw.c

* Update rglfw.c

* Update Makefile

* Makefile: Replace USE_WAYLAND_DISPLAY with DISABLE_WAYLAND

* Revert "Makefile: Replace USE_WAYLAND_DISPLAY with DISABLE_WAYLAND"

This reverts commit 9e79abde78.

* GlfwImport.cmake: Replace GLFW_USE_WAYLAND with GLFW_BUILD_WAYLAND

* Update rglfw.c

* Output platform selected by GLFW to TRACELOG

* GLFW has removed Mir support
2024-02-29 18:29:32 +01:00
johann nadalutti
53221eb799 feat: vox_loader normals and new voxels shader (#3843) 2024-02-29 18:28:51 +01:00
Dalton Overmyer
077ab6d56b Add an example that generates a random sequence. (#3846) 2024-02-29 18:26:49 +01:00
Ray
ed9a6d862b Update rtextures.c 2024-02-28 16:27:55 +01:00
aiafrasinei
2aed94cfc2 Fix examples warnings for macos (#3842) 2024-02-27 22:15:09 +01:00
Laurentino Luna
f0807d2be1 Change sanitization check for ExportDataAsCode (#3837)
* Change sanitization check for `ExportDataAsCode`

I opted to use `isalnum` function since it should handle most cases. It
cannot however handle cases of files beginning with numbers.

* Update `ExportDataAsCode` condition

* Reinsert comment on `ExportDataAsCode`
2024-02-27 13:08:47 +01:00
Christian W. Zuckschwerdt
074fbb0264 Fix DRM cross-compile without sysroot (#3839) 2024-02-27 13:08:16 +01:00
Steve Biedermann
1fc4f4ac9c fix build paths (#3835) 2024-02-26 11:20:18 +01:00
Ray
7fae41b5c6 Update models_bone_socket.c 2024-02-26 11:03:12 +01:00
Ray
a6425fa1b9 Added note #3822 2024-02-26 11:03:09 +01:00
Ray
7d6e59170b Update rtextures.c 2024-02-26 10:49:04 +01:00
Ray
3086bf1668 Update models_bone_socket.c 2024-02-26 10:49:01 +01:00
Gary M
bd6c0bab44 add 16-bit unsigned short vec4 format for gltf joint loading (#3821) 2024-02-26 10:48:19 +01:00
Bowserinator
d919d457d3 Add Vector4 math functions & Vector2 variants of some Vector3 functions (#3828) 2024-02-26 10:41:21 +01:00
iP
2a263a09cc bone socket tutorial (#3833)
Tutorial on how to use bones as sockets to calculate the position of something.
2024-02-26 10:30:22 +01:00
Peter0x44
1df91e74b9 Fix building of raylib_opengl_interop on PLATFORM_DESKTOP_SDL (#3826)
I tested this with CMake. I don't know if the examples makefile
currently handles this case.
2024-02-26 10:29:21 +01:00
Gary M
53cfc7c965 assign format to cubemap (#3823) 2024-02-26 10:26:39 +01:00
Alex Macafee
6db5bb5ccd Update BINDINGS.md (#3829)
Raylib VAPI has been updated to support all features added by Raylib 5.0
2024-02-26 10:26:17 +01:00
Peter0x44
b86f78f6b1 Fix examples linking with CMake and -DPLATFORM=SDL (#3825)
Currently, every example fails linking likeso:

[  3%] Linking C executable audio_mixed_processor
/usr/bin/ld: ../raylib/libraylib.a(raudio.c.o): undefined reference to symbol 'exp@@GLIBC_2.29'
/usr/bin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Apparently, linking libm explicitly is the solution.
2024-02-26 10:25:47 +01:00
4rk
c588a291e6 Add very little sanitization to indentifier names in ExportDataAsCode() (#3832) 2024-02-26 10:22:06 +01:00
github-actions[bot]
2a774a88f5 Update raylib_api.* by CI 2024-02-24 15:47:42 +00:00
GideonSerf
371d25c8c9 Gamepad rumble support with SDL2 (#3819)
* Added gamepad rumble to rcore_desktop.c and rcore_desktop_sdl.c
Still need to add to the rest of the platforms.

* Add SetGamepadVibration warnings to unimplemented platforms.

* Added MAX_GAMEPAD_VIBRATION_TIME
The rumble in SDL2 will continue for MAX_GAMEPAD_VIBRATION_TIME unless the user cancels it with a call to SetGamepadVibration(0.0f,0.0f,0.0f)

* Cast float duration value to Uint 32

* Changed defines from int to float and fixed typo

---------

Co-authored-by: Gideon Serfontein <gse@newspacesystems.com>
2024-02-24 16:47:27 +01:00
Abhishek Rathore
bda919033d Fixed typo in a comment (#3816) (#3817)
Fixed a grammatical error by removing "are" to change `... but some are have multiple purposes ...` to `... but some have multiple purposes ...` in `textures/textures_image_generation`
2024-02-23 19:17:33 +01:00
Ray
23616153d4 Update Makefile 2024-02-22 23:25:05 +01:00
Peter0x44
31c6a340ab Remove all uses of deps/mingw (#3805)
The purpose of this directory in GLFW is to provide some headers that
"mingw.org" doesn't. Raylib has long been unable to build with mingw.org
due to using certain symbols that aren't exposed in their headers.
(_ftelli64 and _access, among others.). Mingw-w64 already has the
necessary headers included, and doesn't need any of these external
implementations. For some reason, this also causes the following error
when building with Visual Studio's clang:

clang  -c rglfw.c -Wall -D_GNU_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing  -std=c99 -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw
In file included from rglfw.c:61:
In file included from ./external/glfw/src/init.c:30:
In file included from ./external/glfw/src/internal.h:331:
In file included from ./external/glfw/src/platform.h:31:
In file included from ./external/glfw/src/win32_platform.h:70:
external/glfw/deps/mingw\xinput.h:227:26: error: a parameter list without types is only allowed in a function definition
  227 | void WINAPI XInputEnable(WINBOOL);
      |

If the last -Iexternal/glfw/deps/mingw is removed, the build works fine.

So, this workaround causes other problems, while not actually helping
raylib.

0bb605cd79/src/CMakeLists.txt (L272-L279)

GLFW's CMakeLists.txt first checks if either dinput.h or xinput.h are
provided by the toolchain, before telling the compiler to search for
headers in that directory. For EVERY compiler that can build raylib,
this is true.

In summary: This directory causes issues when building with some
compilers, and every toolchain that needs this workaround can't build
raylib anyway.
2024-02-22 23:06:22 +01:00
mooff
4f283a0789 Add CMake PLATFORM option for Desktop SDL (#3809) 2024-02-22 23:05:41 +01:00
Nikita Blizniuk
54e0af40c1 fixed loading GLTF animations with 1 frame (#3804) 2024-02-19 18:51:04 +01:00
Ray
77eeb0010e Updated workflows 2024-02-18 12:06:16 +01:00
Ray
e42e3188f5 Remove some unneeded line breaks 2024-02-18 11:59:40 +01:00
João Foscarini
c251e9309e Fix implicit conversion from float to double then back to float again (#3799) 2024-02-17 10:41:03 +01:00
Ray
dc7f81a7b0 Update workflows to use latest actions/upload-artifact 2024-02-13 16:15:18 +01:00
Ray
abe243d469 Update linux.yml 2024-02-13 16:13:46 +01:00
Ray
401c5a8638 Minor tweaks to avoid some CodeQL warnings 2024-02-13 15:58:02 +01:00
Ray
bb741f53a8 Update rtext.c 2024-02-13 10:43:24 +01:00
Mingjie Shen
6280771dad [rtext] Change strcpy to strncpy to fix buffer overflow (#3795) 2024-02-13 10:38:13 +01:00
Jeffery Myers
4cd71a9750 Fix warnings in raylib (#3793) 2024-02-10 20:02:05 +01:00
Ray
dd8b5613ca REVIEWED: DrawPixel() not drawing 2024-02-08 08:45:59 +01:00
Ray
8ba7c61625 Update README.md 2024-02-07 15:56:11 +01:00
Ray
e52ae870f2 Reverted Makefile GL_ENABLE_GET_PROC_ADDRESS #3713 2024-02-05 21:38:13 +01:00
Ray
ea31bd47e5 REVIEWED: PLATFORM_WEB build flags, added GL_ENABLE_GET_PROC_ADDRESS
Reviewed flags formating
2024-02-05 21:12:57 +01:00
Danil
6a8cc62b67 Fix GetCameraRight (#3784) 2024-02-05 20:53:14 +01:00
Ray
e9291fa4c7 Update rtext.c 2024-02-04 22:50:54 +01:00
Ray
c0c2e28c1b Merge branch 'master' of https://github.com/raysan5/raylib 2024-02-04 12:14:15 +01:00
Ray
615ee9d177 REVIEWED: rlLoadFramebuffer() 2024-02-04 12:13:56 +01:00
Ray
cd8da72fea Update rtext.c (#3777) (#3779) 2024-02-04 12:08:49 +01:00
github-actions[bot]
31ce1374e4 Update raylib_api.* by CI 2024-02-04 11:03:25 +00:00
Ray
80580746e5 Reorder functions 2024-02-04 12:02:58 +01:00
Ray
d34956b197 Merge branch 'master' of https://github.com/raysan5/raylib 2024-02-04 11:53:04 +01:00
Ray
c31559101a REVIEWED: rlLoadFramebuffer(), parameters not required 2024-02-04 11:52:49 +01:00
github-actions[bot]
250d89b621 Update raylib_api.* by CI 2024-02-04 10:37:24 +00:00
Luís Almeida
9a5dddc311 Added viewport independent raycast (#3709)
* added viewport independent raycast

* Renamed GetMouseRayEx to GetViewRay
2024-02-04 11:37:10 +01:00
Ray
f033b30703 Review formating and some defines naming consistency 2024-02-04 11:33:38 +01:00
oblerion
d91e9104aa [rcore] Fix GetFileNameWithoutExt() (#3771)
* Update rcore.c

fix [rcore] GetFileNameWithoutExt

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c
2024-02-04 11:28:58 +01:00
A
a96b224b38 Add gamepad support to PLATFORM_DESKTOP_SDL (#3776)
Co-authored-by: Arthur <hi@thenightwat.ch>
2024-02-04 11:24:05 +01:00
Ray
868d515fbc Update rtext.c 2024-02-04 11:18:46 +01:00
Ray
eed56a45d6 REVIEWED: LoadFontDataBDF() name and formating 2024-02-04 11:10:46 +01:00
Stanley Fuller
0932cd3059 [rtext] Add BDF font support (#3735)
* Add BDF font support

* Include font ascent in glyph y-offset when loading BDF font
2024-02-03 19:28:12 +01:00
Brandon Baker
29ff658d92 Update BINDINGS.md (#3774)
Bump supported raylib version of Raylib-cs to 5.0
2024-02-02 18:06:30 +01:00
IoIxD
7ec43022c1 Fix segfault in ExportWaveAsCode (#3769)
`char *txtData = (char *)RL_CALLOC(waveDataSize * 6 + 2000, sizeof(char));`

assumes every chunk being added to txtData is 6 bytes. This is not always true, sometimes a newline is involved and the data becomes 12 bytes instead, and this can cause a random segfault.

This commit changes `6` to `12`, and explains why in the comment.
2024-02-01 21:16:57 +01:00
Marrony Neris
c0b081fac0 Fix MeasureTextEx() height calculation (#3770) 2024-02-01 21:14:22 +01:00
Ray
25306eae42 REVIEWED: Issue on parsing #3765 2024-02-01 00:05:30 +01:00
Ray
d79828076f REVIEWED: macOS issues #3767 2024-02-01 00:03:06 +01:00
Ray
deaffb0698 Review PR #3746 formating 2024-01-29 21:16:17 +01:00
Jeffery Myers
bebf9547bd [CORE,RLGL] Fix scale issues when ending a mode (#3746)
* Only restore GL scale back to screen scale if we are returning to a screen, not a render texture.

* blankspace

* reset back to default screen scale when ending a render texture since we are back on the default fbo
2024-01-29 21:10:23 +01:00
Brian E
812645b077 cleaned away unused macros in rcamera.h (#3762) 2024-01-28 13:49:07 +01:00
Alessandro Nikolaev
cf10cdd6b3 Added missing "standalone" functions to raudio.c & fixed return bug (#3760)
* Added GetFileNameWithoutExt, GetFileName & strprbrk to raudio.c

* Gave return values to SaveFileData & SaveFileText in raudio.c
2024-01-28 13:46:27 +01:00
veins1
f4add5f10d Fix rlSetUniformSampler (#3759)
Fix rlSetUniformSampler not setting sampler uniform if the same texture was already passed to a different sampler uniform
2024-01-28 13:45:19 +01:00
Ray
40f3df5b86 Update core_2d_camera_platformer.c 2024-01-24 21:17:11 +01:00
Victor Gallet
ff1eeafb95 Fix bug to retrieve material specular map in DrawMesh function, with incorrect index (#3758) 2024-01-23 12:37:54 +01:00
Idir Carlos Aliane
cb97a8063d [rtext.c] fixing some comments to align comments style (#3756) 2024-01-22 23:15:25 +01:00
Idir Carlos Aliane
6f1c31b25d Change some minor comments to align with comments style (#3755) 2024-01-22 21:26:18 +01:00
Idir Carlos Aliane
c133fee286 [raymath.h] Small code refactor (#3753)
* [raymath.h] Small refactor to avoid duplicated code

* Fixing some blank spaces to match same syle convention
2024-01-22 19:48:18 +01:00
Brian E
27645e16ab fixed small typo, replaced th with the (#3752) 2024-01-22 11:36:38 +01:00
Antonio Raúl
ef92ced370 fix CheckCollisionPointPoly (#3750) 2024-01-22 11:35:55 +01:00
Idir Carlos Aliane
68c32a4184 Fix typo in HISTORY.md (#3751)
There is a typo where 'undoubtdly' appears instead of 'undoubtedly'.
2024-01-22 07:58:47 +01:00
Alexandre Almeida
5c25913e09 Fix Android keycode translation and duplicate key constants (#3733)
* Fix Android keycode translation

* Simplify code a bit

* Rename KEYCODE_MAPPED_NUM to KEYCODE_MAP_SIZE

* Fix KEY_R and KEY_MENU duplicate

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-20 21:22:33 +01:00
John
192f7f1b29 [rcore rglfw] Feature Test Macros before include (#3737)
Move/Add Feature Test Macros before any includes.
See: [GNU Feature Test Macros](https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html)
> You should define these macros by using ‘#define’ preprocessor directives at the top of your source code files. These directives must come before any #include of a system header file. It is best to make them the very first thing in the file, preceded only by comments.

Alternative changes to rcore would be to change _POSIX_C_SOURCE to
200809L, which removes the need to define _XOPEN_SOURCE >= 500.

These changes allow for compilation with -std=c* (such as -std=c99)
without adding -D macros to the build step.

Co-authored-by: JayLCypher <jaylcypher@github.com>
2024-01-20 21:08:19 +01:00
Hongyu Ouyang
0a8165c0ac Make raylib/raygui work better on touchscreen (#3728)
* Fix that touch doesn't work for click/drag/raygui

* Add comments

* comments update
2024-01-20 21:05:30 +01:00
Anand Swaroop
b600786c52 Update BINDINGS.md (#3739) 2024-01-18 00:22:10 +01:00
Ray
c57b8d5a6a REVIEWED: ImageKernelConvolution(), formating and warnings 2024-01-15 20:32:46 +01:00
Blockguy24
d2b1256e5c Fix bounds check for ImageDrawRectangleRec (#3732) 2024-01-14 11:21:29 +01:00
Tobias Mock
02133092f8 Update OCaml bindings version (#3730) 2024-01-13 23:46:33 +01:00
Ray
cb2572fe07 Avoid asserts because could crash some decompressions https://github.com/raysan5/raygui/issues/364 2024-01-13 16:57:25 +01:00
Karl Zylinski
520c8cffb2 Simplified GetWindowScaleDPI() so it does not fetch the wrong DPI scale some times (Windows looks at center of window while the old raylib code looked on upper left corner of window, now it just uses the glfw function to fetch the window's current scaling). Also introduced a callback to update the CORE.Window.screenScaling when the content scaling updates, previously scaling did not work correctly on systems with multiple monitors that have different DPI scaling. (#3701) 2024-01-13 10:49:04 +01:00
Andrew Lee
b7141d556e Add shared library build option for build.zig and update to zig 0.12.0-dev.2139 (#3727)
* update build.zig to 0.12.0-dev.2139 and add shared lib option

* add no-sanitize workarounds
2024-01-13 10:46:53 +01:00
kolunmi
9d628d1d49 Enable animation names for the m3d model format. (#3714) 2024-01-11 19:49:25 +01:00
freakmangd
482722d881 Update to latest zig 0.12.0dev while keeping 0.11.0 compatibility (#3715)
* update build.zig for latest zig 0.12.0dev while still allowing 0.11.0

* update examples/build.zig and add nicer message for type mismatch
2024-01-11 19:48:37 +01:00
Lieven Petersen
a820c37ab2 implemented fill color TODO in ImageResizeCanvas() (#3720) 2024-01-11 19:48:14 +01:00
Le Juez Victor
746f129bfe Fix ImageDrawRectangleRec (#3721) 2024-01-11 19:37:42 +01:00
Hongyu Ouyang
64ba5cb570 Update a comment (#3724) 2024-01-11 19:33:24 +01:00
Tim Romero
2c124c96df [rtext] Adjust font atlas area calculation so padding area is not underestimated at small font sizes. (#3719) 2024-01-10 21:34:04 +01:00
Ray
be78255bea Update codeql.yml: Exclude src/external files 2024-01-08 01:13:44 +01:00
Alice Nyaa
be0ea89f83 Simplified for loop for some image manip functions (#3712) 2024-01-06 19:41:43 +01:00
Hongyu Ouyang
721e273547 Fix a bug in examples/shapes/shapes_following_eyes (#3710) 2024-01-06 11:32:10 +01:00
Ray
a4dc325a0c Reviewed Makefile SDL2 expected include/lib paths #3705 2024-01-05 22:51:46 +01:00
Ray
b4cb0f3e7d REVIEWED: LoadImageAnimFromMemory() #3704 2024-01-05 22:33:56 +01:00
Ray
e428ec940b Merge branch 'master' of https://github.com/raysan5/raylib 2024-01-05 22:33:22 +01:00
Ray
c95b71d40d Update raudio.c 2024-01-05 22:33:02 +01:00
Ray
3afb4dda97 Update raygui.h 2024-01-05 22:32:59 +01:00
ubkp
19bdcedf1c Hide unused warnings from stb_image_resize2.h (#3708) 2024-01-05 22:22:58 +01:00
Michael Scherbakow
eb6dcab308 Update raylib.zig version to 5.1-dev (#3698) 2024-01-04 10:51:53 +01:00
Ray
e46b6147fc Update copyright year to 2024 2024-01-03 14:16:39 +01:00
Ray
3f1e59a7cf Update copyright to 2024 2024-01-02 20:58:12 +01:00
seiren
0a25a3ed70 Update raylib_api.* by CI (#3692)
* wip: add parse.yml

* Temporarily force run

* Auto commit parse files

* Update raylib_api.* by CI

* Remove temporary setting

* format

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-31 15:06:46 +01:00
Kenta
710e811b27 Update BINDINGS.md (#3689)
Update Raylib.c3 to 5.0
2023-12-29 23:41:44 +01:00
Ray
1f3121d2fa Revert "Update raylib.h"
This reverts commit 7ea6adb29e.
2023-12-28 23:17:07 +01:00
Ray
dde738a2fd Merge branch 'master' of https://github.com/raysan5/raylib 2023-12-28 23:16:57 +01:00
ubkp
fd5e1e6afb [rtextures] Fix LoadImageAnimFromMemory() warning for fileData (#3686)
* Fix LoadImageAnimFromMemory() warning for fileData

* Add LoadImageAnimFromMemory() to raylib.h

* Fix missing ; on previous commit
2023-12-28 23:15:04 +01:00
ubkp
5b5a2d035d Fix TextReplace warning for const (#3687) 2023-12-28 23:13:47 +01:00
Ray
7ea6adb29e Update raylib.h 2023-12-28 22:10:10 +01:00
IoIxD
3fc43c1096 LoadImageAnimFromMemory (#3681) 2023-12-28 20:12:52 +01:00
maverikou
7cfdf33ff0 TextReplace const correctness (#3678)
* TextReplace const correctness

* cleanup
2023-12-28 20:09:49 +01:00
ubkp
43b4f90eb7 Fix SUPPORT_WINMM_HIGHRES_TIMER for PLATFORM_DESKTOP_SDL (#3679) 2023-12-28 20:08:04 +01:00
WisonYe
1727ddb9ea [ fix-crash-caused-by-zig-build ] - Fixed 'Illegal instruction' crash on 'rtextures' and 'raudio' model that caused by zig build. (#3682) 2023-12-28 15:41:33 +01:00
Jeffery Myers
ad64a43b34 [rshapes] Expose shapes drawing texture and rectangle (#3677)
* provide access to the shape texture so that shapes can be extended outside of raylib with the same optimizations as internal raylib functions.

* PR feedback, comply with C standards

* oops
2023-12-28 15:40:03 +01:00
Ray
99f22a47ff Update some versions BINDINGS.md 2023-12-25 14:44:49 +01:00
iacore
21bfd06570 Update BINDINGS.md (#3672)
Update zig libs version
2023-12-25 14:38:49 +01:00
Ray
36df9c5bd6 Update shaders_basic_pbr.c 2023-12-23 18:16:06 +01:00
Ray
e039a221a3 Review formating 2023-12-23 14:07:45 +01:00
Ray
706f74bce0 Update shaders_basic_pbr.c 2023-12-23 13:32:47 +01:00
Antonis Geralis
7ca95512d8 Review UnloadAutomationEventList (#3658)
* Review UnloadAutomationEventList

* Update raylib.h

* Update rcore.c

* Update core_automation_events.c

* Fix mistake
2023-12-23 12:14:39 +01:00
Ray
efe3510a9a REVIEWED: SDL text input to Unicode codepoints #3650
REVIEWED: GLFW naming conventions to reflect codepoints reading
2023-12-23 12:04:19 +01:00
Ray
1792bce292 REVIEWED: LoadTextureCubemap(), added mipmaps #3665 2023-12-23 11:26:23 +01:00
Tim Romero
f914020d45 VSCode sample project Mac fixup (#3666)
Change vscode config and makefile to add a missing IOKit framework reference and use whichever MacOSX sdk symlink is available
2023-12-23 11:22:16 +01:00
o3o
a06f3d0e34 Update BINDINGS.md (#3662)
Udated version of `bindbd-raylib3` to 5.0.0 (bind to raylib 5.0.0)
2023-12-22 17:40:57 +01:00
Ray
bb18018f29 REVIEWED: shaders_basic_pbr, added more comments 2023-12-21 21:32:53 +01:00
Ray
afbad4bbc6 Merge branch 'master' of https://github.com/raysan5/raylib 2023-12-21 21:32:04 +01:00
Ray
4805dddc18 Update shaders_deferred_render.c 2023-12-21 21:32:00 +01:00
glowiak
fbecab32e7 Add new COBOL binding (#3661) 2023-12-21 19:31:34 +01:00
Ray
68b6c79c3f Update rlgl.h 2023-12-20 01:03:52 +01:00
Ray
2fe68a8a12 REVIEWED PR deferred render 2023-12-20 00:51:51 +01:00
Jett
e71153258b fix for deferred rendering example. (#3655)
* fix for deferred rendering example.

* missed defines to build.
2023-12-20 00:27:59 +01:00
fubark
3f776df94e Update ray-cyber to 5.0 in BINDINGS.md (#3654) 2023-12-19 23:30:17 +01:00
Cinghy Creations
57a5ebe6c6 Don't use a separate thread when polling for gamepad events on DRM platforms (#3641) 2023-12-19 10:47:04 +01:00
kolunmi
8b5943d930 [rmodels] Set cgltf callbacks to use LoadFileData() and UnloadFileData() (#3652) 2023-12-19 10:38:57 +01:00
TheManTheMythTheGameDev
1fc3d9aeb2 Add shadowmapping example (#3653) 2023-12-19 10:37:41 +01:00
TheManTheMythTheGameDev
34a9163c52 Remove dependencies from PBR example (#3649)
* Remove dependencies from PBR example

* Reviewed example PR

---------

Co-authored-by: Ray <raysan5@gmail.com>
2023-12-19 10:36:03 +01:00
ubkp
9fcfc8d64b [rcore] Fix ShowCursor(), HideCursor() and review SetMouseCursor() for PLATFORM_WEB (#3647)
* Fix ShowCursor(), HideCursor() and review SetMouseCursor() for PLATFORM_WEB

* Add static to cursorLUT[]

* Re-review SetMouseCursor()
2023-12-17 13:46:21 +01:00
ubkp
2487174b48 Fix CORE.Input.Mouse.cursorHidden with callbacks for PLATFORM_WEB (#3644) 2023-12-16 18:25:55 +01:00
ubkp
0df78d4eeb Fix fullscreen known issue 1 for PLATFORM_WEB (#3642) 2023-12-16 18:22:02 +01:00
Ray
fd84ab3cf7 Bump CMake version required to avoid deprecated #3639 2023-12-15 19:17:44 +01:00
Ray
f3adde8bbd REVIEWED: DrawSplineLinear() to SUPPORT_SPLINE_MITERS 2023-12-15 18:40:19 +01:00
Toctave
0fc1765ff3 Implement miters in DrawSplineLinear (#3585)
* Implement miters in DrawSplineLinear

* Follow raylib style
2023-12-15 18:34:34 +01:00
Dongkun Lee
9de79861ea BM Font Extender (#3536)
* loadbmfont

* bmfontextender

* bm font

* Modify LoadBM Font

* Delete loadbmfontex.diff

* REVIEWED: `LoadBMFont()` PR

* Update rtext.c

* Update rtext.c

---------

Co-authored-by: Dongkun Lee <hope81dklee@outlook.com>
Co-authored-by: Ray <raysan5@gmail.com>
2023-12-15 18:32:01 +01:00
ubkp
e001f7e75e Add ToggleFullscreen() and required changes for PLATFORM_WEB (#3634) 2023-12-15 17:36:27 +01:00
devdad
9bdc217987 basic PBR example (#3621)
* basic pbr example

pbr implementation  includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file  currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve

* Unloading PBRMAterial

I forgot unloading PBRMaterial

* fix small issue with texOffset assigment.

value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset .

* Changed size of textures and file name changed

Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c ,
Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh);
but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh
2023-12-15 17:13:44 +01:00
ubkp
489f0b93f9 [rcore] Add GetWindowPosition() implementation for PLATFORM_WEB and fixes #3636 style/format (#3637)
* Add GetWindowPosition() implementation for PLATFORM_WEB and fixes #3636 style/format

* Remove double space
2023-12-15 16:24:45 +01:00
Braedon Lewis
1e7b99562a Add new raylib-beef binding (#3640) 2023-12-15 16:23:35 +01:00
ubkp
10c82595b0 Add GetMonitorWidth() and GetMonitorHeight() implementations for PLATFORM_WEB (#3636) 2023-12-14 20:55:33 +01:00
Ray
38626dcffd REVIEWED: HighDPI support on Web platform #3372 -WIP-
NOTE: The code is commented until the build system gets updated to latest emscripten.
2023-12-14 15:32:53 +01:00
Ray
d29b36310f Merge branch 'master' of https://github.com/raysan5/raylib 2023-12-14 15:32:45 +01:00
Ray
88db11fda4 Update rtextures.c 2023-12-14 15:30:48 +01:00
Matthew Oros
cec2261e96 [rcore] Flip VR screens (#3633) 2023-12-13 21:24:24 +01:00
Matthew Oros
387506faab [rcore] Remove unused vScreenCenter (#3632) 2023-12-13 21:22:44 +01:00
Romash
222f6f7877 Fix box blur symmetry & simplify code (#3631) 2023-12-13 21:21:08 +01:00
Benjamin Schmid Ties
6083d2b9f3 fixed coding style in function TextToFloat (#3627)
* function to convert string to float

* fix code to match coding conventions
2023-12-13 21:20:13 +01:00
lipx
a57a0ecd96 Update audio_stream_effects.c (#3618)
* Update audio_stream_effects.c

This may slightly improve performance and be more welcoming for new users despite being an more advanced feature. 
void * usually throws an error in most compilers and it would be better to just avoid it.

Also added <stdbool.h> because booleans are, sometimes, not defined by <stddef.h>.

* Update audio_stream_effects.c
2023-12-13 21:19:14 +01:00
2Bear
9322ad0f9b Ignore compiled dll binaries. (#3628) 2023-12-12 23:05:14 +01:00
Ray
c5ebdb8ba7 REVIEWED: Issue in sequence generation #3612 2023-12-11 09:33:21 +01:00
Ray
6f3c87a999 Fix #3613 2023-12-11 09:21:30 +01:00
riadbettole
31d3ed97c7 Update audio_raw_stream.c (#3624)
AudioInputCallBack has this
    audioFrequency += 1.0f;
    audioFrequency -= 1.0f;

cancels out each others
2023-12-11 09:12:30 +01:00
ubkp
a2e45239c3 [rcore] Complement SetWindowState() and ClearWindowState() for PLATFORM_WEB (#3625)
* Complement SetWindowState() and ClearWindowState() for PLATFORM_WEB

* Add FLAG_WINDOW_RESIZABLE to SetWindowState() and ClearWindowState() for PLATFORM_WEB
2023-12-11 09:11:42 +01:00
ubkp
39457ace2f [rcore] Add ToggleBorderlessWindowed() implementation for PLATFORM_WEB (#3622)
* Add ToggleBorderlessWindowed() for PLATFORM_WEB

* Fix coding convention
2023-12-11 09:11:20 +01:00
ubkp
44eeda2475 Optimize gesture handling for PLATFORM_DRM (#3616) 2023-12-11 08:58:55 +01:00
ubkp
ed8a18ea64 [rcore] Fix real touch gestures for PLATFORM_DESKTOP_SDL (#3614)
* Fix touch gestures for PLATFORM_DESKTOP_SDL

* Complement note and optimization

* Events optimization

* Optimize gesture handling

* Reverts previous commit and fixes GESTURE_DRAG to not trigger GESTURE_SWIPE* when it ends

* Reapply previous gesture handling optimization also fixing GESTURE_DRAG to not trigger GESTURE_SWIPE* when it ends
2023-12-11 08:57:51 +01:00
Peter0x44
28bdaa2da6 Update projects/CMake/CMakeLists.txt to raylib 5.0 (#3623) 2023-12-11 08:29:19 +01:00
David Williams
032cc497ca Updating CMake version to 5.0 so libraries are correctly versioned (#3615) 2023-12-09 19:33:12 +01:00
ubkp
a9ba51aa72 [rcore] Fix IsMouseButtonUp() for PLATFORM_WEB and PLATFORM_DRM (#3611)
* Fix IsMouseButtonUp() for PLATFORM_WEB

* Fix IsMouseButtonUp() for PLATFORM_DRM
2023-12-07 19:53:27 +01:00
ubkp
ab9bddb3bd [rcore] Fix IsMouseButtonUp() and add touch events for PLATFORM_DESKTOP_SDL (#3610)
* Fix IsMouseButtonUp() and add touch events for PLATFORM_DESKTOP_SDL

* Fix coding convention
2023-12-07 19:53:02 +01:00
Kenneth M
8b33d1eeb9 Fix IsMouseButtonUp() (#3609) 2023-12-07 19:50:36 +01:00
lesleyrs
6b93180130 Fix for free camera mode (#3603)
* fix free and fp cam

* revert
2023-12-07 19:49:49 +01:00
ubkp
d99617d084 [rcore] Fix IsKeyPressedRepeat() for PLATFORM_DESKTOP_SDL (#3605)
* Fix IsKeyPressedRepeat() for PLATFORM_DESKTOP_SDL

* Fix missing space
2023-12-07 19:47:58 +01:00
ubkp
984e83c2d0 Fix GetKeyPressed and GetCharPressed for SDL (#3604) 2023-12-05 10:02:48 +01:00
Ray
731b210f51 REVIEWED: WARNING: LoadFontData() avoid fallback glyphs
This is a redesign on font loading, missing glyphs are skipped instead of falling back to font `.notdef` special character (usually "tofu" character).
It is changed because not all fonts support a fallback glyph.
One improvement could be allowing users to define a custom fallback character, for example `?` glyph.
2023-12-04 17:32:55 +01:00
Ray
a016b4ded2 REVIEWED: LoadFontData(), load image only if glyph has been found in font 2023-12-03 20:17:16 +01:00
Ray
84ae189953 Create raylib_1024x1024.png 2023-12-03 20:16:26 +01:00
Ray
26d61875ee Create raylib.icns 2023-12-03 20:16:23 +01:00
Ray
8a586249d7 Fix Wrong Makefile flag #3593 2023-12-03 20:16:19 +01:00
Ray
d0a783e362 Revert "Fix Windows Hardcoding (#3600)"
This reverts commit 4ae2af0bcc.
2023-12-03 20:08:48 +01:00
Ray
5aa84a34ea Revert "Fix warning while using external GLFW older than version 3.4.0 (#3599)"
This reverts commit f1b0d15813.
2023-12-03 20:06:34 +01:00
mr sihc
4ae2af0bcc Fix Windows Hardcoding (#3600)
Compiles on Linux & co. now
2023-12-03 19:55:16 +01:00
Marco Maia
f1b0d15813 Fix warning while using external GLFW older than version 3.4.0 (#3599)
Co-authored-by: Marco Maia <marco.maia@iarasystems.com.br>
2023-12-03 19:53:52 +01:00
Peter0x44
8ae804ff9a Fix cmake-built libraylib.a to properly include GLFW's object files (#3598)
I broke this in PR #3573 by accidentally removing too much
The examples still compiled fine so I didn't notice - my guess is that
cmake was still adding a separate link to glfw manually.
2023-12-03 19:53:11 +01:00
WIITD
dfb0ca43c5 Update raylib-freebasic binding (#3591) 2023-12-03 19:51:47 +01:00
ubkp
0748dc2d1e Remove a duplicated loop for PLATFORM_DRM (#3590) 2023-12-01 14:55:48 +01:00
Peter0x44
55e7d1aad1 Expose OpenGL take 2 (#3588)
For some reason, there are actually two macros needed to control this.
Yes, I tried with only one, both are needed
2023-11-30 22:43:02 +01:00
Peter0x44
ef5069862d Fix mistake in pr #3572 (#3587) 2023-11-30 20:07:50 +01:00
Ray
e9ddb15d9d REVIEWED: rlgl function description and comments 2023-11-30 19:04:38 +01:00
Ray
6b136fac67 ADDED: ExportMeshAsCode() 2023-11-30 13:01:19 +01:00
ubkp
e84099bfd4 Fix CheckCollisionCircleRec() (#3584) 2023-11-30 10:11:45 +01:00
ubkp
bd81bdc24a Fix IsKeyPressedRepeat() for PLATFORM_DRM direct input (#3583) 2023-11-30 10:09:57 +01:00
Peter0x44
e7a486fa81 Hide unneeded internal symbols when building raylib as an so or dylib (#3573) 2023-11-28 20:43:45 +01:00
RadsammyT
fe53ba80dd Fix typos in src/platforms/rcore_*.c (#3581) 2023-11-28 20:39:10 +01:00
ubkp
1906f1eddf Fix SetMousePosition() for SDL (#3580) 2023-11-28 20:37:04 +01:00
ubkp
811abcb19f Fix rcamera.h so mouse/keyboard and gamepad can coexist for input (#3579) 2023-11-27 16:36:09 +01:00
ubkp
c35c531551 Fix SetWindowIcon() for SDL (#3578) 2023-11-27 16:34:17 +01:00
Emmanuel Méra
fc4b0c9aec Corrected the path of android ndk toolchains for OSX platforms (#3574) 2023-11-25 19:11:29 +01:00
BLUELOVETH
dfa64f228a Update raylib_api.* (#3564) 2023-11-24 00:46:54 +01:00
Peter0x44
94aba23ef4 Expose glad functions when building raylib as a shared lib (#3572) 2023-11-24 00:41:44 +01:00
Danil
ada1d0fb8c BINDINGS: Add Raylib-CSharp-Vinculum (#3571) 2023-11-23 14:41:31 +01:00
Ray
a3a73b9332 REVIEWED: textures_image_kernel #3556
Added screenshot
2023-11-21 22:55:47 +01:00
Steven Schveighoffer
b122270aa3 Fix version info in rlgl.h (#3558) 2023-11-21 22:47:52 +01:00
Chris Warren-Smith
664d22967c Update bindings for SmallBASIC (#3562) 2023-11-21 21:59:09 +01:00
Jorge A. Gomes
b13f97575b Updated BINDINGS -> Python raylib-py v5.0.0beta1 (#3557)
Co-authored-by: Jorge A. Gomes <jorgegomes83@gmail.com>
2023-11-21 17:02:09 +01:00
Steven Schveighoffer
d409df0b61 Update raylib-d binding (#3561) 2023-11-21 16:58:08 +01:00
Ray
4dae94821b Merge branch 'master' of https://github.com/raysan5/raylib 2023-11-21 00:15:06 +01:00
Ray
299cd9b830 Update rcore.c 2023-11-21 00:14:42 +01:00
Ray
994c4f4bdf Update rcore_desktop_sdl.c 2023-11-20 23:21:04 +01:00
Sergey Zapunidi
ce26e26177 Added missing textures_image_kernel example in web makefile (#3555)
* Added missing textures_image_kernel example in web makefile

* Added missing --preload-file for textures_image_kernel

---------

Co-authored-by: zap <zap@physlab.ru>
2023-11-20 20:49:58 +01:00
Dmitry Matveyev
7e60227720 Update BINDINGS.md for Janet (#3553)
This PR updates the bindings https://github.com/janet-lang/jaylib/pull/54
2023-11-19 11:11:51 +01:00
Auz
ee9b44245f Update BINDINGS.md for Raylib.nelua (#3552)
Bumped version number and updated the link for Raylib.nelua
2023-11-19 11:01:10 +01:00
Ray
a91ebb7517 Update BINDINGS.md 2023-11-18 20:12:08 +01:00
Rob Loach
eccfaa5fcf BINDINGS: Update raylib-cpp support to raylib 5.0 (#3551)
[raylib-cpp](https://github.com/RobLoach/raylib-cpp) supports raylib 5.0.
2023-11-18 20:08:45 +01:00
Gunko Vadim
67035815aa Update pascal binding.md (#3548) 2023-11-18 20:08:08 +01:00
MrScautHD
0137efde7a Expanding Possibilities: Integrating Additional glTF / GLB Data Formats for Enhanced 3D Experiences (#3546)
* Add more gltf data formats

* Fix forgot to save bone ids

* Fix misstake

* Fix code format

* Removed useless formats
2023-11-18 20:07:30 +01:00
Alexandre Almeida
f6de0358e1 Disable unused miniaudio features (#3544)
* Disable unused miniaudio features

* Fix mistakes
2023-11-18 20:06:19 +01:00
Karim
21469e92b0 Image convolution function ImageKernelConvolution (#3528)
* Added image convultion ImageKernelConvolution

* comment changes

* spelling changes and change to kernel size

* removed kernel normalization inside function

* fix to formating
2023-11-18 20:05:45 +01:00
_Tradam
e41a0c9721 fix for running gles2 with sdl on desktop (#3542) 2023-11-18 20:03:13 +01:00
Jussi Viitala
25c6c12150 Added glsl 100 and 120 shaders to lightmap example. (#3543)
* Added glsl 100 and 120 shaders to lightmap example.

* Fixed lightmap example resource loading on web.
2023-11-18 20:02:33 +01:00
Dennis E. Hamilton
f607cac267 Preparing for 5.1-dev (#3550)
Adjusting raylib.h to reflect post-5.0 changes now.
2023-11-18 20:01:02 +01:00
Ray
ae50bfa2cc Updated Npp intellisense data for raylib 5.0 2023-11-15 11:30:50 +01:00
Ray
e84a420766 Update miniaudio to v0.11.21 2023-11-15 10:25:09 +01:00
2Bear
efc0fed9ce Fix tiny spelling mistake. (#3540) 2023-11-14 14:28:45 +01:00
Ray
5ac00a3ccb Merge branch 'master' of https://github.com/raysan5/raylib 2023-11-14 12:25:58 +01:00
ubkp
db70db5f4d Fix missing keys on PLATFORM_DESKTOP_SDL (#3539) 2023-11-14 11:49:27 +01:00
Ray
da660058eb Update HISTORY.md 2023-11-14 11:47:27 +01:00
Ray
92b7589f89 Update CHANGELOG 2023-11-14 11:47:23 +01:00
Ray
a6c33193f7 Update HISTORY.md 2023-11-13 21:40:37 +01:00
Ray
d03d6787d9 Update HISTORY.md 2023-11-13 21:21:38 +01:00
Ray
5c79c5a2ec Update rcore.c 2023-11-13 16:11:10 +01:00
ubkp
87f26c845c Fix mouse button order for SDL (#3534) 2023-11-13 00:16:31 +01:00
Ray
4f67f5f159 REVIEWED: TakeScreenshot(), potential issues 2023-11-12 12:38:10 +01:00
JupiterRider
0873af4734 Update BINDINGS.md (#3531) 2023-11-12 12:23:00 +01:00
Le Juez Victor
9099077075 [rlgl] Fixed return type of GetCompressedFormatName (#3529)
The return type of `GetCompressedFormatName` has been corrected from `char *` to `const char *`
2023-11-12 00:09:00 +01:00
Ray
1b88f2ec03 Review #3526 2023-11-11 20:53:36 +01:00
isaacgravenortechnologies
de3072f838 Added wiki links to README (#3525)
* Added wiki link

* Added second wiki link
2023-11-11 18:11:58 +01:00
ubkp
9634c84e1c Fix automation recording (#3523) 2023-11-11 16:06:23 +01:00
Ray
d32ebbe716 Testing contributors info 2023-11-11 16:05:02 +01:00
Ray
bdcca4510d Update ROADMAP.md 2023-11-10 23:25:00 +01:00
Ray
107ece438a Reviewed duplicate lines 2023-11-10 19:48:47 +01:00
Ray
e7ba72ded9 Update core_automation_events.c 2023-11-10 19:36:58 +01:00
Ray
e4ea116857 Reviewing automation events on web... 2023-11-10 19:25:28 +01:00
Ray
16b79f2c70 Format tweaks 2023-11-10 19:22:22 +01:00
Miloslav Milenkov
a92c34d83c Changed keybinds for the automation example to avoid conflict with browser shortcuts (#3519) 2023-11-10 15:04:04 +01:00
Ray
30dcbaff20 Update rlgl.h 2023-11-10 13:33:42 +01:00
Ray
737cd0be7f Updated for upcoming raylib 5.0 2023-11-10 13:27:13 +01:00
maksut
1b524bb2ec WindowShouldClose(), reset shouldClose flag when window is inited (#3518) 2023-11-09 23:36:22 +01:00
Ray
80aafdb38f REVIEWED: BeginScissorMode() #3510 2023-11-09 23:35:24 +01:00
Ray
c471d22965 Update miniaudio.h 2023-11-09 23:22:30 +01:00
Ray
21dc42d2ad Updated examples 2023-11-09 09:53:25 +01:00
Ray
c69b89cc42 Update example: shapes_splines_drawing 2023-11-09 02:01:00 +01:00
Ray
ed2ac2ae79 Update CHANGELOG 2023-11-09 00:16:58 +01:00
Ray
4c2340aea6 Update core_2d_camera_platformer.c 2023-11-08 23:35:27 +01:00
Ray
9c2308bdc3 Examples reviews 2023-11-08 23:28:31 +01:00
Ray
022b464b0b Remove BOM 2023-11-08 20:37:35 +01:00
Ray
040b945fef Reviewed some examples and warnings 2023-11-08 20:09:32 +01:00
Ray
bee6d7f065 Update Makefile.Web 2023-11-08 19:34:44 +01:00
Ray
33580991c7 Update shell.html 2023-11-08 19:34:38 +01:00
Ray
e7114a5c2a Update rcore.c 2023-11-08 19:34:29 +01:00
Ray
9d8a11f21a Update textures_textured_curve.c 2023-11-08 18:13:25 +01:00
Ray
21354119cc REVIEWED: Makefile.Web, reorganize and add examples 2023-11-08 18:10:29 +01:00
Ray
bd3ffa7db3 REDESIGNED: Spline drawing functionality
This change allows more versatile and consistent splines drawing. It also gives more control to advance users to draw splines as individual segments.
2023-11-08 17:42:35 +01:00
Ray
bbf0c3a46d REVIEWED: Added new examples to VS2022 solution 2023-11-08 17:41:08 +01:00
Ray
fe757b6267 Update rtextures.c 2023-11-08 17:40:23 +01:00
Ray
60fab9c405 Update README.md 2023-11-08 15:14:21 +01:00
ubkp
271a72f2f2 Fix absRange for PLATFORM_DRM (#3517) 2023-11-07 22:15:23 +01:00
Ray
580fbf441c Update textures_textured_curve.c 2023-11-07 20:02:55 +01:00
Ray
4b87cc455d Update shapes_splines_drawing.c 2023-11-07 19:58:45 +01:00
Ray
f01d3db739 ADDED: GetSplinePoint*() functions for spline evaluation
RENAMED: `DrawLine<spline_type>()` to `DrawSpline<spline_type>()` for more consistent and clear naming
REVIEWED: Bezier drawing parameters order, more consistent
REVIEWED: Spline-based examples -WIP-
2023-11-07 19:25:49 +01:00
Ray
c69e1c379b Merge branch 'master' of https://github.com/raysan5/raylib 2023-11-07 19:22:21 +01:00
Ray
e8a3f9f7fa ADDED: Open-graph image alt properties 2023-11-07 19:22:12 +01:00
ubkp
9a2b735645 Fix mouse/touch/gestures for PLATFORM_DRM (#3515) 2023-11-07 19:02:24 +01:00
Ray
a57ac0b18e Update m3d.h 2023-11-07 13:52:36 +01:00
Ray
30987eaf06 Update cgltf.h 2023-11-07 13:52:33 +01:00
Ray
02aa1ee873 Updated dr audio libraries 2023-11-07 13:48:48 +01:00
Ray
11de73dfd6 Update miniaudio.h 2023-11-07 13:44:55 +01:00
mooff
3b09ef58ca Add ES 3.0 to CMakeOptions (#3514) 2023-11-07 08:41:15 +01:00
Jeffery Myers
6cd37e57a6 Fix warnings in visual studio (#3512) 2023-11-06 20:31:07 +01:00
Ray
fc21a8e552 Update raygui.h 2023-11-06 20:14:40 +01:00
Ray
386bf890a0 Merge branch 'master' of https://github.com/raysan5/raylib 2023-11-06 20:06:46 +01:00
Ray
adaecba162 Update codeql.yml 2023-11-06 20:06:30 +01:00
Ray
9c816bbac1 Update codeql.yml 2023-11-06 19:59:30 +01:00
Ray
a810976aa6 REVIEWED: CodeQL workflow, cleaning and organization 2023-11-06 19:53:44 +01:00
Ray
0a9bd393dc REVIEWED: sinfl external library to avoid ASAN complaints #3349 2023-11-06 19:30:00 +01:00
Ray
8b2103fc77 REVIEWED: ScanDirectoryFiles*()- Paths building slashes sides #3507 2023-11-06 19:15:11 +01:00
b4yuan
b216e2fc98 Add CodeQL Workflow for Code Security Analysis (#3476)
* Add CodeQL Workflow for Code Security Analysis

Add CodeQL Workflow for Code Security Analysis

This pull request introduces a CodeQL workflow to enhance the security analysis of our repository. CodeQL is a powerful static analysis tool that helps identify and mitigate security vulnerabilities in our codebase. By integrating this workflow into our GitHub Actions, we can proactively identify and address potential issues before they become security threats.

We added a new CodeQL workflow file (.github/workflows/codeql.yml) that
- Runs on every push and pull request to the main branch.
- Excludes queries with a high false positive rate or low-severity findings.
- Does not display results for third-party code, focusing only on our own codebase.

Testing:
To validate the functionality of this workflow, we have run several test scans on the codebase and reviewed the results. The workflow successfully compiles the project, identifies issues, and provides actionable insights while reducing noise by excluding certain queries and third-party code.

Deployment:
Once this pull request is merged, the CodeQL workflow will be active and automatically run on every push and pull request to the main branch. To view the results of these code scans, please follow these steps:
1. Under the repository name, click on the Security tab.
2. In the left sidebar, click Code scanning alerts.

Additional Information:
- You can further customize the workflow to adapt to your specific needs by modifying the workflow file.
- For more information on CodeQL and how to interpret its results, refer to the GitHub documentation and the CodeQL documentation.

Signed-off-by: Brian <bayuan@purdue.edu>

* Add CodeQL Workflow for Code Security Analysis

Add CodeQL Workflow for Code Security Analysis

This pull request introduces a CodeQL workflow to enhance the security analysis of our repository. CodeQL is a powerful static analysis tool that helps identify and mitigate security vulnerabilities in our codebase. By integrating this workflow into our GitHub Actions, we can proactively identify and address potential issues before they become security threats.

We added a new CodeQL workflow file (.github/workflows/codeql.yml) that
- Runs on every pull request (functionality to run on every push to main branches is included as a comment for convenience).
- Runs daily.
- Excludes queries with a high false positive rate or low-severity findings.
- Does not display results for git submodules, focusing only on our own codebase.

Testing:
To validate the functionality of this workflow, we have run several test scans on the codebase and reviewed the results. The workflow successfully compiles the project, identifies issues, and provides actionable insights while reducing noise by excluding certain queries and third-party code.

Deployment:
Once this pull request is merged, the CodeQL workflow will be active and automatically run on every push and pull request to the main branch. To view the results of these code scans, please follow these steps:
1. Under the repository name, click on the Security tab.
2. In the left sidebar, click Code scanning alerts.

Additional Information:
- You can further customize the workflow to adapt to your specific needs by modifying the workflow file.
- For more information on CodeQL and how to interpret its results, refer to the GitHub documentation and the CodeQL documentation (https://codeql.github.com/ and https://codeql.github.com/docs/).

Signed-off-by: Brian <bayuan@purdue.edu>

* Add CodeQL Workflow for Code Security Analysis

Add CodeQL Workflow for Code Security Analysis

This pull request introduces a CodeQL workflow to enhance the security analysis of our repository. CodeQL is a powerful static analysis tool that helps identify and mitigate security vulnerabilities in our codebase. By integrating this workflow into our GitHub Actions, we can proactively identify and address potential issues before they become security threats.

We added a new CodeQL workflow file (.github/workflows/codeql.yml) that
- Runs on every pull request (functionality to run on every push to main branches is included as a comment for convenience).
- Runs daily.
- Excludes queries with a high false positive rate or low-severity findings.
- Does not display results for git submodules, focusing only on our own codebase.

Testing:
To validate the functionality of this workflow, we have run several test scans on the codebase and reviewed the results. The workflow successfully compiles the project, identifies issues, and provides actionable insights while reducing noise by excluding certain queries and third-party code.

Deployment:
Once this pull request is merged, the CodeQL workflow will be active and automatically run on every push and pull request to the main branch. To view the results of these code scans, please follow these steps:
1. Under the repository name, click on the Security tab.
2. In the left sidebar, click Code scanning alerts.

Additional Information:
- You can further customize the workflow to adapt to your specific needs by modifying the workflow file.
- For more information on CodeQL and how to interpret its results, refer to the GitHub documentation and the CodeQL documentation (https://codeql.github.com/ and https://codeql.github.com/docs/).

Signed-off-by: Brian <bayuan@purdue.edu>

* Add CodeQL Workflow for Code Security Analysis

Add CodeQL Workflow for Code Security Analysis

This pull request introduces a CodeQL workflow to enhance the security analysis of our repository. CodeQL is a powerful static analysis tool that helps identify and mitigate security vulnerabilities in our codebase. By integrating this workflow into our GitHub Actions, we can proactively identify and address potential issues before they become security threats.

We added a new CodeQL workflow file (.github/workflows/codeql.yml) that
- Runs on every pull request (functionality to run on every push to main branches is included as a comment for convenience).
- Runs daily.
- Excludes queries with a high false positive rate or low-severity findings.
- Does not display results for git submodules, focusing only on our own codebase.

Testing:
To validate the functionality of this workflow, we have run several test scans on the codebase and reviewed the results. The workflow successfully compiles the project, identifies issues, and provides actionable insights while reducing noise by excluding certain queries and third-party code.

Deployment:
Once this pull request is merged, the CodeQL workflow will be active and automatically run on every push and pull request to the main branch. To view the results of these code scans, please follow these steps:
1. Under the repository name, click on the Security tab.
2. In the left sidebar, click Code scanning alerts.

Additional Information:
- You can further customize the workflow to adapt to your specific needs by modifying the workflow file.
- For more information on CodeQL and how to interpret its results, refer to the GitHub documentation and the CodeQL documentation (https://codeql.github.com/ and https://codeql.github.com/docs/).

Signed-off-by: Brian <bayuan@purdue.edu>

* Run CodeQL Analysis weekly + incorporate build script into WF

* remove: fail_on_error.py

* update: codeql.yml

---------

Signed-off-by: Brian <bayuan@purdue.edu>
2023-11-06 19:11:41 +01:00
Ray
8739c28949 REVIEWED: Scissor mode to support RenderTexture #3510 2023-11-06 19:09:12 +01:00
gulrak
56b5a5c4f0 BeginScissorMode checks for render texture to avoid using GetWindowScaleDPI (#3510) 2023-11-06 19:03:12 +01:00
Ray
304bf2cd17 ADDED: Flag to know we are rendering to texture #3510 2023-11-06 19:02:11 +01:00
Aniket Teredesai
b9f98dd8cd [build]: add uninstall cmake target (#3511) 2023-11-06 10:12:36 +01:00
Ray
a470cdce4c Merge branch 'master' of https://github.com/raysan5/raylib 2023-11-05 20:12:00 +01:00
Ray
2a67ac0027 REVIEWED: rlgl_standalone examples #3487
Example is intended for `PLATFORM_DESKTOP` only and OpenGL 3.3 Core profile.
2023-11-05 20:11:53 +01:00
Ray
8b3c18de54 Updated GLFW for 64bit 2023-11-05 20:11:14 +01:00
Ray
343e92322b Update README.md 2023-11-05 19:46:25 +01:00
JupiterRider
2252f747b7 Update Makefile (#3509) 2023-11-05 19:42:56 +01:00
Ray
925978ffde Update qoa.h 2023-11-05 19:41:22 +01:00
Ray
6ebfc6023b Update rl_gputex.h 2023-11-05 19:40:00 +01:00
Ray
57f77c3858 Update qoi.h 2023-11-05 19:39:57 +01:00
Ray
127d69e887 Update README.md 2023-11-05 19:24:45 +01:00
glowiak
17a968d2ed Jaylib is now up-to-date (#3508) 2023-11-05 15:58:48 +01:00
Ray
53451e98a7 Updated open graph for examples 2023-11-05 13:02:29 +01:00
Ray
cbf0324c34 Updating web shells open-graph info 2023-11-05 12:18:54 +01:00
freakmangd
39b539c42f Allow raylib to be built with zig 0.11.0 and zig 0.12.0dev (master) (#3506)
* allow zig 0.11.0 and 0.12.0dev to build raylib

* update comment
2023-11-04 21:05:21 +01:00
Ray
32e4be6fb9 Update rcore.c 2023-11-03 22:23:50 +01:00
Ray
2d1b211920 ADDED: LoadRandomSequence()/UnloadRandomSequence() 2023-11-03 20:21:43 +01:00
AndreaBoroni
5da0074fed Fixed Issue 3504 (#3505) 2023-11-03 19:12:42 +01:00
Ray
301d1b85ab Update raylib version to **raylib 5.0** 2023-11-02 18:18:27 +01:00
Ray
3c3e311190 Remove unneeded line on web platform 2023-11-02 18:18:05 +01:00
Ray
807516a991 Support OpenGL ES 3.0 building on Web
For some reason, the equivalent requested context (WebGL 2.0) is not provided, despite being properly requested.
2023-11-02 18:13:37 +01:00
Ray
b40f93b9e3 Comments tweaks 2023-11-02 18:12:22 +01:00
Ray
01bbd42519 Update rprand.h 2023-11-02 18:11:13 +01:00
ubkp
fe34fc7c6b Partial fix the gesture system for DRM (#3502) 2023-11-02 17:35:11 +01:00
Caleb Barger
ba75a7a23b build.zig updates for 0.11.0 release. (#3501) 2023-11-02 09:14:34 +01:00
ubkp
de1ceae4b0 [core] Fix gestures for PLATFORM_DESKTOP_SDL (#3499)
* Fix gestures for SDL

* Review the gesture handling for SDL

* Review 2
2023-11-02 09:13:41 +01:00
Ray
35d27fb11b REVIEWED: Pointers exposing not required for ES3 2023-11-02 09:04:05 +01:00
Ray
d77c918d51 Update rcore_web.c 2023-11-01 16:24:06 +01:00
Ray
c563490cf8 Update rcore_web.c 2023-11-01 15:28:31 +01:00
Ray
64d64cc181 REVIEWED: Potential code issues reported by CodeQL #3476 2023-11-01 15:28:18 +01:00
ubkp
ba21b8d274 Moves keymapUS[] and fixes GetCharPressed for DRM (#3498) 2023-11-01 12:20:33 +01:00
Jeffery Myers
38205d67da Remove unused structures from lighting fragment shaders (#3497) 2023-11-01 12:16:14 +01:00
Techuuu
d4c0d3bebe Update README.md (#3495)
* Update README.md

Fixed docs and improved.

* Update README.md

Done fixed it!

* Update README.md

Fixed!
2023-11-01 12:15:47 +01:00
Ray
df0f7ba61e Update shaders_deferred_render.c 2023-10-31 20:59:08 +01:00
Ray
aca854ccbf Update shaders_deferred_render.c 2023-10-31 20:46:10 +01:00
Ray
1407f6eb46 ADDED: rlBlitFramebuffer(), required for deferred render 2023-10-31 20:46:06 +01:00
Ray
15142a30f5 Update rmodels.c 2023-10-31 20:20:11 +01:00
Ray
43f36b9b05 REDESIGNED: LoadOBJ(), fix #3398
- Now triangulated  meshes are properly supported
 - Simplified code to consider issue situation
 - Removed mesh split per material, just define separate mesh if multiple materials are required
2023-10-31 20:15:45 +01:00
Justin
3645244f9f examples/shaders: Add an example for deferred shading (#3496)
* add example for deferred rendering/shading

* adapt convention

---------

Co-authored-by: 27justin <me@justin.cx>
2023-10-31 20:13:12 +01:00
Ray
de7beef05d Remove trailing spaces 2023-10-31 15:54:52 +01:00
Ray
f88604e6d5 Reviewed QOA seek PR 2023-10-31 15:54:38 +01:00
Ray
0a3567439d Comments tweaks 2023-10-31 15:49:42 +01:00
veins1
6842012748 Fix QOA seeking (#3494) 2023-10-31 15:48:24 +01:00
Ray
0d186a0557 REVIEWED: LoadModel(), removed cube fallback mechanism #3459 2023-10-31 11:32:07 +01:00
ubkp
ab61bad168 Fix relative mouse mode for DRM (#3492) 2023-10-31 10:16:12 +01:00
ubkp
d8acceca14 Fix example core_3d_camera_free (#3488) 2023-10-31 10:10:43 +01:00
Jett
ff04d52f12 Added rlEnablePointMode (#3490)
for rendering meshes with points.
similar to wire mode.
(NOTE) they still backface cull, so disable that if you want to show the entire mesh.
2023-10-31 08:43:32 +01:00
Ray
7677e4b928 REVIEWED: GetModelBoundingBox() #3485 2023-10-30 20:41:33 +01:00
Ray
b8fce54c0f Minor tweaks 2023-10-30 13:29:14 +01:00
Ray
abdebc244d Update rcore.c 2023-10-30 13:14:15 +01:00
Ray
9642fffbbb REVIEWED: GetRender*() issue on macOS highDPI #3367 2023-10-30 13:13:31 +01:00
ubkp
15632876f7 Fix examples Makefile for SDL (#3486) 2023-10-30 12:02:35 +01:00
Ray
ec91b44fb6 Merge branch 'master' of https://github.com/raysan5/raylib 2023-10-29 21:11:40 +01:00
Ray
fc7dcff4a7 ADDED: Pseudo-random numbers generator! 2023-10-29 21:11:30 +01:00
ubkp
049a6d475d Fix drm hang up on exit and mouse input issues (#3484) 2023-10-29 20:55:02 +01:00
Ray
09075d515a Some notes and comments 2023-10-29 20:44:32 +01:00
Ray
4625c41431 ADDED: Support for SDL building on Makefile 2023-10-29 20:44:18 +01:00
Ray
601e391b06 Remove physac library from raylib building
At this moment, physac is an external unmaintained library, better move out of raylib.
2023-10-29 20:43:52 +01:00
Ray
21243c8234 Update rcore_desktop_sdl.c 2023-10-29 20:42:29 +01:00
JaanDev
1fd61a00e4 Fix compressed DDS texture loading issues (#3483) 2023-10-29 20:21:00 +01:00
ubkp
12f3bc10c2 [core] Move rcore.h content to inside rcore.c (#3479)
* Move rcore.h content inside rcore.c

* Remove extern CoreData CORE
2023-10-29 20:20:19 +01:00
Ray
2da8cc383c Update Makefile.Web 2023-10-29 19:46:34 +01:00
Khalid Abdullah
e3363e9ad0 Typo fixed in HISTORY.md (#3481)
* [Typo fixed]  in CHANGELOG

* [Typo fixed] in HISTORY.md
2023-10-29 19:34:50 +01:00
Josh Colclough
975d4154e6 Fix the Julia set shader example (#3467)
* Simplify POI selection

* Improve mouse logic

* Add colour cycles to the shader to show finer details. Works well with high iteration numbers

* Testing things...

* Actually fix zoom. Also allow user to reset camera with 'R'

* Reset max iterations

* Tidying & comments

* Revert to original if statement

* Make mouse logic more readable

* Style conventions

* Coding conventions - f postifx on floating points

* Missed a few f postfixes
2023-10-29 16:41:02 +01:00
Ray
b4865588f8 REVIEWED: GetCurrentMonitor() #3472 2023-10-29 16:36:46 +01:00
ubkp
01c264123d Remove rcore.h include from SDL (#3475) 2023-10-29 16:23:38 +01:00
Khalid Abdullah
effa3ee249 [Typo fixed] in CHANGELOG (#3477) 2023-10-29 16:22:59 +01:00
SuperUserNameMan
b46505b13d Update tinyobj_loader_c.h (#3474)
temporary quickfix for issue #3473
2023-10-27 17:13:10 +02:00
Alexandre Almeida
2db7c727b6 GetCurrentMonitor() - use closest monitor (#3472) 2023-10-27 17:01:05 +02:00
Ray
3afd0a55b9 Update miniaudio to latest dev #3471 2023-10-27 16:55:27 +02:00
Ray
f721429f25 ADDED: SetAutomationEventBaseFrame(int frame) 2023-10-27 01:19:10 +02:00
Ray
98fcbe3fe2 Update core_automation_events.c 2023-10-27 00:50:02 +02:00
Ray
654b4e6257 Update core_automation_events.c 2023-10-27 00:45:00 +02:00
Ray
99dac5451c ADDED: Automation Events System, exposed to users
Added new API to record and play events
Added examples illustrating functionality
2023-10-26 23:59:19 +02:00
Ray
067dbe8657 ADDED: Drop files support to PLATFORM_DESKTOP_SDL 2023-10-26 23:57:07 +02:00
Ray
d0141bd105 Remove trail spaces 2023-10-26 23:56:38 +02:00
Ray
e4547eb422 Remove trail spaces 2023-10-26 23:56:03 +02:00
Ray
1cef62cf05 REVIEWED: glfwGetError() not availbale on PLATFORM_WEB fix #3470 2023-10-26 11:10:41 +02:00
Ray
77730c80d9 Updated to miniaudio v0.11.19 #3448 2023-10-26 10:34:39 +02:00
Ray
eddeafd2ed Revert "Fix IsGestureDetected parameter inconsistency in raylib.h with rgextures.h (#3464)"
This reverts commit 804f1a83eb.
2023-10-26 10:28:00 +02:00
jestarray
804f1a83eb Fix IsGestureDetected parameter inconsistency in raylib.h with rgextures.h (#3464)
closes https://github.com/raysan5/raylib/issues/3463
2023-10-26 10:24:21 +02:00
Alexandre Almeida
2f6b2897fe GetCurrentMonitor() - check window center instead of top-left corner (#3468) 2023-10-26 10:18:00 +02:00
2Bear
9a687e3153 Fix missing PLATFORM_DESKTOP_SDL checks. (#3469) 2023-10-26 10:15:25 +02:00
ubkp
cb1c2ffda1 Fix gamepad names for PLATFORM_DESKTOP/GLFW (#3462) 2023-10-25 19:13:51 +02:00
ubkp
b0c0f2e560 Fix OpenURL on SDL (#3460) 2023-10-25 12:17:54 +02:00
Ray
7e5eff8a29 Revert "Fix #3461"
This reverts commit 8fbd42d592.
2023-10-25 10:15:19 +02:00
Ray
8fbd42d592 Fix #3461 2023-10-25 10:14:17 +02:00
Ray
803b1a910e REVIEWED: Check OpenGL version required, fix #3457 2023-10-23 19:59:29 +02:00
Ray
a0f0034352 REVIEWED: InitPlatform() organization and code-gardening 2023-10-23 19:15:40 +02:00
Ray
3ff6026917 REVIEWED: Move screen capture logic to rcore.c, available for all platforms 2023-10-23 18:32:24 +02:00
Lukas
daf227a185 Fixes a memory leak as a result of creating an AudioBuffer* with the old source.frameCount. This internally allocates memory to the structs data pointer which is then later overridden by the correct sound data of the source sound. (#3458)
Additionally added a volume assignment from old to new as currently there is no way to get the volume of a sound and the AudioBuffer struct is not reachable from user code due to opaque definition.
2023-10-23 18:16:28 +02:00
Jeffery Myers
4ed776368a When the frame counter gets to 0, reset the FPS average counter. This allows the window to be closed and reopened with clean FPS stats. (#3445) 2023-10-23 10:11:50 +02:00
ubkp
8f517b7651 Fix compilation for PLATFORM_WEB examples (#3454) 2023-10-23 10:05:40 +02:00
Peter0x44
b3028e4891 Review prerequisites of rcore.c (#3453)
rcore_desktop_sdl.c was not present in the list of prerequisites this
patch changes them to use a wildcard, so any other platforms added in
future will be tracked properly
2023-10-22 19:45:49 +02:00
Peter0x44
e33e9da277 Add DrawCircleLinesV for consistency (#3452)
ImageDrawCircleLinesV already existed, so I'm not sure why this was
missing. It is trivial to implement, anyway
2023-10-22 17:13:49 +02:00
Ray
f0124df0e8 Update CHANGELOG 2023-10-22 15:34:24 +02:00
Ray
cdb394fac6 Update CHANGELOG for **raylib 5.0** -WIP- 2023-10-22 15:21:25 +02:00
Ray
0e029f719b Revert "REVIEWED: sinfl, fix #3349"
This reverts commit c4fb6c8517.
2023-10-22 15:17:35 +02:00
Ray
9127ee2ff9 Merge branch 'master' of https://github.com/raysan5/raylib 2023-10-22 15:16:08 +02:00
Ray
2b90b5600c Revert "Update sinfl.h"
This reverts commit da9bc564d2.
2023-10-22 15:15:56 +02:00
Keith Stellyes
ea325c54e8 fix examples Makefile to use Makefile.Web when building for web (#3449)
Co-authored-by: Keith Stellyes <keith@keithstellyes.com>
2023-10-22 14:58:35 +02:00
Ray
da9bc564d2 Update sinfl.h 2023-10-22 10:31:35 +02:00
Ray
c4fb6c8517 REVIEWED: sinfl, fix #3349 2023-10-22 10:27:22 +02:00
Ray
1aad6a2fc0 REVIEWED: New platform backend template comments 2023-10-22 10:09:03 +02:00
Ray
bcfa7c6718 Update rcore_desktop.c 2023-10-22 10:08:39 +02:00
ubkp
8cda4273ec [core] Complement implementations for SDL (3) (#3450)
* Fix SetWindowMinSize and SetWindowMaxSize

* Fix window resizes to update the viewport

* Fix window resizes to update the viewport 2
2023-10-22 09:45:04 +02:00
ubkp
e5993c4a4b [core] Complement implementations for SDL (2) (#3447)
* Add note and todo to GetWindowScaleDPI

* Complement ToggleFullscreen and change ToggleBorderlessWindowed

* Complement SetWindowState and ClearWindowState
2023-10-21 12:11:54 +02:00
ubkp
c66eb49199 [core] Complement implementations for SDL (#3444)
* Complement SetWindowMonitor SDL implementation

* Complement SetWindowMonitor SDL implementation 2

* Complement SetWindowMonitor SDL implementation 3

* Complement GetMonitorPosition SDL implementation

* Small tweaks to various SDL implementation

* Small tweaks to various SDL implementation 2
2023-10-20 17:38:14 +02:00
Ray
081fffd46e REVIEWED: Issue with functions definitions 2023-10-19 13:57:31 +02:00
Ray
b674e344a8 REVIEWED: Issue with symbols exposure 2023-10-19 13:46:02 +02:00
Ray
65dd0afb60 Update Makefile 2023-10-19 13:41:09 +02:00
Ray
982641228c REDESIGNED: Move platforms to separate directory #3313 2023-10-19 13:36:10 +02:00
ubkp
a64d606cb3 Fix GetMonitorPhysical* dpi (#3442) 2023-10-19 13:09:27 +02:00
Ray
f09840dcdc Merge branch 'master' of https://github.com/raysan5/raylib 2023-10-19 13:05:54 +02:00
Ray
19ff0e5fb1 REVIEWED: rlLoadTexture() #3440 2023-10-19 13:05:50 +02:00
Le Juez Victor
d7a098ebd3 [core] Add more missing implementations to SDL (#3439)
* [core] Add more missing implementations to SDL

Add functions: `SetWindowState`, `ClearWindowState`, `SetWindowIcon`

* Completing `SetWIndowState` and `ClearWindowState`

* Add VSync support for SDL

* Fix `CORE.Window.display` size issue

* Fix getting monitor size

We now get the size of the monitor where the window is located

* Add `ToggleBorderlessWindowed`

* Add `ToggleFullscreen`

* Add `GetMonitorPosition`

* Add `SetWindowMonitor`

NOTE: The function is implemented but incomplete

* Replace `TraceLog` by `TRACELOG`

* Fixed mouse delta issue in relative mode

Fixed a delta retrieval issue with `GetMouseDelta` when the mouse is in relative mode. Solution by @ubkp

* Fix `IsKeyPressed` issue

An issue caused `IsKeyPressed` to continuously return true for most keys when pressed

* Fix `SetGamepadMappings` returning
2023-10-19 00:09:00 +02:00
ubkp
d0a265cee8 [core] Add more missing implementations to SDL (#3436)
* Add more missing implementations 1

* Add more missing implementations 2

* Add more missing implementations 3

* Add more missing implementations 4

* Add more missing implementations 5

* Add more missing implementations 6
2023-10-18 08:05:35 +02:00
Ray
fc6152613f REVIEWED: raylib 5.0-dev version for a future release 2023-10-18 00:33:05 +02:00
Ray
53cd60bb29 REVIEWED: Move InitWindow()/CloseWindow() to rcore.c #3313 2023-10-18 00:03:47 +02:00
Michael Scherbakow
9534f48425 fix build.zig (#3433)
for zig master (2023-10-17)
2023-10-17 23:36:42 +02:00
Alexey Kutepov
d7d04a07a2 [raudio] Implement GetMasterVolume() (#3434)
It feels a little unfinished when you can SetMasterVolume but can't
really Get it. So to finish the symmetry here is the GetMasterVolume
implementation.
2023-10-17 23:35:38 +02:00
Le Juez Victor
80432fde62 Fix SDL keyboard issue (#3435)
* Fix SDL keyboard issue

We have added a mapping table between raylib keys and SDL scancodes.

* Change `ScancodeToKey` array type
2023-10-17 23:29:28 +02:00
ubkp
f353cd1c3a [core] Add some missing implementations to SDL (#3432)
* Add missing implementations

* Add missing implementations 2

* Add missing implementations 3

* Add missing implementations 4

* Add missing implementations 5
2023-10-17 12:01:01 +02:00
Ray
99ede0f747 Added some notes for alternative implementations #3362 2023-10-17 11:09:56 +02:00
Ray
7290ea9bfb Update models_mesh_generation.c 2023-10-17 10:59:25 +02:00
Dor Shapira
af83764f4f Implement GetCurrentMonitor in rcore_desktop_sdl (#3431)
* Implemented GetCurrentMonitor

* remove traceloog in GetCurrentMonitor
2023-10-17 09:53:53 +02:00
ubkp
fab99b8309 Remove rcore.h include from android (#3429) 2023-10-16 14:59:08 +02:00
Peter0x44
859c67792a Make sure rcore.o gets compiled in more situations (#3423)
Currently doing the following:
```
make
touch rcore_desktop.c
make
```

Will not result in rcore.o getting compiled again, despite that
rcore_desktop.c has changed

This commit resolves that
2023-10-16 14:08:55 +02:00
neyrox
c4296b166a Fix GenMeshPlane when resX != resZ (#3425)
Co-authored-by: Stanislav Yablonskiy <s.yablonskiy@pixonic.com>
2023-10-16 14:06:12 +02:00
ubkp
73363f829b [core] Fix some mouse issues on SDL (#3428)
* Fix mouse wheel getting stucked scrolling up or down

* Fix mouse movement on 3D

* Fix mouse button presses
2023-10-16 09:43:20 +02:00
Ray
84818c96f2 ADDED: NEW PLATFORM: SDL (DESKTOP) rcore_desktop_sdl #3313 2023-10-16 00:51:44 +02:00
Johnathan Corkery
a75251f0a9 Inclusion of Matte to BINDINGS.md (#3427) 2023-10-16 00:25:39 +02:00
MichaelFiber
18bedbd095 [core] Change axisCount to be an array (#3421)
* Update `PLATFORM_DRM` implementation of `GetGamepadAxisCount`

* Update

* Update `PLATFORM_DRM` implementation of `GetGamepadName`

* Add example to test gamepad info functions
Fix typo

* Update new gamepad info example

* Move axis count update out of GamepadThread - race condition

* Remove pointless if statement

* Start integrating stuff from the mikesinput lib

* Add more logging

* Add semicolon

* Add forgotten static

* More fixes

* Update axisCount to be array

* More debugging

* Add forgotten index to ready check

* Add path logging

* Missing parenthesis

* Add missing slash

* Fix axis count being reset to 0

* Fix missing paren

* Test polling joystick button events

* Major updates

* Fix missing array index

* Fix another missing array index

* Update example

* dumb logging

* Wrong constant for ev.code handling

* More dumb logging

* Remove some logging

* Add FPS to gamepad info example and try for max FPS

* tweak

* Revert example

* Add fps back

* Clean up after merge

* Switch axisCount to be an array
2023-10-14 22:51:35 +02:00
ubkp
781f717530 Remove the rcore.h include from drm, web, template (#3420) 2023-10-14 22:47:35 +02:00
Le Juez Victor
6d7112fde7 Fix some omissions (#3418)
Changes the return type of `InitGraphicsDevice()` from `bool` to `int`.
Adds a return at the end of `InitPlatform()`.
2023-10-14 22:46:46 +02:00
Ray
37e3ffcaac REVIEWED: SetMouseCursor() #3416 2023-10-14 22:45:56 +02:00
BeardedBread
b79e381092 Fix SetMouseCursor implementation for PLATFORM_WEB (#3416)
* Fix SetMouseCursor implementation for PLATFORM_WEB

- Restrict function to only set the cursor inside the canvas

* Set the CORE input mouse
2023-10-14 22:42:03 +02:00
Blue
bf639f02a8 Fix raygui.c leftover from zig build (#3417) 2023-10-14 22:38:36 +02:00
Le Juez Victor
2498170b95 Fix screen size check in InitPlatform() (#3415) 2023-10-14 15:11:56 +02:00
BeardedBread
d31b439e04 Implement SetMouseCursor for PLATFORM_WEB (#3414) 2023-10-14 15:10:33 +02:00
Ray
54950f9a3d Make sure CORE.Window.ready is set 2023-10-14 12:55:31 +02:00
Ray
b34c2ecbcb WARNING: REDESIGN: InitPlatform() to initialize all platform data #3313
`InitGraphicsDevice()` could be confusing because the function actually initialized many things: window, graphics, inputs, callbacks, timming, storage... restructured it.
2023-10-14 12:49:54 +02:00
Ray
4521a142c3 tweaks 2023-10-14 11:48:20 +02:00
Ray
005ba155c0 Minor tweaks 2023-10-14 10:56:09 +02:00
Daniil Kisel
2f08f435b9 Add Raylib.lean to BINDINGS.md (#3409) 2023-10-13 20:54:15 +02:00
Purple4pur
4981acb241 fix zig syntax errors in examples, and make it install executables correctly (#3395) 2023-10-13 19:55:52 +02:00
Daniil Kisel
5a0d9c8d43 Fix UpdateSound parameter name (#3405) 2023-10-13 19:54:43 +02:00
Le Juez Victor
36abc48cf8 Normalize gestureEvent.position coordinates (#3406)
Fixed the fact that coordinates were not normalized on Android, preventing detection of `GESTURE_DOUBLE_TAP`
2023-10-13 19:54:00 +02:00
ubkp
f3c27ec157 Fix android, drm compilation issue on InitWindow (#3407)
* Fix drm compilation issue on InitWindow

* Fix android compilation issue on InitWindow
2023-10-13 19:53:31 +02:00
Babak
0f4a8cf7cb Ported to stb_image_resize2.h (#3403) 2023-10-13 16:37:35 +02:00
Le Juez Victor
0daa5ce1e7 Fix GetMouseDelta() issue for Android (#3404) 2023-10-13 16:36:42 +02:00
Ray
2e65bc675c Moved some platforms functions to generic rcore #3313
Reviewed `InitWindow()` to clearly note platform specific code
2023-10-13 14:14:16 +02:00
Ray
876e6b3a0d REVIEWED: TextFormat(), added "..." for truncation #3366
It seems more standard than [TRUN]
2023-10-11 20:25:09 +02:00
ubkp
6ed8acde67 Fix windowMin/Max to screenMin/Max for android, drm, template (#3400) 2023-10-11 19:29:21 +02:00
Ray
61af8e7631 REVIEWED: #3399, Fix #3366 2023-10-11 12:20:03 +02:00
Murlocohol
28fb58f0ea [rtext] TextFormat() warn user if buffer overflow occured. (#3399)
* [rtext] TextFormat now alerts user to truncation.

* Update rtext.c

* Update rcore.c

* Update rtext.c
2023-10-11 12:15:40 +02:00
Ray
da9c2894fe Reorganized some functions, WaitTime() is common to all platforms 2023-10-11 12:10:38 +02:00
Ray
a2c5f01059 Reordered one function 2023-10-11 11:55:12 +02:00
Ray
0d175a69ae REVIEWED: Mouse and Touch functions generic to all platforms #3313 2023-10-11 11:36:44 +02:00
Ray
6ebfec99c5 Added gamepad functions as generic for all platforms 2023-10-11 11:14:03 +02:00
Ray
ddca525132 RENAMED: rcore_custom to rcore_template 2023-10-11 11:11:09 +02:00
MichaelFiber
daba1a2794 Split drm update input (#3397)
* Update `PLATFORM_DRM` implementation of `GetGamepadAxisCount`

* Update

* Update `PLATFORM_DRM` implementation of `GetGamepadName`

* Add example to test gamepad info functions
Fix typo

* Update new gamepad info example

* Move axis count update out of GamepadThread - race condition

* Remove pointless if statement
2023-10-11 10:30:51 +02:00
Ray
101a9b0445 Added comments and review some functions #3313 2023-10-10 11:59:41 +02:00
Ray
b94e6290a4 Added some comments and tweaks #3313 2023-10-10 10:50:09 +02:00
Ray
67a1e1ffae Update rtextures.c 2023-10-10 10:48:46 +02:00
Ray
cb57165956 REVIEWED: Fix #3387 2023-10-10 10:48:30 +02:00
Murlocohol
9702a17152 [raymath] Hotfix for Vector2Angle() and Vector2LineAngle() (#3396)
* Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want.

* Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want.

* [raymath] Hotfix for Vector2Angle and corresponding example

* [raymath] Hotfix for Vector2Angle and corresponding example

---------

Co-authored-by: Ray <raysan5@gmail.com>
2023-10-10 10:42:11 +02:00
Murlocohol
f0d949f931 Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want. (#3394) 2023-10-10 08:59:09 +02:00
Ray
0d8a6cfbfa Revert "Update zig build system to zig version 0.11.0 (#3393)"
This reverts commit 540ad99442.
2023-10-10 08:48:55 +02:00
Purple4pur
540ad99442 Update zig build system to zig version 0.11.0 (#3393)
* update build.zig for zig 0.11.0

* fix build.zig in examples to install executable correctly

* discard build.zig, only use src/build.zig, to avoid annoying zig-out path problem

* update zig version note
2023-10-09 13:05:19 +02:00
Ray
cfffa74f96 REVIEWED: Libs include order 2023-10-09 11:17:22 +02:00
Ray
f93d0ff9bc Update raudio.c 2023-10-09 11:17:09 +02:00
Ray
b55cf40b91 Format tweaks 2023-10-09 11:07:02 +02:00
Ray
a38afcf053 Merge branch 'master' of https://github.com/raysan5/raylib 2023-10-09 10:51:41 +02:00
Ray
f86f4159e6 Avoid references to PLATFORM_ flags #3313 2023-10-09 10:51:37 +02:00
SuperUserNameMan
dfb0326d00 Update rcore.c (#3326) 2023-10-09 09:54:43 +02:00
Ray
33c84b3c00 Update rmodels.c 2023-10-09 09:53:52 +02:00
Dennis E. Hamilton
7ab911b9a4 Ensure m3d faces in non-decreasing materialid sequence (#3385)
This modification replaces the expensive qsort protection with an
insertion sort that is near-instantaneous in the expected ordered case.
2023-10-09 09:49:58 +02:00
Masoud Naservand
d309b1eaa7 Call nsvgDeleteRasterizer() on created rasterizer (#3392)
the `NSVGrasterizer *rast` needs to be passed
to nsvgDeleteRasterizer() when we are done with it.
2023-10-09 09:47:54 +02:00
Ray
ea9de852bd ADDED: Custom platform template! #3313 2023-10-09 09:46:57 +02:00
Ray
682992e868 REVIEWED: Reorganize functions
`TakeScreenshot()` moved to `rcore.c`
2023-10-09 09:45:57 +02:00
Ray
5ed7717f0d REVIEWED: WaitTime(), added validation #3377 2023-10-09 01:21:46 +02:00
Ray
a0b30b0363 REVIEWED: SetupViewport() macOS #3313 2023-10-09 01:02:19 +02:00
Ray
df8d3a5afb REVIEWED: Some warnings #3313 2023-10-09 00:47:22 +02:00
Ray
d445fdaa19 WARNING: REDESIGN: Move platform specific data to platform submodules #3313
REVIEWED: Defines, macros, types and tweaks
2023-10-09 00:41:06 +02:00
Ray
bbbaae5562 Reviewed #3313 2023-10-08 23:38:52 +02:00
Ray
fecf56e15a WARNING: rcore module split per-platform **BIG CHANGE** (#3388)
* Submodules (#3311)

* Check in current state

* Add submodules to Makefile and clean up some imports

* Start moving InitGraphicsDeivce

* Move android_main and CloseWindow() out of rcore

* Move WindowShouldClose out of rcore

* Move IsWindowHidden out of rcore

* Move IsWindowMinimized out of rcore

* Move IsWindowMaximized, IsWindowFocused and IsWindowResized out of rcore

* Move ToggleFullscreen out of rcore

* Move MaximizeWindow, MinimizeWindow and RestoreWindow out of rcore

* Move 13 functions out of rcore:
ToggleBorderlessWindowed
SetWindowState
ClearWindowState
SetWindowIcon
SetWindowIcons
SetWindowTitle
SetWindowPosition
SetWindowMonitor
SetWindowMinSize
SetWindowMaxSize
SetWindowSize
SetWindowOpacity
SetWindowFocused

* Minor clean up, revert makefile change, include submodules directly in rcore

* Fix makefile comment

* Remove rcore.h from Makefile

* Remove debug include

* Move 18 functions from rcore to submodules
GetWindowHandle
GetMonitorCount
GetCurrentMonitor
GetMonitorPosition
GetMonitorWidth
GetMonitorHeight
GetMonitorPhysicalHeight
GetMonitorRefreshRate
GetWindowPosition
GetWindowScaleDPI
GetMonitorName
SetClipboardText
GetClipboardText
ShowCursor
HideCursor
EnableCursor
DisableCursor
GetTime

* Move TakeScreenshot, OpenURL, GetGamepadName out of rcore into submodules

* remove debugging #defines

* Move GetMonitorPhysicalWidth from rcore to submodule

* Move GetGamepadAxisCount from rcore

* Move SetGamepadMappings out of rcore

* Move GetMouseX, GetMouseY, GetMousePosition out of rcore

* Move SetMousePosition out of rcore

* Move GetMouseWheelMove out of rcore

* Move the last functions out of rcore

* Move shared function defs and some global var to rcore.h

* Clean up rcore.c and rcore.h a little more

* Remove unnecessary #define

---------

Co-authored-by: MichaelFiber <michael@cubeofb.org>

* REVIEWED: `PLATFORM_DESKTOP` Windows building

* Revert "REVIEWED: `PLATFORM_DESKTOP` Windows building"

This reverts commit 71a12171f7.

* Reviewed Windows building

* [split] Fix compilation for web (and desktop) (#3329)

* Fix compilation for web

* Remove EM_ASM_INT from core_input_gestures_web example

* Fix raymath undefined symbols for desktop and web

* Remove raylib_opengl_interop from examples Makefile

* Revert previous commit (8651c78)

* Fix TraceLog for web and desktop

* [split] `rcore`, `rcore_web` and `rcore_desktop` changes (batch 2) (#3334)

* Fix formatting

* Reapply commit 9d230d7 (#3305) that was missing

* Reapplies commits 719365f (#3309) and 8a1779b (#3312) that were missing

* Reapply commit 5c9cc3f (#3323) that was missing

* Reapply commit a2b3b1e that was missing

* Revert commit cef25c6 to fix macro redefined warning

* Move rcore.h #include to after config.h to fix macro redefinitions warnings

* [split] `rcore`, `web`, `desktop`, `android` changes (batch 3) (#3338)

* First pass to remove unneeded platform macros for web

* Second pass to remove unneeded platform macros for web

* Move GetTouchX, GetTouchY, GetTouchPosition from rcore to web, desktop, android

* Move SetMouseCursor from rcore to android, desktop, web

* [split] `rcore`, `web`, `desktop`, `android` changes (batch 4) (#3343)

* Fix ToggleBorderlessWindowed duplicated glfwSetWindowSize calls

* First pass to remove unneeded platform macros for android

* Second pass to remove unneeded platform macros for android

* Remove unneeded platform macros for desktop

* Relocate GetGamepadName and update SetGamepadMappings on android, desktop, web

* Add missing comment to web

* [split] `rcore`, `web`, `desktop`, `android` changes (batch 5) (#3345)

* Move SetExitKey from core to android, desktop, web

* Move some callbacks from core to desktop and web

* Relocate emscripten callbacks on web

* Relocate android callbacks on android

* Revert "Relocate android callbacks on android"

This reverts commit bbdbecc01e.

* Updates UnloadVrStereoConfig on rcore

* Update SetClipboardText on android

* Fix screenMin/Max default values for android

* [split] `rcore`, `drm` changes (#3347)

* Tweak makefiles for PLATFORM_DRM and move rcore_drm's dependencies to rcore.h

* Move drm functions to rcore_drm.c

* Fix a typo in rcore.c

* Add SetExitKey to rcore_drm.c

---------

Co-authored-by: MichaelFiber <michael@cubeofb.org>

* Fix compilation for android (#3360)

* Fix android include (#3364)

* Reviewed platform split #3313

 - Added file headers info
 - Added TRACELOG message for unimplemented functions
 - Reviewed code formatting and organization
 - Several code tweaks

* REVIEWED: `GetDirectoryPath()`

---------

Co-authored-by: MichaelFiber <42419558+michaelfiber@users.noreply.github.com>
Co-authored-by: MichaelFiber <michael@cubeofb.org>
Co-authored-by: ubkp <118854183+ubkp@users.noreply.github.com>
2023-10-08 18:36:07 +02:00
Ray
1327b570e3 Update raylib_parser.c 2023-10-08 18:11:55 +02:00
Ray
be8eea9eda Format tweaks 2023-10-08 18:10:05 +02:00
BLUELOVETH
97c2744a16 Update raylib_api.* (#3379) 2023-10-07 21:10:27 +02:00
Ray
52ba44c474 REVIEWED: #3363 2023-10-07 21:07:50 +02:00
DaveH355
da5407b776 Optimize m3d mesh creation (#3363)
* Optimize m3d mesh creation

* Avoid qsort() in rmodels.c

* Revert "Avoid qsort() in rmodels.c"

This reverts commit dc1bd559fd.

* Add comment
2023-10-07 21:02:05 +02:00
Luís Almeida
bc15c19518 Texture Tiling Example - luis605 (#3353)
* Texture Tiling Example - luis605

* Removed SetTraceLogLevel(LOG_WARNING);
2023-10-01 23:01:59 +02:00
Brian E
7351240218 [rcore] reveiwed GetWorldToScreenEx (#3351)
* reveiwed GetWorldToScreenEx
Used the inputted "width" instead of global CORE.window.
Used Vector3Transform instead of quaternion.

* reverted accidental unrelated change

* reverted Vector3Transform back

* fixed mistyped result

---------

Co-authored-by: Brian-E <brian@intra.fo>
2023-10-01 23:00:25 +02:00
BLUELOVETH
c3a1c8c8eb Update BINDINGS.md with raylib-pkpy-bindings (#3361) 2023-10-01 22:56:43 +02:00
Ray
73b54c862e Update raylib.h 2023-09-29 00:28:16 +02:00
Ray
411d0ee437 Update raylib_parser.c 2023-09-29 00:28:03 +02:00
Jeffery Myers
8d5a90ea3c Expose rcamera functions to the dll so they can be picked up by dll users and bindings that need the dll (#3355) 2023-09-27 23:47:18 +02:00
XXIV
9ff47fc807 fix BINDINGS.md (#3358) 2023-09-27 20:57:47 +02:00
WraithGlade
115ba2b079 Factor's Raylib bindings mention being at v4.5 (#3350)
I looked at the linked Factor binding page for Raylib and found that the file [summary.txt](https://github.com/factor/factor/blob/master/extra/raylib/summary.txt) has the following text in it:

```
Bindings for Raylib 4.5
```

The bindings have also been updated within the last week.

This implies that Factor's Raylib bindings are either already up to date with v4.5 or will be soon.

Thus, I have submitted this likely correction to Raylib's bindings table.

(PS: There are other Factor Raylib bindings on the internet that are less up-to-date, so don't confuse those with this.)
2023-09-26 18:59:40 +02:00
Ray
f2389a1e55 Remove trail spaces 2023-09-26 12:54:24 +02:00
Ray
f7c3035b8c Update raygui.h 2023-09-24 23:51:23 +02:00
Ray
c8a6093d52 Update examples creation requirements 2023-09-23 11:13:11 +02:00
Ray
557aeff253 REVIEWED: glInternalFormat is unsigned and actually, rlGetGlTextureFormats() returns 0 if fails 2023-09-22 11:59:52 +02:00
Ray
a3a5aa7c63 REVIEWED: LoadFileData() potential issues with dataSize 2023-09-22 11:58:53 +02:00
Ray
83d82b6697 Update rmodels.c 2023-09-22 11:58:24 +02:00
Ray
f27ea1f0c8 REVIEWED: IsGestureDetected() parameter type 2023-09-22 11:58:14 +02:00
Ray
7eb49d1c7b EXTERNAL: msf_gif.h, reviewed some warnings 2023-09-22 11:57:49 +02:00
Ray
477f5e5436 Update miniaudio v0.11.16 --> v0.11.18 2023-09-21 23:54:59 +02:00
Brian E
577a8de7c0 [raymath] Added macros for EPSILON on each function it's used in (#3330)
* Added macros for EPSILON
This is so the functions can be easily copied and used.

* used `#if !defined()` instead of `#ifndef`

---------

Co-authored-by: Brian-E <brian@intra.fo>
2023-09-21 23:48:48 +02:00
Ray
a2b3b1ebe4 REVIEWED: CompressData(), possible stack overflow
`struct sdefl` is almost 1MB, in some platforms it could generated a stack overflow, for example WebAssembly, where by default stack is only 65KB!
2023-09-20 21:23:43 +02:00
Ray
36e99860ee Added note about WebGL warning 2023-09-20 21:22:04 +02:00
Ray
c9020ece5d Update linux.yml 2023-09-19 18:52:40 +02:00
Ray
b335927665 Reviewed PR #3321 2023-09-18 19:43:10 +02:00
Christopher Odom
eb461512a7 Added UBSAN complaint fix to rLoadTexture #1891 (#3321) 2023-09-18 19:39:12 +02:00
Le Juez Victor
4d2906b0a5 Move mutex initialization before ma_device_start() (#3325) 2023-09-18 18:50:22 +02:00
Ray
5c9cc3f9f7 Reviewed #3323 2023-09-18 12:07:40 +02:00
Ray
b9acbbbc66 Fix #3323 2023-09-18 11:50:37 +02:00
Tobias Mock
421ae5bbd8 Update raylib-ocaml bindings to 4.5 version (#3322) 2023-09-17 22:52:34 +02:00
Ray
97c4333803 REVIEWED: UnloadRenderTexture(), additional check 2023-09-17 20:42:45 +02:00
Brian E
acf211a5fa general syntax fixes (#3319)
* Prettified a comment

* fixed broken indentation caused by another commit.
the commit renamed a bool to int and broke indentation: 233cf3970c

* Changed 0.001 and 0.00001 to EPSILON
This commit is untested.
I don't know what consequences this has.
Since the commits that added these numbers were before epsilon was added,
I have assumed that epsilon could replace them.

* Prettied up indentation in a few places

* removed spacing around *, standardizing it.

* I may have gotten overboard with indentation

* removed a few useless parenthesis

* Added fortran-raylib

* Fix examples/others/rlgl_standalone.c compilation issue (#3242)

* Update BINDINGS.md

* Ignore unused return value of GetCodepointNext in GetCodepointCount (#3241)

* Ignore unused return value of GetCodepointNext in GetCodepointCount

Removes the last warning from non-external libraries when compiling with
the default build configuration on x64 Linux.

* Remove unnecessary void cast in GetCodepointCount

* Fix #3246

* Revert "Fix #3246"

This reverts commit e4dcbd5180.

* Fix text_unicode.c example crashing (#3250)

* Fix text_unicode.c example crashing

* Adjust the text_unicode.c example crashing fix

* tweaks

* add build.zig options for individual modules (#3254)

* Add `IsKeyPressedRepeat` (desktop only) (#3245)

Since the key pressed are handle by comparing current vs previous
state (ie frame), a special way is needed to handle key repeats.

* Reviewed `IsKeyPressedRepeat()` #3248

* Update rcore.c (#3255)

* Match CMakeOptions.txt options default values (#3258)

* Fix SetClipboardText for web (#3257)

* [Image] Validate that ImageDrawRectangleRec is drawing entirely inside the image (#3264)

* Add a function to clone a sound and share data with another sound.

* rename items based on feedback

* PR Feedback, use custom unload for sound alias, not variant of normal sound unloading

* sound_multi example

* Validate that image rect drawing is inside the image so we don't overflow a buffer

* remove files that should not have been added.

* remove changes that should not have been

* revert

* adsfasdfsdfsdf

* Add Vector3 Projecting and Rejection to Raymath (#3263)

* Update raymath.h

* formatting

* [Feature] IsKey... safety checks and more (#3256)

* [Feature] Add GetKeyRepeat

* Update rcore.c

* Simpler design, only one repeat per frame

* Update config.h

* Update rcore.c

* Add KEYBOARD_KEYS_MASK

* Update config.h

* reversions

* Update rcore.c

* Update rcore.c

* change docs

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update raylib.h

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Fix bug where default shaders was not linking. (#3261)

* Formating review

* Add missing cmake options (#3267)

* Fix CMake extraneous -lglfw (#3266)

Closes #3265.

The problem: LIBS_PRIVATE is a list of library names (used by pkg-config), but the shared library of the same name doesn't always exist.

* Fix example/models/models_loading_gltf.c controls (#3268)

* Fix example/models/models_loading_m3d.c controls (#3269)

* Remove e from secondes (#3270)

* Fix example/audio/audio_module_player.c help instructions and small bug (#3272)

* Fix example/audio/audio_module_player.c help instructions and small bug

* Update example/audio/audio_module_player.png screenshot

* Use type name instead of valid specifier

long long --> long long int

* REVIEWED: `GetFileLength()`, added comment #3262

* Update examples/models/models_loading_gltf.png;m3d.png screenshots (#3273)

* Remove a duplicated screenshot and add missing one (#3275)

* Add examples/shaders/shaders_lightmap.c to Makefiles (#3276)

* Fix examples/others/easings_testbed.c help instructions and small tweak (#3277)

* Fix examples/shaders/shaders_texture_outline.c help instructions (#3278)

* Fix examples/shapes/shapes_collision_area.c help instructions (#3279)

* RENAMED: LoadFont*() parameter names for consistency and coherence

* Fix uninitialized thread-locals in stbi #3282 (#3283)

* REVIEWED: Added `SetTextLineSpacing()` to multiline examples

* REVIEWED: Data size type consistency between functions #3168

* Some tweaks

* Use internal default allocators, instead of user-exposed ones

* Added rudimentary SVG support. (#2738)

* Added rudimentary SVG support. Added 2 functions ImageLoadSvg and ImageLoadSvgWithSize.

* Added an example on how to use ImageLoadSvgWithSize and adjusted Makefiles accordingly.

* Added actual correct example file.

* Reviewed the code to keep the raylib coding conventions in mind.
Moved the LoadImageSvg() code into LoadImage() guarded by SUPPORT_FILEFORMAT_SVG.
Renamed LoadImageSvgWithSize() to LoadImageSvg().
Added a LoadImageSvgFromString() function to parse the loaded SVG into an actual image. This does the bulk of the work.

* Fixed typo.

---------

Co-authored-by: Ray <raysan5@gmail.com>

* REVIEWED: `LoadImageSvg()`

* REVIEWED: `LoadImageSvg()`

* Add SUPPORT_FILEFORMAT_SVG to cmake (#3284)

* Fix examples/textures/textures_fog_of_war.c help instructions (#3285)

* Fix examples/textures/textures_image_rotate.c help instructions (#3286)

* Update rtextures.c

* Fix #3247

* Update config.h

* Fix #3293

* Disable UBSAN in zig builds. (#3292)

Zig debug builds automatically enable ubsan.
As the fix for #1891 had to be reverted, debug builds using zig will crash like so:

```
Illegal instruction at address 0x3237d2
raylib/src/rlgl.h:3690:91: 0x3237d2 in rlDrawVertexArrayElements (/home/rcorre/src/raylib-zig-template/raylib/src/rcore.c)
    glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset);
```

This disables UBSAN when using zig to build raylib.

* Update README.md (#3290)

specially -> especially

* Update cmake SUPPORT_FILEFORMAT_SVG default value (#3291)

* Mouse offset and scaling must be considered also on web!

* Update rcore.c

* Update Makefile : clean raygui.c & physac.c (#3296)

* Remove PLATFORM_RPI (#3232)

* Remove PLATFORM_RPI

* remove build artifacts

---------

Co-authored-by: MichaelFiber <michael@cubeofb.org>
Co-authored-by: Ray <raysan5@gmail.com>

* Review to avoid UBSAN complaining #1891

* added raylib-raku to bindings (#3299)

* examples: core: adds 2D camera two player split screen (#3298)

* Reviewed examples for consistency

* Update rtext.c

* Some code restructuring for input functions, consistency review

* Remove unneeded #if (#3301)

Co-authored-by: MichaelFiber <michael@cubeofb.org>

* Revert "Disable UBSAN in zig builds. (#3292)" (#3303)

This reverts commit a316f9e7fc.

Issue #1891 was fixed again, so this is no longer needed.

* rtextures: Fix ImageDraw() source clipping when drawing beyond top left (#3306)

* REVIEWED: `TextToPascal()` issue when first char is uppercase

* Implement FLAG_WINDOW_RESIZABLE for web (#3305)

Fixes #3231

* Update BINDINGS.md (#3307)

Fix Kaylib binding. Reroute to a new repository.
Binding renamed.

* Update webassembly.yml

* Add claw-raylib to BINDINGS.md (#3310)

* Add SetWindowMaxSize for desktop and web (#3309)

* Add SetWindowMaxSize for desktop and web

* Remove SizeInt and respective adjustments

* Update rtextures.c

* Reviewed parameters for consistency

* Rename windowM* to screenM* (#3312)

* Update BINDINGS.md (#3317)

Update TurboRaylib bindings

* Update rmodels.c

* Update BINDINGS.md with vaiorabbit/raylib-bindings (#3318)

* fixed spelling mistake

* put back parenthesis

* reverted major allignment changes

* reverted parser output changes

* reverted one more indentation change

---------

Co-authored-by: Brian-E <brian@intra.fo>
Co-authored-by: Ray <raysan5@gmail.com>
Co-authored-by: ubkp <118854183+ubkp@users.noreply.github.com>
Co-authored-by: ashn <60763262+ashn-dot-dev@users.noreply.github.com>
Co-authored-by: actondev (Christos) <chris.actondev@gmail.com>
Co-authored-by: vitopigno <103512727+VitusVeit@users.noreply.github.com>
Co-authored-by: Asdqwe <asdqwe@asdqwe.com>
Co-authored-by: Jeffery Myers <jeffm2501@gmail.com>
Co-authored-by: Ethan Simpson <ethansimpson@xtra.co.nz>
Co-authored-by: Nickolas McDonald <43690021+n77y@users.noreply.github.com>
Co-authored-by: Branimir Ričko <rickobranimir@gmail.com>
Co-authored-by: iacore <74560659+iacore@users.noreply.github.com>
Co-authored-by: Ethan Conneely <Econn50@outlook.com>
Co-authored-by: Johannes Barthelmes <615914+jbarthelmes@users.noreply.github.com>
Co-authored-by: bXi <bluepunk@gmail.com>
Co-authored-by: Ryan Roden-Corrent <ryan@rcorre.net>
Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: SuperUserNameMan <yoann@terminajones.com>
Co-authored-by: MichaelFiber <42419558+michaelfiber@users.noreply.github.com>
Co-authored-by: MichaelFiber <michael@cubeofb.org>
Co-authored-by: Dan Vu <danvu.hustle@gmail.com>
Co-authored-by: Gabriel dos Santos Sanches <gabrielssanches@gmail.com>
Co-authored-by: Rob Loach <robloach@gmail.com>
Co-authored-by: Peter0x44 <peter0x44@disroot.org>
Co-authored-by: Kenta <106167071+Its-Kenta@users.noreply.github.com>
Co-authored-by: bohonghuang <1281299809@qq.com>
Co-authored-by: turborium <45082001+turborium@users.noreply.github.com>
Co-authored-by: Wilson Silva <wilson.dsigns@gmail.com>
2023-09-17 20:16:14 +02:00
Ray
33cc18ed51 Update BINDINGS.md 2023-09-17 13:32:44 +02:00
Wilson Silva
f9c6ca468a Update BINDINGS.md with vaiorabbit/raylib-bindings (#3318) 2023-09-16 19:56:38 +02:00
Ray
06986f36b3 Update rmodels.c 2023-09-15 17:04:07 +02:00
turborium
18b22523cc Update BINDINGS.md (#3317)
Update TurboRaylib bindings
2023-09-15 12:32:50 +02:00
ubkp
8a1779b2ad Rename windowM* to screenM* (#3312) 2023-09-14 11:57:23 +02:00
Ray
97ef81914c Reviewed parameters for consistency 2023-09-13 17:05:38 +02:00
Ray
528b879955 Update rtextures.c 2023-09-13 17:05:22 +02:00
ubkp
719365f209 Add SetWindowMaxSize for desktop and web (#3309)
* Add SetWindowMaxSize for desktop and web

* Remove SizeInt and respective adjustments
2023-09-13 16:37:11 +02:00
bohonghuang
2b1849e57d Add claw-raylib to BINDINGS.md (#3310) 2023-09-13 16:35:37 +02:00
Ray
2e7a7877a5 Update webassembly.yml 2023-09-12 15:11:16 +02:00
Kenta
3ab7f70e31 Update BINDINGS.md (#3307)
Fix Kaylib binding. Reroute to a new repository.
Binding renamed.
2023-09-11 23:19:43 +02:00
Peter0x44
9d230d753b Implement FLAG_WINDOW_RESIZABLE for web (#3305)
Fixes #3231
2023-09-11 19:03:33 +02:00
Ray
e75f85ce58 REVIEWED: TextToPascal() issue when first char is uppercase 2023-09-11 19:01:24 +02:00
Rob Loach
30f8dd6e37 rtextures: Fix ImageDraw() source clipping when drawing beyond top left (#3306) 2023-09-11 19:00:30 +02:00
Ryan Roden-Corrent
b8cd10264b Revert "Disable UBSAN in zig builds. (#3292)" (#3303)
This reverts commit a316f9e7fc.

Issue #1891 was fixed again, so this is no longer needed.
2023-09-09 17:32:28 +02:00
MichaelFiber
37f60e75e7 Remove unneeded #if (#3301)
Co-authored-by: MichaelFiber <michael@cubeofb.org>
2023-09-09 09:47:07 +02:00
Ray
b68d0850b1 Some code restructuring for input functions, consistency review 2023-09-08 20:01:52 +02:00
Ray
10e4aa32f8 Update rtext.c 2023-09-08 20:01:19 +02:00
Ray
1896268775 Reviewed examples for consistency 2023-09-08 13:27:13 +02:00
Gabriel dos Santos Sanches
2d5d0c2999 examples: core: adds 2D camera two player split screen (#3298) 2023-09-08 12:22:12 +02:00
Dan Vu
ecc80bbcea added raylib-raku to bindings (#3299) 2023-09-08 11:13:00 +02:00
Ray
30a9a24db9 Review to avoid UBSAN complaining #1891 2023-09-07 18:00:10 +02:00
MichaelFiber
18e9784c6d Remove PLATFORM_RPI (#3232)
* Remove PLATFORM_RPI

* remove build artifacts

---------

Co-authored-by: MichaelFiber <michael@cubeofb.org>
Co-authored-by: Ray <raysan5@gmail.com>
2023-09-07 17:42:28 +02:00
SuperUserNameMan
8cf76ec113 Update Makefile : clean raygui.c & physac.c (#3296) 2023-09-07 17:35:02 +02:00
Ray
b0c6972e5c Update rcore.c 2023-09-06 23:33:29 +02:00
Ray
d7debba222 Mouse offset and scaling must be considered also on web! 2023-09-06 23:16:31 +02:00
Ray
d55527953a Merge branch 'master' of https://github.com/raysan5/raylib 2023-09-05 20:04:30 +02:00
Ray
9cce5a93ff Fix #3293 2023-09-05 20:04:21 +02:00
Asdqwe
76fe16259d Update cmake SUPPORT_FILEFORMAT_SVG default value (#3291) 2023-09-05 11:03:59 +02:00
Ikko Eltociear Ashimine
97a8fe1e15 Update README.md (#3290)
specially -> especially
2023-09-05 11:03:32 +02:00
Ryan Roden-Corrent
a316f9e7fc Disable UBSAN in zig builds. (#3292)
Zig debug builds automatically enable ubsan.
As the fix for #1891 had to be reverted, debug builds using zig will crash like so:

```
Illegal instruction at address 0x3237d2
raylib/src/rlgl.h:3690:91: 0x3237d2 in rlDrawVertexArrayElements (/home/rcorre/src/raylib-zig-template/raylib/src/rcore.c)
    glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset);
```

This disables UBSAN when using zig to build raylib.
2023-09-05 11:02:25 +02:00
Ray
c104a97590 Update config.h 2023-09-04 18:51:44 +02:00
Ray
bdda1efd44 Fix #3247 2023-09-04 18:43:25 +02:00
Ray
8a82e17a79 Update rtextures.c 2023-09-04 18:43:03 +02:00
Asdqwe
c147ab51c9 Fix examples/textures/textures_image_rotate.c help instructions (#3286) 2023-09-03 11:03:00 +02:00
Asdqwe
a69d401433 Fix examples/textures/textures_fog_of_war.c help instructions (#3285) 2023-09-02 22:50:59 +02:00
Asdqwe
8bd6bb622c Add SUPPORT_FILEFORMAT_SVG to cmake (#3284) 2023-09-02 22:38:10 +02:00
Ray
67a693fc5b REVIEWED: LoadImageSvg() 2023-09-02 19:20:56 +02:00
Ray
d6f3891009 REVIEWED: LoadImageSvg() 2023-09-02 13:16:44 +02:00
bXi
c03ab03627 Added rudimentary SVG support. (#2738)
* Added rudimentary SVG support. Added 2 functions ImageLoadSvg and ImageLoadSvgWithSize.

* Added an example on how to use ImageLoadSvgWithSize and adjusted Makefiles accordingly.

* Added actual correct example file.

* Reviewed the code to keep the raylib coding conventions in mind.
Moved the LoadImageSvg() code into LoadImage() guarded by SUPPORT_FILEFORMAT_SVG.
Renamed LoadImageSvgWithSize() to LoadImageSvg().
Added a LoadImageSvgFromString() function to parse the loaded SVG into an actual image. This does the bulk of the work.

* Fixed typo.

---------

Co-authored-by: Ray <raysan5@gmail.com>
2023-09-02 13:00:18 +02:00
Ray
75e5cd86d7 Use internal default allocators, instead of user-exposed ones 2023-09-02 12:58:47 +02:00
Ray
6e18d96e7a Some tweaks 2023-09-02 12:54:36 +02:00
Ray
0f447f1fb6 REVIEWED: Data size type consistency between functions #3168 2023-09-02 12:05:34 +02:00
Ray
d41e3141f1 REVIEWED: Added SetTextLineSpacing() to multiline examples 2023-09-02 11:48:19 +02:00
Johannes Barthelmes
0f39051562 Fix uninitialized thread-locals in stbi #3282 (#3283) 2023-09-02 11:41:33 +02:00
Ray
ec6d3bb688 RENAMED: LoadFont*() parameter names for consistency and coherence 2023-09-01 23:23:01 +02:00
Asdqwe
927a030bbf Fix examples/shapes/shapes_collision_area.c help instructions (#3279) 2023-08-30 22:43:19 +02:00
Asdqwe
3d0d54e070 Fix examples/shaders/shaders_texture_outline.c help instructions (#3278) 2023-08-30 22:42:01 +02:00
Asdqwe
fefe8fcda9 Fix examples/others/easings_testbed.c help instructions and small tweak (#3277) 2023-08-30 22:40:49 +02:00
Asdqwe
46bac461ce Add examples/shaders/shaders_lightmap.c to Makefiles (#3276) 2023-08-30 22:40:24 +02:00
Asdqwe
1d2b43402e Remove a duplicated screenshot and add missing one (#3275) 2023-08-30 22:39:44 +02:00
Asdqwe
752baac00c Update examples/models/models_loading_gltf.png;m3d.png screenshots (#3273) 2023-08-29 19:28:03 +02:00
Ray
8157d4283e REVIEWED: GetFileLength(), added comment #3262 2023-08-29 19:26:15 +02:00
Ray
150663f78a Use type name instead of valid specifier
long long --> long long int
2023-08-29 19:25:44 +02:00
Asdqwe
d047597244 Fix example/audio/audio_module_player.c help instructions and small bug (#3272)
* Fix example/audio/audio_module_player.c help instructions and small bug

* Update example/audio/audio_module_player.png screenshot
2023-08-29 19:04:27 +02:00
Ethan Conneely
fc0d132566 Remove e from secondes (#3270) 2023-08-28 22:49:45 +02:00
Asdqwe
de3dc94d5b Fix example/models/models_loading_m3d.c controls (#3269) 2023-08-27 21:15:02 +02:00
Asdqwe
9393500bff Fix example/models/models_loading_gltf.c controls (#3268) 2023-08-27 21:14:20 +02:00
iacore
76adf883fd Fix CMake extraneous -lglfw (#3266)
Closes #3265.

The problem: LIBS_PRIVATE is a list of library names (used by pkg-config), but the shared library of the same name doesn't always exist.
2023-08-27 15:43:39 +02:00
Asdqwe
71a8d09a63 Add missing cmake options (#3267) 2023-08-27 15:42:45 +02:00
Ray
9646497216 Formating review 2023-08-27 00:30:56 +02:00
Branimir Ričko
b27e98a428 Fix bug where default shaders was not linking. (#3261) 2023-08-26 18:55:57 +02:00
Nickolas McDonald
9c9fba6a6c [Feature] IsKey... safety checks and more (#3256)
* [Feature] Add GetKeyRepeat

* Update rcore.c

* Simpler design, only one repeat per frame

* Update config.h

* Update rcore.c

* Add KEYBOARD_KEYS_MASK

* Update config.h

* reversions

* Update rcore.c

* Update rcore.c

* change docs

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update raylib.h

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c
2023-08-26 14:48:28 +02:00
Ethan Simpson
828d273698 Add Vector3 Projecting and Rejection to Raymath (#3263)
* Update raymath.h

* formatting
2023-08-26 14:44:52 +02:00
Jeffery Myers
21f5482e0d [Image] Validate that ImageDrawRectangleRec is drawing entirely inside the image (#3264)
* Add a function to clone a sound and share data with another sound.

* rename items based on feedback

* PR Feedback, use custom unload for sound alias, not variant of normal sound unloading

* sound_multi example

* Validate that image rect drawing is inside the image so we don't overflow a buffer

* remove files that should not have been added.

* remove changes that should not have been

* revert

* adsfasdfsdfsdf
2023-08-26 14:43:14 +02:00
ubkp
4fa66f2635 Fix SetClipboardText for web (#3257) 2023-08-26 14:40:30 +02:00
Asdqwe
8f228626a2 Match CMakeOptions.txt options default values (#3258) 2023-08-26 14:35:53 +02:00
vitopigno
5ed83dfa29 Update rcore.c (#3255) 2023-08-21 00:36:00 +02:00
Ray
dfd0436428 Reviewed IsKeyPressedRepeat() #3248 2023-08-21 00:34:35 +02:00
actondev (Christos)
b3f82a148a Add IsKeyPressedRepeat (desktop only) (#3245)
Since the key pressed are handle by comparing current vs previous
state (ie frame), a special way is needed to handle key repeats.
2023-08-20 23:53:20 +02:00
Ray
83628933f0 Merge branch 'master' of https://github.com/raysan5/raylib 2023-08-20 21:36:50 +02:00
Ray
8189bddefb tweaks 2023-08-20 21:36:36 +02:00
actondev (Christos)
820343e7ac add build.zig options for individual modules (#3254) 2023-08-20 21:27:39 +02:00
Ray
f95dc2d565 Merge branch 'master' of https://github.com/raysan5/raylib 2023-08-19 20:09:53 +02:00
Ray
5a33f19964 Revert "Fix #3246"
This reverts commit e4dcbd5180.
2023-08-19 20:09:43 +02:00
ubkp
016b7d0a3a Fix text_unicode.c example crashing (#3250)
* Fix text_unicode.c example crashing

* Adjust the text_unicode.c example crashing fix
2023-08-19 13:43:00 +02:00
Ray
e4dcbd5180 Fix #3246 2023-08-17 15:05:52 +02:00
ashn
a86c93ebc0 Ignore unused return value of GetCodepointNext in GetCodepointCount (#3241)
* Ignore unused return value of GetCodepointNext in GetCodepointCount

Removes the last warning from non-external libraries when compiling with
the default build configuration on x64 Linux.

* Remove unnecessary void cast in GetCodepointCount
2023-08-15 00:09:27 +02:00
Ray
e2d4463886 Update BINDINGS.md 2023-08-15 00:04:07 +02:00
ubkp
e0afb8942e Fix examples/others/rlgl_standalone.c compilation issue (#3242) 2023-08-14 21:55:13 +02:00
Ray
7a1c0d2547 Added fortran-raylib 2023-08-14 21:10:24 +02:00
Ray
bf705a63de REVIEWED: DrawLineCatmullRom() 2023-08-12 19:31:29 +02:00
Ray
d873d0f173 ISSUE: DrawLineCatmullRom(), needs review 2023-08-12 18:45:59 +02:00
Ray
9161c55d59 REVIEWED: Code formatting 2023-08-12 18:40:18 +02:00
Ray
fc88518067 ADDED: Spline drawing functions ->
- `DrawLineBSpline()`
 - `DrawLineCatmullRom()`
2023-08-12 14:00:50 +02:00
ubkp
c25b52b1b3 Fix rcamera.h issues (#3240) 2023-08-11 10:19:50 +02:00
Ray
93f59a6f59 Review tabs and trail-spaces 2023-08-10 22:47:17 +02:00
Ray
f1c31bee27 Fix #3177 #3109 2023-08-10 22:45:25 +02:00
RadsammyT
0959f6ebf6 fix typos in rmodels, rshapes, rtext modules (#3236) 2023-08-10 00:21:14 +02:00
ashn
90f1749965 Ignore unused function warnings from external headers when compiling with GCC and Clang (#3235) 2023-08-09 19:17:12 +02:00
Ray
42cfabc670 REVIEWED: Old pragma formating 2023-08-09 10:00:26 +02:00
RadsammyT
03ecf2202e Fix typos in rcore.c comments (#3234)
* Fix typos in rcore.c comments

thought i corrected "dettach"
Fix typos in rcore.c comments

* 'fordward' > forward
2023-08-08 20:10:40 +02:00
Nikolas
bef818e210 Fix build for OpenGL 2.1, where half floats are part of an extension (#3233) 2023-08-08 20:09:22 +02:00
mohad12211
db55bed72b fix: check if ctrl modifier is among the currently set modifiers (#3230) 2023-08-07 19:51:36 +02:00
Le Juez Victor
c9864d8ac1 Fixed Android app black screen issue when reopening after incomplete closing (#3227)
* Fixed black screen issue when resuming the app on Android

Partly explained here: https://github.com/raysan5/raylib/issues/3127

* Fix APP_CMD_TERM_WINDOW for Android
2023-08-06 22:04:20 +02:00
yujiri8
b82217eaaa Tweak build.zig to work with cross-compiling (#3225) 2023-08-06 09:25:37 +02:00
Nikolas
dc621ca388 Support 16-Bit HDR textures (#3220)
* Support 16-Bit HDR textures

* Fix build on emscripten

* Move helper functions
2023-08-05 23:16:26 +02:00
Ray
6094869e3e Fix material loading #3126 2023-08-04 18:14:47 +02:00
Jeffery Myers
62f5382d56 [AUDIO] Add an example of how to use LoadSoundAlias (#3223)
* Add a function to clone a sound and share data with another sound.

* rename items based on feedback

* PR Feedback, use custom unload for sound alias, not variant of normal sound unloading

* sound_multi example
2023-08-04 17:14:04 +02:00
Jeffery Myers
601cadbae6 [AUDIO] Add a function to make an alias of a sound and share it's sample data (#3219)
* Add a function to clone a sound and share data with another sound.

* rename items based on feedback

* PR Feedback, use custom unload for sound alias, not variant of normal sound unloading
2023-08-04 16:40:10 +02:00
vitopigno
d3058fe589 [CORE] Support for SetWindowTitle and InitWindow for web (#3222)
* Update raylib.h

Changed SetWindowTitle's description

* Update rcore.c

SetWindowTitle now works on web

* Update rcore.c

InitWindow title now works with web platform too.
2023-08-04 12:04:19 +02:00
ubkp
5b4aaf4eb1 Adds CMake option for SUPPORT_CUSTOM_FRAME_CONTROL (#3221) 2023-08-03 10:29:45 +02:00
ubkp
464e714a2e Adds BORDERLESS_WINDOWED_MODE for PLATFORM_DESKTOP (#3216) 2023-08-02 19:16:35 +02:00
Jeffery Myers
04678bc585 int math done with floats causes warnings. (#3218) 2023-08-02 19:12:38 +02:00
Joseph Montanez
b60c691816 Update BINDINGS.md (#3217)
Updated Raylib-PHP to support Raylib 4.5
2023-08-02 09:05:02 +02:00
Matheus C. França
e7664d5684 build change (#3214)
ref.: https://github.com/ziglang/zig/pull/16446
2023-08-01 10:46:40 +02:00
ubkp
4fd40f0333 Fixes GetCurrentMonitor() detection inconsistency issue (#3215) 2023-08-01 10:42:50 +02:00
Alexander Klingenbeck
d3ea649832 Update BINDINGS.md to include rayjs (#3212) 2023-07-30 19:08:59 +02:00
ndytts
44659b7ba8 Fix android soname in src/Makefile (#3211) 2023-07-29 13:46:04 +02:00
ubkp
962030e70a Changes SetWindowMonitor() to no longer force fullscreen (#3209)
* Changes SetWindowMonitor() to no longer force fullscreen

* Readds fullscreen support
2023-07-28 20:08:41 +02:00
Nikolas
5d28bad0ad Fix LoadTextureCubemap for manual layouts (#3204) 2023-07-27 22:41:43 +02:00
ashn
ac6f889dfc Fix misleading indentation in src/Makefile (#3202) 2023-07-26 17:50:07 +02:00
bohonghuang
298f93ef50 Fix DrawBillboardPro to allow source of negative size (#3197) (#3203) 2023-07-26 17:46:57 +02:00
Ray
32b54be5cb Update FAQ.md 2023-07-24 12:32:22 +02:00
ubkp
090b857912 Fix mouse wheel not working in PLATFORM_RPI or PLATFORM_DRM (#3193) 2023-07-23 20:35:41 +02:00
ubkp
295e8c2a2f Optimize and simplify the gesture system (#3190)
* Optimize and simplify the gesture system

* Decouples GESTURE_SWIPE_* from GESTURE_DRAG
2023-07-22 20:50:04 +02:00
Jakub Václav Flasar
ad2338b994 build.zig: Support for building with PLAFORM_DRM (#3191)
- Adds an option -Dplatform_drm when using zig build
- When building for linux, checks whether -Dplatform_drm is present and configures the build accordingly.
2023-07-21 14:08:35 +02:00
smalltimewizard
1310617a92 Optimization of ImageDrawRectangleRec() (#3185)
A significant performance increase can be had by copying the first row to all other rows.
2023-07-20 13:50:56 +02:00
Alberto González Palomo
5635e4214c Add note about sample format to AttachAudioStreamProcessor() (#3188) 2023-07-20 13:41:35 +02:00
Danil
055fd752c2 Fixed GetMonitorName description (#3184) (#3189) 2023-07-20 10:56:35 +02:00
Alberto González Palomo
7124a14a60 Document buffer format for audio processors. (#3186) 2023-07-19 23:11:29 +02:00
Rokas Puzonas
d6f16b7664 Update usage of 'sinf()' and 'cosf()' to be correct (#3181)
* Update usage of 'sinf()' and 'cosf()' to be correct

* Update formatting of arithmetic operations
2023-07-19 13:46:14 +02:00
ubkp
954c60100f Fix GESTURE_DRAG and GESTURE_SWIPE_* issues (mostly) for web (#3183) 2023-07-19 11:33:10 +02:00
Ray
a9ff13a367 Update CMakeOptions.txt 2023-07-18 18:07:49 +02:00
Ray
52541b4a1f ADDED: SUPPORT_FONT_ATLAS_WHITE_REC
Support creating a 3x3 pixels white rectangle at the bottom-right corner of the generated font atlas image, useful for shapes+text drawing in a single draw call!
2023-07-18 17:57:10 +02:00
Ray
e0c80f5ddd Revert "Makefile change for cross compiling. (#3176)"
This reverts commit 70286c7cdc.
2023-07-16 20:18:38 +02:00
Ray
86f95d7150 Reviewed C compilation issues and formatting 2023-07-16 13:24:49 +02:00
Michael Anghelone
70286c7cdc Makefile change for cross compiling. (#3176)
Working from wsl and compiling for windows this change makes it much easier to compile a static library for windows on arm.
To compile a static library for windows on arm:

```
make PLATFORM=PLATFORM_DESKTOP TARGET_OS=WINDOWS CROSS_CC=/llvm/bin/aarch64-w64-mingw32-gcc CROSS_AR=/llvm/bin/aarch64-w64-mingw32-ar
```

This does not work to compile a shared library yet, only static.
2023-07-16 13:08:55 +02:00
ubkp
b980268ba7 [example] Core Input Gestures for Web (#3172)
* [example] Core Input Gestures for Web

* Fix Doubletap for web

* Changes TAP_TIMEOUT and rgGetCurrentTime to seconds
2023-07-16 13:07:29 +02:00
Roy Qu
22895ba14f fix: cmake option "OPENGL_VERSION" doesn't work (#3170) 2023-07-13 21:20:06 +02:00
Ray
bc9c063254 Update external sdefl and sinfl 2023-07-12 15:49:38 +02:00
ubkp
8096f142ec Add a new task the issue template about checking the wiki (#3169) 2023-07-12 12:02:33 +02:00
Ray
290ec11e7c Merge branch 'master' of https://github.com/raysan5/raylib 2023-07-12 10:37:17 +02:00
Ray
7f21cf1dcf Revert "UPDATED: sdefl and sinfl compression libraries"
This reverts commit e190b7eee9.
2023-07-12 10:37:10 +02:00
Anand Swaroop
e8181a5ddf Update latest h-raylib version (#3166) 2023-07-11 15:21:49 +02:00
Ray
2061bfc5e8 Reviewed parameter names to avoid issues #3159 2023-07-10 19:29:10 +02:00
Ray
bc40012ca3 Added missing structure on standalone mode #3160 2023-07-10 19:15:55 +02:00
Ray
b807c590cb Merge branch 'master' of https://github.com/raysan5/raylib 2023-07-10 19:13:53 +02:00
Ray
0b9fae3c53 Reviewed rcamera/rgestures file-macros for consistency #3161 2023-07-10 19:13:44 +02:00
ubkp
4b6cbd2340 Fix Touch pointCount for web (#3163) 2023-07-10 18:58:56 +02:00
Evan Pratten
91e4eea52d Add raylib-ffi to bindings list (#3164) 2023-07-10 18:58:10 +02:00
o3o
334e96d470 update bindbd-raylib3 to raylib 4.5 (#3157) 2023-07-06 12:32:02 +02:00
Ray
685d47938b Reverted MeasureTextEx() change #3105 2023-07-06 12:31:01 +02:00
Ray
668b37e111 REVIEWED: GenImageFontAtlas(), make atlas size less conservative 2023-07-06 12:29:28 +02:00
Ray
4f9235f6eb Merge branch 'master' of https://github.com/raysan5/raylib 2023-07-05 18:36:59 +02:00
Ray
58bd10edb2 Update rtext.c 2023-07-05 18:36:54 +02:00
ubkp
13a26a0fa2 Fix degrees of swipe gestures for web (#3155) 2023-07-05 16:43:00 +02:00
Wytek01
3c4ce9c99b Update examples_template.c to raylib 4.5 (#3156) 2023-07-05 16:39:38 +02:00
Ray
225b4fb3e2 REVIEWED: Vector2Angle() 2023-07-04 16:58:43 +02:00
ubkp
dd2d64e058 Fix pinch gestures for web (#3153) 2023-07-04 11:08:58 +02:00
ubkp
ffe4d36e0a Fix swipe gestures for web (#3151) 2023-07-03 09:29:26 +02:00
Ray
fdc28fce80 Reviewed vector2angle example 2023-07-02 20:05:15 +02:00
Ray
e8af875756 Minor format tweak, another issue introduced... 2023-07-02 18:54:50 +02:00
Gisteron
64bb2fe3ec fix vector angle example mode 0 circle segment drawing (#3150) 2023-07-02 18:51:27 +02:00
Ray
d1ab031a27 ADDED: SetWindowFocused() #3142 2023-07-02 17:48:00 +02:00
Ray
5361d498c3 WARNING: REDESIGN: Vector2Angle()<-->Vector2LineAngle() #2887 2023-07-02 17:27:38 +02:00
Ray
4fc5e82e30 REVIEWED: TextToUpper(), TextToLower(), TextToPascal() 2023-07-02 11:10:42 +02:00
Ray
3e4e4b32fd WARNING: BREAKING: ADDED: SetTextLineSpacing() 2023-07-02 10:52:20 +02:00
Ray
48e2663d03 REVIEWED: Issue #3105 2023-07-02 10:51:39 +02:00
Ray
df90da0b37 Update rcore.c 2023-07-02 10:50:40 +02:00
Ray
e190b7eee9 UPDATED: sdefl and sinfl compression libraries 2023-06-30 09:47:16 +02:00
Ray
ceafbcf9d2 REVIEWED: SetShapesTexture(), allow reseting 2023-06-28 00:37:24 +02:00
Kenta
5834e970eb Update BINDINGS.md (#3138)
Change C3 to Zlib
Update Raylib-nelua's name as Raylib.nelua to reflect repo change.
Update Raylib.nelua licence to Zlib
2023-06-27 22:03:42 +02:00
Jeffery Myers
0c126af717 casting warnings in rtextures (#3134) 2023-06-24 23:38:09 +02:00
Ray
2d518bfbcd REVIEWED: ProcessMaterialsOBJ() #3125 2023-06-24 13:32:13 +02:00
Ray
77d025ebda Merge branch 'master' of https://github.com/raysan5/raylib 2023-06-24 13:27:07 +02:00
Ray
974460b072 REVIEWED: rlLoadShaderBuffer() #3104 2023-06-24 13:26:43 +02:00
Ian Rash
fa698fb05e Update BINDINGS.md for Crystal (#3132)
Just updated
2023-06-24 13:22:23 +02:00
Le Juez Victor
5e1a81555c Review android_main() in rcore.c (#3121) 2023-06-20 11:01:57 +02:00
Dante Catalfamo
3a90acf08e Add options to zig compile (#3115)
* Add options to zig compile options

Support for compiling with raygui, raymath, and physac.
Also outputs the required headers.

Raygui should be located `../raygui` relative to the repo root
Physac should be located `../physac` relative to the repo root

This behavior matches options in the Makefile

* Move Options struct

* Remove physac, explicit raymath, always copy rlgl.h and raymath.h

* Remove unused options from build.zig

* Add srcdir as include path for raygui.h
2023-06-18 11:48:50 +02:00
Ray
830e328df0 Remove trailing spaces 2023-06-17 16:48:18 +02:00
lesleyrs
2209e5b0ca fix window flags order (#3114) 2023-06-16 18:08:10 +02:00
Ray
a0a18384cb Fix typo 2023-06-16 16:34:47 +02:00
iacore
7392c4b0c5 Better examples/core_input_gamepad (#3110)
* examples/core_input_gamepad: Add visuals for LT,RT

* examples/core_input_gamepad: arrows left/right to choose gamepad

* Style change
2023-06-14 20:46:10 +02:00
Chema Guerra
f385d0ce1c Continuation of support for ES3/WebGL2 (#3107)
* Continuation of support for ES3/WebGL2

* GetTouchPointState()

* Amends to the WebGL2 PR

---------

Co-authored-by: root <root@DESKTOP-GLOV9QV>
Co-authored-by: chemguerra <online@chemaguerra.com>
2023-06-12 08:18:31 +02:00
Charles
2e00d16f3d GLTF: fix segfault in animNormals memcpy when mesh.normals == NULL (#3103) 2023-06-10 22:15:24 +02:00
Ray
6aada7d5ec Updated examples to raygui 4.0-dev 2023-06-09 18:07:25 +02:00
Le Juez Victor
753c0b3853 Addition of support for vox files in version 200. (#3097) 2023-06-05 01:13:08 +02:00
Ray
f8b352f6d9 ADDED: ExportImageToMemory()
Only PNG supported for now
2023-06-03 19:51:16 +02:00
Ray
ba802fdd5e tweaks 2023-06-03 19:50:46 +02:00
Pixel Phobic
b1b6ae3905 Full Movement Added to Right Analog Stick (#3095)
I Added Analog Stick Support to the rcamera module, However this code only allowed for 4 Directions of Movement, This Changed adds the full range of Movement to the Right Analog Stick.
2023-06-02 10:29:45 +02:00
Peter0x44
2dec56e7b7 Add error if raylib.h is included in a C++98 program (#3093)
The color macros don't work properly in C++98, because they require
aggregate initialzation, which is a C++11 feature. So, explicitly state
how to fix this issue, instead of letting the compiler give a more vague
error message like:

main.cpp:8:23: error: expected '(' for function-style cast or type construction
      ClearBackground(BLACK);
                      ^~~~~
/opt/homebrew/Cellar/raylib/4.5.0/include/raylib.h:179:35: note: expanded from macro 'BLACK'
 #define BLACK      CLITERAL(Color){ 0, 0, 0, 255 }         // Black

NOTE: Don't use this check with MSVC because by default, it reports
199711L  regardless of any C++ version passed on command line
Only passing `/Zc:__cplusplus` will make MSVC set this correctly

see: https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
2023-06-01 09:47:52 +02:00
Ray
e497603678 ADDED: Experimental support for OpenGL ES 3.0 -WIP-
Just added the required flags to request the OpenGL ES 3.0 context but it has not been tested...
2023-05-31 18:36:33 +02:00
A Billy
a18667c2e9 cross compilation for PLATFORM_DRM (#3091)
* added cross compilation options for DRM

* fixed identation
2023-05-30 21:34:08 +02:00
yujiri8
45c00ab9d4 build.zig: Fix cross-compiling from Linux (#3090) 2023-05-30 21:33:01 +02:00
Ray
924bb7226b UPDATED: sdefl and sinfl DEFLATE compression libraries 2023-05-30 21:12:03 +02:00
RayIT
15cbf313bb Enhanced cmake part for OpenBSD (#3086)
* Fixed compile on OpenBSD

* Changed to not use seperate UNIX for cmake
2023-05-28 14:49:33 +02:00
RayIT
4a371a5197 Fixed compile on OpenBSD (#3085) 2023-05-28 11:33:14 +02:00
Nikita K
aad51d4704 BINDINGS.md: Janet bindings supported version update (#3083) 2023-05-27 13:11:33 +02:00
Jason Liang
20860e2ba0 Fix a link in the FAQ (#3082) 2023-05-27 09:27:44 +02:00
Ray
5ef50ae139 REVIEWED: ImageRotate() formatting 2023-05-26 14:01:19 +02:00
LuraMoth
144ae120ab Add new file formats to FAQ (#3079)
I noticed some file formats from the new release of raylib were missing so I decided to help out and update it!
2023-05-25 09:15:53 +02:00
Dane Madsen
e465ed0850 Added ImageRotate (#3078)
* Added ImageRotate

* Quick rename of the example

* Update ImageRotate by changing doubles to floats and checking code convention

* Update API
2023-05-24 09:22:51 +02:00
Ray
bf69b38056 Added security check to file reading (memory allocations) 2023-05-22 16:08:14 +02:00
Ray
2937f2010c Review coding conventions 2023-05-22 16:06:03 +02:00
Dane Madsen
a4a6d4da8a Add GenImageGradientSquare (#3077)
* Add GenImageGradientSquare to allow square gradients

* Fix GenImageGradientSquare and add to textures_image_generation example

* Remove params from GenImageGradientSquare
2023-05-22 15:20:28 +02:00
Ray
84ae26cdc0 Update raylib.h 2023-05-21 11:35:25 +02:00
Dane Madsen
e96dc46d38 Replaced GenImageGradientH and GenImageGradientV with GenImageLinearGradient (#3074)
* Replaced GenImageGradientH and GenImageGradientV with GenImageLinearGradient

* renamed GenImageLinearGradient to GenImageGradientLinear
2023-05-21 11:33:47 +02:00
Ray
1b4634702c Minor tweak 2023-05-21 11:20:42 +02:00
Ray
3a841ac130 REVIEWED: GenImagePerlinNoise(), clamp values #3071 2023-05-21 10:28:04 +02:00
Ray
f31df7521a REVIEWED: GenImagePerlinNoise(), no change 2023-05-21 00:14:09 +02:00
Ray
51387dfbfb tweak 2023-05-18 16:14:18 +02:00
Ray
a3e78c5453 Update README.md 2023-05-18 12:00:51 +02:00
Ray
fe6973a4f6 Update README.md 2023-05-18 11:59:35 +02:00
Ray
76e39e502c Update rtextures.c 2023-05-17 23:14:14 +02:00
Ray
3a3e672804 UPDATE: miniaudio v0.11.12 --> v0.11.16 2023-05-17 11:54:32 +02:00
Ray
c3f049fd74 review formatting 2023-05-16 11:02:00 +02:00
Le Juez Victor
675efbda3b Fix Android app freeze after calling CloseWindow() (#3067)
Fixed that the Android application was not closed properly after calling `CloseWindow()` and continued to run.
2023-05-16 11:00:44 +02:00
Ray
e17cf9ecd7 REVIEWED: Formating 2023-05-15 11:30:31 +02:00
Pixel Phobic
3f8ef4e05f Updated (rcamera) To Add Analog Stick Cam Controls (#3066)
I Noticed While Writing Some code for My Game im Making that there Isn't an Easy way to control the Camera With The Analog Sticks on Controller.

I Added  a Couple Lines to the UpdateCamera Function :)
2023-05-15 11:25:44 +02:00
Crynux
3438325e7d Update rmodels.c; free fileData for LoadModelAnimationsGLTF (#3065)
fileData wasn't freed for LoadModelAnimationsGLTF causing a memory leak. Added UnloadFileData line, freeing it.
2023-05-15 11:24:37 +02:00
Gamer-Kold
6b92d71ea1 Reverted commits that deprecated the build.zig files, and added a note to all of them stating version of zig they were using (#3060)
* Revert "Fixed broken build.zig files. Now works with latest stable compiler (as of commit, latest is 0.10.1) (#3045)"

This reverts commit de748dfffe so that zig
build script works with master branch of zig.

* Added a note to build.zig files that denotes what version of zig they have been tested with.

* Standardised the note in the build.zig files
2023-05-15 11:23:36 +02:00
hamyy
26a3536958 GetCurrentMonitor() bugfix (#3058)
* GetCurrentMonitor() bugfix

* GetCurrentMonitor() bugfix
2023-05-14 21:20:43 +02:00
lesleyrs
818312683e update cmake example project (#3062)
* update cmake example project

* off is the correct one
2023-05-14 21:15:32 +02:00
Michael Scherbakow
cc17a7656c Update build.zig be be able to build with current zig master (#3064) 2023-05-14 21:14:16 +02:00
JupiterRider
5978358e58 Update BINDINGS.md (#3053) 2023-05-11 19:48:53 +02:00
Ray
452e3b494c REVIEWED: GetCollisionRec() 2023-05-10 19:25:12 +02:00
manuel5975p
af4b97a301 Update GetCollisionRec (#3052)
* Update rshapes.c

Add a much more efficient GetCollisionRec implementation

* Update GetCollisionRec

Replace macros with ternary operators
2023-05-10 19:19:59 +02:00
Ray
152262dbfc Update cgltf.h 2023-05-10 12:48:17 +02:00
Ray
fe595d60f7 Remove trailing spaces 2023-05-08 18:57:36 +02:00
Kenta
81e2c97095 Update BINDINGS.md (#3050)
Update C3 binding to use Raylib version 4.5
2023-05-08 16:00:21 +02:00
Shoozza
204c6765bd Fix vs code project (#3048)
* Modify remove trailing whitespace

* Fix invalid SetCameraMode call and missing argument to UpdateCamera for VSCode project
2023-05-07 20:22:37 +02:00
Scott Helvick
05e71f990c Version bump for CL bindings (#3049) 2023-05-07 20:21:47 +02:00
Alfred Reinold Baudisch
53b7b26c45 Added ModelAnimation.name, initially with GLTF animation names loaded (#3044) 2023-05-07 10:33:14 +02:00
Gamer-Kold
de748dfffe Fixed broken build.zig files. Now works with latest stable compiler (as of commit, latest is 0.10.1) (#3045)
Co-authored-by: Talha Qamar <qamartalha@proton.me>
2023-05-06 12:04:40 +02:00
Ray
5573f0f1c7 REVIEWED: Ligthmap example 2023-05-04 20:35:20 +02:00
Jussi Viitala
abcbd9817e Lightmap example. (#3043) 2023-05-04 20:21:35 +02:00
Ray
a48bb6e1ed ADDED: Comment to clarify raymath semantics 2023-05-02 20:51:54 +02:00
Ray
fc56940055 REVIEWED: ExportDataAsCode() 2023-05-02 20:40:45 +02:00
Ray
3a21301724 ADDED: Comment about Matrix conventions 2023-05-02 19:29:14 +02:00
Ray
7d68aa6869 REVIEWED: Modules description layout 2023-05-01 14:04:22 +02:00
Ray
a4a5a798bd Update rlgl_compute_shader.c 2023-05-01 14:03:32 +02:00
star-tek-mb
ed2caa1277 fix for latest zig master (#3037) 2023-05-01 11:02:34 +02:00
Ray
59596e4266 Update rcore.c 2023-04-29 20:39:36 +02:00
Thiago P
66f0de2807 WingBGI now leads to the correct website! (#3033)
The old link led to an unregistered site (http://www.codecutter.net/tools/winbgim/). The actual domain has changed to (https://winbgim.codecutter.org/). 
I checked the wayback machine, it's the same site, take a look: https://web.archive.org/web/20190421035959/http://www.codecutter.net/tools/winbgim/.
2023-04-29 20:34:14 +02:00
Le Juez Victor
662dfad670 Correction of values ​​used only once in GenMeshCubicmap (#3032)
* Correction of values ​​used only once in GenMeshCubicmap

The mapWidth and mapHeight values ​​were only used as a limit in the for loop when they could be used throughout the function.

* mapWidth and mapHeight removed from GenMeshCubicmap

mapWidth and mapHeight have been removed from GenMeshCubicmap in favor of using cubicmap.width and cubicmap.height
2023-04-29 17:03:19 +02:00
kolunmi
98cb7a19a1 ensure distance is greater than 0 in CameraMoveToTarget (#3031) 2023-04-27 22:17:57 +02:00
Ray
e2996f167e Update rtextures.c 2023-04-25 20:01:26 +02:00
Ray
64f2f86d32 Update rtextures.c 2023-04-25 15:15:57 +02:00
Ray
6472928cf1 REVIEWED: ImageDrawRectangleRec() #3027 2023-04-25 14:16:48 +02:00
Ray
ac2e9cd00f REVIEWED: Update CORE.Input.Touch.pointCount #3024 2023-04-23 11:48:01 +02:00
Chris
b9b045cdd8 Update BINDINGS.md (#3026) 2023-04-23 11:41:34 +02:00
Ray
838fc7e303 REVIEWED: Some old TODOs 2023-04-22 21:17:53 +02:00
Dor Shapira
05af08080e Update BINDINGS.md (#3023)
update raypyc version to 4.6-dev
2023-04-22 19:38:56 +02:00
Dan Bechard
2d04dd8b88 Fix off-by-one error in CheckCollisionPointRec (#3022)
Checking `<= x + w` causes off-by-one error where `CheckCollisionPointRec` will return true at the same time for two rectangles rendered right next to each, but which don't overlap (e.g. when making a 2D tile editor). This is clearly not what was intended.
2023-04-22 10:15:19 +02:00
Mingjie Shen
7b7c0c83ef Fix offset used before range check (#3021)
This use of offset 'i' should follow the range check.
2023-04-22 10:13:11 +02:00
Soutaisei
535680668b Update BINDINGS.md (#3017)
Update Kaylib to Raylib version 4.5
2023-04-19 21:25:25 +02:00
Ray
771957458d Avoid shader attribute not found log 2023-04-17 17:50:46 +02:00
Ray
9d38363e09 Remove trailing spaces 2023-04-17 12:18:06 +02:00
RadsammyT
e2da32e2da [raudio] Rewritten ExportWaveAsCode() file saving to be more like rtextures ExportImageAsCode() (#3013)
* Update raudio.c

Review `raudio.c`: rewritten `ExportWaveAsCode()` to be more like rtextures.c `ExportImageAsCode()'

* no tab november

accidentally inserted a tab somewhere. corrected it.
2023-04-15 10:58:00 +02:00
Benjamin Thomas
70d7f67bd8 CMake project example: fix a couple of typos (#3014) 2023-04-15 10:55:40 +02:00
Ray
709b14180a Make assets loading extension case insensitive #3008 2023-04-13 23:08:32 +02:00
Ray
9aa71f04f2 Avoid tracelog about not found uniforms #3003 2023-04-10 11:02:00 +02:00
eternalStudent
8f741d894a Minor fix in DrawLineBezier* (#3006)
When `i` starts with `0`, `t` is also `0`, which results in `previous == startPos == current`, this segment is not only redundant, but it also causes division-by-zero since `sqrtf(dx*dx + dy*dy)` is zero.
2023-04-09 22:43:06 +02:00
Jeffery Myers
e57ee9c0e8 Fix warnings in raylib for MSVC (#3004) 2023-04-09 22:42:15 +02:00
fubark
06c17ab7f1 Update BINDINGS.md (#3002) 2023-04-08 19:05:41 +02:00
Ray
d8c7b01a3c REVIEWED: GetGlyphIndex() #3000 2023-04-06 12:49:59 +02:00
chocolate42
8367abad1a [rtext] Fix GetCodepointNext() to return default value on invalid input with size=0 (#2997)
* Fix GetCodepointNext to return default value with size=0 on invalid input. Modify LoadCodepoints to work when GetCodepointNext returns a size of 0. All internal use of GetCodepointNext and GetCodepointPrev checked. This fix may break external code dealing with invalid input as the old code erroneously never returned a size of 0, external code that doesn't properly check for size=0 may endlessly loop or overflow a buffer on invalid input.

* Change default behaviour of GetCodepointNext to return a size of 1 instead of 0. This matches existing prod behaviour and guarantees size 1..4 is returned. Simplify internal code that uses GetCodepointNext that previously had to account for size=0.

* Simplified progressing through a UTF-8 string in ImageTextEx and MeasureTextEx. This change matches existing precedent in DrawTextEx

* GetCodepointNext: Add 10xxxxxx checks to multibyte encodings.

---------

Co-authored-by: anon <anon>
2023-04-06 12:34:37 +02:00
Jorge A. Gomes
17c443ee6d Update BINDINGS.md (raylib-py -> 4.5) (#2992)
Co-authored-by: Ray <raysan5@gmail.com>
2023-03-29 13:52:33 +02:00
Astie Teddy
1a110dcbd7 Update BINDINGS.md (raylib-lua -> 4.5) (#2989) 2023-03-25 23:26:38 +01:00
Ray
02bd709043 Update BINDINGS.md 2023-03-25 10:38:21 +01:00
Steven Schveighoffer
1fc8f1bdbf Update raylib-d binding version to 4.5 (#2988) 2023-03-25 10:32:46 +01:00
WIITD
57082d6600 update raylib-freebasic to 4.5 (#2986) 2023-03-23 22:26:55 +01:00
Ray
6287f68c0b Lazy loading of default font for image loading (no InitWindow) 2023-03-22 20:11:36 +01:00
Ray
0925851f89 Update rl_gputex.h 2023-03-22 20:11:03 +01:00
Ray
770e239f73 Minor tweaks to raylib events automation system 2023-03-22 19:47:42 +01:00
Ray
0d4db7ad7f Update CMakeLists.txt 2023-03-22 12:43:18 +01:00
Ray
19892a3c3a Update resource arch for 64bit #2978 2023-03-22 11:15:00 +01:00
Ray
ecb6a6af32 Review format 2023-03-22 11:08:46 +01:00
Rico P
8b8eddc8e2 slightly optimize Vector3Normalize (#2982) 2023-03-22 11:01:05 +01:00
Hanaxar
e55bdd5d8a Fix packing logic error in ``GenImageFontAtlas`` (#2979)
Basic packing algorithm currently follows this order: Copy pixel data -> Move offsetX for current glyph -> Check remaining space for current glyph...
Since X offset already moved according current glyph, remaining space should be checked for next glyph. Because of this, occasionally, current logic causes glyphs wrapping around texture.
Proposed fix accomplishes that by moving offsetX check to the beginning of the loop.
2023-03-22 11:00:13 +01:00
Hanaxar
02a8a49961 Calculate exact image size in GenImageFontAtlas (#2963)
* Calculate exact image size in GenImageFontAtlas

Calculate exact image size with a method based on total glyph width and glyph row count
Current method seemed a little bit overkill with square root, log and power functions and only approximates image size which can be wonky with some weird fonts like cursive fonts.
Proposed method calculates image size directly with a simpler method and results exact image size needed.

* Update rtext.c

* Update rtext.c

Changed do-while to while loop, and also added an extra step to calculate maximum glyph width and excluding it from image width for extra safety.
2023-03-22 10:59:28 +01:00
Jarrod Davis
7565e274b1 Update BINDINGS.md (#2983)
Adding raylib for Pascal
2023-03-22 08:55:58 +01:00
gingerBill
d61303b1b0 Update BINDINGS.md for raylib Odin 4.5 (#2981) 2023-03-21 22:46:20 +01:00
Gunko Vadim
04229c5854 Update BINDINGS.md (#2980)
update ray4laz to raylib 4.5
2023-03-21 20:03:38 +01:00
Ray
a139ba9c48 Update README.md 2023-03-21 12:04:03 +01:00
Mansour Quddus
4f43ceb0d2 add missing space in one of the cameraDescriptions (#2977) 2023-03-21 08:31:29 +01:00
Ray
9f7a49bec3 Updated version to avoid confusion with 4.5 release 2023-03-20 18:03:37 +01:00
Ikko Eltociear Ashimine
ace7aef0e6 Fix typo in rmodels.c (#2976)
Upate -> Update
2023-03-20 16:43:22 +01:00
Rob Loach
e450c75f6f BINDINGS: Update various versions to 4.5 (#2974) 2023-03-20 16:41:16 +01:00
Webfra
08670ecea1 Add const qualifier to char * path argument in qoaplay_open() (#2972)
* Add const qualifier to char * path argument
in qoa_open()

* Remove unnecessary cast
2023-03-19 20:34:22 +01:00
Michael Scherbakow
03e19c7f43 Update raylib.zig version to 4.5 (#2971) 2023-03-19 18:27:21 +01:00
Anand Swaroop
3c02f0c75b Update h-raylib version (#2970) 2023-03-19 15:38:30 +01:00
Ray
2e02474b7a Update core_loading_thread.c 2023-03-19 11:25:29 +01:00
Rob Loach
c14c7f0b69 raudio: Fix warning on discarded const qualifier (#2967)
The `qoaplay_open()` function expects a `char *`, but we are passing in a `const char *`. While this works just fine, it does issue a compiler warning when strict:

```
src/raudio.c: In function ‘LoadMusicStream’:
src/raudio.c:1290:45: warning: passing argument 1 of ‘qoaplay_open’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1290 |         qoaplay_desc *ctxQoa = qoaplay_open(fileName);
      |                                             ^~~~~~~~
In file included from src/raudio.c:233:
src/external/qoaplay.c:86:34: note: expected ‘char *’ but argument is of type ‘const char *’
   86 | qoaplay_desc *qoaplay_open(char *path)
      |                            ~~~~~~^~~~
```

This change casts the argument to a `char *` to fix the warning.
2023-03-19 11:16:52 +01:00
Niels Martignène
76b5959bb5 Fix missing symbol when rglfw.c on BSD platforms (#2968) 2023-03-19 09:43:51 +01:00
ashn
fec96137e8 Update Makefile comment to indicate arm64 as a supported Linux desktop platform (#2965) 2023-03-18 17:37:04 +01:00
Ray
18a36b3e06 Update raylib.sln 2023-03-18 17:35:14 +01:00
Ray
40d01162b9 Merge branch 'master' of https://github.com/raysan5/raylib 2023-03-17 00:05:51 +01:00
Ray
e8a5d7b85c Update CHANGELOG 2023-03-17 00:05:40 +01:00
Brian E
e06047419c Added my BQN Library to the list (#2962)
I'm the only maintainer and have been working hard recently to get my library to be as nice to use as possible. I found out about this language list, and getting a new language on it didn't seem so bad. A bonus for my efforts.
2023-03-16 22:45:42 +01:00
Ray
03516b1c68 Update npes_saved_w64devkit.txt 2023-03-15 19:09:30 +01:00
Ray
7ab24b94ee Delete c_raylib.xml 2023-03-15 19:09:27 +01:00
Ray
bf3e527dab Update config.h 2023-03-15 17:51:23 +01:00
Ray
b31c836456 Update CHANGELOG 2023-03-15 17:51:03 +01:00
ashn
1aacefd6fa Add raylib-sunder to BINDINGS.md (#2958) 2023-03-15 14:56:24 +01:00
Ray
3b4f9faebc UPDATED: Notepad++ instellisense data 2023-03-15 13:17:14 +01:00
Ray
159e6b6f24 UPDATED: raylib-parser output files (TXT, XML, JSON, LUA) 2023-03-15 13:13:48 +01:00
Ray
ad2067340f REVIEWED: TraceLog(), avoid possible buffer overflow 2023-03-15 13:03:55 +01:00
veins1
cf04425bc2 Spelling (#2957) 2023-03-14 19:23:17 +01:00
Ray
796d96408b Update HISTORY.md 2023-03-14 14:06:37 +01:00
Ray
54ccb18e87 Update write_depth.fs 2023-03-14 13:39:33 +01:00
Ray
3d64598e11 Update Makefile 2023-03-14 13:14:19 +01:00
Ray
7ac2b4a226 Update HISTORY.md 2023-03-14 13:07:24 +01:00
Ray
2b9ef7d15c Update ROADMAP.md 2023-03-14 13:06:22 +01:00
Ray
975c70d2b7 Update rlgl.h 2023-03-14 13:06:17 +01:00
Ray
a6300d828a Update CHANGELOG 2023-03-14 13:05:58 +01:00
Ray
1a361fdfe2 Update Makefile.Web 2023-03-13 23:24:30 +01:00
Ray
5a2c49b954 Updated Makefiles to include all missing new examples 2023-03-13 23:13:02 +01:00
Ray
90ec0d52e0 Reviewed filename 2023-03-13 23:12:23 +01:00
Ray
a7f81b06b9 Remove trailing spaces 2023-03-13 12:08:23 +01:00
Ray
393b0d1a80 Delete rcamera.old.h 2023-03-13 12:06:54 +01:00
Ray
9a115106b4 Update miniaudio.h 2023-03-13 11:48:34 +01:00
Ray
a3b7bd0891 Update webassembly.yml 2023-03-13 11:44:49 +01:00
Ray
dad0e64aa8 Update HISTORY.md 2023-03-13 11:44:02 +01:00
Ray
90e36d1883 Update ROADMAP.md 2023-03-13 10:54:06 +01:00
Ray
8873aca268 Update CHANGELOG 2023-03-12 21:09:50 +01:00
Ray
ce28dfbdeb Update CHANGELOG 2023-03-12 21:03:21 +01:00
Ray
e4bc2c643e Update README.md 2023-03-12 20:52:24 +01:00
Ray
54f01e151c Update CHANGELOG 2023-03-12 20:50:19 +01:00
Ray
11e9a0d41c Update CHANGELOG 2023-03-12 20:48:49 +01:00
Ray
4f38830058 Some tweaks 2023-03-12 20:14:32 +01:00
Ray
520ea94de8 Update version to raylib 4.5 2023-03-12 19:52:24 +01:00
Ray
8ca3212701 REVIEWED: UpdateCameraPro() to use Vector3 2023-03-12 19:40:43 +01:00
Ray
f9c4cc2040 ADDED: UpdateCameraPro() -Experimental-
REVIEWED: rcamera module formating
REVIEWED: `core_3d_camera_example`
2023-03-12 19:28:42 +01:00
Ray
b436c8d7e5 ADDED: Security check for emscripten_run_script() #2954 2023-03-12 13:48:11 +01:00
Ray
ee3e40c663 Update rcore.c 2023-03-12 13:47:02 +01:00
Ray
4fd1e04e70 Update CHANGELOG 2023-03-07 21:03:44 +01:00
Ray
4f7b5ff59f WARNING: REMOVED: UnloadModelKeepMeshes() 2023-03-07 20:40:45 +01:00
Ray
ab1e246367 REVIEWED: Data types validation 2023-03-07 20:33:45 +01:00
Ray
15716e59dc Update CHANGELOG 2023-03-07 20:07:54 +01:00
Ray
aa3c7f4614 Merge branch 'master' of https://github.com/raysan5/raylib 2023-03-07 19:55:02 +01:00
Ray
ae53600d31 WARNING: REMOVED: Multichannel audio support API 2023-03-07 19:54:53 +01:00
Ray
57f0015a08 Update CHANGELOG 2023-03-07 19:51:17 +01:00
Ray
1b873b028f WARNING: REMOVED: Multichannel audio support API
It was quite restrictive and hacky implementation, just load multiple types same sound to play multiple instances.
2023-03-07 19:48:47 +01:00
Ray
3a332d241c Update CHANGELOG 2023-03-07 11:32:37 +01:00
Sid K
0b18882a94 fix(build): Fix DLL build on Windows (#2951)
Changes the DLL export condition to apply to platform WIN32 instead of
compiler MSVC
2023-03-06 21:10:18 +01:00
Ray
8f7e2cd179 Replace TABS by 4 spaces 2023-03-06 15:05:57 +01:00
Ray
614e0518a7 Remove trailing spaces 2023-03-06 14:58:58 +01:00
Ray
cf1ebada0e Tweak WindowDropCallback() #2943 2023-03-06 13:15:13 +01:00
Ray
aae7ab64c7 Update raudio.c 2023-03-06 13:00:30 +01:00
Ray
68ee0bb8dd ADDED: QOA music streaming (with auxiliar lib)
Some format tweaks
2023-03-06 12:33:49 +01:00
Ray
d3f5bc4043 REVIEWED: GetWindowHandle() #2950 2023-03-05 20:06:45 +01:00
Ray
f4f6e25340 Support QOA audio file format by default 2023-03-05 14:07:02 +01:00
Ray
9614d3353b REVIEWED: QOA audio file export 2023-03-05 13:49:18 +01:00
Ray
ab14ad5d75 Close issue #2949 2023-03-05 11:26:37 +01:00
Ray
0eeb499288 Update qoa.h 2023-03-05 11:17:47 +01:00
Ray
5492f52adc Change default threading model for COM objects
It shouldn't matter much but it could avoid some conflicts with other libraries in the future (like `tinyfiledialogs`).
2023-03-05 00:09:56 +01:00
Ray
1611cd54e7 REVIEWED: GetWindowHandle() #2938 2023-03-04 18:56:04 +01:00
Ray
6897b43599 REVIEWED: core_drop_files #2943 2023-03-03 20:13:35 +01:00
Antonis Geralis
394b31faff Add GL_MIN GL_MAX blending equations (#2945) 2023-02-26 12:01:42 +01:00
Ray
73c9f72c52 Update rtextures.c 2023-02-25 22:32:50 +01:00
Ray
7fd2bf1a32 Minimal tweak 2023-02-25 01:07:52 +01:00
Ray
215eb967e8 Update rcore.c 2023-02-24 18:31:16 +01:00
Ray
cb2ba3675c REVIEWED: rlUnloadFramebuffer() #2937 2023-02-24 16:19:25 +01:00
Ray
ca98a84d68 Update rtext.c 2023-02-24 15:27:25 +01:00
fubark
110eab56a7 Add Cyber to BINDINGS.md (#2939) 2023-02-24 00:48:28 +01:00
Ray
d5a31168ce REVIEWED: Data validation 2023-02-23 18:08:15 +01:00
Ray
d652b95fbf ADDED: Security checks 2023-02-22 17:28:25 +01:00
Ray
153470d605 REVIEWED: GenMeshTangents(), avoid crash on missing texcoords data #2927 2023-02-21 23:55:55 +01:00
Ray
b4d824d6fc REVIEWED: GetMonitorWidth() and GetMonitorHeight() #2934 2023-02-21 23:10:03 +01:00
Ray
8169d0eab2 REVIEWED: IsWindowFocused() to consider Android App state #2935 2023-02-21 23:01:23 +01:00
Ray
b2926b2d28 Update rtextures.c 2023-02-21 13:20:52 +01:00
Ray
3cade2a1a0 REVIEWED: IsImageReady() and IsTexureReady()
Reordered some functions to avoid config.h issues when disabling some features.
2023-02-21 13:20:04 +01:00
Ray
bcae065c88 REVIEWED: IsShaderReady() 2023-02-21 13:15:11 +01:00
Ray
1347a15539 ADDED: SetWindowIcons() to set multiple icon image sizes 2023-02-21 13:14:51 +01:00
hkc
d26a56d4e1 Added mixed audio processor (#2929)
* Use RL_QUADS/RL_TRIANGLES for single-pixel drawing

Addresses problem mentioned in
https://github.com/raysan5/raylib/issues/2744#issuecomment-1273568263
(in short: when drawing pixels using DrawPixel{,V} in camera mode,
upscaled pixel becomes a line instead of bigger pixel)

* [rtextures] Fixed scaling down in ImageTextEx

Closes #2755

* Added global audio processor

* Renamed struct member to follow naming conventions

* Added example for AttachAudioMixedProcessor
2023-02-20 11:13:24 +01:00
Ray
47dd842e81 Minor format tweaks 2023-02-15 18:11:46 +01:00
Ray
f594f14510 Reviewed typo and formating 2023-02-15 18:01:42 +01:00
Ray
2766835ed4 REPLACE: TABS by 4 spaces 2023-02-15 17:36:31 +01:00
Jeffery Myers
9eaed07b77 Make the oribital camera work like it used to (it is not just a copy of third person) (#2926) 2023-02-15 17:17:00 +01:00
Ray
beb44f1dac Avoid centering mouse when program launches 2023-02-15 13:11:26 +01:00
Ray
903d85e323 Make sure window position always inits in the middle of the current monitor 2023-02-15 12:53:41 +01:00
Ray
5dedb27ce0 REVIEWED: Issue with camera jump on first frame 2023-02-14 22:51:34 +01:00
veins1
ec95aa2e04 Move camera after rotation (#2923)
Moving camera after rotation is set to avoid 1 frame delay in movement direction
2023-02-14 22:29:32 +01:00
Ray
1cfb484100 ADDED: Example project to VS 2023-02-14 20:31:42 +01:00
Ray
e843be7ea5 ADDED: rcamera dependencies details 2023-02-14 20:13:13 +01:00
Ray
547819766f ADDED: Example project to VS2022 solution 2023-02-14 20:12:53 +01:00
Ray
50d17393a5 Create models_loading_m3d.vcxproj 2023-02-14 20:00:56 +01:00
Ray
ea590c44a9 REVIEWED: Camera redesign PR 2023-02-14 20:00:51 +01:00
Crydsch Cube
73989a4981 WIP rcamera redesign vector (#2563)
* core functionality CAMERA_FREE

* fix example

* add remaining camera modes

* add view bobbing

* view bobbing

* catch curser in SetCameraMode

* adjust examples

* fix compilation on linux

* fix example text_draw_3d

* actually fix text_draw_3d

* Updated camera API

* Improve Vector3RotateByAxisAngle() function

* remove camera.mode dependency from low-level functions

* remove camera.mode from struct

* fixes after rebase

* adjust examples for new UpdateCamera function

* adjust example models_loading_m3d

---------

Co-authored-by: Ray <raysan5@gmail.com>
2023-02-14 17:47:21 +01:00
Ray
f1bcabcc37 Update CHANGELOG 2023-02-12 13:48:11 +01:00
Ray
a9c28d7583 Update CHANGELOG 2023-02-12 13:46:26 +01:00
Ray
22287a78c5 Update qoa.h 2023-02-12 13:29:39 +01:00
Ray
96a9b4e1f2 REVIEWED: config.h format and inconsistencies 2023-02-12 13:28:35 +01:00
Ray
21961a786d REVIEWED: Vertex colors support on M3D loading #2878 2023-02-12 12:10:01 +01:00
Ray
4647441ad8 Update rl_gputex.h 2023-02-12 01:10:54 +01:00
BugraAlptekinSari
4ae0a416f4 Added raymarch example and thumbnail for write depth (#2919) 2023-02-11 13:37:50 +01:00
Julio C. Galindo
6ae21d6581 Fixed some grammar mistakes and typos. (#2914)
* Fixed some grammar mistakes.

* Fixed some typos.
2023-02-09 13:17:47 +01:00
Sasquatch ヽ(´ー` )┌
5c6a756014 Update raylib-hx bindings to 4.2 in BINDINGS.md (#2916) 2023-02-08 13:45:34 +01:00
Nikolas
f784961b9c Enable GetWindowHandle() on macOS (#2915) 2023-02-07 22:18:14 +01:00
Ray
e187b693ea Update raudio.c 2023-02-06 11:02:46 +01:00
star-tek-mb
04ab76b889 zig build: do not use deprecated functions (#2913) 2023-02-06 10:28:24 +01:00
Ray
1fea266472 Clean trailing spaces 2023-02-05 16:30:23 +01:00
Ray
c91190fc6e Review QOA sound loading -WIP- 2023-02-05 16:28:04 +01:00
star-tek-mb
ff70a04bf5 update zig build to latest master (#2910)
also, adds package manager support
2023-02-05 13:03:03 +01:00
Ray
60d0ab418a some typos review 2023-02-05 11:44:12 +01:00
HKrogstie
8c50da167d fix DrawMesh using SHADER_LOC_COLOR_SPECULAR as a material map (#2908) (#2909) 2023-02-05 11:04:30 +01:00
Ray
589892af07 Support QOA audio format on ExportWave() -WIP- 2023-02-04 20:27:47 +01:00
Ray
901c4553d2 ADDED: QOA audio format support -WIP- 2023-02-04 20:20:21 +01:00
Ray
43e45cbb81 Replace TABS by 4 spaces 2023-02-04 20:19:51 +01:00
Ray
7914332c40 Update qoi.h 2023-02-03 14:54:28 +01:00
Ian McFarlane
b9e49cdca6 rcamera: move y clamp to before 3d projection (#2905) 2023-02-03 14:52:15 +01:00
Antonis Geralis
212f331583 Update core_input_gamepad.c (#2903) 2023-02-01 15:13:25 +01:00
Ray
d827a65e59 Update external libraries
Switch to official `stb_vorbis.c` instead of using an outdated fork
2023-02-01 11:45:42 +01:00
Ray
a151cbd37a ADDED: Vector2LineAngle() #2887
REVIEWED: `Vector2Angle()`
2023-02-01 11:18:55 +01:00
Nikolas
89171a2608 Add WASM support for Zig build (#2901)
* Add WASM support for Zig build

* Improve Web example building

* Remove emscript example building with Zig again

* Readd windows emscripten variables
2023-02-01 11:09:03 +01:00
Ray
c94c666d04 Review formatting for M3D loading vertex colors 2023-01-30 17:05:12 +01:00
Uneven Prankster
929a46cbab [models] Fix M3D vertex color import. (#2878)
* Fix vertex color import for .m3d

* Only load vertex colors when color map and/or materials are present

* Only execute when color array is present

---------

Co-authored-by: Uneven Prankster <unevenprankster@pm.me>
2023-01-30 17:00:39 +01:00
Dor Shapira
df5a736c00 fix typo (#2899)
patrix=>matrix
2023-01-28 19:26:41 +01:00
Rob Loach
7fff1ba0b0 ADDED: IsModelReady(), IsMaterialReady(), IsTextureReady(), IsRenderTextureReady() (#2895) 2023-01-28 12:13:09 +01:00
Antonis Geralis
0b42da4085 Raylib.h has exceeded 512 functions! (#2896) 2023-01-27 23:33:15 +01:00
Rob Loach
83ff7b2466 ADDED: IsShaderReady(), IsImageReady(), IsFontReady(), IsWaveReady(), IsSoundReady(), IsMusicReady() (#2892)
These IsReady() functions provide a method in order to verify whether or not the object was loaded successfully. They're useful to make sure the assets are there prior to using them.
2023-01-27 19:24:03 +01:00
Jeffery Myers
81ca2f0bf3 Fix warnings and bad project settings for 4.5 release (#2894) 2023-01-27 19:20:42 +01:00
Ray
af66e751db Update CHANGELOG 2023-01-26 23:20:14 +01:00
Ray
000cb5a47d Update CHANGELOG 2023-01-26 23:18:06 +01:00
Kenta
f088548261 Update BINDINGS.md (#2889)
Update Kaylib license to Zlib
2023-01-26 10:52:59 +01:00
Ray
0125790801 Update rmodels.c 2023-01-25 23:13:17 +01:00
Jeffery Myers
63da7cdec6 add include guards on config.h (#2888) 2023-01-25 22:26:03 +01:00
Antonis Geralis
4adba0d3c3 Add wayland support (#2883) 2023-01-25 22:25:25 +01:00
Dor Shapira
7cdffcec52 fixed typo (#2886)
pilepine=>pipeline
chosing=>choosing
additioanlly=>additionally
attachmment=>attachment
initialize=>inititialize
Binded=>Bound
lattest=>latest

hi @raysan5, I ran rlgl.h into some "typo checking" program(basically a JetBrains IDE), and here are all the things that the program was able to spot and fix. as my English isn't really well I would like it if you could check that I didn't make any mistakes in the typo fixing...
2023-01-24 23:43:09 +01:00
Ray
f68bb8c707 REVIEWED: rlGenTextureMipmaps(), GPU generation only 2023-01-24 17:17:25 +01:00
Ray
5149da5719 Merge branch 'master' of https://github.com/raysan5/raylib 2023-01-24 17:16:44 +01:00
Ray
5b3c5e1a16 REVIEWED: ProcessMaterialsOBJ() available when required 2023-01-24 17:16:35 +01:00
PencilAmazing
542ef8904a [models] Load bone names from IQM file if available (#2882)
* Load bone names from IQM file if available

* Formatting and default bone name
2023-01-23 19:55:02 +01:00
Ray
393a03a46e Removed twitter badge, twitter API seems to be limited 2023-01-23 15:28:45 +01:00
Rob Loach
4706891cae Add RAYLIB_VERSION numbers to raylib.h (#2856)
Ran into an issue in raylib-cpp where a user was using raylib 4.5-dev, even though the library currently only targets 4.2. With having RAYLIB_VERSION_MAJOR and RAYLIB_VERSION_MINOR, we will be able to target different versions of raylib in different ways, via C preprocessor conditionals.

For example:
``` c
newColor = ColorTint(BLUE, RED);
TraceLog(LOG_INFO, "The color should be tinted, but this isn't supported in ryalib <= 4.2");
```
2023-01-22 15:29:29 +01:00
Rob Loach
d8af76f67c Fix to use TRACELOG() instead of TraceLog() for internal modules (#2881)
There were a few raylib modules that continued to use TraceLog() instead of the TRACELOG() macro. This change ensures that all the internal raylib modules use the TRACELOG() pattern consistently.
2023-01-22 11:10:38 +01:00
Ray
78ae3b38a6 minor format tweak 2023-01-21 19:31:47 +01:00
Antonis Geralis
e539aad118 Fix android sound issue #2118 (#2875) 2023-01-21 18:52:31 +01:00
Uneven Prankster
19715546b3 Stub out rlCubemapParameters if under GL 1.1. (#2876)
Co-authored-by: Uneven Prankster <unevenprankster@pm.me>
2023-01-21 18:51:33 +01:00
KOLANICH
342b18da03 Add packaging for distros with deb- and rpm-based packages. (#2877) 2023-01-21 18:50:38 +01:00
Jeffery Myers
c649bec26c Have LoadMaterials call the same code that OBJ loader does so that we can read MTL files (#2872) 2023-01-20 16:13:19 +01:00
Masoud Naservand
e64606a82f Correct the set paths in bat files in examples/ (#2870)
Co-authored-by: Masoud Naservand <masoud.naservand@gmail.com>
2023-01-20 16:07:43 +01:00
Jeffery Myers
edaca16d7c Fix warnings in raylib project from MSVC (#2871) 2023-01-20 16:05:19 +01:00
Jeffery Myers
116603e61c don't try to free a void* buffer as if it's a cgltf_data structure (#2867) 2023-01-19 21:21:05 +01:00
Uneven Prankster
76468bb8d8 Add rlCubemapParameters to rlgl.h (#2862)
Co-authored-by: Uneven Prankster <unevenprankster@pm.me>
2023-01-19 20:53:30 +01:00
Ghost
2a2f2b20b8 Fixed bug : touches become sticky (#2857)
Touches became sticky and didn't disappear after using more than 2 fingers, fixed by getting the touch count of how many fingers are on the screen, and only looping through the available/pressed down touch points instead of looping through the maximum touch points.
Tested with more than 10 touch points, and with different MAX points value, working perfectly.
2023-01-14 19:41:42 +01:00
Kenta
aed131a8f0 Update BINDINGS.md (#2858)
* Update BINDINGS.md

Add Kaylib - Kotlin/Native binding for 4.5-dev (proper binding).
Add Raylib-Nelua - Nelua binding for 4.5-dev with working wasm export.

* Update BINDINGS.md
2023-01-14 19:40:48 +01:00
Tobias Mock
d224414eb1 Update raylib-ocaml to 4.2.0 (#2853) 2023-01-11 18:07:35 +01:00
Daijiro Fukuda
c6376acfc4 Set initial window position for display-sized fullscreen (#2742) 2023-01-10 12:45:53 +01:00
Ray
3028bffd4c Minor tweaks 2023-01-10 12:38:21 +01:00
Go Watanabe
f549f67be9 OpenGLES 2.0 support on PLATFORM_DESKTOP (#2840)
* OpenGLES 2.0 support on PLATFORM_DESKTOP

* exmples raylib_opengl_interop desktop GLES2 support

* rename gles2.h -> glad_gles2.h
2023-01-10 12:34:06 +01:00
Ray
6dd1d2d931 ADDED: Required define on Linux #2729 2023-01-10 12:20:45 +01:00
Ray
bba6ae5622 RENAME: type to projection #2851 2023-01-10 12:16:42 +01:00
Ray
ce8000ee7e REVIEWED: GetClipboardText() on PLATFORM_WEB 2023-01-04 20:13:44 +01:00
Ray
89755e52bf REVIEWED: rLoadTextureDepth() fixed issue 2023-01-04 17:35:51 +01:00
Ray
73234d2a28 Avoid trying to setup uniform for invalid locations 2023-01-03 17:44:06 +01:00
Ray
39f9045703 Update models_loading_gltf.c 2023-01-02 20:59:25 +01:00
Ray
b854909803 Update models_loading_gltf.c 2023-01-02 20:48:02 +01:00
Ray
d3c1a04983 REVIEWED: GLTF animations support #2844 2023-01-02 20:46:33 +01:00
Charles
f2e3d6eca7 [models] Add GLTF animation support (#2844)
* add GLTF animation support

* use correct index when allocating animVertices and animNormals

* early exit LoadModelAnimationsGLTF if the gtlf file fails to parse

* update models/models_loading_gltf.c to play gltf animation

Updated the .blend file to use weights rather than bone parents so it
fits into the framework. Exported with weights to the .glb file.

* fix order of operations for bone scale in UpdateModelAnimation

* minor doc cleanup and improvements

* fix formatting

* fix float formatting

* fix brace alignment and replace asserts with log messages
2023-01-02 20:23:48 +01:00
Ray
fabedf7636 Merge branch 'master' of https://github.com/raysan5/raylib 2023-01-02 17:06:55 +01:00
Ray
62f63f9e48 REVIEWED: Avoid possible gamepad index as -1 #2839
WARNING: It could require further review of `GamepadThread()` function where `js_event gamepadEvent.number` detecting current pressed button could generate a missmatch with index 0 (reserved for button unknow). Or maybe `0` could just be `GAMEPAD_BUTTON_NONE`? In that case, consistency with other inputs should be carefully considered...
2023-01-02 17:06:52 +01:00
Antonis Geralis
1dbcce8b56 Use explicit atomics (#2849)
* Use explicit atomics

* missed one

* use relaced ordering
2023-01-02 16:48:53 +01:00
Ray
0ccc1d3686 Update year to 2023 2023-01-01 19:07:58 +01:00
Ray
5ba41e4f7f REVIEWED: shaders_write_depth example 2023-01-01 18:31:03 +01:00
BugraAlptekinSari
3cfb9a6e83 [example] Writing into the depth buffer (#2836)
* Add a depth buffer example.

* Fixed a typo
2023-01-01 18:17:28 +01:00
Ray
30b75702df Update year to 2023 2023-01-01 18:09:22 +01:00
Ray
e2a8066fca Update year to 2023 2023-01-01 16:07:51 +01:00
Ray
b59fab7ee6 Update year to 2023 2023-01-01 16:00:56 +01:00
Wytek01
713e26332f Update year to 2023 (#2846)
* Update year to 2023

* Update raylib.h year to 2023
2023-01-01 12:55:49 +01:00
Antonis Geralis
ba38fe5b97 core_loading_thread example join thread on completion (#2845)
* core_loading_thread example join thread on completion

* error checking
2022-12-31 19:25:35 +01:00
turborium
dbdbbea471 Add new Delphi/Lazarus bindings (#2838)
TurboRaylib - dynamic bindings of ray lib for Delphi/Lazarus
2022-12-28 11:04:55 +01:00
Ray
03cc540d5f Minor tweak 2022-12-18 18:00:21 +01:00
Ray
d7f7c94c4d REVIEWED: Vector2Angle() 2022-12-18 18:00:14 +01:00
Ray
72b9f3c5de Minor tweaks 2022-12-17 12:15:19 +01:00
Antonis Geralis
d1a104bba4 Fix vector2angle (#2832)
* Fix vector2angle

* Fix ;

* use acosf

* need a break

* add comments
2022-12-17 12:13:40 +01:00
Ray
c2b56c583a Merge branch 'master' of https://github.com/raysan5/raylib 2022-12-14 13:00:29 +01:00
Ray
619331f4a7 REVIEWED: Issue with depth textures on WebGL #2824 2022-12-14 12:57:39 +01:00
Alexander Heinrich
3419aef677 Fix Vector2Angle() (#2829)
With this fix the function still returns negative values, which is
wrong. But we keep this behaviour to maintain backwards compatibility.
2022-12-13 18:59:00 +01:00
Ray
445ce51e51 Update Makefile 2022-12-13 10:46:49 +01:00
simendsjo
884d30b85a Use GLVND also for old cmake versions (#2826)
Use GLVND also when legacy implementations exist for old cmake versions
<= 3.10. This is a breaking change for old cmake versions (prior to
around 2017-10-05) which will now use GLVND rather than defaulting to
libGL.

This fixes the following warning when building:

    CMake Warning (dev) at /gnu/store/qv13zgbmyx0vjav8iiqp772kp6rxvwnd-cmake-3.24.2/share/cmake-3.24/Modules/FindOpenGL.cmake:315 (message):
      Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
      available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      FindOpenGL found both a legacy GL library:

        OPENGL_gl_LIBRARY: /home/simendsjo/.guix-profile/lib/libGL.so

      and GLVND libraries for OpenGL and GLX:

        OPENGL_opengl_LIBRARY: /home/simendsjo/.guix-profile/lib/libOpenGL.so
        OPENGL_glx_LIBRARY: /home/simendsjo/.guix-profile/lib/libGLX.so

      OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
      compatibility with CMake 3.10 and below the legacy GL library will be used.
    Call Stack (most recent call first):
      cmake/LibraryConfigurations.cmake:21 (find_package)
      src/CMakeLists.txt:46 (include)
    This warning is for project developers.  Use -Wno-dev to suppress it.

See https://cmake.org/cmake/help/latest/policy/CMP0072.html

Closes #2825
2022-12-11 13:37:38 +01:00
Ray
c04c3668cb Update windows.yml 2022-12-10 13:09:05 +01:00
Ray
855a5f3701 Update windows.yml 2022-12-10 13:06:13 +01:00
Ray
6d59a21e99 Update windows.yml 2022-12-10 13:01:57 +01:00
Ray
935a306b29 Update windows.yml 2022-12-10 12:44:25 +01:00
Ray
2c9d116a5c ADDED: ColorTint(), ColorContrast() 2022-12-07 12:52:42 +01:00
Ray
f1368c36dd ADDED: ColorBrightness() 2022-12-05 00:24:55 +01:00
Ray
4de64f5750 Expose OpenGL blending mode factors and functions/equations 2022-12-04 13:22:37 +01:00
Ray
89698844a1 REVIEWED: Example: textures_textured_curve 2022-12-04 11:01:59 +01:00
Jeffery Myers
57dd345dc3 Add a textured curve example (#2821) 2022-12-03 22:55:05 +01:00
Ray
5b5dff3f9e format tweak 2022-12-02 11:59:54 +01:00
Ray
a4079ad565 Update Makefile 2022-12-02 11:59:43 +01:00
Hristo Iliev
387c060006 Fix an issue when compiling for web (#2820)
It would try to use the glfw on the system but we're cross-compiling for web where the implementation is provided by emscripten's team
2022-11-30 10:36:01 +01:00
Ray
0b6d4b376f REVIEWED: Image fileformat support: PIC, PNM 2022-11-29 17:28:23 +01:00
Ray
d241ee8516 ADDED: Optional support for PNM images (.ppm, .pgm) 2022-11-29 10:58:27 +01:00
Ray
2edf5a9584 REVIEWED: Issue with shader linkage 2022-11-29 10:45:10 +01:00
jtainer
50a716c0d9 Updated rcore.c, renamed 'time' to 'nanoSeconds' (#2816)
* Updated rcore.c, renamed 'time' to 'time_nsec'

When PLATFORM_ANDROID, PLATFORM_RPI or PLATFORM_DRM were defined, there is a compilation error to redefinition of the variable 'time', so the second instance of 'time' was changed to 'time_nsec' which both fixes the name collision and more accurately describes what that variable represents.

* Renamed 'time_nsec' to 'nanoSeconds'
2022-11-29 00:46:10 +01:00
Daijiro Fukuda
57bd84510f Fix wrong compile definition (#2815) 2022-11-28 22:36:22 +01:00
Daijiro Fukuda
66a2cdee40 Fix array out of range (#2814)
This breaks other values of the struct.
2022-11-28 22:35:44 +01:00
Ray
bbf9935828 Update github workflows 2022-11-28 21:03:21 +01:00
Ray
fc5894e734 REVIEWED: Some compilation warnings (for strict rules) 2022-11-28 14:16:59 +01:00
Antonis Geralis
2fd6d7e8c0 Use const for pointer float array (#2807)
* Use const for pointer float array

* missed a definition
2022-11-24 00:58:56 +01:00
Antonis Geralis
2c77b31e30 Correct types for rlBindImageTexture (#2808) 2022-11-24 00:58:31 +01:00
gtrxAC
c48de2d1af Rename lighting_instanced shader (glsl100) to lighting_instancing (#2805)
* JSON parser: Use array for function params (#2255)

* Parser: follow C convention of type before name

* Update file names in build scripts

* Rename lighting_instanced shader to instancing
2022-11-22 18:16:44 +01:00
Ray
c0010105c2 REVIEWED: UnloadDirectoryFiles() 2022-11-22 17:09:39 +01:00
Ray
f6558fe6e0 Minor tweaks 2022-11-22 01:02:54 +01:00
Alex Macafee
36bb57d1be Add raylib-vapi (#2804) 2022-11-21 13:14:20 +01:00
Ray
e6306e5e76 REVIEWED: rlCullFace() -> rlSetCullFace()
Reviewed formating to follow raylib coding conventions.
2022-11-15 12:34:01 +01:00
jtainer
2761aa40dd Added function rlCullFace (#2797)
rlCullFace sets the face culling mode to RL_FRONT or RL_BACK which correspond to GL_FRONT and GL_BACK respectively.
2022-11-15 12:30:32 +01:00
Pere001
c8fd93d356 Warning on GetRandomValue range limit (#2800)
Added a comment explaining the range limitations of GetRandomValue.
Added a run-time warning TRACELOG when GetRandomValue is called with an invalid range.
2022-11-15 12:29:19 +01:00
Ray
2604b9f72b Merge branch 'master' of https://github.com/raysan5/raylib 2022-11-15 12:26:30 +01:00
Ray
3c51d066f1 Avoid using DrawCubeTexture() 2022-11-15 12:26:22 +01:00
Ray
656f47b7cc Update cmake.yml 2022-11-15 12:23:24 +01:00
Ray
2a88dc9bb7 Update linux_examples.yml 2022-11-15 12:22:26 +01:00
Ray
fadc29d811 WARNING: REMOVED: DrawCubeTexture(), DrawCubeTextureRec()
Those two functions have been moved to a new example: `models_draw_cube_texture`. The reasons for this decision:
 - Function inflexibility: Many users with the need to draw a textured cube could need to customize the texture applied to every face, that function did not allow that kind of functionality.
 - rlgl functionality exposure: The implementation exposed will teach users how to implement custom textured triangles drawing.
2022-11-15 12:16:28 +01:00
Jorge A. Gomes
4bb71c8fa2 Raylib-py updated to 4.2, plus parallel project (#2798)
Now Raylib-py is a releases-only project.
For now on, code maintenance will happen in a parallel project created to automate the binding generation: RaylibpyCtbg
2022-11-12 18:56:54 +01:00
Scott Helvick
baabe22f7a Add Claylib (CL bindings + convenience layer) (#2796) 2022-11-11 17:23:02 +01:00
Ray
025db8f227 Merge branch 'master' of https://github.com/raysan5/raylib 2022-11-10 12:03:26 +01:00
Ray
31edd13a72 Minor formating tweaks 2022-11-10 12:03:17 +01:00
Julianiolo
82e0644195 Fix Makefile emscripten path (#2785) 2022-11-10 11:51:51 +01:00
Ray
3888299bf5 WARNING: REMOVED: DrawTextureTiled()
This function implementation has been moved to the related example. Current implementation can be probably customized depending on user needs.
2022-11-10 10:17:37 +01:00
Ray
7f68c65406 WARNING: REMOVED: DrawTextureQuad()
This function can be easely replicated using `DrawtexturePro()` and actually it was doing some assumptions not transparent to the user. Even the function name was confusing. No example was available for it and actually noone requested one example.
2022-11-10 10:11:28 +01:00
Ray
84a2a88572 WARNING: REMOVED: DrawTexturePoly()
Function moved to `examples/textures/textures_polygon.c`, so users can learn from the implementation and create custom variants as required.
2022-11-10 10:05:11 +01:00
red thing
fca58c8e2f dray is now 4.2.0 (#2792) 2022-11-09 07:42:58 +01:00
Martin Wickham
311a57f9fc Add frameworks needed on macos (#2793) 2022-11-09 07:40:59 +01:00
Dor Shapira
773c0d78d8 removing typo (#2790) 2022-11-08 21:47:05 +01:00
Ray
ca6f58eed1 Update rcore.c 2022-11-05 00:31:13 +01:00
RGDTAB
dbdfad7ace Fix ExportDataAsCode() data types (#2787) 2022-11-04 20:39:04 +01:00
Roman Akberov
1cb81e3f4c Fix examples/build.zig for the latest Zig version (#2786) 2022-11-02 18:41:21 +01:00
IsaacTCB
4c4a703841 Fix Android x86 Architecture name (#2783)
When building a x86 project, the folder inside lib is named i686. However Android x86 actually expects the folder to be called x86.
2022-10-30 12:18:12 +01:00
Angga Permana
d91f30958f Fix deprecation error on android api higher than 23 (#2778) 2022-10-27 11:38:25 +02:00
nobytesgiven
5113817507 Improved billboards example, highlighting rotation and draw order (#2779)
* Improved billboards example, highlighting rotation and draw order

* changes to conform to the raylib conventions

* NOW it conforms

Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-26 19:16:35 +02:00
Ray
28e8b2add3 REVIEWED: Issue with OpenURL() 2022-10-26 18:04:20 +02:00
Dor Shapira
bcb47255b9 fixing typo (#2781)
fixing typo
2022-10-26 17:14:52 +02:00
Dor Shapira
bc60812d68 added raylib-python-ctypes bindings (#2780) 2022-10-26 17:14:24 +02:00
Yunoinsky
df4199e2c1 Add ChezScheme support (#2776) 2022-10-26 09:12:14 +02:00
nobytesgiven
c4abf68351 fixed blur issue on opaque pictures & added example (#2775)
Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-26 09:11:14 +02:00
Ray
865f823835 Review -s 2022-10-25 21:03:33 +02:00
nobytesgiven
dbecb95024 Added Box and Gaussian blurring (#2770)
* Added Box and Gaussian blurring

* Removed dependence of gaussian blur to box blur & Fixed precision errors

Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-25 17:56:06 +02:00
Ian Rash
072e92615a Updated support for crystal (#2774)
All fresh and current.
2022-10-25 10:51:40 +02:00
nobytesgiven
e5d332dea2 Fix bezier line breaking #2735 (#2767)
* Fixed bezier line breaking #2735

* converted tabs to spaces

* typo

* Changed doubles to floats

* removed heap allocations\

Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-24 16:35:47 +02:00
Ray
d5cd5ebd80 Update to latest miniaudio (dev) 2022-10-24 13:37:20 +02:00
Ray
d71505bdc6 Update Makefile 2022-10-24 13:37:08 +02:00
Ray
483f10397e review note 2022-10-20 20:09:54 +02:00
Ray
d9f434afb9 Added -s EXPORTED_RUNTIME_METHODS=ccall to examples web build #2739 2022-10-20 20:07:29 +02:00
InKryption
40cf84e7e5 build.zig: let user decide how to set build mode + fix linker warning (#2763)
* build.zig: let user decide how to set build mode

This should delegate the responsibility of calling `standardReleaseOptions` and setting the build mode of the `*LibExeObjStep` step to the caller, especially since this might not be the process by which one wants to determine the build mode.

Also changes hides `getSrcDir` to enforce usage of `srcdir`, and asserts that the file is in fact inside a directory.

* build.zig: set root_src param to `null`

Supplying the header file as the root source here appears to cause a linker warning of the form:
```
LLD Link... warning(link): unexpected LLD stderr:
ld.lld: warning: {build_root}/zig-cache/o/{hash}/libraylib.a: archive member '{build_root}/zig-cache/o/{hash}/raylib.o' is neither ET_REL nor LLVM bitcode
```
Passing `null` instead fixes it.
2022-10-20 18:33:12 +02:00
Peter0x44
b8e14a4f99 Review parser Makefile (#2765)
* parser: Fail gracefully if a nonexistent file is passed on the command line

Before, if a nonexistent file was passed to LoadFileText(), it would
return NULL, and the parser would happily dereference it.

* parser: Refactor Makefile and update the path to easings.h (now reasings.h)

Before, the `make all` target would simply segfault, see 0a679d79
Now, if a file in the `make all` target doesn't exist, make will write
an error.

Individual API files can be generated likeso, provided the header file
the target depends on exists:

FORMAT=JSON EXTENSION=json make raygui_api.json

In order for the `make all` target to succeed, raygui.h, physac.h and
rmem.h need to be added to the correct directory.
2022-10-20 17:29:03 +02:00
ianband
7e7939e1ad Add DrawCapsule(Wires) (#2761)
* Add DrawCapsule & DrawCapsuleWires

* Add DrawCapsule & DrawCapsuleWires to example

Co-authored-by: Ian Band <ian.r.band@gmail.com>
2022-10-17 11:36:53 +02:00
Rob Loach
c5e89241c5 BINDINGS: Add Umka bindings to BINDINGS.md (#2760)
[raylib-umka](https://github.com/robloach/raylib-umka) provides [Umka scripting language](https://github.com/vtereshkov/umka-lang) bindings to raylib.
2022-10-16 00:25:52 +02:00
hkc
0b69bc28c6 Fix ImageTextEx and ImageDrawTextEx scaling (#2756)
* Use RL_QUADS/RL_TRIANGLES for single-pixel drawing

Addresses problem mentioned in
https://github.com/raysan5/raylib/issues/2744#issuecomment-1273568263
(in short: when drawing pixels using DrawPixel{,V} in camera mode,
upscaled pixel becomes a line instead of bigger pixel)

* [rtextures] Fixed scaling down in ImageTextEx

Closes #2755
2022-10-14 17:43:12 +02:00
Ray
e61639f6fc ADDED: GenImageText()
Probably useless but interesting for education. It generated a grayscale image directly from text data.
2022-10-14 10:51:43 +02:00
Kenta
ccd4f8b5ae Add C3 binding to BINDINGS.md (#2757) 2022-10-13 23:00:53 +02:00
Anut-py
11fd883ee4 Add Haskell bindings to BINDINGS.md (#2753) 2022-10-12 22:04:11 +02:00
CrezyDud
aa67f7c39a Fix & Simplify .vox signature check (#2752)
and make version check be only 150 not over 150
2022-10-12 17:14:18 +02:00
hartmannathan
f080367a0c examples/core/core_custom_logging.c: Fix typo (#2751) 2022-10-12 17:12:28 +02:00
Ray
07bbfe86b9 Update core_basic_window.c 2022-10-11 22:28:40 +02:00
hkc
8ebe62b4dd Use RL_QUADS/RL_TRIANGLES for single-pixel drawing (#2750)
Addresses problem mentioned in
https://github.com/raysan5/raylib/issues/2744#issuecomment-1273568263
(in short: when drawing pixels using DrawPixel{,V} in camera mode,
upscaled pixel becomes a line instead of bigger pixel)
2022-10-11 18:45:34 +02:00
Szieberth Ádám
4cca234f46 avoid leading spaces in text_rectangle_bounds (#2746) 2022-10-11 12:14:40 +02:00
Dor Shapira
0d04ceafbf build raylib_api without the 'vectex' tyops (#2749) 2022-10-11 12:14:01 +02:00
Dor Shapira
8025b052b3 fixing typo (#2748) 2022-10-11 11:20:29 +02:00
JupiterRider
cb085a1b50 Update BINDINGS.md (#2745) 2022-10-07 19:03:08 +02:00
Ray
cee0fc5d78 Update README.md 2022-10-07 16:33:39 +02:00
Ray
38025362ee Update version to raylib 4.5-dev to avoid confusions with 4.2 2022-10-07 16:22:44 +02:00
Ray
7a15861d44 Update rlgl.h 2022-10-06 00:56:18 +02:00
Ray
26969c2c38 Added BLEND_CUSTOM_SEPARATE #2741 2022-10-05 13:57:38 +02:00
Ray
25d846aa9a Avoid early return calls 2022-10-05 13:34:19 +02:00
Ray
9017be3259 Reviewed latest PR formating and variables naming #2741 2022-10-05 13:29:34 +02:00
凌溢狐
2d88958d35 Add rlSetBlendFactorsSeparate and custom blend mode modification checks (#2741) 2022-10-05 13:05:44 +02:00
Ray
2e26cf48e8 Merge branch 'master' of https://github.com/raysan5/raylib 2022-10-03 00:07:34 +02:00
Ray
7459d906de Update rtext.c 2022-10-03 00:07:22 +02:00
_Tradam
62d228346b Update build.zig to work with last GLFW update (#2737) 2022-10-02 20:29:48 +02:00
veins1
2872b2fff5 Clear PCM buffer state when closing audio device (#2736)
Fix for #2714
2022-10-02 19:30:26 +02:00
Ray
33e7f7cc59 WARNING: DrawLineBezier() implementation needs review #2721 2022-10-02 11:11:13 +02:00
Rob Loach
0daaaddeef Fix Gestures to use GetTime() if it's available (#2733) 2022-10-02 10:47:17 +02:00
Random
03f5fce672 removed glfwSetWindowPos on InitWindow (#2732)
* removed glfwSetWindowPos on InitWindow

* removed execute permission from CMakeLists
2022-10-02 10:46:33 +02:00
Ray
178a356cb4 minor tweaks 2022-09-30 23:07:29 +02:00
Random
f14955512f fix issue #2728 (#2731)
* fix issue #2728

* updated gamecontrollerdb: fixes GLFW warning due to invalid entry
2022-09-30 10:09:49 +02:00
Ray
45da03df23 Reviewed monitor checking order 2022-09-29 12:00:20 +02:00
Ray
4fe6f885f7 Update gamepad mappings with latest gamecontrollerdb, fix #2725 2022-09-29 11:23:25 +02:00
Ray
357f782f4e Merge branch 'master' of https://github.com/raysan5/raylib 2022-09-29 11:08:02 +02:00
Ray
0ced04f0df Fix #2722 2022-09-29 11:08:00 +02:00
Dor Shapira
587e61def9 fixing new typoes (#2727) 2022-09-28 20:04:59 +02:00
Dor Shapira
5c404c79da Update raylib.h (#2726) 2022-09-28 20:04:41 +02:00
Michael Scherbakow
8f88c61bdf update build.zig (#2720)
zig `master` now enforces to use addIncludePath instead of addIncludeDir
2022-09-27 01:27:22 +02:00
bXi
e9ca38fafa Clarified working of ImageDrawCircle and ImageDrawCircleV (#2719) 2022-09-26 12:24:10 +02:00
Ray
7ab056b6ef REVIEWED: GeneshHeightmap(), fix #2716 2022-09-25 15:41:49 +02:00
Ray
2ef0b064e5 Fix isssue #2718 2022-09-25 14:09:28 +02:00
Ray
ea87491a82 ADDED: Support CAPS/NUM lock keys registering if locked 2022-09-25 00:14:59 +02:00
Ray
810a0330ab WARNING: Several changes on UTF-8/Codepoints API
- ADDED: `GetCodepointPrevious()`
 - RENAMED: `GetCodepoint()` -> `GetCodepointNext()`, actually, reimplemented
 - `GetCodepoint()` has been kept for the moment, for compatibility and also because implementation is different
 - RENAMED: `TextCodepointsToUTF8()` to `LoadUTF8()`, simpler name and more aligned with raylib conventions (functions loading memory start with Load*()), parameters should be descriptive of functionailty.
 - ADDED: `UnloadUTF8()`, aligned with `LoadUTF8()` to avoid allocators issues.
2022-09-22 20:35:55 +02:00
Ray
4b1d4b4f6b Update rcore.c 2022-09-22 20:30:02 +02:00
Ray
907e9e1fe2 Update text_codepoints_loading.c 2022-09-22 20:29:54 +02:00
Ray
4311ffc9e1 REVIEWED: New functions coding conventions 2022-09-19 18:47:16 +02:00
Rob Loach
2093fdcc53 Added: ImageDrawCircleLines, ImageDrawCircleLinesV (#2713)
This adds `ImageDrawCircleLines()` and `ImageDrawCircleLinesV()` to draw outlines of circles, and updates `ImageDrawCircle()` draw a filled circle to match the effect of `DrawCircle()` and `DrawCircleLines()`.
2022-09-19 18:41:17 +02:00
Ray
0e5cd442be REVIEWED: Renamed some shaders, fix #2707 2022-09-19 18:29:08 +02:00
Ray
5530a3ceb8 REVIEWED: ScanDirectoryFilesRecursively(), fix #2704 2022-09-19 18:20:36 +02:00
Ray
6e8f3b0f45 Update rlgl.h 2022-09-19 10:35:34 +02:00
Ray
12e8cef9cf REMOVED: Mipmaps software generation for OpenGL 1.1
As generation is done in software, it's up to the user to do it. `ImageMipmaps()` is already provided for reference.
2022-09-19 10:31:55 +02:00
Denis Pobedrya
27781a4767 Remove touch points on touch up events on Android (#2711)
Fixes #2683

Remove elements from touch point related arrays when touch up and
similar events are processed. This makes GetTouchPointCount() always
report the actual count of touch points, and all positions returned by
GetTouchPosition() correspond to positions of currently happening
touches.
2022-09-18 23:01:10 +02:00
Gunko Vadim
7e3a50b4ac Update BINDINGS.md (#2710) 2022-09-18 22:36:59 +02:00
Nikolas
42ecd72547 [rlgl] Check for extensions before enabling them (#2706)
* [rlgl] Check for extensions before enabling them

* Shift to glad on macOS

* #undef CORE_OPENGL_33

* Remove version hack and fix ASTC compression assumption

* Remove loader from glad

* Use GLAD_MALLOC/FREE instead of malloc/free

* More explicit extension checking
2022-09-18 21:08:51 +02:00
Denis Pobedrya
8f597b3cc3 Basic gamepad support for Android (#2709)
Currently assumes a single gamepad, has no code specific to gamepad
detection (gamepad is "detected" when an event related to gamepad
arrives). Also assumes that all gamepads look roughly like an xbox/ps
controller. Both assumptions are not strictly true, but an
implementation like that probably covers 85% of usecases.

Also it doesn't update previousButtonState so functions
IsGamepadButtonPressed() and IsGamepadButtonReleased() don't work, but
they didn't work previously on Android anyway, and they are flaky on
desktop as they are now, so the mechanism for these two functions
probably should be reworked anyway.

It's certainly an improvement compared to the previous android gamepad
handling code, which put gamepad events into touch related structs.
2022-09-18 19:58:52 +02:00
Denis Pobedrya
ff25402f68 Fix viewport scaling bug on android after context rebind (#2703)
On android after rebinding context (which happens when you minimize and
navigate back to an app, or when you turn a screen off and back on)
there's a bug that viewport has a wrong scale and part of it is off
screen.

The change fixes it on devices I tried, but the solution feels hacky to
me. However when I attempted instead to call SetupViewport() again which
feels like a more proper solution, it didn't fix it.
2022-09-18 11:28:55 +02:00
Denis Pobedrya
8e57c8ace3 Fix touchscreen input related functions on Android (#2702)
Fix display -> screen coordinate conversion for android platform and
move it to the platform event handling code, simplifying
GetTouchPosition() function implementation.

Co-authored-by: Denis Pobedrya <denis.pobedrya@gmail.com>
2022-09-17 23:15:11 +02:00
AQuantumPotato
494a581339 Update BINDINGS.md (#2701)
Updated the list of projects that support 4.2
2022-09-17 23:14:00 +02:00
Rob Loach
4c3d577ddb CMake: Project template fix to easily target raylib version (#2700) 2022-09-17 23:12:57 +02:00
Ray
c328f09efc Move compressed textures loading to a separate self-contained library 2022-09-17 19:26:23 +02:00
Ray
cb9b8f73c0 ADDED: GenImagePerlinNoise() 2022-09-17 13:39:49 +02:00
murilluhenrique
eaa0b9102b Fix typo (#2696) 2022-09-16 00:06:25 +02:00
Nikolas
a12ddacb7b Enable DXT compression on __APPLE__ targets (#2694) 2022-09-12 12:21:41 +02:00
Ray
853c66baed REVIEWED: CheckCollisionPointPoly() 2022-09-10 23:56:52 +02:00
Ray
cf76d23476 Minor format tweaks 2022-09-10 10:23:38 +02:00
Ray
cf24c021a3 WARNING: BREAKING: Reviewed SSBO usage to avoid long long
raylib library tries to avoid `long long` usage. Several SSBO functions have been reviewed (including some renames for consistency) to minimize `long long` type usage.
2022-09-09 00:26:47 +02:00
Ray
b478364914 REVIEWED: Removed comment, fixes #2691 2022-09-09 00:04:08 +02:00
hartmannathan
c1b4881e8a examples/core/core_custom_logging.c: Fix typo (#2692) 2022-09-08 16:10:15 +02:00
Ray
ac1ffbad1d REVIEWED: Data type to unsigned 2022-09-07 00:39:38 +02:00
Ray
b09725fa84 REPLACED: rlVertex2i() by rlVertex2f() 2022-09-05 18:45:33 +02:00
Ray
e59442bfab REMOVED: rlPushMatrix()/rlPopMatrix() from rshapes
This simplification will allow the usage of `rshapes` as STANDALONE mode in a future. Only a small set of `rlgl` functions are required and they can be "more" easely replaced if no `rlPushMatrix()`/`rlPopMatrix()` are involved.

More simplification planned for the future, maybe the textures dependencies.
2022-09-05 18:23:25 +02:00
Ray
9996e328cb WARNING: BREAKING: Removed rlCheckRenderBatchLimit() requirement
Updated version to `rlgl 4.2`
2022-09-05 13:20:09 +02:00
Ray
ad5ffd78d6 REVIEWED: rlgl enums and comments 2022-09-05 11:15:28 +02:00
Ray
0917290e95 REVIEWED: M3D model loading #2688 2022-09-04 18:49:54 +02:00
Ray
ac3420faac Update core_custom_frame_control.c 2022-09-04 12:32:40 +02:00
skylar
ee5a87826d Fixed a bug in the 2d camera platformer example (#2687)
canJump used to alternate between true and false when on ground
2022-09-04 11:48:33 +02:00
Ray
f4b4054de5 REVIEWED: CheckCollisionPointPoly() 2022-09-04 10:45:01 +02:00
Jacek
aff98d7f2a Check collision point polygon (#2685)
* Update raylib.h

* CheckCollisionPointPolygon()

* typo
2022-09-04 10:39:03 +02:00
Ray
082920eb80 WARNING: RENAMED exported symbol to raylib_version #2671 2022-09-02 21:35:08 +02:00
Ray
de968e3623 WARNING: RENAMED symbol raylibVersion to raylib_version
I want to note this is a special symbol exported
2022-09-02 21:32:58 +02:00
Ray
2a798d64a2 Export raylibVersion symbol. Fixes #2671 2022-09-02 21:28:19 +02:00
Stan
234576da71 Removed raylib_opengl_interop.c from PLATFORM=Web build (#2682) 2022-09-02 09:13:35 +02:00
Ray
fb1037a241 ADDED: Complete support for M3D animations! #2648 2022-09-01 20:46:06 +02:00
Ray
64cca24526 ADDED: RL_TEXTURE_MIPMAP_BIAS_RATIO support to rlTextureParameters() for OpenGL 3.3 #2674 2022-09-01 11:18:22 +02:00
Ray
a598754b5b Update windows.yml 2022-09-01 11:04:10 +02:00
Ray
bb4d9297b5 Update windows.yml 2022-09-01 10:52:03 +02:00
Ray
4938966e76 Update windows.yml 2022-09-01 10:45:30 +02:00
Ray
cabaa53302 Update windows.yml 2022-09-01 10:44:25 +02:00
Ray
bfab101ac2 Update windows.yml 2022-09-01 10:42:11 +02:00
Ray
23cc39a265 Implemented latest .M3D improvements #2648 2022-09-01 10:27:16 +02:00
Ray
0c7ba773ec Fixed issue with LoadIQM() #2676 2022-09-01 10:14:45 +02:00
Ray
4b76aa09dd ADDED: lighting.fs for GLSL120 Fix #2651 2022-08-29 14:36:07 +02:00
Ray
d66692149b Update README.md 2022-08-28 18:04:47 +02:00
Ray
7f5567eec0 Reviewed GLFW compilation requirements on Linux: _GNU_SOURCE
Reasons to NOT define `_GNU_SOURCE`:

 - access to lots of nonstandard GNU/Linux extension functions
 - access to traditional functions which were omitted from the POSIX standard (often for good reason, such as being replaced with better alternatives, or being tied to particular legacy implementations)
 - access to low-level functions that cannot be portable, but that you sometimes need for implementing system utilities like mount, ifconfig, etc.
 - broken behavior for lots of POSIX-specified functions, where the GNU folks disagreed with the standards committee on how the functions should behave and decided to do their own thing.
2022-08-28 15:48:12 +02:00
Ray
be2328f848 Update Makefile 2022-08-28 15:39:22 +02:00
Ray
568fe42cb1 Reviewed GLFW issue with ppoll() function 2022-08-28 15:37:09 +02:00
Ray
482dbfc52e Avoid error on implicit-function-declaration 2022-08-28 15:28:57 +02:00
Ray
10ae54379a Update posix_poll.c 2022-08-28 15:25:34 +02:00
Ray
2236197d49 Update rglfw.c 2022-08-28 15:20:16 +02:00
Ray
9e0e08cba4 WARNING: UPDATED GLFW to latest master branch!
WARNING: This could be a BREAKING CHANGE for some platforms! I'm afraid something could be wrong on `rglfw.c` module.

To be able to compile on Windows I had to modify `glfw/src/platform.c` line 74. I couldn't manage to compile without that change, help is welcome!
2022-08-28 14:16:51 +02:00
Dmitry Matveyev
8508ae3d15 Update NimraylibNow! bindings version (#2667) 2022-08-28 13:35:39 +02:00
Milan Nikolic
99948a86e1 Update raylib-go bindings (#2665) 2022-08-27 18:07:30 +02:00
Ray
f66b1a3136 REVIEWED: Support M3D file loading #2648 2022-08-26 10:04:38 +02:00
Ray
ae745e4fa8 ADDED: -latomic library on Linux (only required for ARM32)
This linkage is only required for arm 32bit but I don't know how to detect that specific architecture in the Makefile...
2022-08-22 11:25:35 +02:00
Ray
e92bc8ca4e REVIEWED: M3D implementation #2648 2022-08-22 11:11:05 +02:00
Rodrigo Escar
aa4111a3b2 Fix PATH for Web target (#2647) 2022-08-21 11:45:37 +02:00
Daijiro Fukuda
7bb8ffc29e Win32: resolve some symbols re-definition of windows.h in glfw3native.h (#2643)
* Win32: resolve some symbols re-definition of windows.h in glfw3native.h

This reflects GLFW's fix: https://github.com/glfw/glfw/issues/1348

This enables to build with a external GLFW containing the
following fix:

* 05f6c13d11

Currently, glfw3native.h of the internal GLFW is customized at
2feea87b61

This fix is compatible with the current customized glfw3native.h.

This fix enables us to update it to the latest and remove the
customization.

* Win32: remove unneeded typedef
2022-08-21 11:44:16 +02:00
Rob Loach
e835311d0d BINDINGS: raylib-cpp has support for raylib 4.2 (#2652)
https://github.com/robloach/raylib-cpp
2022-08-21 11:43:27 +02:00
Ray
4ee5fdf619 ADDED: Support M3D model file format (meshes and materials) #2648 2022-08-20 14:01:54 +02:00
Ray
35c777ef2c REVIEWED: Avoid crash on bad data provided 2022-08-18 15:11:23 +02:00
Ray
904c505125 minor tweak 2022-08-18 15:10:40 +02:00
irishgreencitrus
d8ed3fb31e Update raylib.jl and raylib.v to 4.2.0 (#2644) 2022-08-17 16:36:03 +02:00
Ray
2ad7967db8 REVIEW: Fix issue with external GLFW missing define #2638 2022-08-17 10:19:52 +02:00
Michael Scherbakow
95d3a6ac52 update raylib.zig to 4.2 (#2642) 2022-08-15 23:55:58 +02:00
moosey
f049f9dd3a Tiny documentation fix in reasings.h (#2640) 2022-08-15 09:15:43 +02:00
WIITD
67f8424eb0 raylib-freebasic updated to 4.2 (#2639) 2022-08-15 09:12:30 +02:00
Ray
7db6fe02fd Fixed issue with new output format 2022-08-14 12:56:55 +02:00
853 changed files with 245501 additions and 99999 deletions

View File

@@ -21,6 +21,7 @@ Please, before submitting a new issue verify and check:
- [ ] I tested it on latest raylib version from master branch
- [ ] I checked there is no similar issue already reported
- [ ] I checked the documentation on the [wiki](https://github.com/raysan5/raylib/wiki)
- [ ] My code has no errors or misuse of raylib
### Issue description

135
.github/workflows/analyze_codeql.yml vendored Normal file
View File

@@ -0,0 +1,135 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: Analyze raylib with CodeQL
on:
workflow_dispatch:
# push:
# branches: [ "main", "master" ]
pull_request:
branches: '*'
schedule:
- cron: '0 0 * * 1'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Setup Environment
run: |
sudo apt-get update -qq
sudo apt-get install gcc-multilib
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPLATFORM=Desktop
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
queries: security-and-quality
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPLATFORM=Desktop
cmake --build . --config $BUILD_TYPE
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
upload: false
id: step1
# Filter out rules with low severity or high false positve rate
# Also filter out warnings in third-party code
- name: Filter out unwanted errors and warnings
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-**:cpp/path-injection
-**:cpp/world-writable-file-creation
-**:cpp/poorly-documented-function
-**:cpp/potentially-dangerous-function
-**:cpp/use-of-goto
-**:cpp/integer-multiplication-cast-to-long
-**:cpp/comparison-with-wider-type
-**:cpp/leap-year/*
-**:cpp/ambiguously-signed-bit-field
-**:cpp/suspicious-pointer-scaling
-**:cpp/suspicious-pointer-scaling-void
-**:cpp/unsigned-comparison-zero
-**/cmake*/Modules/**
-**/src/external/glfw/**
-**/src/external/**
input: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
- name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.step1.outputs.sarif-output }}
category: "/language:${{matrix.language}}"
- name: Upload CodeQL results as an artifact
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: codeql-results
path: ${{ steps.step1.outputs.sarif-output }}
retention-days: 5

View File

@@ -1,4 +1,4 @@
name: Android
name: Build raylib - Android
on:
workflow_dispatch:
@@ -82,19 +82,15 @@ jobs:
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published'
if: github.event_name == 'release' && github.event.action == 'published'

View File

@@ -1,4 +1,4 @@
name: CMakeBuilds
name: Build raylib CMake - Windows+Linux
on:
workflow_dispatch:
@@ -36,7 +36,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
@@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
@@ -86,7 +86,7 @@ jobs:
run: |
sudo apt-get update -qq
sudo apt-get install gcc-multilib
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libwayland-bin libxkbcommon-dev
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system

View File

@@ -1,4 +1,4 @@
name: Linux Examples
name: Build raylib examples - Linux
on:
workflow_dispatch:
@@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Environment
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
- name: Build Library
run: |

View File

@@ -1,4 +1,4 @@
name: Windows Examples
name: Build raylib examples - Windows
on:
workflow_dispatch:
@@ -22,7 +22,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

View File

@@ -1,4 +1,4 @@
name: Linux
name: Build raylib - Linux
on:
workflow_dispatch:
@@ -22,22 +22,28 @@ jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
bits: [32, 64]
include:
- bits: 32
ARCH: "i386"
ARCH_NAME: "i386"
COMPILER_PATH: "/user/bin"
COMPILER_PATH: "/usr/bin"
runner: "ubuntu-latest"
- bits: 64
ARCH: "x86_64"
ARCH_NAME: "amd64"
COMPILER_PATH: "/user/bin"
COMPILER_PATH: "/usr/bin"
runner: "ubuntu-latest"
- bits: 64
ARCH: "aarch64"
ARCH_NAME: "arm64"
COMPILER_PATH: "/usr/bin"
runner: "ubuntu-24.04-arm"
runs-on: ${{ matrix.runner }}
env:
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
@@ -54,8 +60,7 @@ jobs:
- name: Setup Environment
run: |
sudo apt-get update -qq
sudo apt-get install gcc-multilib
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
@@ -64,9 +69,14 @@ jobs:
mkdir lib
cd ../../../raylib
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
- name: Setup Environment (x86)
run : |
sudo apt-get install gcc-multilib
if: matrix.bits == 32 && matrix.ARCH == 'i386'
# TODO: Support 32bit (i386) static/shared library building
- name: Build Library
- name: Build Library (32-bit)
run: |
cd src
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
@@ -74,13 +84,21 @@ jobs:
cd ..
if: matrix.bits == 32
- name: Build Library
- name: Build Library (64-bit x86)
run: |
cd src
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
if: matrix.bits == 64
if: matrix.bits == 64 && matrix.ARCH == 'x86_64'
- name: Build Library (64-bit ARM)
run: |
cd src
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
if: matrix.bits == 64 && matrix.ARCH == 'aarch64'
- name: Generate Artifacts
run: |
@@ -94,18 +112,15 @@ jobs:
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published'
if: github.event_name == 'release' && github.event.action == 'published'

View File

@@ -1,4 +1,4 @@
name: macOS
name: Build raylib - macOS
on:
workflow_dispatch:
@@ -99,18 +99,15 @@ jobs:
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published'

View File

@@ -1,4 +1,4 @@
name: WebAssembly
name: Build raylib - WebAssembly
on:
workflow_dispatch:
@@ -27,9 +27,9 @@ jobs:
uses: actions/checkout@master
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v11
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.0.0
version: 3.1.71
actions-cache-folder: 'emsdk-cache'
- name: Setup Release Version
@@ -69,18 +69,15 @@ jobs:
shell: cmd
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
asset_name: ${{ env.RELEASE_NAME }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published'

View File

@@ -1,4 +1,4 @@
name: Windows
name: Build raylib - Windows
on:
workflow_dispatch:
@@ -28,29 +28,34 @@ jobs:
max-parallel: 1
matrix:
compiler: [mingw-w64, msvc16]
bits: [32, 64]
ziptarget: [ win32, win64, winarm64 ]
include:
- compiler: mingw-w64
bits: 32
ARCH: "i686"
COMPILER_PATH: "C:\\msys64\\mingw32\\bin"
WINDRES_ARCH: pe-i386
ziptarget: "win32"
- compiler: mingw-w64
bits: 64
ARCH: "x86_64"
COMPILER_PATH: "C:\\msys64\\mingw64\\bin"
WINDRES_ARCH: pe-x86-64
ziptarget: "win64"
- compiler: msvc16
bits: 32
ARCH: "x86"
VSARCHPATH: "Win32"
ziptarget: "win32"
- compiler: msvc16
bits: 64
ARCH: "x64"
VSARCHPATH: "x64"
ziptarget: "win64"
- compiler: msvc16
ARCH: "ARM64"
VSARCHPATH: "ARM64"
ziptarget: "winarm64"
exclude:
- compiler: mingw-w64
ziptarget: winarm64 # We don't build arm64 with mingw-w64 yet
env:
RELEASE_NAME: raylib-dev_win${{ matrix.bits }}_${{ matrix.compiler }}
RELEASE_NAME: raylib-dev_${{ matrix.ziptarget }}_${{ matrix.compiler }}
GNUTARGET: default
steps:
@@ -59,7 +64,7 @@ jobs:
- name: Setup Release Version
run: |
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_win${{ matrix.bits }}_${{ matrix.compiler }}" >> $GITHUB_ENV
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_${{ matrix.ziptarget }}_${{ matrix.compiler }}" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
@@ -76,21 +81,38 @@ jobs:
# Setup MSBuild.exe path if required
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2
if: matrix.compiler == 'msvc16'
- name: Build Library (MinGW-w64)
- name: Build Library (MinGW-w64 32bit)
run: |
cd src
x86_64-w64-mingw32-gcc.exe --version
windres.exe --version
dir C:\msys64\mingw64\bin
make PLATFORM=PLATFORM_DESKTOP CC=x86_64-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS=-m32
//windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
//make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
shell: cmd
if: |
matrix.compiler == 'mingw-w64' &&
matrix.arch == 'i686'
- name: Build Library (MinGW-w64 64bit)
run: |
cd src
set PATH=%PATH%;${{ matrix.COMPILER_PATH }}
${{ matrix.ARCH }}-w64-mingw32-gcc.exe --version
${{ matrix.COMPILER_PATH }}/windres.exe --version
windres.exe --version
dir C:\msys64\mingw64\bin
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
${{ matrix.COMPILER_PATH }}/windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
shell: cmd
if: matrix.compiler == 'mingw-w64'
if: |
matrix.compiler == 'mingw-w64' &&
matrix.arch == 'x86_64'
- name: Build Library (MSVC16)
run: |
@@ -118,18 +140,15 @@ jobs:
shell: cmd
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
asset_name: ${{ env.RELEASE_NAME }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published'

37
.github/workflows/parse_api.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Parse raylib API
on:
workflow_dispatch:
push:
paths:
- "src/raylib.h"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update parse files
working-directory: tools/parser
run: |
make raylib_api
mv raylib_api.* output
- name: Diff parse files
id: diff
run: |
git add -N parser
git diff --name-only --exit-code
continue-on-error: true
- name: Commit parse files
if: steps.diff.outcome == 'failure'
run: |
set -x
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add tools/parser
git commit -m "Update raylib_api.* by CI"
git push

72
.github/workflows/update_examples.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
name: Update examples collection
on:
workflow_dispatch:
push:
paths:
- 'examples/**'
pull_request:
paths:
- 'examples/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: 'latest'
actions-cache-folder: 'emsdk-cache'
- name: Clone raylib.com repo to update files
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/raysan5/raylib.com.git
shell: bash
- name: Build and run rexm tool (requires GNU Makefile)
# "rexm update" validates and updates all required examples in raylib and even raylib.com repos,
# note that it calls examples/Makefile.Web internally, so it requires [make] tool available
run: |
sudo apt-get update && sudo apt-get install -y libopengl0 libglu1-mesa libx11-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libgl1-mesa-dev libglu1-mesa-dev
cd "${{ github.workspace }}/src"
make PLATFORM=PLATFORM_DESKTOP
sudo make install
make clean
make PLATFORM=PLATFORM_WEB
cd ../tools/rexm/
make
export REXM_EXAMPLES_BASE_PATH="${{ github.workspace }}/examples"
export REXM_EXAMPLES_WEB_PATH="${{ github.workspace }}/raylib.com/examples"
export REXM_EXAMPLES_TEMPLATE_FILE_PATH="${{ github.workspace }}/examples/examples_template.c"
export REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH="${{ github.workspace }}/examples/examples_template.png"
export REXM_EXAMPLES_COLLECTION_FILE_PATH="${{ github.workspace }}/examples/examples_list.txt"
export REXM_EXAMPLES_VS2022_SLN_FILE="${{ github.workspace }}/projects/VS2022/raylib.sln"
export EMSDK_PATH="${{ github.workspace }}/emsdk-cache/emsdk-main"
./rexm update
shell: bash
- name: Commit changes to raylib repo (DISABLED)
if: github.event_name == 'push' && false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Update examples collection" || echo "git exited with code 1, nothing changed"
git push
shell: bash
- name: Push changes to raylib.com repo (DISABLED)
if: github.event_name == 'push' && false
run: |
cd raylib.com
git add -A
git commit -m "Update web examples" || echo "git exited with code 1, nothing changed"
git push origin
shell: bash

19
.gitignore vendored
View File

@@ -54,6 +54,10 @@ packages/
*.bc
*.so
*.so.*
*.dll
# Emscripten
emsdk
# Ignore wasm data in examples/
examples/**/*.wasm
@@ -75,6 +79,9 @@ xcschememanagement.plist
xcuserdata/
DerivedData/
# VSCode project
.vscode
# Jetbrains project
.idea/
cmake-build-*/
@@ -85,6 +92,7 @@ CMakeFiles
CMakeScripts
Testing
cmake_install.cmake
cmake_uninstall.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
@@ -96,11 +104,18 @@ GRTAGS
GTAGS
# Zig programming language
.zig-cache/
zig-cache/
zig-out/
build/
build-*/
docgen_tmp/
# Parser stuff
parser/raylib_parser
# Tools stuff
tools/parser/raylib_parser
tools/rexm/rexm.exe
tools/rexm/rexm
# CI
emsdk-cache/
raylib.com/

View File

@@ -1,137 +1,178 @@
# raylib bindings and wrappers
Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
Some people ported raylib to other languages in the form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
### Language Bindings
| name | raylib version | language | license | repo |
|:------------------:|:---------------:|:---------:|:----------:|-----------------------------------------------------------|
| raylib | **4.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | https://github.com/raysan5/raylib |
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo |
| Raylib-cs | **4.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | https://github.com/ChrisDill/Raylib-cs |
| Raylib-CsLo | **4.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/NotNotTech/Raylib-CsLo |
| cl-raylib | **4.0** | [Common Lisp](https://common-lisp.net/) | MIT | https://github.com/longlene/cl-raylib |
| raylib-cr | **4.0** | [Crystal](https://crystal-lang.org/) | Apache-2.0 | https://github.com/sol-vin/raylib-cr |
| dart-raylib | **4.0** | [Dart](https://dart.dev/) | MIT | https://gitlab.com/wolfenrain/dart-raylib |
| bindbc-raylib3 | **4.0** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 |
| dray | **4.0** | [D](https://dlang.org/) | Apache-2.0 | https://github.com/xdrie/dray |
| raylib-d | **4.0** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d |
| dlang_raylib | **4.0** | [D](https://dlang.org) | MPL-2.0 |https://github.com/rc-05/dlang_raylib |
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
| raylib-factor | **4.0** | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
| raylib-freebasic | **4.0** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
| raylib-go | **4.0** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
| raylib-guile | auto | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | MIT | https://github.com/ArnautDaniel/gforth-raylib |
| raylib-hx | 4.0 | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
| jaylib | **4.2** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
| raylib-j | **4.0** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J |
| raylib.jl | **4.0** | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl |
| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | ? | https://github.com/electronstudio/kaylib |
| raylib-lua | **4.0** | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua |
| raylua | **4.0** | [Lua](http://www.lua.org/) | MIT | https://github.com/Rabios/raylua |
| nelua-raylib | 4.0 | [nelua](https://nelua.io/) | MIT | https://github.com/AKDev21/nelua-raylib |
| NimraylibNow! | 4.0 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now |
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever |
| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib |
| node-raylib | **4.0** | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib |
| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | MIT | https://github.com/Deathbat2190/raylib_odin_bindings |
| raylib-odin | **4.0** | [Odin](https://odin-lang.org/) | BSD-3Clause | https://github.com/odin-lang/Odin/tree/master/vendor/raylib |
| raylib-ocaml | **4.0** | [OCaml](https://ocaml.org/) | MIT | https://github.com/tjammer/raylib-ocaml |
| Ray4Laz | **4.2** | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language))| Zlib | https://github.com/GuvaCode/Ray4Laz |
| Raylib.4.0.Pascal | **4.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/sysrpl/Raylib.4.0.Pascal |
| pyraylib | 3.7 | [Python](https://www.python.org/) | Zlib | https://github.com/Ho011/pyraylib |
| raylib-python-cffi | **4.2** | [Python](https://www.python.org/) | EPL-2.0 | https://github.com/electronstudio/raylib-python-cffi |
| raylib-php | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php |
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp |
| raylibr | **4.0** | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr |
| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs |
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib |
| racket-raylib | **4.0** | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib |
| raylib-swift | **4.0** | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib |
| raylib-scopes | auto | [Scopes](http://scopes.rocks) | MIT | https://github.com/salotz/raylib-scopes |
| raylib-smallBasic | 4.1-dev | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib |
| raylib.v | **4.0** | [V](https://vlang.io/) | Zlib | https://github.com/irishgreencitrus/raylib.v |
| raylib-wren | **4.0** | [Wren](http://wren.io/) | ISC | https://github.com/TSnake41/raylib-wren |
| raylib-zig | **4.0** | [Zig](https://ziglang.org/) | MIT | https://github.com/Not-Nik/raylib-zig |
| raylib.zig | **4.1-dev** | [Zig](https://ziglang.org/) | MIT | https://github.com/ryupold/raylib.zig |
| hare-raylib | auto | [Hare](https://harelang.org/) | Zlib | https://git.sr.ht/~evantj/hare-raylib |
| Name | raylib Version | Language | License |
| :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: |
| [raylib](https://github.com/raysan5/raylib) | **5.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
| [raylib-ada](https://github.com/Fabien-Chouteau/raylib-ada) | **5.5** | [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) | MIT |
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT |
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3](https://c3-lang.org) | MIT |
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
| [Raylib-cs.BleedingEdge](https://github.com/danilwhale/Raylib-cs.BleedingEdge) | **5.6-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
| [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT |
| [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
| [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 |
| [raylib](https://github.com/fosskers/raylib) | 5.5 | [Common Lisp](https://common-lisp.net) | MPL-2.0 |
| [chez-raylib](https://github.com/Yunoinsky/chez-raylib) | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme) | GPLv3 |
| [CLIPSraylib](https://github.com/mrryanjohnston/CLIPSraylib) | **auto** | [CLIPS](https://www.clipsrules.net/) | MIT |
| [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 |
| [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT |
| [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT |
| [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 |
| [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 |
| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.5** | [D](https://dlang.org) | Zlib |
| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 |
| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD |
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC |
| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.5** | [Go](https://golang.org) | Zlib |
| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib |
| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** |
| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 |
| [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib |
| [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT |
| [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT |
| [jaylib](https://github.com/electronstudio/jaylib/) | **5.5** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE |
| [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib |
| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC |
| [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC |
| [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT |
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib |
| [raylib-luajit](https://github.com/homma/raylib-luajit) | 5.5 | [Lua](http://www.lua.org) | MIT |
| [raylib-luajit-generated](https://github.com/james2doyle/raylib-luajit-generated) | 5.5 | [Lua](http://www.lua.org) | MIT |
| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** |
| [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.5** | [nelua](https://nelua.io) | Zlib |
| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib |
| [naylib](https://github.com/planetis-m/naylib) | **5.6-dev** | [Nim](https://nim-lang.org) | MIT |
| [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib |
| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | BSD-3Clause |
| [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT |
| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT |
| [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT |
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
| [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
| [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib |
| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [Python](https://www.python.org) | EPL-2.0 |
| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 5.5 | [Python](https://www.python.org) | MIT |
| [raylib-py](https://github.com/overdev/raylib-py) | 5.5 | [Python](https://www.python.org) | MIT |
| [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT |
| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 5.1-dev | [pocketpy](https://pocketpy.dev) | MIT |
| [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
| [raylib-phpcpp](https://github.com/oraoto/raylib-phpcpp) | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT |
| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 5.5 | [Rust](https://www.rust-lang.org) | GPLv3 |
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib |
| [raylib-ruby](https://github.com/wilsonsilva/raylib-ruby) | 4.5 | [Ruby](https://www.ruby-lang.org) | Zlib |
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
| [racket-raylib](https://github.com/eutro/racket-raylib) | **5.5** | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT |
| [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT |
| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.5** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 |
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
| [raylib-v](https://github.com/vlang/raylib) | 5.5 | [V](https://vlang.io) | MIT/Unlicense |
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
| [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD |
| [raylib-bqn](https://github.com/Brian-ED/raylib-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
| [rayjs](https://github.com/mode777/rayjs) | 4.6-dev | [QuickJS](https://bellard.org/quickjs) | MIT |
| [raylib-raku](https://github.com/vushu/raylib-raku) | **auto** | [Raku](https://www.raku.org) | Artistic License 2.0 |
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause |
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
| [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT |
| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT |
| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT |
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
### Utility Wrapers
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
| name | raylib version | language | license | repo |
|:------------------:|:-------------: | :--------:|:-------:|:-------------------------------------------------------------|
| raylib-cpp | **4.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | https://github.com/robloach/raylib-cpp |
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm.
| Name | raylib Version | Language | License |
| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: |
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
| [DOOR](https://github.com/RealDoigt/DOOR) | 4.0 | [D](https://dlang.org) | MIT |
| [Iris](https://github.com/Marcos-cat/iris) | **5.5** | [Uiua](https://www.uiua.org/) | MIT |
### Older or Unmaintained Language Bindings
These are older raylib bindings that are more than 2 versions old or have not been maintained.
| name | raylib version | language | repo |
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp |
| RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS |
| raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d |
| bindbc-raylib | 3.0 | [D](https://dlang.org/) | https://github.com/o3o/bindbc-raylib |
| go-raylib | 3.5 | [Go](https://golang.org/) | https://github.com/chunqian/go-raylib |
| raylib-goplus | 2.6-dev | [Go](https://golang.org/) | https://github.com/Lachee/raylib-goplus |
| ray-go | 2.6-dev | [Go](https://golang.org/) | https://github.com/hecate-tech/ray-go |
| raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore |
| LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib |
| raylib-lua-sol | 2.5 | [Lua](http://www.lua.org/) | https://github.com/RobLoach/raylib-lua-sol |
| raylib-lua-ffi | 2.0 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib/issues/693 |
| raylib-lua | 1.7 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib-lua |
| raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua |
| raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim |
| raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim |
| nim-raylib | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/tomc1998/nim-raylib |
| raylib-haskell | 2.0 | [Haskell](https://www.haskell.org/) | https://github.com/DevJac/raylib-haskell |
| raylib-cr | 2.5-dev | [Crystal](https://crystal-lang.org/) | https://github.com/AregevDev/raylib-cr |
| raylib.cr | 2.0 | [Crystal](https://crystal-lang.org/) | https://github.com/sam0x17/raylib.cr |
| cray | 1.8 | [Crystal](https://crystal-lang.org/) | https://gitlab.com/Zatherz/cray |
| raylib-pas | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/tazdij/raylib-pas |
| raylib-pascal | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/drezgames/raylib-pascal |
| Graphics-Raylib | 1.4 | [Perl](https://www.perl.org/) | https://github.com/athreef/Graphics-Raylib |
| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby |
| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi |
| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby |
| raylib-py-ctbg | 2.6 | [Python](https://www.python.org/) | https://github.com/overdev/raylib-py-ctbg |
| raylib-py | 2.0 | [Python](https://www.python.org/) | https://github.com/overdev/raylib-py |
| raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java |
| clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib |
| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib |
| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape |
| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 |
| raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript |
| raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel |
| racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d |
| raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi |
| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe |
| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib |
| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm |
| raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi |
| raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme |
| Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib |
| raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin |
| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib |
| raylib-vala | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | https://code.guddler.uk/mart/raylibVapi |
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/raylib-jai |
| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments |
| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada |
| jaylib | 3.0 | [Janet](https://janet-lang.org/) | https://github.com/janet-lang/jaylib |
| raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit |
| ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod |
| raylib-mosaic | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | https://github.com/pluckyporcupine/raylib-mosaic |
| raylib-xdpw | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | https://github.com/vtereshkov/raylib-xdpw |
| raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp |
| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb |
| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic |
| raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 |
| raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef |
| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
These are older raylib bindings that are more than 2 versions old or have not been maintained.
| Name | raylib Version | Language |
| ---------------------------------------------------------------------------------- | :------------: | :---------------------------------------------------------------------: |
| [raylib-cppsharp](https://github.com/phxvyper/raylib-cppsharp) | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) |
| [RaylibFS](https://github.com/dallinbeutler/RaylibFS) | 2.5 | [F#](https://fsharp.org) |
| [raylib\*d](https://github.com/Sepheus/raylib_d) | 2.5 | [D](https://dlang.org) |
| [bindbc-raylib](https://github.com/o3o/bindbc-raylib) | 3.0 | [D](https://dlang.org) |
| [go-raylib](https://github.com/chunqian/go-raylib) | 3.5 | [Go](https://golang.org) |
| [raylib-goplus](https://github.com/Lachee/raylib-goplus) | 2.6-dev | [Go](https://golang.org) |
| [ray-go](https://github.com/hecate-tech/ray-go) | 2.6-dev | [Go](https://golang.org) |
| [raylib-luamore](https://github.com/HDPLocust/raylib-luamore) | 3.0 | [Lua](http://www.lua.org) |
| [LuaJIT-Raylib](https://github.com/Bambofy/LuaJIT-Raylib) | 2.6 | [Lua](http://www.lua.org) |
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 2.5 | [Lua](http://www.lua.org) |
| [raylib-lua-ffi](https://github.com/raysan5/raylib/issues/693) | 2.0 | [Lua](http://www.lua.org) |
| [raylib-lua](https://github.com/raysan5/raylib-lua) | 1.7 | [Lua](http://www.lua.org) |
| [raylib-nelua](https://github.com/Andre-LA/raylib-nelua) | 3.0 | [Nelua](https://nelua.io) |
| [raylib-nim](https://github.com/Skrylar/raylib-nim) | 2.0 | [Nim](https://nim-lang.org) |
| [raylib-Nim](https://gitlab.com/define-private-public/raylib-Nim) | 1.7 | [Nim](https://nim-lang.org) |
| [nim-raylib](https://github.com/tomc1998/nim-raylib) | 3.1-dev | [Nim](https://nim-lang.org) |
| [raylib-Forever](https://github.com/Guevara-chan/Raylib-Forever) | auto | [Nim](https://nim-lang.org) |
| [NimraylibNow!](https://github.com/greenfork/nimraylib_now) | 4.2 | [Nim](https://nim-lang.org) |
| [raylib-haskell](https://github.com/DevJac/raylib-haskell) | 2.0 | [Haskell](https://www.haskell.org) |
| [raylib-cr](https://github.com/AregevDev/raylib-cr) | 2.5-dev | [Crystal](https://crystal-lang.org) |
| [raylib.cr](https://github.com/sam0x17/raylib.cr) | 2.0 | [Crystal](https://crystal-lang.org) |
| [cray](https://gitlab.com/Zatherz/cray) | 1.8 | [Crystal](https://crystal-lang.org) |
| [raylib-pas](https://github.com/tazdij/raylib-pas) | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal*(programming*language)) |
| [raylib-pascal](https://github.com/drezgames/raylib-pascal) | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal*(programming*language)) |
| [Graphics-Raylib](https://github.com/athreef/Graphics-Raylib) | 1.4 | [Perl](https://www.perl.org) |
| [raylib-ruby](https://github.com/a0/raylib-ruby) | 2.6 | [Ruby](https://www.ruby-lang.org/en) |
| [raylib-ruby-ffi](https://github.com/D3nX/raylib-ruby-ffi) | 2.0 | [Ruby](https://www.ruby-lang.org/en) |
| [raylib-mruby](https://github.com/lihaochen910/raylib-mruby) | 2.5-dev | [mruby](https://github.com/mruby/mruby) |
| [raylib-java](https://github.com/XoanaIO/raylib-java) | 2.0 | [Java](https://en.wikipedia.org/wiki/Java*(programming_language)) |
| [clj-raylib](https://github.com/lsevero/clj-raylib) | 3.0 | [Clojure](https://clojure.org) |
| [QuickJS-raylib](https://github.com/sntg-p/QuickJS-raylib) | 3.0 | [QuickJS](https://bellard.org/quickjs) |
| [raylib-duktape](https://github.com/RobLoach/raylib-duktape) | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) |
| [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) | 2.6 | [ChaiScript](http://chaiscript.com) |
| [raylib-squirrel](https://github.com/RobLoach/raylib-squirrel) | 2.5 | [Squirrel](http://www.squirrel-lang.org) |
| [racket-raylib-2d](https://github.com/arvyy/racket-raylib-2d) | 2.5 | [Racket](https://racket-lang.org) |
| [raylib-php-ffi](https://github.com/oraoto/raylib-php-ffi) | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) |
| [raylib-haxe](https://github.com/ibilon/raylib-haxe) | 2.4 | [Haxe](https://haxe.org) |
| [ringraylib](https://github.com/ringpackages/ringraylib) | 2.6 | [Ring](http://ring-lang.sourceforge.net) |
| [raylib-scm](https://github.com/yashrk/raylib-scm) | 2.5 | [Chicken Scheme](https://www.call-cc.org) |
| [raylib-chibi](https://github.com/VincentToups/raylib-chibi) | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) |
| [raylib-gambit-scheme](https://github.com/georgjz/raylib-gambit-scheme) | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) |
| [Euraylib](https://github.com/gAndy50/Euraylib) | 3.0 | [Euphoria](https://openeuphoria.org) |
| [raylib-odin](https://github.com/kevinw/raylib-odin) | 3.0 | [Odin](https://odin-lang.org) |
| [vraylib](https://github.com/waotzi/vraylib) | 3.5 | [V](https://vlang.io) |
| [raylib-vala](https://code.guddler.uk/mart/raylibVapi) | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) |
| [raylib-jai](https://github.com/kujukuju/raylib-jai) | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) |
| [ray.zig](https://github.com/BitPuffin/zig-raylib-experiments) | 2.5 | [Zig](https://ziglang.org) |
| [raylib-Ada](https://github.com/mimo/raylib-Ada) | 3.0 | [Ada](https://www.adacore.com/about-ada) |
| [raykit](https://github.com/Gamerfiend/raykit) | **???** | [Kit](https://www.kitlang.org) |
| [ray.mod](https://github.com/bmx-ng/ray.mod) | 3.0 | [BlitzMax](https://blitzmax.org) |
| [raylib-mosaic](https://github.com/pluckyporcupine/raylib-mosaic) | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) |
| [raylib-xdpw](https://github.com/vtereshkov/raylib-xdpw) | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) |
| [raylib-carp](https://github.com/sacredbirdman/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) |
| [raylib-fb](https://github.com/IchMagBier/raylib-fb) | 3.0 | [FreeBasic](https://www.freebasic.net) |
| [raylib-purebasic](https://github.com/D-a-n-i-l-o/raylib-purebasic) | 3.0 | [PureBasic](https://www.purebasic.com) |
| [raylib-ats2](https://github.com/mephistopheles-8/raylib-ats2) | 3.0 | [ATS2](http://www.ats-lang.org) |
| [raylib-beef](https://github.com/M0n7y5/raylib-beef) | 3.0 | [Beef](https://www.beeflang.org) |
| [raylib-never](https://github.com/never-lang/raylib-never) | 3.0 | [Never](https://github.com/never-lang/never) |
| [raylib.cbl](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib) | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) |
Missing some language or wrapper? Feel free to create a new one! :)

905
CHANGELOG
View File

@@ -1,7 +1,898 @@
changelog
---------
Current Release: raylib 4.2.0 (11 August 2022)
Current Release: raylib 5.5 (18 November 2024)
-------------------------------------------------------------------------
Release: raylib 5.5 (18 November 2024)
-------------------------------------------------------------------------
KEY CHANGES:
- New tool: raylib project creator
- New rcore backends: RGFW and SDL3
- New platforms supported: Dreamcast, N64, PSP, PSVita, PS4
- Added GPU Skinning support (all platforms and GL versions)
- Added raymath C++ operators
Detailed changes:
WIP: Last update with commit from 02-Nov-2024
[rcore] ADDED: Working directory info at initialization by @Ray
[rcore] ADDED: `GetClipboardImage()`, supported by multiple backends (#4459) by @evertonse
[rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray
[rcore] ADDED: `ComputeSHA1()` (#4390) by @Anthony Carbajal
[rcore] ADDED: `ComputeCRC32()` and `ComputeMD5()` by @Ray
[rcore] ADDED: `GetKeyName()` (#4161) by @MrScautHD
[rcore] ADDED: `IsFileNameValid()` by @Ray
[rcore] ADDED: `GetViewRay()`, viewport independent raycast (#3709) by @Luís Almeida
[rcore] RENAMED: `GetMouseRay()` to `GetScreenToWorldRay()` (#3830) by @Ray
[rcore] RENAMED: `GetViewRay()` to `GetScreenToWorldRayEx()` (#3830) by @Ray
[rcore] REVIEWED: `GetApplicationDirectory()` for FreeBSD (#4318) by @base
[rcore] REVIEWED: `LoadDirectoryFilesEx()`/`ScanDirectoryFiles()`, support directory on filter (#4302) by @foxblock
[rcore] REVIEWED: Update comments on fullscreen and boderless window to describe what they do (#4280) by @Jeffery Myers
[rcore] REVIEWED: Correct processing of mouse wheel on Automation events #4263 by @Ray
[rcore] REVIEWED: Fix gamepad axis movement and its automation event recording (#4184) by @maxmutant
[rcore] REVIEWED: Do not set RL_TEXTURE_FILTER_LINEAR when high dpi flag is enabled (#4189) by @Dave Green
[rcore] REVIEWED: `GetScreenWidth()`/`GetScreenHeight()` (#4074) by @Anthony Carbajal
[rcore] REVIEWED: Initial window dimensions checks (#3950) by @Christian Haas
[rcore] REVIEWED: Set default init values for random #3954 by @Ray
[rcore] REVIEWED: Window positioning, avoid out-of-screen window-bar by @Ray
[rcore] REVIEWED: Fix framerate recording for .gif (#3894) by @Rob Loach
[rcore] REVIEWED: Screen space related functions consistency (#3830) by @aiafrasinei
[rcore] REVIEWED: `GetFileNameWithoutExt()` (#3771) by @oblerion
[rcore] REVIEWED: `GetWindowScaleDPI()`, simplified (#3701) by @Karl Zylinski
[rcore] REVIEWED: `UnloadAutomationEventList()` (#3658) by @Antonis Geralis
[rcore] REVIEWED: Flip VR screens (#3633) by @Matthew Oros
[rcore] REVIEWED: Remove unused vScreenCenter (#3632) by @Matthew Oros
[rcore] REVIEWED: `LoadRandomSequence()`, issue in sequence generation #3612 by @Ray
[rcore] REVIEWED: `IsMouseButtonUp()` (#3609) by @Kenneth M
[rcore] REVIEWED: Fix typos in src/platforms/rcore_*.c (#3581) by @RadsammyT
[rcore] REVIEWED: `ExportDataAsCode()`, change sanitization check (#3837) by @Laurentino Luna
[rcore] REVIEWED: `ExportDataAsCode()`, add little sanitization to indentifier names (#3832) by @4rk
[rcore] REVIEWED: `GetScreenWidth()`/`GetScreenHeight()` align with all platforms (#4451) by @Arche Washi
[rcore] REVIEWED: `SetGamepadVibration()`, added duration parameter (#4410) by @Asdqwe -WARNING-
[rcore] REVIEWED: `GetGamepadAxisMovement()`, fix #4405 (#4420) by @Asdqwe
[rcore] REVIEWED: `GetGestureHoldDuration()` comments by @Ray
[rcore][rlgl] REVIEWED: Fix scale issues when ending a view mode (#3746) by @Jeffery Myers
[rcore][GLFW] REVIEWED: Keep CORE.Window.position properly in sync with glfw window position (#4190) by @Dave Green
[rcore][GLFW] REVIEWED: Set AUTO_ICONIFY flag to false per default (#4188) by @Dave Green
[rcore][GLFW] REVIEWED: `InitPlatform()`, add workaround for NetBSD (#4139) by @NishiOwO
[rcore][GLFW] REVIEWED: Fix window not initializing on primary monitor (#3923) by @Rafael Bordoni
[rcore][GLFW] REVIEWED: Set relative mouse mode when the cursor is disabled (#3874) by @Jeffery Myers
[rcore][GLFW] REVIEWED: Remove GLFW mouse passthrough hack and increase GLFW version in CMake (#3852) by @Alexandre Almeida
[rcore][GLFW] REVIEWED: Updated GLFW to 3.4 (#3827) by @Alexandre Almeida
[rcore][GLFW] REVIEWED: Feature test macros before include (#3737) by @John
[rcore][GLFW] REVIEWED: Fix inconsistent dll linkage warning on windows (#4447) by @Jeffery Myers
[rcore][Web] ADDED: `SetWindowOpacity()` implementation (#4403) by @Asdqwe
[rcore][Web] ADDED: `MaximizeWindow()` and `RestoreWindow()` implementations (#4397) by @Asdqwe
[rcore][Web] ADDED: `ToggleFullscreen()` implementation (#3634) by @ubkp
[rcore][Web] ADDED: `GetWindowPosition()` implementation (#3637) by @ubkp
[rcore][Web] ADDED: `ToggleBorderlessWindowed()` implementation (#3622) by @ubkp
[rcore][Web] ADDED: `GetMonitorWidth()` and `GetMonitorHeight()` implementations (#3636) by @ubkp
[rcore][Web] REVIEWED: Update `SetWindowState()` and `ClearWindowState()` to handle `FLAG_WINDOW_MAXIMIZED` (#4402) by @Asdqwe
[rcore][Web] REVIEWED: `WindowSizeCallback()`, do not try to handle DPI, already managed by GLFW (#4143) by @SuperUserNameMan
[rcore][Web] REVIEWED: Relative mouse mode issues (#3940) by @Cemal Gönültaş
[rcore][Web] REVIEWED: `ShowCursor()`, `HideCursor()` and `SetMouseCursor()` (#3647) by @ubkp
[rcore][Web] REVIEWED: Fix CORE.Input.Mouse.cursorHidden with callbacks (#3644) by @ubkp
[rcore][Web] REVIEWED: Fix `IsMouseButtonUp()` (#3611) by @ubkp
[rcore][Web] REVIEWED: HighDPI support #3372 by @Ray
[rcore][Web] REVIEWED: `SetWindowSize()` (#4452) by @Asdqwe
[rcore][Web] REVIEWED: `EmscriptenResizeCallback()`, simplified (#4415) by @Asdqwe
[rcore][SDL] ADDED: `IsCursorOnScreen()` (#3862) by @Peter0x44
[rcore][SDL] ADDED: Gamepad rumble/vibration support (#3819) by @GideonSerf
[rcore][SDL] REVIEWED: Gamepad support (#3776) by @A
[rcore][SDL] REVIEWED: `GetWorkingDirectory()`, return correct path (#4392) by @Asdqwe
[rcore][SDL] REVIEWED: `GetClipboardText()`, fix memory leak (#4354) by @Asdqwe
[rcore][SDL] REVIEWED: Change SDL_Joystick to SDL_GameController (#4129) by @Frank Kartheuser
[rcore][SDL] REVIEWED: Update storage base path, use provided SDL base path by @Ray
[rcore][SDL] REVIEWED: Call SDL_GL_SetSwapInterval() after GL context creation (#3997) by @JupiterRider
[rcore][SDL] REVIEWED: `GetKeyPressed()` (#3869) by @Arthur
[rcore][SDL] REVIEWED: Fix SDL multitouch tracking (#3810) by @mooff
[rcore][SDL] REVIEWED: Fix `SUPPORT_WINMM_HIGHRES_TIMER` (#3679) by @ubkp
[rcore][SDL] REVIEWED: SDL text input to Unicode codepoints #3650 by @Ray
[rcore][SDL] REVIEWED: `IsMouseButtonUp()` and add touch events (#3610) by @ubkp
[rcore][SDL] REVIEWED: Fix real touch gestures (#3614) by @ubkp
[rcore][SDL] REVIEWED: `IsKeyPressedRepeat()` (#3605) by @ubkp
[rcore][SDL] REVIEWED: `GetKeyPressed()` and `GetCharPressed()` for SDL (#3604) by @ubkp
[rcore][SDL] REVIEWED: `SetMousePosition()` for SDL (#3580) by @ubkp
[rcore][SDL] REVIEWED: `SetWindowIcon()` for SDL (#3578) by @ubkp
[rcore][SDL][rlgl] REVIEWED: Fix for running gles2 with SDL on desktop (#3542) by @_Tradam
[rcore][Android] REVIEWED: Issue with isGpuReady flag (#4340) by @Menno van der Graaf
[rcore][Android] REVIEWED: Allow main() to return it its caller on configuration changes (#4288) by @Hesham Abourgheba
[rcore][Android] REVIEWED: Replace deprecated Android function ALooper_pollAll with ALooper_pollOnce (#4275) by @Menno van der Graaf
[rcore][Android] REVIEWED: `PollInputEvents()`, register previous gamepad events (#3910) by @Aria
[rcore][Android] REVIEWED: Fix Android keycode translation and duplicate key constants (#3733) by @Alexandre Almeida
[rcore][DRM] ADDED: uConsole keys mapping (#4297) by @carverdamien
[rcore][DRM] ADDED: `GetMonitorWidth/Height()` (#3956) by @gabriel-marques
[rcore][DRM] REVIEWED: `IsMouseButtonUp()` (#3611) by @ubkp
[rcore][DRM] REVIEWED: Optimize gesture handling (#3616) by @ubkp
[rcore][DRM] REVIEWED: `IsKeyPressedRepeat()` for PLATFORM_DRM direct input (#3583) by @ubkp
[rcore][DRM] REVIEWED: Fix gamepad buttons not working in drm backend (#3888) by @MrMugame
[rcore][DRM] REVIEWED: DRM backend to only use one api to allow for more devices (#3879) by @MrMugame
[rcore][DRM] REVIEWED: Avoid separate thread when polling for gamepad events (#3641) by @Cinghy Creations
[rcore][DRM] REVIEWED: Connector status reported as UNKNOWN but should be considered as CONNECTED (#4305) by @Michał Jaskólski
[rcore][RGFW] ADDED: RGFW, new rcore backend platform (#3941) by @Colleague Riley
[rcore][RGFW] REVIEWED: RGFW 1.0 (#4144) by @Colleague Riley
[rcore][RGFW] REVIEWED: Fix errors when compiling with mingw (#4282) by @Colleague Riley
[rcore][RGFW] REVIEWED: Replace long switch with a lookup table (#4108) by @Colleague Riley
[rcore][RGFW] REVIEWED: Fix MSVC build errors (#4441) by @Colleague Riley
[rlgl] ADDED: More uniform data type options #4137 by @Ray
[rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang -WARNING-
[rlgl] ADDED: `rlCullDistance*()` variables and getters (#3912) by @KotzaBoss
[rlgl] ADDED: `rlSetClipPlanes()` function (#3912) by @KotzaBoss
[rlgl] ADDED: `isGpuReady` flag, allow font loading with no GPU acceleration by @Ray -WARNING-
[rlgl] REVIEWED: Changed RLGL_VERSION from 4.5 to 5.0 (#3914) by @Mute
[rlgl] REVIEWED: Shader load failing returns 0, instead of fallback by @Ray -WARNING-
[rlgl] REVIEWED: Standalone mode default flags (#4334) by @Asdqwe
[rlgl] REVIEWED: Fix hardcoded index values in vboID array (#4312) by @Jett
[rlgl] REVIEWED: GLint64 did not exist before OpenGL 3.2 (#4284) by @Tchan0
[rlgl] REVIEWED: Extra warnings in case OpenGL 4.3 is not enabled (#4202) by @Maxim Knyazkin
[rlgl] REVIEWED: Using GLint64 for glGetBufferParameteri64v() (#4197) by @Randy Palamar
[rlgl] REVIEWED: Replace `glGetInteger64v()` with `glGetBufferParameteri64v()` (#4154) by @Kai Kitagawa-Jones
[rlgl] REVIEWED: `rlMultMatrixf()`, fix matrix multiplication order (#3935) by @bohonghuang
[rlgl] REVIEWED: `rlSetVertexAttribute()`, define last parameter as offset #3800 by @Ray
[rlgl] REVIEWED: `rlDisableVertexAttribute()`, remove redundat calls for SHADER_LOC_VERTEX_COLOR (#3871) by @Kacper Zybała
[rlgl] REVIEWED: `rlLoadTextureCubemap()`, load mipmaps for cubemaps (#4429) by @Nikolas
[rlgl] REVIEWED: `rlLoadFramebuffer()`, parameters not required by @Ray
[rlgl] REVIEWED: `rlSetUniformSampler()` (#3759) by @veins1
[rlgl] REVIEWED: Renamed near/far variables (#4039) by @jgabaut
[rlgl] REVIEWED: Expose OpenGL symbols (#3588) by @Peter0x44
[rlgl] REVIEWED: Fix OpenGL 1.1 build issues (#3876) by @Ray
[rlgl] REVIEWED: Fixed compilation for OpenGL ES (#4243) by @Maxim Knyazkin
[rlgl] REVIEWED: rlgl function description and comments by @Ray
[rlgl] REVIEWED: Expose glad functions when building raylib as a shared lib (#3572) by @Peter0x44
[rlgl] REVIEWED: Fix version info in rlgl.h (#3558) by @Steven Schveighoffer
[rlgl] REVIEWED: Use the vertex color to the base shader in GLSL330 (#4431) by @Jeffery Myers
[rcamera] REVIEWED: Make camera movement independant of framerate (#4247) by @hanaxars -WARNING-
[rcamera] REVIEWED: Updated camera speeds with GetFrameTime() (#4362) by @Anthony Carbajal
[rcamera] REVIEWED: `UpdateCamera()`, added CAMERA_CUSTOM check (#3938) by @Tomas Fabrizio Orsi
[rcamera] REVIEWED: Support mouse/keyboard and gamepad coexistence for input (#3579) by @ubkp
[rcamera] REVIEWED: Cleaned away unused macros(#3762) by @Brian E
[rcamera] REVIEWED: Fix for free camera mode (#3603) by @lesleyrs
[rcamera] REVIEWED: `GetCameraRight()` (#3784) by @Danil
[raymath] ADDED: C++ operator overloads for common math function (#4385) by @Jeffery Myers -WARNING-
[raymath] ADDED: Vector4 math functions and Vector2 variants of some Vector3 functions (#3828) by @Bowserinator
[raymath] REVIEWED: Fix MSVC warnings/errors in C++ (#4125) by @Jeffery Myers
[raymath] REVIEWED: Add extern "C" to raymath header for C++ (#3978) by @Jeffery Myers
[raymath] REVIEWED: `QuaternionFromAxisAngle()`, remove redundant axis length calculation (#3900) by @jtainer
[raymath] REVIEWED: `Vector3Perpendicular()`, avoid implicit conversion from float to double (#3799) by @João Foscarini
[raymath] REVIEWED: `MatrixDecompose()`, incorrect output for certain scale and rotations (#4461) by @waveydave
[raymath] REVIEWED: Small code refactor (#3753) by @Idir Carlos Aliane
[rshapes] ADDED: `CheckCollisionCircleLine()` (#4018) by @kai-z99
[rshapes] REVIEWED: Multisegment Bezier splines (#3744) by @Santiago Pelufo
[rshapes] REVIEWED: Expose shapes drawing texture and rectangle (#3677) by @Jeffery Myers
[rshapes] REVIEWED: `DrawLine()` #4075 by @Ray
[rshapes] REVIEWED: `DrawPixel()` drawing by @Ray
[rshapes] REVIEWED: `DrawLine()` to avoid pixel rounding issues #3931 by @Ray
[rshapes] REVIEWED: `DrawRectangleLines()`, considering view matrix for lines "alignment" by @Ray
[rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset (#4261) by @RadsammyT
[rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset when scaling (#3884) by @Ray
[rshapes] REVIEWED: `DrawRectangleLinesEx()`, make sure accounts for square tiles (#4382) by @Jojaby
[rshapes] REVIEWED: `Draw*Gradient()` color parameter names (#4270) by @Paperdomo101
[rshapes] REVIEWED: `DrawGrid()`, remove duplicate color calls (#4148) by @Jeffery Myers
[rshapes] REVIEWED: `DrawSplineLinear()` to `SUPPORT_SPLINE_MITERS` by @Ray
[rshapes] REVIEWED: `DrawSplineLinear()`, implement miters (#3585) by @Toctave
[rshapes] REVIEWED: `CheckCollisionPointRec()` by @Ray
[rshapes] REVIEWED: `CheckCollisionPointCircle()`, new implementation (#4135) by @kai-z99
[rshapes] REVIEWED: `CheckCollisionCircles()`, optimized (#4065) by @kai-z99
[rshapes] REVIEWED: `CheckCollisionPointPoly()` (#3750) by @Antonio Raúl
[rshapes] REVIEWED: `CheckCollisionCircleRec()` (#3584) by @ubkp
[rshapes] REVIEWED: Add more detail to function comment (#4344) by @Jeffery Myers
[rshapes] REVIEWED: Functions that draw point arrays take them as const (#4051) by @Jeffery Myers
[rtextures] ADDED: `ColorIsEqual()` by @Ray
[rtextures] ADDED: `ColorLerp()`, to mix 2 colors together (#4310) by @SusgUY446
[rtextures] ADDED: `LoadImageAnimFromMemory()` (#3681) by @IoIxD
[rtextures] ADDED: `ImageKernelConvolution()` (#3528) by @Karim
[rtextures] ADDED: `ImageFromChannel()` (#4105) by @Bruno Cabral
[rtextures] ADDED: `ImageDrawLineEx()` (#4097) by @Le Juez Victor
[rtextures] ADDED: `ImageDrawTriangle()` (#4094) by @Le Juez Victor
[rtextures] REMOVED: SVG files loading and drawing, moving it to raylib-extras by @Ray -WARNING-
[rtextures] REVIEWED: `LoadImage()`, added support for 3-channel QOI images (#4384) by @R-YaTian
[rtextures] REVIEWED: `LoadImageRaw()` #3926 by @Ray
[rtextures] REVIEWED: `LoadImageColors()`, advance k in loop (#4120) by @Bruno Cabral
[rtextures] REVIEWED: `LoadTextureCubemap()`, added `mipmaps` #3665 by @Ray
[rtextures] REVIEWED: `LoadTextureCubemap()`, assign format to cubemap (#3823) by @Gary M
[rtextures] REVIEWED: `LoadTextureCubemap()`, load mipmaps for cubemaps (#4429) by @Nikolas
[rtextures] REVIEWED: `LoadTextureCubemap()`, avoid dangling re-allocated pointers (#4439) by @Nikolas
[rtextures] REVIEWED: `LoadImageFromScreen()`, fix scaling (#3881) by @proberge-dev
[rtextures] REVIEWED: `LoadImageFromMemory()`, warnings on invalid image data (#4179) by @Jutastre
[rtextures] REVIEWED: `LoadImageAnimFromMemory()`, added security checks (#3924) by @Ray
[rtextures] REVIEWED: `ImageColorTint()` and `ColorTint()`, optimized (#4015) by @Le Juez Victor
[rtextures] REVIEWED: `ImageKernelConvolution()`, formating and warnings by @Ray
[rtextures] REVIEWED: `ImageDrawRectangleRec`, fix bounds check (#3732) by @Blockguy24
[rtextures] REVIEWED: `ImageResizeCanvas()`, implemented fill color (#3720) by @Lieven Petersen
[rtextures] REVIEWED: `ImageDrawRectangleRec()` (#3721) by @Le Juez Victor
[rtextures] REVIEWED: `ImageDraw()`, don't try to blend images without alpha (#4395) by @Nikolas
[rtextures] REVIEWED: `GenImagePerlinNoise()` being stretched (#4276) by @Bugsia
[rtextures] REVIEWED: `GenImageGradientLinear()`, fix some angles (#4462) by @decromo
[rtextures] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 by @Ray
[rtextures] REVIEWED: `ColorToInt()`, fix undefined behaviour (#3996) by @OetkenPurveyorOfCode
[rtextures] REVIEWED: Remove panorama cubemap layout option (#4425) by @Jeffery Myers
[rtextures] REVIEWED: Removed unneeded module check, `rtextures` should not depend on `rtext` by @Ray
[rtextures] REVIEWED: Simplified for loop for some image manipulation functions (#3712) by @Alice Nyaa
[rtext] ADDED: BDF fonts support (#3735) by @Stanley Fuller -WARNING-
[rtext] ADDED: `TextToCamel()` (#4033) by @IoIxD
[rtext] ADDED: `TextToSnake()` (#4033) by @IoIxD
[rtext] ADDED: `TextToFloat()` (#3627) by @Benjamin Schmid Ties
[rtext] REDESIGNED: `SetTextLineSpacing()` by @Ray -WARNING-
[rtext] REVIEWED: `LoadFontDataBDF()` name and formating by @Ray
[rtext] REVIEWED: `LoadFontDefault()`, initialize glyphs and recs to zero #4319 by @Ray
[rtext] REVIEWED: `LoadFontEx()`, avoid default font fallback (#4077) by @Peter0x44 -WARNING-
[rtext] REVIEWED: `LoadBMFont()`, extended functionality (#3536) by @Dongkun Lee
[rtext] REVIEWED: `LoadBMFont()`, issue on not glyph data initialized by @Ray
[rtext] REVIEWED: `LoadFontFromMemory()`, use strncpy() to fix buffer overflow (#3795) by @Mingjie Shen
[rtext] REVIEWED: `LoadCodepoints()` returning a freed ptr when count is 0 (#4089) by @Alice Nyaa
[rtext] REVIEWED: `LoadFontData()` avoid fallback glyphs by @Ray -WARNING-
[rtext] REVIEWED: `LoadFontData()`, load image only if glyph has been found in font by @Ray
[rtext] REVIEWED: `ExportFontAsCode()`, fix C++ compiler errors (#4013) by @DarkAssassin23
[rtext] REVIEWED: `MeasureTextEx()` height calculation (#3770) by @Marrony Neris
[rtext] REVIEWED: `MeasureTextEx()`, additional check for empty input string (#4448) by @mpv-enjoyer
[rtext] REVIEWED: `CodepointToUTF8()`, clean static buffer #4379 by @Ray
[rtext] REVIEWED: `TextToFloat()`, always multiply by sign (#4273) by @listeria
[rtext] REVIEWED: `TextReplace()` const correctness (#3678) by @maverikou
[rtext] REVIEWED: `TextToFloat()`, coding style (#3627) by @Benjamin Schmid Ties
[rtext] REVIEWED: Some comments to align to style (#3756) by @Idir Carlos Aliane
[rtext] REVIEWED: Adjust font atlas area calculation so padding area is not underestimated at small font sizes (#3719) by @Tim Romero
[rmodels] ADDED: GPU skinning support for models animations (#4321) by @Daniel Holden -WARNING-
[rmodels] ADDED: Support 16-bit unsigned short vec4 format for gltf joint loading (#3821) by @Gary M
[rmodels] ADDED: Support animation names for the m3d model format (#3714) by @kolunmi
[rmodels] ADDED: `DrawModelPoints()`, more performant point cloud rendering (#4203) by @Reese Gallagher
[rmodels] ADDED: `ExportMeshAsCode()` by @Ray
[rmodels] REVIEWED: Multiple updates to gltf loading, improved macro (#4373) by @Harald Scheirich
[rmodels] REVIEWED: `LoadOBJ()`, correctly split obj meshes by material (#4285) by @Jeffery Myers
[rmodels] REVIEWED: `LoadOBJ()`, add warning when loading an OBJ with multiple materials (#4271) by @Jeffery Myers
[rmodels] REVIEWED: `LoadOBJ()`, fix bug that fragmented the loaded meshes (#4494) by @Eike Decker
[rmodels] REVIEWED: `LoadIQM()`, set model.meshMaterial[] (#4092) by @SuperUserNameMan
[rmodels] REVIEWED: `LoadIQM()`, attempt to load texture from IQM at loadtime (#4029) by @Jett
[rmodels] REVIEWED: `LoadM3D(), fix vertex colors for m3d files (#3859) by @Jeffery Myers
[rmodels] REVIEWED: `LoadGLTF()`, supporting additional vertex data formats (#3546) by @MrScautHD
[rmodels] REVIEWED: `LoadGLTF()`, correctly handle the node hierarchy in a glTF file (#4037) by @Paul Melis
[rmodels] REVIEWED: `LoadGLTF()`, replaced SQUAD quat interpolation with cubic hermite (gltf 2.0 specs) (#3920) by @Benji
[rmodels] REVIEWED: `LoadGLTF()`, support 2nd texture coordinates loading by @Ray
[rmodels] REVIEWED: `LoadGLTF()`, support additional vertex attributes data formats #3890 by @Ray
[rmodels] REVIEWED: `LoadGLTF()`, set cgltf callbacks to use `LoadFileData()` and `UnloadFileData()` (#3652) by @kolunmi
[rmodels] REVIEWED: `LoadGLTF()`, JOINTS loading #3836 by @Ray
[rmodels] REVIEWED: `LoadImageFromCgltfImage()`, fix base64 padding support (#4112) by @SuperUserNameMan
[rmodels] REVIEWED: `LoadModelAnimationsIQM()`, fix corrupted animation names (#4026) by @Jett
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, load animations with 1 frame (#3804) by @Nikita Blizniuk
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, added missing interpolation types (#3919) by @Benji
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()` (#4107) by @VitoTringolo
[rmodels] REVIEWED: `LoadBoneInfoGLTF()`, add check for animation name being NULL (#4053) by @VitoTringolo
[rmodels] REVIEWED: `GenMeshSphere()`, fix artifacts (#4460) by @MikiZX1
[rmodels] REVIEWED: `GenMeshTangents()`, read uninitialized values, fix bounding case (#4066) by @kai-z99
[rmodels] REVIEWED: `GenMeshTangents()`, fixed out of bounds error (#3990) by @Salvador Galindo
[rmodels] REVIEWED: `UpdateModelAnimation()`, performance speedup (#4470) by @JettMonstersGoBoom
[rmodels] REVIEWED: `DrawCylinder()`, fix drawing due to imprecise angle (#4034) by @Paul Melis
[rmodels] REVIEWED: `DrawCylinder()`, fix drawing of cap (#4478) by @JeffM2501
[rmodels] REVIEWED: `DrawMesh()`, send full matModel to shader in DrawMesh (#4005) (#4022) by @David Holland
[rmodels] REVIEWED: `DrawMesh()`, fix material specular map retrieval (#3758) by @Victor Gallet
[rmodels] REVIEWED: `DrawModelEx()`, simplified multiplication of colors (#4002) by @Le Juez Victor
[rmodels] REVIEWED: `DrawBillboardPro()`, to be consistend with `DrawTexturePro()` (#4132) by @bohonghuang
[rmodels] REVIEWED: `DrawSphereEx()` optimization (#4106) by @smalltimewizard
[raudio] REVIEWED: `LoadMusicStreamFromMemory()`, support 24-bit FLACs (#4279) by @konstruktor227
[raudio] REVIEWED: `LoadWaveSamples()`, fix mapping of wave data (#4062) by @listeria
[raudio] REVIEWED: `LoadMusicStream()`, remove drwav_uninit() (#3986) by @FishingHacks
[raudio] REVIEWED: `LoadMusicStream()` qoa and wav loading (#3966) by @veins1
[raudio] REVIEWED: `ExportWaveAsCode()`, segfault (#3769) by @IoIxD
[raudio] REVIEWED: `WaveCrop()`, fix issues and use frames instead of samples (#3994) by @listeria
[raudio] REVIEWED: Crash from multithreading issues (#3907) by @Christian Haas
[raudio] REVIEWED: Reset music.ctxType if loading wasn't succesful (#3917) by @veins1
[raudio] REVIEWED: Added missing functions in "standalone" mode (#3760) by @Alessandro Nikolaev
[raudio] REVIEWED: Disable unused miniaudio features (#3544) by @Alexandre Almeida
[raudio] REVIEWED: Fix crash when switching playback device at runtime (#4102) by @jkaup
[raudio] REVIEWED: Support 24 bits samples for FLAC format (#4058) by @Alexey Kutepov
[examples] ADDED: `core_random_sequence` (#3846) by @Dalton Overmyer
[examples] ADDED: `core_input_virtual_controls` (#4342) by @oblerion
[examples] ADDED: `shapes_rectangle_advanced `, implementing `DrawRectangleRoundedGradientH()` (#4435) by @Everton Jr.
[examples] ADDED: `models_bone_socket` (#3833) by @iP
[examples] ADDED: `shaders_vertex_displacement` (#4186) by @Alex ZH
[examples] ADDED: `shaders_shadowmap` (#3653) by @TheManTheMythTheGameDev
[examples] REVIEWED: `core_2d_camera_platformer` by @Ray
[examples] REVIEWED: `core_2d_camera_mouse_zoom`, use logarithmic scaling for a 2d zoom functionality (#3977) by @Mike Will
[examples] REVIEWED: `core_input_gamepad_info`, all buttons displayed within the window (#4241) by @Asdqwe
[examples] REVIEWED: `core_input_gamepad_info`, show ps3 controller (#4040) by @Konrad Gutvik Grande
[examples] REVIEWED: `core_input_gamepad`, add drawing for generic gamepad (#4424) by @Asdqwe
[examples] REVIEWED: `core_input_gamepad`, add deadzone handling (#4422) by @Asdqwe
[examples] REVIEWED: `shapes_bouncing_ball` (#4226) by @Anthony Carbajal
[examples] REVIEWED: `shapes_following_eyes` (#3710) by @Hongyu Ouyang
[examples] REVIEWED: `shapes_draw_rectangle_rounded` by @Ray
[examples] REVIEWED: `shapes_draw_ring`, fix other examples (#4211) by @kai-z99
[examples] REVIEWED: `shapes_lines_bezier` by @Ray
[examples] REVIEWED: `textures_image_kernel` #3556 by @Ray
[examples] REVIEWED: `text_input_box` (#4229) by @Anthony Carbajal
[examples] REVIEWED: `text_writing_anim` (#4230) by @Anthony Carbajal
[examples] REVIEWED: `models_billboard` by @Ray
[examples] REVIEWED: `models_cubicmap` by @Ray
[examples] REVIEWED: `models_point_rendering` by @Ray
[examples] REVIEWED: `models_box_collisions` (#4224) by @Anthony Carbajal
[examples] REVIEWED: `models_skybox`, do not use HDR by default (#4115) by @Jeffery Myers
[examples] REVIEWED: `shaders_basic_pbr` (#4225) by @Anthony Carbajal
[examples] REVIEWED: `shaders_palette_switch` by @Ray
[examples] REVIEWED: `shaders_hybrid_render` (#3908) by @Yousif
[examples] REVIEWED: `shaders_lighting_instancing`, fix vertex shader (#4056) by @Karl Zylinski
[examples] REVIEWED: `shaders_raymarching`, add `raymarching.fs` for GLSL120 (#4183) by @CDM15y
[examples] REVIEWED: `shaders_shadowmap`, fix shaders for GLSL 1.20 (#4167) by @CDM15y
[examples] REVIEWED: `shaders_deferred_render` (#3655) by @Jett
[examples] REVIEWED: `shaders_basic_pbr` (#3621) by @devdad
[examples] REVIEWED: `shaders_basic_pbr`, remove dependencies (#3649) by @TheManTheMythTheGameDev
[examples] REVIEWED: `shaders_basic_pbr`, added more comments by @Ray
[examples] REVIEWED: `shaders_gpu_skinning`, to work with OpenGL ES 2.0 #4412 by @Ray
[examples] REVIEWED: `shaders_model_shader`, use free camera (#4428) by @IcyLeave6109
[examples] REVIEWED: `audio_stream_effects` (#3618) by @lipx
[examples] REVIEWED: `audio_raw_stream` (#3624) by @riadbettole
[examples] REVIEWED: `audio_mixed_processor` (#4214) by @Anthony Carbajal
[examples] REVIEWED: `raylib_opengl_interop`, fix building on PLATFORM_DESKTOP_SDL (#3826) by @Peter0x44
[examples] REVIEWED: Update examples missing UnloadTexture() calls (#4234) by @Anthony Carbajal
[examples] REVIEWED: Added GLSL 100 and 120 shaders to lightmap example (#3543) by @Jussi Viitala
[examples] REVIEWED: Set FPS to always 60 in all exampels (#4235) by @Anthony Carbajal
[build] REVIEWED: Makefile by @Ray
[build] REVIEWED: Makefile, fix wrong flag #3593 by @Ray
[build] REVIEWED: Makefile, disable wayland by default (#4369) by @Anthony Carbajal
[build] REVIEWED: Makefile, VSCode, fix to support multiple .c files (#4391) by @Alan Arrecis
[build] REVIEWED: Makefile, fix -Wstringop-truncation warning (#4096) by @Peter0x44
[build] REVIEWED: Makefile, fix issues for RGFW on Linux/macOS (#3969) by @Colleague Riley
[build] REVIEWED: Makefile, update RAYLIB_VERSION (#3901) by @Belllg
[build] REVIEWED: Makefile, use mingw32-make for Windows (#4436) by @Asdqwe
[build] REVIEWED: Makefile, move CUSTOM_CFLAGS for better visibility (#4054) by @Lázaro Albuquerque
[build] REVIEWED: Makefile, update emsdk paths to latest versions by @Ray
[build] REVIEWED: Makefile examples, align /usr/local with /src Makefile (#4286) by @Tchan0
[build] REVIEWED: Makefile examples, added `textures_image_kernel` (#3555) by @Sergey Zapunidi
[build] REVIEWED: Makefile examples (#4209) by @Anthony Carbajal
[build] REVIEWED: Makefile examples, to work on NetBSD (#4438) by @NishiOwO
[build] REVIEWED: Makefile examples, WebGL2 (OpenGL ES 3.0) backend flags #4330 by @Ray
[build] REVIEWED: Makefile examples, web building (#4434) by @Asdqwe
[build] REVIEWED: build.zig, fix various issues around `-Dconfig` (#4398) by @Sage Hane
[build] REVIEWED: build.zig, fix type mismatch (#4383) by @yuval_dev
[build] REVIEWED: build.zig, minor fixes (#4381) by @Sage Hane
[build] REVIEWED: build.zig, fix @src logic and a few things (#4380) by @Sage Hane
[build] REVIEWED: build.zig, improve logic (#4375) by @Sage Hane
[build] REVIEWED: build.zig, issues (#4374) by @William Culver
[build] REVIEWED: build.zig, issues (#4366) by @Visen
[build] REVIEWED: build.zig, support desktop backend change (#4358) by @Nikolas
[build] REVIEWED: build.zig, use zig fmt (#4242) by @freakmangd
[build] REVIEWED: build.zig, check if wayland-scanner is installed (#4217) by @lnc3l0t
[build] REVIEWED: build.zig, override config.h definitions (#4193) by @lnc3l0t
[build] REVIEWED: build.zig, support GLFW platform detection (#4150) by @InventorXtreme
[build] REVIEWED: build.zig, make emscripten build compatible with Zig 0.13.0 (#4121) by @Mike Will
[build] REVIEWED: build.zig, pass the real build.zig file (#4113) by @InKryption
[build] REVIEWED: build.zig, leverage `dependencyFromBuildZig` (#4109) by @InKryption
[build] REVIEWED: build.zig, run examples from their directories (#4063) by @Mike Will
[build] REVIEWED: build.zig, fix raygui build when using addRaygui externally (#4027) by @Viktor Pocedulić
[build] REVIEWED: build.zig, fix emscripten build (#4012) by @Dylan
[build] REVIEWED: build.zig, update to zig 0.12.0dev while keeping 0.11.0 compatibility (#3715) by @freakmangd
[build] REVIEWED: build.zig, drop support for 0.11.0 and use more idiomatic build script code (#3927) by @freakmangd
[build] REVIEWED: build.zig, sdd shared library build option and update to zig 0.12.0-dev.2139 (#3727) by @Andrew Lee
[build] REVIEWED: build.zig, add `opengl_version` option (#3979) by @Alexei Mozaidze
[build] REVIEWED: build.zig, fix local dependency break (#3913) by @freakmangd
[build] REVIEWED: build.zig, fix breaking builds for Zig v0.11.0 (#3896) by @iarkn
[build] REVIEWED: build.zig, update to latest version and simplify (#3905) by @freakmangd
[build] REVIEWED: build.zig, remove all uses of deps/mingw (#3805) by @Peter0x44
[build] REVIEWED: build.zig, fixed illegal instruction crash (#3682) by @WisonYe
[build] REVIEWED: build.zig, fix broken build on #3863 (#3891) by @Nikolas Mauropoulos
[build] REVIEWED: build.zig, improve cross-compilation (#4468) by @deathbeam
[build] REVIEWED: CMake, update to raylib 5.0 (#3623) by @Peter0x44
[build] REVIEWED: CMake, added PLATFORM option for Desktop SDL (#3809) by @mooff
[build] REVIEWED: CMake, fix GRAPHICS_* check (#4359) by @Kacper Zybała
[build] REVIEWED: CMake, examples projects (#4332) by @Ridge3Dproductions
[build] REVIEWED: CMake, fix warnings in projects/CMake/CMakeLists.txt (#4278) by @Peter0x44
[build] REVIEWED: CMake, delete BuildOptions.cmake (#4277) by @Peter0x44
[build] REVIEWED: CMake, update version to 5.0 so libraries are correctly versioned (#3615) by @David Williams
[build] REVIEWED: CMake, improved linkage flags to save 28KB on the final bundle (#4177) by @Lázaro Albuquerque
[build] REVIEWED: CMake, support OpenGL ES3 in `LibraryConfigurations.cmake` (#4079) by @manuel5975p
[build] REVIEWED: CMake, `config.h` fully available to users (#4044) by @Lázaro Albuquerque
[build] REVIEWED: CMake, pass -sFULL_ES3 instead of -sFULL_ES3=1 (#4090) by @manuel5975p
[build] REVIEWED: CMake, SDL build link the glfw dependency (#3860) by @Rob Loach
[build] REVIEWED: CMake, infer CMAKE_MODULE_PATH in super-build (#4042) by @fruzitent
[build] REVIEWED: CMake, remove USE_WAYLAND option (#3851) by @Alexandre Almeida
[build] REVIEWED: CMake, disable SDL rlgl_standalone example (#3861) by @Rob Loach
[build] REVIEWED: CMake, bump version required to avoid deprecated #3639 by @Ray
[build] REVIEWED: CMake, fix examples linking -DPLATFORM=SDL (#3825) by @Peter0x44
[build] REVIEWED: CMake, don't build for wayland by default (#4432) by @Peter0x44
[build] REVIEWED: VS2022, misc improvements by @Ray
[build] REVIEWED: VS2022, fix build warnings (#4095) by @Jeffery Myers
[build] REVIEWED: VS2022, added new examples (#4492) by @Jeffery Myers
[build] REVIEWED: Fix fix-build-paths (#3849) by @Caleb Barger
[build] REVIEWED: Fix build paths (#3835) by @Steve Biedermann
[build] REVIEWED: Fix VSCode sample project for macOS (#3666) by @Tim Romero
[build] REVIEWED: Fix some warnings on web builds and remove some redundant flags (#4069) by @Lázaro Albuquerque
[build] REVIEWED: Fix examples not building with gestures system disabled (#4020) by @Sprix
[build] REVIEWED: Fix GLFW runtime platform detection (#3863) by @Alexandre Almeida
[build] REVIEWED: Fix DRM cross-compile without sysroot (#3839) by @Christian W. Zuckschwerdt
[build] REVIEWED: Fix cmake-built libraylib.a to properly include GLFW's object files (#3598) by @Peter0x44
[build] REVIEWED: Hide unneeded internal symbols when building raylib as an so or dylib (#3573) by @Peter0x44
[build] REVIEWED: Corrected the path of android ndk toolchains for OSX platforms (#3574) by @Emmanuel Méra
[build][CI] ADDED: Automatic update for raylib_api.* (#3692) by @seiren
[build][CI] REVIEWED: Update workflows to use latest actions/upload-artifact by @Ray
[build][CI] REVIEWED: CodeQL minor tweaks to avoid some warnings by @Ray
[build][CI] REVIEWED: Update linux_examples.yml by @Ray
[build][CI] REVIEWED: Update linux.yml by @Ray
[build][CI] REVIEWED: Update webassembly.yml by @Ray
[build][CI] REVIEWED: Update cmake.yml by @Ray
[build][CI] REVIEWED: Update codeql.yml, exclude src/external files by @Ray
[bindings] ADDED: raylib-APL (#4253) by @Brian E
[bindings] ADDED: raylib-bqn, moved rayed-bqn (#4331) by @Brian E
[bindings] ADDED: brainfuck binding (#4169) by @_Tradam
[bindings] ADDED: raylib-zig-bindings (#4004) by @Lionel Briand
[bindings] ADDED: Raylib-CSharp wrapper (#3963) by @MrScautHD
[bindings] ADDED: COBOL binding (#3661) by @glowiak
[bindings] ADDED: raylib-beef binding (#3640) by @Braedon Lewis
[bindings] ADDED: Raylib-CSharp-Vinculum (#3571) by @Danil
[bindings] REVIEWED: Remove broken-link bindings #3899 by @Ray
[bindings] REVIEWED: Updated some versions on BINDINGS.md by @Ray
[bindings] REVIEWED: Removed umaintained repos (#3999) by @Antonis Geralis
[bindings] REDESIGNED: Add binding link to name, instead of separate column (#3995) by @Carmine Pietroluongo
[bindings] UPDATED: h-raylib (#4378) by @Anand Swaroop
[bindings] UPDATED: Raylib.lean, to master version (#4337) by @Daniil Kisel
[bindings] UPDATED: raybit, to latest master (#4311) by @Alex
[bindings] UPDATED: dray binding (#4163) by @red thing
[bindings] UPDATED: Julia (#4068) by @ShalokShalom
[bindings] UPDATED: nim to latest master (#3999) by @Antonis Geralis
[bindings] UPDATED: raylib-rs (#3991) by @IoIxD
[bindings] UPDATED: raylib-zig version (#3902) by @Nikolas
[bindings] UPDATED: raylib-odin (#3868) by @joyousblunder
[bindings] UPDATED: Raylib VAPI (#3829) by @Alex Macafee
[bindings] UPDATED: Raylib-cs (#3774) by @Brandon Baker
[bindings] UPDATED: h-raylib (#3739) by @Anand Swaroop
[bindings] UPDATED: OCaml bindings version (#3730) by @Tobias Mock
[bindings] UPDATED: Raylib.c3 (#3689) by @Kenta
[bindings] UPDATED: ray-cyber to 5.0 (#3654) by @fubark
[bindings] UPDATED: raylib-freebasic binding (#3591) by @WIITD
[bindings] UPDATED: SmallBASIC (#3562) by @Chris Warren-Smith
[bindings] UPDATED: Python raylib-py v5.0.0beta1 (#3557) by @Jorge A. Gomes
[bindings] UPDATED: raylib-d binding (#3561) by @Steven Schveighoffer
[bindings] UPDATED: Janet (#3553) by @Dmitry Matveyev
[bindings] UPDATED: Raylib.nelua (#3552) by @Auz
[bindings] UPDATED: raylib-cpp to 5.0 (#3551) by @Rob Loach
[bindings] UPDATED: Pascal binding (#3548) by @Gunko Vadim
[external] UPDATED: stb_truetype.h to latest version by @Ray
[external] UPDATED: stb_image_resize2.h to latest version by @Ray
[external] UPDATED: stb_image.h to latest version by @Ray
[external] UPDATED: qoa.h to latest version by @Ray
[external] UPDATED: dr_wav.h to latest version by @Ray
[external] UPDATED: dr_mp3.h to latest version by @Ray
[external] UPDATED: cgltf.h to latest version by @Ray
[external] REVIEWED: rl_gputex, correctly load mipmaps from DDS files (#4399) by @Nikolas
[external] REVIEWED: stb_image_resize2, dix vld1q_f16 undeclared in arm (#4309) by @masnm
[external] REVIEWED: miniaudio, fix library and Makefile for NetBSD (#4212) by @NishiOwO
[external] REVIEWED: raygui, update to latest version 4.5-dev (#4238) by @Anthony Carbajal
[external] REVIEWED: jar_xml, replace unicode characters by ascii characters to avoid warning in MSVC (#4196) by @Rico P
[external] REVIEWED: vox_loader, normals and new voxels shader (#3843) by @johann nadalutti
[parser] REVIEWED: README.md, to mirror fixed help text (#4336) by @Daniil Kisel
[parser] REVIEWED: Fix seg fault with long comment lines (#4306) by @Chris Warren-Smith
[parser] REVIEWED: Don't crash for files that don't end in newlines (#3981) by @Peter0x44
[parser] REVIEWED: Issues in usage example help text (#4084) by @Peter0x44
[parser] REVIEWED: Fix parsing of empty parentheses (#3974) by @Filyus
[parser] REVIEWED: Address parsing issue when generating XML #3893 by @Ray
[parser] REVIEWED: `MemoryCopy()`, prevent buffer overflow by replacing hard-coded arguments (#4011) by @avx0
[misc] ADDED: Create logo/raylib.icns by @Ray
[misc] ADDED: Create logo/raylib_1024x1024.png by @Ray
[misc] ADDED: Default vertex/fragment shader for OpenGL ES 3.0 (#4178) by @Lázaro Albuquerque
[misc] REVIEWED: README.md, fix Reddit badge (#4136) by @Ninad Sachania
[misc] REVIEWED: .gitignore, ignore compiled dll binaries (#3628) by @2Bear
[misc] REVIEWED: Fix undesired scrollbars on web shell files (#4104) by @jspast
[misc] REVIEWED: Made comments on raylib.h match comments in rcamera.h (#3942) by @Tomas Fabrizio Orsi
[misc] REVIEWED: Make raylib/raygui work better on touchscreen (#3728) by @Hongyu Ouyang
[misc] REVIEWED: Update config.h by @Ray
-------------------------------------------------------------------------
Release: raylib 5.0 - 10th Anniversary Edition (18 November 2023)
-------------------------------------------------------------------------
KEY CHANGES:
- REDESIGNED: rcore module platform-split, by @ubkp, @michaelfiber, @Bigfoot71, @raysan5
- ADDED: New platform backend supported: SDL
- ADDED: New platform backend supported: Nintendo Switch (closed source)
- ADDED: New Splines drawing and evaluation API
- ADDED: New pseudo-random numbers generator: rprand
- ADDED: Automation Events System API
- UPDATED: raygui 4.0: New version of this immediate-mode gui system for tools development with raylib
Detailed changes:
[rcore] ADDED: RAYLIB_VERSION_* values to raylib.h (#2856) by @RobLoach
[rcore] ADDED: IsKeyPressedRepeat() on PLATFORM_DESKTOP (#3245) by @actondev
[rcore] ADDED: SetWindowTitle() for PLATFORM_WEB (#3222) by @VitusVeit
[rcore] ADDED: FLAG_WINDOW_RESIZABLE for web (#3305) by @Peter0x44
[rcore] ADDED: SetWindowMaxSize() for desktop and web (#3309) by @ubkp
[rcore] ADDED: SetMouseCursor() for PLATFORM_WEB (#3414) by @BeardedBread
[rcore] ADDED: LoadRandomSequence()/UnloadRandomSequence() by @raysan5
[rcore] REMOVED: PLATFORM_RPI (#3232) by @michaelfiber
[rcore] REVIEWED: GetFileLength(), added comment (#3262) by @raysan5
[rcore] REVIEWED: Default shaders precission issue on PLATFORM_WEB (#3261) by @branc116
[rcore] REVIEWED: IsKey*() key validation checks (#3256) by @n77y
[rcore] REVIEWED: SetClipboardText() for PLATFORM_WEB (#3257) by @ubkp
[rcore] REVIEWED: Check if Ctrl modifier is among the currently set modifiers (#3230) by @mohad12211
[rcore] REVIEWED: Android app black screen when reopening by @Bigfoot71
[rcore] REVIEWED: Warnings when casting int to floats (#3218) by @JeffM2501
[rcore] REVIEWED: GetCurrentMonitor() detection inconsistency issue (#3215) by @ubkp
[rcore] REVIEWED: SetWindowMonitor() to no longer force fullscreen (#3209) by @ubkp
[rcore] REVIEWED: Fix mouse wheel not working in PLATFORM_RPI or PLATFORM_DRM (#3193) by @ubkp
[rcore] REVIEWED: GetMonitorName() description (#3184) (#3189) by @danilwhale
[rcore] REVIEWED: BeginScissorMode(), identify rendering to texture (#3510) by @gulrak
[rcore] REVIEWED: Window flags order (#3114) by @lesleyrs
[rcore] REVIEWED: Full movement for right analog stick (#3095) by @PixelPhobicGames
[rcore] REVIEWED: Fix Android app freeze after calling CloseWindow() (#3067) by @Bigfoot71
[rcore] REVIEWED: Lazy loading of default font used on image drawing (no InitWindow) by @raysan5
[rcore] REVIEWED: Minor tweaks to raylib events automation system @raysan5
[rcore] REVIEWED: GetCurrentMonitor() bugfix (#3058) by @hamyyy
[rcore] REVIEWED: Update CORE.Input.Touch.pointCount (#3024) by @raysan5
[rcore] REVIEWED: Mouse offset and scaling must be considered also on web!
[rcore] REVIEWED: CompressData(), possible stack overflow
[rcore] REVIEWED: GetWorldToScreenEx() (#3351) by @Brian-ED
[rcore] REVIEWED: Fix GetMouseDelta() issue for Android (#3404) by @Bigfoot71
[rcore] REVIEWED: GetFPS(), reset FPS averages when window is inited (#3445) by @JeffM2501
[rcore] REVIEWED: GetCurrentMonitor(), check window center position by @M374LX
[rcore] REVIEWED: GetRender*() issue on macOS highDPI (#3367) by @raysan5
[rcore] REVIEWED: ScanDirectoryFiles*(), paths building slashes sides (#3507)
[rlgl] ADDED: Experimental support for OpenGL ES 3.0 by @raysan5
[rlgl] ADDED: Support 16-Bit HDR textures (#3220) by @Not-Nik
[rlgl] ADDED: rlEnablePointMode() (#3490) by @JettMonstersGoBoom
[rlgl] ADDED: rlBlitFramebuffer(), required for deferred render
[rlgl] REVIEWED: LoadModel(), removed cube fallback mechanism (#3459)
[rlgl] REVIEWED: Improved support for ES3/WebGL2 (#3107) by @chemaguerra
[rlgl] REVIEWED: OpenGL 2.1 half floats support as part of an extension by @Not-Nik
[rlgl] REVIEWED: Avoid shader attribute not found log by @raysan5
[rlgl] REVIEWED: Avoid tracelog about not found uniforms (#3003) by @raysan5
[rlgl] REVIEWED: rLoadTexture() UBSAN complaints #1891 (#3321) by @Codom
[rlgl] REVIEWED: glInternalFormat as unsigned int
[rlgl] REVIEWED: OpenGL ES 3.0 support
[rshapes] ADDED: Spline drawing functions by @raysan5
[rshapes] ADDED: GetSplinePoint*() functions for spline evaluation by @raysan5
[rshapes] ADDED: DrawCircleLinesV() for consistency (#3452) by @Peter0x44
[rshapes] REVIEWED: DrawSplineCatmullRom() by @raysan5
[rshapes] REVIEWED: Minor fix in DrawLineBezier* (#3006) by @eternalStudent
[rshapes] REVIEWED: GetCollisionRec(), more performant (#3052) by @manuel5975p
[rshapes] REVIEWED: Fix off-by-one error in CheckCollisionPointRec() (#3022) by @dbechrd
[rtextures] ADDED: Basic SVG loading support (#2738) by @bXi
[rtextures] ADDED: Support 16-Bit HDR textures (#3220) by @Not-Nik
[rtextures] ADDED: ExportImageToMemory() by @raysan5
[rtextures] ADDED: ImageRotate() (#3078) by @danemadsen
[rtextures] ADDED: GenImageGradientSquare() (#3077) by @danemadsen
[rtextures] ADDED: GenImageLinearGradient() by @danemadsen
[rtextures] REMOVED: GenImageGradientH() and GenImageGradientV() by @danemadsen
[rtextures] REVIEWED: LoadImageSvg() by @raysan5
[rtextures] REVIEWED: Uninitialized thread-locals in stbi (#3282) (#3283) by @jbarthelmes
[rtextures] REVIEWED: ImageDrawRectangleRec(), validate drawing inside bounds by @JeffM2501
[rtextures] REVIEWED: LoadTextureCubemap() for manual layouts (#3204) by @Not-Nik
[rtextures] REVIEWED: Optimization of ImageDrawRectangleRec() (#3185) by @smalltimewizard
[rtextures] REVIEWED: ImageRotate() formatting by @raysan5
[rtextures] REVIEWED: GenImagePerlinNoise(), clamp values (#3071) by @raysan5
[rtextures] REVIEWED: Packing logic error in GenImageFontAtlas() (#2979) by @hanaxar
[rtextures] REVIEWED: Calculate exact image size in GenImageFontAtlas() (#2963) by @hanaxar
[rtextures] REVIEWED: ImageDrawRectangleRec() (#3027) by @raysan5
[rtextures] REVIEWED: ImageDraw() source clipping when drawing beyond top left (#3306) by @RobLoach
[rtextures] REVIEWED: UnloadRenderTexture(), additional checks
[rtextures] REVIEWED: Fixed compressed DDS texture loading issues (#3483) by @JaanDev
[rtext] ADDED: Font altas white rectangle and flag SUPPORT_FONT_ATLAS_WHITE_REC by @raysan5
[rtext] ADDED: SetTextLineSpacing() to define line breaks text drawing spacing by @raysan5
[rtext] RENAMED: LoadFont*() parameter names for consistency and coherence by @raysan5
[rtext] REVIEWED: GetCodepointCount(), ignore unused return value of GetCodepointNext by @ashn-dot-dev
[rtext] REVIEWED: TextFormat() warn user if buffer overflow occured (#3399) by @Murlocohol
[rtext] REVIEWED: TextFormat(), added "..." for truncation (#3366) by @raysan5
[rtext] REVIEWED: GetGlyphIndex() (#3000) by @raysan5
[rtext] REVIEWED: GetCodepointNext() to return default value by @chocolate42
[rtext] REVIEWED: TextToPascal() issue when first char is uppercase
[rmodels] ADDED: ModelAnimation.name field, initially with GLTF animation names by @alfredbaudisch
[rmodels] REDESIGNED: LoadOBJ(), avoid mesh splitting by materials, fix (#3398) by @raysan5
[rmodels] REVIEWED: Support .vox model files version 200 (#3097) by @Bigfoot71
[rmodels] REVIEWED: Materials loading (#3126) @raysan5
[rmodels] REVIEWED: DrawBillboardPro() to allow source of negative size (#3197) by @bohonghuang
[rmodels] REVIEWED: glTF loading segfault in animNormals memcpy by @charles-l
[rmodels] REVIEWED: LoadModelAnimationsGLTF(), free fileData after use (#3065) by @crynux
[rmodels] REVIEWED: GenMeshCubicmap(), correction of values (#3032) by @Bigfoot71
[rmodels] REVIEWED: DrawMesh() to avoid UBSAN complaining (#1891)
[rmodels] REVIEWED: GenMeshPlane() when resX != resZ (#3425) by @neyrox, @s-yablonskiy
[rmodels] REVIEWED: GetModelBoundingBox() (#3485)
[raudio] ADDED: LoadSoundAlias() by @JeffM2501
[raudio] ADDED: Missing structure on standalone mode (#3160) by @raysan5
[raudio] ADDED: GetMasterVolume() (#3434) by @rexim
[raudio] REVIEWED: Comments about sample format to AttachAudioStreamProcessor() (#3188) by @AlbertoGP
[raudio] REVIEWED: Documented buffer format for audio processors (#3186) by @AlbertoGP
[raudio] REVIEWED: ExportWaveAsCode() file saving by @RadsammyT
[raudio] REVIEWED: Fix warning on discarded const qualifier (#2967) by @RobLoach
[raudio] REVIEWED: Move mutex initialization before ma_device_start() (#3325) by @Bigfoot71
[raudio] REVIEWED: Fix UpdateSound() parameter name (#3405) by @KislyjKisel
[raudio] REVIEWED: Fix QOA seeking (#3494) by @veins1
[rcamera] REVIEWED: File-macros for consistency (#3161) by @raysan5
[rcamera] REVIEWED: Support analog stick camera controls (#3066) by @PixelPhobicGames
[rcamera] REVIEWED: CameraMoveToTarget(), ensure distance is greater than 0 (#3031) by @kolunmi
[rcamera] REVIEWED: Exposing rcamera functions to the dll (#3355) by @JeffM2501
[raymath] ADDED: Vector3Projection() and Vector3Rejection() (#3263) by @Dial0
[raymath] ADDED: EPSILON macro to each function requiring it (#3330) by @Brian-ED
[raymath] REVIEWED: Usage of 'sinf()' and 'cosf()' to be correct (#3181) by @RokasPuzonas
[raymath] REVIEWED: Slightly optimized Vector3Normalize() (#2982) by @RicoP
[raymath] REVIEWED: Comment to clarify raymath semantics by @raysan5
[raymath] REVIEWED: Comment about Matrix conventions by @raysan5
[raymath] REVIEWED: Vector2Angle() and Vector2LineAngle() (#3396) by @Murlocohol
[rgestures] REVIEWED: Optimize and simplify the gesture system (#3190) by @ubkp
[rgestures] REVIEWED: GESTURE_DRAG and GESTURE_SWIPE_* issues (mostly) for web (#3183) by @ubkp
[rgestures] REVIEWED: Touch pointCount for web (#3163) by @ubkp
[rgestures] REVIEWED: IsGestureDetected() parameter type
[utils] ADDED: Security checks to file reading (memory allocations) by @raysan5
[utils] REVIEWED: LoadFileData() potential issues with dataSize
[examples] ADDED: shaders_lightmap (#3043) by @nullstare
[examples] ADDED: core_2d_camera_split_screen (#3298) by @gabrielssanches
[examples] ADDED: LoadSoundAlias() usage example (#3223) by @JeffM2501
[examples] ADDED: textures_tiling (#3353) by @luis605
[examples] ADDED: shader_deferred_render (#3496) by @27justin
[examples] RENAMED: 2d_camera examples for consistency
[examples] REVIEWED: Text examples SetTextLineSpacing() to multiline examples by @raysan5
[examples] REVIEWED: examples/shapes/shapes_collision_area.c help instructions (#3279) by @asdqwe
[examples] REVIEWED: examples/shaders/shaders_texture_outline.c help instructions (#3278) by @asdqwe
[examples] REVIEWED: examples/others/easings_testbed.c help instructions and small twe… by @asdqwe
[examples] REVIEWED: example/audio/audio_module_player.c help instructions and small b… by @asdqwe
[examples] REVIEWED: example/models/models_loading_m3d.c controls (#3269) by @asdqwe
[examples] REVIEWED: example/models/models_loading_gltf.c controls (#3268) by @asdqwe
[examples] REVIEWED: text_unicode.c example crashing (#3250) by @ubkp
[examples] REVIEWED: rlgl_standalone.c compilation issue (#3242) by @ubkp
[examples] REVIEWED: core_input_gestures for Web (#3172) by @ubkp
[examples] REVIEWED: core_input_gamepad (#3110) by @iacore
[examples] REVIEWED: examples using raygui to raygui 4.0 by @raysan5
[examples] REVIEWED: Julia set shader example (#3467) by @joshcol9232
[build] ADDED: CMake option for SUPPORT_CUSTOM_FRAME_CONTROL (#3221) by @ubkp
[build] ADDED: New BORDERLESS_WINDOWED_MODE for PLATFORM_DESKTOP (#3216) by @ubkp
[build] ADDED: New examples to VS2022 solution by @raysan5
[build] REVIEWED: Updated Makefile and Makefile.Web, include new examples
[build] REVIEWED: Fix CMake extraneous -lglfw (#3266) by @iacore
[build] REVIEWED: Add missing cmake options (#3267) by @asdqwe
[build] REVIEWED: Match CMakeOptions.txt options default values (#3258) by @asdqwe
[build] REVIEWED: Add build.zig options for individual modules (#3254) by @actondev
[build] REVIEWED: build.zig to work with cross-compiling (#3225) by @yujiri8
[build] REVIEWED: Makefile build on PLATFORM_ANDROID, soname (#3211) by @ndytts
[build] REVIEWED: src/Makefile, fix misleading indentation (#3202) by @ashn-dot-dev
[build] REVIEWED: build.zig: Support for building with PLAFORM_DRM (#3191) by @jakubvf
[build] REVIEWED: Update CMakeOptions.txt by @raysan5
[build] REVIEWED: fix: cmake option "OPENGL_VERSION" doesn't work (#3170) by @royqh1979
[build] REVIEWED: Add error if raylib.h is included in a C++98 program (#3093) by @Peter0x44
[build] REVIEWED: Cross compilation for PLATFORM_DRM (#3091) by @TheLastBilly
[build] REVIEWED: build.zigm fixed cross-compiling from Linux (#3090)by @yujiri8
[build] REVIEWED: Enhanced cmake part for OpenBSD (#3086) by @rayit
[build] REVIEWED: Fixed compile on OpenBSD (#3085)by @rayit
[build] REVIEWED: CMake project example: fix a couple of typos (#3014) by @benjamin-thomas
[build] REVIEWED: Fix warnings in raylib for MSVC (#3004) by @JeffM2501
[build] REVIEWED: Update cmake example project (#3062) by @lesleyrs
[build] REVIEWED: Update build.zig be be able to build with current zig master (#3064) by @ryupold
[build] REVIEWED: VSCode project template (#3048) by @Shoozza
[build] REVIEWED: Fixed broken build.zig files. Now works with latest stable compiler (… by @Gamer-Kold
[build] REVIEWED: Fix missing symbol when rglfw.c on BSD platforms (#2968) by @Koromix
[build] REVIEWED: Update Makefile comment to indicate arm64 as a supported Linux deskto… @ashn-dot-dev
[build] REVIEWED: Update Makefile : clean raygui.c & physac.c (#3296) by @SuperUserNameMan
[build] REVIEWED: Update webassembly.yml and linux.yml
[build] REVIEWED: Update zig build system to zig version 0.11.0 (#3393) by @purple4pur
[build] REVIEWED: Fix for latest zig master (#3037) by @star-tek-mb
[build] REVIEWED: Examples Makefile to use Makefile.Web when building for web (#3449) by @keithstellyes
[build] REVIEWED: build.zig updates for 0.11.0 release. (#3501) by @cabarger
[build] REVIEWED: Support OpenGL ES 3.0 building on Web platform
[build] REVIEWED: Fix warnings in Visual Studio (#3512) by @JeffM2501
[build] REVIEWED: OpenGL ES 3.0 flags on CMakeOptions (#3514) by @awfulcooking
[bindings] ADDED: fortran-raylib
[bindings] ADDED: raylib-raku to bindings (#3299) by @vushu
[bindings] ADDED: claw-raylib to BINDINGS.md (#3310) by @bohonghuang
[bindings] ADDED: vaiorabbit/raylib-bindings (#3318) by @wilsonsilva
[bindings] ADDED: TurboRaylib (#3317) by @turborium
[bindings] ADDED: raylib-ffi to bindings list (#3164) by @ewpratten
[bindings] ADDED: raylib-pkpy-bindings (#3361) by @blueloveTH
[bindings] ADDED: Raylib.lean to BINDINGS.md (#3409) by @KislyjKisel
[bindings] UPDATED: BINDINGS.md (#3217) by @joseph-montanez
[bindings] UPDATED: BINDINGS.md to include rayjs (#3212) by @mode777
[bindings] UPDATED: latest h-raylib version (#3166) by @Anut-py
[bindings] UPDATED: bindbd-raylib3 to raylib 4.5 (#3157) by @o3o
[bindings] UPDATED: Janet bindings supported version update (#3083)by @archydragon
[bindings] UPDATED: BINDINGS.md (raylib-py -> 4.5) (#2992) by @overdev
[bindings] UPDATED: BINDINGS.md (raylib-lua -> 4.5) (#2989) by @TSnake41
[bindings] UPDATED: raylib-d binding version to 4.5 (#2988) by @schveiguy
[bindings] UPDATED: raylib-freebasic to 4.5 (#2986) by @WIITD
[bindings] UPDATED: BINDINGS.md (#2983) by @jarroddavis68
[bindings] UPDATED: BINDINGS.md for raylib Odin 4.5 (#2981) by @gingerBill
[bindings] UPDATED: BINDINGS.md (#2980) by @GuvaCode
[bindings] UPDATED: BINDINGS.md (#3002) by @fubark
[bindings] UPDATED: BINDINGS.md (#3053) by @JupiterRider
[bindings] UPDATED: BINDINGS.md (#3050) by @Its-Kenta
[bindings] UPDATED: CL bindings version (#3049) by @shelvick
[bindings] UPDATED: BINDINGS.md (#3026) by @ChrisDill
[bindings] UPDATED: BINDINGS.md (#3023) by @sDos280
[bindings] UPDATED: BINDINGS.md (#3017) by @Soutaisei
[bindings] UPDATED: Various versions to 4.5 (#2974) by @RobLoach
[bindings] UPDATED: raylib.zig version to 4.5 (#2971) by @ryupold
[bindings] UPDATED: h-raylib version (#2970) by @Anut-py
[bindings] UPDATED: Factor's raylib binding to v4.5 (#3350) by @WraithGlade
[bindings] UPDATED: raylib-ocaml bindings to 4.5 version (#3322) by @tjammer
[bindings] UPDATED: Jaylib binding (#3508) by @glowiak
[external] UPDATED: sdefl and sinfl DEFLATE compression libraries by @raysan5
[external] UPDATED: miniaudio v0.11.12 --> v0.11.19 by @raysan5
[external] UPDATED: rl_gputex.h compressed images loading library by @raysan5
[external] UPDATED: Replaced stb_image_resize.c by stb_image_resize2.h (#3403) by @BabakSamimi
[external] UPDATED: qoi and qoa libraries
[external] UPDATED: stb libraries (required ones)
[external] UPDATED: cgltf and m3d libraries
[external] REVIEWED: msf_gif.h, some warnings
[external] REVIEWED: sinfl external library to avoid ASAN complaints (#3349) by @raysan5
[misc] ADDED: New task point to issue template about checking the wiki (#3169) by @ubkp
[misc] ADDED: CodeQL for static code analysis (#3476) by @b4yuan
[misc] REVIEWED: Update FAQ.md by @raysan5
[misc] REVIEWED: Potential code issues reported by CodeQL (#3476)
[misc] REVIEWED: Fix a link in the FAQ (#3082)by @jasonliang-dev
[misc] REVIEWED: New file formats to FAQ (#3079) by @Luramoth
[misc] REVIEWED: Make assets loading extension case insensitive #3008 by @raysan5
[misc] REVIEWED: Updated web shells open-graph info by @raysan5
-------------------------------------------------------------------------
Release: raylib 4.5 (18 March 2023)
-------------------------------------------------------------------------
KEY CHANGES:
- ADDED: Improved ANGLE support on Desktop platforms
- ADDED: rcamera module, simpler and more extendable
- ADDED: Support for M3D models and M3D/GLTF animations
- ADDED: Support QOA audio format (import/export)
- ADDED: rl_gputex module for compressed textures loading
- REDESIGNED: rlgl module for automatic render-batch limits checking
- REDESIGNED: rshapes module to minimize the rlgl dependency
Detailed changes:
[core] ADDED: RAYLIB_VERSION_* values to raylib.h (#2856) by @RobLoach
[core] ADDED: Basic gamepad support for Android (#2709) by @deniska
[core] ADDED: Support CAPS/NUM lock keys registering if locked
[core] ADDED: _GNU_SOURCE define on Linux (#2729)
[core] ADDED: SetWindowIcons() to set multiple icon image sizes
[core] `WARNING`: RENAMED: Exported raylib version symbol to raylib_version #2671
[core] REMOVED: Touch points on touch up events on Android (#2711) by @deniska
[core] REVIEWED: Window position setup on InitWindow() (#2732) by @RandomErrorMessage
[core] REVIEWED: Touchscreen input related functions on Android (#2702) by @deniska
[core] REVIEWED: Viewport scaling on Android after context rebind (#2703) by @deniska
[core] REVIEWED: ScanDirectoryFilesRecursively() (#2704)
[core] REVIEWED: Gamepad mappings with latest gamecontrollerdb (#2725)
[core] REVIEWED: Monitor order check on app initialization
[core] REVIEWED: Application monitor when opening (#2728, #2731) by @RandomErrorMessage
[core] REVIEWED: Gestures module to use GetTime() if available (#2733) by @RobLoach
[core] REVIEWED: Resolve GLFW3 some symbols re-definition of windows.h in glfw3native (#2643) by @daipom
[core] REVIEWED: OpenURL(), string buffer too short sometimes
[core] REVIEWED: GetRandomValue() range limit warning (#2800) by @Pere001
[core] REVIEWED: UnloadDirectoryFiles()
[core] REVIEWED: GetKeyPressed(), out of range issue (#2814) by @daipom
[core] REVIEWED: GetTime(), renamed variable 'time' to 'nanoSeconds' (#2816) by @jtainer
[core] REVIEWED: LoadShaderFromMemory(), issue with shader linkage
[core] REVIEWED: Avoid possible gamepad index as -1 (#2839)
[core] REVIEWED: SetShaderValue*(), avoid setup uniforms for invalid locations
[core] REVIEWED: GetClipboardText() on PLATFORM_WEB, permissions issues
[core] REVIEWED: Initial window position for display-sized fullscreen (#2742) by @daipom
[core] REVIEWED: Sticky touches input (#2857) by @ImazighenGhost
[core] REVIEWED: Enable GetWindowHandle() on macOS (#2915) by @Not-Nik
[core] REVIEWED: Window position always inits centered in current monitor
[core] REVIEWED: IsWindowFocused() to consider Android App state (#2935)
[core] REVIEWED: GetMonitorWidth() and GetMonitorHeight() (#2934)
[core] REVIEWED: GetWindowHandle() to return Linux window (#2938)
[core] REVIEWED: WindowDropCallback(), additional security check (#2943)
[core] REVIEWED: Security checks for emscripten_run_script() (#2954)
[utils] REVIEWED: TraceLog() message size limit overflow
[rcamera] REDESIGNED: New implementation from scratch (#2563) by @Crydsch
[rcamera] REVIEWED: Make orbital camera work as expected (#2926) by @JeffM2501
[rcamera] REVIEWED: Multiple reviews on the new implementation
[rcamera] ADDED: UpdateCameraPro(), supporting custom user inputs
[rlgl] ADDED: OpenGL ES 2.0 support on PLATFORM_DESKTOP (#2840) by @wtnbgo
[rlgl] ADDED: Separate blending modes for color and alpha, BLEND_CUSTOM_SEPARATE (#2741)
[rlgl] ADDED: rlSetBlendFactorsSeparate and custom blend mode modification checks (#2741) by @pure01fx
[rlgl] ADDED: RL_TEXTURE_MIPMAP_BIAS_RATIO support to `rlTextureParameters()` for OpenGL 3.3 #2674
[rlgl] ADDED: rlCubemapParameters() (#2862) by @GithubPrankster
[rlgl] ADDED: rlSetCullFace() (#2797) by @jtainer
[rlgl] REMOVED: Mipmaps software generation for OpenGL 1.1
[rlgl] REVIEWED: Check for extensions before enabling them (#2706) by @Not-Nik
[rlgl] REVIEWED: SSBO usage to avoid long long data types
[rlgl] REVIEWED: Enable DXT compression on __APPLE__ targets (#2694) by @Not-Nik
[rlgl] REVIEWED: enums exposed and description comments
[rlgl] REVIEWED: rlBindImageTexture(), correct data types (#2808) by @planetis-m
[rlgl] REVIEWED: rlMultMatrixf(), use const pointer (#2807) by @planetis-m
[rlgl] REVIEWED: Expose OpenGL blending mode factors and functions/equations
[rlgl] REVIEWED: rLoadTextureDepth(), issue with depth textures on WebGL (#2824)
[rlgl] REVIEWED: rlUnloadFramebuffer() (#2937)
[raymath] ADDED: Vector2LineAngle() (#2887)
[raymath] REVIEWED: Vector2Angle() (#2829, #2832) by @AlxHnr, @planetis-m
[shapes] ADDED: CheckCollisionPointPoly() (#2685) by @acejacek
[shapes] REVIEWED: DrawPixel*(), use RL_QUADS/RL_TRIANGLES (#2750) by @hatkidchan
[shapes] REVIEWED: DrawLineBezier*(), fix bezier line breaking (#2735, #2767) by @nobytesgiven
[textures] ADDED: ColorBrightness()
[textures] ADDED: ColorTint()
[textures] ADDED: ColorContrast()
[textures] ADDED: Support for PNM images (.ppm, .pgm)
[textures] ADDED: GenImagePerlinNoise()
[textures] ADDED: GenImageText(), generate grayscale image from text byte data
[textures] ADDED: ImageDrawCircleLines(), ImageDrawCircleLinesV() (#2713) by @RobLoach
[textures] ADDED: ImageBlurGaussian() (#2770) by @nobytesgiven
[textures] REVIEWED: Image fileformat support: PIC, PNM
[textures] REVIEWED: ImageTextEx() and ImageDrawTextEx() scaling (#2756) by @hatkidchan
[textures] `WARNING`: REMOVED: DrawTextureQuad()
[textures] `WARNING`: REMOVED: DrawTexturePoly(), function moved to example: `textures_polygon`
[textures] `WARNING`: REMOVED: DrawTextureTiled(),function implementation moved to the textures_tiled.c
[text] ADDED: GetCodepointPrevious()
[text] ADDED: UnloadUTF8(), aligned with LoadUTF8()
[text] `WARNING`: RENAMED: TextCodepointsToUTF8() to LoadUTF8()
[text] `WARNING`: RENAMED: GetCodepoint() -> GetCodepointNext()
[text] REDESIGNED: GetCodepointNext()
[text] REVIEWED: MeasureTextEx(), avoid crash on bad data
[text] REVIEWED: UnloadFontData(), avoid crash on invalid font data
[models] ADDED: Support M3D model file format (meshes and materials) (#2648) by @bztsrc
[models] ADDED: Support for M3D animations (#2648) by @bztsrc
[models] ADDED: GLTF animation support (#2844) by @charles-l
[models] ADDED: DrawCapsule() and DrawCapsuleWires() (#2761) by @IanBand
[models] ADDED: LoadMaterials(), MTL files loading, same code as OBJ loader (#2872) by @JeffM2501
[models] `WARNING`: REMOVED: UnloadModelKeepMeshes()
[models] `WARNING`: REMOVED: DrawCubeTexture(), DrawCubeTextureRec(), functions moved to new example: `models_draw_cube_texture`
[models] REVIEWED: DrawMesh(), using SHADER_LOC_COLOR_SPECULAR as a material map (#2908) by @haved
[models] REVIEWED: LoadM3D() vertex color support (#2878) by @GithubPrankster, @bztsrc
[models] REVIEWED: GenMeshHeightmap() (#2716)
[models] REVIEWED: LoadIQM() (#2676)
[models] REVIEWED: Simplify .vox signature check (#2752) by @CrezyDud
[models] REVIEWED: LoadIQM(), support bone names loading if available (#2882) by @PencilAmazing
[models] REVIEWED: GenMeshTangents(), avoid crash on missing texcoords data (#2927)
[audio] ADDED: Full support for QOA audio file format
[audio] ADDED: Mixed audio processor (#2929) by @hatkidchan
[audio] ADDED: IsWaveReady()`, IsSoundReady(), IsMusicReady() (#2892) by @RobLoach
[audio] `WARNING`: REMOVED: Multichannel audio API: PlaySoundMulti(), StopSoundMulti()
[audio] REVIEWED: Clear PCM buffer state when closing audio device (#2736) by @veins1
[audio] REVIEWED: Android backend selected (#2118, #2875) by @planetis-m
[audio] REVIEWED: Change default threading model for COM objects in miniaudio
[multi] ADDED: IsShaderReady(), IsImageReady(), IsFontReady() (#2892) by @RobLoach
[multi] ADDED: IsModelReady(), IsMaterialReady(), IsTextureReady(), IsRenderTextureReady() (#2895) by @RobLoach
[multi] REVIEWED: Multiple code/comment typos by @sDos280
[multi] REVIEWED: Grammar mistakes and typos (#2914) by @stickM4N
[multi] REVIEWED: Use TRACELOG() macro instead of TraceLog() in internal modules (#2881) by @RobLoach
[examples] ADDED: textures_textured_curve (#2821) by @JeffM2501
[examples] ADDED: models_draw_cube_texture
[examples] ADDED: models_loading_m3d (#2648) by @bztsrc
[examples] ADDED: shaders_write_depth (#2836) by @BugraAlptekinSari
[examples] ADDED: shaders_hybrid_render (#2919) by @BugraAlptekinSari
[examples] REMOVED: audio_multichannel_sound
[examples] RENAMED: Several shaders for naming consistency (#2707)
[examples] RENAMED: lighting_instanced.fs to lighting_instancing.fs (glsl100) (#2805) by @gtrxAC
[examples] REVIEWED: core_custom_logging.c (#2692) by @hartmannathan
[examples] REVIEWED: core_camera_2d_platformer (#2687) by @skylar779
[examples] REVIEWED: core_input_gamepad.c (#2903) by @planetis-m
[examples] REVIEWED: core_custom_frame_control
[examples] REVIEWED: core_drop_files (#2943)
[examples] REVIEWED: text_rectangle_bounds (#2746) by @SzieberthAdam
[examples] REVIEWED: textures_image_processing, added gaussian blurring (#2775) by @nobytesgiven
[examples] REVIEWED: models_billboard, highlighting rotation and draw order (#2779) by @nobytesgiven
[examples] REVIEWED: core_loading_thread, join thread on completion (#2845) by @planetis-m
[examples] REVIEWED: models_loading_gltf
[examples] REVIEWED: Shader lighting.fs for GLSL120 (#2651)
[examples] REVIEWED: text_codepoints_loading.c
[parser] REVIEWED: raylib-parser Makefile (#2765) by @Peter0x44
[build] ADDED: Packaging for distros with deb-based and rpm-based packages (#2877) by @KOLANICH
[build] ADDED: Linkage library -latomic on Linux (only required for ARM32)
[build] ADDED: Required frameworks on macOS (#2793) by @SpexGuy
[build] ADDED: WASM support for Zig build (#2901) by @Not-Nik
[build] ADDED: New raylib examples as VS2022 project (to raylib solution)
[build] REVIEWED: config.h format and inconsistencies
[build] REVIEWED: Zig build to latest master, avoid deprecated functions (#2910) by @star-tek-mb
[build] REVIEWED: CMake project template to easily target raylib version (#2700) by @RobLoach
[build] REVIEWED: PATH for PLATFORM_WEB target (#2647) by @futureapricot
[build] REVIEWED: build.zig to let user decide how to set build mode and linker fixes by @InKryption
[build] REVIEWED: Deprecation error on Android API higher than 23 (#2778) by @anggape
[build] REVIEWED: Android x86 Architecture name (#2783) by @IsaacTCB
[build] REVIEWED: examples/build.zig for the latest Zig version (#2786) by @RomanAkberov
[utils] REVIEWED: ExportDataAsCode() data types (#2787) by @RGDTAB
[build] REVIEWED: Makefile emscripten path (#2785) by @Julianiolo
[build] REVIEWED: Several compilation warnings (for strict rules)
[build] REVIEWED: All github workflows using deprecated actions
[build] REVIEWED: CMake when compiling for web (#2820) by @object71
[build] REVIEWED: DLL build on Windows (#2951) by @Skaytacium
[build] REVIEWED: Avoid MSVC warnings in raylib project (#2871) by @JeffM2501
[build] REVIEWED: Paths in .bat files to build examples (#2870) by @masoudd
[build] REVIEWED: CMake, use GLVND for old cmake versions (#2826) by @simendsjo
[build] REVIEWED: Makefile, multiple tweaks
[build] REVIEWED: CI action: linux_examples.yml
[build] REVIEWED: CI action: cmake.yml
[bindings] ADDED: h-raylib (Haskell) by @Anut-py
[bindings] ADDED: raylib-c3 (C3) by @Its-Kenta
[bindings] ADDED: raylib-umka (Umka) by @RobLoach
[bindings] ADDED: chez-raylib (Chez Scheme) by @Yunoinsky
[bindings] ADDED: raylib-python-ctypes (Python) by @sDos280
[bindings] ADDED: claylib (Common Lisp) by @shelvick
[bindings] ADDED: raylib-vapi (Vala) by @lxmcf
[bindings] ADDED: TurboRaylib (Object Pascal) by @turborium
[bindings] ADDED: Kaylib (Kotlin/Native) by @Its-Kenta
[bindings] ADDED: Raylib-Nelua (Nelua) by @Its-Kenta
[bindings] ADDED: Cyber (Cyber) by @fubark
[bindings] ADDED: raylib-sunder (Sunder) by @ashn-dot-dev
[bindings] ADDED: raylib BQN (#2962) by @Brian-ED
[misc] REVIEWED: Update external libraries to latest versions
-------------------------------------------------------------------------
Release: raylib 4.2 (11 August 2022)
@@ -222,7 +1113,7 @@ Release: raylib 4.0 - 8th Anniversary Edition (05 November 2021)
KEY CHANGES:
- Naming consistency and coherency: Complete review of the library: syntax, naming, comments, decriptions, logs...
- Event Automation System: Support for input events recording and automatic re-playing, useful for automated testing and more!
- Custom game-loop control: Intended for advance users that want to control the events polling and the timming mechanisms
- Custom game-loop control: Intended for advanced users that want to control the events polling and the timming mechanisms
- rlgl 4.0: Completely decoupling from platform layer and raylib, intended for standalone usage as single-file header-only
- raymath 1.5: Complete review following new conventions, to make it more portable and self-contained
- raygui 3.0: Complete review and official new release, more portable and self-contained, intended for tools development
@@ -265,7 +1156,7 @@ Detailed changes:
[raymath] REVIEWED: QuaternionFromAxisAngle() (#1892)
[raymath] REVIEWED: QuaternionToMatrix() returning transposed result. (#1793) by @object71
[shapes] ADDED: RenderPolyLinesEx() (#1758) by @lambertwang
[shapes] ADDED: DrawLineBezierCubic() (#2021) by @SAOMDVN
[shapes] ADDED: DrawSplineBezierCubic() (#2021) by @SAOMDVN
[textures] ADDED: GetImageColor() #2024
[textures] REMOVED: GenImagePerlinNoise()
[textures] RENAMED: GetTextureData() to LoadImageFromTexture()
@@ -403,7 +1294,7 @@ Detailed changes:
[rlgl] REDESIGNED: rlLoadExtensions(), more details exposed
[raymath] REVIEWED: QuaternionFromEuler() (#1651)
[raymath] REVIEWED: MatrixRotateZYX() (#1642)
[shapes] ADDED: DrawLineBezierQuad() (#1468) by @epsilon-phase
[shapes] ADDED: DrawSplineBezierQuad() (#1468) by @epsilon-phase
[shapes] ADDED: CheckCollisionLines()
[shapes] ADDED: CheckCollisionPointLine() by @mkupiec1
[shapes] REVIEWED: CheckCollisionPointTriangle() by @mkupiec1
@@ -780,7 +1671,7 @@ Detailed changes:
[examples] ADDED: models_waving_cubes, by @codecat
[examples] ADDED: models_solar_system, by @aldrinmartoq
[examples] ADDED: shaders_fog, by @chriscamacho
[examples] ADDED: shaders_texture_waves, by @Anata
[examples] ADDED: shaders_texture_waves, by @anatagawa
[examples] ADDED: shaders_basic_lighting, by @chriscamacho
[examples] ADDED: shaders_simple_mask, by @chriscamacho
[examples] ADDED: audio_multichannel_sound, by @chriscamacho
@@ -1485,9 +2376,9 @@ other changes:
[models] Added function DrawCubeTexture()
[models] Added function DrawQuad()
[models] Added function DrawRay()
[models] Simplified funtion DrawPlane()
[models] Simplified function DrawPlane()
[models] Removed function DrawPlaneEx()
[models] Simplified funtion DrawGizmo()
[models] Simplified function DrawGizmo()
[models] Removed function DrawGizmoEx()
[models] Added function LoadModelEx()
[models] Review of function LoadCubicMap()

39
CMakeLists.txt Executable file → Normal file
View File

@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.25)
#this change avoid the warning that appear when we include raylib using Cmake fatch content
project(raylib)
# Avoid excessive expansion of variables in conditionals. In particular, if
# "PLATFORM" is "DRM" than:
# "PLATFORM" is "DRM" then:
#
# if (${PLATFORM} MATCHES "DRM")
#
@@ -13,17 +14,14 @@ project(raylib)
# See https://cmake.org/cmake/help/latest/policy/CMP0054.html
cmake_policy(SET CMP0054 NEW)
# Makes a hidden visibility preset on a static lib respected
# This is used to hide glfw's symbols from the library exports when building an so/dylib
# See https://cmake.org/cmake/help/latest/policy/CMP0063.html
cmake_policy(SET CMP0063 NEW)
# Directory for easier includes
# Anywhere you see include(...) you can check <root>/cmake for that file
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# RAYLIB_IS_MAIN determines whether the project is being used from root
# or if it is added as a dependency (through add_subdirectory for example).
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(RAYLIB_IS_MAIN TRUE)
else()
set(RAYLIB_IS_MAIN FALSE)
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Sets compiler flags and language standard
include(CompilerFlags)
@@ -31,12 +29,27 @@ include(CompilerFlags)
# Registers build options that are exposed to cmake
include(CMakeOptions.txt)
# Enforces a few environment and compiler configurations
include(BuildOptions)
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM")
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11")
endif()
endif()
# Main sources directory (the second parameter sets the output directory name to raylib)
add_subdirectory(src raylib)
# Uninstall target, only create when building raylib by itself
# Avoid conflicting target names when using raylib with other libraries
if(NOT TARGET uninstall AND PROJECT_IS_TOP_LEVEL)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
if (${BUILD_EXAMPLES})
MESSAGE(STATUS "Building examples is enabled")
add_subdirectory(examples)

View File

@@ -1,94 +1,39 @@
### Config options ###
# ## Config options ###
include(CMakeDependentOption)
include(EnumOption)
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM" "Platform to build for.")
if(EMSCRIPTEN)
# When configuring web builds with "emcmake cmake -B build -S .", set PLATFORM to Web by default
SET(PLATFORM Web CACHE STRING "Platform to build for.")
endif()
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM;SDL" "Platform to build for.")
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0" "Force a specific OpenGL Version?")
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?")
# Configuration options
option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
option(BUILD_EXAMPLES "Build the examples." ${PROJECT_IS_TOP_LEVEL})
option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
option(WITH_PIC "Compile static library as position-independent code" OFF)
option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF)
option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF)
cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON)
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
if(UNIX AND NOT APPLE)
option(USE_WAYLAND "Use Wayland for window creation" OFF)
endif()
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
# GLFW build options
option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF)
option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage)" OFF)
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
# raylib modules included
cmake_dependent_option(SUPPORT_MODULE_RSHAPES "Include module: rshapes" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RTEXTURES "Include module: rtextures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RTEXT "Include module: rtext" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RMODELS "Include module: rmodels" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RAUDIO "Include module: raudio" ON CUSTOMIZE_BUILD ON)
include(ParseConfigHeader)
# rcore.c
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
# rshapes.c
cmake_dependent_option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON CUSTOMIZE_BUILD ON)
# rtextures.c
cmake_dependent_option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
# rtext.c
cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_TEXT_MANIPULATION "Support text manipulation functions" ON CUSTOMIZE_BUILD ON)
# rmodels.c
cmake_dependent_option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_VOX "Support loading VOX file format" ON CUSTOMIZE_BUILD ON)
# raudio.c
cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF)
# utils.c
cmake_dependent_option(SUPPORT_STANDARD_FILEIO "Support standard file io library (stdio.h)" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON CUSTOMIZE_BUILD ON)
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
cmake_dependent_option(${CMAKE_MATCH_1} "" ${CMAKE_MATCH_2} CUSTOMIZE_BUILD ${CMAKE_MATCH_2})
endforeach()

View File

@@ -5,13 +5,13 @@ Hello contributors! Welcome to raylib!
Do you enjoy raylib and want to contribute? Nice! You can help with the following points:
- `C programming` - Can you write/review/test/improve the code?
- `Documentation/Tutorials/Example` - Can you write some tutorial/example?
- `Documentation/Tutorials/Example` - Can you write some tutorials/examples?
- `Porting to other platforms` - Can you port/adapt/compile raylib on other systems?
- `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)?
- `Testing` - Can you find some bugs in raylib?
This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules.
Use your best judgement, and feel free to propose changes to this document in a pull request.
Use your best judgment, and feel free to propose changes to this document in a pull request.
### raylib philosophy
@@ -28,14 +28,14 @@ Use your best judgement, and feel free to propose changes to this document in a
- [raylib license](LICENSE)
- [raylib roadmap](ROADMAP.md)
[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone for edit.
[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone to edit.
Feel free to review it if required, just take care not to break something.
### raylib C coding conventions
Despite being written in C, raylib does not follow the standard Hungarian notation for C,
it [follows Pascal-case/camel-case notation](https://github.com/raysan5/raylib/wiki/raylib-coding-conventions),
more common on C# language. All code formatting decisions have been carefully taken
more common in C# language. All code formatting decisions have been carefully taken
to make it easier for students/users to read, write and understand code.
Source code is extensively commented for that purpose, raylib primary learning method is:
@@ -46,21 +46,21 @@ For detailed information on building raylib and examples, please check [raylib W
### Opening new Issues
To open new issue for raylib (bug, enhancement, discussion...), just try to follow these rules:
To open new issues for raylib (bug, enhancement, discussion...), just try to follow these rules:
- Make sure the issue has not already been reported before by searching on GitHub under Issues.
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a
title and clear description, as much relevant information as possible, and a code sample demonstrating the unexpected behavior.
- If applies, attach some screenshot of the issue and a .zip file with the code sample and required resources.
- If applicable, attach some screenshot of the issue and a .zip file with the code sample and required resources.
- On issue description, add a brackets tag about the raylib module that relates to this issue.
If don't know which module, just report the issue, I will review it.
- You can check other issues to see how is being done!
- You can check other issues to see how it's being done!
### Sending a Pull-Request
- Make sure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
- Don't send big pull requests (lots of changelists), they are difficult to review. It's better to send small pull requests, one at a time.
- Verify that changes don't break the build (at least on Windows platform). As many platforms where you can test it, the better, but don't worry
- Verify that changes don't break the build (at least on Windows platform). The more platforms where you can test it, the better, but don't worry
if you cannot test all the platforms.
### Contact information

View File

@@ -1,6 +1,6 @@
## C Coding Style Conventions
Here it is a list with some of the code conventions used by raylib:
Here is a list with some of the code conventions used by raylib:
Code element | Convention | Example
--- | :---: | ---
@@ -11,7 +11,7 @@ Local variables | lowerCase | `Vector2 playerPosition = { 0 };`
Global variables | lowerCase | `bool windowReady = false;`
Constants | lowerCase | `const int maxValue = 8;`
Pointers | MyType *pointer | `Texture2D *array = NULL;`
float values | always x.xf | `float gravity = 10.0f`
float values | always x.xf | `float gravity = 10.0f` (avoid `10.f`)
Operators | value1*value2 | `int product = value*6;`
Operators | value1/value2 | `int division = value/4;`
Operators | value1 + value2 | `int sum = value + 10;`
@@ -28,6 +28,10 @@ Some other conventions to follow:
- **ALWAYS** initialize all defined variables.
- **Do not use TABS**, use 4 spaces instead.
- Avoid trailing spaces, please, avoid them
- Comments always start with space + capital letter and never end with a '.', place them **before** the line(s) they refer to
```c
// This is a comment in raylib or raylib examples
```
- Control flow statements always are followed **by a space**:
```c
if (condition) value = 0;
@@ -68,19 +72,19 @@ void SomeFunction()
**If proposing new functions, please try to use a clear naming for function-name and functions-parameters, in case of doubt, open an issue for discussion.**
## Files and Directories Naming Conventions
- Directories will be named using `snake_case`: `resources/models`, `resources/fonts`
- Files will be named using `snake_case`: `main_title.png`, `cubicmap.png`, `sound.wav`
_NOTE: Avoid any space or special character in the files/dir naming!_
## Games/Examples Directories Organization Conventions
- Data files should be organized by context and usage in the game, think about the loading requirements for data and put all the resources that need to be loaded at the same time together.
- Use descriptive names for the files, it would be perfect if just reading the name of the file, it was possible to know what is that file and where fits in the game.
- Here it is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font).
- Here is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font).
```
resources/audio/fx/long_jump.wav
resources/audio/music/main_theme.ogg

27
FAQ.md
View File

@@ -14,12 +14,13 @@
- [What does raylib provide that other engines or libraries don't?](#what-does-raylib-provide-that-other-engines-or-libraries-dont)
- [How does raylib compare to Unity/Unreal/Godot?](#how-does-raylib-compare-to-unityunrealgodot)
- [What development tools are required for raylib?](#what-development-tools-are-required-for-raylib)
- [Which are raylib external dependencies?](#which-are-raylib-external-dependencies)
- [What are raylib's external dependencies?](#what-are-raylibs-external-dependencies)
- [Can I use raylib with other technologies or libraries?](#can-i-use-raylib-with-other-technologies-or-libraries)
- [What file formats are supported by raylib?](#what-file-formats-are-supported-by-raylib)
- [Does raylib support the Vulkan API?](#does-raylib-support-the-vulkan-api)
- [What could I expect to see in raylib in the future?](#what-could-i-expect-to-see-in-raylib-in-the-future)
- [Who are the raylib developers?](#who-are-the-raylib-developers)
- [MORE QUESTIONS...](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions)
### What is raylib?
@@ -39,13 +40,13 @@ Yes, raylib can be used to create any kind of application, not just videogames.
### How can I learn to use raylib? Is there some official documentation or tutorials?
raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look to [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching.
raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look at [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching.
raylib also provides a big [collection of examples](https://www.raylib.com/examples.html), to showcase the multiple functionality usage (+120 examples). Examples are categorized by the internal module functionality and also define an estimated level of difficulty to guide the users checking them.
There is also a [FAQ on the raylib Wiki](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions) with common technical questions.
There are also many tutorials on the internet and YouTube created by the growing raylib community along the years.
There are also many tutorials on the internet and YouTube created by the growing raylib community over the years.
[raylib Discord Community](https://discord.gg/raylib) is also a great place to join and ask questions, the community is very friendly and always ready to help.
@@ -55,7 +56,7 @@ raylib is [free and open source](https://github.com/raysan5/raylib). Anyone can
### What is the raylib license?
raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details.
raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed-source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details.
### What platforms are supported by raylib?
@@ -89,25 +90,25 @@ I personally consider raylib a graphics library with some high-level features ra
### What does raylib provide that other engines or libraries don't?
I would say "simplicity" and "enjoyment" at a really low-level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
I would say "simplicity" and "enjoyment" at a really low level of coding but actually it is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
### How does raylib compare to Unity/Unreal/Godot?
Those engines are usually big and complex to use, providing lot of functionality. They require some time to learn and test, they usually abstract many parts of the game development process and they usually provide a set of tools to assist users on their creations (like a GUI editor).
raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low-level to create graphics applications in a more handmade way.
raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low level to create graphics applications in a more handmade way.
### What development tools are required for raylib?
To develop raylib programs you only need a text editor (with recommended code syntax highlighting) and a compiler.
A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advance configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials.
A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advanced configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials.
### What are raylib's external dependencies?
raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file-formats.
raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file formats.
A detailed list of raylib dependencies could be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies).
A detailed list of raylib dependencies can be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies).
### Can I use raylib with other technologies or libraries?
@@ -119,8 +120,8 @@ raylib can load data from multiple standard file formats:
- Image/Textures: PNG, BMP, TGA, JPG, GIF, QOI, PSD, DDS, HDR, KTX, ASTC, PKM, PVR
- Fonts: FNT (sprite font), TTF, OTF
- Models/Meshes: OBJ, IQM, GLTF, VOX
- Audio: WAV, OGG, MP3, FLAC, XM, MOD
- Models/Meshes: OBJ, IQM, GLTF, VOX, M3D
- Audio: WAV, OGG, MP3, FLAC, XM, MOD, QOA
### Does raylib support the Vulkan API?
@@ -128,10 +129,10 @@ No, raylib is built on top of OpenGL API, and there are currently no plans to su
### What could I expect to see in raylib in the future?
The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features are regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable.
The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features being regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable.
### Who are the raylib developers?
The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there's 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib.
The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there are 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib.
The full list of raylib contributors can be seen [on GitHub](https://github.com/raysan5/raylib/graphs/contributors).

View File

@@ -3,13 +3,13 @@
introduction
------------
I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profile, most of students had never written a single line of code.
I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profiles, most of students had never written a single line of code.
I decided to start with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found [WinBGI](http://www.codecutter.net/tools/winbgim/); it was great and it worked very well with students, in just a couple of weeks, those students that had never written a single line of code were able to program (and understand) a simple PONG game, some of them even a BREAKOUT!
I decided to start with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found [WinBGI](https://winbgim.codecutter.org/); it was great and it worked very well with students, in just a couple of weeks, those students that had never written a single line of code were able to program (and understand) a simple PONG game, some of them even a BREAKOUT!
But WinBGI was not the clearer and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration.
But WinBGI was not the clearest and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration.
So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, the most important, primarily intended to learn videogames programming.
So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, most importantly, primarily intended to learn videogames programming.
My previous videogames development experience was mostly in C# and [XNA](https://en.wikipedia.org/wiki/Microsoft_XNA) and I really loved it, so, I decided to use C# language style notation and XNA naming conventions. That way, students were able to move from raylib to XNA, MonoGame or similar libs extremely easily.
@@ -20,28 +20,28 @@ Enjoy it.
notes on raylib 1.1
-------------------
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
On April 2014, after 6 months of first raylib release, raylib 1.1 was released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
- A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
- [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support.
Some other big changes of this new version have been the support for OGG file loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support.
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1.
Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.1.
notes on raylib 1.2
-------------------
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
On September 2014, after 5 months of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch.
It's been some months of really hard work to accommodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cycle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch.
- A new display initialization system has been created to support multiple resolutions, adding black bars if required; user only defines desired screen size and it gets properly displayed.
- A new display initialization system has been created to support multiple resolutions, adding black bars if required; the user only defines the desired screen size and it gets properly displayed.
- Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.2.
In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/).
@@ -50,26 +50,26 @@ notes on raylib 1.3
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality, improves tremendously textures module and also provides some new modules (camera system, gestures system, immediate-mode gui).
- Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder.
- Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen post-processing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder.
- Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
- A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_first_person.c).
- A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.h) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_first_person.c).
- New [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module simplifies gestures detection on Android and HTML5 programs.
- [raygui](https://github.com/raysan5/raylib/blob/master/src/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional.
- [raygui](https://github.com/raysan5/raylib/blob/master/examples/shapes/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primarily intended for tools development. It's still in an experimental state but already fully functional.
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3.
Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.3.
notes on raylib 1.4
-------------------
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
- First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage.
- First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1331) that have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now basic image processing can be done before converting the image to texture for usage.
- SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
@@ -77,12 +77,12 @@ On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For
- [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
- [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
- [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module has been redesigned and simplified, now it can process touch events from any source, including the mouse. This way, gestures system can be used on any platform providing a unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
- Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental).
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions,
and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/src/easings.h) module has also been added for values animation.
and the addition of two simple functions for persistent data storage. Now raylib users can save and load game data in a file (only some platforms are supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/examples/shapes/reasings.h) module has also been added for values animation.
Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn
how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.
@@ -94,36 +94,36 @@ notes on raylib 1.5
On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added.
- VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c).
- VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameters, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c).
- New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
- New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
- New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages to render internally for every 3d object using standard material.
- Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
- Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
- Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been significantly improved, now physic objects are managed internally in a second thread.
- Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
- Audio chiptunes support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All these features thanks to the amazing work of @kd7tck.
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes.
This new version is so massive that is difficult to list all the improvements, most of the raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely redesigned to accommodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes.
Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries.
Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries.
Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5.
notes on raylib 1.6
-------------------
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version commemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
- Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality.
- Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
- Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completely self-contained, no external libraries are required anymore!
- [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
- [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, the library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
- Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
@@ -131,41 +131,41 @@ On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new v
- Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advanced users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/projects/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.
notes on raylib 1.7
-------------------
On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are:
On May 2017, around 6 months after raylib 1.6, comes another raylib installment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are:
- More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, funtions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
- More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, functions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
- Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality.
- Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advanced users can customize raylib just by choosing desired features, and defining some configuration flags on modules compilation. That way users can control library size and available functionality.
- Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
- Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compilation flags.
- New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems.
- New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All sample material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to the latest raylib version and tested on multiple platforms. Examples folder structure has been improved and also build systems.
- Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
- Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplified, some functions have been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timing improvements, public log system, rres file format support, automatic GIF recording...
And here it is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it.
And here is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it.
notes on raylib 1.8
-------------------
October 2017, around 5 months after latest raylib version, another release is published: raylib 1.8. Again, several modules of the library have been reviewed and some new functionality added. Main changes of this new release are:
- [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses.
- [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning purposes.
- [Parametric mesh generation](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing.
- PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference.
- PBR Materials support, a completely redesigned shaders and material system allows advanced materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference.
- Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts.
- Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into the final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts.
- [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions.
@@ -178,37 +178,37 @@ New installer provided, web updated, examples re-builded, documentation reviewed
notes on raylib 2.0
-------------------
It's been 9 month since last raylib version was published, a lots of things have changed since then... This new raylib version represents an inflexion point in the development of the library and so, we jump to a new major version... Here it is the result of almost **5 years and thousands of hours of hard work**... here it is... **raylib 2.0**
It's been 9 months since last raylib version was published, a lot of things have changed since then... This new raylib version represents an inflection point in the development of the library and so, we jump to a new major version... Here is the result of almost **5 years and thousands of hours of hard work**... here is... **raylib 2.0**
In **raylib 2.0** the full API has been carefully reviewed for better consistency, some new functionality has been added and the overall raylib experience has been greatly improved... The key features of new version are:
- **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependant ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library.
- **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependent ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library.
- **Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtly, the perfect low-level companion for raylib audio module!
- **Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtedly, the perfect low-level companion for raylib audio module!
- **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplyfing the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release!
- **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplifying the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release!
- **More platforms supported and tested**, including BSD family (FreeBSD, openBSD, NetBSD, DragonFly) and Linux-based family platforms (openSUSE, Debian, Ubuntu, Arch, NixOS...). raylib has already been added to some package managers! Oh, and last but not less important, **Android 64bit** is already supported by raylib!
- **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provide by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds!
- **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provided by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds!
- Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file-formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired!
- Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired!
A part of that, lots of new features, like a brand **new font rendering and packaging system** for TTF fonts with **SDF support** (thanks to the amazing STB headers), new functions for **CPU image data manipulation**, new orthographic 3d camera mode, a complete review of `raymath.h` single-file header-only library for better consistency and performance, new examples and way, [way more](https://github.com/raysan5/raylib/blob/master/CHANGELOG).
Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtly its development has exceeded any initial objective; raylib has become a simple and easy-to-use trully multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning!
Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtedly its development has exceeded any initial objective; raylib has become a simple and easy-to-use truly multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning!
notes on raylib 2.5
-------------------
After almost one years since latest raylib installment, here it is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here it is a short recap with the highlight improvements.
After almost one years since latest raylib installment, here is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here is a short recap with the highlight improvements.
- New **window management and file system functions** to query monitor information, deal with clipboard, check directory files info and even launch a URL with default system web browser. Experimental **High-DPI monitor support** has also been added through a compile flag.
- **Redesigned Gamepad mechanism**, now generic for all platforms and gamepads, no more specific gamepad configurations.
**Redesigned UWP input system**, now raylib supports UWP seamlessly, previous implementation required a custom input system implemented in user code.
- `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behaviour.
- `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behavior.
- **VR simulator** has been reviewed to **allow custom configuration of Head-Mounted-Device parameters and distortion shader**, `core_vr_simulator` has been properly adapted to showcase this new functionality, now the VR simulator is a generic configurable stereo rendering system that allows any VR device simulation with just a few lines of code or even dynamic tweaking of HMD parameters.
@@ -220,30 +220,30 @@ After almost one years since latest raylib installment, here it is **raylib 2.5*
- Experimental **cubemap support**, to automatically load multiple cubemap layouts (`LoadTextureCubemap()`). It required some internal `rlgl` redesign to allow cubemap textures.
- **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accomodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added.
- **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accommodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added.
This is a just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones.
This is just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones.
It has been a long year of hard work to make raylib a solid technology to develop new products over it.
notes on raylib 3.0
-------------------
After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has reveived a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other progamming [language bindings](BINDINGS.md).
After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has received a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other programming [language bindings](BINDINGS.md).
- All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variables naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired.
- All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variable naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired.
- All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easely hook their own memory allocations mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074.
- All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easily hook their own memory allocation mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074.
- All **I/O file accesses** from raylib are being moved to **memory data access**, now all I/O file access is centralized into just four functions: `LoadFileData()`, `SaveFileData()`, `LoadFileText()`, `SaveFileText()`. Users can just update those functions to any I/O file system. This change makes it easier to integrate raylib with **Virtual File Systems** or custom I/O file implementations.
- All **raylib data structures** have been reviewed and optimized for pass-by-value usage. One of raylib distinctive design decisions is that most of its functions receive and return data by value. This design makes raylib really simple for newcomers, avoiding pointers and allowing complete access to all structures data in a simple way. The downside is that data is copied on stack every function call and that copy could be costly so, all raylib data structures have been optimized to **stay under 64 bytes** for fast copy and retrieve.
- All **raylib tracelog messages** have been reviewd and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages.
- All **raylib tracelog messages** have been reviewed and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages.
- `raudio` module has been internally reviewed to accomodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio).
- `raudio` module has been internally reviewed to accommodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio).
- `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accomodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding.
- `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accommodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding.
- **Multiple new examples added** (most of them contributed by raylib users) and all examples reviewed for correct execution on most of the supported platforms, specially Web and Raspberry Pi. A detailed categorized table has been created on github for easy examples navigation and code access.
@@ -274,19 +274,19 @@ Here the list with some highlights for `raylib 3.5`.
- NEW **configuration options** exposed: For custom raylib builds, `config.h` now exposes **more than 150 flags and defines** to build raylib with only the desired features, for example, it allows to build a minimal raylib library in just some KB removing all external data filetypes supported, very useful to generate **small executables or embedded devices**.
- NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file-accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out!
- NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out!
- NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advance users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently.
- NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advanced users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently.
- NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advance Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API.
- NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advanced Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API.
- Improved **software rendering**: raylib `Image*()` API is intended for software rendering, for those cases when **no GPU or no Window is available**. Those functions operate directly with **multi-format** pixel data on RAM and they have been completely redesigned to be way faster, specially for small resolutions and retro-gaming. Low-end embedded devices like **microcontrollers with custom displays** could benefit of this raylib functionality!
- File **loading from memory**: Multiple functions have been redesigned to load data from memory buffers **instead of directly accessing the files**, now all raylib file loading/saving goes through a couple of functions that load data into memory. This feature allows **custom virtual-file-systems** and it gives more control to the user to access data already loaded in memory (i.e. images, fonts, sounds...).
- NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hidding, focusing, topmost and more.
- NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hiding, focusing, topmost and more.
- NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the diferent generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed.
- NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the different generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed.
A part of those changes, many new functions have been added, some redundant functions removed and many functions have been reviewed for consistency with the full API (function name, parameters name and order, code formatting...). Again, this release represents is a **great improvement for raylib and marks the way forward** for the library. Make sure to check [CHANGELOG](CHANGELOG) for details! Hope you enjoy it!
@@ -295,7 +295,7 @@ Happy holidays! :)
notes on raylib 3.7
-------------------
April 2021, it's been about 4 months since last raylib release and here it is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April the 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version:
April 2021, it's been about 4 months since the last raylib release and here is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version:
Let's start with some numbers:
@@ -315,18 +315,18 @@ Highlights for `raylib 3.7`:
- **ADDED: glTF animations support**. glTF is the preferred models file format to be used with raylib and along the addition of a models animation API on latest raylib versions, now animations support for glTF format has come to raylib, thanks for this great contribution to [Hristo Stamenov](@object71)
- **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streamming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD.
- **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streaming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD.
- **RENAMED: enums values for consistency**. Most raylib enums names and values names have been renamed for consistency, now all value names start with the type of data they represent. It increases clarity and readability when using those values and also **improves overall library consistency**.
Beside those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment!
Besides those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment!
Happy **gamedev/tools/graphics** programming! :)
notes on raylib 4.0 - 8th Anniversary Edition
---------------------------------------------
It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflexion point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long term version (LTS), stable and complete enough for any new graphic/game/tool application development.
It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflection point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long-term version (LTS), stable and complete enough for any new graphic/game/tool application development.
Let's start with some numbers:
@@ -339,11 +339,11 @@ Let's start with some numbers:
Highlights for `raylib 4.0`:
- **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent.
- **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been written in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent.
- **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental.
- **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assisted game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental.
- **Custom game-loop control**: As requested by some advance users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advance users that want to control the events polling and also the timming mechanisms of their games.
- **Custom game-loop control**: As requested by some advanced users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advanced users that want to control the events polling and also the timing mechanisms of their games.
- [**`rlgl 4.0`**](https://github.com/raysan5/raylib/blob/master/src/rlgl.h): This module has been completely **decoupled from platform layer** and raylib, now `rlgl` single-file header-only library only depends on the multiple OpenGL backends supported, even the dependency on `raymath` has been removed. Additionally, **support for OpenGL 4.3** has been added, supporting compute shaders and Shader Storage Buffer Objects (SSBO). Now `rlgl` can be used as a complete standalone portable library to wrap several OpenGL version and providing **a simple and easy-to-use pseudo-OpenGL immediate-mode API**.
@@ -361,12 +361,12 @@ Highlights for `raylib 4.0`:
Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes!
Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :)
Undoubtedly, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :)
notes on raylib 4.2
-------------------
**New raylib release!** Nine months after latest raylib, here it is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing!
**New raylib release!** Nine months after latest raylib, here is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing!
Some numbers to start with:
@@ -379,19 +379,146 @@ Some numbers to start with:
Highlights for `raylib 4.2`:
- **raylib extra libraries cleanup**: raylib has been on diet and all the _extra_ libraries included on previous releases have been removed from raylib. Now raylib only includes the original **7** raylib modules: `rcore`, `rlgl`, `rshapes`, `rtextures`, `rtext`, `rmodels` and `raudio`. But no worries, _extra_ libraries have not been deleted, they have been moved to their own repos for better maintainability and more focus on its functionality. The libraries moved out from raylib repo are: [`raygui`](https://github.com/raysan5/raygui), [`physac`](https://github.com/raysan5/physac), [`rmem`](https://github.com/raylib-extras/rmem), [`reasings`](https://github.com/raylib-extras/reasings) and [`raudio`](https://github.com/raysan5/raudio) (standalone mode). On that same line, a new **amazing GitHub group:** [`raylib-extras`](https://github.com/raylib-extras) has been created by @JeffM2501 to contain raylib extra libraries as well as other raylib add-ons provided by the community. Jeff has done an amazing work on that line, providing multiple libraries and examples for raylib, like [custom first-person and third person camera systems](https://github.com/raylib-extras/extras-c/tree/main/cameras), [Dear ImGui raylib integration](https://github.com/raylib-extras/rlImGui), [multiple specific examples](https://github.com/raylib-extras/examples-c) and even a complete [RPG Game Example](https://github.com/raylib-extras/RPGExample)! Great work Jeff! :D
- **raylib examples review**: The +120 raylib examples have been reviewed to add clearer information about when the were first created (raylib version used) and when they were updated for the last time. But the greatest improvement for users has been the **addition of an estimated difficulty level** for every example, [web has been updated accordingly](https://www.raylib.com/examples.html) to reflect those difficulty levels. Now examples are classified with **1 to 4 stars** depending on difficulty to help users with their learning process. Personally, I think this "small" addition could be a game-changer to better guide new users on the library adoption! Additionally, this new raylib release includes 7 new examples; the most interesting one: [`text_codepoints_loading`](https://www.raylib.com/examples/text/loader.html?name=text_codepoints_loading) that illustrates how to load and draw custom codepoints from a font file, very useful for Asian languages.
- **raylib examples review**: The +120 raylib examples have been reviewed to add clearer information about when the were first created (raylib version used) and when they were updated for the last time. But the greatest improvement for users has been the **addition of an estimated difficulty level** for every example, [web has been updated accordingly](https://www.raylib.com/examples.html) to reflect those difficulty levels. Now examples are classified with **1 to 4 stars** depending on difficulty to help users with their learning process. Personally, I think this "small" addition could be a game-changer to better guide new users on the library adoption! Additionally, this new raylib release includes 7 new examples; the most interesting one: [`text_codepoints_loading`](https://www.raylib.com/examples/text/loader.html?name=text_codepoints_loading) that illustrates how to load and draw custom codepoints from a font file, very useful for Asian languages.
- [**`rres 1.0`**](https://github.com/raysan5/rres): New `rres` **resources packaging file-format**, including a [`rres-raylib`](https://github.com/raysan5/rres/blob/master/src/rres-raylib.h) library implementation and [`rrespacker`](https://raylibtech.itch.io/rrespacker) tool. `rres` file format has been [under development for +8 years](https://github.com/raysan5/rres#design-history) and it was originally created to be part of raylib. It was highly inspired by _XNA XNB_ resources file format but design has changed a lot along the years. This first release of the format specs is engine-agnostic and has been designed to be portable to any engine, including lots of professional features like data processing, compression and encryption.
- [**`raygui 3.2`**](https://github.com/raysan5/raygui): The **official raylib immediate-mode gui library** designed for tools development has been updated to a new version aligned with raylib 4.2. Multiple controls have been reviewed for library consistency, now all controls follow a similar function signature. It has been battle-tested with the development of +8 published tools in the last months. The tools can be seen and used for free in the [raylib technologies tools page](https://raylibtech.itch.io/). Worth mentioning that several of those **tools have been open sourced** for anyone to use, compile, contribute or learn how the code works.
- [**`raylib_parser`**](https://github.com/raysan5/raylib/tree/master/parser): Multiple contributors **using the tool to automatize bindings creation** have contributed with improvements of this **tool to parse `raylib.h`** (and other raylib-style headers) to tokenize its enums, structs and functions. Processed data can be exported to custom file formats (i.e XML, JSON, LUA) for bindings generation or even docs generation if required.
- **New file system API**: Current API has been redesigned to be more comprehensive and better aligned with raylib naming conventions, two new functions are provided `LoadDirectoryFiles()`/`LoadDirectoryFilesEx()` to load a `FilePathList` for provided path, supporting extension filtering and recursive directory scan. `LoadDroppedFiles()` has been renamed to better reflect its internal functionality. Now, all raylib functions that start with `Load*()` allocate memory internally and a equivalent `Unload*()` function is defined to take care of that memory internally when not required any more!
- **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advance users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib.
- **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advanced users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib.
As always, there are more improvements than the key features listed, make sure to check raylib [CHANGELOG](CHANGELOG) for the detailed list of changes; for this release a `WARNING` flag has been added to all the changes that could affect bindings or productivity code. **raylib keeps improving one more version** and a special focus on maintainability has been put on the library for the future. Specific/advance functionality will be provided through **raylib-extras** repos and raylib main repo devlelopment will be focused on what made raylib popular: being a simple and easy-to-use library to **enjoy videogames programming**.
**Enjoy gamedev/tools/graphics programming!** :)
notes on raylib 4.5
-------------------
It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here is a small summary highlighting this new **rayib 4.5**.
Some numbers for this release:
- **+100** closed issues (for a TOTAL of **+1340**!)
- **+350** commits since previous RELEASE (for a TOTAL of **+6350**!)
- **+25** functions ADDED to raylib API (for a TOTAL of **516**!)
- **+40** functions REVIEWED/REDESIGNED
- **+40** new contributors (for a TOTAL of **405**!)
Highlights for `raylib 4.5`:
- **`NEW` Improved ANGLE support on Desktop platforms**: Support for OpenGL ES 2.0 on Desktop platforms (Windows, Linux, macOS) has been reviewed by @wtnbgo GitHub user. Now raylib can be compiled on desktop for OpenGL ES 2.0 and linked against [`ANGLE`](https://github.com/google/angle). This _small_ addition open the door to building raylib for all **ANGLE supported backends: Direct3D 11, Vulkan and Metal**. Please note that this new feature is still experimental and requires further testing!
- **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advanced users have **full control over camera inputs and movement/rotation speeds**!
- **`NEW` Support for M3D models and M3D/GLTF animations**: 3d models animations support has been a limited aspect of raylib for long time, some versions ago IQM animations were supported but raylib 4.5 also adds support for the brand new [M3D file format](https://bztsrc.gitlab.io/model3d/), including animations and the long expected support for **GLTF animations**! The new M3D file format is **simple, portable, feature complete, extensible and open source**. It also provides a complete set of tools to export/visualize M3D models from/to Blender! Now raylib supports up to **3 model file-formats with animations**: `IQM`, `GLTF` and `M3D`.
- **`NEW` Support QOA audio format (import/export)**: Just a couple of months ago the new [QOA file format](https://qoaformat.org/) was published, a very simple, portable and open source quite-ok-audio file format. raylib already supports it, added to `raudio` module and including audio loading from file, loading from memory, streaming from file, streaming from memory and **exporting to QOA** audio format. **Because simplicity really matters to raylib!**
- **`NEW` Module for compressed textures loading**: [`rl_gputex`](https://github.com/raysan5/raylib/blob/master/src/external/rl_gputex.h), a portable single-file header-only small library to load compressed texture file-formats (DDS, PKM, KTX, PVR, ASTC). Provided functionality is not new to raylib but it was part of the raylib `rtextures` module, now it has been moved into a separate self-contained library, **improving portability**. Note that this module is only intended to **load compressed data from files, ready to be uploaded to GPU**, no compression/decompression functionality is provided. This change is a first step towards a better modularization of raylib library.
- **Reviewed `rlgl` module for automatic limits checking**: Again, [`rlgl`](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been reviewed to simplify usage. Now users do not need to worry about reaching the internal render-batch limits when they send their triangles to draw 2d/3d, `rlgl` manages it automatically! This change allows a **great simplification for other modules** like `rshapes`, `rtextures` and `rmodels` that do not need to worry about bufffer overflows and can just define as many vertex as desired!
- **Reviewed `rshapes` module to minimize the rlgl dependency**: Now `rshapes` 2d shapes drawing functions **only depend on 6 low-level functions**: `rlBegin()`, `rlEnd()`, `rlVertex3f()`, `rlTexCoord2f()`, `rlNormal3f()`, `rlSetTexture()`. With only those pseudo-OpenGl 1.1 minimal functionality, everything can be drawn! This improvement converts `rshapes` module in a **self-contained, portable shapes-drawing library that can be used independently of raylib**, as far as entry points for those 6 functions are provided by the user. It even allows to be used for software rendering, with the proper backend!
- **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselves.
As usual, those are only some highlights but there is much more! New image generators, new color transformation functionality, improved blending support for color/alpha, etc... Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! Please, note that all breaking changes have been flagged with a `WARNING` in the CHANGELOG, specially useful for binding creators!
**raylib keeps improving one more version** with a special focus on maintainability and sustainability. Always working towards making the library more **simple and easy-to-use**.
Let's keep **enjoying games/tools/graphics programming!** :)
notes on raylib 5.0
-------------------
It's been **7 months** since latest raylib release and **10 years** since raylib 1.0 was officially released... what an adventure! In the last 10 years raylib has improved a lot, new functions have been added, many new features and improvements implemented, up to **500 contributors** have helped to shape the library as it is today. `raylib 5.0` is the final result of all this incredible amount of work and dedication. Here is the summary with the key features and additions of this NEW major version of raylib.
Some numbers for this release:
- **+200** closed issues (for a TOTAL of **+1540**!)
- **+550** commits since previous RELEASE (for a TOTAL of **+6950**!)
- **+35** functions ADDED to raylib API (for a TOTAL of **552**!)
- **+60** functions REVIEWED/REDESIGNED
- **+80** new contributors (for a TOTAL of **+500**!)
Highlights for `raylib 5.0`:
- **`rcore` module platform-split**: Probably the biggest raylib redesign in the last 10 years. raylib started as a library targeting 3 desktop platforms: `Windows`, `Linux` and `macOS` (thanks to `GLFW` underlying library) but with the years support for several new platforms has been added (`Android`, `Web`, `Rapsberry Pi`, `RPI native`...); lot of the platform code was shared so the logic was all together on `rcore.c` module, separated by compilation flags. This approach was very handy but also made it very difficult to support new platforms and specially painful for contributors not familiar with the module, navigating +8000 lines of code in a single file. A big redesign was really needed but the amount of work required was humungous and quite scary for a solo-developer like me, moreover considering that everything was working and the chances to break things were really high. Fortunately, some contributors were ready for the task (@ubkp, @michaelfiber, @Bigfoot71) and thanks to their initiative and super-hard work, the `rcore` [platform split](https://github.com/raysan5/raylib/blob/master/src/platforms) has been possible! This new raylib architecture greatly improves the platforms maintenance but also greatly simplifies the addition of new platforms. A [`platforms/rcore_template.c`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_template.c) file is provided with the required structure and functions to be filled for the addition of new platforms, actually it has been simplified to mostly filling some pre-defined functions: `InitPlatform()`, `ClosePlatform`, `PollInputEvents`... Undoubtedly, **this redesign opens the doors to a new era for raylib**, letting the users to plug new platforms as desired.
- **`NEW` Platform backend supported: SDL**: Thanks to the new `rcore` platform-split, the addition of new platforms/backends to raylib has been greatly simplified. As a proof of concept, [`SDL2`](https://libsdl.org/) platform backend has been added to raylib as an alternative for `GLFW` library for desktop builds: [`platforms/rcore_desktop_sdl`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_sdl.c). Lot of work has been put to provide exactly the same features as the other platforms and carefully test the new implementation. Now `SDL2` fans can use this new backend, just providing the required include libraries on compilation and linkage (not included in raylib, like `GLFW`). `SDL` backend support also **eases the process of supporting a wider range of platforms** that already support `SDL`.
- **`NEW` Platform backend supported: Nintendo Switch (closed source)**: The addition of the `SDL` backend was quite a challenge but to really verify the robustness and ease of the new platform plugin system, adding support for a console was a more demanding adventure. Surprisingly, only two days of work were required to add support for `Nintendo Switch` to raylib! Implementation result showed an outstanding level of simplicity, with a **self-contained module** (`rcore_swith.cpp`) supporting graphics and inputs. Unfortunately this module can not be open-sourced due to licensing restrictions.
- **`NEW` Splines drawing and evaluation API**: A complete set of functions has been added to [draw](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1258) and [evaluate](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1270) different types of splines: `Linear`, `Basis`, `Catmull-Rom`, `Quadratic Bezier` and `Cubic Bezier`. Splines are extremely useful for game development (describe paths, control NPC movement...) but they can also be very useful on tools development (node-conections, elements-movement, 3d modelling, animations...). This was the missing feature on the raylib [`rshapes`](https://github.com/raysan5/raylib/blob/master/src/rshapes.h) module to make it complete! Note that `rshapes` module can also be used independently of raylib just providing the **only 6 functions required for vertex definition and drawing**.
- **`NEW` Pseudo-random numbers generator: rprand**: After several years of users asking for this missing piece, a brand new pseudo-random generator module has been added to raylib. [`rprand`](https://github.com/raysan5/raylib/blob/master/src/external/rprand.h) implements the `Xoshiro128**` algorithm combined with `SplitMix64`, specially suited for **fast software pseudo-random numbers generation**. The module also implies some useful functions to generate non-repetitive random numbers sequences, functionality exposed by raylib. usage of this module can be controlled by a compilation flag, in case the default libc `rand()` function was preferred.
- **`NEW` Automation Events System API**: This new system was first added in `raylib 4.0` as an experimental feature but it was a bit clumsy and there was no API exposed to users. For the new `raylib 5.0` the system has been redesigned and [proper API](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1135) added for the users. With this new events automation system, users can **record input events for later replay**, very useful feature for testing automation, tutorials generation, assisted game playing, in-game cinematics, speedruns saving or even AI assited game playing!
- **`NEW` [`raygui 4.0`](https://github.com/raysan5/raygui)**: The **official raylib immediate-mode gui library** designed for tools development has been updated to a new version, aligned with raylib 5.0. This new version is a complete redesign of raygui to unify all controls structure and usage, now all controls have the same function signature!. `raygui` has been battle-tested with the development of +12 published tools in the last few years. The tools can be seen and used for free in the [raylib technologies tools page](https://raylibtech.itch.io/). Worth mentioning that several of those **tools have been open sourced** for anyone to use, compile, contribute or learn how the code works.
- **`NEW` raylib web examples functionality**: Beside the addition of several new examples, the web examples functionality has been improved. Examples have been organized by [complexity level](https://www.raylib.com/examples.html), marked with one star for simple examples and up to 4 stars for more complex ones. A new option has been added to web to allow to **filter examples by function-name** usage, to ease the learning process when looking for an usage example of some function. Finally, **open-graph metadata** information has been added to all examples individual webpages, improving a the visuals and information when sharing those webpages on social networks, sharing the example screenshot and details.
As always, those are only some highlights of the new `raylib 5.0` but there is many more improvements! Support for 16-bit HDR images/textures, SVG loading and scaling support, new OpenGL ES 3.0 graphic backend, new image gradient generators, sound alias loading, improved 3d models loading, multiple optimizations, new bindings, CodeQL integration and much more!
Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes!
Undoubtedly, this is the **biggest raylib update in 10 years**. Many new features and improvements with a special focus on maintainability and long-term sustainability. **Undoubtedly, this is the raylib of the future**.
**Enjoy programming!** :)
notes on raylib 5.5
-------------------
One year after raylib 5.0 release, arrives `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date.
Some numbers for this release:
- **+270** closed issues (for a TOTAL of **+1810**!)
- **+800** commits since previous RELEASE (for a TOTAL of **+7770**!)
- **+30** functions ADDED to raylib API (for a TOTAL of **580**!)
- **+110** functions REVIEWED with fixes and improvements
- **+140** new contributors (for a TOTAL of **+640**!)
Highlights for `raylib 5.5`:
- **`NEW` raylib pre-configured Windows package**: The new raylib **portable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib).
- **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!.
- **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, **adding new platforms backends has been greatly simplified**, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: [`RGFW`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_rgfw.c). `RGFW` is a **new single-file header-only portable library** ([`RGFW.h`](https://github.com/ColleagueRiley/RGFW)) intended for platform-functionality management (windowing and inputs); in this case for **desktop platforms** (Windows, Linux, macOS) but also for **Web platform**. It adds a new alternative to the already existing `GLFW` and `SDL` platform backends.
- **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added support for `SDL2` library, and `raylib 5.5` not only improves SDL2 functionality, with several issues reviewed, but also adds support for the recently released big SDL update in years: [`SDL3`](https://wiki.libsdl.org/SDL3/FrontPage). Now users can **select at compile time the desired SDL version to use**, increasing the number of potential platforms supported in the future!
- **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, **supporting new platform backends is easier than ever!** Along the raylib `rlgl` module support for the `OpenGL 1.1` graphics API, it opened the door to [**multiple homebrew retro-consoles backend implementations!**](https://github.com/raylib4Consoles) It's amazing to see raylib running on +20 year old consoles like [Dreamcast](https://github.com/raylib4Consoles/raylib4Dreamcast), [PSP](https://github.com/raylib4Consoles/raylib4Psp) or [PSVita](https://github.com/psp2dev/raylib4Vita), considering the hardware constraints of those platforms and proves **raylib outstanding versability!** Those additional platforms can be found in separate repositories and have been created by the amazing programmer Antonio Jose Ramos Marquez (@psxdev).
- **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to the contributor Daniel Holden (@orangeduck), probably the developer that has further pushed models animations with raylib, developing two amazing tools to visualize and test animations: [GenoView](https://github.com/orangeduck/GenoView) and [BVHView](https://github.com/orangeduck/BVHView). Adding GPU skinning was a tricky feature, considering it had to be **available for all raylib supported platforms**, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found to make it possible. A new example, [`models_gpu_skinning`](https://github.com/raysan5/raylib/blob/master/examples/models/models_gpu_skinning.c) has been added to illustrate this new functionality. As an extra, previous existing CPU animation system has been greatly improved, multiplying performance by a factor (simplifiying required maths).
- **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, these operators **simplify C++ code when doing math operations**.
Beside those new big features, `raylib 5.5` comes with MANY other improvements:
- Normals support on batching system
- Clipboard images reading support
- CRC32/MD5/SHA1 hash computation
- Gamepad vibration support
- Improved font loading (no GPU required) with BDF fonts support
- Time-based camera movement
- Improved GLTF animations loading
...and [much much more](https://github.com/raysan5/raylib/blob/master/CHANGELOG), including **many functions reviews and new functions added!**
Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes!
To end with, I want to **thank all the contributors (+640!**) that along the years have **greatly improved raylib** and pushed it further and better day after day. Thanks to all of them, raylib is the amazing library it is today.
Last but not least, I want to thank **raylib sponsors and all the raylib community** for their support and continuous engagement with the library, creating and sharing amazing raylib projects on a daily basis. **Thanks for making raylib a great platform to enjoy games/tools/graphic programming!**
**After 11 years of development, `raylib 5.5` is the best raylib ever.**
**Enjoy programming with raylib!** :)

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2022 Ramon Santamaria (@raysan5)
Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.

View File

@@ -1,8 +1,8 @@
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">
<img align="left" style="width:260px" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">
**raylib is a simple and easy-to-use library to enjoy videogames programming.**
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's specially well suited for prototyping, tooling, graphical applications, embedded systems and education.
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's especially well suited for prototyping, tooling, graphical applications, embedded systems and education.
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
@@ -12,53 +12,50 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
<br>
[![GitHub Contributors](https://img.shields.io/github/contributors/raysan5/raylib)](https://github.com/raysan5/raylib/graphs/contributors)
[![GitHub Releases Downloads](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases)
[![GitHub Stars](https://img.shields.io/github/stars/raysan5/raylib?style=flat&label=stars)](https://github.com/raysan5/raylib/stargazers)
[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/4.0.0)](https://github.com/raysan5/raylib/commits/master)
[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/5.5)](https://github.com/raysan5/raylib/commits/master)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/raysan5?label=sponsors)](https://github.com/sponsors/raysan5)
[![Packaging Status](https://repology.org/badge/tiny-repos/raylib.svg)](https://repology.org/project/raylib/versions)
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE)
[![Discord Members](https://img.shields.io/discord/426912293134270465.svg?label=Discord&logo=discord)](https://discord.gg/raylib)
[![Subreddit Subscribers](https://img.shields.io/reddit/subreddit-subscribers/raylib?label=reddit%20r%2Fraylib&logo=reddit)](https://www.reddit.com/r/raylib/)
[![Reddit Static Badge](https://img.shields.io/badge/-r%2Fraylib-red?style=flat&logo=reddit&label=reddit)](https://www.reddit.com/r/raylib/)
[![Youtube Subscribers](https://img.shields.io/youtube/channel/subscribers/UC8WIBkhYb5sBNqXO1mZ7WSQ?style=flat&label=Youtube&logo=youtube)](https://www.youtube.com/c/raylib)
[![Twitch Status](https://img.shields.io/twitch/status/raysan5?style=flat&label=Twitch&logo=twitch)](https://www.twitch.tv/raysan5)
[![Twitter Followers](https://img.shields.io/twitter/follow/raysan5?style=flat&label=@raysan5&color=1da1f2&logo=twitter)](https://twitter.com/raysan5)
[![Build Windows](https://github.com/raysan5/raylib/actions/workflows/build_windows.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_windows.yml)
[![Build Linux](https://github.com/raysan5/raylib/actions/workflows/build_linux.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_linux.yml)
[![Build macOS](https://github.com/raysan5/raylib/actions/workflows/build_macos.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_macos.yml)
[![Build WebAssembly](https://github.com/raysan5/raylib/actions/workflows/build_webassembly.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_webassembly.yml)
[![Windows](https://github.com/raysan5/raylib/workflows/Windows/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWindows)
[![Linux](https://github.com/raysan5/raylib/workflows/Linux/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ALinux)
[![macOS](https://github.com/raysan5/raylib/workflows/macOS/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AmacOS)
[![Android](https://github.com/raysan5/raylib/workflows/Android/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AAndroid)
[![WebAssembly](https://github.com/raysan5/raylib/workflows/WebAssembly/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWebAssembly)
[![CMakeBuilds](https://github.com/raysan5/raylib/workflows/CMakeBuilds/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ACMakeBuilds)
[![Windows Examples](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml)
[![Linux Examples](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml)
[![Build CMake](https://github.com/raysan5/raylib/actions/workflows/build_cmake.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_cmake.yml)
[![Build examples Windows](https://github.com/raysan5/raylib/actions/workflows/build_examples_windows.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_examples_windows.yml)
[![Build examples Linux](https://github.com/raysan5/raylib/actions/workflows/build_examples_linux.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/build_examples_linux.yml)
features
--------
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
- **NO external dependencies**, all required libraries are [included into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
- Written in plain C code (C99) in PascalCase/camelCase notation
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3 or ES 2.0**)
- Written in plain C code (C99) using PascalCase/camelCase notation
- Hardware accelerated with OpenGL: **1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
- Multiple **Fonts** formats supported (TTF, XNA fonts, AngelCode fonts)
- Multiple **Fonts** formats supported (TTF, OTF, FNT, BDF, sprite fonts)
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
- Flexible Materials system, supporting classic maps and **PBR maps**
- **Animated 3D models** supported (skeletal bones animation) (IQM)
- Shaders support, including model and **postprocessing** shaders.
- **Animated 3D models** supported (skeletal bones animation) (IQM, M3D, glTF)
- Shaders support, including model shaders and **postprocessing** shaders
- **Powerful math module** for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h)
- Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
- Audio loading and playing with streaming support (WAV, QOA, OGG, MP3, FLAC, XM, MOD)
- **VR stereo rendering** support with configurable HMD device parameters
- Huge examples collection with [+120 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
- Bindings to [+50 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
- **Free and open source**.
- Huge examples collection with [+140 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
- Bindings to [+70 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
- **Free and open source**
basic example
--------------
This is a basic raylib example, it creates a window and it draws the text `"Congrats! You created your first window!"` in the middle of the screen. Check this example [running live on web here](https://www.raylib.com/examples/core/loader.html?name=core_basic_window).
This is a basic raylib example, it creates a window and draws the text `"Congrats! You created your first window!"` in the middle of the screen. Check this example [running live on web here](https://www.raylib.com/examples/core/loader.html?name=core_basic_window).
```c
#include "raylib.h"
@@ -85,7 +82,7 @@ build and installation
raylib binary releases for Windows, Linux, macOS, Android and HTML5 are available at the [Github Releases page](https://github.com/raysan5/raylib/releases).
raylib is also available via multiple [package managers](https://github.com/raysan5/raylib/issues/613) on multiple OS distributions.
raylib is also available via multiple package managers on multiple OS distributions.
#### Installing and building raylib on multiple platforms
@@ -116,7 +113,7 @@ learning and docs
raylib is designed to be learned using [the examples](https://github.com/raysan5/raylib/tree/master/examples) as the main reference. There is no standard API documentation but there is a [**cheatsheet**](https://www.raylib.com/cheatsheet/cheatsheet.html) containing all the functions available on the library a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works.
Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here are the relevant links:
Some additional documentation about raylib design can be found in [raylib GitHub Wiki](https://github.com/raysan5/raylib/wiki). Here are the relevant links:
- [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html)
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
@@ -133,14 +130,22 @@ raylib is present in several networks and raylib community is growing everyday.
- Webpage: [https://www.raylib.com](https://www.raylib.com)
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
- Twitter: [https://www.twitter.com/raysan5](https://www.twitter.com/raysan5)
- BlueSky: [https://bsky.app/profile/raysan5](https://bsky.app/profile/raysan5.bsky.social)
- Twitch: [https://www.twitch.tv/raysan5](https://www.twitch.tv/raysan5)
- Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
- YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/c/raylib)
contributors
------------
<a href="https://github.com/raysan5/raylib/graphs/contributors">
<img src="https://contrib.rocks/image?repo=raysan5/raylib&max=500&columns=20&anon=1" />
</a>
license
-------
raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.
raylib uses internally some libraries for window/graphics/inputs management and also to support different file formats loading, all those libraries are embedded with and are available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib dependencies LICENSES](https://github.com/raysan5/raylib/wiki/raylib-dependencies) on raylib Wiki for details.
raylib uses internally some libraries for window/graphics/inputs management and also to support different file formats loading, all those libraries are embedded with and are available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib dependencies LICENSES](https://github.com/raysan5/raylib/wiki/raylib-dependencies) on [raylib Wiki](https://github.com/raysan5/raylib/wiki) for details.

View File

@@ -1,21 +1,37 @@
# raylib roadmap
Here it is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
Here is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
- raylib wishlists discussions (https://github.com/raysan5/raylib/discussions/1502, https://github.com/raysan5/raylib/discussions/2272) are open to everyone to ask for improvements, feel free to check and comment.
- [GitHub PRs](https://github.com/raysan5/raylib/pulls) open with improvements to be reviewed.
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
- [raylib 6.0 wishlist](https://github.com/raysan5/raylib/discussions/4660)
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
- [raylib wishlist 2021](https://github.com/raysan5/raylib/discussions/1502)
_Current version of raylib is complete and functional but there is always room for improvements._
**raylib 5.x**
- [ ] `rcore`: Support additional platforms: iOS, consoles?
- [ ] `rcore_web`: Avoid GLFW dependency, functionality can be directly implemented using emscripten SDK
- [ ] `rlgl`: Review GLSL shaders naming conventions for consistency
- [ ] `textures`: Improve compressed textures support, loading and saving
- [ ] `rmodels`: Improve 3d objects loading, specially animations (obj, gltf)
- [ ] `raudio`: Implement miniaudio high-level provided features
- [ ] `examples`: Review all examples, add more and better code explanations
- [ ] Software renderer backend? Maybe using `Image` provided API
**raylib 4.x**
- [ ] Redesign camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143), https://github.com/raysan5/raylib/discussions/2507)
- [ ] Redesign gestures system, improve touch inputs management
- [ ] Redesign raudio module, implement miniaudio high-level provided features
- [x] Better documentation and improved examples
- [x] Split core module into separate platforms?
- [x] Redesign gestures system, improve touch inputs management
- [x] Redesign camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143), https://github.com/raysan5/raylib/discussions/2507)
- [x] Better documentation and improved examples, reviewed webpage with examples complexity level
- [x] Focus on HTML5 ([raylib 5k gamejam](https://itch.io/jam/raylib-5k-gamejam)) and embedded platforms (RPI and similar SOCs)
- [x] Additional support libraries: [raygui](https://github.com/raysan5/raygui), [rres](https://github.com/raysan5/rres)
**raylib 4.0**
- [x] Improved consistency and coherency in raylib API
- [x] Continuous Deployment using GitHub Actions
@@ -23,23 +39,23 @@ _Current version of raylib is complete and functional but there is always room f
- Basic CPU/GPU stats system (memory, draws, time...) ([#1295](https://github.com/raysan5/raylib/issues/1295)) - _DISCARDED_
- Software rendering backend (avoiding OpenGL) ([#1370](https://github.com/raysan5/raylib/issues/1370)) - _DISCARDED_
- Network module (UDP): `rnet` ([#753](https://github.com/raysan5/raylib/issues/753)) - _DISCARDED_ - Use [nbnet](https://github.com/nathhB/nbnet).
**raylib 3.0**
- [x] Custom memory allocators support
- [x] Global variables moved to global context
- [x] Optimize data structures for pass-by-value
- [x] Trace log messages redesign ([#1065](https://github.com/raysan5/raylib/issues/1065))
- [x] Continuous Integration using GitHub Actions
**raylib 2.5**
- [x] Support Animated models
- [x] Support glTF models file format
- [x] Unicode support on text drawing
**raylib 2.0**
- [x] Removed external dependencies (GLFW3 and OpenAL)
- [x] Support TCC compiler (32bit and 64bit)
**raylib 1.8**
- [x] Improved Materials system with PBR support
- [x] Procedural image generation functions (spot, gradient, noise...)
@@ -50,7 +66,7 @@ _Current version of raylib is complete and functional but there is always room f
- [x] Support configuration flags
- [x] Improved build system for Android
- [x] Gamepad support on HTML5
**raylib 1.6**
- [x] Lua scripting support (raylib Lua wrapper)
- [x] Redesigned audio module
@@ -59,7 +75,7 @@ _Current version of raylib is complete and functional but there is always room f
**raylib 1.5**
- [x] Support Oculus Rift CV1 and VR stereo rendering (simulator)
- [x] Redesign Shaders/Textures system -> New Materials system
- [x] Support lighting: Omni, Directional and Spot lights
- [x] Support lighting: Omni, Directional and Spotlights
- [x] Redesign physics module (physac)
- [x] Chiptunes audio modules support

687
build.zig Normal file
View File

@@ -0,0 +1,687 @@
const std = @import("std");
const builtin = @import("builtin");
/// Minimum supported version of Zig
const min_ver = "0.15.1";
const emccOutputDir = "zig-out" ++ std.fs.path.sep_str ++ "htmlout" ++ std.fs.path.sep_str;
const emccOutputFile = "index.html";
comptime {
const order = std.SemanticVersion.order;
const parse = std.SemanticVersion.parse;
if (order(builtin.zig_version, parse(min_ver) catch unreachable) == .lt)
@compileError("Raylib requires zig version " ++ min_ver);
}
pub const emsdk = struct {
const zemscripten = @import("zemscripten");
pub fn shell(b: *std.Build) std.Build.LazyPath {
return b.dependency("raylib", .{}).path("src/shell.html");
}
pub const FlagsOptions = struct {
optimize: std.builtin.OptimizeMode,
asyncify: bool = true,
};
pub fn emccDefaultFlags(allocator: std.mem.Allocator, options: FlagsOptions) zemscripten.EmccFlags {
var emcc_flags = zemscripten.emccDefaultFlags(allocator, .{
.optimize = options.optimize,
.fsanitize = true,
});
if (options.asyncify)
emcc_flags.put("-sASYNCIFY", {}) catch unreachable;
return emcc_flags;
}
pub const SettingsOptions = struct {
optimize: std.builtin.OptimizeMode,
es3: bool = true,
emsdk_allocator: zemscripten.EmsdkAllocator = .emmalloc,
};
pub fn emccDefaultSettings(allocator: std.mem.Allocator, options: SettingsOptions) zemscripten.EmccSettings {
var emcc_settings = zemscripten.emccDefaultSettings(allocator, .{
.optimize = options.optimize,
.emsdk_allocator = options.emsdk_allocator,
});
if (options.es3)
emcc_settings.put("FULL_ES3", "1") catch unreachable;
emcc_settings.put("USE_GLFW", "3") catch unreachable;
emcc_settings.put("EXPORTED_RUNTIME_METHODS", "['requestFullscreen']") catch unreachable;
return emcc_settings;
}
pub fn emccStep(b: *std.Build, raylib: *std.Build.Step.Compile, wasm: *std.Build.Step.Compile, options: zemscripten.StepOptions) *std.Build.Step {
const activate_emsdk_step = zemscripten.activateEmsdkStep(b);
const emsdk_dep = b.dependency("emsdk", .{});
raylib.root_module.addIncludePath(emsdk_dep.path("upstream/emscripten/cache/sysroot/include"));
wasm.root_module.addIncludePath(emsdk_dep.path("upstream/emscripten/cache/sysroot/include"));
const emcc_step = zemscripten.emccStep(b, wasm, options);
emcc_step.dependOn(activate_emsdk_step);
return emcc_step;
}
pub fn emrunStep(
b: *std.Build,
html_path: []const u8,
extra_args: []const []const u8,
) *std.Build.Step {
return zemscripten.emrunStep(b, html_path, extra_args);
}
};
fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void {
switch (platform) {
.glfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_GLFW", ""),
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""),
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""),
.android => raylib.root_module.addCMacro("PLATFORM_ANDROID", ""),
else => {},
}
}
/// A list of all flags from `src/config.h` that one may override
const config_h_flags = outer: {
// Set this value higher if compile errors happen as `src/config.h` gets larger
@setEvalBranchQuota(1 << 20);
const config_h = @embedFile("src/config.h");
var flags: [std.mem.count(u8, config_h, "\n") + 1][]const u8 = undefined;
var i = 0;
var lines = std.mem.tokenizeScalar(u8, config_h, '\n');
while (lines.next()) |line| {
if (!std.mem.containsAtLeast(u8, line, 1, "SUPPORT")) continue;
if (std.mem.containsAtLeast(u8, line, 1, "MODULE")) continue;
if (std.mem.startsWith(u8, line, "//")) continue;
if (std.mem.startsWith(u8, line, "#if")) continue;
var flag = std.mem.trimLeft(u8, line, " \t"); // Trim whitespace
flag = flag["#define ".len - 1 ..]; // Remove #define
flag = std.mem.trimLeft(u8, flag, " \t"); // Trim whitespace
flag = flag[0 .. std.mem.indexOf(u8, flag, " ") orelse continue]; // Flag is only one word, so capture till space
flag = "-D" ++ flag; // Prepend with -D
flags[i] = flag;
i += 1;
}
// Uncomment this to check what flags normally get passed
//@compileLog(flags[0..i].*);
break :outer flags[0..i].*;
};
fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
var raylib_flags_arr: std.ArrayList([]const u8) = .empty;
defer raylib_flags_arr.deinit(b.allocator);
const raylib = b.addLibrary(.{
.name = "raylib",
.linkage = options.linkage,
.root_module = b.createModule(.{
.optimize = optimize,
.target = target,
.link_libc = true,
}),
});
try raylib_flags_arr.appendSlice(
b.allocator,
&[_][]const u8{
"-std=gnu99",
"-D_GNU_SOURCE",
"-DGL_SILENCE_DEPRECATION=199309L",
"-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/3674
},
);
if (options.linkage == .dynamic) {
try raylib_flags_arr.appendSlice(
b.allocator,
&[_][]const u8{
"-fPIC",
"-DBUILD_LIBTYPE_SHARED",
},
);
}
// Sets a flag indiciating the use of a custom `config.h`
try raylib_flags_arr.append(b.allocator, "-DEXTERNAL_CONFIG_FLAGS");
if (options.config.len > 0) {
// Splits a space-separated list of config flags into multiple flags
//
// Note: This means certain flags like `-x c++` won't be processed properly.
// `-xc++` or similar should be used when possible
var config_iter = std.mem.tokenizeScalar(u8, options.config, ' ');
// Apply config flags supplied by the user
while (config_iter.next()) |config_flag|
try raylib_flags_arr.append(b.allocator, config_flag);
// Apply all relevant configs from `src/config.h` *except* the user-specified ones
//
// Note: Currently using a suboptimal `O(m*n)` time algorithm where:
// `m` corresponds roughly to the number of lines in `src/config.h`
// `n` corresponds to the number of user-specified flags
outer: for (config_h_flags) |flag| {
// If a user already specified the flag, skip it
config_iter.reset();
while (config_iter.next()) |config_flag| {
// For a user-specified flag to match, it must share the same prefix and have the
// same length or be followed by an equals sign
if (!std.mem.startsWith(u8, config_flag, flag)) continue;
if (config_flag.len == flag.len or config_flag[flag.len] == '=') continue :outer;
}
// Otherwise, append default value from config.h to compile flags
try raylib_flags_arr.append(b.allocator, flag);
}
} else {
// Set default config if no custome config got set
try raylib_flags_arr.appendSlice(b.allocator, &config_h_flags);
}
// No GLFW required on PLATFORM_DRM
if (options.platform != .drm) {
raylib.addIncludePath(b.path("src/external/glfw/include"));
}
var c_source_files: std.ArrayList([]const u8) = try .initCapacity(b.allocator, 2);
c_source_files.appendSliceAssumeCapacity(&.{ "src/rcore.c", "src/utils.c" });
if (options.rshapes) {
try c_source_files.append(b.allocator, "src/rshapes.c");
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RSHAPES");
}
if (options.rtextures) {
try c_source_files.append(b.allocator, "src/rtextures.c");
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RTEXTURES");
}
if (options.rtext) {
try c_source_files.append(b.allocator, "src/rtext.c");
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RTEXT");
}
if (options.rmodels) {
try c_source_files.append(b.allocator, "src/rmodels.c");
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RMODELS");
}
if (options.raudio) {
try c_source_files.append(b.allocator, "src/raudio.c");
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RAUDIO");
}
if (options.opengl_version != .auto) {
raylib.root_module.addCMacro(options.opengl_version.toCMacroStr(), "");
}
raylib.addIncludePath(b.path("src/platforms"));
switch (target.result.os.tag) {
.windows => {
switch (options.platform) {
.glfw => try c_source_files.append(b.allocator, "src/rglfw.c"),
.rgfw, .sdl, .drm, .android => {},
}
raylib.root_module.linkSystemLibrary("winmm", .{});
raylib.root_module.linkSystemLibrary("gdi32", .{});
raylib.root_module.linkSystemLibrary("opengl32", .{});
setDesktopPlatform(raylib, options.platform);
},
.linux => {
if (options.platform == .drm) {
if (options.opengl_version == .auto) {
raylib.root_module.linkSystemLibrary("GLESv2", .{});
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
}
raylib.root_module.linkSystemLibrary("EGL", .{});
raylib.root_module.linkSystemLibrary("gbm", .{});
raylib.root_module.linkSystemLibrary("libdrm", .{ .use_pkg_config = .force });
raylib.root_module.addCMacro("PLATFORM_DRM", "");
raylib.root_module.addCMacro("EGL_NO_X11", "");
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "");
} else if (target.result.abi.isAndroid()) {
//these are the only tag options per https://developer.android.com/ndk/guides/other_build_systems
const hostTuple = switch (builtin.target.os.tag) {
.linux => "linux-x86_64",
.windows => "windows-x86_64",
.macos => "darwin-x86_64",
else => @panic("unsupported host OS"),
};
const androidTriple = switch (target.result.cpu.arch) {
.x86 => "i686-linux-android",
.x86_64 => "x86_64-linux-android",
.arm => "arm-linux-androideabi",
.aarch64 => "aarch64-linux-android",
.riscv64 => "riscv64-linux-android",
else => error.InvalidAndroidTarget,
} catch @panic("invalid android target!");
const androidNdkPathString: []const u8 = options.android_ndk;
if (androidNdkPathString.len < 1) @panic("no ndk path provided and ANDROID_NDK_HOME is not set");
const androidApiLevel: []const u8 = options.android_api_version;
const androidSysroot = try std.fs.path.join(b.allocator, &.{ androidNdkPathString, "/toolchains/llvm/prebuilt/", hostTuple, "/sysroot" });
const androidLibPath = try std.fs.path.join(b.allocator, &.{ androidSysroot, "/usr/lib/", androidTriple });
const androidApiSpecificPath = try std.fs.path.join(b.allocator, &.{ androidLibPath, androidApiLevel });
const androidIncludePath = try std.fs.path.join(b.allocator, &.{ androidSysroot, "/usr/include" });
const androidArchIncludePath = try std.fs.path.join(b.allocator, &.{ androidIncludePath, androidTriple });
const androidAsmPath = try std.fs.path.join(b.allocator, &.{ androidIncludePath, "/asm-generic" });
const androidGluePath = try std.fs.path.join(b.allocator, &.{ androidNdkPathString, "/sources/android/native_app_glue/" });
raylib.root_module.addLibraryPath(.{ .cwd_relative = androidLibPath });
raylib.root_module.addLibraryPath(.{ .cwd_relative = androidApiSpecificPath });
raylib.root_module.addSystemIncludePath(.{ .cwd_relative = androidIncludePath });
raylib.root_module.addSystemIncludePath(.{ .cwd_relative = androidArchIncludePath });
raylib.root_module.addSystemIncludePath(.{ .cwd_relative = androidAsmPath });
raylib.root_module.addSystemIncludePath(.{ .cwd_relative = androidGluePath });
var libcData: std.ArrayList(u8) = .empty;
var aw: std.Io.Writer.Allocating = .fromArrayList(b.allocator, &libcData);
try (std.zig.LibCInstallation{
.include_dir = androidIncludePath,
.sys_include_dir = androidIncludePath,
.crt_dir = androidApiSpecificPath,
}).render(&aw.writer);
const libcFile = b.addWriteFiles().add("android-libc.txt", try libcData.toOwnedSlice(b.allocator));
raylib.setLibCFile(libcFile);
if (options.opengl_version == .auto) {
raylib.root_module.linkSystemLibrary("GLESv2", .{});
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
}
raylib.root_module.linkSystemLibrary("EGL", .{});
setDesktopPlatform(raylib, .android);
} else {
try c_source_files.append(b.allocator, "src/rglfw.c");
if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) {
raylib.root_module.addCMacro("_GLFW_X11", "");
raylib.root_module.linkSystemLibrary("GLX", .{});
raylib.root_module.linkSystemLibrary("X11", .{});
raylib.root_module.linkSystemLibrary("Xcursor", .{});
raylib.root_module.linkSystemLibrary("Xext", .{});
raylib.root_module.linkSystemLibrary("Xfixes", .{});
raylib.root_module.linkSystemLibrary("Xi", .{});
raylib.root_module.linkSystemLibrary("Xinerama", .{});
raylib.root_module.linkSystemLibrary("Xrandr", .{});
raylib.root_module.linkSystemLibrary("Xrender", .{});
}
if (options.linux_display_backend == .Wayland or options.linux_display_backend == .Both) {
_ = b.findProgram(&.{"wayland-scanner"}, &.{}) catch {
std.log.err(
\\ `wayland-scanner` may not be installed on the system.
\\ You can switch to X11 in your `build.zig` by changing `Options.linux_display_backend`
, .{});
@panic("`wayland-scanner` not found");
};
raylib.root_module.addCMacro("_GLFW_WAYLAND", "");
raylib.root_module.linkSystemLibrary("EGL", .{});
raylib.root_module.linkSystemLibrary("wayland-client", .{});
raylib.root_module.linkSystemLibrary("xkbcommon", .{});
waylandGenerate(b, raylib, "wayland.xml", "wayland-client-protocol");
waylandGenerate(b, raylib, "xdg-shell.xml", "xdg-shell-client-protocol");
waylandGenerate(b, raylib, "xdg-decoration-unstable-v1.xml", "xdg-decoration-unstable-v1-client-protocol");
waylandGenerate(b, raylib, "viewporter.xml", "viewporter-client-protocol");
waylandGenerate(b, raylib, "relative-pointer-unstable-v1.xml", "relative-pointer-unstable-v1-client-protocol");
waylandGenerate(b, raylib, "pointer-constraints-unstable-v1.xml", "pointer-constraints-unstable-v1-client-protocol");
waylandGenerate(b, raylib, "fractional-scale-v1.xml", "fractional-scale-v1-client-protocol");
waylandGenerate(b, raylib, "xdg-activation-v1.xml", "xdg-activation-v1-client-protocol");
waylandGenerate(b, raylib, "idle-inhibit-unstable-v1.xml", "idle-inhibit-unstable-v1-client-protocol");
}
setDesktopPlatform(raylib, options.platform);
}
},
.freebsd, .openbsd, .netbsd, .dragonfly => {
try c_source_files.append(b.allocator, "rglfw.c");
raylib.root_module.linkSystemLibrary("GL", .{});
raylib.root_module.linkSystemLibrary("rt", .{});
raylib.root_module.linkSystemLibrary("dl", .{});
raylib.root_module.linkSystemLibrary("m", .{});
raylib.root_module.linkSystemLibrary("X11", .{});
raylib.root_module.linkSystemLibrary("Xrandr", .{});
raylib.root_module.linkSystemLibrary("Xinerama", .{});
raylib.root_module.linkSystemLibrary("Xi", .{});
raylib.root_module.linkSystemLibrary("Xxf86vm", .{});
raylib.root_module.linkSystemLibrary("Xcursor", .{});
setDesktopPlatform(raylib, options.platform);
},
.macos => {
// Include xcode_frameworks for cross compilation
if (b.lazyDependency("xcode_frameworks", .{})) |dep| {
raylib.root_module.addSystemFrameworkPath(dep.path("Frameworks"));
raylib.root_module.addSystemIncludePath(dep.path("include"));
raylib.root_module.addLibraryPath(dep.path("lib"));
}
// On macos rglfw.c include Objective-C files.
try raylib_flags_arr.append(b.allocator, "-ObjC");
raylib.root_module.addCSourceFile(.{
.file = b.path("src/rglfw.c"),
.flags = raylib_flags_arr.items,
});
_ = raylib_flags_arr.pop();
raylib.root_module.linkFramework("Foundation", .{});
raylib.root_module.linkFramework("CoreServices", .{});
raylib.root_module.linkFramework("CoreGraphics", .{});
raylib.root_module.linkFramework("AppKit", .{});
raylib.root_module.linkFramework("IOKit", .{});
setDesktopPlatform(raylib, options.platform);
},
.emscripten => {
raylib.root_module.addCMacro("PLATFORM_WEB", "");
if (options.opengl_version == .auto) {
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES3", "");
}
},
else => {
@panic("Unsupported OS");
},
}
raylib.root_module.addCSourceFiles(.{
.files = c_source_files.items,
.flags = raylib_flags_arr.items,
});
return raylib;
}
pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency, options: Options) void {
const raylib_dep = b.dependencyFromBuildZig(@This(), options);
var gen_step = b.addWriteFiles();
raylib.step.dependOn(&gen_step.step);
const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n");
raylib.root_module.addCSourceFile(.{ .file = raygui_c_path });
raylib.root_module.addIncludePath(raygui_dep.path("src"));
raylib.root_module.addIncludePath(raylib_dep.path("src"));
raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h");
}
pub const Options = struct {
raudio: bool = true,
rmodels: bool = true,
rshapes: bool = true,
rtext: bool = true,
rtextures: bool = true,
platform: PlatformBackend = .glfw,
linkage: std.builtin.LinkMode = .static,
linux_display_backend: LinuxDisplayBackend = .X11,
opengl_version: OpenglVersion = .auto,
android_ndk: []const u8 = "",
android_api_version: []const u8 = "35",
/// config should be a list of space-separated cflags, eg, "-DSUPPORT_CUSTOM_FRAME_CONTROL"
config: []const u8 = &.{},
const defaults = Options{};
pub fn getOptions(b: *std.Build) Options {
return .{
.platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform,
.raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio,
.rmodels = b.option(bool, "rmodels", "Compile with models support") orelse defaults.rmodels,
.rtext = b.option(bool, "rtext", "Compile with text support") orelse defaults.rtext,
.rtextures = b.option(bool, "rtextures", "Compile with textures support") orelse defaults.rtextures,
.rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes,
.linkage = b.option(std.builtin.LinkMode, "linkage", "Compile as shared or static library") orelse defaults.linkage,
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
.opengl_version = b.option(OpenglVersion, "opengl_version", "OpenGL version to use") orelse defaults.opengl_version,
.config = b.option([]const u8, "config", "Compile with custom define macros overriding config.h") orelse &.{},
.android_ndk = b.option([]const u8, "android_ndk", "specify path to android ndk") orelse std.process.getEnvVarOwned(b.allocator, "ANDROID_NDK_HOME") catch "",
.android_api_version = b.option([]const u8, "android_api_version", "specify target android API level") orelse defaults.android_api_version,
};
}
};
pub const OpenglVersion = enum {
auto,
gl_1_1,
gl_2_1,
gl_3_3,
gl_4_3,
gles_2,
gles_3,
pub fn toCMacroStr(self: @This()) []const u8 {
switch (self) {
.auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"),
.gl_1_1 => return "GRAPHICS_API_OPENGL_11",
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
.gl_4_3 => return "GRAPHICS_API_OPENGL_43",
.gles_2 => return "GRAPHICS_API_OPENGL_ES2",
.gles_3 => return "GRAPHICS_API_OPENGL_ES3",
}
}
};
pub const LinuxDisplayBackend = enum {
X11,
Wayland,
Both,
};
pub const PlatformBackend = enum {
glfw,
rgfw,
sdl,
drm,
android,
};
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const lib = try compileRaylib(b, target, optimize, Options.getOptions(b));
lib.installHeader(b.path("src/raylib.h"), "raylib.h");
lib.installHeader(b.path("src/rcamera.h"), "rcamera.h");
lib.installHeader(b.path("src/raymath.h"), "raymath.h");
lib.installHeader(b.path("src/rlgl.h"), "rlgl.h");
b.installArtifact(lib);
const examples = b.step("examples", "Build/Install all examples");
examples.dependOn(try addExamples("audio", b, target, optimize, lib));
examples.dependOn(try addExamples("core", b, target, optimize, lib));
examples.dependOn(try addExamples("models", b, target, optimize, lib));
examples.dependOn(try addExamples("others", b, target, optimize, lib));
examples.dependOn(try addExamples("shaders", b, target, optimize, lib));
examples.dependOn(try addExamples("shapes", b, target, optimize, lib));
examples.dependOn(try addExamples("text", b, target, optimize, lib));
examples.dependOn(try addExamples("textures", b, target, optimize, lib));
}
fn addExamples(
comptime module: []const u8,
b: *std.Build,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
raylib: *std.Build.Step.Compile,
) !*std.Build.Step {
const all = b.step(module, "All " ++ module ++ " examples");
const module_subpath = b.pathJoin(&.{ "examples", module });
var dir = try std.fs.cwd().openDir(b.pathFromRoot(module_subpath), .{ .iterate = true });
defer dir.close();
var iter = dir.iterate();
while (try iter.next()) |entry| {
if (entry.kind != .file) continue;
const extension_idx = std.mem.lastIndexOf(u8, entry.name, ".c") orelse continue;
const name = entry.name[0..extension_idx];
const path = b.pathJoin(&.{ module_subpath, entry.name });
// zig's mingw headers do not include pthread.h
if (std.mem.eql(u8, "core_loading_thread", name) and target.result.os.tag == .windows) continue;
const exe_mod = b.createModule(.{
.target = target,
.optimize = optimize,
});
exe_mod.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
exe_mod.linkLibrary(raylib);
const run_step = b.step(name, name);
if (target.result.os.tag == .emscripten) {
const wasm = b.addLibrary(.{
.name = name,
.linkage = .static,
.root_module = exe_mod,
});
if (std.mem.eql(u8, name, "rlgl_standalone")) {
//TODO: Make rlgl_standalone example work
continue;
}
if (std.mem.eql(u8, name, "raylib_opengl_interop")) {
//TODO: Make raylib_opengl_interop example work
continue;
}
const emcc_flags = emsdk.emccDefaultFlags(b.allocator, .{ .optimize = optimize });
const emcc_settings = emsdk.emccDefaultSettings(b.allocator, .{ .optimize = optimize });
const install_dir: std.Build.InstallDir = .{ .custom = "htmlout" };
const emcc_step = emsdk.emccStep(b, raylib, wasm, .{
.optimize = optimize,
.flags = emcc_flags,
.settings = emcc_settings,
.shell_file_path = b.path("src/shell.html"),
.embed_paths = &.{
.{
.src_path = b.pathJoin(&.{ module_subpath, "resources" }),
.virtual_path = "resources",
},
},
.install_dir = install_dir,
});
const html_filename = try std.fmt.allocPrint(b.allocator, "{s}.html", .{wasm.name});
const emrun_step = emsdk.emrunStep(
b,
b.getInstallPath(install_dir, html_filename),
&.{"--no_browser"},
);
emrun_step.dependOn(emcc_step);
run_step.dependOn(emrun_step);
all.dependOn(emcc_step);
} else {
// special examples that test using these external dependencies directly
// alongside raylib
if (std.mem.eql(u8, name, "rlgl_standalone")) {
exe_mod.addIncludePath(b.path("src"));
exe_mod.addIncludePath(b.path("src/external/glfw/include"));
if (!hasCSource(raylib.root_module, "rglfw.c")) {
exe_mod.addCSourceFile(.{ .file = b.path("src/rglfw.c"), .flags = &.{} });
}
}
if (std.mem.eql(u8, name, "raylib_opengl_interop")) {
exe_mod.addIncludePath(b.path("src/external"));
}
switch (target.result.os.tag) {
.windows => {
exe_mod.linkSystemLibrary("winmm", .{});
exe_mod.linkSystemLibrary("gdi32", .{});
exe_mod.linkSystemLibrary("opengl32", .{});
exe_mod.addCMacro("PLATFORM_DESKTOP", "");
},
.linux => {
exe_mod.linkSystemLibrary("GL", .{});
exe_mod.linkSystemLibrary("rt", .{});
exe_mod.linkSystemLibrary("dl", .{});
exe_mod.linkSystemLibrary("m", .{});
exe_mod.linkSystemLibrary("X11", .{});
exe_mod.addCMacro("PLATFORM_DESKTOP", "");
},
.macos => {
exe_mod.linkFramework("Foundation", .{});
exe_mod.linkFramework("Cocoa", .{});
exe_mod.linkFramework("OpenGL", .{});
exe_mod.linkFramework("CoreAudio", .{});
exe_mod.linkFramework("CoreVideo", .{});
exe_mod.linkFramework("IOKit", .{});
exe_mod.addCMacro("PLATFORM_DESKTOP", "");
},
else => {
@panic("Unsupported OS");
},
}
const exe = b.addExecutable(.{
.name = name,
.root_module = exe_mod,
});
const install_cmd = b.addInstallArtifact(exe, .{});
const run_cmd = b.addRunArtifact(exe);
run_cmd.cwd = b.path(module_subpath);
run_cmd.step.dependOn(&install_cmd.step);
run_step.dependOn(&run_cmd.step);
all.dependOn(&install_cmd.step);
}
}
return all;
}
fn waylandGenerate(
b: *std.Build,
raylib: *std.Build.Step.Compile,
comptime protocol: []const u8,
comptime basename: []const u8,
) void {
const waylandDir = "src/external/glfw/deps/wayland";
const protocolDir = b.pathJoin(&.{ waylandDir, protocol });
const clientHeader = basename ++ ".h";
const privateCode = basename ++ "-code.h";
const client_step = b.addSystemCommand(&.{ "wayland-scanner", "client-header" });
client_step.addFileArg(b.path(protocolDir));
raylib.root_module.addIncludePath(client_step.addOutputFileArg(clientHeader).dirname());
const private_step = b.addSystemCommand(&.{ "wayland-scanner", "private-code" });
private_step.addFileArg(b.path(protocolDir));
raylib.root_module.addIncludePath(private_step.addOutputFileArg(privateCode).dirname());
raylib.step.dependOn(&client_step.step);
raylib.step.dependOn(&private_step.step);
}
fn hasCSource(module: *std.Build.Module, name: []const u8) bool {
for (module.link_objects.items) |o| switch (o) {
.c_source_file => |c| if (switch (c.file) {
.src_path => |s| std.ascii.endsWithIgnoreCase(s.sub_path, name),
.generated, .cwd_relative, .dependency => false,
}) return true,
.c_source_files => |s| for (s.files) |c| if (std.ascii.endsWithIgnoreCase(c, name)) return true,
else => {},
};
return false;
}

31
build.zig.zon Normal file
View File

@@ -0,0 +1,31 @@
.{
.name = .raylib,
.version = "5.6.0-dev",
.minimum_zig_version = "0.15.1",
.fingerprint = 0x13035e5cb8bc1ac2, // Changing this has security and trust implications.
.dependencies = .{
.xcode_frameworks = .{
.url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7",
.hash = "N-V-__8AABHMqAWYuRdIlflwi8gksPnlUMQBiSxAqQAAZFms",
.lazy = true,
},
.emsdk = .{
.url = "git+https://github.com/emscripten-core/emsdk#4.0.9",
.hash = "N-V-__8AAJl1DwBezhYo_VE6f53mPVm00R-Fk28NPW7P14EQ",
},
.zemscripten = .{
.url = "git+https://github.com/zig-gamedev/zemscripten#3fa4b778852226c7346bdcc3c1486e875a9a6d02",
.hash = "zemscripten-0.2.0-dev-sRlDqApRAACspTbAZnuNKWIzfWzSYgYkb2nWAXZ-tqqt",
},
},
.paths = .{
"build.zig",
"build.zig.zon",
"src",
"examples",
"LICENSE",
},
}

View File

@@ -1,18 +0,0 @@
if(${PLATFORM} MATCHES "Desktop" AND APPLE)
if(MACOS_FATLIB)
if (CMAKE_OSX_ARCHITECTURES)
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
endif()
endif()
endif()
# This helps support the case where emsdk toolchain file is used
# either by setting it with -DCMAKE_TOOLCHAIN_FILE=<path_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
# or by using "emcmake cmake -B build -S ." as described in https://emscripten.org/docs/compiling/Building-Projects.html
if(EMSCRIPTEN)
SET(PLATFORM Web CACHE STRING "Forcing PLATFORM_WEB because EMSCRIPTEN was detected")
endif()
# vim: ft=cmake

View File

@@ -3,112 +3,21 @@ target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}")
target_compile_definitions("raylib" PUBLIC "${GRAPHICS}")
function(define_if target variable)
if (${${variable}})
if(${${variable}})
message(STATUS "${variable}=${${variable}}")
target_compile_definitions(${target} PUBLIC "${variable}")
endif ()
target_compile_definitions(${target} PRIVATE "${variable}")
endif()
endfunction()
if (${CUSTOMIZE_BUILD})
target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS)
define_if("raylib" USE_AUDIO)
define_if("raylib" SUPPORT_MODULE_RSHAPES)
define_if("raylib" SUPPORT_MODULE_RTEXTURES)
define_if("raylib" SUPPORT_MODULE_RTEXT)
define_if("raylib" SUPPORT_MODULE_RMODELS)
define_if("raylib" SUPPORT_MODULE_RAUDIO)
define_if("raylib" SUPPORT_CAMERA_SYSTEM)
define_if("raylib" SUPPORT_GESTURES_SYSTEM)
define_if("raylib" SUPPORT_MOUSE_GESTURES)
define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI)
define_if("raylib" SUPPORT_DEFAULT_FONT)
define_if("raylib" SUPPORT_SCREEN_CAPTURE)
define_if("raylib" SUPPORT_GIF_RECORDING)
define_if("raylib" SUPPORT_BUSY_WAIT_LOOP)
define_if("raylib" SUPPORT_EVENTS_WAITING)
define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER)
define_if("raylib" SUPPORT_COMPRESSION_API)
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
define_if("raylib" SUPPORT_IMAGE_EXPORT)
define_if("raylib" SUPPORT_IMAGE_GENERATION)
define_if("raylib" SUPPORT_IMAGE_MANIPULATION)
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
define_if("raylib" SUPPORT_FILEFORMAT_BMP)
define_if("raylib" SUPPORT_FILEFORMAT_TGA)
define_if("raylib" SUPPORT_FILEFORMAT_JPG)
define_if("raylib" SUPPORT_FILEFORMAT_GIF)
define_if("raylib" SUPPORT_FILEFORMAT_QOI)
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
define_if("raylib" SUPPORT_MESH_GENERATION)
define_if("raylib" SUPPORT_FILEFORMAT_OBJ)
define_if("raylib" SUPPORT_FILEFORMAT_MTL)
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
define_if("raylib" SUPPORT_FILEFORMAT_VOX)
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
define_if("raylib" SUPPORT_FILEFORMAT_XM)
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
define_if("raylib" SUPPORT_STANDARD_FILEIO)
define_if("raylib" SUPPORT_TRACELOG)
if(${CUSTOMIZE_BUILD})
target_compile_definitions("raylib" PRIVATE EXTERNAL_CONFIG_FLAGS)
if (UNIX AND NOT APPLE)
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096")
else ()
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=512")
endif ()
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPADS=4")
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_AXIS=8")
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_BUTTONS=32")
target_compile_definitions("raylib" PUBLIC "MAX_TOUCH_POINTS=10")
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"")
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64")
if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11")
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=8192")
elseif (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES2")
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=2048")
endif ()
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_DRAWCALLS=256")
target_compile_definitions("raylib" PUBLIC "MAX_MATRIX_STACK_SIZE=32")
target_compile_definitions("raylib" PUBLIC "MAX_SHADER_LOCATIONS=32")
target_compile_definitions("raylib" PUBLIC "MAX_MATERIAL_MAPS=12")
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_NEAR=0.01")
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_FAR=1000.0")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_POSITION=\"vertexPosition\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD=\"vertexTexCoord\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_NORMAL=\"vertexNormal\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_COLOR=\"vertexColor\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TANGENT=\"vertexTangent\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2=\"vertexTexCoord2\"")
target_compile_definitions("raylib" PUBLIC "MAX_TEXT_BUFFER_LENGTH=1024")
target_compile_definitions("raylib" PUBLIC "MAX_TEXT_UNICODE_CHARS=512")
target_compile_definitions("raylib" PUBLIC "MAX_TEXTSPLIT_COUNT=128")
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_FORMAT=ma_format_f32")
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_CHANNELS=2")
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_SAMPLE_RATE=44100")
target_compile_definitions("raylib" PUBLIC "DEFAULT_AUDIO_BUFFER_SIZE=4096")
target_compile_definitions("raylib" PUBLIC "MAX_TRACELOG_MSG_LENGTH=128")
target_compile_definitions("raylib" PUBLIC "MAX_UWP_MESSAGES=512")
endif ()
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
define_if("raylib" ${CMAKE_MATCH_1})
endforeach()
foreach(VALUE IN LISTS CONFIG_HEADER_VALUES)
target_compile_definitions("raylib" PRIVATE ${VALUE})
endforeach()
endif()

View File

@@ -1,8 +1,8 @@
if(USE_EXTERNAL_GLFW STREQUAL "ON")
find_package(glfw3 3.3.3 REQUIRED)
find_package(glfw3 3.4 REQUIRED)
elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE")
find_package(glfw3 3.3.3 QUIET)
find_package(glfw3 3.4 QUIET)
endif()
if (glfw3_FOUND)
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
@@ -16,15 +16,15 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE)
set(GLFW_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE)
set(WAS_SHARED ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE)
add_subdirectory(external/glfw)
set(BUILD_SHARED_LIBS ${WAS_SHARED} CACHE BOOL " " FORCE)
unset(WAS_SHARED)
# Hide glfw's symbols when building a shared lib
if (BUILD_SHARED_LIBS)
set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden)
endif()
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
include_directories(BEFORE SYSTEM external/glfw/include)

View File

@@ -9,8 +9,7 @@ install(
# PKG_CONFIG_LIBS_PRIVATE is used in raylib.pc.in
if (NOT BUILD_SHARED_LIBS)
include(LibraryPathToLinkerFlags)
library_path_to_linker_flags(__PKG_CONFIG_LIBS_PRIVATE "${LIBS_PRIVATE}")
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})
set(PKG_CONFIG_LIBS_PRIVATE ${GLFW_PKG_LIBS})
string(REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
elseif (BUILD_SHARED_LIBS)
set(PKG_CONFIG_LIBS_EXTRA "")

View File

@@ -1,3 +1,12 @@
# Set OpenGL_GL_PREFERENCE to new "GLVND" even when legacy library exists and
# cmake is <= 3.10
#
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html for more
# information.
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
if (${PLATFORM} MATCHES "Desktop")
set(PLATFORM_CPP "PLATFORM_DESKTOP")
@@ -16,7 +25,7 @@ if (${PLATFORM} MATCHES "Desktop")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
find_package(OpenGL QUIET)
set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm)
else ()
elseif (UNIX)
find_library(pthread NAMES pthread)
find_package(OpenGL QUIET)
if ("${OPENGL_LIBRARIES}" STREQUAL "")
@@ -27,17 +36,31 @@ if (${PLATFORM} MATCHES "Desktop")
find_library(OSS_LIBRARY ossaudio)
endif ()
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
else ()
find_library(pthread NAMES pthread)
find_package(OpenGL QUIET)
if ("${OPENGL_LIBRARIES}" STREQUAL "")
set(OPENGL_LIBRARIES "GL")
endif ()
set(LIBS_PRIVATE m atomic pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
if (USE_AUDIO)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
find_library(OSS_LIBRARY ossaudio)
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
endif ()
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD" AND USE_AUDIO)
set(LIBS_PRIVATE ${LIBS_PRIVATE} dl)
endif ()
endif ()
elseif (${PLATFORM} MATCHES "Web")
set(PLATFORM_CPP "PLATFORM_WEB")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling")
if(NOT GRAPHICS)
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
endif()
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
elseif (${PLATFORM} MATCHES "Android")
@@ -45,26 +68,20 @@ elseif (${PLATFORM} MATCHES "Android")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
list(APPEND raylib_sources ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
add_definitions(-DANDROID -D__ANDROID_API__=21)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
# NOTE: We remove '-Wl,--no-undefined' (set by default) as it conflicts with '-Wl,-undefined,dynamic_lookup' needed
# for compiling with the missing 'void main(void)' declaration in `android_main()`.
# We also remove other unnecessary or problematic flags.
string(REPLACE "-Wl,--no-undefined -Qunused-arguments" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REPLACE "-static-libstdc++" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup")
find_library(OPENGL_LIBRARY OpenGL)
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
elseif (${PLATFORM} MATCHES "Raspberry Pi")
set(PLATFORM_CPP "PLATFORM_RPI")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
add_definitions(-D_DEFAULT_SOURCE)
find_library(GLESV2 brcmGLESv2 HINTS /opt/vc/lib)
find_library(EGL brcmEGL HINTS /opt/vc/lib)
find_library(BCMHOST bcm_host HINTS /opt/vc/lib)
include_directories(/opt/vc/include /opt/vc/include/interface/vmcs_host/linux /opt/vc/include/interface/vcos/pthreads)
link_directories(/opt/vc/lib)
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl)
elseif ("${PLATFORM}" MATCHES "DRM")
set(PLATFORM_CPP "PLATFORM_DRM")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
@@ -78,17 +95,50 @@ elseif ("${PLATFORM}" MATCHES "DRM")
find_library(DRM drm)
find_library(GBM gbm)
if (NOT CMAKE_CROSSCOMPILING)
if (NOT CMAKE_CROSSCOMPILING OR NOT CMAKE_SYSROOT)
include_directories(/usr/include/libdrm)
endif ()
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
elseif ("${PLATFORM}" MATCHES "SDL")
# First, check if SDL is included as a subdirectory
if(TARGET SDL3::SDL3)
message(STATUS "Using SDL3 from subdirectory")
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL3::SDL3)
add_compile_definitions(USING_SDL3_PROJECT)
elseif(TARGET SDL2::SDL2)
message(STATUS "Using SDL2 from subdirectory")
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL2::SDL2)
add_compile_definitions(USING_SDL2_PROJECT)
else()
# No SDL added via add_subdirectory(), try find_package()
message(STATUS "No SDL target from subdirectory, searching via find_package()...")
# First try SDL3
find_package(SDL3 QUIET)
if(SDL3_FOUND)
message(STATUS "Found SDL3 via find_package()")
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL3::SDL3)
add_compile_definitions(USING_SDL3_PACKAGE)
else()
# Fallback to SDL2
find_package(SDL2 REQUIRED)
message(STATUS "Found SDL2 via find_package()")
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL2::SDL2)
add_compile_definitions(USING_SDL2_PACKAGE)
endif()
endif()
endif ()
if (${OPENGL_VERSION})
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
if (NOT ${OPENGL_VERSION} MATCHES "OFF")
set(SUGGESTED_GRAPHICS "${GRAPHICS}")
if (${OPENGL_VERSION} MATCHES "4.3")
set(GRAPHICS "GRAPHICS_API_OPENGL_43")
set(GRAPHICS "GRAPHICS_API_OPENGL_43")
elseif (${OPENGL_VERSION} MATCHES "3.3")
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
elseif (${OPENGL_VERSION} MATCHES "2.1")
@@ -97,9 +147,11 @@ if (${OPENGL_VERSION})
set(GRAPHICS "GRAPHICS_API_OPENGL_11")
elseif (${OPENGL_VERSION} MATCHES "ES 2.0")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
elseif (${OPENGL_VERSION} MATCHES "ES 3.0")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES3")
endif ()
if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail")
if (NOT "${SUGGESTED_GRAPHICS}" STREQUAL "" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail.")
endif ()
endif ()

View File

@@ -1,5 +1,6 @@
# Packaging
SET(CPACK_PACKAGE_NAME "raylib")
SET(CPACK_PACKAGE_CONTACT "raysan5")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to enjoy videogames programming")
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
@@ -9,5 +10,9 @@ SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows
include(CPack)
SET(CPACK_GENERATOR "ZIP;TGZ;DEB;RPM") # Remove this, if you want the NSIS installer on Windows
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # can be used to generate deps, slow and requires tools.
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libatomic1, libc6, libglfw3, libglu1-mesa | libglu1, libglx0, libopengl0")
SET(CPACK_DEBIAN_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-dev")
SET(CPACK_RPM_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-devel")
include(CPack)

View File

@@ -0,0 +1,17 @@
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/config.h" CONFIG_HEADER_CONTENT)
set(BLANK_OR_BACKSLASH_PATTERN "[ \t\r\n\\]")
set(VALID_IDENTIFIER_PATTERN "[A-Za-z_]+[A-Za-z_0-9]*")
set(VALID_VALUE_PATTERN [=["?[A-Za-z_0-9.-]+"?]=]) # not really correct but does the job since the config.h file hopefully will have been checked by a C preprocessor.
set(MACRO_REGEX "(//${BLANK_OR_BACKSLASH_PATTERN}*)?\#define${BLANK_OR_BACKSLASH_PATTERN}+(${VALID_IDENTIFIER_PATTERN})${BLANK_OR_BACKSLASH_PATTERN}+(${VALID_VALUE_PATTERN})")
string(REGEX MATCHALL ${MACRO_REGEX} MACRO_LIST ${CONFIG_HEADER_CONTENT})
set(CONFIG_HEADER_FLAGS ${MACRO_LIST})
list(FILTER CONFIG_HEADER_FLAGS INCLUDE REGEX "^.+SUPPORT_")
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=OFF]] REGEX "^//")
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=ON]])
set(CONFIG_HEADER_VALUES ${MACRO_LIST})
list(FILTER CONFIG_HEADER_VALUES EXCLUDE REGEX "(^.+SUPPORT_)|(^//)")
list(TRANSFORM CONFIG_HEADER_VALUES REPLACE ${MACRO_REGEX} [[\2=\3]])

21
cmake/Uninstall.cmake Normal file
View File

@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()

View File

@@ -1,6 +1,6 @@
# - Try to find raylib
# Options:
# raylib_USE_STATIC_LIBS - OFF by default
# raylib_USE_STATIC_LIBS - ON by default
# raylib_VERBOSE - OFF by default
# Once done, this defines a raylib target that can be passed to
# target_link_libraries as well as following variables:
@@ -11,6 +11,9 @@
# raylib_LDFLAGS - The linker flags needed with raylib
# raylib_DEFINITIONS - Compiler switches required for using raylib
option(raylib_USE_STATIC_LIBS "Use static libs" ON)
option(raylib_VERBOSE "Show raylib verbose messages" OFF)
if (NOT TARGET raylib)
set(XPREFIX PC_RAYLIB)
@@ -25,23 +28,22 @@ if (NOT TARGET raylib)
find_path(raylib_INCLUDE_DIR
NAMES raylib.h
HINTS ${${XPREFIX}_INCLUDE_DIRS}
HINTS ${${XPREFIX}_INCLUDE_DIRS} ${raylib_DIR}/../../../include/
)
set(RAYLIB_NAMES raylib)
if (raylib_USE_STATIC_LIBS)
set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES})
endif()
set(RAYLIB_NAMES libraylib.a raylib.lib)
else ()
set(RAYLIB_NAMES raylib)
endif ()
find_library(raylib_LIBRARY
NAMES ${RAYLIB_NAMES}
HINTS ${${XPREFIX}_LIBRARY_DIRS}
HINTS ${${XPREFIX}_LIBRARY_DIRS} ${raylib_DIR}/../../
)
set(raylib_LIBRARIES ${raylib_LIBRARY})
set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})
set(raylib_LIBRARY_DIR ${raylib_LIBRARY_DIRS})
set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR})
set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS})

View File

@@ -85,23 +85,25 @@ if (${PLATFORM} MATCHES "Android")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_obj_viewer.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_animation.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_first_person_maze.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_magicavoxel_loading.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_magicavoxel_loading.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_custom_uniform.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_model_shader.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_view_depth.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_postprocessing.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_raymarching.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_palette_switch.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_basic_lighting.c)
elseif (${PLATFORM} MATCHES "Web")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os")
# Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s WASM=1 -s ASYNCIFY -s ALLOW_MEMORY_GROWTH=1 --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
# Remove the -rdynamic flag because otherwise emscripten
# does not generate HTML+JS+WASM files, only a non-working
# and fat HTML
@@ -111,8 +113,35 @@ elseif ("${PLATFORM}" STREQUAL "DRM")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
elseif (NOT SUPPORT_GESTURES_SYSTEM)
# Items requiring gestures system
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_mouse_painting.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_basic_screen_manager.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_input_gestures_web.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_input_gestures.c)
endif ()
# The rlgl_standalone example only targets desktop, without shared libraries.
if (BUILD_SHARED_LIBS OR NOT ${PLATFORM} MATCHES "Desktop")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
endif()
# The audio examples fail to link if raylib is built without raudio
if (NOT SUPPORT_MODULE_RAUDIO)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_mixed_processor.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_module_playing.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_music_stream.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_raw_stream.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_loading.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_multi.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_stream_effects.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/embedded_files_loading.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_button.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_explosion.c)
endif()
include_directories(BEFORE SYSTEM others/external/include)
if (NOT TARGET raylib)
@@ -129,6 +158,9 @@ foreach (example_source ${example_sources})
add_executable(${example_name} ${example_source})
target_link_libraries(${example_name} raylib)
if (NOT WIN32)
target_link_libraries(${example_name} m)
endif()
string(REGEX MATCH ".*/.*/" resources_dir ${example_source})
string(APPEND resources_dir "resources")

View File

@@ -1,8 +1,36 @@
#**************************************************************************************************
#
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
# raylib makefile for multiple platforms
#
# Copyright (c) 2013-2022 Ramon Santamaria (@raysan5)
# This file supports building raylib examples for the following platforms:
#
# > PLATFORM_DESKTOP
# - Defaults to PLATFORM_DESKTOP_GLFW
# > PLATFORM_DESKTOP_GFLW (GLFW backend):
# - Windows (Win32, Win64)
# - Linux (X11/Wayland desktop mode)
# - macOS/OSX (x64, arm64)
# - FreeBSD, OpenBSD, NetBSD, DragonFly (X11 desktop)
# > PLATFORM_DESKTOP_SDL (SDL backend):
# - Windows (Win32, Win64)
# - Linux (X11/Wayland desktop mode)
# - Others (not tested)
# > PLATFORM_DESKTOP_RGFW (RGFW backend):
# - Windows (Win32, Win64)
# - Linux (X11 desktop mode)
# - macOS/OSX (x64, arm64 (not tested))
# - Others (not tested)
# > PLATFORM_WEB_RGFW:
# - HTML5 (WebAssembly)
# > PLATFORM_WEB:
# - HTML5 (WebAssembly)
# > PLATFORM_DRM:
# - Raspberry Pi 0-5 (DRM/KMS)
# - Linux DRM subsystem (KMS mode)
# > PLATFORM_ANDROID:
# - Android (ARM, ARM64)
#
# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
@@ -25,18 +53,33 @@
# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_WEB_RGFW
PLATFORM ?= PLATFORM_DESKTOP
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW))
TARGET_PLATFORM := $(PLATFORM)
override PLATFORM = PLATFORM_DESKTOP
else
ifeq ($(PLATFORM), PLATFORM_DESKTOP)
TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW
else
TARGET_PLATFORM = $(PLATFORM)
endif
endif
# Define required raylib variables
PROJECT_NAME ?= raylib_examples
RAYLIB_VERSION ?= 4.2.0
RAYLIB_VERSION ?= 5.5.0
RAYLIB_PATH ?= ..
# Define raylib source code path
RAYLIB_SRC_PATH ?= ../src
# Locations of raylib.h and libraylib.a/libraylib.so
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
RAYLIB_INCLUDE_PATH ?= /usr/local/include
RAYLIB_LIB_PATH ?= /usr/local/lib
DESTDIR ?= /usr/local
RAYLIB_INCLUDE_PATH ?= $(DESTDIR)/include
RAYLIB_LIB_PATH ?= $(DESTDIR)/lib
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
@@ -47,21 +90,28 @@ BUILD_MODE ?= RELEASE
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
# PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally
# WARNING: Library is not included in raylib, it MUST be configured by users
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
SDL_LIBRARIES ?= -lSDL2 -lSDL2main
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
# NOTE: This variable is only used for PLATFORM_OS: LINUX
USE_WAYLAND_DISPLAY ?= FALSE
# Use cross-compiler for PLATFORM_RPI
ifeq ($(PLATFORM),PLATFORM_RPI)
USE_RPI_CROSS_COMPILER ?= FALSE
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
endif
endif
# PLATFORM_WEB: Default properties
BUILD_WEB_ASYNCIFY ?= TRUE
BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
BUILD_WEB_HEAP_SIZE ?= 134217728
BUILD_WEB_RESOURCES ?= TRUE
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
# Use WebGL2 backend (OpenGL 3.0)
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
BUILD_WEB_WEBGL2 ?= FALSE
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# Determine PLATFORM_OS when required
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
@@ -88,13 +138,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
@@ -103,7 +147,7 @@ endif
# RAYLIB_PATH adjustment for LINUX platform
# TODO: Do we really need this?
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_PREFIX ?= ..
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
@@ -111,31 +155,30 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
# Default path for raylib on Raspberry Pi
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH ?= /home/pi/raylib
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
RAYLIB_PATH ?= /home/pi/raylib
endif
# Define raylib release directory for compiled library
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH ?= C:/emsdk
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS),WINDOWS)
# Emscripten required variables
EMSDK_PATH ?= C:/raylib/emsdk
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit
NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
endif
endif
# Define default C compiler: CC
#------------------------------------------------------------------------------------------------
CC = gcc
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),OSX)
# OSX default compiler
CC = clang
@@ -145,14 +188,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-compiler
#CC = armv6j-hardfloat-linux-gnueabi-gcc
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# HTML5 emscripten compiler
# WARNING: To compile to HTML5, code must be redesigned
# to use emscripten.h and emscripten_set_main_loop()
@@ -163,16 +199,25 @@ endif
#------------------------------------------------------------------------------------------------
MAKE ?= make
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),WINDOWS)
MAKE = mingw32-make
endif
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
MAKE = mingw32-make
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
MAKE = mingw32-make
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(OS),Windows_NT)
MAKE = mingw32-make
else
EMMAKE != type emmake
ifneq (, $(EMMAKE))
MAKE = emmake make
else
MAKE = mingw32-make
endif
endif
endif
# Define compiler flags: CFLAGS
@@ -190,14 +235,15 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
ifeq ($(BUILD_MODE),DEBUG)
CFLAGS += -g -D_DEBUG
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS += -s ASSERTIONS=1 --profiling
endif
else
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS += -Os
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
CFLAGS += -O3
else
CFLAGS += -Os
endif
else
CFLAGS += -s -O1
CFLAGS += -O2
endif
endif
@@ -207,7 +253,7 @@ endif
# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
# -Werror=implicit-function-declaration catch function calls without prior declaration
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_LIBTYPE),STATIC)
CFLAGS += -D_DEFAULT_SOURCE
@@ -218,33 +264,29 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS += -std=gnu99
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
CFLAGS += -std=gnu99 -DEGL_NO_X11
endif
# Define include paths for required headers: INCLUDE_PATHS
# NOTE: Some external/extras libraries could be required (stb, easings...)
#------------------------------------------------------------------------------------------------
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS)
# Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
endif
ifeq ($(PLATFORM_OS),LINUX)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH)
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
INCLUDE_PATHS += -I/usr/include/libdrm
endif
@@ -252,7 +294,7 @@ endif
#------------------------------------------------------------------------------------------------
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),WINDOWS)
# NOTE: The resource .rc file contains windows executable icon and properties
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
@@ -268,40 +310,77 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
ifeq ($(PLATFORM_OS),WINDOWS)
# NOTE: The resource .rc file contains windows executable icon and properties
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
# -Wl,--subsystem,windows hides the console window
ifeq ($(BUILD_MODE), RELEASE)
LDFLAGS += -Wl,--subsystem,windows
endif
endif
LDFLAGS += -L$(SDL_LIBRARY_PATH)
endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -s USE_GLFW=3 # Use glfw3 library (context/input management)
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -s USE_PTHREADS=1 # multithreading support
# -s WASM=0 # disable Web Assembly, emitted by default
# -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -sUSE_PTHREADS=1 # multithreading support
# -sWASM=0 # disable Web Assembly, emitted by default
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sMINIFY_HTML=0 # minify generated html from shell.html
# --profiling # include information for code profiling
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
# --source-map-base # allow debugging in browser with source map
LDFLAGS += -s USE_GLFW=3 -s ASYNCIFY -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 --preload-file $(dir $<)resources@resources
# --shell-file shell.html # define a custom shell .html and output extension
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sEXPORTED_RUNTIME_METHODS=ccall -sMINIFY_HTML=0
# Using GLFW3 library (instead of RGFW)
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
LDFLAGS += -sUSE_GLFW=3
endif
# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
LDFLAGS += -sASYNCIFY
endif
# NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0)
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
ifeq ($(BUILD_WEB_WEBGL2),TRUE)
LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
endif
# Add resources building if required
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
endif
# Add debug mode flags if required
ifeq ($(BUILD_MODE),DEBUG)
LDFLAGS += -sASSERTIONS=1 --profiling
endif
# Define a custom shell .html and output extension
LDFLAGS += --shell-file $(BUILD_WEB_SHELL)
EXT = .html
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
# we can compile same code for ALL platforms with no change required, but, working on bigger
# projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
# logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
# Define a custom shell .html and output extension
LDFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
EXT = .html
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
LDFLAGS += -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
endif
# Define libraries required on linking: LDLIBS
# NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
#------------------------------------------------------------------------------------------------
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compilation
# NOTE: WinMM library required to set high-res timer resolution
@@ -325,6 +404,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for OSX 10.9 desktop compiling
@@ -334,7 +416,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm
LDFLAGS += -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib
LDLIBS = -lraylib -lGL -lm -lpthread
# On XWindow requires also below libraries
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
@@ -344,161 +427,254 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
LDLIBS += -lglfw
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl -latomic
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
LDLIBS += -lvchiq_arm -lvcos
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compilation
LDLIBS = -lraylib $(SDL_LIBRARIES) -lopengl32 -lgdi32
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = -lraylib $(SDL_LIBRARIES) -lGL -lm -lpthread -ldl -lrt
# On X11 requires also below libraries
LDLIBS += -lX11
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
# On Wayland windowing system, additional libraries requires
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
endif
# Explicit link to libc
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compilation
LDFLAGS += -L..\src
LDLIBS = -lraylib -lgdi32 -lwinmm -lopengl32
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compipling
# NOTE: Required packages: libegl1-mesa-dev
LDFLAGS += -L../src
LDLIBS = -lraylib -lGL -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lm -lpthread -ldl -lrt
# Explicit link to libc
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libegl1-mesa-dev
LDFLAGS += -L../src
LDLIBS = -lraylib -lm
LDLIBS += -framework Foundation -framework AppKit -framework IOKit -framework OpenGL -framework CoreVideo
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
# Libraries for DRM compiling
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# Libraries for web (HTML5) compiling
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a
endif
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
# Define source code object files required
#------------------------------------------------------------------------------------------------
#EXAMPLES_LIST_START
CORE = \
core/core_basic_window \
core/core_2d_camera \
core/core_2d_camera_mouse_zoom \
core/core_2d_camera_platformer \
core/core_2d_camera_split_screen \
core/core_3d_camera_first_person \
core/core_3d_camera_fps \
core/core_3d_camera_free \
core/core_3d_camera_mode \
core/core_3d_camera_split_screen \
core/core_3d_picking \
core/core_automation_events \
core/core_basic_screen_manager \
core/core_basic_window \
core/core_basic_window_web \
core/core_custom_frame_control \
core/core_custom_logging \
core/core_drop_files \
core/core_high_dpi \
core/core_input_gamepad \
core/core_input_gestures \
core/core_input_gestures_web \
core/core_input_keys \
core/core_input_mouse \
core/core_input_mouse_wheel \
core/core_input_gamepad \
core/core_input_multitouch \
core/core_input_gestures \
core/core_2d_camera \
core/core_2d_camera_platformer \
core/core_2d_camera_mouse_zoom \
core/core_3d_camera_mode \
core/core_3d_camera_free \
core/core_3d_camera_first_person \
core/core_3d_picking \
core/core_world_screen \
core/core_custom_logging \
core/core_drop_files \
core/core_input_virtual_controls \
core/core_random_sequence \
core/core_random_values \
core/core_scissor_test \
core/core_smooth_pixelperfect \
core/core_storage_values \
core/core_vr_simulator \
core/core_loading_thread \
core/core_window_flags \
core/core_window_letterbox \
core/core_window_should_close \
core/core_split_screen \
core/core_smooth_pixelperfect \
core/core_custom_frame_control
core/core_world_screen
SHAPES = \
shapes/shapes_basic_shapes \
shapes/shapes_bouncing_ball \
shapes/shapes_colors_palette \
shapes/shapes_logo_raylib \
shapes/shapes_logo_raylib_anim \
shapes/shapes_rectangle_scaling \
shapes/shapes_lines_bezier \
shapes/shapes_collision_area \
shapes/shapes_following_eyes \
shapes/shapes_colors_palette \
shapes/shapes_digital_clock \
shapes/shapes_double_pendulum \
shapes/shapes_draw_circle_sector \
shapes/shapes_draw_rectangle_rounded \
shapes/shapes_draw_ring \
shapes/shapes_easings_ball_anim \
shapes/shapes_easings_box_anim \
shapes/shapes_easings_rectangle_array \
shapes/shapes_draw_ring \
shapes/shapes_draw_circle_sector \
shapes/shapes_draw_rectangle_rounded \
shapes/shapes_following_eyes \
shapes/shapes_lines_bezier \
shapes/shapes_logo_raylib \
shapes/shapes_logo_raylib_anim \
shapes/shapes_rectangle_advanced \
shapes/shapes_rectangle_scaling \
shapes/shapes_splines_drawing \
shapes/shapes_top_down_lights
TEXTURES = \
textures/textures_logo_raylib \
textures/textures_mouse_painting \
textures/textures_srcrec_dstrec \
textures/textures_background_scrolling \
textures/textures_blend_modes \
textures/textures_bunnymark \
textures/textures_fog_of_war \
textures/textures_gif_player \
textures/textures_image_channel \
textures/textures_image_drawing \
textures/textures_image_generation \
textures/textures_image_kernel \
textures/textures_image_loading \
textures/textures_image_processing \
textures/textures_image_rotate \
textures/textures_image_text \
textures/textures_to_image \
textures/textures_raw_data \
textures/textures_particles_blending \
textures/textures_logo_raylib \
textures/textures_mouse_painting \
textures/textures_npatch_drawing \
textures/textures_background_scrolling \
textures/textures_particles_blending \
textures/textures_polygon_drawing \
textures/textures_raw_data \
textures/textures_sprite_anim \
textures/textures_sprite_button \
textures/textures_sprite_explosion \
textures/textures_bunnymark \
textures/textures_blend_modes \
textures/textures_draw_tiled \
textures/textures_polygon \
textures/textures_gif_player \
textures/textures_fog_of_war
textures/textures_srcrec_dstrec \
textures/textures_textured_curve \
textures/textures_tiled_drawing \
textures/textures_to_image
TEXT = \
text/text_raylib_fonts \
text/text_font_spritefont \
text/text_font_loading \
text/text_3d_drawing \
text/text_codepoints_loading \
text/text_font_filters \
text/text_font_loading \
text/text_font_sdf \
text/text_font_spritefont \
text/text_format_text \
text/text_input_box \
text/text_writing_anim \
text/text_rectangle_bounds \
text/text_unicode \
text/text_draw_3d \
text/text_codepoints_loading
text/text_sprite_fonts \
text/text_unicode_emojis \
text/text_unicode_ranges \
text/text_writing_anim
MODELS = \
models/models_animation \
models/models_billboard \
models/models_bone_socket \
models/models_box_collisions \
models/models_cubicmap \
models/models_draw_cube_texture \
models/models_first_person_maze \
models/models_geometric_shapes \
models/models_gpu_skinning \
models/models_heightmap \
models/models_loading \
models/models_loading_gltf \
models/models_loading_m3d \
models/models_loading_vox \
models/models_mesh_generation \
models/models_mesh_picking \
models/models_loading \
models/models_loading_vox \
models/models_loading_gltf \
models/models_orthographic_projection \
models/models_point_rendering \
models/models_rlgl_solar_system \
models/models_skybox \
models/models_yaw_pitch_roll \
models/models_heightmap \
models/models_waving_cubes
models/models_skybox_rendering \
models/models_tesseract_view \
models/models_waving_cubes \
models/models_yaw_pitch_roll
SHADERS = \
shaders/shaders_model_shader \
shaders/shaders_shapes_textures \
shaders/shaders_custom_uniform \
shaders/shaders_postprocessing \
shaders/shaders_palette_switch \
shaders/shaders_raymarching \
shaders/shaders_texture_drawing \
shaders/shaders_texture_waves \
shaders/shaders_texture_outline \
shaders/shaders_julia_set \
shaders/shaders_eratosthenes \
shaders/shaders_basic_lighting \
shaders/shaders_basic_pbr \
shaders/shaders_custom_uniform \
shaders/shaders_deferred_render \
shaders/shaders_eratosthenes \
shaders/shaders_fog \
shaders/shaders_hot_reloading \
shaders/shaders_hybrid_render \
shaders/shaders_julia_set \
shaders/shaders_lightmap \
shaders/shaders_mesh_instancing \
shaders/shaders_model_shader \
shaders/shaders_multi_sample2d \
shaders/shaders_normal_map \
shaders/shaders_palette_switch \
shaders/shaders_postprocessing \
shaders/shaders_raymarching \
shaders/shaders_rounded_rectangle \
shaders/shaders_shadowmap \
shaders/shaders_shapes_textures \
shaders/shaders_simple_mask \
shaders/shaders_spotlight \
shaders/shaders_hot_reloading \
shaders/shaders_mesh_instancing \
shaders/shaders_multi_sample2d
shaders/shaders_texture_drawing \
shaders/shaders_texture_outline \
shaders/shaders_texture_tiling \
shaders/shaders_texture_waves \
shaders/shaders_vertex_displacement \
shaders/shaders_view_depth \
shaders/shaders_write_depth
AUDIO = \
audio/audio_mixed_processor \
audio/audio_module_playing \
audio/audio_music_stream \
audio/audio_raw_stream \
audio/audio_sound_loading \
audio/audio_multichannel_sound \
audio/audio_sound_multi \
audio/audio_sound_positioning \
audio/audio_stream_effects
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
OTHERS = \
others/easings_testbed \
others/embedded_files_loading \
others/raylib_opengl_interop \
others/raymath_vector_angle \
others/rlgl_compute_shader \
others/rlgl_standalone
#EXAMPLES_LIST_END
# Define processes to execute
#------------------------------------------------------------------------------------------------
@@ -516,18 +692,24 @@ audio: $(AUDIO)
# Generic compilation pattern
# NOTE: Examples must be ready for Android compilation!
%: %.c
ifeq ($(PLATFORM),PLATFORM_ANDROID)
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
else ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
$(MAKE) -f Makefile.Web $@
else
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -D$(TARGET_PLATFORM)
endif
# Clean everything
clean:
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),WINDOWS)
del *.o *.exe /s
endif
ifeq ($(PLATFORM_OS),BSD)
find . -type f -perm -ugo+x -delete
rm -fv *.o
endif
ifeq ($(PLATFORM_OS),LINUX)
find . -type f -executable -delete
rm -fv *.o
@@ -537,16 +719,15 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
rm -f *.o
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
del *.o *.html *.js
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS),WINDOWS)
del *.wasm *.html *.js *.data
else
rm -f */*.wasm */*.html */*.js */*.data
endif
endif
@echo Cleaning done

View File

@@ -2,7 +2,7 @@
#
# raylib makefile for Android project (APK building)
#
# Copyright (c) 2017-2022 Ramon Santamaria (@raysan5)
# Copyright (c) 2017-2025 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
@@ -48,7 +48,7 @@ ifeq ($(ANDROID_ARCH),ARM64)
ANDROID_ARCH_NAME = arm64-v8a
endif
ifeq ($(ANDROID_ARCH),x86)
ANDROID_ARCH_NAME = i686
ANDROID_ARCH_NAME = x86
endif
ifeq ($(ANDROID_ARCH),x86_64)
ANDROID_ARCH_NAME = x86_64
@@ -158,7 +158,8 @@ LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl
OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES))
# Android APK building process... some steps required...
# NOTE: typing 'make' will invoke the default target entry called 'all',
# NOTE: typing 'make' will invoke the default target entry called 'all'
# TODO: Use apksigner for APK signing, jarsigner is not recommended
all: create_temp_project_dirs \
copy_project_required_libs \
copy_project_resources \
@@ -170,8 +171,14 @@ all: create_temp_project_dirs \
compile_project_class \
compile_project_class_dex \
create_project_apk_package \
zipalign_project_apk_package \
sign_project_apk_package
sign_project_apk_package \
zipalign_project_apk_package
# WARNING: About build signing process:
# - If using apksigner, zipalign must be used before the APK file has been signed.
# - If using jarsigner (not recommended), zipalign must be used after the APK file has been signed.
# REF: https://developer.android.com/tools/zipalign
# REF: https://developer.android.com/tools/apksigner
# Create required temp directories for APK building
create_temp_project_dirs:

File diff suppressed because it is too large Load Diff

View File

@@ -16,188 +16,224 @@ You may find it easier to use than other toolchains, especially when it comes to
- `zig build [module]` to compile all examples for a module (e.g. `zig build core`)
- `zig build [example]` to compile _and run_ a particular example (e.g. `zig build core_basic_window`)
## EXAMPLES LIST
## EXAMPLES COLLECTION [TOTAL: 161]
### category: core
### category: core [36]
Examples using raylib core platform functionality like window creation, inputs, drawing modes and system functionality.
Examples using raylib[core](../src/rcore.c) platform functionality like window creation, inputs, drawing modes and system functionality.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 01 | [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 02 | [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 03 | [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="80"> | ⭐☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
| 04 | [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="80"> | ⭐☆☆☆ | 1.1 | 1.3 | [Ray](https://github.com/raysan5) |
| 05 | [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="80"> | ⭐☆☆☆ | 1.1 | **4.2** | [Ray](https://github.com/raysan5) |
| 06 | [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="80"> | ⭐☆☆☆ | 2.1 | 2.5 | [Berni](https://github.com/Berni8k) |
| 07 | [core_input_gestures](core/core_input_gestures.c) | <img src="core/core_input_gestures.png" alt="core_input_gestures" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
| 08 | [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="80"> | ⭐️⭐️☆☆ | 1.5 | 3.0 | [Ray](https://github.com/raysan5) |
| 09 | [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | <img src="core/core_2d_camera_mouse_zoom.png" alt="core_2d_camera_mouse_zoom" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
| 10 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [avyy](https://github.com/avyy) |
| 11 | [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 12 | [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 13 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 14 | [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 15 | [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.4 | [Ray](https://github.com/raysan5) |
| 16 | [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) |
| 17 | [core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="80"> | ⭐️⭐️⭐️☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 18 | [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Anata](https://github.com/anatagawa) |
| 19 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
| 20 | [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
| 21 | [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="80"> | ⭐️☆☆☆ | 1.1 | 1.1 | [Ray](https://github.com/raysan5) |
| 22 | [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
| 23 | [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 24 | [core_loading_thread](core/core_loading_thread.c) | <img src="core/core_loading_thread.png" alt="core_loading_thread" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [Ray](https://github.com/raysan5) |
| 25 | [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="80"> | ⭐☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
| 26 | [core_basic_screen_manager](core/core_basic_screen_manager.c) | <img src="core/core_basic_screen_manager.png" alt="core_basic_screen_manager" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
| 27 | [core_custom_frame_control](core/core_custom_frame_control.c) | <img src="core/core_custom_frame_control.png" alt="core_custom_frame_control" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
| 28 | [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | <img src="core/core_smooth_pixelperfect.png" alt="core_smooth_pixelperfect" width="80"> | ⭐️⭐️⭐️☆ | 3.7 | **4.0** | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) |
| 29 | [core_split_screen](core/core_split_screen.c) | <img src="core/core_split_screen.png" alt="core_split_screen" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.0** | [Jeffery Myers](https://github.com/JeffM2501) |
| 30 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="80"> | ⭐☆☆☆ | 1.0 | 5.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="80"> | ⭐☆☆☆ | 1.1 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="80"> | ⭐☆☆☆ | 1.1 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="80"> | ⭐☆☆☆ | 2.1 | 2.5 | [Berni](https://github.com/Berni8k) |
| [core_input_gestures](core/core_input_gestures.c) | <img src="core/core_input_gestures.png" alt="core_input_gestures" width="80"> | ⭐☆☆ | 1.4 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_virtual_controls](core/core_input_virtual_controls.c) | <img src="core/core_input_virtual_controls.png" alt="core_input_virtual_controls" width="80"> | ⭐☆☆ | 5.0 | 5.0 | [oblerion](https://github.com/oblerion) |
| [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="80"> | ⭐☆☆ | 1.5 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | <img src="core/core_2d_camera_mouse_zoom.png" alt="core_2d_camera_mouse_zoom" width="80"> | ⭐⭐☆☆ | 4.2 | 4.2 | [Jeffery Myers](https://github.com/JeffM2501) |
| [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.0 | [arvyy](https://github.com/arvyy) |
| [core_2d_camera_split_screen](core/core_2d_camera_split_screen.c) | <img src="core/core_2d_camera_split_screen.png" alt="core_2d_camera_split_screen" width="80"> | ⭐⭐⭐⭐️ | 4.5 | 4.5 | [Gabriel dos Santos Sanches](https://github.com/gabrielssanches) |
| [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="80"> | ⭐☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="80"> | ⭐☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="80"> | ⭐☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_3d_camera_split_screen](core/core_3d_camera_split_screen.c) | <img src="core/core_3d_camera_split_screen.png" alt="core_3d_camera_split_screen" width="80"> | ⭐⭐⭐☆ | 3.7 | 4.0 | [Jeffery Myers](https://github.com/JeffM2501) |
| [core_3d_camera_fps](core/core_3d_camera_fps.c) | <img src="core/core_3d_camera_fps.png" alt="core_3d_camera_fps" width="80"> | ⭐⭐⭐☆ | 5.5 | 5.5 | [Agnis Aldins](https://github.com/nezvers) |
| [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="80"> | ⭐☆☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="80"> | ⭐☆☆ | 1.3 | 1.4 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) |
| [core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="80"> | ⭐⭐⭐☆ | 3.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="80"> | ⭐☆☆ | 2.5 | 4.0 | [Anata](https://github.com/anatagawa) |
| [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐☆☆☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="80"> | ⭐⭐☆☆ | 1.3 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="80"> | ⭐☆☆☆ | 1.1 | 1.1 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="80"> | ⭐☆☆ | 1.4 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="80"> | ⭐⭐⭐☆ | 2.5 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="80"> | ⭐☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
| [core_basic_screen_manager](core/core_basic_screen_manager.c) | <img src="core/core_basic_screen_manager.png" alt="core_basic_screen_manager" width="80"> | ⭐☆☆☆ | 4.0 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_custom_frame_control](core/core_custom_frame_control.c) | <img src="core/core_custom_frame_control.png" alt="core_custom_frame_control" width="80"> | ⭐⭐⭐⭐️ | 4.0 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | <img src="core/core_smooth_pixelperfect.png" alt="core_smooth_pixelperfect" width="80"> | ⭐⭐⭐☆ | 3.7 | 4.0 | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) |
| [core_random_sequence](core/core_random_sequence.c) | <img src="core/core_random_sequence.png" alt="core_random_sequence" width="80"> | ⭐☆☆☆ | 5.0 | 5.0 | [Dalton Overmyer](https://github.com/REDl3east) |
| [core_basic_window_web](core/core_basic_window_web.c) | <img src="core/core_basic_window_web.png" alt="core_basic_window_web" width="80"> | ⭐☆☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_input_gestures_web](core/core_input_gestures_web.c) | <img src="core/core_input_gestures_web.png" alt="core_input_gestures_web" width="80"> | ⭐⭐☆☆ | 4.6 | 4.6 | [ubkp](https://github.com/ubkp) |
| [core_automation_events](core/core_automation_events.c) | <img src="core/core_automation_events.png" alt="core_automation_events" width="80"> | ⭐⭐⭐☆ | 5.0 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [core_high_dpi](core/core_high_dpi.c) | <img src="core/core_high_dpi.png" alt="core_high_dpi" width="80"> | ⭐☆☆☆ | 5.0 | 5.0 | [Jonathan Marler](https://github.com/marler8997) |
### category: shapes
### category: shapes [20]
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/shapes.c) module.
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/rshapes.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 31 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="80"> | ⭐☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
| 32 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="80"> | ⭐☆☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 33 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="80"> | ⭐️⭐️☆☆ | 1.0 | 2.5 | [Ray](https://github.com/raysan5) |
| 34 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 35 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 36 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 37 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="80"> | ⭐☆☆☆ | 1.7 | 1.7 | [Ray](https://github.com/raysan5) |
| 38 | [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 39 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 40 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 41 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 42 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 43 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 44 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 45 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 46 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | <img src="shapes/shapes_top_down_lights.png" alt="shapes_top_down_lights" width="80"> | ⭐️⭐️⭐️⭐️ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="80"> | ⭐☆☆☆ | 1.0 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="80"> | ⭐☆☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="80"> | ⭐☆☆ | 1.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="80"> | ⭐☆☆ | 2.5 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="80"> | ⭐☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="80"> | ⭐☆☆☆ | 1.7 | 1.7 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="80"> | ⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="80"> | ⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="80"> | ⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="80"> | ⭐⭐⭐☆ | 2.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | <img src="shapes/shapes_top_down_lights.png" alt="shapes_top_down_lights" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 4.2 | [Jeffery Myers](https://github.com/JeffM2501) |
| [shapes_rectangle_advanced](shapes/shapes_rectangle_advanced.c) | <img src="shapes/shapes_rectangle_advanced.png" alt="shapes_rectangle_advanced" width="80"> | ⭐⭐⭐⭐️ | 5.5 | 5.5 | [Everton Jr.](https://github.com/evertonse) |
| [shapes_splines_drawing](shapes/shapes_splines_drawing.c) | <img src="shapes/shapes_splines_drawing.png" alt="shapes_splines_drawing" width="80"> | ⭐⭐⭐☆ | 5.0 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [shapes_digital_clock](shapes/shapes_digital_clock.c) | <img src="shapes/shapes_digital_clock.png" alt="shapes_digital_clock" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [Hamza RAHAL](https://github.com/rhmz-rhl) |
| [shapes_double_pendulum](shapes/shapes_double_pendulum.c) | <img src="shapes/shapes_double_pendulum.png" alt="shapes_double_pendulum" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [JoeCheong](https://github.com/Joecheong2006) |
### category: textures
### category: textures [26]
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/textures.c) module.
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/rtextures.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 47 | [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 48 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 49 | [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
| 50 | [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | 1.8 | [Ray](https://github.com/raysan5) |
| 51 | [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="80"> | ⭐☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 52 | [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="80"> | ⭐️⭐️⭐️☆ | 1.4 | 3.5 | [Ray](https://github.com/raysan5) |
| 53 | [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
| 54 | [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="80"> | ⭐☆☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 55 | [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
| 56 | [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="80"> | ⭐☆☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
| 57 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="80"> | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) |
| 58 | [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="80"> | ⭐☆☆☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) |
| 59 | [textures_sprite_anim](textures/textures_sprite_anim.c) | <img src="textures/textures_sprite_anim.png" alt="textures_sprite_anim" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 60 | [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 61 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 62 | [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | 2.5 | [Ray](https://github.com/raysan5) |
| 63 | [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
| 64 | [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="80"> | ⭐☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) |
| 65 | [textures_draw_tiled](textures/textures_draw_tiled.c) | <img src="textures/textures_draw_tiled.png" alt="textures_draw_tiled" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) |
| 66 | [textures_polygon](textures/textures_polygon.c) | <img src="textures/textures_polygon.png" alt="textures_polygon" width="80"> | ⭐☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) |
| 67 | [textures_fog_of_war](textures/textures_fog_of_war.c) | <img src="textures/textures_fog_of_war.png" alt="textures_fog_of_war" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
| 68 | [textures_gif_player](textures/textures_gif_player.c) | <img src="textures/textures_gif_player.png" alt="textures_gif_player" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="80"> | ⭐⭐⭐☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="80"> | ⭐☆☆ | 1.4 | 1.4 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="80"> | ⭐☆☆ | 1.8 | 1.8 | [Wilhem Barbier](https://github.com/nounoursheureux) |
| [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="80"> | ⭐☆☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="80"> | ⭐⭐⭐☆ | 1.4 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="80"> | ⭐☆☆ | 1.8 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="80"> | ⭐☆☆☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="80"> | ⭐⭐⭐☆ | 1.3 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="80"> | ⭐☆☆☆ | 1.7 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="80"> | ⭐⭐⭐☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) |
| [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="80"> | ⭐☆☆☆ | 2.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_sprite_anim](textures/textures_sprite_anim.c) | <img src="textures/textures_sprite_anim.png" alt="textures_sprite_anim" width="80"> | ⭐☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="80"> | ⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="80"> | ⭐☆☆ | 2.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="80"> | ⭐⭐⭐☆ | 1.6 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="80"> | ⭐⭐⭐☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
| [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="80"> | ⭐☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) |
| [textures_tiled_drawing](textures/textures_tiled_drawing.c) | <img src="textures/textures_tiled_drawing.png" alt="textures_tiled_drawing" width="80"> | ⭐⭐⭐☆ | 3.0 | 4.2 | [Vlad Adrian](https://github.com/demizdor) |
| [textures_polygon_drawing](textures/textures_polygon_drawing.c) | <img src="textures/textures_polygon_drawing.png" alt="textures_polygon_drawing" width="80"> | ⭐☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
| [textures_fog_of_war](textures/textures_fog_of_war.c) | <img src="textures/textures_fog_of_war.png" alt="textures_fog_of_war" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_gif_player](textures/textures_gif_player.c) | <img src="textures/textures_gif_player.png" alt="textures_gif_player" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_image_kernel](textures/textures_image_kernel.c) | <img src="textures/textures_image_kernel.png" alt="textures_image_kernel" width="80"> | ⭐⭐⭐⭐️ | 1.3 | 1.3 | [Karim Salem](https://github.com/kimo-s) |
| [textures_image_channel](textures/textures_image_channel.c) | <img src="textures/textures_image_channel.png" alt="textures_image_channel" width="80"> | ⭐⭐☆☆ | 5.1 | 5.1 | [Bruno Cabral](https://github.com/brccabral) |
| [textures_image_rotate](textures/textures_image_rotate.c) | <img src="textures/textures_image_rotate.png" alt="textures_image_rotate" width="80"> | ⭐⭐☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_textured_curve](textures/textures_textured_curve.c) | <img src="textures/textures_textured_curve.png" alt="textures_textured_curve" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Jeffery Myers](https://github.com/JeffM2501) |
### category: text
### category: text [13]
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/text.c) module.
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/rtext.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 69 | [text_raylib_fonts](text/text_raylib_fonts.c) | <img src="text/text_raylib_fonts.png" alt="text_raylib_fonts" width="80"> | ⭐☆☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
| 70 | [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 71 | [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
| 72 | [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="80"> | ⭐☆☆☆ | 1.4 | 3.0 | [Ray](https://github.com/raysan5) |
| 73 | [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 74 | [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="80"> | ⭐☆☆☆ | 1.1 | 3.0 | [Ray](https://github.com/raysan5) |
| 75 | [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
| 76 | [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
| 77 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
| 78 | [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
| 79 | [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="80"> | ⭐️⭐️⭐️⭐️ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
| 80 | [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐️⭐️⭐️ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
### category: models
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [text_sprite_fonts](text/text_sprite_fonts.c) | <img src="text/text_sprite_fonts.png" alt="text_sprite_fonts" width="80"> | ⭐☆☆☆ | 1.7 | 3.7 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="80"> | ⭐☆☆ | 1.3 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="80"> | ⭐☆☆☆ | 1.4 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="80"> | ⭐⭐⭐☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="80"> | ⭐☆☆☆ | 1.1 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="80"> | ⭐☆☆ | 1.7 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="80"> | ⭐☆☆ | 1.4 | 1.4 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
| [text_unicode_emojis](text/text_unicode_emojis.c) | <img src="text/text_unicode_emojis.png" alt="text_unicode_emojis" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
| [text_unicode_ranges](text/text_unicode_ranges.c) | <img src="text/text_unicode_ranges.png" alt="text_unicode_ranges" width="80"> | ⭐⭐⭐⭐️ | 5.5 | 5.6 | [Vlad Adrian](https://github.com/demizdor) |
| [text_3d_drawing](text/text_3d_drawing.c) | <img src="text/text_3d_drawing.png" alt="text_3d_drawing" width="80"> | ⭐⭐⭐⭐️ | 3.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
| [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/models.c) module.
### category: models [23]
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 81 | [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [culacant](https://github.com/culacant) |
| 82 | [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
| 83 | [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="80"> | ⭐️☆☆☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
| 84 | [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="80"> | ⭐️⭐️☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
| 85 | [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 86 | [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | 3.5 | [Ray](https://github.com/raysan5) |
| 87 | [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
| 88 | [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="80"> | ⭐️⭐️⭐️☆ | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) |
| 89 | [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="80"> | ⭐️☆☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 90 | [models_loading_gltf](models/models_loading_gltf.c) | <img src="models/models_loading_gltf.png" alt="models_loading_gltf" width="80"> | ⭐️☆☆☆ | 3.7 | **4.2** | [Ray](https://github.com/raysan5) |
| 91 | [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) |
| 92 | [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
| 93 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 94 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) |
| 95 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) |
| 96 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
| 97 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/rmodels.c) module.
### category: shaders
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="80"> | ⭐⭐☆☆ | 2.5 | 3.5 | [Culacant](https://github.com/culacant) |
| [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="80"> | ⭐⭐⭐☆ | 1.3 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="80"> | ⭐☆☆☆ | 1.3 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="80"> | ⭐⭐☆☆ | 1.8 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="80"> | ⭐⭐☆☆ | 2.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="80"> | ⭐☆☆☆ | 1.0 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="80"> | ⭐⭐⭐☆ | 1.7 | 4.0 | [Joel Davis](https://github.com/joeld42) |
| [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="80"> | ⭐☆☆☆ | 2.0 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_loading_gltf](models/models_loading_gltf.c) | <img src="models/models_loading_gltf.png" alt="models_loading_gltf" width="80"> | ⭐☆☆☆ | 3.7 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐☆☆☆ | 4.0 | 4.0 | [Johann Nadalutti](https://github.com/procfxgen) |
| [models_loading_m3d](models/models_loading_m3d.c) | <img src="models/models_loading_m3d.png" alt="models_loading_m3d" width="80"> | ⭐⭐☆☆ | 4.5 | 4.5 | [bzt](https://github.com/model3d) |
| [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
| [models_point_rendering](models/models_point_rendering.c) | <img src="models/models_point_rendering.png" alt="models_point_rendering" width="80"> | ⭐⭐⭐☆ | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) |
| [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Berni](https://github.com/Berni8k) |
| [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.7 | [Codecat](https://github.com/codecat) |
| [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐☆☆☆ | 1.8 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_skybox_rendering](models/models_skybox_rendering.c) | <img src="models/models_skybox_rendering.png" alt="models_skybox_rendering" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_draw_cube_texture](models/models_draw_cube_texture.c) | <img src="models/models_draw_cube_texture.png" alt="models_draw_cube_texture" width="80"> | ⭐⭐☆☆ | 4.5 | 4.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [models_gpu_skinning](models/models_gpu_skinning.c) | <img src="models/models_gpu_skinning.png" alt="models_gpu_skinning" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Daniel Holden](https://github.com/orangeduck) |
| [models_bone_socket](models/models_bone_socket.c) | <img src="models/models_bone_socket.png" alt="models_bone_socket" width="80"> | ⭐⭐⭐⭐️ | 4.5 | 4.5 | [iP](https://github.com/ipzaur) |
| [models_tesseract_view](models/models_tesseract_view.c) | <img src="models/models_tesseract_view.png" alt="models_tesseract_view" width="80"> | ⭐⭐☆☆ | 5.6 | 5.6 | [Timothy van der Valk](https://github.com/arceryz) |
### category: shaders [29]
Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 98 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) |
| 99 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) |
| 100 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
| 101 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 102 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 103 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
| 104 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) |
| 105 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) |
| 106 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) |
| 107 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
| 108 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) |
| 109 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) |
| 110 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
| 111 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
| 112 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) |
| 113 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) |
| 114 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 115 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
### category: audio
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐⭐⭐⭐️ | 3.0 | 4.2 | [Chris Camacho](https://github.com/chriscamacho) |
| [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐☆☆ | 1.3 | 3.7 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐☆☆ | 1.7 | 3.7 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐☆☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐⭐⭐☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
| [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐⭐⭐⭐️ | 2.0 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/ciessielski) |
| [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐⭐⭐☆ | 4.0 | 4.0 | [Samuel Skiff](https://github.com/GoldenThumbs) |
| [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
| [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐⭐⭐☆ | 2.5 | 4.0 | [Josh Colclough](https://github.com/joshcol9232) |
| [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐⭐⭐☆ | 2.5 | 4.0 | [ProfJski](https://github.com/ProfJski) |
| [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
| [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
| [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐⭐⭐☆ | 3.0 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐⭐⭐⭐️ | 3.7 | 4.2 | [seanpringle](https://github.com/seanpringle) |
| [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐☆☆ | 3.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [shaders_normal_map](shaders/shaders_normal_map.c) | <img src="shaders/shaders_normal_map.png" alt="shaders_normal_map" width="80"> | ⭐⭐⭐⭐️ | 5.6 | 5.6 | [Jeremy Montgomery](https://github.com/Sir_Irk) |
| [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐⭐☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
| [shaders_deferred_render](shaders/shaders_deferred_render.c) | <img src="shaders/shaders_deferred_render.png" alt="shaders_deferred_render" width="80"> | ⭐⭐⭐⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) |
| [shaders_hybrid_render](shaders/shaders_hybrid_render.c) | <img src="shaders/shaders_hybrid_render.png" alt="shaders_hybrid_render" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 4.2 | [Buğra Alptekin Sarı](https://github.com/BugraAlptekinSari) |
| [shaders_texture_tiling](shaders/shaders_texture_tiling.c) | <img src="shaders/shaders_texture_tiling.png" alt="shaders_texture_tiling" width="80"> | ⭐⭐☆☆ | 4.5 | 4.5 | [Luis Almeida](https://github.com/luis605) |
| [shaders_shadowmap](shaders/shaders_shadowmap.c) | <img src="shaders/shaders_shadowmap.png" alt="shaders_shadowmap" width="80"> | ⭐⭐⭐⭐️ | 5.0 | 5.0 | [TheManTheMythTheGameDev](https://github.com/TheManTheMythTheGameDev) |
| [shaders_vertex_displacement](shaders/shaders_vertex_displacement.c) | <img src="shaders/shaders_vertex_displacement.png" alt="shaders_vertex_displacement" width="80"> | ⭐⭐⭐☆ | 5.0 | 4.5 | [Alex ZH](https://github.com/ZzzhHe) |
| [shaders_write_depth](shaders/shaders_write_depth.c) | <img src="shaders/shaders_write_depth.png" alt="shaders_write_depth" width="80"> | ⭐⭐☆☆ | 4.2 | 4.2 | [Buğra Alptekin Sarı](https://github.com/BugraAlptekinSari) |
| [shaders_basic_pbr](shaders/shaders_basic_pbr.c) | <img src="shaders/shaders_basic_pbr.png" alt="shaders_basic_pbr" width="80"> | ⭐⭐⭐⭐️ | 5.0 | 5.1 | [Afan OLOVCIC](https://github.com/_DevDad) |
| [shaders_lightmap](shaders/shaders_lightmap.c) | <img src="shaders/shaders_lightmap.png" alt="shaders_lightmap" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Jussi Viitala](https://github.com/nullstare) |
| [shaders_rounded_rectangle](shaders/shaders_rounded_rectangle.c) | <img src="shaders/shaders_rounded_rectangle.png" alt="shaders_rounded_rectangle" width="80"> | ⭐⭐⭐☆ | 5.5 | 5.5 | [Anstro Pleuton](https://github.com/anstropleuton) |
| [shaders_view_depth](shaders/shaders_view_depth.c) | <img src="shaders/shaders_view_depth.png" alt="shaders_view_depth" width="80"> | ⭐⭐⭐☆ | 5.6 | 5.6 | [Luís Almeida](https://github.com/luis605) |
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib, check [raudio_standalone](others/raudio_standalone.c) example.
### category: audio [8]
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 116 | [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="80"> | ⭐️☆☆☆ | 1.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 117 | [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="80"> | ⭐️☆☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
| 118 | [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | **4.2** | [Ray](https://github.com/raysan5) |
| 119 | [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) |
| 120 | [audio_multichannel_sound](audio/audio_multichannel_sound.c) | <img src="audio/audio_multichannel_sound.png" alt="audio_multichannel_sound" width="80"> | ⭐️☆☆☆ | 3.0 | 3.5 | [Chris Camacho](https://github.com/codifies) |
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib.
### category: others
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="80"> | ⭐☆☆☆ | 1.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="80"> | ⭐☆☆☆ | 1.3 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="80"> | ⭐⭐⭐☆ | 1.6 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐☆☆☆ | 1.1 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
| [audio_mixed_processor](audio/audio_mixed_processor.c) | <img src="audio/audio_mixed_processor.png" alt="audio_mixed_processor" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 4.2 | [hkc](https://github.com/hatkidchan) |
| [audio_stream_effects](audio/audio_stream_effects.c) | <img src="audio/audio_stream_effects.png" alt="audio_stream_effects" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [audio_sound_multi](audio/audio_sound_multi.c) | <img src="audio/audio_sound_multi.png" alt="audio_sound_multi" width="80"> | ⭐⭐☆☆ | 4.6 | 4.6 | [Jeffery Myers](https://github.com/JeffM2501) |
| [audio_sound_positioning](audio/audio_sound_positioning.c) | <img src="audio/audio_sound_positioning.png" alt="audio_sound_positioning" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [Le Juez Victor](https://github.com/Bigfoot71) |
### category: others [6]
Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 121 | [rlgl_standalone](others/rlgl_standalone.c) | <img src="others/rlgl_standalone.png" alt="rlgl_standalone" width="80"> | ⭐️⭐️⭐️⭐️ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) |
| 122 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | <img src="others/rlgl_compute_shader.png" alt="rlgl_compute_shader" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) |
| 123 | [easings_testbed](others/easings_testbed.c) | <img src="others/easings_testbed.png" alt="easings_testbed" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) |
| 124 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | <img src="others/raylib_opengl_interop.png" alt="raylib_opengl_interop" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) |
| 125 | [embedded_files_loading](others/embedded_files_loading.c) | <img src="others/embedded_files_loading.png" alt="embedded_files_loading" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) |
As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with!
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
| [rlgl_standalone](others/rlgl_standalone.c) | <img src="others/rlgl_standalone.png" alt="rlgl_standalone" width="80"> | ⭐⭐⭐⭐️ | 1.6 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [rlgl_compute_shader](others/rlgl_compute_shader.c) | <img src="others/rlgl_compute_shader.png" alt="rlgl_compute_shader" width="80"> | ⭐⭐⭐⭐️ | 4.0 | 4.0 | [Teddy Astie](https://github.com/tsnake41) |
| [easings_testbed](others/easings_testbed.c) | <img src="others/easings_testbed.png" alt="easings_testbed" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) |
| [raylib_opengl_interop](others/raylib_opengl_interop.c) | <img src="others/raylib_opengl_interop.png" alt="raylib_opengl_interop" width="80"> | ⭐⭐⭐⭐️ | 3.8 | 4.0 | [Stephan Soller](https://github.com/arkanis) |
| [embedded_files_loading](others/embedded_files_loading.c) | <img src="others/embedded_files_loading.png" alt="embedded_files_loading" width="80"> | ⭐☆☆ | 3.0 | 3.5 | [Kristian Holmgren](https://github.com/defutura) |
| [raymath_vector_angle](others/raymath_vector_angle.c) | <img src="others/raymath_vector_angle.png" alt="raymath_vector_angle" width="80"> | ⭐⭐☆☆ | 1.0 | 4.6 | [Ramon Santamaria](https://github.com/raysan5) |
Some example missing? As always, contributions are welcome, feel free to send new examples!
Here is an[examples template](examples_template.c) with instructions to start with!

View File

@@ -0,0 +1,125 @@
/*******************************************************************************************
*
* raylib [audio] example - mixed audio processing
*
* Example complexity rating: [★★★★] 4/4
*
* Example originally created with raylib 4.2, last time updated with raylib 4.2
*
* Example contributed by hkc (@hatkidchan) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2023-2025 hkc (@hatkidchan)
*
********************************************************************************************/
#include "raylib.h"
#include <math.h>
static float exponent = 1.0f; // Audio exponentiation value
static float averageVolume[400] = { 0.0f }; // Average volume history
//------------------------------------------------------------------------------------
// Audio processing function
//------------------------------------------------------------------------------------
void ProcessAudio(void *buffer, unsigned int frames)
{
float *samples = (float *)buffer; // Samples internally stored as <float>s
float average = 0.0f; // Temporary average volume
for (unsigned int frame = 0; frame < frames; frame++)
{
float *left = &samples[frame*2 + 0], *right = &samples[frame*2 + 1];
*left = powf(fabsf(*left), exponent)*( (*left < 0.0f)? -1.0f : 1.0f );
*right = powf(fabsf(*right), exponent)*( (*right < 0.0f)? -1.0f : 1.0f );
average += fabsf(*left)/frames; // accumulating average volume
average += fabsf(*right)/frames;
}
// Moving history to the left
for (int i = 0; i < 399; i++) averageVolume[i] = averageVolume[i + 1];
averageVolume[399] = average; // Adding last average value
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [audio] example - mixed audio processing");
InitAudioDevice(); // Initialize audio device
AttachAudioMixedProcessor(ProcessAudio);
Music music = LoadMusicStream("resources/country.mp3");
Sound sound = LoadSound("resources/coin.wav");
PlayMusicStream(music);
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // Update music buffer with new stream data
// Modify processing variables
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_LEFT)) exponent -= 0.05f;
if (IsKeyPressed(KEY_RIGHT)) exponent += 0.05f;
if (exponent <= 0.5f) exponent = 0.5f;
if (exponent >= 3.0f) exponent = 3.0f;
if (IsKeyPressed(KEY_SPACE)) PlaySound(sound);
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
DrawText(TextFormat("EXPONENT = %.2f", exponent), 215, 180, 20, LIGHTGRAY);
DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
for (int i = 0; i < 400; i++)
{
DrawLine(201 + i, 232 - (int)(averageVolume[i]*32), 201 + i, 232, MAROON);
}
DrawRectangleLines(199, 199, 402, 34, GRAY);
DrawText("PRESS SPACE TO PLAY OTHER SOUND", 200, 250, 20, LIGHTGRAY);
DrawText("USE LEFT AND RIGHT ARROWS TO ALTER DISTORTION", 140, 280, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadMusicStream(music); // Unload music stream buffers from RAM
DetachAudioMixedProcessor(ProcessAudio); // Disconnect audio processor
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [audio] example - Module playing (streaming)
* raylib [audio] example - module playing (streaming)
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.5, last time updated with raylib 3.5
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2016-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -79,6 +81,7 @@ int main(void)
{
StopMusicStream(music);
PlayMusicStream(music);
pause = false;
}
// Pause/Resume music playing
@@ -134,6 +137,14 @@ int main(void)
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
// Draw help instructions
DrawRectangle(20, 20, 425, 145, WHITE);
DrawRectangleLines(20, 20, 425, 145, GRAY);
DrawText("PRESS SPACE TO RESTART MUSIC", 40, 40, 20, BLACK);
DrawText("PRESS P TO PAUSE/RESUME", 40, 70, 20, BLACK);
DrawText("PRESS UP/DOWN TO CHANGE SPEED", 40, 100, 20, BLACK);
DrawText(TextFormat("SPEED: %f", pitch), 40, 130, 20, MAROON);
EndDrawing();
//----------------------------------------------------------------------------------
}
@@ -148,4 +159,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [audio] example - Music playing (streaming)
* raylib [audio] example - music playing (streaming)
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.3, last time updated with raylib 4.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -34,7 +36,7 @@ int main(void)
float timePlayed = 0.0f; // Time played normalized [0.0f..1.0f]
bool pause = false; // Music playing paused
SetTargetFPS(30); // Set our game to run at 60 frames-per-second
SetTargetFPS(30); // Set our game to run at 30 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
@@ -43,7 +45,7 @@ int main(void)
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // Update music buffer with new stream data
// Restart music playing (stop and play)
if (IsKeyPressed(KEY_SPACE))
{
@@ -95,4 +97,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [audio] example - Raw audio streaming
* raylib [audio] example - raw audio streaming
*
* Example complexity rating: [★★★☆] 3/4
*
* Example originally created with raylib 1.6, last time updated with raylib 4.2
*
@@ -9,7 +11,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
*
********************************************************************************************/
@@ -38,12 +40,11 @@ float sineIdx = 0.0f;
void AudioInputCallback(void *buffer, unsigned int frames)
{
audioFrequency = frequency + (audioFrequency - frequency)*0.95f;
audioFrequency += 1.0f;
audioFrequency -= 1.0f;
float incr = audioFrequency/44100.0f;
short *d = (short *)buffer;
for (int i = 0; i < frames; i++)
for (unsigned int i = 0; i < frames; i++)
{
d[i] = (short)(32000.0f*sinf(2*PI*sineIdx));
sineIdx += incr;
@@ -107,8 +108,6 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
// Sample mouse input.
mousePosition = GetMousePosition();
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT))
@@ -116,7 +115,7 @@ int main(void)
float fp = (float)(mousePosition.y);
frequency = 40.0f + (float)(fp);
float pan = (float)(mousePosition.x) / (float)screenWidth;
float pan = (float)(mousePosition.x)/(float)screenWidth;
SetAudioStreamPan(stream, pan);
}
@@ -124,7 +123,7 @@ int main(void)
// Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc.
if (frequency != oldFrequency)
{
// Compute wavelength. Limit size in both directions.
// Compute wavelength. Limit size in both directions
//int oldWavelength = waveLength;
waveLength = (int)(22050/frequency);
if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2;
@@ -142,7 +141,7 @@ int main(void)
}
// Scale read cursor's position to minimize transition artifacts
//readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));
//readCursor = (int)(readCursor*((float)waveLength/(float)oldWavelength));
oldFrequency = frequency;
}

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [audio] example - Sound loading and playing
* raylib [audio] example - sound loading and playing
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.1, last time updated with raylib 3.5
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

@@ -1,20 +1,26 @@
/*******************************************************************************************
*
* raylib [audio] example - Multichannel sound playing
* raylib [audio] example - sound alias
*
* Example originally created with raylib 3.0, last time updated with raylib 3.5
* Example complexity rating: [] 2/4
*
* Example contributed by Chris Camacho (@chriscamacho) and reviewed by Ramon Santamaria (@raysan5)
* Example originally created with raylib 4.6, last time updated with raylib 4.6
*
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2022 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5)
* Copyright (c) 2023-2025 Jeffery Myers (@JeffM2501)
*
********************************************************************************************/
#include "raylib.h"
#define MAX_SOUNDS 10
Sound soundArray[MAX_SOUNDS] = { 0 };
int currentSound;
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
@@ -25,16 +31,20 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [audio] example - Multichannel sound playing");
InitWindow(screenWidth, screenHeight, "raylib [audio] example - sound alias");
InitAudioDevice(); // Initialize audio device
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
Sound fxOgg = LoadSound("resources/target.ogg"); // Load OGG audio file
// Load audio file into the first slot as the 'source' sound,
// this sound owns the sample data
soundArray[0] = LoadSound("resources/sound.wav");
SetSoundVolume(fxWav, 0.2f);
// Load an alias of the sound into slots 1-9. These do not own the sound data, but can be played
for (int i = 1; i < MAX_SOUNDS; i++) soundArray[i] = LoadSoundAlias(soundArray[0]);
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
currentSound = 0; // Set the sound list to the start
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
@@ -42,8 +52,17 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_ENTER)) PlaySoundMulti(fxWav); // Play a new wav sound instance
if (IsKeyPressed(KEY_SPACE)) PlaySoundMulti(fxOgg); // Play a new ogg sound instance
if (IsKeyPressed(KEY_SPACE))
{
PlaySound(soundArray[currentSound]); // Play the next open sound slot
currentSound++; // Increment the sound slot
// If the sound slot is out of bounds, go back to 0
if (currentSound >= MAX_SOUNDS) currentSound = 0;
// NOTE: Another approach would be to look at the list for the first sound
// that is not playing and use that slot
}
//----------------------------------------------------------------------------------
// Draw
@@ -52,11 +71,7 @@ int main(void)
ClearBackground(RAYWHITE);
DrawText("MULTICHANNEL SOUND PLAYING", 20, 20, 20, GRAY);
DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, LIGHTGRAY);
DrawText("Press ENTER to play new wav instance!", 200, 180, 20, LIGHTGRAY);
DrawText(TextFormat("CONCURRENT SOUNDS PLAYING: %02i", GetSoundsPlaying()), 220, 280, 20, RED);
DrawText("Press SPACE to PLAY a WAV sound!", 200, 180, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -64,10 +79,8 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
StopSoundMulti(); // We must stop the buffer pool before unloading
UnloadSound(fxWav); // Unload sound data
UnloadSound(fxOgg); // Unload sound data
for (int i = 1; i < MAX_SOUNDS; i++) UnloadSoundAlias(soundArray[i]); // Unload sound aliases
UnloadSound(soundArray[0]); // Unload source sound data
CloseAudioDevice(); // Close audio device
@@ -75,4 +88,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,128 @@
/*******************************************************************************************
*
* raylib [audio] example - 3d sound positioning
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 5.5, last time updated with raylib 5.5
*
* Example contributed by Le Juez Victor (@Bigfoot71) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2025 Le Juez Victor (@Bigfoot71)
*
********************************************************************************************/
#include "raylib.h"
#include "raymath.h"
//------------------------------------------------------------------------------------
// Module Functions Declaration
//------------------------------------------------------------------------------------
static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [audio] example - 3d sound positioning");
InitAudioDevice();
Sound sound = LoadSound("resources/coin.wav");
Camera camera = {
.position = (Vector3) { 0, 5, 5 },
.target = (Vector3) { 0, 0, 0 },
.up = (Vector3) { 0, 1, 0 },
.fovy = 60,
.projection = CAMERA_PERSPECTIVE
};
DisableCursor();
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose())
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera, CAMERA_FREE);
float th = GetTime();
Vector3 spherePos = {
.x = 5.0f*cosf(th),
.y = 0.0f,
.z = 5.0f*sinf(th)
};
SetSoundPosition(camera, sound, spherePos, 20.0f);
if (!IsSoundPlaying(sound)) PlaySound(sound);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode3D(camera);
DrawGrid(10, 2);
DrawSphere(spherePos, 0.5f, RED);
EndMode3D();
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadSound(sound);
CloseAudioDevice(); // Close audio device
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------------
// Module Functions Definition
//------------------------------------------------------------------------------------
// Set sound 3d position
static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist)
{
// Calculate direction vector and distance between listener and sound source
Vector3 direction = Vector3Subtract(position, listener.position);
float distance = Vector3Length(direction);
// Apply logarithmic distance attenuation and clamp between 0-1
float attenuation = 1.0f/(1.0f + (distance/maxDist));
attenuation = Clamp(attenuation, 0.0f, 1.0f);
// Calculate normalized vectors for spatial positioning
Vector3 normalizedDirection = Vector3Normalize(direction);
Vector3 forward = Vector3Normalize(Vector3Subtract(listener.target, listener.position));
Vector3 right = Vector3Normalize(Vector3CrossProduct(listener.up, forward));
// Reduce volume for sounds behind the listener
float dotProduct = Vector3DotProduct(forward, normalizedDirection);
if (dotProduct < 0.0f) attenuation *= (1.0f + dotProduct*0.5f);
// Set stereo panning based on sound position relative to listener
float pan = 0.5f + 0.5f*Vector3DotProduct(normalizedDirection, right);
// Apply final sound properties
SetSoundVolume(sound, attenuation);
SetSoundPan(sound, pan);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -1,21 +1,25 @@
/*******************************************************************************************
*
* raylib [audio] example - Music stream processing effects
* raylib [audio] example - stream effects
*
* Example originally created with raylib 4.2, last time updated with raylib 4.2
* Example complexity rating: [★★★★] 4/4
*
* Example originally created with raylib 4.2, last time updated with raylib 5.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2022-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <stdlib.h> // Required for: NULL
#include <stdlib.h> // Required for: NULL
// Required delay effect variables
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
static float *delayBuffer = NULL;
static unsigned int delayBufferSize = 0;
static unsigned int delayReadIndex = 2;
@@ -51,7 +55,7 @@ int main(void)
float timePlayed = 0.0f; // Time played normalized [0.0f..1.0f]
bool pause = false; // Music playing paused
bool enableEffectLPF = false; // Enable effect low-pass-filter
bool enableEffectDelay = false; // Enable effect delay (1 second)
@@ -96,7 +100,7 @@ int main(void)
if (enableEffectDelay) AttachAudioStreamProcessor(music.stream, AudioProcessEffectDelay);
else DetachAudioStreamProcessor(music.stream, AudioProcessEffectDelay);
}
// Get normalized time played for current music stream
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
@@ -117,7 +121,7 @@ int main(void)
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 230, 20, LIGHTGRAY);
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 260, 20, LIGHTGRAY);
DrawText(TextFormat("PRESS F TO TOGGLE LPF EFFECT: %s", enableEffectLPF? "ON" : "OFF"), 200, 320, 20, GRAY);
DrawText(TextFormat("PRESS D TO TOGGLE DELAY EFFECT: %s", enableEffectDelay? "ON" : "OFF"), 180, 350, 20, GRAY);
@@ -146,16 +150,20 @@ int main(void)
static void AudioProcessEffectLPF(void *buffer, unsigned int frames)
{
static float low[2] = { 0.0f, 0.0f };
static const float cutoff = 70.0f / 44100.0f; // 70 Hz lowpass filter
const float k = cutoff / (cutoff + 0.1591549431f); // RC filter formula
static const float cutoff = 70.0f/44100.0f; // 70 Hz lowpass filter
const float k = cutoff/(cutoff + 0.1591549431f); // RC filter formula
// Converts the buffer data before using it
float *bufferData = (float *)buffer;
for (unsigned int i = 0; i < frames*2; i += 2)
{
float l = ((float *)buffer)[i], r = ((float *)buffer)[i + 1];
low[0] += k * (l - low[0]);
low[1] += k * (r - low[1]);
((float *)buffer)[i] = low[0];
((float *)buffer)[i + 1] = low[1];
const float l = bufferData[i];
const float r = bufferData[i + 1];
low[0] += k*(l - low[0]);
low[1] += k*(r - low[1]);
bufferData[i] = low[0];
bufferData[i + 1] = low[1];
}
}
@@ -176,4 +184,4 @@ static void AudioProcessEffectDelay(void *buffer, unsigned int frames)
delayBuffer[delayWriteIndex++] = ((float *)buffer)[i + 1];
if (delayWriteIndex == delayBufferSize) delayWriteIndex = 0;
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,97 +0,0 @@
const std = @import("std");
const builtin = @import("builtin");
fn add_module(comptime module: []const u8, b: *std.build.Builder, target: std.zig.CrossTarget) !*std.build.Step {
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
const all = b.step(module, "All " ++ module ++ " examples");
const dir = try std.fs.cwd().openIterableDir(module, .{});
var iter = dir.iterate();
while (try iter.next()) |entry| {
if (entry.kind != .File) continue;
const extension_idx = std.mem.lastIndexOf(u8, entry.name, ".c") orelse continue;
const name = entry.name[0..extension_idx];
const path = try std.fs.path.join(b.allocator, &.{ module, entry.name });
// zig's mingw headers do not include pthread.h
if (std.mem.eql(u8, "core_loading_thread", name) and target.getOsTag() == .windows) continue;
const exe = b.addExecutable(name, null);
exe.addCSourceFile(path, switch (target.getOsTag()) {
.windows => &[_][]const u8{},
.linux => &[_][]const u8{},
.macos => &[_][]const u8{"-DPLATFORM_DESKTOP"},
else => @panic("Unsupported OS"),
});
exe.setTarget(target);
exe.setBuildMode(mode);
exe.linkLibC();
exe.addObjectFile(switch (target.getOsTag()) {
.windows => "../src/raylib.lib",
.linux => "../src/libraylib.a",
.macos => "../src/libraylib.a",
else => @panic("Unsupported OS"),
});
exe.addIncludeDir("../src");
exe.addIncludeDir("../src/external");
exe.addIncludeDir("../src/external/glfw/include");
switch (exe.target.toTarget().os.tag) {
.windows => {
exe.linkSystemLibrary("winmm");
exe.linkSystemLibrary("gdi32");
exe.linkSystemLibrary("opengl32");
exe.addIncludeDir("external/glfw/deps/mingw");
},
.linux => {
exe.linkSystemLibrary("GL");
exe.linkSystemLibrary("rt");
exe.linkSystemLibrary("dl");
exe.linkSystemLibrary("m");
exe.linkSystemLibrary("X11");
},
.macos => {
exe.linkFramework("Foundation");
exe.linkFramework("Cocoa");
exe.linkFramework("OpenGL");
exe.linkFramework("CoreAudio");
exe.linkFramework("CoreVideo");
exe.linkFramework("IOKit");
},
else => {
@panic("Unsupported OS");
},
}
exe.setOutputDir(module);
var run = exe.run();
run.step.dependOn(&b.addInstallArtifact(exe).step);
run.cwd = module;
b.step(name, name).dependOn(&run.step);
all.dependOn(&exe.step);
}
return all;
}
pub fn build(b: *std.build.Builder) !void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
const all = b.getInstallStep();
all.dependOn(try add_module("audio", b, target));
all.dependOn(try add_module("core", b, target));
all.dependOn(try add_module("models", b, target));
all.dependOn(try add_module("others", b, target));
all.dependOn(try add_module("shaders", b, target));
all.dependOn(try add_module("shapes", b, target));
all.dependOn(try add_module("text", b, target));
all.dependOn(try add_module("textures", b, target));
}

View File

@@ -0,0 +1,44 @@
::@echo off
:: .
:: Compile your examples for web using: build_example_web.bat <example_category>/<example_name>
:: .
SET "INPUT_FILE=%1"
:: Change delimiter for the FOR loop
FOR /f "tokens=1-10 delims=/" %%a IN ("%INPUT_FILE%") DO (
SET CATEGORY=%%a
SET FILENAME=%%b
)
:: > SETup required Environment
:: -------------------------------------
SET RAYLIB_PATH=C:\GitHub\raylib
SET EMSDK_PATH=C:\raylib\emsdk
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=%COMPILER_PATH%
SET MAKE=mingw32-make
echo
:: Set required web compilation options
:: -------------------------------------
::SET CC=%EMSDK_PATH%\upstream\emscripten\emcc
::SET CFLAGS=-Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -O3 -I. -Iexternal -I%RAYLIB_PATH%\src -I%RAYLIB_PATH%\external -DPLATFORM_WEB
::SET LDFLAGS=-L. -L$(RAYLIB_PATH)\src -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall -sASYNCIFY --shell-file %RAYLIB_PATH%\src\shell.html
::SET LDLIBS=%RAYLIB_PATH%\src\libraylib.web.a
echo
:: Clean latest build
:: ------------------------
cmd /c if exist %FILENAME%.html del /F %FILENAME%.html
cmd /c if exist %FILENAME%.wasm del /F %FILENAME%.wasm
cmd /c if exist %FILENAME%.js del /F %FILENAME%.js
cmd /c if exist %FILENAME%.data del /F %FILENAME%.data
echo
:: Setup emsdk environment
:: --------------------------
call %EMSDK_PATH%\emsdk_env.bat
echo on
:: Compile program
:: -----------------------
C:
cd %RAYLIB_PATH%\examples
%MAKE% -f Makefile.Web %CATEGORY%/%FILENAME% PLATFORM=PLATFORM_WEB -B
::%CC% -o %FILENAME%.html %FILENAME%.c %CFLAGS% %LDFLAGS% %LDLIBS% %RESOURCES%
cd ..
echo

View File

@@ -2,16 +2,19 @@
*
* raylib [core] example - 2d camera
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 1.5, last time updated with raylib 3.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2016-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <math.h>
#define MAX_BUILDINGS 100
@@ -42,7 +45,11 @@ int main(void)
spacing += (int)buildings[i].width;
buildColors[i] = (Color){ GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255 };
buildColors[i] = (Color){
(unsigned char)GetRandomValue(200, 240),
(unsigned char)GetRandomValue(200, 240),
(unsigned char)GetRandomValue(200, 250),
255};
}
Camera2D camera = { 0 };
@@ -75,7 +82,8 @@ int main(void)
else if (camera.rotation < -40) camera.rotation = -40;
// Camera zoom controls
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
// Uses log scaling to provide consistent zoom speed
camera.zoom = expf(logf(camera.zoom) + ((float)GetMouseWheelMove()*0.1f));
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
else if (camera.zoom < 0.1f) camera.zoom = 0.1f;

View File

@@ -2,12 +2,16 @@
*
* raylib [core] example - 2d camera mouse zoom
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 4.2, last time updated with raylib 4.2
*
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2022 Jeffery Myers (@JeffM2501)
* Copyright (c) 2022-2025 Jeffery Myers (@JeffM2501)
*
********************************************************************************************/
@@ -31,6 +35,8 @@ int main ()
Camera2D camera = { 0 };
camera.zoom = 1.0f;
int zoomMode = 0; // 0-Mouse Wheel, 1-Mouse Move
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -39,46 +45,73 @@ int main ()
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_ONE)) zoomMode = 0;
else if (IsKeyPressed(KEY_TWO)) zoomMode = 1;
// Translate based on mouse right click
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT))
{
Vector2 delta = GetMouseDelta();
delta = Vector2Scale(delta, -1.0f/camera.zoom);
camera.target = Vector2Add(camera.target, delta);
}
// Zoom based on mouse wheel
float wheel = GetMouseWheelMove();
if (wheel != 0)
if (zoomMode == 0)
{
// Get the world point that is under the mouse
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
// Set the offset to where the mouse is
camera.offset = GetMousePosition();
// Zoom based on mouse wheel
float wheel = GetMouseWheelMove();
if (wheel != 0)
{
// Get the world point that is under the mouse
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
// Set the target to match, so that the camera maps the world space point
// under the cursor to the screen space point under the cursor at any zoom
camera.target = mouseWorldPos;
// Set the offset to where the mouse is
camera.offset = GetMousePosition();
// Zoom increment
const float zoomIncrement = 0.125f;
// Set the target to match, so that the camera maps the world space point
// under the cursor to the screen space point under the cursor at any zoom
camera.target = mouseWorldPos;
camera.zoom += (wheel*zoomIncrement);
if (camera.zoom < zoomIncrement) camera.zoom = zoomIncrement;
// Zoom increment
// Uses log scaling to provide consistent zoom speed
float scale = 0.2f*wheel;
camera.zoom = Clamp(expf(logf(camera.zoom)+scale), 0.125f, 64.0f);
}
}
else
{
// Zoom based on mouse right click
if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT))
{
// Get the world point that is under the mouse
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
// Set the offset to where the mouse is
camera.offset = GetMousePosition();
// Set the target to match, so that the camera maps the world space point
// under the cursor to the screen space point under the cursor at any zoom
camera.target = mouseWorldPos;
}
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
{
// Zoom increment
// Uses log scaling to provide consistent zoom speed
float deltaX = GetMouseDelta().x;
float scale = 0.005f*deltaX;
camera.zoom = Clamp(expf(logf(camera.zoom)+scale), 0.125f, 64.0f);
}
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(BLACK);
ClearBackground(RAYWHITE);
BeginMode2D(camera);
// Draw the 3d grid, rotated 90 degrees and centered around 0,0
// Draw the 3d grid, rotated 90 degrees and centered around 0,0
// just so we have something in the XY plane
rlPushMatrix();
rlTranslatef(0, 25*50, 0);
@@ -87,12 +120,20 @@ int main ()
rlPopMatrix();
// Draw a reference circle
DrawCircle(100, 100, 50, YELLOW);
DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON);
EndMode2D();
DrawText("Mouse right button drag to move, mouse wheel to zoom", 10, 10, 20, WHITE);
// Draw mouse reference
//Vector2 mousePos = GetWorldToScreen2D(GetMousePosition(), camera)
DrawCircleV(GetMousePosition(), 4, DARKGRAY);
DrawTextEx(GetFontDefault(), TextFormat("[%i, %i]", GetMouseX(), GetMouseY()),
Vector2Add(GetMousePosition(), (Vector2){ -44, -24 }), 20, 2, BLACK);
DrawText("[1][2] Select mouse zoom mode (Wheel or Move)", 20, 20, 20, DARKGRAY);
if (zoomMode == 0) DrawText("Mouse left button drag to move, mouse wheel to zoom", 20, 50, 20, DARKGRAY);
else DrawText("Mouse left button drag to move, mouse press and move to zoom", 20, 50, 20, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
@@ -102,4 +143,4 @@ int main ()
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -2,6 +2,8 @@
*
* raylib [core] example - 2d camera platformer
*
* Example complexity rating: [★★★☆] 3/4
*
* Example originally created with raylib 2.5, last time updated with raylib 3.0
*
* Example contributed by arvyy (@arvyy) and reviewed by Ramon Santamaria (@raysan5)
@@ -9,7 +11,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2022 arvyy (@arvyy)
* Copyright (c) 2019-2025 arvyy (@arvyy)
*
********************************************************************************************/
@@ -20,6 +22,9 @@
#define PLAYER_JUMP_SPD 350.0f
#define PLAYER_HOR_SPD 200.0f
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
typedef struct Player {
Vector2 position;
float speed;
@@ -33,7 +38,7 @@ typedef struct EnvItem {
} EnvItem;
//----------------------------------------------------------------------------------
// Module functions declaration
// Module Functions Declaration
//----------------------------------------------------------------------------------
void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float delta);
void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
@@ -52,7 +57,7 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera");
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera platformer");
Player player = { 0 };
player.position = (Vector2){ 400, 280 };
@@ -90,7 +95,7 @@ int main(void)
"Follow player center",
"Follow player center, but clamp to map edges",
"Follow player center; smoothed",
"Follow player center horizontally; updateplayer center vertically after landing",
"Follow player center horizontally; update player center vertically after landing",
"Player push camera on getting too close to screen edge"
};
@@ -133,9 +138,11 @@ int main(void)
for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color);
Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40, 40 };
Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40.0f, 40.0f };
DrawRectangleRec(playerRect, RED);
DrawCircleV(player.position, 5.0f, GOLD);
EndMode2D();
DrawText("Controls:", 20, 20, 10, BLACK);
@@ -168,7 +175,7 @@ void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float d
player->canJump = false;
}
int hitObstacle = 0;
bool hitObstacle = false;
for (int i = 0; i < envItemsLength; i++)
{
EnvItem *ei = envItems + i;
@@ -177,11 +184,12 @@ void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float d
ei->rect.x <= p->x &&
ei->rect.x + ei->rect.width >= p->x &&
ei->rect.y >= p->y &&
ei->rect.y < p->y + player->speed*delta)
ei->rect.y <= p->y + player->speed*delta)
{
hitObstacle = 1;
hitObstacle = true;
player->speed = 0.0f;
p->y = ei->rect.y;
break;
}
}
@@ -289,7 +297,7 @@ void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *env
Vector2 bboxWorldMin = GetScreenToWorld2D((Vector2){ (1 - bbox.x)*0.5f*width, (1 - bbox.y)*0.5f*height }, *camera);
Vector2 bboxWorldMax = GetScreenToWorld2D((Vector2){ (1 + bbox.x)*0.5f*width, (1 + bbox.y)*0.5f*height }, *camera);
camera->offset = (Vector2){ (1 - bbox.x)*0.5f * width, (1 - bbox.y)*0.5f*height };
camera->offset = (Vector2){ (1 - bbox.x)*0.5f*width, (1 - bbox.y)*0.5f*height };
if (player->position.x < bboxWorldMin.x) camera->target.x = player->position.x;
if (player->position.y < bboxWorldMin.y) camera->target.y = player->position.y;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,169 @@
/*******************************************************************************************
*
* raylib [core] example - 2d camera split screen
*
* Example complexity rating: [★★★★] 4/4
*
* Addapted from the core_3d_camera_split_screen example:
* https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_split_screen.c
*
* Example originally created with raylib 4.5, last time updated with raylib 4.5
*
* Example contributed by Gabriel dos Santos Sanches (@gabrielssanches) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2023-2025 Gabriel dos Santos Sanches (@gabrielssanches)
*
********************************************************************************************/
#include "raylib.h"
#define PLAYER_SIZE 40
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 440;
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera split screen");
Rectangle player1 = { 200, 200, PLAYER_SIZE, PLAYER_SIZE };
Rectangle player2 = { 250, 200, PLAYER_SIZE, PLAYER_SIZE };
Camera2D camera1 = { 0 };
camera1.target = (Vector2){ player1.x, player1.y };
camera1.offset = (Vector2){ 200.0f, 200.0f };
camera1.rotation = 0.0f;
camera1.zoom = 1.0f;
Camera2D camera2 = { 0 };
camera2.target = (Vector2){ player2.x, player2.y };
camera2.offset = (Vector2){ 200.0f, 200.0f };
camera2.rotation = 0.0f;
camera2.zoom = 1.0f;
RenderTexture screenCamera1 = LoadRenderTexture(screenWidth/2, screenHeight);
RenderTexture screenCamera2 = LoadRenderTexture(screenWidth/2, screenHeight);
// Build a flipped rectangle the size of the split view to use for drawing later
Rectangle splitScreenRect = { 0.0f, 0.0f, (float)screenCamera1.texture.width, (float)-screenCamera1.texture.height };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyDown(KEY_S)) player1.y += 3.0f;
else if (IsKeyDown(KEY_W)) player1.y -= 3.0f;
if (IsKeyDown(KEY_D)) player1.x += 3.0f;
else if (IsKeyDown(KEY_A)) player1.x -= 3.0f;
if (IsKeyDown(KEY_UP)) player2.y -= 3.0f;
else if (IsKeyDown(KEY_DOWN)) player2.y += 3.0f;
if (IsKeyDown(KEY_RIGHT)) player2.x += 3.0f;
else if (IsKeyDown(KEY_LEFT)) player2.x -= 3.0f;
camera1.target = (Vector2){ player1.x, player1.y };
camera2.target = (Vector2){ player2.x, player2.y };
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginTextureMode(screenCamera1);
ClearBackground(RAYWHITE);
BeginMode2D(camera1);
// Draw full scene with first camera
for (int i = 0; i < screenWidth/PLAYER_SIZE + 1; i++)
{
DrawLineV((Vector2){(float)PLAYER_SIZE*i, 0}, (Vector2){ (float)PLAYER_SIZE*i, (float)screenHeight}, LIGHTGRAY);
}
for (int i = 0; i < screenHeight/PLAYER_SIZE + 1; i++)
{
DrawLineV((Vector2){0, (float)PLAYER_SIZE*i}, (Vector2){ (float)screenWidth, (float)PLAYER_SIZE*i}, LIGHTGRAY);
}
for (int i = 0; i < screenWidth/PLAYER_SIZE; i++)
{
for (int j = 0; j < screenHeight/PLAYER_SIZE; j++)
{
DrawText(TextFormat("[%i,%i]", i, j), 10 + PLAYER_SIZE*i, 15 + PLAYER_SIZE*j, 10, LIGHTGRAY);
}
}
DrawRectangleRec(player1, RED);
DrawRectangleRec(player2, BLUE);
EndMode2D();
DrawRectangle(0, 0, GetScreenWidth()/2, 30, Fade(RAYWHITE, 0.6f));
DrawText("PLAYER1: W/S/A/D to move", 10, 10, 10, MAROON);
EndTextureMode();
BeginTextureMode(screenCamera2);
ClearBackground(RAYWHITE);
BeginMode2D(camera2);
// Draw full scene with second camera
for (int i = 0; i < screenWidth/PLAYER_SIZE + 1; i++)
{
DrawLineV((Vector2){ (float)PLAYER_SIZE*i, 0}, (Vector2){ (float)PLAYER_SIZE*i, (float)screenHeight}, LIGHTGRAY);
}
for (int i = 0; i < screenHeight/PLAYER_SIZE + 1; i++)
{
DrawLineV((Vector2){0, (float)PLAYER_SIZE*i}, (Vector2){ (float)screenWidth, (float)PLAYER_SIZE*i}, LIGHTGRAY);
}
for (int i = 0; i < screenWidth/PLAYER_SIZE; i++)
{
for (int j = 0; j < screenHeight/PLAYER_SIZE; j++)
{
DrawText(TextFormat("[%i,%i]", i, j), 10 + PLAYER_SIZE*i, 15 + PLAYER_SIZE*j, 10, LIGHTGRAY);
}
}
DrawRectangleRec(player1, RED);
DrawRectangleRec(player2, BLUE);
EndMode2D();
DrawRectangle(0, 0, GetScreenWidth()/2, 30, Fade(RAYWHITE, 0.6f));
DrawText("PLAYER2: UP/DOWN/LEFT/RIGHT to move", 10, 10, 10, DARKBLUE);
EndTextureMode();
// Draw both views render textures to the screen side by side
BeginDrawing();
ClearBackground(BLACK);
DrawTextureRec(screenCamera1.texture, splitScreenRect, (Vector2){ 0, 0 }, WHITE);
DrawTextureRec(screenCamera2.texture, splitScreenRect, (Vector2){ screenWidth/2.0f, 0 }, WHITE);
DrawRectangle(GetScreenWidth()/2 - 2, 0, 4, GetScreenHeight(), LIGHTGRAY);
EndDrawing();
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadRenderTexture(screenCamera1); // Unload render texture
UnloadRenderTexture(screenCamera2); // Unload render texture
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -2,16 +2,19 @@
*
* raylib [core] example - 3d camera first person
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 1.3, last time updated with raylib 1.3
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "rcamera.h"
#define MAX_COLUMNS 20
@@ -29,11 +32,13 @@ int main(void)
// Define the camera to look into our 3d world (position, target, up vector)
Camera camera = { 0 };
camera.position = (Vector3){ 4.0f, 2.0f, 4.0f };
camera.target = (Vector3){ 0.0f, 1.8f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.fovy = 60.0f;
camera.projection = CAMERA_PERSPECTIVE;
camera.position = (Vector3){ 0.0f, 2.0f, 4.0f }; // Camera position
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 60.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
int cameraMode = CAMERA_FIRST_PERSON;
// Generates some random columns
float heights[MAX_COLUMNS] = { 0 };
@@ -47,17 +52,93 @@ int main(void)
colors[i] = (Color){ GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255 };
}
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode
DisableCursor(); // Limit cursor to relative movement inside the window
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera);
// Switch camera mode
if (IsKeyPressed(KEY_ONE))
{
cameraMode = CAMERA_FREE;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
if (IsKeyPressed(KEY_TWO))
{
cameraMode = CAMERA_FIRST_PERSON;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
if (IsKeyPressed(KEY_THREE))
{
cameraMode = CAMERA_THIRD_PERSON;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
if (IsKeyPressed(KEY_FOUR))
{
cameraMode = CAMERA_ORBITAL;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
// Switch camera projection
if (IsKeyPressed(KEY_P))
{
if (camera.projection == CAMERA_PERSPECTIVE)
{
// Create isometric view
cameraMode = CAMERA_THIRD_PERSON;
// Note: The target distance is related to the render distance in the orthographic projection
camera.position = (Vector3){ 0.0f, 2.0f, -100.0f };
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.projection = CAMERA_ORTHOGRAPHIC;
camera.fovy = 20.0f; // near plane width in CAMERA_ORTHOGRAPHIC
CameraYaw(&camera, -135*DEG2RAD, true);
CameraPitch(&camera, -45*DEG2RAD, true, true, false);
}
else if (camera.projection == CAMERA_ORTHOGRAPHIC)
{
// Reset to default view
cameraMode = CAMERA_THIRD_PERSON;
camera.position = (Vector3){ 0.0f, 2.0f, 10.0f };
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.projection = CAMERA_PERSPECTIVE;
camera.fovy = 60.0f;
}
}
// Update camera computes movement internally depending on the camera mode
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
// For advanced camera controls, it's recommended to compute camera movement manually
UpdateCamera(&camera, cameraMode); // Update camera
/*
// Camera PRO usage example (EXPERIMENTAL)
// This new camera function allows custom movement/rotation values to be directly provided
// as input parameters, with this approach, rcamera module is internally independent of raylib inputs
UpdateCameraPro(&camera,
(Vector3){
(IsKeyDown(KEY_W) || IsKeyDown(KEY_UP))*0.1f - // Move forward-backward
(IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN))*0.1f,
(IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT))*0.1f - // Move right-left
(IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT))*0.1f,
0.0f // Move up-down
},
(Vector3){
GetMouseDelta().x*0.05f, // Rotation: yaw
GetMouseDelta().y*0.05f, // Rotation: pitch
0.0f // Rotation: roll
},
GetMouseWheelMove()*2.0f); // Move to target (zoom)
*/
//----------------------------------------------------------------------------------
// Draw
@@ -80,14 +161,39 @@ int main(void)
DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, MAROON);
}
// Draw player cube
if (cameraMode == CAMERA_THIRD_PERSON)
{
DrawCube(camera.target, 0.5f, 0.5f, 0.5f, PURPLE);
DrawCubeWires(camera.target, 0.5f, 0.5f, 0.5f, DARKPURPLE);
}
EndMode3D();
DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5f));
DrawRectangleLines( 10, 10, 220, 70, BLUE);
// Draw info boxes
DrawRectangle(5, 5, 330, 100, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(5, 5, 330, 100, BLUE);
DrawText("First person camera default controls:", 20, 20, 10, BLACK);
DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY);
DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY);
DrawText("Camera controls:", 15, 15, 10, BLACK);
DrawText("- Move keys: W, A, S, D, Space, Left-Ctrl", 15, 30, 10, BLACK);
DrawText("- Look around: arrow keys or mouse", 15, 45, 10, BLACK);
DrawText("- Camera mode keys: 1, 2, 3, 4", 15, 60, 10, BLACK);
DrawText("- Zoom keys: num-plus, num-minus or mouse scroll", 15, 75, 10, BLACK);
DrawText("- Camera projection key: P", 15, 90, 10, BLACK);
DrawRectangle(600, 5, 195, 100, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(600, 5, 195, 100, BLUE);
DrawText("Camera status:", 610, 15, 10, BLACK);
DrawText(TextFormat("- Mode: %s", (cameraMode == CAMERA_FREE) ? "FREE" :
(cameraMode == CAMERA_FIRST_PERSON) ? "FIRST_PERSON" :
(cameraMode == CAMERA_THIRD_PERSON) ? "THIRD_PERSON" :
(cameraMode == CAMERA_ORBITAL) ? "ORBITAL" : "CUSTOM"), 610, 30, 10, BLACK);
DrawText(TextFormat("- Projection: %s", (camera.projection == CAMERA_PERSPECTIVE) ? "PERSPECTIVE" :
(camera.projection == CAMERA_ORTHOGRAPHIC) ? "ORTHOGRAPHIC" : "CUSTOM"), 610, 45, 10, BLACK);
DrawText(TextFormat("- Position: (%06.3f, %06.3f, %06.3f)", camera.position.x, camera.position.y, camera.position.z), 610, 60, 10, BLACK);
DrawText(TextFormat("- Target: (%06.3f, %06.3f, %06.3f)", camera.target.x, camera.target.y, camera.target.z), 610, 75, 10, BLACK);
DrawText(TextFormat("- Up: (%06.3f, %06.3f, %06.3f)", camera.up.x, camera.up.y, camera.up.z), 610, 90, 10, BLACK);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -99,4 +205,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

View File

@@ -0,0 +1,330 @@
/*******************************************************************************************
*
* raylib [core] example - 3d first-person camera controller
*
* Example complexity rating: [★★★☆] 3/4
*
* Example originally created with raylib 5.5, last time updated with raylib 5.5
*
* Example contributed by Agnis Aldins (@nezvers) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2025-2025 Agnis Aldins (@nezvers)
*
********************************************************************************************/
#include "raylib.h"
#include "raymath.h"
//----------------------------------------------------------------------------------
// Defines and Macros
//----------------------------------------------------------------------------------
// Movement constants
#define GRAVITY 32.0f
#define MAX_SPEED 20.0f
#define CROUCH_SPEED 5.0f
#define JUMP_FORCE 12.0f
#define MAX_ACCEL 150.0f
// Grounded drag
#define FRICTION 0.86f
// Increasing air drag, increases strafing speed
#define AIR_DRAG 0.98f
// Responsiveness for turning movement direction to looked direction
#define CONTROL 15.0f
#define CROUCH_HEIGHT 0.0f
#define STAND_HEIGHT 1.0f
#define BOTTOM_HEIGHT 0.5f
#define NORMALIZE_INPUT 0
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
// Body structure
typedef struct {
Vector3 position;
Vector3 velocity;
Vector3 dir;
bool isGrounded;
} Body;
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
static Vector2 sensitivity = { 0.001f, 0.001f };
static Body player = { 0 };
static Vector2 lookRotation = { 0 };
static float headTimer = 0.0f;
static float walkLerp = 0.0f;
static float headLerp = STAND_HEIGHT;
static Vector2 lean = { 0 };
//----------------------------------------------------------------------------------
// Module Functions Declaration
//----------------------------------------------------------------------------------
static void DrawLevel(void);
static void UpdateCameraFPS(Camera *camera);
static void UpdateBody(Body *body, float rot, char side, char forward, bool jumpPressed, bool crouchHold);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d first-person camera controller");
// Initialize camera variables
// NOTE: UpdateCameraFPS() takes care of the rest
Camera camera = { 0 };
camera.fovy = 60.0f;
camera.projection = CAMERA_PERSPECTIVE;
camera.position = (Vector3){
player.position.x,
player.position.y + (BOTTOM_HEIGHT + headLerp),
player.position.z,
};
UpdateCameraFPS(&camera); // Update camera parameters
DisableCursor(); // Limit cursor to relative movement inside the window
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
Vector2 mouseDelta = GetMouseDelta();
lookRotation.x -= mouseDelta.x*sensitivity.x;
lookRotation.y += mouseDelta.y*sensitivity.y;
char sideway = (IsKeyDown(KEY_D) - IsKeyDown(KEY_A));
char forward = (IsKeyDown(KEY_W) - IsKeyDown(KEY_S));
bool crouching = IsKeyDown(KEY_LEFT_CONTROL);
UpdateBody(&player, lookRotation.x, sideway, forward, IsKeyPressed(KEY_SPACE), crouching);
float delta = GetFrameTime();
headLerp = Lerp(headLerp, (crouching ? CROUCH_HEIGHT : STAND_HEIGHT), 20.0f*delta);
camera.position = (Vector3){
player.position.x,
player.position.y + (BOTTOM_HEIGHT + headLerp),
player.position.z,
};
if (player.isGrounded && ((forward != 0) || (sideway != 0)))
{
headTimer += delta*3.0f;
walkLerp = Lerp(walkLerp, 1.0f, 10.0f*delta);
camera.fovy = Lerp(camera.fovy, 55.0f, 5.0f*delta);
}
else
{
walkLerp = Lerp(walkLerp, 0.0f, 10.0f*delta);
camera.fovy = Lerp(camera.fovy, 60.0f, 5.0f*delta);
}
lean.x = Lerp(lean.x, sideway*0.02f, 10.0f*delta);
lean.y = Lerp(lean.y, forward*0.015f, 10.0f*delta);
UpdateCameraFPS(&camera);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode3D(camera);
DrawLevel();
EndMode3D();
// Draw info box
DrawRectangle(5, 5, 330, 75, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(5, 5, 330, 75, BLUE);
DrawText("Camera controls:", 15, 15, 10, BLACK);
DrawText("- Move keys: W, A, S, D, Space, Left-Ctrl", 15, 30, 10, BLACK);
DrawText("- Look around: arrow keys or mouse", 15, 45, 10, BLACK);
DrawText(TextFormat("- Velocity Len: (%06.3f)", Vector2Length((Vector2){ player.velocity.x, player.velocity.z })), 15, 60, 10, BLACK);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
//----------------------------------------------------------------------------------
// Module Functions Definition
//----------------------------------------------------------------------------------
// Update body considering current world state
void UpdateBody(Body *body, float rot, char side, char forward, bool jumpPressed, bool crouchHold)
{
Vector2 input = (Vector2){ (float)side, (float)-forward };
#if defined(NORMALIZE_INPUT)
// Slow down diagonal movement
if ((side != 0) && (forward != 0)) input = Vector2Normalize(input);
#endif
float delta = GetFrameTime();
if (!body->isGrounded) body->velocity.y -= GRAVITY*delta;
if (body->isGrounded && jumpPressed)
{
body->velocity.y = JUMP_FORCE;
body->isGrounded = false;
// Sound can be played at this moment
//SetSoundPitch(fxJump, 1.0f + (GetRandomValue(-100, 100)*0.001));
//PlaySound(fxJump);
}
Vector3 front = (Vector3){ sin(rot), 0.f, cos(rot) };
Vector3 right = (Vector3){ cos(-rot), 0.f, sin(-rot) };
Vector3 desiredDir = (Vector3){ input.x*right.x + input.y*front.x, 0.0f, input.x*right.z + input.y*front.z, };
body->dir = Vector3Lerp(body->dir, desiredDir, CONTROL*delta);
float decel = (body->isGrounded ? FRICTION : AIR_DRAG);
Vector3 hvel = (Vector3){ body->velocity.x*decel, 0.0f, body->velocity.z*decel };
float hvelLength = Vector3Length(hvel); // Magnitude
if (hvelLength < (MAX_SPEED*0.01f)) hvel = (Vector3){ 0 };
// This is what creates strafing
float speed = Vector3DotProduct(hvel, body->dir);
// Whenever the amount of acceleration to add is clamped by the maximum acceleration constant,
// a Player can make the speed faster by bringing the direction closer to horizontal velocity angle
// More info here: https://youtu.be/v3zT3Z5apaM?t=165
float maxSpeed = (crouchHold? CROUCH_SPEED : MAX_SPEED);
float accel = Clamp(maxSpeed - speed, 0.f, MAX_ACCEL*delta);
hvel.x += body->dir.x*accel;
hvel.z += body->dir.z*accel;
body->velocity.x = hvel.x;
body->velocity.z = hvel.z;
body->position.x += body->velocity.x*delta;
body->position.y += body->velocity.y*delta;
body->position.z += body->velocity.z*delta;
// Fancy collision system against the floor
if (body->position.y <= 0.0f)
{
body->position.y = 0.0f;
body->velocity.y = 0.0f;
body->isGrounded = true; // Enable jumping
}
}
// Update camera for FPS behaviour
static void UpdateCameraFPS(Camera *camera)
{
const Vector3 up = (Vector3){ 0.0f, 1.0f, 0.0f };
const Vector3 targetOffset = (Vector3){ 0.0f, 0.0f, -1.0f };
// Left and right
Vector3 yaw = Vector3RotateByAxisAngle(targetOffset, up, lookRotation.x);
// Clamp view up
float maxAngleUp = Vector3Angle(up, yaw);
maxAngleUp -= 0.001f; // Avoid numerical errors
if ( -(lookRotation.y) > maxAngleUp) { lookRotation.y = -maxAngleUp; }
// Clamp view down
float maxAngleDown = Vector3Angle(Vector3Negate(up), yaw);
maxAngleDown *= -1.0f; // Downwards angle is negative
maxAngleDown += 0.001f; // Avoid numerical errors
if ( -(lookRotation.y) < maxAngleDown) { lookRotation.y = -maxAngleDown; }
// Up and down
Vector3 right = Vector3Normalize(Vector3CrossProduct(yaw, up));
// Rotate view vector around right axis
float pitchAngle = -lookRotation.y -
lean.y;
pitchAngle = Clamp(pitchAngle, -PI/2 + 0.0001f, PI/2 - 0.0001f); // Clamp angle so it doesn't go past straight up or straight down
Vector3 pitch = Vector3RotateByAxisAngle(yaw, right, pitchAngle);
// Head animation
// Rotate up direction around forward axis
float headSin = sin(headTimer*PI);
float headCos = cos(headTimer*PI);
const float stepRotation = 0.01f;
camera->up = Vector3RotateByAxisAngle(up, pitch, headSin*stepRotation + lean.x);
// Camera BOB
const float bobSide = 0.1f;
const float bobUp = 0.15f;
Vector3 bobbing = Vector3Scale(right, headSin*bobSide);
bobbing.y = fabsf(headCos*bobUp);
camera->position = Vector3Add(camera->position, Vector3Scale(bobbing, walkLerp));
camera->target = Vector3Add(camera->position, pitch);
}
// Draw game level
static void DrawLevel(void)
{
const int floorExtent = 25;
const float tileSize = 5.0f;
const Color tileColor1 = (Color){ 150, 200, 200, 255 };
// Floor tiles
for (int y = -floorExtent; y < floorExtent; y++)
{
for (int x = -floorExtent; x < floorExtent; x++)
{
if ((y & 1) && (x & 1))
{
DrawPlane((Vector3){ x*tileSize, 0.0f, y*tileSize}, (Vector2){ tileSize, tileSize }, tileColor1);
}
else if (!(y & 1) && !(x & 1))
{
DrawPlane((Vector3){ x*tileSize, 0.0f, y*tileSize}, (Vector2){ tileSize, tileSize }, LIGHTGRAY);
}
}
}
const Vector3 towerSize = (Vector3){ 16.0f, 32.0f, 16.0f };
const Color towerColor = (Color){ 150, 200, 200, 255 };
Vector3 towerPos = (Vector3){ 16.0f, 16.0f, 16.0f };
DrawCubeV(towerPos, towerSize, towerColor);
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
towerPos.x *= -1;
DrawCubeV(towerPos, towerSize, towerColor);
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
towerPos.z *= -1;
DrawCubeV(towerPos, towerSize, towerColor);
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
towerPos.x *= -1;
DrawCubeV(towerPos, towerSize, towerColor);
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
// Red sun
DrawSphere((Vector3){ 300.0f, 300.0f, 0.0f }, 100.0f, (Color){ 255, 0, 0, 255 });
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] example - Initialize 3d camera free
* raylib [core] example - 3d camera free
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.3, last time updated with raylib 1.3
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -31,11 +33,11 @@ int main(void)
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
DisableCursor(); // Limit cursor to relative movement inside the window
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -45,9 +47,9 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera);
UpdateCamera(&camera, CAMERA_FREE);
if (IsKeyDown('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
if (IsKeyPressed('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
//----------------------------------------------------------------------------------
// Draw
@@ -65,15 +67,13 @@ int main(void)
EndMode3D();
DrawRectangle( 10, 10, 320, 133, Fade(SKYBLUE, 0.5f));
DrawRectangleLines( 10, 10, 320, 133, BLUE);
DrawRectangle( 10, 10, 320, 93, Fade(SKYBLUE, 0.5f));
DrawRectangleLines( 10, 10, 320, 93, BLUE);
DrawText("Free camera default controls:", 20, 20, 10, BLACK);
DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, DARKGRAY);
DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, DARKGRAY);
DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, DARKGRAY);
DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, DARKGRAY);
DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, DARKGRAY);
DrawText("- Z to zoom to (0, 0, 0)", 40, 80, 10, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -85,4 +85,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] example - Initialize 3d camera mode
* raylib [core] example - 3d camera mode
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [core] example - split screen
* raylib [core] example - 3d camera split screen
*
* Example complexity rating: [] 3/4
*
* Example originally created with raylib 3.7, last time updated with raylib 4.0
*
@@ -9,39 +11,12 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2022 Jeffery Myers (@JeffM2501)
* Copyright (c) 2021-2025 Jeffery Myers (@JeffM2501)
*
********************************************************************************************/
#include "raylib.h"
Texture2D textureGrid = { 0 };
Camera cameraPlayer1 = { 0 };
Camera cameraPlayer2 = { 0 };
// Scene drawing
void DrawScene(void)
{
int count = 5;
float spacing = 4;
// Grid of cube trees on a plane to make a "world"
DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane
for (float x = -count*spacing; x <= count*spacing; x += spacing)
{
for (float z = -count*spacing; z <= count*spacing; z += spacing)
{
DrawCubeTexture(textureGrid, (Vector3) { x, 1.5f, z }, 1, 1, 1, GREEN);
DrawCubeTexture(textureGrid, (Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN);
}
}
// Draw a cube at each player's position
DrawCube(cameraPlayer1.position, 1, 1, 1, RED);
DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE);
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
@@ -52,16 +27,10 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - split screen");
// Generate a simple texture to use for trees
Image img = GenImageChecked(256, 256, 32, 32, DARKGRAY, WHITE);
textureGrid = LoadTextureFromImage(img);
UnloadImage(img);
SetTextureFilter(textureGrid, TEXTURE_FILTER_ANISOTROPIC_16X);
SetTextureWrap(textureGrid, TEXTURE_WRAP_CLAMP);
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera split screen");
// Setup player 1 camera and screen
Camera cameraPlayer1 = { 0 };
cameraPlayer1.fovy = 45.0f;
cameraPlayer1.up.y = 1.0f;
cameraPlayer1.target.y = 1.0f;
@@ -71,17 +40,22 @@ int main(void)
RenderTexture screenPlayer1 = LoadRenderTexture(screenWidth/2, screenHeight);
// Setup player two camera and screen
Camera cameraPlayer2 = { 0 };
cameraPlayer2.fovy = 45.0f;
cameraPlayer2.up.y = 1.0f;
cameraPlayer2.target.y = 3.0f;
cameraPlayer2.position.x = -3.0f;
cameraPlayer2.position.y = 3.0f;
RenderTexture screenPlayer2 = LoadRenderTexture(screenWidth / 2, screenHeight);
RenderTexture screenPlayer2 = LoadRenderTexture(screenWidth/2, screenHeight);
// Build a flipped rectangle the size of the split view to use for drawing later
Rectangle splitScreenRect = { 0.0f, 0.0f, (float)screenPlayer1.texture.width, (float)-screenPlayer1.texture.height };
// Grid data
int count = 5;
float spacing = 4;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -91,7 +65,7 @@ int main(void)
// Update
//----------------------------------------------------------------------------------
// If anyone moves this frame, how far will they move based on the time since the last frame
// this moves thigns at 10 world units per second, regardless of the actual FPS
// this moves things at 10 world units per second, regardless of the actual FPS
float offsetThisFrame = 10.0f*GetFrameTime();
// Move Player1 forward and backwards (no turning)
@@ -124,26 +98,69 @@ int main(void)
// Draw Player1 view to the render texture
BeginTextureMode(screenPlayer1);
ClearBackground(SKYBLUE);
BeginMode3D(cameraPlayer1);
DrawScene();
// Draw scene: grid of cube trees on a plane to make a "world"
DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane
for (float x = -count*spacing; x <= count*spacing; x += spacing)
{
for (float z = -count*spacing; z <= count*spacing; z += spacing)
{
DrawCube((Vector3) { x, 1.5f, z }, 1, 1, 1, LIME);
DrawCube((Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN);
}
}
// Draw a cube at each player's position
DrawCube(cameraPlayer1.position, 1, 1, 1, RED);
DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE);
EndMode3D();
DrawText("PLAYER1 W/S to move", 10, 10, 20, RED);
DrawRectangle(0, 0, GetScreenWidth()/2, 40, Fade(RAYWHITE, 0.8f));
DrawText("PLAYER1: W/S to move", 10, 10, 20, MAROON);
EndTextureMode();
// Draw Player2 view to the render texture
BeginTextureMode(screenPlayer2);
ClearBackground(SKYBLUE);
BeginMode3D(cameraPlayer2);
DrawScene();
// Draw scene: grid of cube trees on a plane to make a "world"
DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane
for (float x = -count*spacing; x <= count*spacing; x += spacing)
{
for (float z = -count*spacing; z <= count*spacing; z += spacing)
{
DrawCube((Vector3) { x, 1.5f, z }, 1, 1, 1, LIME);
DrawCube((Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN);
}
}
// Draw a cube at each player's position
DrawCube(cameraPlayer1.position, 1, 1, 1, RED);
DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE);
EndMode3D();
DrawText("PLAYER2 UP/DOWN to move", 10, 10, 20, BLUE);
DrawRectangle(0, 0, GetScreenWidth()/2, 40, Fade(RAYWHITE, 0.8f));
DrawText("PLAYER2: UP/DOWN to move", 10, 10, 20, DARKBLUE);
EndTextureMode();
// Draw both views render textures to the screen side by side
BeginDrawing();
ClearBackground(BLACK);
DrawTextureRec(screenPlayer1.texture, splitScreenRect, (Vector2){ 0, 0 }, WHITE);
DrawTextureRec(screenPlayer2.texture, splitScreenRect, (Vector2){ screenWidth/2.0f, 0 }, WHITE);
DrawRectangle(GetScreenWidth()/2 - 2, 0, 4, GetScreenHeight(), LIGHTGRAY);
EndDrawing();
}
@@ -151,10 +168,9 @@ int main(void)
//--------------------------------------------------------------------------------------
UnloadRenderTexture(screenPlayer1); // Unload render texture
UnloadRenderTexture(screenPlayer2); // Unload render texture
UnloadTexture(textureGrid); // Unload texture
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] example - Picking in 3d mode
* raylib [core] example - 3d picking
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 1.3, last time updated with raylib 4.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -31,16 +33,13 @@ int main(void)
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
Vector3 cubePosition = { 0.0f, 1.0f, 0.0f };
Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };
Ray ray = { 0 }; // Picking line ray
RayCollision collision = { 0 };
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
RayCollision collision = { 0 }; // Ray collision hit info
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -50,13 +49,20 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera);
if (IsCursorHidden()) UpdateCamera(&camera, CAMERA_FIRST_PERSON);
// Toggle camera controls
if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT))
{
if (IsCursorHidden()) EnableCursor();
else DisableCursor();
}
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
if (!collision.hit)
{
ray = GetMouseRay(GetMousePosition(), camera);
ray = GetScreenToWorldRay(GetMousePosition(), camera);
// Check collision between ray and box
collision = GetRayCollisionBox(ray,
@@ -93,9 +99,11 @@ int main(void)
EndMode3D();
DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY);
DrawText("Try clicking on the box with your mouse!", 240, 10, 20, DARKGRAY);
if (collision.hit) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, (int)(screenHeight * 0.1f), 30, GREEN);
if (collision.hit) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30))/2, (int)(screenHeight*0.1f), 30, GREEN);
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, GRAY);
DrawFPS(10, 10);

View File

@@ -0,0 +1,340 @@
/*******************************************************************************************
*
* raylib [core] example - automation events
*
* Example complexity rating: [★★★☆] 3/4
*
* Example originally created with raylib 5.0, last time updated with raylib 5.0
*
* Example based on 2d_camera_platformer example by arvyy (@arvyy)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2023-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "raymath.h"
#define GRAVITY 400
#define PLAYER_JUMP_SPD 350.0f
#define PLAYER_HOR_SPD 200.0f
#define MAX_ENVIRONMENT_ELEMENTS 5
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
typedef struct Player {
Vector2 position;
float speed;
bool canJump;
} Player;
typedef struct EnvElement {
Rectangle rect;
int blocking;
Color color;
} EnvElement;
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - automation events");
// Define player
Player player = { 0 };
player.position = (Vector2){ 400, 280 };
player.speed = 0;
player.canJump = false;
// Define environment elements (platforms)
EnvElement envElements[MAX_ENVIRONMENT_ELEMENTS] = {
{{ 0, 0, 1000, 400 }, 0, LIGHTGRAY },
{{ 0, 400, 1000, 200 }, 1, GRAY },
{{ 300, 200, 400, 10 }, 1, GRAY },
{{ 250, 300, 100, 10 }, 1, GRAY },
{{ 650, 300, 100, 10 }, 1, GRAY }
};
// Define camera
Camera2D camera = { 0 };
camera.target = player.position;
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
// Automation events
AutomationEventList aelist = LoadAutomationEventList(0); // Initialize list of automation events to record new events
SetAutomationEventList(&aelist);
bool eventRecording = false;
bool eventPlaying = false;
unsigned int frameCounter = 0;
unsigned int playFrameCounter = 0;
unsigned int currentPlayFrame = 0;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose())
{
// Update
//----------------------------------------------------------------------------------
float deltaTime = 0.015f;//GetFrameTime();
// Dropped files logic
//----------------------------------------------------------------------------------
if (IsFileDropped())
{
FilePathList droppedFiles = LoadDroppedFiles();
// Supports loading .rgs style files (text or binary) and .png style palette images
if (IsFileExtension(droppedFiles.paths[0], ".txt;.rae"))
{
UnloadAutomationEventList(aelist);
aelist = LoadAutomationEventList(droppedFiles.paths[0]);
eventRecording = false;
// Reset scene state to play
eventPlaying = true;
playFrameCounter = 0;
currentPlayFrame = 0;
player.position = (Vector2){ 400, 280 };
player.speed = 0;
player.canJump = false;
camera.target = player.position;
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
}
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
}
//----------------------------------------------------------------------------------
// Update player
//----------------------------------------------------------------------------------
if (IsKeyDown(KEY_LEFT)) player.position.x -= PLAYER_HOR_SPD*deltaTime;
if (IsKeyDown(KEY_RIGHT)) player.position.x += PLAYER_HOR_SPD*deltaTime;
if (IsKeyDown(KEY_SPACE) && player.canJump)
{
player.speed = -PLAYER_JUMP_SPD;
player.canJump = false;
}
int hitObstacle = 0;
for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++)
{
EnvElement *element = &envElements[i];
Vector2 *p = &(player.position);
if (element->blocking &&
element->rect.x <= p->x &&
element->rect.x + element->rect.width >= p->x &&
element->rect.y >= p->y &&
element->rect.y <= p->y + player.speed*deltaTime)
{
hitObstacle = 1;
player.speed = 0.0f;
p->y = element->rect.y;
}
}
if (!hitObstacle)
{
player.position.y += player.speed*deltaTime;
player.speed += GRAVITY*deltaTime;
player.canJump = false;
}
else player.canJump = true;
if (IsKeyPressed(KEY_R))
{
// Reset game state
player.position = (Vector2){ 400, 280 };
player.speed = 0;
player.canJump = false;
camera.target = player.position;
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
}
//----------------------------------------------------------------------------------
// Events playing
// NOTE: Logic must be before Camera update because it depends on mouse-wheel value,
// that can be set by the played event... but some other inputs could be affected
//----------------------------------------------------------------------------------
if (eventPlaying)
{
// NOTE: Multiple events could be executed in a single frame
while (playFrameCounter == aelist.events[currentPlayFrame].frame)
{
PlayAutomationEvent(aelist.events[currentPlayFrame]);
currentPlayFrame++;
if (currentPlayFrame == aelist.count)
{
eventPlaying = false;
currentPlayFrame = 0;
playFrameCounter = 0;
TraceLog(LOG_INFO, "FINISH PLAYING!");
break;
}
}
playFrameCounter++;
}
//----------------------------------------------------------------------------------
// Update camera
//----------------------------------------------------------------------------------
camera.target = player.position;
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
float minX = 1000, minY = 1000, maxX = -1000, maxY = -1000;
// WARNING: On event replay, mouse-wheel internal value is set
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
else if (camera.zoom < 0.25f) camera.zoom = 0.25f;
for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++)
{
EnvElement *element = &envElements[i];
minX = fminf(element->rect.x, minX);
maxX = fmaxf(element->rect.x + element->rect.width, maxX);
minY = fminf(element->rect.y, minY);
maxY = fmaxf(element->rect.y + element->rect.height, maxY);
}
Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, camera);
Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, camera);
if (max.x < screenWidth) camera.offset.x = screenWidth - (max.x - screenWidth/2);
if (max.y < screenHeight) camera.offset.y = screenHeight - (max.y - screenHeight/2);
if (min.x > 0) camera.offset.x = screenWidth/2 - min.x;
if (min.y > 0) camera.offset.y = screenHeight/2 - min.y;
//----------------------------------------------------------------------------------
// Events management
if (IsKeyPressed(KEY_S)) // Toggle events recording
{
if (!eventPlaying)
{
if (eventRecording)
{
StopAutomationEventRecording();
eventRecording = false;
ExportAutomationEventList(aelist, "automation.rae");
TraceLog(LOG_INFO, "RECORDED FRAMES: %i", aelist.count);
}
else
{
SetAutomationEventBaseFrame(180);
StartAutomationEventRecording();
eventRecording = true;
}
}
}
else if (IsKeyPressed(KEY_A)) // Toggle events playing (WARNING: Starts next frame)
{
if (!eventRecording && (aelist.count > 0))
{
// Reset scene state to play
eventPlaying = true;
playFrameCounter = 0;
currentPlayFrame = 0;
player.position = (Vector2){ 400, 280 };
player.speed = 0;
player.canJump = false;
camera.target = player.position;
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
}
}
if (eventRecording || eventPlaying) frameCounter++;
else frameCounter = 0;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(LIGHTGRAY);
BeginMode2D(camera);
// Draw environment elements
for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++)
{
DrawRectangleRec(envElements[i].rect, envElements[i].color);
}
// Draw player rectangle
DrawRectangleRec((Rectangle){ player.position.x - 20, player.position.y - 40, 40, 40 }, RED);
EndMode2D();
// Draw game controls
DrawRectangle(10, 10, 290, 145, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(10, 10, 290, 145, Fade(BLUE, 0.8f));
DrawText("Controls:", 20, 20, 10, BLACK);
DrawText("- RIGHT | LEFT: Player movement", 30, 40, 10, DARKGRAY);
DrawText("- SPACE: Player jump", 30, 60, 10, DARKGRAY);
DrawText("- R: Reset game state", 30, 80, 10, DARKGRAY);
DrawText("- S: START/STOP RECORDING INPUT EVENTS", 30, 110, 10, BLACK);
DrawText("- A: REPLAY LAST RECORDED INPUT EVENTS", 30, 130, 10, BLACK);
// Draw automation events recording indicator
if (eventRecording)
{
DrawRectangle(10, 160, 290, 30, Fade(RED, 0.3f));
DrawRectangleLines(10, 160, 290, 30, Fade(MAROON, 0.8f));
DrawCircle(30, 175, 10, MAROON);
if (((frameCounter/15)%2) == 1) DrawText(TextFormat("RECORDING EVENTS... [%i]", aelist.count), 50, 170, 10, MAROON);
}
else if (eventPlaying)
{
DrawRectangle(10, 160, 290, 30, Fade(LIME, 0.3f));
DrawRectangleLines(10, 160, 290, 30, Fade(DARKGREEN, 0.8f));
DrawTriangle((Vector2){ 20, 155 + 10 }, (Vector2){ 20, 155 + 30 }, (Vector2){ 40, 155 + 20 }, DARKGREEN);
if (((frameCounter/15)%2) == 1) DrawText(TextFormat("PLAYING RECORDED EVENTS... [%i]", currentPlayFrame), 50, 170, 10, DARKGREEN);
}
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [core] examples - basic screen manager
* raylib [core] example - basic screen manager
*
* Example complexity rating: [★☆☆☆] 1/4
*
* NOTE: This example illustrates a very simple screen manager based on a states machines
*
@@ -9,7 +11,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -46,7 +48,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
switch(currentScreen)
switch (currentScreen)
{
case LOGO:
{

View File

@@ -1,23 +1,28 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window
* raylib [core] example - basic window
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* To test examples, just press F6 and execute 'raylib_compile_execute' script
* Note that compiled executable is placed in the same folder as .c file
*
* To test the examples on Web, press F6 and execute 'raylib_compile_execute_web' script
* Web version of the program is generated in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2013-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

@@ -1,8 +1,10 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window (adapted for HTML5 platform)
* raylib [core] example - basic window
*
* NOTE: This example is prepared to compile for PLATFORM_WEB, PLATFORM_DESKTOP and PLATFORM_RPI
* Example complexity rating: [★☆☆☆] 1/4
*
* NOTE: This example is prepared to compile for PLATFORM_WEB, and PLATFORM_DESKTOP
* As you will notice, code structure is slightly diferent to the other examples...
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
*
@@ -11,7 +13,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -30,7 +32,7 @@ const int screenWidth = 800;
const int screenHeight = 450;
//----------------------------------------------------------------------------------
// Module functions declaration
// Module Functions Declaration
//----------------------------------------------------------------------------------
void UpdateDrawFrame(void); // Update and Draw one frame

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -2,7 +2,9 @@
*
* raylib [core] example - custom frame control
*
* NOTE: WARNING: This is an example for advance users willing to have full control over
* Example complexity rating: [★★★★] 4/4
*
* NOTE: WARNING: This is an example for advanced users willing to have full control over
* the frame processes. By default, EndDrawing() calls the following processes:
* 1. Draw remaining batch data: rlDrawRenderBatchActive()
* 2. SwapScreenBuffer()
@@ -10,7 +12,7 @@
* 4. PollInputEvents()
*
* To avoid steps 2, 3 and 4, flag SUPPORT_CUSTOM_FRAME_CONTROL can be enabled in
* config.h (it requires recompiling raylib). This way those steps are up to the user.
* config.h (it requires recompiling raylib). This way those steps are up to the user
*
* Note that enabling this flag invalidates some functions:
* - GetFrameTime()
@@ -22,7 +24,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -37,7 +39,7 @@ int main(void)
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - custom frame control");
// Custom timming variables
@@ -46,11 +48,11 @@ int main(void)
double updateDrawTime = 0.0; // Update + Draw time
double waitTime = 0.0; // Wait time (if target fps required)
float deltaTime = 0.0f; // Frame time (Update + Draw + Wait time)
float timeCounter = 0.0f; // Accumulative time counter (seconds)
float position = 0.0f; // Circle position
bool pause = false; // Pause control flag
int targetFPS = 60; // Our initial target fps
//--------------------------------------------------------------------------------------
@@ -59,13 +61,15 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
#ifndef PLATFORM_WEB // NOTE: On non web platforms the PollInputEvents just works before the inputs checks
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
#endif
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
if (IsKeyPressed(KEY_UP)) targetFPS += 20;
else if (IsKeyPressed(KEY_DOWN)) targetFPS -= 20;
if (targetFPS < 0) targetFPS = 0;
if (!pause)
@@ -74,6 +78,10 @@ int main(void)
if (position >= GetScreenWidth()) position = 0;
timeCounter += deltaTime; // We count time (seconds)
}
#ifdef PLATFORM_WEB // NOTE: On web platform for some reason the PollInputEvents only works after the inputs check, so just call it after check all your inputs (on web)
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
#endif
//----------------------------------------------------------------------------------
// Draw
@@ -83,39 +91,42 @@ int main(void)
ClearBackground(RAYWHITE);
for (int i = 0; i < GetScreenWidth()/200; i++) DrawRectangle(200*i, 0, 1, GetScreenHeight(), SKYBLUE);
DrawCircle((int)position, GetScreenHeight()/2 - 25, 50, RED);
DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), position - 40, GetScreenHeight()/2 - 100, 20, MAROON);
DrawText(TextFormat("PosX: %03.0f", position), position - 50, GetScreenHeight()/2 + 40, 20, BLACK);
DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), (int)position - 40, GetScreenHeight()/2 - 100, 20, MAROON);
DrawText(TextFormat("PosX: %03.0f", position), (int)position - 50, GetScreenHeight()/2 + 40, 20, BLACK);
DrawText("Circle is moving at a constant 200 pixels/sec,\nindependently of the frame rate.", 10, 10, 20, DARKGRAY);
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY);
DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME);
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
if (deltaTime != 0)
{
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
}
EndDrawing();
// NOTE: In case raylib is configured to SUPPORT_CUSTOM_FRAME_CONTROL,
// NOTE: In case raylib is configured to SUPPORT_CUSTOM_FRAME_CONTROL,
// Events polling, screen buffer swap and frame time control must be managed by the user
SwapScreenBuffer(); // Flip the back buffer to screen (front buffer)
currentTime = GetTime();
updateDrawTime = currentTime - previousTime;
if (targetFPS > 0) // We want a fixed frame rate
{
waitTime = (1.0f/(float)targetFPS) - updateDrawTime;
if (waitTime > 0.0)
if (waitTime > 0.0)
{
WaitTime((float)waitTime*1000.0f);
WaitTime((float)waitTime);
currentTime = GetTime();
deltaTime = (float)(currentTime - previousTime);
}
}
else deltaTime = updateDrawTime; // Framerate could be variable
else deltaTime = (float)updateDrawTime; // Framerate could be variable
previousTime = currentTime;
//----------------------------------------------------------------------------------

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [core] example - Custom logging
* raylib [core] example - custom logging
*
* Example complexity rating: [★★★☆] 3/4
*
* Example originally created with raylib 2.5, last time updated with raylib 2.5
*
@@ -9,7 +11,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2018-2022 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
* Copyright (c) 2018-2025 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -18,7 +20,7 @@
#include <stdio.h> // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen()
#include <time.h> // Required for: time_t, tm, time(), localtime(), strftime()
// Custom logging funtion
// Custom logging function
void CustomLog(int msgType, const char *text, va_list args)
{
char timeStr[64] = { 0 };

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [core] example - Windows drop files
* raylib [core] example - drop files
*
* Example complexity rating: [★★☆☆] 2/4
*
* NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
*
@@ -9,12 +11,17 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <stdlib.h> // Required for: calloc(), free()
#define MAX_FILEPATH_RECORDED 4096
#define MAX_FILEPATH_SIZE 2048
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
@@ -27,7 +34,14 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [core] example - drop files");
FilePathList droppedFiles = { 0 };
int filePathCounter = 0;
char *filePaths[MAX_FILEPATH_RECORDED] = { 0 }; // We will register a maximum of filepaths
// Allocate space for the required file paths
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
{
filePaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_SIZE, 1);
}
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -39,11 +53,18 @@ int main(void)
//----------------------------------------------------------------------------------
if (IsFileDropped())
{
// Is some files have been previously loaded, unload them
if (droppedFiles.count > 0) UnloadDroppedFiles(droppedFiles);
// Load new dropped files
droppedFiles = LoadDroppedFiles();
FilePathList droppedFiles = LoadDroppedFiles();
for (int i = 0, offset = filePathCounter; i < (int)droppedFiles.count; i++)
{
if (filePathCounter < (MAX_FILEPATH_RECORDED - 1))
{
TextCopy(filePaths[offset + i], droppedFiles.paths[i]);
filePathCounter++;
}
}
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
}
//----------------------------------------------------------------------------------
@@ -53,20 +74,20 @@ int main(void)
ClearBackground(RAYWHITE);
if (droppedFiles.count == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY);
if (filePathCounter == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY);
else
{
DrawText("Dropped files:", 100, 40, 20, DARKGRAY);
for (int i = 0; i < droppedFiles.count; i++)
for (int i = 0; i < filePathCounter; i++)
{
if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f));
DrawText(droppedFiles.paths[i], 120, 100 + 40*i, 10, GRAY);
DrawText(filePaths[i], 120, 100 + 40*i, 10, GRAY);
}
DrawText("Drop new files...", 100, 110 + 40*droppedFiles.count, 20, DARKGRAY);
DrawText("Drop new files...", 100, 110 + 40*filePathCounter, 20, DARKGRAY);
}
EndDrawing();
@@ -75,7 +96,10 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadDroppedFiles(droppedFiles); // Unload files memory
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
{
RL_FREE(filePaths[i]); // Free allocated memory for all filepaths
}
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View File

@@ -0,0 +1,130 @@
/*******************************************************************************************
*
* raylib [core] example - high dpi
*
* Example complexity rating: [★☆☆☆] e/4
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Module Functions Declaration
//------------------------------------------------------------------------------------
static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
SetConfigFlags(FLAG_WINDOW_HIGHDPI | FLAG_WINDOW_RESIZABLE);
InitWindow(screenWidth, screenHeight, "raylib [core] example - high dpi");
SetWindowMinSize(450, 450);
int logicalGridDescY = 120;
int logicalGridLabelY = logicalGridDescY + 30;
int logicalGridTop = logicalGridLabelY + 30;
int logicalGridBottom = logicalGridTop + 80;
int pixelGridTop = logicalGridBottom - 20;
int pixelGridBottom = pixelGridTop + 80;
int pixelGridLabelY = pixelGridBottom + 30;
int pixelGridDescY = pixelGridLabelY + 30;
int cellSize = 50;
float cellSizePx = (float)cellSize;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
int monitorCount = GetMonitorCount();
if ((monitorCount > 1) && IsKeyPressed(KEY_N))
{
SetWindowMonitor((GetCurrentMonitor() + 1)%monitorCount);
}
int currentMonitor = GetCurrentMonitor();
Vector2 dpiScale = GetWindowScaleDPI();
cellSizePx = ((float)cellSize)/dpiScale.x;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
int windowCenter = GetScreenWidth()/2;
DrawTextCenter(TextFormat("Dpi Scale: %f", dpiScale.x), windowCenter, 30, 40, DARKGRAY);
DrawTextCenter(TextFormat("Monitor: %d/%d ([N] next monitor)", currentMonitor+1, monitorCount), windowCenter, 70, 20, LIGHTGRAY);
DrawTextCenter(TextFormat("Window is %d \"logical points\" wide", GetScreenWidth()), windowCenter, logicalGridDescY, 20, ORANGE);
bool odd = true;
for (int i = cellSize; i < GetScreenWidth(); i += cellSize, odd = !odd)
{
if (odd) DrawRectangle(i, logicalGridTop, cellSize, logicalGridBottom-logicalGridTop, ORANGE);
DrawTextCenter(TextFormat("%d", i), i, logicalGridLabelY, 10, LIGHTGRAY);
DrawLine(i, logicalGridLabelY + 10, i, logicalGridBottom, GRAY);
}
odd = true;
const int minTextSpace = 30;
int lastTextX = -minTextSpace;
for (int i = cellSize; i < GetRenderWidth(); i += cellSize, odd = !odd)
{
int x = (int)(((float)i)/dpiScale.x);
if (odd) DrawRectangle(x, pixelGridTop, (int)cellSizePx, pixelGridBottom - pixelGridTop, CLITERAL(Color){ 0, 121, 241, 100 });
DrawLine(x, pixelGridTop, (int)(((float)i)/dpiScale.x), pixelGridLabelY - 10, GRAY);
if ((x - lastTextX) >= minTextSpace)
{
DrawTextCenter(TextFormat("%d", i), x, pixelGridLabelY, 10, LIGHTGRAY);
lastTextX = x;
}
}
DrawTextCenter(TextFormat("Window is %d \"physical pixels\" wide", GetRenderWidth()), windowCenter, pixelGridDescY, 20, BLUE);
const char *text = "Can you see this?";
Vector2 size = MeasureTextEx(GetFontDefault(), text, 20, 3);
Vector2 pos = (Vector2){ GetScreenWidth() - size.x - 5, GetScreenHeight() - size.y - 5 };
DrawTextEx(GetFontDefault(), text, pos, 20, 3, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
//------------------------------------------------------------------------------------
// Module Functions Definition
//------------------------------------------------------------------------------------
static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color)
{
Vector2 size = MeasureTextEx(GetFontDefault(), text, (float)fontSize, 3);
Vector2 pos = (Vector2){ x - size.x/2, y - size.y/2 };
DrawTextEx(GetFontDefault(), text, pos, (float)fontSize, 3, color);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [core] example - Gamepad input
* raylib [core] example - gamepad input
*
* Example complexity rating: [★☆☆☆] 1/4
*
* NOTE: This example requires a Gamepad connected to the system
* raylib is configured to work with the following gamepads:
@@ -13,21 +15,16 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2013-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
// NOTE: Gamepad name ID depends on drivers and OS
#define XBOX360_LEGACY_NAME_ID "Xbox Controller"
#if defined(PLATFORM_RPI)
#define XBOX360_NAME_ID "Microsoft X-Box 360 pad"
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
#else
#define XBOX360_NAME_ID "Xbox 360 Controller"
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
#endif
#define XBOX_ALIAS_1 "xbox"
#define XBOX_ALIAS_2 "x-box"
#define PS_ALIAS "playstation"
//------------------------------------------------------------------------------------
// Program main entry point
@@ -46,9 +43,19 @@ int main(void)
Texture2D texPs3Pad = LoadTexture("resources/ps3.png");
Texture2D texXboxPad = LoadTexture("resources/xbox.png");
// Set axis deadzones
const float leftStickDeadzoneX = 0.1f;
const float leftStickDeadzoneY = 0.1f;
const float rightStickDeadzoneX = 0.1f;
const float rightStickDeadzoneY = 0.1f;
const float leftTriggerDeadzone = -0.9f;
const float rightTriggerDeadzone = -0.9f;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
int gamepad = 0; // which gamepad to display
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
@@ -63,123 +70,205 @@ int main(void)
ClearBackground(RAYWHITE);
if (IsGamepadAvailable(0))
{
DrawText(TextFormat("GP1: %s", GetGamepadName(0)), 10, 10, 10, BLACK);
if (IsKeyPressed(KEY_LEFT) && gamepad > 0) gamepad--;
if (IsKeyPressed(KEY_RIGHT)) gamepad++;
if (TextIsEqual(GetGamepadName(0), XBOX360_NAME_ID) || TextIsEqual(GetGamepadName(0), XBOX360_LEGACY_NAME_ID))
if (IsGamepadAvailable(gamepad))
{
DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK);
// Get axis values
float leftStickX = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_X);
float leftStickY = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_Y);
float rightStickX = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_X);
float rightStickY = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_Y);
float leftTrigger = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER);
float rightTrigger = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER);
// Calculate deadzones
if (leftStickX > -leftStickDeadzoneX && leftStickX < leftStickDeadzoneX) leftStickX = 0.0f;
if (leftStickY > -leftStickDeadzoneY && leftStickY < leftStickDeadzoneY) leftStickY = 0.0f;
if (rightStickX > -rightStickDeadzoneX && rightStickX < rightStickDeadzoneX) rightStickX = 0.0f;
if (rightStickY > -rightStickDeadzoneY && rightStickY < rightStickDeadzoneY) rightStickY = 0.0f;
if (leftTrigger < leftTriggerDeadzone) leftTrigger = -1.0f;
if (rightTrigger < rightTriggerDeadzone) rightTrigger = -1.0f;
if (TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_1) > -1 || TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_2) > -1)
{
DrawTexture(texXboxPad, 0, 0, DARKGRAY);
// Draw buttons: xbox home
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(394, 89, 19, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(394, 89, 19, RED);
// Draw buttons: basic
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(436, 150, 9, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(352, 150, 9, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(501, 151, 15, BLUE);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(536, 187, 15, LIME);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(572, 151, 15, MAROON);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(536, 115, 15, GOLD);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(436, 150, 9, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(352, 150, 9, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(501, 151, 15, BLUE);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(536, 187, 15, LIME);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(572, 151, 15, MAROON);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(536, 115, 15, GOLD);
// Draw buttons: d-pad
DrawRectangle(317, 202, 19, 71, BLACK);
DrawRectangle(293, 228, 69, 19, BLACK);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(317, 202, 19, 26, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(292, 228, 25, 19, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(317, 202, 19, 26, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(292, 228, 25, 19, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED);
// Draw buttons: left-right back
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(259, 61, 20, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(259, 61, 20, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED);
// Draw axis: left joystick
Color leftGamepadColor = BLACK;
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED;
DrawCircle(259, 152, 39, BLACK);
DrawCircle(259, 152, 34, LIGHTGRAY);
DrawCircle(259 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X)*20),
152 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK);
DrawCircle(259 + (int)(leftStickX*20),
152 + (int)(leftStickY*20), 25, leftGamepadColor);
// Draw axis: right joystick
Color rightGamepadColor = BLACK;
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_THUMB)) rightGamepadColor = RED;
DrawCircle(461, 237, 38, BLACK);
DrawCircle(461, 237, 33, LIGHTGRAY);
DrawCircle(461 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20),
237 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
DrawCircle(461 + (int)(rightStickX*20),
237 + (int)(rightStickY*20), 25, rightGamepadColor);
// Draw axis: left-right triggers
DrawRectangle(170, 30, 15, 70, GRAY);
DrawRectangle(604, 30, 15, 70, GRAY);
DrawRectangle(170, 30, 15, (int)(((1 + GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER))/2)*70), RED);
DrawRectangle(604, 30, 15, (int)(((1 + GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER))/2)*70), RED);
DrawRectangle(170, 30, 15, (int)(((1 + leftTrigger)/2)*70), RED);
DrawRectangle(604, 30, 15, (int)(((1 + rightTrigger)/2)*70), RED);
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
}
else if (TextIsEqual(GetGamepadName(0), PS3_NAME_ID))
else if (TextFindIndex(TextToLower(GetGamepadName(gamepad)), PS_ALIAS) > -1)
{
DrawTexture(texPs3Pad, 0, 0, DARKGRAY);
// Draw buttons: ps
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(396, 222, 13, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(396, 222, 13, RED);
// Draw buttons: basic
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawRectangle(328, 170, 32, 13, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(557, 144, 13, LIME);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(586, 173, 13, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(557, 203, 13, VIOLET);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(527, 173, 13, PINK);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawRectangle(328, 170, 32, 13, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(557, 144, 13, LIME);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(586, 173, 13, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(557, 203, 13, VIOLET);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(527, 173, 13, PINK);
// Draw buttons: d-pad
DrawRectangle(225, 132, 24, 84, BLACK);
DrawRectangle(195, 161, 84, 25, BLACK);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(225, 132, 24, 29, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(195, 161, 30, 25, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(225, 132, 24, 29, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(195, 161, 30, 25, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED);
// Draw buttons: left-right back buttons
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(239, 82, 20, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(557, 82, 20, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(239, 82, 20, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(557, 82, 20, RED);
// Draw axis: left joystick
Color leftGamepadColor = BLACK;
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED;
DrawCircle(319, 255, 35, BLACK);
DrawCircle(319, 255, 31, LIGHTGRAY);
DrawCircle(319 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) * 20),
255 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) * 20), 25, BLACK);
DrawCircle(319 + (int)(leftStickX*20),
255 + (int)(leftStickY*20), 25, leftGamepadColor);
// Draw axis: right joystick
Color rightGamepadColor = BLACK;
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_THUMB)) rightGamepadColor = RED;
DrawCircle(475, 255, 35, BLACK);
DrawCircle(475, 255, 31, LIGHTGRAY);
DrawCircle(475 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X) * 20),
255 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y) * 20), 25, BLACK);
DrawCircle(475 + (int)(rightStickX*20),
255 + (int)(rightStickY*20), 25, rightGamepadColor);
// Draw axis: left-right triggers
DrawRectangle(169, 48, 15, 70, GRAY);
DrawRectangle(611, 48, 15, 70, GRAY);
DrawRectangle(169, 48, 15, (int)(((1 - GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)) / 2) * 70), RED);
DrawRectangle(611, 48, 15, (int)(((1 - GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)) / 2) * 70), RED);
DrawRectangle(169, 48, 15, (int)(((1 + leftTrigger)/2)*70), RED);
DrawRectangle(611, 48, 15, (int)(((1 + rightTrigger)/2)*70), RED);
}
else
{
DrawText("- GENERIC GAMEPAD -", 280, 180, 20, GRAY);
// TODO: Draw generic gamepad
// Draw background: generic
DrawRectangleRounded((Rectangle){ 175, 110, 460, 220}, 0.3f, 16, DARKGRAY);
// Draw buttons: basic
DrawCircle(365, 170, 12, RAYWHITE);
DrawCircle(405, 170, 12, RAYWHITE);
DrawCircle(445, 170, 12, RAYWHITE);
DrawCircle(516, 191, 17, RAYWHITE);
DrawCircle(551, 227, 17, RAYWHITE);
DrawCircle(587, 191, 17, RAYWHITE);
DrawCircle(551, 155, 17, RAYWHITE);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(365, 170, 10, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(405, 170, 10, GREEN);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(445, 170, 10, BLUE);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(516, 191, 15, GOLD);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(551, 227, 15, BLUE);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(587, 191, 15, GREEN);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(551, 155, 15, RED);
// Draw buttons: d-pad
DrawRectangle(245, 145, 28, 88, RAYWHITE);
DrawRectangle(215, 174, 88, 29, RAYWHITE);
DrawRectangle(247, 147, 24, 84, BLACK);
DrawRectangle(217, 176, 84, 25, BLACK);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(247, 147, 24, 29, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(247, 147 + 54, 24, 30, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(217, 176, 30, 25, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(217 + 54, 176, 30, 25, RED);
// Draw buttons: left-right back
DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 16, DARKGRAY);
DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 16, DARKGRAY);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 16, RED);
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 16, RED);
// Draw axis: left joystick
Color leftGamepadColor = BLACK;
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED;
DrawCircle(345, 260, 40, BLACK);
DrawCircle(345, 260, 35, LIGHTGRAY);
DrawCircle(345 + (int)(leftStickX*20),
260 + (int)(leftStickY*20), 25, leftGamepadColor);
// Draw axis: right joystick
Color rightGamepadColor = BLACK;
if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_THUMB)) rightGamepadColor = RED;
DrawCircle(465, 260, 40, BLACK);
DrawCircle(465, 260, 35, LIGHTGRAY);
DrawCircle(465 + (int)(rightStickX*20),
260 + (int)(rightStickY*20), 25, rightGamepadColor);
// Draw axis: left-right triggers
DrawRectangle(151, 110, 15, 70, GRAY);
DrawRectangle(644, 110, 15, 70, GRAY);
DrawRectangle(151, 110, 15, (int)(((1 + leftTrigger)/2)*70), RED);
DrawRectangle(644, 110, 15, (int)(((1 + rightTrigger)/2)*70), RED);
}
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(0)), 10, 50, 10, MAROON);
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(gamepad)), 10, 50, 10, MAROON);
for (int i = 0; i < GetGamepadAxisCount(0); i++)
for (int i = 0; i < GetGamepadAxisCount(gamepad); i++)
{
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(0, i)), 20, 70 + 20*i, 10, DARKGRAY);
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(gamepad, i)), 20, 70 + 20*i, 10, DARKGRAY);
}
if (GetGamepadButtonPressed() != -1) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
if (GetGamepadButtonPressed() != GAMEPAD_BUTTON_UNKNOWN) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
}
else
{
DrawText("GP1: NOT DETECTED", 10, 10, 10, GRAY);
DrawText(TextFormat("GP%d: NOT DETECTED", gamepad), 10, 10, 10, GRAY);
DrawTexture(texXboxPad, 0, 0, LIGHTGRAY);
}

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] example - Input Gestures Detection
* raylib [core] example - input gestures
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 1.4, last time updated with raylib 4.2
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2016-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

@@ -0,0 +1,332 @@
/*******************************************************************************************
*
* raylib [core] example - input gestures web
*
* Example complexity rating: [★★☆☆] 2/4
*
* Example originally created with raylib 4.6-dev, last time updated with raylib 4.6-dev
*
* Example contributed by ubkp (@ubkp) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2023-2025 ubkp (@ubkp)
*
********************************************************************************************/
#include "raylib.h"
#include "math.h" // Required for the protractor angle graphic drawing
#if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h> // Required for the Web/HTML5
#endif
//--------------------------------------------------------------------------------------
// Global definitions and declarations
//--------------------------------------------------------------------------------------
// Common variables definitions
//--------------------------------------------------------------------------------------
int screenWidth = 800; // Update depending on web canvas
const int screenHeight = 450;
Vector2 messagePosition = { 160, 7 };
// Last gesture variables definitions
//--------------------------------------------------------------------------------------
int lastGesture = 0;
Vector2 lastGesturePosition = { 165, 130 };
// Gesture log variables definitions and functions declarations
//--------------------------------------------------------------------------------------
#define GESTURE_LOG_SIZE 20
char gestureLog[GESTURE_LOG_SIZE][12] = { "" }; // The gesture log uses an array (as an inverted circular queue) to store the performed gestures
int gestureLogIndex = GESTURE_LOG_SIZE; // The index for the inverted circular queue (moving from last to first direction, then looping around)
int previousGesture = 0;
char const *GetGestureName(int i)
{
switch (i) {
case 0: return "None"; break;
case 1: return "Tap"; break;
case 2: return "Double Tap"; break;
case 4: return "Hold"; break;
case 8: return "Drag"; break;
case 16: return "Swipe Right"; break;
case 32: return "Swipe Left"; break;
case 64: return "Swipe Up"; break;
case 128: return "Swipe Down"; break;
case 256: return "Pinch In"; break;
case 512: return "Pinch Out"; break;
default: return "Unknown"; break;
}
}
Color GetGestureColor(int i)
{
switch (i) {
case 0: return BLACK; break;
case 1: return BLUE; break;
case 2: return SKYBLUE; break;
case 4: return BLACK; break;
case 8: return LIME; break;
case 16: return RED; break;
case 32: return RED; break;
case 64: return RED; break;
case 128: return RED; break;
case 256: return VIOLET; break;
case 512: return ORANGE; break;
default: return BLACK; break;
}
}
int logMode = 1; // Log mode values: 0 shows repeated events; 1 hides repeated events; 2 shows repeated events but hide hold events; 3 hides repeated events and hide hold events
Color gestureColor = { 0, 0, 0, 255 };
Rectangle logButton1 = { 53, 7, 48, 26 };
Rectangle logButton2 = { 108, 7, 36, 26 };
Vector2 gestureLogPosition = { 10, 10 };
// Protractor variables definitions
//--------------------------------------------------------------------------------------
float angleLength = 90.0f;
float currentAngleDegrees = 0.0f;
Vector2 finalVector = { 0.0f, 0.0f };
char currentAngleStr[7] = "";
Vector2 protractorPosition = { 266.0f, 315.0f };
// Update
//--------------------------------------------------------------------------------------
void Update(void)
{
// Handle common
//--------------------------------------------------------------------------------------
int i, ii; // Iterators that will be reused by all for loops
const int currentGesture = GetGestureDetected();
const float currentDragDegrees = GetGestureDragAngle();
const float currentPitchDegrees = GetGesturePinchAngle();
const int touchCount = GetTouchPointCount();
// Handle last gesture
//--------------------------------------------------------------------------------------
if ((currentGesture != 0) && (currentGesture != 4) && (currentGesture != previousGesture)) lastGesture = currentGesture; // Filter the meaningful gestures (1, 2, 8 to 512) for the display
// Handle gesture log
//--------------------------------------------------------------------------------------
if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT))
{
if (CheckCollisionPointRec(GetMousePosition(), logButton1))
{
switch (logMode)
{
case 3: logMode=2; break;
case 2: logMode=3; break;
case 1: logMode=0; break;
default: logMode=1; break;
}
}
else if (CheckCollisionPointRec(GetMousePosition(), logButton2))
{
switch (logMode)
{
case 3: logMode=1; break;
case 2: logMode=0; break;
case 1: logMode=3; break;
default: logMode=2; break;
}
}
}
int fillLog = 0; // Gate variable to be used to allow or not the gesture log to be filled
if (currentGesture !=0)
{
if (logMode == 3) // 3 hides repeated events and hide hold events
{
if (((currentGesture != 4) && (currentGesture != previousGesture)) || (currentGesture < 3)) fillLog = 1;
}
else if (logMode == 2) // 2 shows repeated events but hide hold events
{
if (currentGesture != 4) fillLog = 1;
}
else if (logMode == 1) // 1 hides repeated events
{
if (currentGesture != previousGesture) fillLog = 1;
}
else // 0 shows repeated events
{
fillLog = 1;
}
}
if (fillLog) // If one of the conditions from logMode was met, fill the gesture log
{
previousGesture = currentGesture;
gestureColor = GetGestureColor(currentGesture);
if (gestureLogIndex <= 0) gestureLogIndex = GESTURE_LOG_SIZE;
gestureLogIndex--;
// Copy the gesture respective name to the gesture log array
TextCopy(gestureLog[gestureLogIndex], GetGestureName(currentGesture));
}
// Handle protractor
//--------------------------------------------------------------------------------------
if (currentGesture > 255) // aka Pinch In and Pinch Out
{
currentAngleDegrees = currentPitchDegrees;
}
else if (currentGesture > 15) // aka Swipe Right, Swipe Left, Swipe Up and Swipe Down
{
currentAngleDegrees = currentDragDegrees;
}
else if (currentGesture > 0) // aka Tap, Doubletap, Hold and Grab
{
currentAngleDegrees = 0.0f;
}
float currentAngleRadians = ((currentAngleDegrees +90.0f)*PI/180); // Convert the current angle to Radians
finalVector = (Vector2){ (angleLength*sinf(currentAngleRadians)) + protractorPosition.x, (angleLength*cosf(currentAngleRadians)) + protractorPosition.y }; // Calculate the final vector for display
// Handle touch and mouse pointer points
//--------------------------------------------------------------------------------------
#define MAX_TOUCH_COUNT 32
Vector2 touchPosition[MAX_TOUCH_COUNT] = { 0 };
Vector2 mousePosition = {0, 0};
if (currentGesture != GESTURE_NONE)
{
if (touchCount != 0)
{
for (i = 0; i < touchCount; i++) touchPosition[i] = GetTouchPosition(i); // Fill the touch positions
}
else mousePosition = GetMousePosition();
}
// Draw
//--------------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
// Draw common
//--------------------------------------------------------------------------------------
DrawText("*", messagePosition.x + 5, messagePosition.y + 5, 10, BLACK);
DrawText("Example optimized for Web/HTML5\non Smartphones with Touch Screen.", messagePosition.x + 15, messagePosition.y + 5, 10, BLACK);
DrawText("*", messagePosition.x + 5, messagePosition.y + 35, 10, BLACK);
DrawText("While running on Desktop Web Browsers,\ninspect and turn on Touch Emulation.", messagePosition.x + 15, messagePosition.y + 35, 10, BLACK);
// Draw last gesture
//--------------------------------------------------------------------------------------
DrawText("Last gesture", lastGesturePosition.x + 33, lastGesturePosition.y - 47, 20, BLACK);
DrawText("Swipe Tap Pinch Touch", lastGesturePosition.x + 17, lastGesturePosition.y - 18, 10, BLACK);
DrawRectangle(lastGesturePosition.x + 20, lastGesturePosition.y, 20, 20, lastGesture == GESTURE_SWIPE_UP ? RED : LIGHTGRAY);
DrawRectangle(lastGesturePosition.x, lastGesturePosition.y + 20, 20, 20, lastGesture == GESTURE_SWIPE_LEFT ? RED : LIGHTGRAY);
DrawRectangle(lastGesturePosition.x + 40, lastGesturePosition.y + 20, 20, 20, lastGesture == GESTURE_SWIPE_RIGHT ? RED : LIGHTGRAY);
DrawRectangle(lastGesturePosition.x + 20, lastGesturePosition.y + 40, 20, 20, lastGesture == GESTURE_SWIPE_DOWN ? RED : LIGHTGRAY);
DrawCircle(lastGesturePosition.x + 80, lastGesturePosition.y + 16, 10, lastGesture == GESTURE_TAP ? BLUE : LIGHTGRAY);
DrawRing( (Vector2){lastGesturePosition.x + 103, lastGesturePosition.y + 16}, 6.0f, 11.0f, 0.0f, 360.0f, 0, lastGesture == GESTURE_DRAG ? LIME : LIGHTGRAY);
DrawCircle(lastGesturePosition.x + 80, lastGesturePosition.y + 43, 10, lastGesture == GESTURE_DOUBLETAP ? SKYBLUE : LIGHTGRAY);
DrawCircle(lastGesturePosition.x + 103, lastGesturePosition.y + 43, 10, lastGesture == GESTURE_DOUBLETAP ? SKYBLUE : LIGHTGRAY);
DrawTriangle((Vector2){ lastGesturePosition.x + 122, lastGesturePosition.y + 16 }, (Vector2){ lastGesturePosition.x + 137, lastGesturePosition.y + 26 }, (Vector2){ lastGesturePosition.x + 137, lastGesturePosition.y + 6 }, lastGesture == GESTURE_PINCH_OUT? ORANGE : LIGHTGRAY);
DrawTriangle((Vector2){ lastGesturePosition.x + 147, lastGesturePosition.y + 6 }, (Vector2){ lastGesturePosition.x + 147, lastGesturePosition.y + 26 }, (Vector2){ lastGesturePosition.x + 162, lastGesturePosition.y + 16 }, lastGesture == GESTURE_PINCH_OUT? ORANGE : LIGHTGRAY);
DrawTriangle((Vector2){ lastGesturePosition.x + 125, lastGesturePosition.y + 33 }, (Vector2){ lastGesturePosition.x + 125, lastGesturePosition.y + 53 }, (Vector2){ lastGesturePosition.x + 140, lastGesturePosition.y + 43 }, lastGesture == GESTURE_PINCH_IN? VIOLET : LIGHTGRAY);
DrawTriangle((Vector2){ lastGesturePosition.x + 144, lastGesturePosition.y + 43 }, (Vector2){ lastGesturePosition.x + 159, lastGesturePosition.y + 53 }, (Vector2){ lastGesturePosition.x + 159, lastGesturePosition.y + 33 }, lastGesture == GESTURE_PINCH_IN? VIOLET : LIGHTGRAY);
for (i = 0; i < 4; i++) DrawCircle(lastGesturePosition.x + 180, lastGesturePosition.y + 7 + i*15, 5, touchCount <= i? LIGHTGRAY : gestureColor);
// Draw gesture log
//--------------------------------------------------------------------------------------
DrawText("Log", gestureLogPosition.x, gestureLogPosition.y, 20, BLACK);
// Loop in both directions to print the gesture log array in the inverted order (and looping around if the index started somewhere in the middle)
for (i = 0, ii = gestureLogIndex; i < GESTURE_LOG_SIZE; i++, ii = (ii + 1) % GESTURE_LOG_SIZE) DrawText(gestureLog[ii], gestureLogPosition.x, gestureLogPosition.y + 410 - i*20, 20, (i == 0 ? gestureColor : LIGHTGRAY));
Color logButton1Color, logButton2Color;
switch (logMode)
{
case 3: logButton1Color=MAROON; logButton2Color=MAROON; break;
case 2: logButton1Color=GRAY; logButton2Color=MAROON; break;
case 1: logButton1Color=MAROON; logButton2Color=GRAY; break;
default: logButton1Color=GRAY; logButton2Color=GRAY; break;
}
DrawRectangleRec(logButton1, logButton1Color);
DrawText("Hide", logButton1.x + 7, logButton1.y + 3, 10, WHITE);
DrawText("Repeat", logButton1.x + 7, logButton1.y + 13, 10, WHITE);
DrawRectangleRec(logButton2, logButton2Color);
DrawText("Hide", logButton1.x + 62, logButton1.y + 3, 10, WHITE);
DrawText("Hold", logButton1.x + 62, logButton1.y + 13, 10, WHITE);
// Draw protractor
//--------------------------------------------------------------------------------------
DrawText("Angle", protractorPosition.x + 55, protractorPosition.y + 76, 10, BLACK);
const char *angleString = TextFormat("%f", currentAngleDegrees);
const int angleStringDot = TextFindIndex(angleString, ".");
const char *angleStringTrim = TextSubtext(angleString, 0, angleStringDot + 3);
DrawText( angleStringTrim, protractorPosition.x + 55, protractorPosition.y + 92, 20, gestureColor);
DrawCircle(protractorPosition.x, protractorPosition.y, 80.0f, WHITE);
DrawLineEx((Vector2){ protractorPosition.x - 90, protractorPosition.y }, (Vector2){ protractorPosition.x + 90, protractorPosition.y }, 3.0f, LIGHTGRAY);
DrawLineEx((Vector2){ protractorPosition.x, protractorPosition.y - 90 }, (Vector2){ protractorPosition.x, protractorPosition.y + 90 }, 3.0f, LIGHTGRAY);
DrawLineEx((Vector2){ protractorPosition.x - 80, protractorPosition.y - 45 }, (Vector2){ protractorPosition.x + 80, protractorPosition.y + 45 }, 3.0f, GREEN);
DrawLineEx((Vector2){ protractorPosition.x - 80, protractorPosition.y + 45 }, (Vector2){ protractorPosition.x + 80, protractorPosition.y - 45 }, 3.0f, GREEN);
DrawText("0", protractorPosition.x + 96, protractorPosition.y - 9, 20, BLACK);
DrawText("30", protractorPosition.x + 74, protractorPosition.y - 68, 20, BLACK);
DrawText("90", protractorPosition.x - 11, protractorPosition.y - 110, 20, BLACK);
DrawText("150", protractorPosition.x - 100, protractorPosition.y - 68, 20, BLACK);
DrawText("180", protractorPosition.x - 124, protractorPosition.y - 9, 20, BLACK);
DrawText("210", protractorPosition.x - 100, protractorPosition.y + 50, 20, BLACK);
DrawText("270", protractorPosition.x - 18, protractorPosition.y + 92, 20, BLACK);
DrawText("330", protractorPosition.x + 72, protractorPosition.y + 50, 20, BLACK);
if (currentAngleDegrees != 0.0f) DrawLineEx(protractorPosition, finalVector, 3.0f, gestureColor);
// Draw touch and mouse pointer points
//--------------------------------------------------------------------------------------
if (currentGesture != GESTURE_NONE)
{
if ( touchCount != 0 )
{
for (i = 0; i < touchCount; i++)
{
DrawCircleV(touchPosition[i], 50.0f, Fade(gestureColor, 0.5f));
DrawCircleV(touchPosition[i], 5.0f, gestureColor);
}
if (touchCount == 2) DrawLineEx(touchPosition[0], touchPosition[1], ((currentGesture == 512)? 8 : 12), gestureColor);
}
else
{
DrawCircleV(mousePosition, 35.0f, Fade(gestureColor, 0.5f));
DrawCircleV(mousePosition, 5.0f, gestureColor);
}
}
EndDrawing();
//--------------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
InitWindow(screenWidth, screenHeight, "raylib [core] example - input gestures web");
//--------------------------------------------------------------------------------------
// Main game loop
//--------------------------------------------------------------------------------------
#if defined(PLATFORM_WEB)
emscripten_set_main_loop(Update, 0, 1);
#else
SetTargetFPS(60);
while (!WindowShouldClose()) Update(); // Detect window close button or ESC key
#endif
//--------------------------------------------------------------------------------------
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] example - Keyboard input
* raylib [core] example - keyboard input
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] example - Mouse input
* raylib [core] example - mouse input
*
* Example originally created with raylib 1.0, last time updated with raylib 4.0
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.0, last time updated with raylib 5.5
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -36,6 +38,18 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_H))
{
if (IsCursorHidden())
{
ShowCursor();
}
else
{
HideCursor();
}
}
ballPosition = GetMousePosition();
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) ballColor = MAROON;
@@ -56,6 +70,10 @@ int main(void)
DrawCircleV(ballPosition, 40, ballColor);
DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY);
DrawText("Press 'H' to toggle cursor visibility", 10, 30, 20, DARKGRAY);
if (!IsCursorHidden()) DrawText("CURSOR HIDDEN", 20, 60, 20, RED);
else DrawText("CURSOR VISIBLE", 20, 60, 20, LIME);
EndDrawing();
//----------------------------------------------------------------------------------

View File

@@ -1,13 +1,15 @@
/*******************************************************************************************
*
* raylib [core] examples - Mouse wheel input
* raylib [core] example - input mouse wheel
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 1.1, last time updated with raylib 1.3
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -36,7 +38,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
boxPositionY -= (GetMouseWheelMove()*scrollSpeed);
boxPositionY -= (int)(GetMouseWheelMove()*scrollSpeed);
//----------------------------------------------------------------------------------
// Draw

View File

@@ -1,6 +1,8 @@
/*******************************************************************************************
*
* raylib [core] example - Input multitouch
* raylib [core] example - input multitouch
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 2.1, last time updated with raylib 2.5
*
@@ -9,7 +11,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2022 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
* Copyright (c) 2019-2025 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -39,8 +41,12 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
// Get multiple touchpoints
for (int i = 0; i < MAX_TOUCH_POINTS; ++i) touchPositions[i] = GetTouchPosition(i);
// Get the touch point count ( how many fingers are touching the screen )
int tCount = GetTouchPointCount();
// Clamp touch points available ( set the maximum touch points allowed )
if (tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
// Get touch points positions
for (int i = 0; i < tCount; ++i) touchPositions[i] = GetTouchPosition(i);
//----------------------------------------------------------------------------------
// Draw
@@ -48,8 +54,8 @@ int main(void)
BeginDrawing();
ClearBackground(RAYWHITE);
for (int i = 0; i < MAX_TOUCH_POINTS; ++i)
for (int i = 0; i < tCount; ++i)
{
// Make sure point is not (0, 0) as this means there is no touch for it
if ((touchPositions[i].x > 0) && (touchPositions[i].y > 0))
@@ -72,4 +78,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

View File

@@ -0,0 +1,160 @@
/*******************************************************************************************
*
* raylib [core] example - input virtual controls
*
* Example complexity rating: [★★★☆] 3/4
*
* Example originally created with raylib 5.0, last time updated with raylib 5.0
*
* Example create by GreenSnakeLinux (@GreenSnakeLinux),
* lighter by oblerion (@oblerion) and
* reviewed by Ramon Santamaria (@raysan5) and
* improved by danilwhale (@danilwhale)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2024-2025 oblerion (@oblerion) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <math.h>
typedef enum {
BUTTON_NONE = -1,
BUTTON_UP,
BUTTON_LEFT,
BUTTON_RIGHT,
BUTTON_DOWN,
BUTTON_MAX
} PadButton;
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - input virtual controls");
Vector2 padPosition = { 100, 350 };
float buttonRadius = 30;
Vector2 buttonPositions[BUTTON_MAX] =
{
{ padPosition.x,padPosition.y - buttonRadius*1.5f }, // Up
{ padPosition.x - buttonRadius*1.5f, padPosition.y }, // Left
{ padPosition.x + buttonRadius*1.5f, padPosition.y }, // Right
{ padPosition.x, padPosition.y + buttonRadius*1.5f } // Down
};
const char *buttonLabels[BUTTON_MAX] =
{
"Y", // Up
"X", // Left
"B", // Right
"A" // Down
};
Color buttonLabelColors[BUTTON_MAX] =
{
YELLOW, // Up
BLUE, // Left
RED, // Right
GREEN // Down
};
int pressedButton = BUTTON_NONE;
Vector2 inputPosition = { 0, 0 };
Vector2 playerPosition = { (float)screenWidth/2, (float)screenHeight/2 };
float playerSpeed = 75;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//--------------------------------------------------------------------------
if ((GetTouchPointCount() > 0))
{
// Use touch position
inputPosition = GetTouchPosition(0);
}
else
{
// Use mouse position
inputPosition = GetMousePosition();
}
// Reset pressed button to none
pressedButton = BUTTON_NONE;
// Make sure user is pressing left mouse button if they're from desktop
if ((GetTouchPointCount() > 0) || ((GetTouchPointCount() == 0) && IsMouseButtonDown(MOUSE_BUTTON_LEFT)))
{
// Find nearest D-Pad button to the input position
for (int i = 0; i < BUTTON_MAX; i++)
{
float distX = fabsf(buttonPositions[i].x - inputPosition.x);
float distY = fabsf(buttonPositions[i].y - inputPosition.y);
if ((distX + distY < buttonRadius))
{
pressedButton = i;
break;
}
}
}
// Move player according to pressed button
switch (pressedButton)
{
case BUTTON_UP: playerPosition.y -= playerSpeed*GetFrameTime(); break;
case BUTTON_LEFT: playerPosition.x -= playerSpeed*GetFrameTime(); break;
case BUTTON_RIGHT: playerPosition.x += playerSpeed*GetFrameTime(); break;
case BUTTON_DOWN: playerPosition.y += playerSpeed*GetFrameTime(); break;
default: break;
};
//--------------------------------------------------------------------------
// Draw
//--------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
// Draw world
DrawCircleV(playerPosition, 50, MAROON);
// Draw GUI
for (int i = 0; i < BUTTON_MAX; i++)
{
DrawCircleV(buttonPositions[i], buttonRadius, (i == pressedButton)? DARKGRAY : BLACK);
DrawText(buttonLabels[i],
(int)buttonPositions[i].x - 7, (int)buttonPositions[i].y - 8,
20, buttonLabelColors[i]);
}
DrawText("move the player with D-Pad buttons", 10, 10, 20, DARKGRAY);
EndDrawing();
//--------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,151 +0,0 @@
/*******************************************************************************************
*
* raylib [cpre] example - loading thread
*
* NOTE: This example requires linking with pthreads library on MinGW,
* it can be accomplished passing -static parameter to compiler
*
* Example originally created with raylib 2.5, last time updated with raylib 3.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
*
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "pthread.h" // POSIX style threads management
#include <stdatomic.h> // C11 atomic data types
#include <time.h> // Required for: clock()
// Using C11 atomics for synchronization
// NOTE: A plain bool (or any plain data type for that matter) can't be used for inter-thread synchronization
static atomic_bool dataLoaded = ATOMIC_VAR_INIT(false); // Data Loaded completion indicator
static void *LoadDataThread(void *arg); // Loading data thread function declaration
static int dataProgress = 0; // Data progress accumulator
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - loading thread");
pthread_t threadId; // Loading data thread id
enum { STATE_WAITING, STATE_LOADING, STATE_FINISHED } state = STATE_WAITING;
int framesCounter = 0;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
switch (state)
{
case STATE_WAITING:
{
if (IsKeyPressed(KEY_ENTER))
{
int error = pthread_create(&threadId, NULL, &LoadDataThread, NULL);
if (error != 0) TraceLog(LOG_ERROR, "Error creating loading thread");
else TraceLog(LOG_INFO, "Loading thread initialized successfully");
state = STATE_LOADING;
}
} break;
case STATE_LOADING:
{
framesCounter++;
if (atomic_load(&dataLoaded))
{
framesCounter = 0;
state = STATE_FINISHED;
}
} break;
case STATE_FINISHED:
{
if (IsKeyPressed(KEY_ENTER))
{
// Reset everything to launch again
atomic_store(&dataLoaded, false);
dataProgress = 0;
state = STATE_WAITING;
}
} break;
default: break;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
switch (state)
{
case STATE_WAITING: DrawText("PRESS ENTER to START LOADING DATA", 150, 170, 20, DARKGRAY); break;
case STATE_LOADING:
{
DrawRectangle(150, 200, dataProgress, 60, SKYBLUE);
if ((framesCounter/15)%2) DrawText("LOADING DATA...", 240, 210, 40, DARKBLUE);
} break;
case STATE_FINISHED:
{
DrawRectangle(150, 200, 500, 60, LIME);
DrawText("DATA LOADED!", 250, 210, 40, GREEN);
} break;
default: break;
}
DrawRectangleLines(150, 200, 500, 60, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
// Loading data thread function definition
static void *LoadDataThread(void *arg)
{
int timeCounter = 0; // Time counted in ms
clock_t prevTime = clock(); // Previous time
// We simulate data loading with a time counter for 5 seconds
while (timeCounter < 5000)
{
clock_t currentTime = clock() - prevTime;
timeCounter = currentTime*1000/CLOCKS_PER_SEC;
// We accumulate time over a global variable to be used in
// main thread as a progress bar
dataProgress = timeCounter/10;
}
// When data has finished loading, we set global variable
atomic_store(&dataLoaded, true);
return NULL;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,178 @@
/*******************************************************************************************
*
* raylib [core] example - generate random sequence
*
* Example complexity rating: [★☆☆☆] 1/4
*
* Example originally created with raylib 5.0, last time updated with raylib 5.0
*
* Example contributed by Dalton Overmyer (@REDl3east) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2023-2025 Dalton Overmyer (@REDl3east)
*
********************************************************************************************/
#include "raylib.h"
#include "raymath.h"
#include <stdlib.h> // Required for: malloc(), free()
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
typedef struct ColorRect {
Color color;
Rectangle rect;
} ColorRect;
//------------------------------------------------------------------------------------
// Module Functions Declaration
//------------------------------------------------------------------------------------
static Color GenerateRandomColor(void);
static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight);
static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - generate random sequence");
int rectCount = 20;
float rectSize = (float)screenWidth/rectCount;
ColorRect *rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_SPACE)) ShuffleColorRectSequence(rectangles, rectCount);
if (IsKeyPressed(KEY_UP))
{
rectCount++;
rectSize = (float)screenWidth/rectCount;
RL_FREE(rectangles);
// Re-generate random sequence with new count
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
}
if (IsKeyPressed(KEY_DOWN))
{
if (rectCount >= 4)
{
rectCount--;
rectSize = (float)screenWidth/rectCount;
RL_FREE(rectangles);
// Re-generate random sequence with new count
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
}
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
for (int i = 0; i < rectCount; i++)
{
DrawRectangleRec(rectangles[i].rect, rectangles[i].color);
DrawText("Press SPACE to shuffle the sequence", 10, screenHeight - 96, 20, BLACK);
DrawText("Press SPACE to shuffle the current sequence", 10, screenHeight - 96, 20, BLACK);
DrawText("Press UP to add a rectangle and generate a new sequence", 10, screenHeight - 64, 20, BLACK);
DrawText("Press DOWN to remove a rectangle and generate a new sequence", 10, screenHeight - 32, 20, BLACK);
}
DrawText(TextFormat("Count: %d rectangles", rectCount), 10, 10, 20, MAROON);
DrawFPS(screenWidth - 80, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
free(rectangles);
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
//------------------------------------------------------------------------------------
// Module Functions Definition
//------------------------------------------------------------------------------------
static Color GenerateRandomColor(void)
{
Color color = {
GetRandomValue(0, 255),
GetRandomValue(0, 255),
GetRandomValue(0, 255),
255
};
return color;
}
static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight)
{
ColorRect *rectangles = (ColorRect *)RL_CALLOC((int)rectCount, sizeof(ColorRect));
int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount - 1);
float rectSeqWidth = rectCount*rectWidth;
float startX = (screenWidth - rectSeqWidth)*0.5f;
for (int i = 0; i < rectCount; i++)
{
int rectHeight = (int)Remap((float)seq[i], 0, rectCount - 1, 0, screenHeight);
rectangles[i].color = GenerateRandomColor();
rectangles[i].rect = CLITERAL(Rectangle){ startX + i*rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight };
}
UnloadRandomSequence(seq);
return rectangles;
}
static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount)
{
int *seq = LoadRandomSequence(rectCount, 0, rectCount - 1);
for (int i1 = 0; i1 < rectCount; i1++)
{
ColorRect *r1 = &rectangles[i1];
ColorRect *r2 = &rectangles[seq[i1]];
// Swap only the color and height
ColorRect tmp = *r1;
r1->color = r2->color;
r1->rect.height = r2->rect.height;
r1->rect.y = r2->rect.y;
r2->color = tmp.color;
r2->rect.height = tmp.rect.height;
r2->rect.y = tmp.rect.y;
}
UnloadRandomSequence(seq);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Some files were not shown because too many files have changed in this diff Show More