diff --git a/BINDINGS.md b/BINDINGS.md index 3bc235b76..6f96103c7 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -10,7 +10,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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/ChrisDill/Raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | +| [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.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | @@ -48,7 +48,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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.0** | [nelua](https://nelua.io) | Zlib | +| [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 | @@ -76,7 +76,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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-for-v](https://github.com/EmmaTheMartian/raylib-for-v) | 5.5 | [V](https://vlang.io) | MIT/Unlicense | +| [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 | diff --git a/CHANGELOG b/CHANGELOG index 61e12a3d4..f792bca4d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1671,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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9905ba144..af4444e07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.12) +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 diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 00ecb594d..4e413fe61 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -2,6 +2,10 @@ include(CMakeDependentOption) include(EnumOption) +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;ES 3.0" "Force a specific OpenGL Version?") diff --git a/README.md b/README.md index 29f0f61ff..4b242f171 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ 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) diff --git a/examples/Makefile b/examples/Makefile index 834007c26..0a2c908a3 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -233,9 +233,6 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -D_DEBUG - ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) - CFLAGS += -sASSERTIONS=1 --profiling - endif else ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) @@ -637,6 +634,7 @@ SHADERS = \ 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 \ diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 3757e4a3d..6f060652f 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -189,9 +189,6 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -D_DEBUG - ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) - CFLAGS += -sASSERTIONS=1 --profiling - endif else ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) @@ -517,6 +514,7 @@ SHADERS = \ 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 \ @@ -1042,10 +1040,10 @@ shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c shaders/shaders_deferred_render: shaders/shaders_deferred_render.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/fudesumi.png@resources/fudesumi.png \ - --preload-file shaders/resources/shaders/glsl330/gbuffer.vs@resources/shaders/glsl330/gbuffer.vs \ - --preload-file shaders/resources/shaders/glsl330/gbuffer.fs@resources/shaders/glsl330/gbuffer.fs \ - --preload-file shaders/resources/shaders/glsl330/deferred_shading.fs@resources/shaders/glsl330/deferred_shading.fs \ - --preload-file shaders/resources/shaders/glsl330/deferred_shading.fs@resources/shaders/glsl330/deferred_shading.fs + --preload-file shaders/resources/shaders/glsl100/gbuffer.vs@resources/shaders/glsl100/gbuffer.vs \ + --preload-file shaders/resources/shaders/glsl100/gbuffer.fs@resources/shaders/glsl100/gbuffer.fs \ + --preload-file shaders/resources/shaders/glsl100/deferred_shading.vs@resources/shaders/glsl100/deferred_shading.vs \ + --preload-file shaders/resources/shaders/glsl100/deferred_shading.fs@resources/shaders/glsl100/deferred_shading.fs shaders/shaders_eratosthenes: shaders/shaders_eratosthenes.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ diff --git a/examples/README.md b/examples/README.md index d25ad10cc..c42a701a2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -23,187 +23,210 @@ You may find it easier to use than other toolchains, especially when it comes to Examples using raylib core platform functionality like window creation, inputs, drawing modes and system functionality. | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| | 01 | [core_basic_window](core/core_basic_window.c) | core_basic_window | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | | 02 | [core_input_keys](core/core_input_keys.c) | core_input_keys | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | -| 03 | [core_input_mouse](core/core_input_mouse.c) | core_input_mouse | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) | +| 03 | [core_input_mouse](core/core_input_mouse.c) | core_input_mouse | ⭐️☆☆☆ | 1.0 | 5.5 | [Ray](https://github.com/raysan5) | | 04 | [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | core_input_mouse_wheel | ⭐️☆☆☆ | 1.1 | 1.3 | [Ray](https://github.com/raysan5) | -| 05 | [core_input_gamepad](core/core_input_gamepad.c) | core_input_gamepad | ⭐️☆☆☆ | 1.1 | **4.2** | [Ray](https://github.com/raysan5) | +| 05 | [core_input_gamepad](core/core_input_gamepad.c) | core_input_gamepad | ⭐️☆☆☆ | 1.1 | 4.2 | [Ray](https://github.com/raysan5) | | 06 | [core_input_multitouch](core/core_input_multitouch.c) | core_input_multitouch | ⭐️☆☆☆ | 2.1 | 2.5 | [Berni](https://github.com/Berni8k) | -| 07 | [core_input_gestures](core/core_input_gestures.c) | core_input_gestures | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) | -| 08 | [core_input_virtual_controls](core/core_input_virtual_controls.c) | core_input_virtual_controls | ⭐️⭐️☆☆ | **5.0** | **5.0** | [oblerion](https://github.com/oblerion) | +| 07 | [core_input_gestures](core/core_input_gestures.c) | core_input_gestures | ⭐️⭐️☆☆ | 1.4 | 4.2 | [Ray](https://github.com/raysan5) | +| 08 | [core_input_virtual_controls](core/core_input_virtual_controls.c) | core_input_virtual_controls | ⭐️⭐️☆☆ | 5.0 | 5.0 | [oblerion](https://github.com/oblerion) | | 09 | [core_2d_camera](core/core_2d_camera.c) | core_2d_camera | ⭐️⭐️☆☆ | 1.5 | 3.0 | [Ray](https://github.com/raysan5) | -| 10 | [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | core_2d_camera_mouse_zoom | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) | -| 11 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | core_2d_camera_platformer | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [avyy](https://github.com/avyy) | -| 12 | [core_2d_camera_split_screen](core/core_2d_camera_split_screen.c) | core_2d_camera_split_screen | ⭐️⭐️⭐️⭐️ | **4.5** | **4.5** | [Gabriel dos Santos Sanches](https://github.com/gabrielssanches) | +| 10 | [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | core_2d_camera_mouse_zoom | ⭐️⭐️☆☆ | 4.2 | 4.2 | [Jeffery Myers](https://github.com/JeffM2501) | +| 11 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | core_2d_camera_platformer | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [arvyy](https://github.com/arvyy) | +| 12 | [core_2d_camera_split_screen](core/core_2d_camera_split_screen.c) | core_2d_camera_split_screen | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [Gabriel dos Santos Sanches](https://github.com/gabrielssanches) | | 13 | [core_3d_camera_mode](core/core_3d_camera_mode.c) | core_3d_camera_mode | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | | 14 | [core_3d_camera_free](core/core_3d_camera_free.c) | core_3d_camera_free | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | | 15 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | core_3d_camera_first_person | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 16 | [core_3d_camera:split_screen](core/core_3d_camera_split_screen.c) | core_3d_camera_split_screen | ⭐️⭐️⭐️⭐️ | 3.7 | **4.0** | [Jeffery Myers](https://github.com/JeffM2501) | -| 17 | [core_3d_picking](core/core_3d_picking.c) | core_3d_picking | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | +| 16 | [core_3d_camera_split_screen](core/core_3d_camera_split_screen.c) | core_3d_camera_split_screen | ⭐️⭐️⭐️☆ | 3.7 | 4.0 | [Jeffery Myers](https://github.com/JeffM2501) | +| 17 | [core_3d_picking](core/core_3d_picking.c) | core_3d_picking | ⭐️⭐️☆☆ | 1.3 | 4.0 | [Ray](https://github.com/raysan5) | | 18 | [core_world_screen](core/core_world_screen.c) | core_world_screen | ⭐️⭐️☆☆ | 1.3 | 1.4 | [Ray](https://github.com/raysan5) | | 19 | [core_custom_logging](core/core_custom_logging.c) | core_custom_logging | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) | | 20 | [core_window_flags](core/core_window_flags.c) | core_window_flags | ⭐️⭐️⭐️☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 21 | [core_window_letterbox](core/core_window_letterbox.c) | core_window_letterbox | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Anata](https://github.com/anatagawa) | -| 22 | [core_window_should_close](core/core_window_should_close.c) | core_window_should_close | ⭐️☆☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | -| 23 | [core_drop_files](core/core_drop_files.c) | core_drop_files | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | +| 21 | [core_window_letterbox](core/core_window_letterbox.c) | core_window_letterbox | ⭐️⭐️☆☆ | 2.5 | 4.0 | [Anata](https://github.com/anatagawa) | +| 22 | [core_window_should_close](core/core_window_should_close.c) | core_window_should_close | ⭐️☆☆☆ | 4.2 | 4.2 | [Ray](https://github.com/raysan5) | +| 23 | [core_drop_files](core/core_drop_files.c) | core_drop_files | ⭐️⭐️☆☆ | 1.3 | 4.2 | [Ray](https://github.com/raysan5) | | 24 | [core_random_values](core/core_random_values.c) | core_random_values | ⭐️☆☆☆ | 1.1 | 1.1 | [Ray](https://github.com/raysan5) | -| 25 | [core_storage_values](core/core_storage_values.c) | core_storage_values | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) | -| 26 | [core_vr_simulator](core/core_vr_simulator.c) | core_vr_simulator | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | +| 25 | [core_storage_values](core/core_storage_values.c) | core_storage_values | ⭐️⭐️☆☆ | 1.4 | 4.2 | [Ray](https://github.com/raysan5) | +| 26 | [core_vr_simulator](core/core_vr_simulator.c) | core_vr_simulator | ⭐️⭐️⭐️☆ | 2.5 | 4.0 | [Ray](https://github.com/raysan5) | | 27 | [core_loading_thread](core/core_loading_thread.c) | core_loading_thread | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [Ray](https://github.com/raysan5) | | 28 | [core_scissor_test](core/core_scissor_test.c) | core_scissor_test | ⭐️☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) | -| 29 | [core_basic_screen_manager](core/core_basic_screen_manager.c) | core_basic_screen_manager | ⭐️☆☆☆ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) | -| 30 | [core_custom_frame_control](core/core_custom_frame_control.c) | core_custom_frame_control | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) | -| 31 | [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | core_smooth_pixelperfect | ⭐️⭐️⭐️☆ | 3.7 | **4.0** | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) | -| 32 | [core_window_should_close](core/core_window_should_close.c) | core_window_should_close | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | -| 33 | [core_random_sequence](core/core_random_sequence.c) | core_random_sequence | ⭐️☆☆☆ | **5.0** | **5.0** | [REDl3east](https://github.com/REDl3east) | +| 29 | [core_basic_screen_manager](core/core_basic_screen_manager.c) | core_basic_screen_manager | ⭐️☆☆☆ | 4.0 | 4.0 | [Ray](https://github.com/raysan5) | +| 30 | [core_custom_frame_control](core/core_custom_frame_control.c) | core_custom_frame_control | ⭐️⭐️⭐️⭐️ | 4.0 | 4.0 | [Ray](https://github.com/raysan5) | +| 31 | [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | core_smooth_pixelperfect | ⭐️⭐️⭐️☆ | 3.7 | 4.0 | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) | +| 32 | [core_random_sequence](core/core_random_sequence.c) | core_random_sequence | ⭐️☆☆☆ | 5.0 | 5.0 | [Dalton Overmyer](https://github.com/REDl3east) | +| 33 | [core_basic_window_web](core/core_basic_window_web.c) | core_basic_window_web | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 34 | [core_input_gestures_web](core/core_input_gestures_web.c) | core_input_gestures_web | ⭐️⭐️☆☆ | 4.6-dev | 4.6-dev | [ubkp](https://github.com/ubkp) | +| 35 | [core_automation_events](core/core_automation_events.c) | core_automation_events | ⭐️⭐️⭐️☆ | 5.0 | 5.0 | [Ray](https://github.com/raysan5) | ### category: shapes Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/shapes.c) module. | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 34 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | shapes_basic_shapes | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) | -| 35 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | shapes_bouncing_ball | ⭐️☆☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 36 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | shapes_colors_palette | ⭐️⭐️☆☆ | 1.0 | 2.5 | [Ray](https://github.com/raysan5) | -| 37 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | shapes_logo_raylib | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | -| 38 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | shapes_logo_raylib_anim | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | -| 39 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | shapes_rectangle_scaling | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | -| 40 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | shapes_lines_bezier | ⭐️☆☆☆ | 1.7 | 1.7 | [Ray](https://github.com/raysan5) | -| 41 | [shapes_collision_area](shapes/shapes_collision_area.c) | shapes_collision_area | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 42 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | shapes_following_eyes | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 43 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | shapes_easings_ball_anim | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 44 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | shapes_easings_box_anim | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 45 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | shapes_easings_rectangle_array | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 46 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | shapes_draw_ring | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | -| 47 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | shapes_draw_circle_sector | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | -| 48 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | shapes_draw_rectangle_rounded | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | -| 49 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | shapes_top_down_lights | ⭐️⭐️⭐️⭐️ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) | -| 50 | [shapes_rectangle_advanced](shapes/shapes_rectangle_advanced.c) | shapes_rectangle_advanced | ⭐️⭐️⭐️⭐️⭐️| **5.0** | **5.0** | [ExCyber](https://github.com/evertonse) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 36 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | shapes_basic_shapes | ⭐️☆☆☆ | 1.0 | 4.2 | [Ray](https://github.com/raysan5) | +| 37 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | shapes_bouncing_ball | ⭐️☆☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 38 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | shapes_colors_palette | ⭐️⭐️☆☆ | 1.0 | 2.5 | [Ray](https://github.com/raysan5) | +| 39 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | shapes_logo_raylib | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | +| 40 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | shapes_logo_raylib_anim | ⭐️⭐️☆☆ | 2.5 | 4.0 | [Ray](https://github.com/raysan5) | +| 41 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | shapes_rectangle_scaling | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | +| 42 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | shapes_lines_bezier | ⭐️☆☆☆ | 1.7 | 1.7 | [Ray](https://github.com/raysan5) | +| 43 | [shapes_collision_area](shapes/shapes_collision_area.c) | shapes_collision_area | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 44 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | shapes_following_eyes | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 45 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | shapes_easings_ball_anim | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 46 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | shapes_easings_box_anim | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 47 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | shapes_easings_rectangle_array | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) | +| 48 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | shapes_draw_ring | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | +| 49 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | shapes_draw_circle_sector | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | +| 50 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | shapes_draw_rectangle_rounded | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | +| 51 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | shapes_top_down_lights | ⭐️⭐️⭐️⭐️ | 4.2 | 4.2 | [Jeffery Myers](https://github.com/JeffM2501) | +| 52 | [shapes_rectangle_advanced](shapes/shapes_rectangle_advanced.c) | shapes_rectangle_advanced | ⭐️⭐️⭐️⭐️ | 5.5 | 5.5 | [Everton Jr.](https://github.com/evertonse) | +| 53 | [shapes_splines_drawing](shapes/shapes_splines_drawing.c) | shapes_splines_drawing | ⭐️⭐️⭐️☆ | 5.0 | 5.0 | [Ray](https://github.com/raysan5) | ### category: textures -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/textures.c) modul | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 51 | [textures_logo_raylib](textures/textures_logo_raylib.c) | textures_logo_raylib | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | -| 52 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | textures_srcrec_dstrec | ⭐️⭐️⭐️☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 53 | [textures_image_drawing](textures/textures_image_drawing.c) | textures_image_drawing | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | -| 54 | [textures_image_generation](textures/textures_image_generation.c) | textures_image_generation | ⭐️⭐️☆☆ | 1.8 | 1.8 | [Ray](https://github.com/raysan5) | -| 55 | [textures_image_loading](textures/textures_image_loading.c) | textures_image_loading | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 56 | [textures_image_processing](textures/textures_image_processing.c) | textures_image_processing | ⭐️⭐️⭐️☆ | 1.4 | 3.5 | [Ray](https://github.com/raysan5) | -| 57 | [textures_image_text](textures/textures_image_text.c) | textures_image_text | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | -| 58 | [textures_to_image](textures/textures_to_image.c) | textures_to_image | ⭐️☆☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 59 | [textures_raw_data](textures/textures_raw_data.c) | textures_raw_data | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | -| 60 | [textures_particles_blending](textures/textures_particles_blending.c) | textures_particles_blending | ⭐️☆☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | -| 61 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | textures_npatch_drawing | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) | -| 62 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | ⭐️☆☆☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) | -| 63 | [textures_sprite_anim](textures/textures_sprite_anim.c) | textures_sprite_anim | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 64 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 65 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 66 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | ⭐️⭐️⭐️☆ | 1.6 | 2.5 | [Ray](https://github.com/raysan5) | -| 67 | [textures_mouse_painting](textures/textures_mouse_painting.c) | textures_mouse_painting | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) | -| 68 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | ⭐️☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) | -| 69 | [textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | ⭐️⭐️⭐️☆ | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) | -| 70 | [textures_polygon](textures/textures_polygon.c) | textures_polygon | ⭐️☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 71 | [textures_fog_of_war](textures/textures_fog_of_war.c) | textures_fog_of_war | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | -| 72 | [textures_gif_player](textures/textures_gif_player.c) | textures_gif_player | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 54 | [textures_logo_raylib](textures/textures_logo_raylib.c) | textures_logo_raylib | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | +| 55 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | textures_srcrec_dstrec | ⭐️⭐️⭐️☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 56 | [textures_image_drawing](textures/textures_image_drawing.c) | textures_image_drawing | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | +| 57 | [textures_image_generation](textures/textures_image_generation.c) | textures_image_generation | ⭐️⭐️☆☆ | 1.8 | 1.8 | [Wilhem Barbier](https://github.com/nounoursheureux) | +| 58 | [textures_image_loading](textures/textures_image_loading.c) | textures_image_loading | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 59 | [textures_image_processing](textures/textures_image_processing.c) | textures_image_processing | ⭐️⭐️⭐️☆ | 1.4 | 3.5 | [Ray](https://github.com/raysan5) | +| 60 | [textures_image_text](textures/textures_image_text.c) | textures_image_text | ⭐️⭐️☆☆ | 1.8 | 4.0 | [Ray](https://github.com/raysan5) | +| 61 | [textures_to_image](textures/textures_to_image.c) | textures_to_image | ⭐️☆☆☆ | 1.3 | 4.0 | [Ray](https://github.com/raysan5) | +| 62 | [textures_raw_data](textures/textures_raw_data.c) | textures_raw_data | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | +| 63 | [textures_particles_blending](textures/textures_particles_blending.c) | textures_particles_blending | ⭐️☆☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | +| 64 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | textures_npatch_drawing | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) | +| 65 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | ⭐️☆☆☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) | +| 66 | [textures_sprite_anim](textures/textures_sprite_anim.c) | textures_sprite_anim | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 67 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 68 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 69 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | ⭐️⭐️⭐️☆ | 1.6 | 2.5 | [Ray](https://github.com/raysan5) | +| 70 | [textures_mouse_painting](textures/textures_mouse_painting.c) | textures_mouse_painting | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) | +| 71 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | ⭐️☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) | +| 72 | [textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | ⭐️⭐️⭐️☆ | 3.0 | 4.2 | [Vlad Adrian](https://github.com/demizdor) | +| 73 | [textures_polygon](textures/textures_polygon.c) | textures_polygon | ⭐️☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) | +| 74 | [textures_fog_of_war](textures/textures_fog_of_war.c) | textures_fog_of_war | ⭐️⭐️⭐️☆ | 4.2 | 4.2 | [Ray](https://github.com/raysan5) | +| 75 | [textures_gif_player](textures/textures_gif_player.c) | textures_gif_player | ⭐️⭐️⭐️☆ | 4.2 | 4.2 | [Ray](https://github.com/raysan5) | +| 76 | [textures_image_kernel](textures/textures_image_kernel.c) | textures_image_kernel | ⭐️⭐️⭐️⭐️ | 1.3 | 1.3 | [Karim Salem](https://github.com/kimo-s) | +| 77 | [textures_image_channel](textures/textures_image_channel.c) | textures_image_channel | ⭐️⭐️☆☆ | 5.1-dev | 5.1-dev | [Bruno Cabral](https://github.com/brccabral) | +| 78 | [textures_image_rotate](textures/textures_image_rotate.c) | textures_image_rotate | ⭐️⭐️☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | +| 79 | [textures_textured_curve](textures/textures_textured_curve.c) | textures_textured_curve | ⭐️⭐️⭐️☆ | 4.5 | 4.5 | [Jeffery Myers](https://github.com/JeffM2501) | ### category: text Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/text.c) module. | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 73 | [text_raylib_fonts](text/text_raylib_fonts.c) | text_raylib_fonts | ⭐️☆☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | -| 74 | [text_font_spritefont](text/text_font_spritefont.c) | text_font_spritefont | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | -| 75 | [text_font_filters](text/text_font_filters.c) | text_font_filters | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | -| 76 | [text_font_loading](text/text_font_loading.c) | text_font_loading | ⭐️☆☆☆ | 1.4 | 3.0 | [Ray](https://github.com/raysan5) | -| 77 | [text_font_sdf](text/text_font_sdf.c) | text_font_sdf | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 78 | [text_format_text](text/text_format_text.c) | text_format_text | ⭐️☆☆☆ | 1.1 | 3.0 | [Ray](https://github.com/raysan5) | -| 79 | [text_input_box](text/text_input_box.c) | text_input_box | ⭐️⭐️☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | -| 80 | [text_writing_anim](text/text_writing_anim.c) | text_writing_anim | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | -| 81 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | text_rectangle_bounds | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | -| 82 | [text_unicode](text/text_unicode.c) | text_unicode | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | -| 83 | [text_draw_3d](text/text_draw_3d.c) | text_draw_3d | ⭐️⭐️⭐️⭐️ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | -| 84 | [text_codepoints_loading](text/text_codepoints_loading.c) | text_codepoints_loading | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 80 | [text_raylib_fonts](text/text_raylib_fonts.c) | text_raylib_fonts | ⭐️☆☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | +| 81 | [text_font_spritefont](text/text_font_spritefont.c) | text_font_spritefont | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | +| 82 | [text_font_filters](text/text_font_filters.c) | text_font_filters | ⭐️⭐️☆☆ | 1.3 | 4.2 | [Ray](https://github.com/raysan5) | +| 83 | [text_font_loading](text/text_font_loading.c) | text_font_loading | ⭐️☆☆☆ | 1.4 | 3.0 | [Ray](https://github.com/raysan5) | +| 84 | [text_font_sdf](text/text_font_sdf.c) | text_font_sdf | ⭐️⭐️⭐️☆ | 1.3 | 4.0 | [Ray](https://github.com/raysan5) | +| 85 | [text_format_text](text/text_format_text.c) | text_format_text | ⭐️☆☆☆ | 1.1 | 3.0 | [Ray](https://github.com/raysan5) | +| 86 | [text_input_box](text/text_input_box.c) | text_input_box | ⭐️⭐️☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | +| 87 | [text_writing_anim](text/text_writing_anim.c) | text_writing_anim | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | +| 88 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | text_rectangle_bounds | ⭐️⭐️⭐️⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) | +| 89 | [text_unicode](text/text_unicode.c) | text_unicode | ⭐️⭐️⭐️⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) | +| 90 | [text_draw_3d](text/text_draw_3d.c) | text_draw_3d | ⭐️⭐️⭐️⭐️ | 3.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) | +| 91 | [text_codepoints_loading](text/text_codepoints_loading.c) | text_codepoints_loading | ⭐️⭐️⭐️☆ | 4.2 | 4.2 | [Ray](https://github.com/raysan5) | ### category: models Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/models.c) module. | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 85 | [models_animation](models/models_animation.c) | models_animation | ⭐️⭐️☆☆ | 2.5 | 3.5 | [culacant](https://github.com/culacant) | -| 86 | [models_billboard](models/models_billboard.c) | models_billboard | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | -| 87 | [models_box_collisions](models/models_box_collisions.c) | models_box_collisions | ⭐️☆☆☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | -| 88 | [models_cubicmap](models/models_cubicmap.c) | models_cubicmap | ⭐️⭐️☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | -| 89 | [models_first_person_maze](models/models_first_person_maze.c) | models_first_person_maze | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 90 | [models_geometric_shapes](models/models_geometric_shapes.c) | models_geometric_shapes | ⭐️☆☆☆ | 1.0 | 3.5 | [Ray](https://github.com/raysan5) | -| 91 | [models_mesh_generation](models/models_mesh_generation.c) | models_mesh_generation | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | -| 92 | [models_mesh_picking](models/models_mesh_picking.c) | models_mesh_picking | ⭐️⭐️⭐️☆ | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) | -| 93 | [models_loading](models/models_loading.c) | models_loading | ⭐️☆☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | -| 94 | [models_loading_gltf](models/models_loading_gltf.c) | models_loading_gltf | ⭐️☆☆☆ | 3.7 | **4.2** | [Ray](https://github.com/raysan5) | -| 95 | [models_loading_vox](models/models_loading_vox.c) | models_loading_vox | ⭐️☆☆☆ | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) | -| 96 | [models_loading_m3d](models/models_loading_m3d.c) | models_loading_m3d | ⭐️☆☆☆ | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) | -| 97 | [models_orthographic_projection](models/models_orthographic_projection.c) | models_orthographic_projection | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) | -| 98 | [models_point_rendering](models/models_point_rendering.c) | models_point_rendering | ⭐️⭐️☆☆ | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) | -| 99 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | models_rlgl_solar_system | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | -| 100 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | models_yaw_pitch_roll | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) | -| 101 | [models_waving_cubes](models/models_waving_cubes.c) | models_waving_cubes | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) | -| 102 | [models_heightmap](models/models_heightmap.c) | models_heightmap | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | -| 103 | [models_skybox](models/models_skybox.c) | models_skybox | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 92 | [models_animation](models/models_animation.c) | models_animation | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Culacant](https://github.com/culacant) | +| 93 | [models_billboard](models/models_billboard.c) | models_billboard | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | +| 94 | [models_box_collisions](models/models_box_collisions.c) | models_box_collisions | ⭐️☆☆☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | +| 95 | [models_cubicmap](models/models_cubicmap.c) | models_cubicmap | ⭐️⭐️☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | +| 96 | [models_first_person_maze](models/models_first_person_maze.c) | models_first_person_maze | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 97 | [models_geometric_shapes](models/models_geometric_shapes.c) | models_geometric_shapes | ⭐️☆☆☆ | 1.0 | 3.5 | [Ray](https://github.com/raysan5) | +| 98 | [models_mesh_generation](models/models_mesh_generation.c) | models_mesh_generation | ⭐️⭐️☆☆ | 1.8 | 4.0 | [Ray](https://github.com/raysan5) | +| 99 | [models_mesh_picking](models/models_mesh_picking.c) | models_mesh_picking | ⭐️⭐️⭐️☆ | 1.7 | 4.0 | [Joel Davis](https://github.com/joeld42) | +| 100 | [models_loading](models/models_loading.c) | models_loading | ⭐️☆☆☆ | 2.0 | 4.2 | [Ray](https://github.com/raysan5) | +| 101 | [models_loading_gltf](models/models_loading_gltf.c) | models_loading_gltf | ⭐️☆☆☆ | 3.7 | 4.2 | [Ray](https://github.com/raysan5) | +| 102 | [models_loading_vox](models/models_loading_vox.c) | models_loading_vox | ⭐️☆☆☆ | 4.0 | 4.0 | [Johann Nadalutti](https://github.com/procfxgen) | +| 103 | [models_loading_m3d](models/models_loading_m3d.c) | models_loading_m3d | ⭐️⭐️☆☆ | 4.5 | 4.5 | [bzt](https://bztsrc.gitlab.io/model3d) | +| 104 | [models_orthographic_projection](models/models_orthographic_projection.c) | models_orthographic_projection | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) | +| 105 | [models_point_rendering](models/models_point_rendering.c) | models_point_rendering | ⭐️⭐️⭐️☆ | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) | +| 106 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | models_rlgl_solar_system | ⭐️⭐️⭐️⭐️ | 2.5 | 4.0 | [Ray](https://github.com/raysan5) | +| 107 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | models_yaw_pitch_roll | ⭐️⭐️☆☆ | 1.8 | 4.0 | [Berni](https://github.com/Berni8k) | +| 108 | [models_waving_cubes](models/models_waving_cubes.c) | models_waving_cubes | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Codecat](https://github.com/codecat) | +| 109 | [models_heightmap](models/models_heightmap.c) | models_heightmap | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | +| 110 | [models_skybox](models/models_skybox.c) | models_skybox | ⭐️⭐️☆☆ | 1.8 | 4.0 | [Ray](https://github.com/raysan5) | +| 111 | [models_draw_cube_texture](models/models_draw_cube_texture.c) | models_draw_cube_texture | ⭐️⭐️☆☆ | 4.5 | 4.5 | [Ray](https://github.com/raysan5) | +| 112 | [models_gpu_skinning](models/models_gpu_skinning.c) | models_gpu_skinning | ⭐️⭐️⭐️☆ | 4.5 | 4.5 | [Daniel Holden](https://github.com/orangeduck) | +| 113 | [models_bone_socket](models/models_bone_socket.c) | models_bone_socket | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [iP](https://github.com/ipzaur) | +| 114 | [models_tesseract_view](models/models_tesseract_view.c) | models_tesseract_view | ⭐️⭐️☆☆ | 5.6-dev | 5.6-dev | [Timothy van der Valk](https://github.com/arceryz) | ### category: shaders 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
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 104 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | shaders_basic_lighting | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) | -| 105 | [shaders_model_shader](shaders/shaders_model_shader.c) | shaders_model_shader | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) | -| 106 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | shaders_shapes_textures | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | -| 107 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | shaders_custom_uniform | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 108 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | shaders_postprocessing | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 109 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | shaders_palette_switch | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) | -| 110 | [shaders_raymarching](shaders/shaders_raymarching.c) | shaders_raymarching | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) | -| 111 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | shaders_texture_drawing | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) | -| 112 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | shaders_texture_outline | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) | -| 113 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | shaders_texture_waves | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) | -| 114 | [shaders_julia_set](shaders/shaders_julia_set.c) | shaders_julia_set | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) | -| 115 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | shaders_eratosthenes | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) | -| 116 | [shaders_fog](shaders/shaders_fog.c) | shaders_fog | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 117 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | shaders_simple_mask | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 118 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | shaders_hot_reloading | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) | -| 119 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | shaders_mesh_instancing | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) | -| 120 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | shaders_multi_sample2d | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 121 | [shaders_spotlight](shaders/shaders_spotlight.c) | shaders_spotlight | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 122 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | shaders_deferred_render | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 115 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | shaders_basic_lighting | ⭐️⭐️⭐️⭐️ | 3.0 | 4.2 | [Chris Camacho](https://github.com/chriscamacho) | +| 116 | [shaders_model_shader](shaders/shaders_model_shader.c) | shaders_model_shader | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) | +| 117 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | shaders_shapes_textures | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | +| 118 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | shaders_custom_uniform | ⭐️⭐️☆☆ | 1.3 | 4.0 | [Ray](https://github.com/raysan5) | +| 119 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | shaders_postprocessing | ⭐️⭐️⭐️☆ | 1.3 | 4.0 | [Ray](https://github.com/raysan5) | +| 120 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | shaders_palette_switch | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) | +| 121 | [shaders_raymarching](shaders/shaders_raymarching.c) | shaders_raymarching | ⭐️⭐️⭐️⭐️ | 2.0 | 4.2 | [Ray](https://github.com/raysan5) | +| 122 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | shaders_texture_drawing | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/ciessielski) | +| 123 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | shaders_texture_outline | ⭐️⭐️⭐️☆ | 4.0 | 4.0 | [Samuel Skiff](https://github.com/GoldenThumbs) | +| 124 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | shaders_texture_waves | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) | +| 125 | [shaders_julia_set](shaders/shaders_julia_set.c) | shaders_julia_set | ⭐️⭐️⭐️☆ | 2.5 | 4.0 | [Josh Colclough](https://github.com/joshcol9232) | +| 126 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | shaders_eratosthenes | ⭐️⭐️⭐️☆ | 2.5 | 4.0 | [ProfJski](https://github.com/ProfJski) | +| 127 | [shaders_fog](shaders/shaders_fog.c) | shaders_fog | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) | +| 128 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | shaders_simple_mask | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) | +| 129 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | shaders_hot_reloading | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) | +| 130 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | shaders_mesh_instancing | ⭐️⭐️⭐️⭐️ | 3.7 | 4.2 | [seanpringle](https://github.com/seanpringle) | +| 131 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | shaders_multi_sample2d | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 132 | [shaders_spotlight](shaders/shaders_spotlight.c) | shaders_spotlight | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) | +| 133 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | shaders_deferred_render | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) | +| 134 | [shaders_hybrid_render](shaders/shaders_hybrid_render.c) | shaders_hybrid_render | ⭐️⭐️⭐️⭐️ | 4.2 | 4.2 | [Buğra Alptekin Sarı](https://github.com/BugraAlptekinSari) | +| 135 | [shaders_texture_tiling](shaders/shaders_texture_tiling.c) | shaders_texture_tiling | ⭐️⭐️☆☆ | 4.5 | 4.5 | [Luis Almeida](https://github.com/luis605) | +| 136 | [shaders_shadowmap](shaders/shaders_shadowmap.c) | shaders_shadowmap | ⭐️⭐️⭐️⭐️ | 5.0 | 5.0 | [TheManTheMythTheGameDev](https://github.com/TheManTheMythTheGameDev) | +| 137 | [shaders_vertex_displacement](shaders/shaders_vertex_displacement.c) | shaders_vertex_displacement | ⭐️⭐️⭐️☆ | 5.0 | 4.5 | [Alex ZH](https://github.com/ZzzhHe) | +| 138 | [shaders_write_depth](shaders/shaders_write_depth.c) | shaders_write_depth | ⭐️⭐️☆☆ | 4.2 | 4.2 | [Buğra Alptekin Sarı](https://github.com/BugraAlptekinSari) | +| 139 | [shaders_basic_pbr](shaders/shaders_basic_pbr.c) | shaders_basic_pbr | ⭐️⭐️⭐️⭐️ | 5.0 | 5.1-dev | [Afan OLOVCIC](https://github.com/_DevDad) | +| 140 | [shaders_lightmap](shaders/shaders_lightmap.c) | shaders_lightmap | ⭐️⭐️⭐️☆ | 4.5 | 4.5 | [Jussi Viitala](https://github.com/nullstare) | +| 141 | [shaders_rounded_rectangle](shaders/shaders_rounded_rectangle.c) | shaders_rounded_rectangle | ⭐️⭐️⭐️☆ | 5.5 | 5.5 | [Anstro Pleuton](https://github.com/anstropleuton) | ### category: audio 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. | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 123 | [audio_module_playing](audio/audio_module_playing.c) | audio_module_playing | ⭐️☆☆☆ | 1.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 124 | [audio_music_stream](audio/audio_music_stream.c) | audio_music_stream | ⭐️☆☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | -| 125 | [audio_raw_stream](audio/audio_raw_stream.c) | audio_raw_stream | ⭐️⭐️⭐️☆ | 1.6 | **4.2** | [Ray](https://github.com/raysan5) | -| 126 | [audio_sound_loading](audio/audio_sound_loading.c) | audio_sound_loading | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 142 | [audio_module_playing](audio/audio_module_playing.c) | audio_module_playing | ⭐️☆☆☆ | 1.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 143 | [audio_music_stream](audio/audio_music_stream.c) | audio_music_stream | ⭐️☆☆☆ | 1.3 | 4.2 | [Ray](https://github.com/raysan5) | +| 144 | [audio_raw_stream](audio/audio_raw_stream.c) | audio_raw_stream | ⭐️⭐️⭐️☆ | 1.6 | 4.2 | [Ray](https://github.com/raysan5) | +| 145 | [audio_sound_loading](audio/audio_sound_loading.c) | audio_sound_loading | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) | +| 146 | [audio_mixed_processor](audio/audio_mixed_processor.c) | audio_mixed_processor | ⭐️⭐️⭐️⭐️ | 4.2 | 4.2 | [hkc](https://github.com/hatkidchan) | +| 147 | [audio_stream_effects](audio/audio_stream_effects.c) | audio_stream_effects | ⭐️⭐️⭐️⭐️ | 4.2 | 5.0 | [Ray](https://github.com/raysan5) | +| 148 | [audio_sound_multi](audio/audio_sound_multi.c) | audio_sound_multi | ⭐️⭐️☆☆ | 4.6 | 4.6 | [Jeffery Myers](https://github.com/JeffM2501) | ### category: others Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries. | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | -|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 127 | [rlgl_standalone](others/rlgl_standalone.c) | rlgl_standalone | ⭐️⭐️⭐️⭐️ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) | -| 128 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | rlgl_compute_shader | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) | -| 129 | [easings_testbed](others/easings_testbed.c) | easings_testbed | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) | -| 130 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | raylib_opengl_interop | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) | -| 131 | [embedded_files_loading](others/embedded_files_loading.c) | embedded_files_loading | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) | +|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------| +| 149 | [rlgl_standalone](others/rlgl_standalone.c) | rlgl_standalone | ⭐️⭐️⭐️⭐️ | 1.6 | 4.0 | [Ray](https://github.com/raysan5) | +| 150 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | rlgl_compute_shader | ⭐️⭐️⭐️⭐️ | 4.0 | 4.0 | [Teddy Astie](https://github.com/tsnake41) | +| 151 | [easings_testbed](others/easings_testbed.c) | easings_testbed | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) | +| 152 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | raylib_opengl_interop | ⭐️⭐️⭐️⭐️ | 3.8 | 4.0 | [Stephan Soller](https://github.com/arkanis) | +| 153 | [embedded_files_loading](others/embedded_files_loading.c) | embedded_files_loading | ⭐️⭐️☆☆ | 3.0 | 3.5 | [Kristian Holmgren](https://github.com/defutura) | +| 154 | [raymath_vector_angle](others/raymath_vector_angle.c) | raymath_vector_angle | ⭐️⭐️☆☆ | 1.0 | 4.6 | [Ray](https://github.com/raysan5) | As always contributions are welcome, feel free to send new examples! Here is an [examples template](examples_template.c) to start with! diff --git a/examples/audio/audio_mixed_processor.c b/examples/audio/audio_mixed_processor.c index df46edc4e..fc9785bc8 100644 --- a/examples/audio/audio_mixed_processor.c +++ b/examples/audio/audio_mixed_processor.c @@ -2,6 +2,8 @@ * * 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) @@ -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) 2023 hkc (@hatkidchan) +* Copyright (c) 2023-2025 hkc (@hatkidchan) * ********************************************************************************************/ #include "raylib.h" diff --git a/examples/audio/audio_module_playing.c b/examples/audio/audio_module_playing.c index 6234f0e55..0d6c48981 100644 --- a/examples/audio/audio_module_playing.c +++ b/examples/audio/audio_module_playing.c @@ -2,12 +2,14 @@ * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/audio/audio_music_stream.c b/examples/audio/audio_music_stream.c index bdf141edf..609b12333 100644 --- a/examples/audio/audio_music_stream.c +++ b/examples/audio/audio_music_stream.c @@ -2,12 +2,14 @@ * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c index 0b7954293..fb36830ce 100644 --- a/examples/audio/audio_raw_stream.c +++ b/examples/audio/audio_raw_stream.c @@ -2,6 +2,8 @@ * * 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 * * Example created by Ramon Santamaria (@raysan5) and reviewed by James Hofmann (@triplefox) @@ -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-2024 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox) * ********************************************************************************************/ diff --git a/examples/audio/audio_sound_loading.c b/examples/audio/audio_sound_loading.c index 41aa2160e..45028839b 100644 --- a/examples/audio/audio_sound_loading.c +++ b/examples/audio/audio_sound_loading.c @@ -2,12 +2,14 @@ * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/audio/audio_sound_multi.c b/examples/audio/audio_sound_multi.c index d5472efab..243ca7bd8 100644 --- a/examples/audio/audio_sound_multi.c +++ b/examples/audio/audio_sound_multi.c @@ -2,12 +2,16 @@ * * raylib [audio] example - Playing sound multiple times * -* Example originally created with raylib 4.6 +* Example complexity rating: [★★☆☆] 2/4 +* +* 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) 2023 Jeffery Myers (@JeffM2501) +* Copyright (c) 2023-2025 Jeffery Myers (@JeffM2501) * ********************************************************************************************/ diff --git a/examples/audio/audio_stream_effects.c b/examples/audio/audio_stream_effects.c index cc8273abc..4a34d3030 100644 --- a/examples/audio/audio_stream_effects.c +++ b/examples/audio/audio_stream_effects.c @@ -2,12 +2,14 @@ * * raylib [audio] example - Music stream processing effects * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2022-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_2d_camera.c b/examples/core/core_2d_camera.c index 99b61d4e5..44d3c6961 100644 --- a/examples/core/core_2d_camera.c +++ b/examples/core/core_2d_camera.c @@ -2,12 +2,14 @@ * * raylib [core] example - 2D Camera system * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_2d_camera_mouse_zoom.c b/examples/core/core_2d_camera_mouse_zoom.c index a9864b168..cfdaf15aa 100644 --- a/examples/core/core_2d_camera_mouse_zoom.c +++ b/examples/core/core_2d_camera_mouse_zoom.c @@ -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-2024 Jeffery Myers (@JeffM2501) +* Copyright (c) 2022-2025 Jeffery Myers (@JeffM2501) * ********************************************************************************************/ diff --git a/examples/core/core_2d_camera_platformer.c b/examples/core/core_2d_camera_platformer.c index 3743de80b..1ccb35167 100644 --- a/examples/core/core_2d_camera_platformer.c +++ b/examples/core/core_2d_camera_platformer.c @@ -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-2024 arvyy (@arvyy) +* Copyright (c) 2019-2025 arvyy (@arvyy) * ********************************************************************************************/ diff --git a/examples/core/core_2d_camera_split_screen.c b/examples/core/core_2d_camera_split_screen.c index 60b5a2e55..900db450e 100644 --- a/examples/core/core_2d_camera_split_screen.c +++ b/examples/core/core_2d_camera_split_screen.c @@ -2,6 +2,8 @@ * * 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 * @@ -12,7 +14,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) 2023 Gabriel dos Santos Sanches (@gabrielssanches) +* Copyright (c) 2023-2025 Gabriel dos Santos Sanches (@gabrielssanches) * ********************************************************************************************/ diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index 2b36c598b..c26fe827c 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -2,12 +2,14 @@ * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_3d_camera_free.c b/examples/core/core_3d_camera_free.c index 9899dbdb5..b490575db 100644 --- a/examples/core/core_3d_camera_free.c +++ b/examples/core/core_3d_camera_free.c @@ -2,12 +2,14 @@ * * raylib [core] example - Initialize 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_3d_camera_mode.c b/examples/core/core_3d_camera_mode.c index 0600fd330..372fd5923 100644 --- a/examples/core/core_3d_camera_mode.c +++ b/examples/core/core_3d_camera_mode.c @@ -2,12 +2,14 @@ * * raylib [core] example - Initialize 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_3d_camera_split_screen.c b/examples/core/core_3d_camera_split_screen.c index 313b64f65..f825a52f9 100644 --- a/examples/core/core_3d_camera_split_screen.c +++ b/examples/core/core_3d_camera_split_screen.c @@ -2,6 +2,8 @@ * * raylib [core] example - 3d cmaera split screen * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 3.7, last time updated with raylib 4.0 * * Example contributed by Jeffery Myers (@JeffM2501) 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) 2021-2024 Jeffery Myers (@JeffM2501) +* Copyright (c) 2021-2025 Jeffery Myers (@JeffM2501) * ********************************************************************************************/ diff --git a/examples/core/core_3d_picking.c b/examples/core/core_3d_picking.c index 634afba8c..8a6fbd156 100644 --- a/examples/core/core_3d_picking.c +++ b/examples/core/core_3d_picking.c @@ -2,12 +2,14 @@ * * raylib [core] example - Picking in 3d mode * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_automation_events.c b/examples/core/core_automation_events.c index 64ca51fda..fab363d58 100644 --- a/examples/core/core_automation_events.c +++ b/examples/core/core_automation_events.c @@ -2,6 +2,8 @@ * * 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) @@ -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) 2023 Ramon Santamaria (@raysan5) +* Copyright (c) 2023-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_basic_screen_manager.c b/examples/core/core_basic_screen_manager.c index df38a0623..67de31159 100644 --- a/examples/core/core_basic_screen_manager.c +++ b/examples/core/core_basic_screen_manager.c @@ -2,6 +2,8 @@ * * raylib [core] examples - basic screen manager * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: This example illustrates a very simple screen manager based on a states machines * * Example originally created with raylib 4.0, last time updated with raylib 4.0 @@ -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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_basic_window.c b/examples/core/core_basic_window.c index 3cf2c7c5d..b3f20367a 100644 --- a/examples/core/core_basic_window.c +++ b/examples/core/core_basic_window.c @@ -2,6 +2,8 @@ * * 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 @@ -20,7 +22,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) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_basic_window_web.c b/examples/core/core_basic_window_web.c index 8726908cb..e8607432b 100644 --- a/examples/core/core_basic_window_web.c +++ b/examples/core/core_basic_window_web.c @@ -2,6 +2,8 @@ * * raylib [core] example - Basic window (adapted for HTML5 platform) * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index 9793fc359..0d149ce9d 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -2,6 +2,8 @@ * * raylib [core] example - custom frame control * +* 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() @@ -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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_custom_logging.c b/examples/core/core_custom_logging.c index f886267ee..d27c9fd6b 100644 --- a/examples/core/core_custom_logging.c +++ b/examples/core/core_custom_logging.c @@ -2,6 +2,8 @@ * * raylib [core] example - Custom logging * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.5 * * Example contributed by Pablo Marcos Oltra (@pamarcos) 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) 2018-2024 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_drop_files.c b/examples/core/core_drop_files.c index 2e51d872b..4aafbb8c9 100644 --- a/examples/core/core_drop_files.c +++ b/examples/core/core_drop_files.c @@ -2,6 +2,8 @@ * * raylib [core] example - Windows drop files * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?) * * Example originally created with raylib 1.3, 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index f9310fdc3..6df29f8c8 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -2,6 +2,8 @@ * * 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: * - Xbox 360 Controller (Xbox 360, Xbox One) @@ -13,7 +15,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) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_input_gestures.c b/examples/core/core_input_gestures.c index 27ecef56e..b491da393 100644 --- a/examples/core/core_input_gestures.c +++ b/examples/core/core_input_gestures.c @@ -2,12 +2,14 @@ * * raylib [core] example - Input Gestures Detection * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_input_gestures_web.c b/examples/core/core_input_gestures_web.c index e1492244c..613aff0ab 100644 --- a/examples/core/core_input_gestures_web.c +++ b/examples/core/core_input_gestures_web.c @@ -2,6 +2,8 @@ * * raylib [core] example - Input Gestures for 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) @@ -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) 2023 ubkp (@ubkp) +* Copyright (c) 2023-2025 ubkp (@ubkp) * ********************************************************************************************/ diff --git a/examples/core/core_input_keys.c b/examples/core/core_input_keys.c index 8e74b93b0..670df1ef4 100644 --- a/examples/core/core_input_keys.c +++ b/examples/core/core_input_keys.c @@ -2,12 +2,14 @@ * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_input_mouse.c b/examples/core/core_input_mouse.c index e6a3e15dc..6091ded45 100644 --- a/examples/core/core_input_mouse.c +++ b/examples/core/core_input_mouse.c @@ -2,12 +2,14 @@ * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ @@ -27,6 +29,7 @@ int main(void) Vector2 ballPosition = { -100.0f, -100.0f }; Color ballColor = DARKBLUE; + int isCursorHidden = 0; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //--------------------------------------------------------------------------------------- @@ -36,6 +39,20 @@ int main(void) { // Update //---------------------------------------------------------------------------------- + if (IsKeyPressed(KEY_H)) + { + if (isCursorHidden == 0) + { + HideCursor(); + isCursorHidden = 1; + } + else + { + ShowCursor(); + isCursorHidden = 0; + } + } + ballPosition = GetMousePosition(); if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) ballColor = MAROON; @@ -56,6 +73,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 == 1) DrawText("CURSOR HIDDEN", 20, 60, 20, RED); + else DrawText("CURSOR VISIBLE", 20, 60, 20, LIME); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_input_mouse_wheel.c b/examples/core/core_input_mouse_wheel.c index d261e9348..242eeafa6 100644 --- a/examples/core/core_input_mouse_wheel.c +++ b/examples/core/core_input_mouse_wheel.c @@ -2,12 +2,14 @@ * * raylib [core] examples - Mouse wheel input * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_input_multitouch.c b/examples/core/core_input_multitouch.c index 093b6f386..55015235c 100644 --- a/examples/core/core_input_multitouch.c +++ b/examples/core/core_input_multitouch.c @@ -2,6 +2,8 @@ * * raylib [core] example - Input multitouch * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 2.1, last time updated with raylib 2.5 * * Example contributed by Berni (@Berni8k) 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-2024 Berni (@Berni8k) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Berni (@Berni8k) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_input_virtual_controls.c b/examples/core/core_input_virtual_controls.c index 799c927c0..80d9f0b3b 100644 --- a/examples/core/core_input_virtual_controls.c +++ b/examples/core/core_input_virtual_controls.c @@ -2,6 +2,8 @@ * * 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), @@ -12,7 +14,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) 2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2024-2025 oblerion (@oblerion) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_loading_thread.c b/examples/core/core_loading_thread.c index 8e09c99da..cd3d5a744 100644 --- a/examples/core/core_loading_thread.c +++ b/examples/core/core_loading_thread.c @@ -2,6 +2,8 @@ * * raylib [core] example - loading thread * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires linking with pthreads library on MinGW, * it can be accomplished passing -static parameter to compiler * @@ -9,7 +11,7 @@ * * Example licensed under an unmodified zlib/libpng license, which is an OSI-certified, * -* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_random_sequence.c b/examples/core/core_random_sequence.c index 2cb067db4..1aa0a068c 100644 --- a/examples/core/core_random_sequence.c +++ b/examples/core/core_random_sequence.c @@ -2,6 +2,8 @@ * * raylib [core] example - Generates a 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) @@ -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) 2023 Dalton Overmyer (@REDl3east) +* Copyright (c) 2023-2025 Dalton Overmyer (@REDl3east) * ********************************************************************************************/ diff --git a/examples/core/core_random_values.c b/examples/core/core_random_values.c index 46516ea1c..4abc87694 100644 --- a/examples/core/core_random_values.c +++ b/examples/core/core_random_values.c @@ -2,12 +2,14 @@ * * raylib [core] example - Generate random values * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.1, last time updated with raylib 1.1 * * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_scissor_test.c b/examples/core/core_scissor_test.c index 62ae080cb..49e90c794 100644 --- a/examples/core/core_scissor_test.c +++ b/examples/core/core_scissor_test.c @@ -2,6 +2,8 @@ * * raylib [core] example - Scissor test * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 2.5, last time updated with raylib 3.0 * * Example contributed by Chris Dill (@MysteriousSpace) 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-2024 Chris Dill (@MysteriousSpace) +* Copyright (c) 2019-2025 Chris Dill (@MysteriousSpace) * ********************************************************************************************/ diff --git a/examples/core/core_smooth_pixelperfect.c b/examples/core/core_smooth_pixelperfect.c index d76557651..964bacdb3 100644 --- a/examples/core/core_smooth_pixelperfect.c +++ b/examples/core/core_smooth_pixelperfect.c @@ -2,6 +2,8 @@ * * raylib [core] example - Smooth Pixel-perfect camera * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 3.7, last time updated with raylib 4.0 * * Example contributed by Giancamillo Alessandroni (@NotManyIdeasDev) and @@ -10,7 +12,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-2024 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_storage_values.c b/examples/core/core_storage_values.c index 70386da6c..747b94d5b 100644 --- a/examples/core/core_storage_values.c +++ b/examples/core/core_storage_values.c @@ -2,12 +2,14 @@ * * raylib [core] example - Storage save/load values * +* 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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_vr_simulator.c b/examples/core/core_vr_simulator.c index 021698edb..a793e62f4 100644 --- a/examples/core/core_vr_simulator.c +++ b/examples/core/core_vr_simulator.c @@ -2,12 +2,14 @@ * * raylib [core] example - VR Simulator (Oculus Rift CV1 parameters) * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 2.5, 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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_window_flags.c b/examples/core/core_window_flags.c index c9f858929..ec4f6aac6 100644 --- a/examples/core/core_window_flags.c +++ b/examples/core/core_window_flags.c @@ -2,12 +2,14 @@ * * raylib [core] example - window flags * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 3.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) 2020-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_window_letterbox.c b/examples/core/core_window_letterbox.c index ded782431..b3622c8b9 100644 --- a/examples/core/core_window_letterbox.c +++ b/examples/core/core_window_letterbox.c @@ -2,6 +2,8 @@ * * raylib [core] example - window scale letterbox (and virtual mouse) * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 4.0 * * Example contributed by Anata (@anatagawa) 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-2024 Anata (@anatagawa) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Anata (@anatagawa) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_window_should_close.c b/examples/core/core_window_should_close.c index e28ef7dbd..56561795d 100644 --- a/examples/core/core_window_should_close.c +++ b/examples/core/core_window_should_close.c @@ -2,12 +2,14 @@ * * raylib [core] example - Window should close * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 4.2, 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) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/core/core_world_screen.c b/examples/core/core_world_screen.c index 82fa31281..f302c3b27 100644 --- a/examples/core/core_world_screen.c +++ b/examples/core/core_world_screen.c @@ -2,12 +2,14 @@ * * raylib [core] example - World to screen * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.3, last time updated with raylib 1.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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/examples_template.c b/examples/examples_template.c index 5cf0b98d8..49136a4d4 100644 --- a/examples/examples_template.c +++ b/examples/examples_template.c @@ -56,16 +56,18 @@ /******************************************************************************************* * -* raylib [core] example - Basic window +* raylib [] example - * -* Example originally created with raylib 4.5, last time updated with raylib 4.5 +* Example complexity rating: [★☆??] ?/4 +* +* Example originally created with raylib 5.5, last time updated with raylib 5.5 * * Example contributed by (@) 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 (@) +* Copyright (c) - (@) * ********************************************************************************************/ @@ -81,7 +83,7 @@ int main(void) const int screenWidth = 800; const int screenHeight = 450; - InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); + InitWindow(screenWidth, screenHeight, "raylib [] example - "); // TODO: Load resources / Initialize variables at this point diff --git a/examples/models/models_animation.c b/examples/models/models_animation.c index 76998d1ec..b334e17ea 100644 --- a/examples/models/models_animation.c +++ b/examples/models/models_animation.c @@ -2,6 +2,8 @@ * * raylib [models] example - Load 3d model with animations and play them * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 3.5 * * Example contributed by Culacant (@culacant) 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-2024 Culacant (@culacant) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Culacant (@culacant) and Ramon Santamaria (@raysan5) * ******************************************************************************************** * diff --git a/examples/models/models_billboard.c b/examples/models/models_billboard.c index cfb49e55c..1d49ab89e 100644 --- a/examples/models/models_billboard.c +++ b/examples/models/models_billboard.c @@ -2,12 +2,14 @@ * * raylib [models] example - Drawing billboards * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 1.3, 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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_bone_socket.c b/examples/models/models_bone_socket.c index 66f952e89..ceea21b8c 100644 --- a/examples/models/models_bone_socket.c +++ b/examples/models/models_bone_socket.c @@ -1,6 +1,8 @@ /******************************************************************************************* * * raylib [core] example - Using bones as socket for calculating the positioning of something +* +* Example complexity rating: [★★★★] 4/4 * * Example originally created with raylib 4.5, last time updated with raylib 4.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) 2024 iP (@ipzaur) +* Copyright (c) 2024-2025 iP (@ipzaur) * ********************************************************************************************/ diff --git a/examples/models/models_box_collisions.c b/examples/models/models_box_collisions.c index 4d98a776a..00e7e541c 100644 --- a/examples/models/models_box_collisions.c +++ b/examples/models/models_box_collisions.c @@ -2,12 +2,14 @@ * * raylib [models] example - Detect basic 3d collisions (box vs sphere vs box) * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.3, 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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index 2c6267ede..980215b2e 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -2,12 +2,14 @@ * * raylib [models] example - Cubicmap loading and drawing * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.8, 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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_draw_cube_texture.c b/examples/models/models_draw_cube_texture.c index 87d83c8f3..172a50394 100644 --- a/examples/models/models_draw_cube_texture.c +++ b/examples/models/models_draw_cube_texture.c @@ -2,12 +2,14 @@ * * raylib [models] example - Draw textured cube * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 4.5, last time updated with raylib 4.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) 2022-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2022-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_first_person_maze.c b/examples/models/models_first_person_maze.c index b1af7d47b..43020974f 100644 --- a/examples/models/models_first_person_maze.c +++ b/examples/models/models_first_person_maze.c @@ -2,12 +2,14 @@ * * raylib [models] example - first person maze * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.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) 2019-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_geometric_shapes.c b/examples/models/models_geometric_shapes.c index 7f66a69fe..8cce4fcb0 100644 --- a/examples/models/models_geometric_shapes.c +++ b/examples/models/models_geometric_shapes.c @@ -2,12 +2,14 @@ * * raylib [models] example - Draw some basic geometric shapes (cube, sphere, cylinder...) * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.0, 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_gpu_skinning.c b/examples/models/models_gpu_skinning.c index 98bf09922..c268d25d1 100644 --- a/examples/models/models_gpu_skinning.c +++ b/examples/models/models_gpu_skinning.c @@ -1,6 +1,8 @@ /******************************************************************************************* * * raylib [core] example - Doing skinning on the gpu using a vertex shader +* +* Example complexity rating: [★★★☆] 3/4 * * Example originally created with raylib 4.5, last time updated with raylib 4.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) 2024 Daniel Holden (@orangeduck) +* Copyright (c) 2024-2025 Daniel Holden (@orangeduck) * * Note: Due to limitations in the Apple OpenGL driver, this feature does not work on MacOS * diff --git a/examples/models/models_heightmap.c b/examples/models/models_heightmap.c index d59e82814..e24c01c9a 100644 --- a/examples/models/models_heightmap.c +++ b/examples/models/models_heightmap.c @@ -2,12 +2,14 @@ * * raylib [models] example - Heightmap loading and drawing * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.8, 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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_loading.c b/examples/models/models_loading.c index d35db347c..2a674eeaa 100644 --- a/examples/models/models_loading.c +++ b/examples/models/models_loading.c @@ -2,6 +2,8 @@ * * raylib [models] example - Models loading * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: raylib supports multiple models file formats: * * - OBJ > Text file format. Must include vertex position-texcoords-normals information, @@ -20,7 +22,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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_loading_gltf.c b/examples/models/models_loading_gltf.c index 8b8838c8d..6309af84c 100644 --- a/examples/models/models_loading_gltf.c +++ b/examples/models/models_loading_gltf.c @@ -2,6 +2,8 @@ * * raylib [models] example - loading gltf with animations * +* Example complexity rating: [★☆☆☆] 1/4 +* * LIMITATIONS: * - Only supports 1 armature per file, and skips loading it if there are multiple armatures * - Only supports linear interpolation (default method in Blender when checked @@ -14,7 +16,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) 2020-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_loading_m3d.c b/examples/models/models_loading_m3d.c index 6091d95f8..38dfbd51e 100644 --- a/examples/models/models_loading_m3d.c +++ b/examples/models/models_loading_m3d.c @@ -2,6 +2,8 @@ * * raylib [models] example - Load models M3D * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 4.5, last time updated with raylib 4.5 * * Example contributed by bzt (@bztsrc) and reviewed by Ramon Santamaria (@raysan5) @@ -13,7 +15,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) 2022-2024 bzt (@bztsrc) +* Copyright (c) 2022-2025 bzt (@bztsrc) * ********************************************************************************************/ diff --git a/examples/models/models_loading_vox.c b/examples/models/models_loading_vox.c index 1a2721a63..75b975f94 100644 --- a/examples/models/models_loading_vox.c +++ b/examples/models/models_loading_vox.c @@ -2,6 +2,8 @@ * * raylib [models] example - Load models vox (MagicaVoxel) * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 4.0, last time updated with raylib 4.0 * * Example contributed by Johann Nadalutti (@procfxgen) 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) 2021-2024 Johann Nadalutti (@procfxgen) and Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Johann Nadalutti (@procfxgen) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_mesh_generation.c b/examples/models/models_mesh_generation.c index 03dc2b067..bc92873c2 100644 --- a/examples/models/models_mesh_generation.c +++ b/examples/models/models_mesh_generation.c @@ -1,13 +1,15 @@ /******************************************************************************************* * -* raylib example - procedural mesh generation +* raylib [models] example - procedural mesh generation +* +* Example complexity rating: [★★☆☆] 2/4 * * Example originally created with raylib 1.8, 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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_mesh_picking.c b/examples/models/models_mesh_picking.c index 15723e39d..f6fffd907 100644 --- a/examples/models/models_mesh_picking.c +++ b/examples/models/models_mesh_picking.c @@ -2,6 +2,8 @@ * * raylib [models] example - Mesh picking in 3d mode, ground plane, triangle, mesh * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 1.7, last time updated with raylib 4.0 * * Example contributed by Joel Davis (@joeld42) 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) 2017-2024 Joel Davis (@joeld42) and Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Joel Davis (@joeld42) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_orthographic_projection.c b/examples/models/models_orthographic_projection.c index b0f74413d..8392f7a7d 100644 --- a/examples/models/models_orthographic_projection.c +++ b/examples/models/models_orthographic_projection.c @@ -2,6 +2,8 @@ * * raylib [models] example - Show the difference between perspective and orthographic projection * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 2.0, last time updated with raylib 3.7 * * Example contributed by Max Danielsson (@autious) 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) 2018-2024 Max Danielsson (@autious) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Max Danielsson (@autious) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_point_rendering.c b/examples/models/models_point_rendering.c index d33cbdda8..b7bf96742 100644 --- a/examples/models/models_point_rendering.c +++ b/examples/models/models_point_rendering.c @@ -2,6 +2,8 @@ * * raylib example - point rendering * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 5.0, last time updated with raylib 5.0 * * Example contributed by Reese Gallagher (@satchelfrost) 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) 2024 Reese Gallagher (@satchelfrost) +* Copyright (c) 2024-2025 Reese Gallagher (@satchelfrost) * ********************************************************************************************/ @@ -163,9 +165,9 @@ static Mesh GenMeshPoints(int numPoints) float phi = (2.0f*PI*rand())/RAND_MAX; float r = (10.0f*rand())/RAND_MAX; - mesh.vertices[i*3 + 0] = r*sin(theta)*cos(phi); - mesh.vertices[i*3 + 1] = r*sin(theta)*sin(phi); - mesh.vertices[i*3 + 2] = r*cos(theta); + mesh.vertices[i*3 + 0] = r*sinf(theta)*cosf(phi); + mesh.vertices[i*3 + 1] = r*sinf(theta)*sinf(phi); + mesh.vertices[i*3 + 2] = r*cosf(theta); Color color = ColorFromHSV(r*360.0f, 1.0f, 1.0f); diff --git a/examples/models/models_rlgl_solar_system.c b/examples/models/models_rlgl_solar_system.c index 7b35263ac..81f3e0f75 100644 --- a/examples/models/models_rlgl_solar_system.c +++ b/examples/models/models_rlgl_solar_system.c @@ -2,6 +2,8 @@ * * raylib [models] example - rlgl module usage with push/pop matrix transformations * +* Example complexity rating: [★★★★] 4/4 +* * NOTE: This example uses [rlgl] module functionality (pseudo-OpenGL 1.1 style coding) * * Example originally created with raylib 2.5, last time updated with raylib 4.0 @@ -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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index 4689acd77..e816b27e1 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -2,12 +2,14 @@ * * raylib [models] example - Skybox loading and drawing * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.8, 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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_tesseract_view.c b/examples/models/models_tesseract_view.c index 495e9af9c..44484ca5b 100644 --- a/examples/models/models_tesseract_view.c +++ b/examples/models/models_tesseract_view.c @@ -4,12 +4,16 @@ * * NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?) * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 5.6-dev, last time updated with raylib 5.6-dev * +* Example contributed by Timothy van der Valk (@arceryz) 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) 2024-2025 raylib contributor (?) & Ramon Santamaria (@raysan5) +* Copyright (c) 2024-2025 Timothy van der Valk (@arceryz) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_waving_cubes.c b/examples/models/models_waving_cubes.c index 521a4afd5..6608eba48 100644 --- a/examples/models/models_waving_cubes.c +++ b/examples/models/models_waving_cubes.c @@ -2,6 +2,8 @@ * * raylib [models] example - Waving cubes * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 2.5, last time updated with raylib 3.7 * * Example contributed by Codecat (@codecat) 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-2024 Codecat (@codecat) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Codecat (@codecat) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index 5374c035e..2c674824e 100644 --- a/examples/models/models_yaw_pitch_roll.c +++ b/examples/models/models_yaw_pitch_roll.c @@ -2,6 +2,8 @@ * * raylib [models] example - Plane rotations (yaw, pitch, roll) * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.8, last time updated with raylib 4.0 * * Example contributed by Berni (@Berni8k) 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) 2017-2024 Berni (@Berni8k) and Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Berni (@Berni8k) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/others/easings_testbed.c b/examples/others/easings_testbed.c index 1f31f5bb9..e3fa0e84b 100644 --- a/examples/others/easings_testbed.c +++ b/examples/others/easings_testbed.c @@ -4,12 +4,14 @@ * * Example originally created with raylib 2.5, last time updated with raylib 2.5 * +* Example complexity rating: [★★★☆] 3/4 +* * Example contributed by Juan Miguel López (@flashback-fx) 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-2024 Juan Miguel López (@flashback-fx ) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Juan Miguel López (@flashback-fx) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/others/embedded_files_loading.c b/examples/others/embedded_files_loading.c index e46fe102f..8a66b4394 100644 --- a/examples/others/embedded_files_loading.c +++ b/examples/others/embedded_files_loading.c @@ -2,6 +2,8 @@ * * raylib [others] example - Embedded files loading (Wave and Image) * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 3.0, last time updated with raylib 2.5 * * Example contributed by Kristian Holmgren (@defutura) 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) 2020-2024 Kristian Holmgren (@defutura) and Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 Kristian Holmgren (@defutura) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/others/raylib_opengl_interop.c b/examples/others/raylib_opengl_interop.c index b0b7d6ff3..9ab2bb220 100644 --- a/examples/others/raylib_opengl_interop.c +++ b/examples/others/raylib_opengl_interop.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - OpenGL point particle system * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 3.8, last time updated with raylib 2.5 * * Example contributed by Stephan Soller (@arkanis) 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) 2021-2024 Stephan Soller (@arkanis) and Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Stephan Soller (@arkanis) and Ramon Santamaria (@raysan5) * ******************************************************************************************** * diff --git a/examples/others/raymath_vector_angle.c b/examples/others/raymath_vector_angle.c index 5a69345b4..414546ac6 100644 --- a/examples/others/raymath_vector_angle.c +++ b/examples/others/raymath_vector_angle.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - Vector Angle * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.0, last time updated with raylib 4.6 * * 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 Ramon Santamaria (@raysan5) +* Copyright (c) 2023-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/others/rlgl_compute_shader.c b/examples/others/rlgl_compute_shader.c index e8a654d2a..b17ba711a 100644 --- a/examples/others/rlgl_compute_shader.c +++ b/examples/others/rlgl_compute_shader.c @@ -5,6 +5,8 @@ * NOTE: This example requires raylib OpenGL 4.3 versions for compute shaders support, * shaders used in this example are #version 430 (OpenGL 4.3) * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 4.0, last time updated with raylib 2.5 * * Example contributed by Teddy Astie (@tsnake41) and reviewed by Ramon Santamaria (@raysan5) @@ -12,7 +14,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-2024 Teddy Astie (@tsnake41) +* Copyright (c) 2021-2025 Teddy Astie (@tsnake41) * ********************************************************************************************/ diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index 60d140598..713d1b908 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -5,6 +5,10 @@ * rlgl library is an abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0) * that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...) * +* Example complexity rating: [★★★★] 4/4 +* +* Example originally created with raylib 1.6, last time updated with raylib 4.0 +* * WARNING: This example is intended only for PLATFORM_DESKTOP and OpenGL 3.3 Core profile. * It could work on other platforms if redesigned for those platforms (out-of-scope) * @@ -29,7 +33,7 @@ * This example is 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-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. diff --git a/examples/shaders/resources/shaders/glsl100/deferred_shading.fs b/examples/shaders/resources/shaders/glsl100/deferred_shading.fs new file mode 100644 index 000000000..d782792b9 --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/deferred_shading.fs @@ -0,0 +1,59 @@ +#version 100 + +precision mediump float; + +// Input vertex attributes (from vertex shader) +varying vec2 fragTexCoord; +varying vec4 fragColor; + +// Input uniform values +uniform sampler2D gPosition; +uniform sampler2D gNormal; +uniform sampler2D gAlbedoSpec; + +struct Light { + int enabled; + int type; // Unused in this demo. + vec3 position; + vec3 target; // Unused in this demo. + vec4 color; +}; + +const int NR_LIGHTS = 4; +uniform Light lights[NR_LIGHTS]; +uniform vec3 viewPosition; + +const float QUADRATIC = 0.032; +const float LINEAR = 0.09; + +void main() +{ + vec3 fragPosition = texture2D(gPosition, fragTexCoord).rgb; + vec3 normal = texture2D(gNormal, fragTexCoord).rgb; + vec3 albedo = texture2D(gAlbedoSpec, fragTexCoord).rgb; + float specular = texture2D(gAlbedoSpec, fragTexCoord).a; + + vec3 ambient = albedo*vec3(0.1); + vec3 viewDirection = normalize(viewPosition - fragPosition); + + for (int i = 0; i < NR_LIGHTS; ++i) + { + if(lights[i].enabled == 0) continue; + vec3 lightDirection = lights[i].position - fragPosition; + vec3 diffuse = max(dot(normal, lightDirection), 0.0)*albedo*lights[i].color.xyz; + + vec3 halfwayDirection = normalize(lightDirection + viewDirection); + float spec = pow(max(dot(normal, halfwayDirection), 0.0), 32.0); + vec3 specular = specular*spec*lights[i].color.xyz; + + // Attenuation + float distance = length(lights[i].position - fragPosition); + float attenuation = 1.0/(1.0 + LINEAR * distance + QUADRATIC*distance*distance); + diffuse *= attenuation; + specular *= attenuation; + ambient += diffuse + specular; + } + + gl_FragColor = vec4(ambient, 1.0); +} + diff --git a/examples/shaders/resources/shaders/glsl100/deferred_shading.vs b/examples/shaders/resources/shaders/glsl100/deferred_shading.vs new file mode 100644 index 000000000..bb108ce09 --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/deferred_shading.vs @@ -0,0 +1,16 @@ +#version 100 + +// Input vertex attributes +attribute vec3 vertexPosition; +attribute vec2 vertexTexCoord; + +// Output vertex attributes (to fragment shader) +varying vec2 fragTexCoord; + +void main() +{ + fragTexCoord = vertexTexCoord; + + // Calculate final vertex position + gl_Position = vec4(vertexPosition, 1.0); +} diff --git a/examples/shaders/resources/shaders/glsl100/gbuffer.fs b/examples/shaders/resources/shaders/glsl100/gbuffer.fs new file mode 100644 index 000000000..2945c5ddd --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/gbuffer.fs @@ -0,0 +1,36 @@ +#version 100 + +precision mediump float; + +// Input vertex attributes (from vertex shader) +varying vec3 fragPosition; +varying vec2 fragTexCoord; +varying vec3 fragNormal; +varying vec4 fragColor; + +// TODO: Is there some alternative for GLSL100 +//layout (location = 0) out vec3 gPosition; +//layout (location = 1) out vec3 gNormal; +//layout (location = 2) out vec4 gAlbedoSpec; +//uniform vec3 gPosition; +//uniform vec3 gNormal; +//uniform vec4 gAlbedoSpec; + +// Input uniform values +uniform sampler2D texture0; // Diffuse texture +uniform sampler2D specularTexture; + +void main() +{ + // Store the fragment position vector in the first gbuffer texture + //gPosition = fragPosition; + + // Store the per-fragment normals into the gbuffer + //gNormal = normalize(fragNormal); + + // Store the diffuse per-fragment color + gl_FragColor.rgb = texture2D(texture0, fragTexCoord).rgb; + + // Store specular intensity in gAlbedoSpec's alpha component + gl_FragColor.a = texture2D(specularTexture, fragTexCoord).r; +} diff --git a/examples/shaders/resources/shaders/glsl100/gbuffer.vs b/examples/shaders/resources/shaders/glsl100/gbuffer.vs new file mode 100644 index 000000000..2791ce5ee --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/gbuffer.vs @@ -0,0 +1,60 @@ +#version 100 + +// Input vertex attributes +attribute vec3 vertexPosition; +attribute vec2 vertexTexCoord; +attribute vec3 vertexNormal; +attribute vec4 vertexColor; + +// Input uniform values +uniform mat4 matModel; +uniform mat4 matView; +uniform mat4 matProjection; + +// Output vertex attributes (to fragment shader) +varying vec3 fragPosition; +varying vec2 fragTexCoord; +varying vec3 fragNormal; +varying vec4 fragColor; + + +// https://github.com/glslify/glsl-inverse +mat3 inverse(mat3 m) +{ + float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2]; + float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2]; + float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2]; + + float b01 = a22*a11 - a12*a21; + float b11 = -a22*a10 + a12*a20; + float b21 = a21*a10 - a11*a20; + + float det = a00*b01 + a01*b11 + a02*b21; + + return mat3(b01, (-a22*a01 + a02*a21), (a12*a01 - a02*a11), + b11, (a22*a00 - a02*a20), (-a12*a00 + a02*a10), + b21, (-a21*a00 + a01*a20), (a11*a00 - a01*a10))/det; +} + +// https://github.com/glslify/glsl-transpose +mat3 transpose(mat3 m) +{ + return mat3(m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2]); +} + +void main() +{ + // Calculate vertex attributes for fragment shader + vec4 worldPos = matModel*vec4(vertexPosition, 1.0); + fragPosition = worldPos.xyz; + fragTexCoord = vertexTexCoord; + fragColor = vertexColor; + + mat3 normalMatrix = transpose(inverse(mat3(matModel))); + fragNormal = normalMatrix*vertexNormal; + + // Calculate final vertex position + gl_Position = matProjection*matView*worldPos; +} diff --git a/examples/shaders/resources/shaders/glsl100/rounded_rectangle.fs b/examples/shaders/resources/shaders/glsl100/rounded_rectangle.fs new file mode 100644 index 000000000..3c8d07978 --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/rounded_rectangle.fs @@ -0,0 +1,76 @@ +// Note: SDF by Iñigo Quilez is licensed under MIT License + +#version 100 + +precision mediump float; + +// Input vertex attributes (from vertex shader) +varying vec2 fragTexCoord; +varying vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform vec4 colDiffuse; + +uniform vec4 rectangle; // Rectangle dimensions (x, y, width, height) +uniform vec4 radius; // Corner radius (top-left, top-right, bottom-left, bottom-right) +uniform vec4 color; + +// Shadow parameters +uniform float shadowRadius; +uniform vec2 shadowOffset; +uniform float shadowScale; +uniform vec4 shadowColor; + +// Border parameters +uniform float borderThickness; +uniform vec4 borderColor; + +// Create a rounded rectangle using signed distance field +// Thanks to Iñigo Quilez (https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm) +// And thanks to inobelar (https://www.shadertoy.com/view/fsdyzB) for shader +// MIT License +float RoundedRectangleSDF(vec2 fragCoord, vec2 center, vec2 halfSize, vec4 radius) +{ + vec2 fragFromCenter = fragCoord - center; + + // Determine which corner radius to use + radius.xy = (fragFromCenter.y > 0.0) ? radius.xy : radius.zw; + radius.x = (fragFromCenter.x < 0.0) ? radius.x : radius.y; + + // Calculate signed distance field + vec2 dist = abs(fragFromCenter) - halfSize + radius.x; + return min(max(dist.x, dist.y), 0.0) + length(max(dist, 0.0)) - radius.x; +} + +void main() +{ + // Texel color fetching from texture sampler + vec4 texelColor = texture2D(texture0, fragTexCoord); + + // Requires fragment coordinate varying pixels + vec2 fragCoord = gl_FragCoord.xy; + + // Calculate signed distance field for rounded rectangle + vec2 halfSize = rectangle.zw*0.5; + vec2 center = rectangle.xy + halfSize; + float recSDF = RoundedRectangleSDF(fragCoord, center, halfSize, radius); + + // Calculate signed distance field for rectangle shadow + vec2 shadowHalfSize = halfSize*shadowScale; + vec2 shadowCenter = center + shadowOffset; + float shadowSDF = RoundedRectangleSDF(fragCoord, shadowCenter, shadowHalfSize, radius); + + // Caculate alpha factors + float recFactor = smoothstep(1.0, 0.0, recSDF); + float shadowFactor = smoothstep(shadowRadius, 0.0, shadowSDF); + float borderFactor = smoothstep(0.0, 1.0, recSDF + borderThickness)*recFactor; + + // Multiply each color by its respective alpha factor + vec4 recColor = vec4(color.rgb, color.a*recFactor); + vec4 shadowCol = vec4(shadowColor.rgb, shadowColor.a*shadowFactor); + vec4 borderCol = vec4(borderColor.rgb, borderColor.a*borderFactor); + + // Combine the colors varying the order (shadow, rectangle, border) + gl_FragColor = mix(mix(shadowCol, recColor, recColor.a), borderCol, borderCol.a); +} \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl120/rounded_rectangle.fs b/examples/shaders/resources/shaders/glsl120/rounded_rectangle.fs new file mode 100644 index 000000000..eb96c28d3 --- /dev/null +++ b/examples/shaders/resources/shaders/glsl120/rounded_rectangle.fs @@ -0,0 +1,74 @@ +// Note: SDF by Iñigo Quilez is licensed under MIT License + +#version 120 + +// Input vertex attributes (from vertex shader) +varying vec2 fragTexCoord; +varying vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform vec4 colDiffuse; + +uniform vec4 rectangle; // Rectangle dimensions (x, y, width, height) +uniform vec4 radius; // Corner radius (top-left, top-right, bottom-left, bottom-right) +uniform vec4 color; + +// Shadow parameters +uniform float shadowRadius; +uniform vec2 shadowOffset; +uniform float shadowScale; +uniform vec4 shadowColor; + +// Border parameters +uniform float borderThickness; +uniform vec4 borderColor; + +// Create a rounded rectangle using signed distance field +// Thanks to Iñigo Quilez (https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm) +// And thanks to inobelar (https://www.shadertoy.com/view/fsdyzB) for shader +// MIT License +float RoundedRectangleSDF(vec2 fragCoord, vec2 center, vec2 halfSize, vec4 radius) +{ + vec2 fragFromCenter = fragCoord - center; + + // Determine which corner radius to use + radius.xy = (fragFromCenter.y > 0.0) ? radius.xy : radius.zw; + radius.x = (fragFromCenter.x < 0.0) ? radius.x : radius.y; + + // Calculate signed distance field + vec2 dist = abs(fragFromCenter) - halfSize + radius.x; + return min(max(dist.x, dist.y), 0.0) + length(max(dist, 0.0)) - radius.x; +} + +void main() +{ + // Texel color fetching from texture sampler + vec4 texelColor = texture2D(texture0, fragTexCoord); + + // Requires fragment coordinate varying pixels + vec2 fragCoord = gl_FragCoord.xy; + + // Calculate signed distance field for rounded rectangle + vec2 halfSize = rectangle.zw*0.5; + vec2 center = rectangle.xy + halfSize; + float recSDF = RoundedRectangleSDF(fragCoord, center, halfSize, radius); + + // Calculate signed distance field for rectangle shadow + vec2 shadowHalfSize = halfSize*shadowScale; + vec2 shadowCenter = center + shadowOffset; + float shadowSDF = RoundedRectangleSDF(fragCoord, shadowCenter, shadowHalfSize, radius); + + // Caculate alpha factors + float recFactor = smoothstep(1.0, 0.0, recSDF); + float shadowFactor = smoothstep(shadowRadius, 0.0, shadowSDF); + float borderFactor = smoothstep(0.0, 1.0, recSDF + borderThickness)*recFactor; + + // Multiply each color by its respective alpha factor + vec4 recColor = vec4(color.rgb, color.a*recFactor); + vec4 shadowCol = vec4(shadowColor.rgb, shadowColor.a*shadowFactor); + vec4 borderCol = vec4(borderColor.rgb, borderColor.a*borderFactor); + + // Combine the colors varying the order (shadow, rectangle, border) + gl_FragColor = mix(mix(shadowCol, recColor, recColor.a), borderCol, borderCol.a); +} \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/rounded_rectangle.fs b/examples/shaders/resources/shaders/glsl330/rounded_rectangle.fs new file mode 100644 index 000000000..a96c31fab --- /dev/null +++ b/examples/shaders/resources/shaders/glsl330/rounded_rectangle.fs @@ -0,0 +1,77 @@ +// Note: SDF by Iñigo Quilez is licensed under MIT License + +#version 330 + +// Input vertex attributes (from vertex shader) +in vec2 fragTexCoord; +in vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform vec4 colDiffuse; + +// Output fragment color +out vec4 finalColor; + +uniform vec4 rectangle; // Rectangle dimensions (x, y, width, height) +uniform vec4 radius; // Corner radius (top-left, top-right, bottom-left, bottom-right) +uniform vec4 color; + +// Shadow parameters +uniform float shadowRadius; +uniform vec2 shadowOffset; +uniform float shadowScale; +uniform vec4 shadowColor; + +// Border parameters +uniform float borderThickness; +uniform vec4 borderColor; + +// Create a rounded rectangle using signed distance field +// Thanks to Iñigo Quilez (https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm) +// And thanks to inobelar (https://www.shadertoy.com/view/fsdyzB) for shader +// MIT License +float RoundedRectangleSDF(vec2 fragCoord, vec2 center, vec2 halfSize, vec4 radius) +{ + vec2 fragFromCenter = fragCoord - center; + + // Determine which corner radius to use + radius.xy = (fragFromCenter.y > 0.0) ? radius.xy : radius.zw; + radius.x = (fragFromCenter.x < 0.0) ? radius.x : radius.y; + + // Calculate signed distance field + vec2 dist = abs(fragFromCenter) - halfSize + radius.x; + return min(max(dist.x, dist.y), 0.0) + length(max(dist, 0.0)) - radius.x; +} + +void main() +{ + // Texel color fetching from texture sampler + vec4 texelColor = texture(texture0, fragTexCoord); + + // Requires fragment coordinate in pixels + vec2 fragCoord = gl_FragCoord.xy; + + // Calculate signed distance field for rounded rectangle + vec2 halfSize = rectangle.zw*0.5; + vec2 center = rectangle.xy + halfSize; + float recSDF = RoundedRectangleSDF(fragCoord, center, halfSize, radius); + + // Calculate signed distance field for rectangle shadow + vec2 shadowHalfSize = halfSize*shadowScale; + vec2 shadowCenter = center + shadowOffset; + float shadowSDF = RoundedRectangleSDF(fragCoord, shadowCenter, shadowHalfSize, radius); + + // Caculate alpha factors + float recFactor = smoothstep(1.0, 0.0, recSDF); + float shadowFactor = smoothstep(shadowRadius, 0.0, shadowSDF); + float borderFactor = smoothstep(0.0, 1.0, recSDF + borderThickness)*recFactor; + + // Multiply each color by its respective alpha factor + vec4 recColor = vec4(color.rgb, color.a*recFactor); + vec4 shadowCol = vec4(shadowColor.rgb, shadowColor.a*shadowFactor); + vec4 borderCol = vec4(borderColor.rgb, borderColor.a*borderFactor); + + // Combine the colors in the order (shadow, rectangle, border) + finalColor = mix(mix(shadowCol, recColor, recColor.a), borderCol, borderCol.a); +} \ No newline at end of file diff --git a/examples/shaders/shaders_basic_lighting.c b/examples/shaders/shaders_basic_lighting.c index 77fedfeb9..f115338a5 100644 --- a/examples/shaders/shaders_basic_lighting.c +++ b/examples/shaders/shaders_basic_lighting.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - basic lighting * +* Example complexity rating: [★★★★] 4/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -9,12 +11,12 @@ * * Example originally created with raylib 3.0, last time updated with raylib 4.2 * -* Example contributed by Chris Camacho (@codifies) and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by Chris Camacho (@chriscamacho) 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-2024 Chris Camacho (@codifies) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_basic_pbr.c b/examples/shaders/shaders_basic_pbr.c index d02980afd..e595ef9ca 100644 --- a/examples/shaders/shaders_basic_pbr.c +++ b/examples/shaders/shaders_basic_pbr.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Basic PBR * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 5.0, last time updated with raylib 5.1-dev * * Example contributed by Afan OLOVCIC (@_DevDad) 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) 2023-2024 Afan OLOVCIC (@_DevDad) +* Copyright (c) 2023-2025 Afan OLOVCIC (@_DevDad) * * Model: "Old Rusty Car" (https://skfb.ly/LxRy) by Renafox, * licensed under Creative Commons Attribution-NonCommercial diff --git a/examples/shaders/shaders_custom_uniform.c b/examples/shaders/shaders_custom_uniform.c index 9d991bd1a..432b240ee 100644 --- a/examples/shaders/shaders_custom_uniform.c +++ b/examples/shaders/shaders_custom_uniform.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Postprocessing with custom uniform variable * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_deferred_render.c b/examples/shaders/shaders_deferred_render.c index e03ad6009..879f9a68b 100644 --- a/examples/shaders/shaders_deferred_render.c +++ b/examples/shaders/shaders_deferred_render.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - deferred rendering * +* Example complexity rating: [★★★★] 4/4 +* * NOTE: This example requires raylib OpenGL 3.3 or OpenGL ES 3.0 * * Example originally created with raylib 4.5, last time updated with raylib 4.5 @@ -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) 2023 Justin Andreas Lacoste (@27justin) +* Copyright (c) 2023-2025 Justin Andreas Lacoste (@27justin) * ********************************************************************************************/ @@ -76,11 +78,11 @@ int main(void) Model cube = LoadModelFromMesh(GenMeshCube(2.0f, 2.0f, 2.0f)); // Load geometry buffer (G-buffer) shader and deferred shader - Shader gbufferShader = LoadShader("resources/shaders/glsl330/gbuffer.vs", - "resources/shaders/glsl330/gbuffer.fs"); + Shader gbufferShader = LoadShader(TextFormat("resources/shaders/glsl%i/gbuffer.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/gbuffer.fs", GLSL_VERSION)); - Shader deferredShader = LoadShader("resources/shaders/glsl330/deferred_shading.vs", - "resources/shaders/glsl330/deferred_shading.fs"); + Shader deferredShader = LoadShader(TextFormat("resources/shaders/glsl%i/deferred_shading.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/deferred_shading.fs", GLSL_VERSION)); deferredShader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(deferredShader, "viewPosition"); // Initialize the G-buffer @@ -130,7 +132,6 @@ int main(void) if (!rlFramebufferComplete(gBuffer.framebuffer)) { TraceLog(LOG_WARNING, "Framebuffer is not complete"); - exit(1); } // Now we initialize the sampler2D uniform's in the deferred shader. diff --git a/examples/shaders/shaders_eratosthenes.c b/examples/shaders/shaders_eratosthenes.c index 21b7ea8f9..26075706e 100644 --- a/examples/shaders/shaders_eratosthenes.c +++ b/examples/shaders/shaders_eratosthenes.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Sieve of Eratosthenes * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: Sieve of Eratosthenes, the earliest known (ancient Greek) prime number sieve. * * "Sift the twos and sift the threes, @@ -16,12 +18,12 @@ * * Example originally created with raylib 2.5, last time updated with raylib 4.0 * -* Example contributed by ProfJski and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by ProfJski (@ProfJski) 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-2024 ProfJski and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 ProfJski (@ProfJski) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_fog.c b/examples/shaders/shaders_fog.c index ad514077d..2e589eec4 100644 --- a/examples/shaders/shaders_fog.c +++ b/examples/shaders/shaders_fog.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - fog * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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-2024 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_hot_reloading.c b/examples/shaders/shaders_hot_reloading.c index 2a9ea2d6d..1005c0913 100644 --- a/examples/shaders/shaders_hot_reloading.c +++ b/examples/shaders/shaders_hot_reloading.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Hot reloading * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 for shaders support and only #version 330 * is currently supported. OpenGL ES 2.0 platforms are not supported at the moment. * @@ -10,7 +12,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) 2020-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_hybrid_render.c b/examples/shaders/shaders_hybrid_render.c index 5bf2e49a8..4c9f5c978 100644 --- a/examples/shaders/shaders_hybrid_render.c +++ b/examples/shaders/shaders_hybrid_render.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Hybrid Rendering * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 4.2, last time updated with raylib 4.2 * * Example contributed by Buğra Alptekin Sarı (@BugraAlptekinSari) 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) 2022-2024 Buğra Alptekin Sarı (@BugraAlptekinSari) +* Copyright (c) 2022-2025 Buğra Alptekin Sarı (@BugraAlptekinSari) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_julia_set.c b/examples/shaders/shaders_julia_set.c index 93a3436a8..c1be3f325 100644 --- a/examples/shaders/shaders_julia_set.c +++ b/examples/shaders/shaders_julia_set.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Julia sets * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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-2024 Josh Colclough (@joshcol9232) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Josh Colclough (@joshcol9232) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_lightmap.c b/examples/shaders/shaders_lightmap.c index 91ed8bfd2..0d26e54c8 100644 --- a/examples/shaders/shaders_lightmap.c +++ b/examples/shaders/shaders_lightmap.c @@ -2,17 +2,21 @@ * * raylib [shaders] example - lightmap * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). * +* Example originally created with raylib 4.5, last time updated with raylib 4.5 +* * Example contributed by Jussi Viitala (@nullstare) 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-2024 Jussi Viitala (@nullstare) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Jussi Viitala (@nullstare) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_mesh_instancing.c b/examples/shaders/shaders_mesh_instancing.c index 1e0bf0696..17b2da33d 100644 --- a/examples/shaders/shaders_mesh_instancing.c +++ b/examples/shaders/shaders_mesh_instancing.c @@ -2,18 +2,19 @@ * * raylib [shaders] example - Mesh instancing * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 3.7, last time updated with raylib 4.2 * -* Example contributed by @seanpringle and reviewed by Max (@moliad) and Ramon Santamaria (@raysan5) +* Example contributed by seanpringle (@seanpringle) and reviewed by Max (@moliad) and 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) 2020-2024 @seanpringle, Max (@moliad) and Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 seanpringle (@seanpringle), Max (@moliad) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ - #include "raylib.h" #include "raymath.h" diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index 9faa2d589..fda6377fc 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Model shader * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_multi_sample2d.c b/examples/shaders/shaders_multi_sample2d.c index ccdc6fa82..8409e35cb 100644 --- a/examples/shaders/shaders_multi_sample2d.c +++ b/examples/shaders/shaders_multi_sample2d.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Multiple sample2D with default batch system * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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) 2020-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_palette_switch.c b/examples/shaders/shaders_palette_switch.c index 9ff86d83d..50f80b8f0 100644 --- a/examples/shaders/shaders_palette_switch.c +++ b/examples/shaders/shaders_palette_switch.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Color palette switch * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -16,7 +18,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-2024 Marco Lizza (@MarcoLizza) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Marco Lizza (@MarcoLizza) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c index 54ffae931..ea55c9ca4 100644 --- a/examples/shaders/shaders_postprocessing.c +++ b/examples/shaders/shaders_postprocessing.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Apply a postprocessing shader to a scene * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_raymarching.c b/examples/shaders/shaders_raymarching.c index 812d683e6..ab69fe69a 100644 --- a/examples/shaders/shaders_raymarching.c +++ b/examples/shaders/shaders_raymarching.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Raymarching shapes generation * +* Example complexity rating: [★★★★] 4/4 +* * NOTE: This example requires raylib OpenGL 3.3 for shaders support and only #version 330 * is currently supported. OpenGL ES 2.0 platforms are not supported at the moment. * @@ -10,7 +12,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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_rounded_rectangle.c b/examples/shaders/shaders_rounded_rectangle.c new file mode 100644 index 000000000..754110d92 --- /dev/null +++ b/examples/shaders/shaders_rounded_rectangle.c @@ -0,0 +1,238 @@ +/******************************************************************************************* +* +* raylib [shaders] example - Rounded Rectangle +* +* Example complexity rating: [★★★☆] 3/4 +* +* Example originally created with raylib 5.5, last time updated with raylib 5.5 +* +* Example contributed by Anstro Pleuton (@anstropleuton) 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 Anstro Pleuton (@anstropleuton) +* +********************************************************************************************/ + +#include "raylib.h" + +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif + +//------------------------------------------------------------------------------------ +// Declare custom Structs +//------------------------------------------------------------------------------------ + +// Rounded rectangle data +typedef struct { + Vector4 cornerRadius; // Individual corner radius (top-left, top-right, bottom-left, bottom-right) + + // Shadow variables + float shadowRadius; + Vector2 shadowOffset; + float shadowScale; + + // Border variables + float borderThickness; // Inner-border thickness + + // Shader locations + int rectangleLoc; + int radiusLoc; + int colorLoc; + int shadowRadiusLoc; + int shadowOffsetLoc; + int shadowScaleLoc; + int shadowColorLoc; + int borderThicknessLoc; + int borderColorLoc; +} RoundedRectangle; + +//------------------------------------------------------------------------------------ +// Module Functions Declaration +//------------------------------------------------------------------------------------ + +// Create a rounded rectangle and set uniform locations +static RoundedRectangle CreateRoundedRectangle(Vector4 cornerRadius, float shadowRadius, Vector2 shadowOffset, float shadowScale, float borderThickness, Shader shader); + +// Update rounded rectangle uniforms +static void UpdateRoundedRectangle(RoundedRectangle rec, Shader shader); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + const Color rectangleColor = BLUE; + const Color shadowColor = DARKBLUE; + const Color borderColor = SKYBLUE; + + InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Rounded Rectangle"); + + // Load the shader + Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/rounded_rectangle.fs", GLSL_VERSION)); + + // Create a rounded rectangle + RoundedRectangle roundedRectangle = CreateRoundedRectangle( + (Vector4){ 5.0f, 10.0f, 15.0f, 20.0f }, // Corner radius + 20.0f, // Shadow radius + (Vector2){ 0.0f, -5.0f }, // Shadow offset + 0.95f, // Shadow scale + 5.0f, // Border thickness + shader // Shader + ); + + // Update shader uniforms + UpdateRoundedRectangle(roundedRectangle, shader); + + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + // Draw rectangle box with rounded corners using shader + Rectangle rec = { 50, 70, 110, 60 }; + DrawRectangleLines(rec.x - 20, rec.y - 20, rec.width + 40, rec.height + 40, DARKGRAY); + DrawText("Rounded rectangle", rec.x - 20, rec.y - 35, 10, DARKGRAY); + + // Flip Y axis to match shader coordinate system + rec.y = screenHeight - rec.y - rec.height; + SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); + + // Only rectangle color + SetShaderValue(shader, roundedRectangle.colorLoc, (float[]) { rectangleColor.r/255.0f, rectangleColor.g/255.0f, rectangleColor.b/255.0f, rectangleColor.a/255.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.shadowColorLoc, (float[]) { 0.0f, 0.0f, 0.0f, 0.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.borderColorLoc, (float[]) { 0.0f, 0.0f, 0.0f, 0.0f }, SHADER_UNIFORM_VEC4); + + BeginShaderMode(shader); + DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); + EndShaderMode(); + + + + // Draw rectangle shadow using shader + rec = (Rectangle){ 50, 200, 110, 60 }; + DrawRectangleLines(rec.x - 20, rec.y - 20, rec.width + 40, rec.height + 40, DARKGRAY); + DrawText("Rounded rectangle shadow", rec.x - 20, rec.y - 35, 10, DARKGRAY); + + rec.y = screenHeight - rec.y - rec.height; + SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); + + // Only shadow color + SetShaderValue(shader, roundedRectangle.colorLoc, (float[]) { 0.0f, 0.0f, 0.0f, 0.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.shadowColorLoc, (float[]) { shadowColor.r/255.0f, shadowColor.g/255.0f, shadowColor.b/255.0f, shadowColor.a/255.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.borderColorLoc, (float[]) { 0.0f, 0.0f, 0.0f, 0.0f }, SHADER_UNIFORM_VEC4); + + BeginShaderMode(shader); + DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); + EndShaderMode(); + + + + // Draw rectangle's border using shader + rec = (Rectangle){ 50, 330, 110, 60 }; + DrawRectangleLines(rec.x - 20, rec.y - 20, rec.width + 40, rec.height + 40, DARKGRAY); + DrawText("Rounded rectangle border", rec.x - 20, rec.y - 35, 10, DARKGRAY); + + rec.y = screenHeight - rec.y - rec.height; + SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); + + // Only border color + SetShaderValue(shader, roundedRectangle.colorLoc, (float[]) { 0.0f, 0.0f, 0.0f, 0.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.shadowColorLoc, (float[]) { 0.0f, 0.0f, 0.0f, 0.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.borderColorLoc, (float[]) { borderColor.r/255.0f, borderColor.g/255.0f, borderColor.b/255.0f, borderColor.a/255.0f }, SHADER_UNIFORM_VEC4); + + BeginShaderMode(shader); + DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); + EndShaderMode(); + + + + // Draw one more rectangle with all three colors + rec = (Rectangle){ 240, 80, 500, 300 }; + DrawRectangleLines(rec.x - 30, rec.y - 30, rec.width + 60, rec.height + 60, DARKGRAY); + DrawText("Rectangle with all three combined", rec.x - 30, rec.y - 45, 10, DARKGRAY); + + rec.y = screenHeight - rec.y - rec.height; + SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); + + // All three colors + SetShaderValue(shader, roundedRectangle.colorLoc, (float[]) { rectangleColor.r/255.0f, rectangleColor.g/255.0f, rectangleColor.b/255.0f, rectangleColor.a/255.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.shadowColorLoc, (float[]) { shadowColor.r/255.0f, shadowColor.g/255.0f, shadowColor.b/255.0f, shadowColor.a/255.0f }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, roundedRectangle.borderColorLoc, (float[]) { borderColor.r/255.0f, borderColor.g/255.0f, borderColor.b/255.0f, borderColor.a/255.0f }, SHADER_UNIFORM_VEC4); + + BeginShaderMode(shader); + DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); + EndShaderMode(); + + DrawText("(c) Rounded rectangle SDF by Iñigo Quilez. MIT License.", screenWidth - 300, screenHeight - 20, 10, BLACK); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + UnloadShader(shader); // Unload shader + + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} + +//------------------------------------------------------------------------------------ +// Module Functions Definitions +//------------------------------------------------------------------------------------ + +// Create a rounded rectangle and set uniform locations +RoundedRectangle CreateRoundedRectangle(Vector4 cornerRadius, float shadowRadius, Vector2 shadowOffset, float shadowScale, float borderThickness, Shader shader) +{ + RoundedRectangle rec; + rec.cornerRadius = cornerRadius; + rec.shadowRadius = shadowRadius; + rec.shadowOffset = shadowOffset; + rec.shadowScale = shadowScale; + rec.borderThickness = borderThickness; + + // Get shader uniform locations + rec.rectangleLoc = GetShaderLocation(shader, "rectangle"); + rec.radiusLoc = GetShaderLocation(shader, "radius"); + rec.colorLoc = GetShaderLocation(shader, "color"); + rec.shadowRadiusLoc = GetShaderLocation(shader, "shadowRadius"); + rec.shadowOffsetLoc = GetShaderLocation(shader, "shadowOffset"); + rec.shadowScaleLoc = GetShaderLocation(shader, "shadowScale"); + rec.shadowColorLoc = GetShaderLocation(shader, "shadowColor"); + rec.borderThicknessLoc = GetShaderLocation(shader, "borderThickness"); + rec.borderColorLoc = GetShaderLocation(shader, "borderColor"); + + UpdateRoundedRectangle(rec, shader); + + return rec; +} + +// Update rounded rectangle uniforms +void UpdateRoundedRectangle(RoundedRectangle rec, Shader shader) +{ + SetShaderValue(shader, rec.radiusLoc, (float[]){ rec.cornerRadius.x, rec.cornerRadius.y, rec.cornerRadius.z, rec.cornerRadius.w }, SHADER_UNIFORM_VEC4); + SetShaderValue(shader, rec.shadowRadiusLoc, &rec.shadowRadius, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, rec.shadowOffsetLoc, (float[]){ rec.shadowOffset.x, rec.shadowOffset.y }, SHADER_UNIFORM_VEC2); + SetShaderValue(shader, rec.shadowScaleLoc, &rec.shadowScale, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, rec.borderThicknessLoc, &rec.borderThickness, SHADER_UNIFORM_FLOAT); +} diff --git a/examples/shaders/shaders_rounded_rectangle.png b/examples/shaders/shaders_rounded_rectangle.png new file mode 100644 index 000000000..0d8c2b5f4 Binary files /dev/null and b/examples/shaders/shaders_rounded_rectangle.png differ diff --git a/examples/shaders/shaders_shadowmap.c b/examples/shaders/shaders_shadowmap.c index 96c42d12f..4910b0908 100644 --- a/examples/shaders/shaders_shadowmap.c +++ b/examples/shaders/shaders_shadowmap.c @@ -2,13 +2,17 @@ * * raylib [shaders] example - Shadowmap * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 5.0, last time updated with raylib 5.0 * -* Example contributed by @TheManTheMythTheGameDev and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by TheManTheMythTheGameDev (@TheManTheMythTheGameDev) 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 TheManTheMythTheGameDev (@TheManTheMythTheGameDev) +* ********************************************************************************************/ #include "raylib.h" diff --git a/examples/shaders/shaders_shapes_textures.c b/examples/shaders/shaders_shapes_textures.c index 65ccef659..107b09c03 100644 --- a/examples/shaders/shaders_shapes_textures.c +++ b/examples/shaders/shaders_shapes_textures.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Apply a shader to some shape or texture * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -14,7 +16,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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_simple_mask.c b/examples/shaders/shaders_simple_mask.c index 11e0ac2e7..f12230373 100644 --- a/examples/shaders/shaders_simple_mask.c +++ b/examples/shaders/shaders_simple_mask.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Simple shader mask * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 3.7 * * Example contributed by Chris Camacho (@chriscamacho) 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-2024 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) * ******************************************************************************************** * diff --git a/examples/shaders/shaders_spotlight.c b/examples/shaders/shaders_spotlight.c index 2752a2db4..288292cb6 100644 --- a/examples/shaders/shaders_spotlight.c +++ b/examples/shaders/shaders_spotlight.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Simple shader mask * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 3.7 * * Example contributed by Chris Camacho (@chriscamacho) 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-2024 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) * ******************************************************************************************** * diff --git a/examples/shaders/shaders_texture_drawing.c b/examples/shaders/shaders_texture_drawing.c index ada44299d..2cfe7e64d 100644 --- a/examples/shaders/shaders_texture_drawing.c +++ b/examples/shaders/shaders_texture_drawing.c @@ -1,17 +1,19 @@ /******************************************************************************************* * -* raylib [textures] example - Texture drawing +* raylib [shaders] example - Texture drawing +* +* Example complexity rating: [★★☆☆] 2/4 * * NOTE: This example illustrates how to draw into a blank texture using a shader * * Example originally created with raylib 2.0, last time updated with raylib 3.7 * -* Example contributed by Michał Ciesielski and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by Michał Ciesielski (@ciessielski) 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-2024 Michał Ciesielski and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Michał Ciesielski (@ciessielski) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_texture_outline.c b/examples/shaders/shaders_texture_outline.c index f90e41769..b2172aef9 100644 --- a/examples/shaders/shaders_texture_outline.c +++ b/examples/shaders/shaders_texture_outline.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Apply an shdrOutline to a texture * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -12,7 +14,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-2024 Samuel SKiff (@GoldenThumbs) and Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Samuel SKiff (@GoldenThumbs) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_texture_tiling.c b/examples/shaders/shaders_texture_tiling.c index 0d07bdff9..d811e30ec 100644 --- a/examples/shaders/shaders_texture_tiling.c +++ b/examples/shaders/shaders_texture_tiling.c @@ -2,14 +2,18 @@ * * raylib [shaders] example - texture tiling * +* Example complexity rating: [★★☆☆] 2/4 +* * Example demonstrates how to tile a texture on a 3D model using raylib. * +* Example originally created with raylib 4.5, last time updated with raylib 4.5 +* * Example contributed by Luis Almeida (@luis605) 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 Luis Almeida (@luis605) +* Copyright (c) 2023-2025 Luis Almeida (@luis605) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_texture_waves.c b/examples/shaders/shaders_texture_waves.c index 205fc636e..73ba738c6 100644 --- a/examples/shaders/shaders_texture_waves.c +++ b/examples/shaders/shaders_texture_waves.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Texture Waves * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. * @@ -16,7 +18,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-2024 Anata (@anatagawa) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Anata (@anatagawa) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_vertex_displacement.c b/examples/shaders/shaders_vertex_displacement.c index 207a237d0..8008bc004 100644 --- a/examples/shaders/shaders_vertex_displacement.c +++ b/examples/shaders/shaders_vertex_displacement.c @@ -2,14 +2,16 @@ * * raylib [shaders] example - Vertex displacement * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 5.0, last time updated with raylib 4.5 * -* Example contributed by (@ZzzhHe) and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by Alex ZH (@ZzzhHe) 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 (@ZzzhHe) +* Copyright (c) 2023-2025 Alex ZH (@ZzzhHe) * ********************************************************************************************/ diff --git a/examples/shaders/shaders_write_depth.c b/examples/shaders/shaders_write_depth.c index 531a7bfa6..d47ea1ae3 100644 --- a/examples/shaders/shaders_write_depth.c +++ b/examples/shaders/shaders_write_depth.c @@ -2,6 +2,8 @@ * * raylib [shaders] example - Depth buffer writing * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 4.2, last time updated with raylib 4.2 * * Example contributed by Buğra Alptekin Sarı (@BugraAlptekinSari) 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) 2022-2024 Buğra Alptekin Sarı (@BugraAlptekinSari) +* Copyright (c) 2022-2025 Buğra Alptekin Sarı (@BugraAlptekinSari) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_basic_shapes.c b/examples/shapes/shapes_basic_shapes.c index 9c0fff7d0..bd1688453 100644 --- a/examples/shapes/shapes_basic_shapes.c +++ b/examples/shapes/shapes_basic_shapes.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - Draw basic shapes 2d (rectangle, circle, line...) * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.0, 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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_bouncing_ball.c b/examples/shapes/shapes_bouncing_ball.c index df0c37c1c..187cd41af 100644 --- a/examples/shapes/shapes_bouncing_ball.c +++ b/examples/shapes/shapes_bouncing_ball.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - bouncing ball * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.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) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_collision_area.c b/examples/shapes/shapes_collision_area.c index c2e2c1e1d..f492cf250 100644 --- a/examples/shapes/shapes_collision_area.c +++ b/examples/shapes/shapes_collision_area.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - collision area * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.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) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_colors_palette.c b/examples/shapes/shapes_colors_palette.c index 60a6dd6a2..81d008ff0 100644 --- a/examples/shapes/shapes_colors_palette.c +++ b/examples/shapes/shapes_colors_palette.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - Colors palette * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.0, last time updated with raylib 2.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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_draw_circle_sector.c b/examples/shapes/shapes_draw_circle_sector.c index cb9ab859b..e64055c81 100644 --- a/examples/shapes/shapes_draw_circle_sector.c +++ b/examples/shapes/shapes_draw_circle_sector.c @@ -2,6 +2,8 @@ * * raylib [shapes] example - draw circle sector (with gui options) * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.5 * * Example contributed by Vlad Adrian (@demizdor) 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) 2018-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_draw_rectangle_rounded.c b/examples/shapes/shapes_draw_rectangle_rounded.c index 58991884c..ed7e032d1 100644 --- a/examples/shapes/shapes_draw_rectangle_rounded.c +++ b/examples/shapes/shapes_draw_rectangle_rounded.c @@ -2,6 +2,8 @@ * * raylib [shapes] example - draw rectangle rounded (with gui options) * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.5 * * Example contributed by Vlad Adrian (@demizdor) 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) 2018-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_draw_ring.c b/examples/shapes/shapes_draw_ring.c index 8bccdf729..daee5cbf5 100644 --- a/examples/shapes/shapes_draw_ring.c +++ b/examples/shapes/shapes_draw_ring.c @@ -2,6 +2,8 @@ * * raylib [shapes] example - draw ring (with gui options) * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.5 * * Example contributed by Vlad Adrian (@demizdor) 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) 2018-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_easings_ball_anim.c b/examples/shapes/shapes_easings_ball_anim.c index d54f24a1d..d7f0bb72e 100644 --- a/examples/shapes/shapes_easings_ball_anim.c +++ b/examples/shapes/shapes_easings_ball_anim.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - easings ball anim * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_easings_box_anim.c b/examples/shapes/shapes_easings_box_anim.c index c82beac05..4a76e7ef3 100644 --- a/examples/shapes/shapes_easings_box_anim.c +++ b/examples/shapes/shapes_easings_box_anim.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - easings box anim * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_easings_rectangle_array.c b/examples/shapes/shapes_easings_rectangle_array.c index ed13e93c1..912926ea4 100644 --- a/examples/shapes/shapes_easings_rectangle_array.c +++ b/examples/shapes/shapes_easings_rectangle_array.c @@ -2,6 +2,8 @@ * * raylib [shapes] example - easings rectangle array * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: This example requires 'easings.h' library, provided on raylib/src. Just copy * the library to same directory as example or make sure it's available on include path. * @@ -10,7 +12,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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_following_eyes.c b/examples/shapes/shapes_following_eyes.c index 7e428f2c3..b5b3fd7c8 100644 --- a/examples/shapes/shapes_following_eyes.c +++ b/examples/shapes/shapes_following_eyes.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - following eyes * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.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) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_lines_bezier.c b/examples/shapes/shapes_lines_bezier.c index 1293e16e4..f963cd4de 100644 --- a/examples/shapes/shapes_lines_bezier.c +++ b/examples/shapes/shapes_lines_bezier.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - Cubic-bezier lines * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.7, last time updated with raylib 1.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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_logo_raylib.c b/examples/shapes/shapes_logo_raylib.c index f637df2c9..d26db5ce6 100644 --- a/examples/shapes/shapes_logo_raylib.c +++ b/examples/shapes/shapes_logo_raylib.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - Draw raylib logo using basic shapes * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_logo_raylib_anim.c b/examples/shapes/shapes_logo_raylib_anim.c index ace9c8d02..81c1e6d3f 100644 --- a/examples/shapes/shapes_logo_raylib_anim.c +++ b/examples/shapes/shapes_logo_raylib_anim.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - raylib logo animation * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, 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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c index 6dd7d2e7e..0c20c9e8b 100644 --- a/examples/shapes/shapes_rectangle_advanced.c +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -2,12 +2,16 @@ * * raylib [shapes] example - Rectangle advanced * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 5.5, last time updated with raylib 5.5 * +* Example contributed by Everton Jr. (@evertonse) 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) 2024-2025 raylib contributors and Ramon Santamaria (@raysan5) +* Copyright (c) 2024-2025 Everton Jr. (@evertonse) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_rectangle_scaling.c b/examples/shapes/shapes_rectangle_scaling.c index dcafab9da..b5c778317 100644 --- a/examples/shapes/shapes_rectangle_scaling.c +++ b/examples/shapes/shapes_rectangle_scaling.c @@ -2,6 +2,8 @@ * * raylib [shapes] example - rectangle scaling by mouse * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.5 * * Example contributed by Vlad Adrian (@demizdor) 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) 2018-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_splines_drawing.c b/examples/shapes/shapes_splines_drawing.c index 536b558e1..065050e8e 100644 --- a/examples/shapes/shapes_splines_drawing.c +++ b/examples/shapes/shapes_splines_drawing.c @@ -2,12 +2,14 @@ * * raylib [shapes] example - splines drawing * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 5.0, 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) 2023 Ramon Santamaria (@raysan5) +* Copyright (c) 2023-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/shapes/shapes_top_down_lights.c b/examples/shapes/shapes_top_down_lights.c index abe845f8c..7e2640117 100644 --- a/examples/shapes/shapes_top_down_lights.c +++ b/examples/shapes/shapes_top_down_lights.c @@ -2,14 +2,16 @@ * * raylib [shapes] example - top down lights * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 4.2, last time updated with raylib 4.2 * -* Example contributed by Vlad Adrian (@demizdor) and reviewed by Ramon Santamaria (@raysan5) +* 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-2024 Jeffery Myers (@JeffM2501) +* Copyright (c) 2022-2025 Jeffery Myers (@JeffM2501) * ********************************************************************************************/ diff --git a/examples/text/text_codepoints_loading.c b/examples/text/text_codepoints_loading.c index 95a81dfc3..a4cd5ca79 100644 --- a/examples/text/text_codepoints_loading.c +++ b/examples/text/text_codepoints_loading.c @@ -2,12 +2,14 @@ * * raylib [text] example - Codepoints loading * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 4.2, last time updated with raylib 2.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) 2022-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2022-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index 8d23b0450..21be7dc62 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -2,6 +2,8 @@ * * raylib [text] example - Draw 3d * +* Example complexity rating: [★★★★] 4/4 +* * NOTE: Draw a 2D text in 3D space, each letter is drawn in a quad (or 2 quads if backface is set) * where the texture coodinates of each quad map to the texture coordinates of the glyphs * inside the font texture. @@ -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-2024 Vlad Adrian (@demizdor) +* Copyright (c) 2021-2025 Vlad Adrian (@demizdor) * ********************************************************************************************/ diff --git a/examples/text/text_font_filters.c b/examples/text/text_font_filters.c index b12f26055..f3293e6be 100644 --- a/examples/text/text_font_filters.c +++ b/examples/text/text_font_filters.c @@ -2,6 +2,8 @@ * * raylib [text] example - Font filters * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: After font loading, font texture atlas filter could be configured for a softer * display of the font when scaling it to different sizes, that way, it's not required * to generate multiple fonts at multiple sizes (as long as the scaling is not very different) @@ -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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_font_loading.c b/examples/text/text_font_loading.c index 6b98a4e8a..a7f8c60f4 100644 --- a/examples/text/text_font_loading.c +++ b/examples/text/text_font_loading.c @@ -2,6 +2,8 @@ * * raylib [text] example - Font loading * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: raylib can load fonts from multiple input file formats: * * - TTF/OTF > Sprite font atlas is generated on loading, user can configure @@ -16,7 +18,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) 2016-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_font_sdf.c b/examples/text/text_font_sdf.c index 95245741e..7a051710b 100644 --- a/examples/text/text_font_sdf.c +++ b/examples/text/text_font_sdf.c @@ -2,12 +2,14 @@ * * raylib [text] example - Font SDF loading * +* Example complexity rating: [★★★☆] 3/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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_font_spritefont.c b/examples/text/text_font_spritefont.c index 1b2695c71..95b5cfee5 100644 --- a/examples/text/text_font_spritefont.c +++ b/examples/text/text_font_spritefont.c @@ -2,6 +2,8 @@ * * raylib [text] example - Sprite font loading * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: Sprite fonts should be generated following this conventions: * * - Characters must be ordered starting with character 32 (Space) @@ -17,7 +19,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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_format_text.c b/examples/text/text_format_text.c index 0f53f35dc..eca6500e3 100644 --- a/examples/text/text_format_text.c +++ b/examples/text/text_format_text.c @@ -2,12 +2,14 @@ * * raylib [text] example - Text formatting * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 1.1, 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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index c53057711..24672b2ad 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -2,12 +2,14 @@ * * raylib [text] example - Input Box * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.7, 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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_raylib_fonts.c b/examples/text/text_raylib_fonts.c index acd18d94c..7248be128 100644 --- a/examples/text/text_raylib_fonts.c +++ b/examples/text/text_raylib_fonts.c @@ -2,6 +2,8 @@ * * raylib [text] example - raylib fonts loading * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: raylib is distributed with some free to use fonts (even for commercial pourposes!) * To view details and credits for those fonts, check raylib license file * @@ -10,7 +12,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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c index 173d3f93d..c9dad5f9e 100644 --- a/examples/text/text_rectangle_bounds.c +++ b/examples/text/text_rectangle_bounds.c @@ -2,6 +2,8 @@ * * raylib [text] example - Rectangle bounds * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 2.5, last time updated with raylib 4.0 * * Example contributed by Vlad Adrian (@demizdor) 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) 2018-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_unicode.c b/examples/text/text_unicode.c index 2b5245be9..31faafade 100644 --- a/examples/text/text_unicode.c +++ b/examples/text/text_unicode.c @@ -2,6 +2,8 @@ * * raylib [text] example - Unicode * +* Example complexity rating: [★★★★] 4/4 +* * Example originally created with raylib 2.5, last time updated with raylib 4.0 * * Example contributed by Vlad Adrian (@demizdor) 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-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/text/text_writing_anim.c b/examples/text/text_writing_anim.c index 8e2820fc9..3455cec33 100644 --- a/examples/text/text_writing_anim.c +++ b/examples/text/text_writing_anim.c @@ -2,12 +2,14 @@ * * raylib [text] example - Text Writing Animation * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.4, last time updated with raylib 1.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) 2016-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_background_scrolling.c b/examples/textures/textures_background_scrolling.c index 0df159cae..48ba314d4 100644 --- a/examples/textures/textures_background_scrolling.c +++ b/examples/textures/textures_background_scrolling.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Background scrolling * +* Example complexity rating: [★☆☆☆] 1/4 +* * Example originally created with raylib 2.0, last time updated with raylib 2.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) 2019-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_blend_modes.c b/examples/textures/textures_blend_modes.c index d97432cb2..555cdd7b5 100644 --- a/examples/textures/textures_blend_modes.c +++ b/examples/textures/textures_blend_modes.c @@ -2,6 +2,8 @@ * * raylib [textures] example - blend modes * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 3.5, last time updated with raylib 3.5 @@ -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) 2020-2024 Karlo Licudine (@accidentalrebel) +* Copyright (c) 2020-2025 Karlo Licudine (@accidentalrebel) * ********************************************************************************************/ diff --git a/examples/textures/textures_bunnymark.c b/examples/textures/textures_bunnymark.c index f3ef694a2..6f58e8281 100644 --- a/examples/textures/textures_bunnymark.c +++ b/examples/textures/textures_bunnymark.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Bunnymark * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 1.6, last time updated with raylib 2.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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_draw_tiled.c b/examples/textures/textures_draw_tiled.c index 699836555..801a7c15a 100644 --- a/examples/textures/textures_draw_tiled.c +++ b/examples/textures/textures_draw_tiled.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Draw part of the texture tiled * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 3.0, last time updated with raylib 4.2 * * Example contributed by Vlad Adrian (@demizdor) 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) 2020-2024 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) +* Copyright (c) 2020-2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_fog_of_war.c b/examples/textures/textures_fog_of_war.c index 2f72c0d6d..e9296f3f4 100644 --- a/examples/textures/textures_fog_of_war.c +++ b/examples/textures/textures_fog_of_war.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Fog of war * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 4.2, 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) 2018-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_gif_player.c b/examples/textures/textures_gif_player.c index cf8492e0d..f62205b63 100644 --- a/examples/textures/textures_gif_player.c +++ b/examples/textures/textures_gif_player.c @@ -2,12 +2,14 @@ * * raylib [textures] example - gif playing * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 4.2, 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) 2021-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_channel.c b/examples/textures/textures_image_channel.c index 9afcda638..cebe61651 100644 --- a/examples/textures/textures_image_channel.c +++ b/examples/textures/textures_image_channel.c @@ -4,14 +4,16 @@ * * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 5.1-dev, last time updated with raylib 5.1-dev * -* Example contributed by Bruno Cabral (github.com/brccabral) and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by Bruno Cabral (@brccabral) 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) 2024-2024 Bruno Cabral (github.com/brccabral) and Ramon Santamaria (@raysan5) +* Copyright (c) 2024-2025 Bruno Cabral (@brccabral) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_drawing.c b/examples/textures/textures_image_drawing.c index d0eee999d..05f40df9b 100644 --- a/examples/textures/textures_image_drawing.c +++ b/examples/textures/textures_image_drawing.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Image loading and drawing on it * +* Example complexity rating: [★★☆☆] 2/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 1.4, last time updated with raylib 1.4 @@ -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) 2016-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_generation.c b/examples/textures/textures_image_generation.c index 47f9a9eb0..2372af9c3 100644 --- a/examples/textures/textures_image_generation.c +++ b/examples/textures/textures_image_generation.c @@ -2,12 +2,16 @@ * * raylib [textures] example - Procedural images generation * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 1.8, last time updated with raylib 1.8 * +* Example contributed by Wilhem Barbier (@nounoursheureux) 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) 2O17-2024 Wilhem Barbier (@nounoursheureux) and Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Wilhem Barbier (@nounoursheureux) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_kernel.c b/examples/textures/textures_image_kernel.c index b850b63ed..456cd1c18 100644 --- a/examples/textures/textures_image_kernel.c +++ b/examples/textures/textures_image_kernel.c @@ -2,14 +2,18 @@ * * raylib [textures] example - Image loading and texture creation * +* Example complexity rating: [★★★★] 4/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * +* Example contributed by Karim Salem (@kimo-s) and reviewed by Ramon Santamaria (@raysan5) +* * 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-2024 Karim Salem (@kimo-s) +* Copyright (c) 2015-2025 Karim Salem (@kimo-s) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_loading.c b/examples/textures/textures_image_loading.c index 95175e079..267216332 100644 --- a/examples/textures/textures_image_loading.c +++ b/examples/textures/textures_image_loading.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Image loading and texture creation * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 1.3, last time updated with raylib 1.3 @@ -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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c index 269273546..8531d1dba 100644 --- a/examples/textures/textures_image_processing.c +++ b/examples/textures/textures_image_processing.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Image processing * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 1.4, last time updated with raylib 3.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) 2016-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_rotate.c b/examples/textures/textures_image_rotate.c index 94c42034b..4921dc8ac 100644 --- a/examples/textures/textures_image_rotate.c +++ b/examples/textures/textures_image_rotate.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Image Rotation * +* Example complexity rating: [★★☆☆] 2/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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c index 856b64ed0..a0a41404a 100644 --- a/examples/textures/textures_image_text.c +++ b/examples/textures/textures_image_text.c @@ -1,13 +1,15 @@ /******************************************************************************************* * -* raylib [texture] example - Image text drawing using TTF generated font +* raylib [textures] example - Image text drawing using TTF generated font +* +* Example complexity rating: [★★☆☆] 2/4 * * Example originally created with raylib 1.8, 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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_logo_raylib.c b/examples/textures/textures_logo_raylib.c index 35baa1223..bd402baec 100644 --- a/examples/textures/textures_logo_raylib.c +++ b/examples/textures/textures_logo_raylib.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Texture loading and drawing * +* 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_mouse_painting.c b/examples/textures/textures_mouse_painting.c index 27bbc74e9..c0e426232 100644 --- a/examples/textures/textures_mouse_painting.c +++ b/examples/textures/textures_mouse_painting.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Mouse painting * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 3.0, last time updated with raylib 3.0 * * Example contributed by Chris Dill (@MysteriousSpace) 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-2024 Chris Dill (@MysteriousSpace) and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Chris Dill (@MysteriousSpace) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_npatch_drawing.c b/examples/textures/textures_npatch_drawing.c index 5fb39996b..005fc845e 100644 --- a/examples/textures/textures_npatch_drawing.c +++ b/examples/textures/textures_npatch_drawing.c @@ -2,6 +2,8 @@ * * raylib [textures] example - N-patch drawing * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 2.0, last time updated with raylib 2.5 @@ -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) 2018-2024 Jorge A. Gomes (@overdev) and Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Jorge A. Gomes (@overdev) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_particles_blending.c b/examples/textures/textures_particles_blending.c index 113b2b068..65a55f30a 100644 --- a/examples/textures/textures_particles_blending.c +++ b/examples/textures/textures_particles_blending.c @@ -1,13 +1,15 @@ /******************************************************************************************* * -* raylib example - particles blending +* raylib [textures] example - particles blending +* +* Example complexity rating: [★☆☆☆] 1/4 * * Example originally created with raylib 1.7, 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) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_polygon.c b/examples/textures/textures_polygon.c index 2491e1bc2..759f2b420 100644 --- a/examples/textures/textures_polygon.c +++ b/examples/textures/textures_polygon.c @@ -1,15 +1,17 @@ /******************************************************************************************* * -* raylib [shapes] example - Draw Textured Polygon +* raylib [textures] example - Draw Textured Polygon +* +* Example complexity rating: [★☆☆☆] 1/4 * * Example originally created with raylib 3.7, last time updated with raylib 3.7 * -* Example contributed by Chris Camacho (@codifies) and reviewed by Ramon Santamaria (@raysan5) +* Example contributed by Chris Camacho (@chriscamacho) 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) 2021-2024 Chris Camacho (@codifies) and Ramon Santamaria (@raysan5) +* Copyright (c) 2021-2025 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_raw_data.c b/examples/textures/textures_raw_data.c index 6fb41b143..01248e979 100644 --- a/examples/textures/textures_raw_data.c +++ b/examples/textures/textures_raw_data.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Load textures from raw data * +* Example complexity rating: [★★★☆] 3/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 1.3, last time updated with raylib 3.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) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_sprite_anim.c b/examples/textures/textures_sprite_anim.c index deb68216a..c8b401522 100644 --- a/examples/textures/textures_sprite_anim.c +++ b/examples/textures/textures_sprite_anim.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Sprite animation * +* 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) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_sprite_button.c b/examples/textures/textures_sprite_button.c index 5d0153b57..a7db93c4f 100644 --- a/examples/textures/textures_sprite_button.c +++ b/examples/textures/textures_sprite_button.c @@ -2,12 +2,14 @@ * * raylib [textures] example - sprite button * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.5, last time updated with raylib 2.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) 2019-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_sprite_explosion.c b/examples/textures/textures_sprite_explosion.c index a65426cb6..fe9669224 100644 --- a/examples/textures/textures_sprite_explosion.c +++ b/examples/textures/textures_sprite_explosion.c @@ -2,12 +2,14 @@ * * raylib [textures] example - sprite explosion * +* Example complexity rating: [★★☆☆] 2/4 +* * Example originally created with raylib 2.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) 2019-2024 Anata and Ramon Santamaria (@raysan5) +* Copyright (c) 2019-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_srcrec_dstrec.c b/examples/textures/textures_srcrec_dstrec.c index 035e30371..cf3686d15 100644 --- a/examples/textures/textures_srcrec_dstrec.c +++ b/examples/textures/textures_srcrec_dstrec.c @@ -2,12 +2,14 @@ * * raylib [textures] example - Texture source and destination rectangles * +* Example complexity rating: [★★★☆] 3/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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_textured_curve.c b/examples/textures/textures_textured_curve.c index 6e4c53cff..00417b038 100644 --- a/examples/textures/textures_textured_curve.c +++ b/examples/textures/textures_textured_curve.c @@ -2,14 +2,16 @@ * * raylib [textures] example - Draw a texture along a segmented curve * +* Example complexity rating: [★★★☆] 3/4 +* * Example originally created with raylib 4.5, last time updated with raylib 4.5 * -* Example contributed by Jeffery Myers and reviewed by Ramon Santamaria (@raysan5) +* 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-2024 Jeffery Myers and Ramon Santamaria (@raysan5) +* Copyright (c) 2022-2025 Jeffery Myers (@JeffM2501) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/textures/textures_to_image.c b/examples/textures/textures_to_image.c index e1d88c4cd..84b4a72be 100644 --- a/examples/textures/textures_to_image.c +++ b/examples/textures/textures_to_image.c @@ -2,6 +2,8 @@ * * raylib [textures] example - Retrieve image data from texture: LoadImageFromTexture() * +* Example complexity rating: [★☆☆☆] 1/4 +* * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * * Example originally created with raylib 1.3, last time updated with raylib 4.0 @@ -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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 0044de007..9fd9bcef0 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3899,7 +3899,7 @@ }, { "name": "SetShaderValueTexture", - "description": "Set shader uniform value for texture (sampler2d)", + "description": "Set shader uniform value and bind the texture (sampler2d)", "returnType": "void", "params": [ { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index ccf61cb0b..59eb4b0fc 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3674,7 +3674,7 @@ return { }, { name = "SetShaderValueTexture", - description = "Set shader uniform value for texture (sampler2d)", + description = "Set shader uniform value and bind the texture (sampler2d)", returnType = "void", params = { {type = "Shader", name = "shader"}, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 896efbaff..f0fb4eab4 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1431,7 +1431,7 @@ Function 082: SetShaderValueMatrix() (3 input parameters) Function 083: SetShaderValueTexture() (3 input parameters) Name: SetShaderValueTexture Return type: void - Description: Set shader uniform value for texture (sampler2d) + Description: Set shader uniform value and bind the texture (sampler2d) Param[1]: shader (type: Shader) Param[2]: locIndex (type: int) Param[3]: texture (type: Texture2D) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 241b28ae8..21e9d30e6 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -906,7 +906,7 @@ - + diff --git a/projects/VS2022/examples/shaders_rounded_rectangle.vcxproj b/projects/VS2022/examples/shaders_rounded_rectangle.vcxproj new file mode 100644 index 000000000..fd6c9fcc5 --- /dev/null +++ b/projects/VS2022/examples/shaders_rounded_rectangle.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4} + Win32Proj + shaders_rounded_rectangle + 10.0 + shaders_rounded_rectangle + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index f4f0600e1..8f3323bc8 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -307,6 +307,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_bone_socket", "examp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_vertex_displacement", "examples\shaders_vertex_displacement.vcxproj", "{CCA63A76-D9FC-4130-9F67-4D97F9770D53}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_rounded_rectangle", "examples\shaders_rounded_rectangle.vcxproj", "{D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.DLL|x64 = Debug.DLL|x64 @@ -2615,6 +2617,22 @@ Global {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x64.Build.0 = Release|x64 {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x86.ActiveCfg = Release|Win32 {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x86.Build.0 = Release|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug|x64.ActiveCfg = Debug|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug|x64.Build.0 = Debug|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug|x86.ActiveCfg = Debug|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Debug|x86.Build.0 = Debug|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release|x64.ActiveCfg = Release|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release|x64.Build.0 = Release|x64 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release|x86.ActiveCfg = Release|Win32 + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2771,6 +2789,7 @@ Global {0981CA28-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} {3A7FE53D-35F7-49DC-9C9A-A5204A53523F} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} {CCA63A76-D9FC-4130-9F67-4D97F9770D53} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {D3493FFE-8873-4C53-8F6C-74DEF78EA3C4} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} diff --git a/src/Makefile b/src/Makefile index a626db52e..1b7562da4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -384,7 +384,7 @@ ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_R # --source-map-base # allow debugging in browser with source map # --shell-file shell.html # define a custom shell .html and output extension ifeq ($(RAYLIB_BUILD_MODE),DEBUG) - CFLAGS += -sASSERTIONS=1 --profiling + CFLAGS += --profiling endif endif ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) @@ -533,6 +533,11 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) LDFLAGS += -L$(SDL_LIBRARY_PATH) endif +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) + ifeq ($(RAYLIB_BUILD_MODE),DEBUG) + LDFLAGS += -sASSERTIONS=1 + endif +endif ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) ifeq ($(USE_RPI_CROSSCOMPILER), TRUE) @@ -665,6 +670,9 @@ raylib: $(OBJS) ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # Compile raylib libray for web #$(CC) $(OBJS) -r -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc + ifeq ($(RAYLIB_LIBTYPE),SHARED) + @echo "WARNING: $(TARGET_PLATFORM) does not support SHARED libraries. Generating STATIC library." + endif $(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).web.a $(OBJS) @echo "raylib library generated (lib$(RAYLIB_LIB_NAME).web.a)!" else @@ -734,7 +742,7 @@ rcore.o : rcore.c raylib.h rlgl.h utils.h raymath.h rcamera.h rgestures.h # Compile rglfw module rglfw.o : rglfw.c - $(CC) $(GLFW_OSX) -c $< $(CFLAGS) $(INCLUDE_PATHS) + $(CC) $(GLFW_OSX) -c $< $(CFLAGS) $(INCLUDE_PATHS) -U_GNU_SOURCE # Compile shapes module rshapes.o : rshapes.c raylib.h rlgl.h @@ -823,7 +831,7 @@ ifeq ($(ROOT),root) @echo "This function currently works on GNU/Linux systems. Add yours today (^;" endif else - @echo "Error: Root permissions needed for installation. Try sudo make install" + @echo "ERROR: Root permissions needed for installation. Try sudo make install" && exit 1 endif # Remove raylib dev files installed on the system @@ -850,7 +858,7 @@ ifeq ($(ROOT),root) @echo "This function currently works on GNU/Linux systems. Add yours today (^;" endif else - @echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall" + @echo "ERROR: Root permissions needed for uninstallation. Try sudo make uninstall" && exit 1 endif .PHONY: clean_shell_cmd clean_shell_sh diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index dba821ddd..279f8c193 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1238,8 +1238,18 @@ void PollInputEvents(void) } // Register buttons for 2nd triggers (because GLFW doesn't count these as buttons but rather axis) - CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1f); - CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1f); + if (CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1f) + { + CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = 1; + CORE.Input.Gamepad.lastButtonPressed = GAMEPAD_BUTTON_LEFT_TRIGGER_2; + } + else CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = 0; + if (CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1f) + { + CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = 1; + CORE.Input.Gamepad.lastButtonPressed = GAMEPAD_BUTTON_RIGHT_TRIGGER_2; + } + else CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = 0; CORE.Input.Gamepad.axisCount[i] = GLFW_GAMEPAD_AXIS_LAST + 1; } @@ -1652,7 +1662,7 @@ int InitPlatform(void) // Retrieve gamepad names for (int i = 0; i < MAX_GAMEPADS; i++) { - if (glfwJoystickPresent(i)) strcpy(CORE.Input.Gamepad.name[i], glfwGetJoystickName(i)); + if (glfwJoystickPresent(i)) strncpy(CORE.Input.Gamepad.name[i], glfwGetJoystickName(i), MAX_GAMEPAD_NAME_LENGTH - 1); } //---------------------------------------------------------------------------- @@ -1915,11 +1925,11 @@ static void JoystickCallback(int jid, int event) { if (event == GLFW_CONNECTED) { - strcpy(CORE.Input.Gamepad.name[jid], glfwGetJoystickName(jid)); + strncpy(CORE.Input.Gamepad.name[jid], glfwGetJoystickName(jid), MAX_GAMEPAD_NAME_LENGTH - 1); } else if (event == GLFW_DISCONNECTED) { - memset(CORE.Input.Gamepad.name[jid], 0, 64); + memset(CORE.Input.Gamepad.name[jid], 0, MAX_GAMEPAD_NAME_LENGTH); } } diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 4b3327ee1..f248e2614 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -82,6 +82,7 @@ typedef struct { SDL_GLContext glContext; SDL_GameController *gamepad[MAX_GAMEPADS]; + SDL_JoystickID gamepadId[MAX_GAMEPADS]; // Joystick instance ids SDL_Cursor *cursor; bool cursorRelative; } PlatformData; @@ -1658,11 +1659,12 @@ void PollInputEvents(void) // Check gamepad events case SDL_JOYDEVICEADDED: { - int jid = event.jdevice.which; + int jid = event.jdevice.which; // Joystick device index if (!CORE.Input.Gamepad.ready[jid] && (jid < MAX_GAMEPADS)) { platform.gamepad[jid] = SDL_GameControllerOpen(jid); + platform.gamepadId[jid] = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[jid])); if (platform.gamepad[jid]) { @@ -1670,8 +1672,8 @@ void PollInputEvents(void) CORE.Input.Gamepad.axisCount[jid] = SDL_JoystickNumAxes(SDL_GameControllerGetJoystick(platform.gamepad[jid])); CORE.Input.Gamepad.axisState[jid][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; CORE.Input.Gamepad.axisState[jid][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; - strncpy(CORE.Input.Gamepad.name[jid], SDL_GameControllerNameForIndex(jid), 63); - CORE.Input.Gamepad.name[jid][63] = '\0'; + strncpy(CORE.Input.Gamepad.name[jid], SDL_GameControllerNameForIndex(jid), MAX_GAMEPAD_NAME_LENGTH - 1); + CORE.Input.Gamepad.name[jid][MAX_GAMEPAD_NAME_LENGTH - 1] = '\0'; } else { @@ -1681,14 +1683,18 @@ void PollInputEvents(void) } break; case SDL_JOYDEVICEREMOVED: { - int jid = event.jdevice.which; + int jid = event.jdevice.which; // Joystick instance id - if (jid == SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[jid]))) + for (int i = 0; i < MAX_GAMEPADS; i++) { - SDL_GameControllerClose(platform.gamepad[jid]); - platform.gamepad[jid] = SDL_GameControllerOpen(0); - CORE.Input.Gamepad.ready[jid] = false; - memset(CORE.Input.Gamepad.name[jid], 0, 64); + if (platform.gamepadId[i] == jid) + { + SDL_GameControllerClose(platform.gamepad[i]); + CORE.Input.Gamepad.ready[i] = false; + memset(CORE.Input.Gamepad.name[i], 0, MAX_GAMEPAD_NAME_LENGTH); + platform.gamepadId[i] = -1; + break; + } } } break; case SDL_CONTROLLERBUTTONDOWN: @@ -1721,8 +1727,15 @@ void PollInputEvents(void) if (button >= 0) { - CORE.Input.Gamepad.currentButtonState[event.jbutton.which][button] = 1; - CORE.Input.Gamepad.lastButtonPressed = button; + for (int i = 0; i < MAX_GAMEPADS; i++) + { + if (platform.gamepadId[i] == event.jbutton.which) + { + CORE.Input.Gamepad.currentButtonState[i][button] = 1; + CORE.Input.Gamepad.lastButtonPressed = button; + break; + } + } } } break; case SDL_CONTROLLERBUTTONUP: @@ -1755,8 +1768,15 @@ void PollInputEvents(void) if (button >= 0) { - CORE.Input.Gamepad.currentButtonState[event.jbutton.which][button] = 0; - if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + for (int i = 0; i < MAX_GAMEPADS; i++) + { + if (platform.gamepadId[i] == event.jbutton.which) + { + CORE.Input.Gamepad.currentButtonState[i][button] = 0; + if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + break; + } + } } } break; case SDL_CONTROLLERAXISMOTION: @@ -1776,18 +1796,25 @@ void PollInputEvents(void) if (axis >= 0) { - // SDL axis value range is -32768 to 32767, we normalize it to RayLib's -1.0 to 1.0f range - float value = event.jaxis.value/(float)32767; - CORE.Input.Gamepad.axisState[event.jaxis.which][axis] = value; - - // Register button state for triggers in addition to their axes - if ((axis == GAMEPAD_AXIS_LEFT_TRIGGER) || (axis == GAMEPAD_AXIS_RIGHT_TRIGGER)) + for (int i = 0; i < MAX_GAMEPADS; i++) { - int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; - int pressed = (value > 0.1f); - CORE.Input.Gamepad.currentButtonState[event.jaxis.which][button] = pressed; - if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; - else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + if (platform.gamepadId[i] == event.jaxis.which) + { + // SDL axis value range is -32768 to 32767, we normalize it to RayLib's -1.0 to 1.0f range + float value = event.jaxis.value/(float)32767; + CORE.Input.Gamepad.axisState[i][axis] = value; + + // Register button state for triggers in addition to their axes + if ((axis == GAMEPAD_AXIS_LEFT_TRIGGER) || (axis == GAMEPAD_AXIS_RIGHT_TRIGGER)) + { + int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; + int pressed = (value > 0.1f); + CORE.Input.Gamepad.currentButtonState[i][button] = pressed; + if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; + else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + } + break; + } } } } break; @@ -1967,9 +1994,15 @@ int InitPlatform(void) // Initialize input events system //---------------------------------------------------------------------------- // Initialize gamepads + for (int i = 0; i < MAX_GAMEPADS; i++) + { + platform.gamepadId[i] = -1; // Set all gamepad initial instance ids as invalid to not conflict with instance id zero + } + for (int i = 0; (i < SDL_NumJoysticks()) && (i < MAX_GAMEPADS); i++) { platform.gamepad[i] = SDL_GameControllerOpen(i); + platform.gamepadId[i] = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[i])); if (platform.gamepad[i]) { @@ -1977,8 +2010,8 @@ int InitPlatform(void) CORE.Input.Gamepad.axisCount[i] = SDL_JoystickNumAxes(SDL_GameControllerGetJoystick(platform.gamepad[i])); CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; - strncpy(CORE.Input.Gamepad.name[i], SDL_GameControllerNameForIndex(i), 63); - CORE.Input.Gamepad.name[i][63] = '\0'; + strncpy(CORE.Input.Gamepad.name[i], SDL_GameControllerNameForIndex(i), MAX_GAMEPAD_NAME_LENGTH - 1); + CORE.Input.Gamepad.name[i][MAX_GAMEPAD_NAME_LENGTH - 1] = '\0'; } else TRACELOG(LOG_WARNING, "PLATFORM: Unable to open game controller [ERROR: %s]", SDL_GetError()); } diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 78fd46f50..0341bec31 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -142,6 +142,8 @@ static EM_BOOL EmscriptenPointerlockCallback(int eventType, const EmscriptenPoin static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData); static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData); +static const char *GetCanvasId(void); + //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- @@ -152,14 +154,21 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE //---------------------------------------------------------------------------------- // Check if application should close +// This will always return false on a web-build as web builds have no control over this functionality +// Sleep is handled in EndDrawing() for synchronous code bool WindowShouldClose(void) { - // Emterpreter-Async required to run sync code - // https://github.com/emscripten-core/emscripten/wiki/Emterpreter#emterpreter-async-run-synchronous-code - // By default, this function is never called on a web-ready raylib example because we encapsulate - // frame code in a UpdateDrawFrame() function, to allow browser manage execution asynchronously - // but now emscripten allows sync code to be executed in an interpreted way, using emterpreter! - emscripten_sleep(16); + // Emscripten Asyncify is required to run synchronous code in asynchronous JS + // REF: https://emscripten.org/docs/porting/asyncify.html + + // WindowShouldClose() is not called on a web-ready raylib application if using emscripten_set_main_loop() + // and encapsulating one frame execution on a UpdateDrawFrame() function, + // allowing the browser to manage execution asynchronously + + // Optionally we can manage the time we give-control-back-to-browser if required, + // but it seems below line could generate stuttering on some browsers + emscripten_sleep(12); + return false; } @@ -176,8 +185,8 @@ void ToggleFullscreen(void) else if (CORE.Window.flags & FLAG_BORDERLESS_WINDOWED_MODE) enterFullscreen = true; else { - const int canvasWidth = EM_ASM_INT( { return document.getElementById('canvas').width; }, 0); - const int canvasStyleWidth = EM_ASM_INT( { return parseInt(document.getElementById('canvas').style.width); }, 0); + const int canvasWidth = EM_ASM_INT( { return Module.canvas.width; }, 0); + const int canvasStyleWidth = EM_ASM_INT( { return parseInt(Module.canvas.style.width); }, 0); if (canvasStyleWidth > canvasWidth) enterFullscreen = false; else enterFullscreen = true; } @@ -284,7 +293,7 @@ void ToggleBorderlessWindowed(void) else if (CORE.Window.flags & FLAG_FULLSCREEN_MODE) enterBorderless = true; else { - const int canvasWidth = EM_ASM_INT( { return document.getElementById('canvas').width; }, 0); + const int canvasWidth = EM_ASM_INT( { return Module.canvas.width; }, 0); const int screenWidth = EM_ASM_INT( { return screen.width; }, 0); if (screenWidth == canvasWidth) enterBorderless = false; else enterBorderless = true; @@ -370,8 +379,8 @@ void SetWindowState(unsigned int flags) const bool wasFullscreen = EM_ASM_INT( { if (document.fullscreenElement) return 1; }, 0); if (wasFullscreen) { - const int canvasWidth = EM_ASM_INT( { return document.getElementById('canvas').width; }, 0); - const int canvasStyleWidth = EM_ASM_INT( { return parseInt(document.getElementById('canvas').style.width); }, 0); + const int canvasWidth = EM_ASM_INT( { return Module.canvas.width; }, 0); + const int canvasStyleWidth = EM_ASM_INT( { return parseInt(Module.canvas.style.width); }, 0); if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) || canvasStyleWidth > canvasWidth) ToggleBorderlessWindowed(); } else ToggleBorderlessWindowed(); @@ -384,7 +393,7 @@ void SetWindowState(unsigned int flags) const bool wasFullscreen = EM_ASM_INT( { if (document.fullscreenElement) return 1; }, 0); if (wasFullscreen) { - const int canvasWidth = EM_ASM_INT( { return document.getElementById('canvas').width; }, 0); + const int canvasWidth = EM_ASM_INT( { return Module.canvas.width; }, 0); const int screenWidth = EM_ASM_INT( { return screen.width; }, 0); if ((CORE.Window.flags & FLAG_BORDERLESS_WINDOWED_MODE) || screenWidth == canvasWidth ) ToggleFullscreen(); } @@ -503,7 +512,7 @@ void ClearWindowState(unsigned int flags) const bool wasFullscreen = EM_ASM_INT( { if (document.fullscreenElement) return 1; }, 0); if (wasFullscreen) { - const int canvasWidth = EM_ASM_INT( { return document.getElementById('canvas').width; }, 0); + const int canvasWidth = EM_ASM_INT( { return Module.canvas.width; }, 0); const int screenWidth = EM_ASM_INT( { return screen.width; }, 0); if ((CORE.Window.flags & FLAG_BORDERLESS_WINDOWED_MODE) || (screenWidth == canvasWidth)) EM_ASM(document.exitFullscreen();); } @@ -517,8 +526,8 @@ void ClearWindowState(unsigned int flags) const bool wasFullscreen = EM_ASM_INT( { if (document.fullscreenElement) return 1; }, 0); if (wasFullscreen) { - const int canvasWidth = EM_ASM_INT( { return document.getElementById('canvas').width; }, 0); - const int canvasStyleWidth = EM_ASM_INT( { return parseInt(document.getElementById('canvas').style.width); }, 0); + const int canvasWidth = EM_ASM_INT( { return Module.canvas.width; }, 0); + const int canvasStyleWidth = EM_ASM_INT( { return parseInt(Module.canvas.style.width); }, 0); if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) || (canvasStyleWidth > canvasWidth)) EM_ASM(document.exitFullscreen();); } @@ -676,7 +685,7 @@ void SetWindowOpacity(float opacity) { if (opacity >= 1.0f) opacity = 1.0f; else if (opacity <= 0.0f) opacity = 0.0f; - EM_ASM({ document.getElementById('canvas').style.opacity = $0; }, opacity); + EM_ASM({ Module.canvas.style.opacity = $0; }, opacity); } // Set window focused @@ -824,7 +833,7 @@ void ShowCursor(void) { if (CORE.Input.Mouse.cursorHidden) { - EM_ASM( { document.getElementById("canvas").style.cursor = UTF8ToString($0); }, cursorLUT[CORE.Input.Mouse.cursor]); + EM_ASM( { Module.canvas.style.cursor = UTF8ToString($0); }, cursorLUT[CORE.Input.Mouse.cursor]); CORE.Input.Mouse.cursorHidden = false; } @@ -835,7 +844,7 @@ void HideCursor(void) { if (!CORE.Input.Mouse.cursorHidden) { - EM_ASM(document.getElementById('canvas').style.cursor = 'none';); + EM_ASM(Module.canvas.style.cursor = 'none';); CORE.Input.Mouse.cursorHidden = true; } @@ -856,7 +865,7 @@ void EnableCursor(void) void DisableCursor(void) { // TODO: figure out how not to hard code the canvas ID here. - emscripten_request_pointerlock("#canvas", 1); + emscripten_request_pointerlock(GetCanvasId(), 1); // Set cursor position in the middle SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2); @@ -953,7 +962,7 @@ void SetMouseCursor(int cursor) { if (CORE.Input.Mouse.cursor != cursor) { - if (!CORE.Input.Mouse.cursorHidden) EM_ASM( { document.getElementById('canvas').style.cursor = UTF8ToString($0); }, cursorLUT[cursor]); + if (!CORE.Input.Mouse.cursorHidden) EM_ASM( { Module.canvas.style.cursor = UTF8ToString($0); }, cursorLUT[cursor]); CORE.Input.Mouse.cursor = cursor; } @@ -1355,25 +1364,25 @@ int InitPlatform(void) // emscripten_set_keydown_callback("#canvas", NULL, 1, EmscriptenKeyboardCallback); // Support mouse events - emscripten_set_click_callback("#canvas", NULL, 1, EmscriptenMouseCallback); + emscripten_set_click_callback(GetCanvasId(), NULL, 1, EmscriptenMouseCallback); emscripten_set_pointerlockchange_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, 1, EmscriptenPointerlockCallback); // Following the mouse delta when the mouse is locked - emscripten_set_mousemove_callback("#canvas", NULL, 1, EmscriptenMouseMoveCallback); + emscripten_set_mousemove_callback(GetCanvasId(), NULL, 1, EmscriptenMouseMoveCallback); // Support touch events - emscripten_set_touchstart_callback("#canvas", NULL, 1, EmscriptenTouchCallback); - emscripten_set_touchend_callback("#canvas", NULL, 1, EmscriptenTouchCallback); - emscripten_set_touchmove_callback("#canvas", NULL, 1, EmscriptenTouchCallback); - emscripten_set_touchcancel_callback("#canvas", NULL, 1, EmscriptenTouchCallback); + emscripten_set_touchstart_callback(GetCanvasId(), NULL, 1, EmscriptenTouchCallback); + emscripten_set_touchend_callback(GetCanvasId(), NULL, 1, EmscriptenTouchCallback); + emscripten_set_touchmove_callback(GetCanvasId(), NULL, 1, EmscriptenTouchCallback); + emscripten_set_touchcancel_callback(GetCanvasId(), NULL, 1, EmscriptenTouchCallback); // Support gamepad events (not provided by GLFW3 on emscripten) emscripten_set_gamepadconnected_callback(NULL, 1, EmscriptenGamepadCallback); emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenGamepadCallback); // Support focus events - emscripten_set_blur_callback("#canvas", platform.handle, 1, EmscriptenFocusCallback); - emscripten_set_focus_callback("#canvas", platform.handle, 1, EmscriptenFocusCallback); + emscripten_set_blur_callback(GetCanvasId(), platform.handle, 1, EmscriptenFocusCallback); + emscripten_set_focus_callback(GetCanvasId(), platform.handle, 1, EmscriptenFocusCallback); //---------------------------------------------------------------------------- // Initialize timing system @@ -1674,7 +1683,7 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent * if (height < (int)CORE.Window.screenMin.height) height = CORE.Window.screenMin.height; else if ((height > (int)CORE.Window.screenMax.height) && (CORE.Window.screenMax.height > 0)) height = CORE.Window.screenMax.height; - emscripten_set_canvas_element_size("#canvas", width, height); + emscripten_set_canvas_element_size(GetCanvasId(), width, height); SetupViewport(width, height); // Reset viewport and projection matrix for new size @@ -1760,7 +1769,7 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent // NOTE: emscripten_get_canvas_element_size() returns canvas.width and canvas.height but // we are looking for actual CSS size: canvas.style.width and canvas.style.height // EMSCRIPTEN_RESULT res = emscripten_get_canvas_element_size("#canvas", &canvasWidth, &canvasHeight); - emscripten_get_element_css_size("#canvas", &canvasWidth, &canvasHeight); + emscripten_get_element_css_size(GetCanvasId(), &canvasWidth, &canvasHeight); for (int i = 0; (i < CORE.Input.Touch.pointCount) && (i < MAX_TOUCH_POINTS); i++) { @@ -1835,4 +1844,20 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent return 1; // The event was consumed by the callback handler } +// obtaining the canvas id provided by the module configuration +EM_JS(char*, GetCanvasIdJs, (), { + var canvasId = "#" + Module.canvas.id; + var lengthBytes = lengthBytesUTF8(canvasId) + 1; + var stringOnWasmHeap = _malloc(lengthBytes); + stringToUTF8(canvasId, stringOnWasmHeap, lengthBytes); + return stringOnWasmHeap; +}); + +static const char *GetCanvasId(void) +{ + static char *canvasId = NULL; + if (canvasId == NULL) canvasId = GetCanvasIdJs(); + return canvasId; +} + // EOF diff --git a/src/raylib.h b/src/raylib.h index 27a8ab049..b8428e7ac 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1061,7 +1061,7 @@ RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Ge RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) -RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) +RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value and bind the texture (sampler2d) RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions @@ -1502,7 +1502,8 @@ RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) // Text strings management functions (no UTF-8 strings, only byte chars) -// NOTE: Some strings allocate memory internally for returned strings, just be careful! +// WARNING 1: Most of these functions use internal static buffers, it's recommended to store returned data on user-side for re-use +// WARNING 2: Some strings allocate memory internally for the returned strings, those strings must be free by user using MemFree() RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending diff --git a/src/rcore.c b/src/rcore.c index a90a60387..59b1b31c8 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -233,6 +233,9 @@ __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod) #ifndef MAX_GAMEPADS #define MAX_GAMEPADS 4 // Maximum number of gamepads supported #endif +#ifndef MAX_GAMEPAD_NAME_LENGTH + #define MAX_GAMEPAD_NAME_LENGTH 128 // Maximum number of characters of gamepad name (byte size) +#endif #ifndef MAX_GAMEPAD_AXIS #define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad) #endif @@ -352,7 +355,7 @@ typedef struct CoreData { int lastButtonPressed; // Register last gamepad button pressed int axisCount[MAX_GAMEPADS]; // Register number of available gamepad axis bool ready[MAX_GAMEPADS]; // Flag to know if gamepad is ready - char name[MAX_GAMEPADS][64]; // Gamepad name holder + char name[MAX_GAMEPADS][MAX_GAMEPAD_NAME_LENGTH]; // Gamepad name holder char currentButtonState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state char previousButtonState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state float axisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state diff --git a/src/rlgl.h b/src/rlgl.h index 574b860b0..245fd059d 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -684,9 +684,10 @@ RLAPI void rlSetCullFace(int mode); // Set face culling mode RLAPI void rlEnableScissorTest(void); // Enable scissor test RLAPI void rlDisableScissorTest(void); // Disable scissor test RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test -RLAPI void rlEnableWireMode(void); // Enable wire mode RLAPI void rlEnablePointMode(void); // Enable point mode -RLAPI void rlDisableWireMode(void); // Disable wire (and point) mode +RLAPI void rlDisablePointMode(void); // Disable point mode +RLAPI void rlEnableWireMode(void); // Enable wire mode +RLAPI void rlDisableWireMode(void); // Disable wire mode RLAPI void rlSetLineWidth(float width); // Set the line drawing width RLAPI float rlGetLineWidth(void); // Get the line drawing width RLAPI void rlEnableSmoothLines(void); // Enable line aliasing @@ -1967,6 +1968,15 @@ void rlEnableWireMode(void) #endif } +// Disable wire mode +void rlDisableWireMode(void) +{ +#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) + // NOTE: glPolygonMode() not available on OpenGL ES + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif +} + // Enable point mode void rlEnablePointMode(void) { @@ -1977,8 +1987,8 @@ void rlEnablePointMode(void) #endif } -// Disable wire mode -void rlDisableWireMode(void) +// Disable point mode +void rlDisablePointMode(void) { #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) // NOTE: glPolygonMode() not available on OpenGL ES diff --git a/src/rmodels.c b/src/rmodels.c index ed0ce9136..4928d4bf1 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -183,6 +183,7 @@ void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) } // Draw a point in 3D space, actually a small line +// WARNING: OpenGL ES 2.0 does not support point mode drawing void DrawPoint3D(Vector3 position, Color color) { rlPushMatrix(); @@ -3779,6 +3780,7 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float } // Draw a model points +// WARNING: OpenGL ES 2.0 does not support point mode drawing void DrawModelPoints(Model model, Vector3 position, float scale, Color tint) { rlEnablePointMode(); @@ -3787,10 +3789,11 @@ void DrawModelPoints(Model model, Vector3 position, float scale, Color tint) DrawModel(model, position, scale, tint); rlEnableBackfaceCulling(); - rlDisableWireMode(); + rlDisablePointMode(); } // Draw a model points +// WARNING: OpenGL ES 2.0 does not support point mode drawing void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { rlEnablePointMode(); @@ -3799,7 +3802,7 @@ void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, floa DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint); rlEnableBackfaceCulling(); - rlDisableWireMode(); + rlDisablePointMode(); } // Draw a billboard @@ -3876,10 +3879,10 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector } Vector2 texcoords[4]; - texcoords[0] = (Vector2) { (float)source.x/texture.width, (float)(source.y + source.height)/texture.height }; - texcoords[1] = (Vector2) { (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height }; - texcoords[2] = (Vector2) { (float)(source.x + source.width)/texture.width, (float)source.y/texture.height }; - texcoords[3] = (Vector2) { (float)source.x/texture.width, (float)source.y/texture.height }; + texcoords[0] = (Vector2){ (float)source.x/texture.width, (float)(source.y + source.height)/texture.height }; + texcoords[1] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height }; + texcoords[2] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)source.y/texture.height }; + texcoords[3] = (Vector2){ (float)source.x/texture.width, (float)source.y/texture.height }; rlSetTexture(texture.id); rlBegin(RL_QUADS); @@ -5138,7 +5141,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri)); } } - else if (cgltfImage->buffer_view != NULL && cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer + else if ((cgltfImage->buffer_view != NULL) && (cgltfImage->buffer_view->buffer->data != NULL)) // Check if image is provided as data buffer { unsigned char *data = RL_MALLOC(cgltfImage->buffer_view->size); int offset = (int)cgltfImage->buffer_view->offset; @@ -5153,10 +5156,14 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat // Check mime_type for image: (cgltfImage->mime_type == "image/png") // NOTE: Detected that some models define mime_type as "image\\/png" - if ((strcmp(cgltfImage->mime_type, "image\\/png") == 0) || - (strcmp(cgltfImage->mime_type, "image/png") == 0)) image = LoadImageFromMemory(".png", data, (int)cgltfImage->buffer_view->size); - else if ((strcmp(cgltfImage->mime_type, "image\\/jpeg") == 0) || - (strcmp(cgltfImage->mime_type, "image/jpeg") == 0)) image = LoadImageFromMemory(".jpg", data, (int)cgltfImage->buffer_view->size); + if ((strcmp(cgltfImage->mime_type, "image\\/png") == 0) || (strcmp(cgltfImage->mime_type, "image/png") == 0)) + { + image = LoadImageFromMemory(".png", data, (int)cgltfImage->buffer_view->size); + } + else if ((strcmp(cgltfImage->mime_type, "image\\/jpeg") == 0) || (strcmp(cgltfImage->mime_type, "image/jpeg") == 0)) + { + image = LoadImageFromMemory(".jpg", data, (int)cgltfImage->buffer_view->size); + } else TRACELOG(LOG_WARNING, "MODEL: glTF image data MIME type not recognized", TextFormat("%s/%s", texPath, cgltfImage->uri)); RL_FREE(data); @@ -5344,7 +5351,34 @@ static Model LoadGLTF(const char *fileName) Image imMetallicRoughness = LoadImageFromCgltfImage(data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.texture->image, texPath); if (imMetallicRoughness.data != NULL) { - model.materials[j].maps[MATERIAL_MAP_ROUGHNESS].texture = LoadTextureFromImage(imMetallicRoughness); + Image imMetallic = { 0 }; + Image imRoughness = { 0 }; + + imMetallic.data = RL_MALLOC(imMetallicRoughness.width*imMetallicRoughness.height); + imRoughness.data = RL_MALLOC(imMetallicRoughness.width*imMetallicRoughness.height); + + imMetallic.width = imRoughness.width = imMetallicRoughness.width; + imMetallic.height = imRoughness.height = imMetallicRoughness.height; + + imMetallic.format = imRoughness.format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE; + imMetallic.mipmaps = imRoughness.mipmaps = 1; + + for (int x = 0; x < imRoughness.width; x++) + { + for (int y = 0; y < imRoughness.height; y++) + { + Color color = GetImageColor(imMetallicRoughness, x, y); + + ((unsigned char *)imRoughness.data)[y*imRoughness.width + x] = color.g; // Roughness color channel + ((unsigned char *)imMetallic.data)[y*imMetallic.width + x] = color.b; // Metallic color channel + } + } + + model.materials[j].maps[MATERIAL_MAP_ROUGHNESS].texture = LoadTextureFromImage(imRoughness); + model.materials[j].maps[MATERIAL_MAP_METALNESS].texture = LoadTextureFromImage(imMetallic); + + UnloadImage(imRoughness); + UnloadImage(imMetallic); UnloadImage(imMetallicRoughness); } diff --git a/src/rtext.c b/src/rtext.c index d8d290053..982402f54 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1915,7 +1915,7 @@ void UnloadCodepoints(int *codepoints) int GetCodepointCount(const char *text) { unsigned int length = 0; - char *ptr = (char *)&text[0]; + const char *ptr = text; while (*ptr != '\0') { diff --git a/src/rtextures.c b/src/rtextures.c index 5248f1f4c..ee116b0e5 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -124,10 +124,6 @@ #endif // Image fileformats not supported by default -#if defined(__TINYC__) - #define STBI_NO_SIMD -#endif - #if (defined(SUPPORT_FILEFORMAT_BMP) || \ defined(SUPPORT_FILEFORMAT_PNG) || \ defined(SUPPORT_FILEFORMAT_TGA) || \ @@ -149,6 +145,10 @@ #define STBI_NO_THREAD_LOCALS + #if defined(__TINYC__) + #define STBI_NO_SIMD + #endif + #define STB_IMAGE_IMPLEMENTATION #include "external/stb_image.h" // Required for: stbi_load_from_file() // NOTE: Used to read image data (multiple formats support) @@ -218,6 +218,9 @@ #pragma GCC diagnostic ignored "-Wunused-function" #endif +#if defined(__TINYC__) + #define STBIR_NO_SIMD +#endif #define STB_IMAGE_RESIZE_IMPLEMENTATION #include "external/stb_image_resize2.h" // Required for: stbir_resize_uint8_linear() [ImageResize()] @@ -4205,8 +4208,11 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) Image mipmapped = ImageCopy(image); #if defined(SUPPORT_IMAGE_MANIPULATION) - ImageMipmaps(&mipmapped); - ImageMipmaps(&faces); + if (image.mipmaps > 1) + { + ImageMipmaps(&mipmapped); + ImageMipmaps(&faces); + } #endif // NOTE: Image formatting does not work with compressed textures @@ -4223,7 +4229,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) if (cubemap.id != 0) { cubemap.format = faces.format; - cubemap.mipmaps = 1; + cubemap.mipmaps = faces.mipmaps; } else TRACELOG(LOG_WARNING, "IMAGE: Failed to load cubemap image"); @@ -5384,13 +5390,19 @@ static float HalfToFloat(unsigned short x) { float result = 0.0f; + union + { + float fm; + unsigned int ui; + } uni; + const unsigned int e = (x & 0x7C00) >> 10; // Exponent const unsigned int m = (x & 0x03FF) << 13; // Mantissa - const float fm = (float)m; - const unsigned int v = (*(unsigned int *)&fm) >> 23; // Evil log2 bit hack to count leading zeros in denormalized format - const unsigned int r = (x & 0x8000) << 16 | (e != 0)*((e + 112) << 23 | m) | ((e == 0)&(m != 0))*((v - 37) << 23 | ((m << (150 - v)) & 0x007FE000)); // sign : normalized : denormalized + uni.fm = (float)m; + const unsigned int v = uni.ui >> 23; // Evil log2 bit hack to count leading zeros in denormalized format + uni.ui = (x & 0x8000) << 16 | (e != 0)*((e + 112) << 23 | m) | ((e == 0)&(m != 0))*((v - 37) << 23 | ((m << (150 - v)) & 0x007FE000)); // sign : normalized : denormalized - result = *(float *)&r; + result = uni.fm; return result; } @@ -5400,7 +5412,14 @@ static unsigned short FloatToHalf(float x) { unsigned short result = 0; - const unsigned int b = (*(unsigned int *) & x) + 0x00001000; // Round-to-nearest-even: add last bit after truncated mantissa + union + { + float fm; + unsigned int ui; + } uni; + uni.fm = x; + + const unsigned int b = uni.ui + 0x00001000; // Round-to-nearest-even: add last bit after truncated mantissa const unsigned int e = (b & 0x7F800000) >> 23; // Exponent const unsigned int m = b & 0x007FFFFF; // Mantissa; in line below: 0x007FF000 = 0x00800000-0x00001000 = decimal indicator flag - initial rounding @@ -5493,6 +5512,7 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].z = 0.0f; pixels[i].w = 1.0f; + k += 1; } break; case PIXELFORMAT_UNCOMPRESSED_R32G32B32: { @@ -5518,6 +5538,8 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].y = 0.0f; pixels[i].z = 0.0f; pixels[i].w = 1.0f; + + k += 1; } break; case PIXELFORMAT_UNCOMPRESSED_R16G16B16: {