Skip to content

Commit c807265

Browse files
committed
Merge branch 'master' of https://github.com/raysan5/raylib
2 parents 767df4c + 04a1a02 commit c807265

File tree

13 files changed

+880
-16
lines changed

13 files changed

+880
-16
lines changed

examples/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ SHAPES = \
554554
shapes/shapes_easings_box \
555555
shapes/shapes_easings_rectangles \
556556
shapes/shapes_following_eyes \
557+
shapes/shapes_kaleidoscope \
557558
shapes/shapes_lines_bezier \
558559
shapes/shapes_logo_raylib \
559560
shapes/shapes_logo_raylib_anim \
@@ -564,6 +565,7 @@ SHAPES = \
564565
shapes/shapes_rounded_rectangle_drawing \
565566
shapes/shapes_splines_drawing \
566567
shapes/shapes_top_down_lights \
568+
shapes/shapes_triangle_strip \
567569
shapes/shapes_vector_angle
568570

569571
TEXTURES = \

examples/Makefile.Web

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ SHAPES = \
554554
shapes/shapes_easings_box \
555555
shapes/shapes_easings_rectangles \
556556
shapes/shapes_following_eyes \
557+
shapes/shapes_kaleidoscope \
557558
shapes/shapes_lines_bezier \
558559
shapes/shapes_logo_raylib \
559560
shapes/shapes_logo_raylib_anim \
@@ -564,6 +565,7 @@ SHAPES = \
564565
shapes/shapes_rounded_rectangle_drawing \
565566
shapes/shapes_splines_drawing \
566567
shapes/shapes_top_down_lights \
568+
shapes/shapes_triangle_strip \
567569
shapes/shapes_vector_angle
568570

569571
TEXTURES = \
@@ -854,6 +856,9 @@ shapes/shapes_easings_rectangles: shapes/shapes_easings_rectangles.c
854856
shapes/shapes_following_eyes: shapes/shapes_following_eyes.c
855857
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
856858

859+
shapes/shapes_kaleidoscope: shapes/shapes_kaleidoscope.c
860+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
861+
857862
shapes/shapes_lines_bezier: shapes/shapes_lines_bezier.c
858863
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
859864

@@ -884,6 +889,9 @@ shapes/shapes_splines_drawing: shapes/shapes_splines_drawing.c
884889
shapes/shapes_top_down_lights: shapes/shapes_top_down_lights.c
885890
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
886891

892+
shapes/shapes_triangle_strip: shapes/shapes_triangle_strip.c
893+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
894+
887895
shapes/shapes_vector_angle: shapes/shapes_vector_angle.c
888896
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
889897

examples/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You may find it easier to use than other toolchains, especially when it comes to
1717
- `zig build [module]` to compile all examples for a module (e.g. `zig build core`)
1818
- `zig build [example]` to compile _and run_ a particular example (e.g. `zig build core_basic_window`)
1919

20-
## EXAMPLES COLLECTION [TOTAL: 173]
20+
## EXAMPLES COLLECTION [TOTAL: 175]
2121

2222
### category: core [40]
2323

@@ -66,7 +66,7 @@ Examples using raylib[core](../src/rcore.c) platform functionality like window c
6666
| [core_undo_redo](core/core_undo_redo.c) | <img src="core/core_undo_redo.png" alt="core_undo_redo" width="80"> | ⭐⭐⭐☆ | 5.5 | 5.6 | [Ramon Santamaria](https://github.com/raysan5) |
6767
| [core_input_actions](core/core_input_actions.c) | <img src="core/core_input_actions.png" alt="core_input_actions" width="80"> | ⭐⭐☆☆ | 5.5 | 5.6 | [Jett](https://github.com/JettMonstersGoBoom) |
6868

69-
### category: shapes [24]
69+
### category: shapes [26]
7070

7171
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/rshapes.c) module.
7272

@@ -84,8 +84,8 @@ Examples using raylib shapes drawing functionality, provided by raylib [shapes](
8484
| [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
8585
| [shapes_easings_ball](shapes/shapes_easings_ball.c) | <img src="shapes/shapes_easings_ball.png" alt="shapes_easings_ball" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
8686
| [shapes_easings_box](shapes/shapes_easings_box.c) | <img src="shapes/shapes_easings_box.png" alt="shapes_easings_box" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
87-
| [shapes_recursive_tree](shapes/shapes_recursive_tree.c) | <img src="shapes/shapes_recursive_tree.png" alt="shapes_recursive_tree" width="80"> | ⭐⭐⭐☆ | 5.6-dev | 5.6-dev| [Jopestpe](https://github.com/jopestpe) |
8887
| [shapes_easings_rectangles](shapes/shapes_easings_rectangles.c) | <img src="shapes/shapes_easings_rectangles.png" alt="shapes_easings_rectangles" width="80"> | ⭐⭐⭐☆ | 2.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
88+
| [shapes_recursive_tree](shapes/shapes_recursive_tree.c) | <img src="shapes/shapes_recursive_tree.png" alt="shapes_recursive_tree" width="80"> | ⭐⭐⭐☆ | 5.6-dev | 5.6-dev | [Jopestpe](https://github.com/jopestpe) |
8989
| [shapes_ring_drawing](shapes/shapes_ring_drawing.c) | <img src="shapes/shapes_ring_drawing.png" alt="shapes_ring_drawing" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
9090
| [shapes_circle_sector_drawing](shapes/shapes_circle_sector_drawing.c) | <img src="shapes/shapes_circle_sector_drawing.png" alt="shapes_circle_sector_drawing" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
9191
| [shapes_rounded_rectangle_drawing](shapes/shapes_rounded_rectangle_drawing.c) | <img src="shapes/shapes_rounded_rectangle_drawing.png" alt="shapes_rounded_rectangle_drawing" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
@@ -95,7 +95,9 @@ Examples using raylib shapes drawing functionality, provided by raylib [shapes](
9595
| [shapes_digital_clock](shapes/shapes_digital_clock.c) | <img src="shapes/shapes_digital_clock.png" alt="shapes_digital_clock" width="80"> | ⭐⭐⭐⭐️ | 5.5 | 5.6 | [Hamza RAHAL](https://github.com/hmz-rhl) |
9696
| [shapes_double_pendulum](shapes/shapes_double_pendulum.c) | <img src="shapes/shapes_double_pendulum.png" alt="shapes_double_pendulum" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [JoeCheong](https://github.com/Joecheong2006) |
9797
| [shapes_dashed_line](shapes/shapes_dashed_line.c) | <img src="shapes/shapes_dashed_line.png" alt="shapes_dashed_line" width="80"> | ⭐☆☆☆ | 5.5 | 5.5 | [Luís Almeida](https://github.com/luis605) |
98+
| [shapes_triangle_strip](shapes/shapes_triangle_strip.c) | <img src="shapes/shapes_triangle_strip.png" alt="shapes_triangle_strip" width="80"> | ⭐⭐☆☆ | 5.6-dev | 5.6-dev | [Jopestpe](https://github.com/jopestpe) |
9899
| [shapes_vector_angle](shapes/shapes_vector_angle.c) | <img src="shapes/shapes_vector_angle.png" alt="shapes_vector_angle" width="80"> | ⭐⭐☆☆ | 1.0 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
100+
| [shapes_kaleidoscope](shapes/shapes_kaleidoscope.c) | <img src="shapes/shapes_kaleidoscope.png" alt="shapes_kaleidoscope" width="80"> | ⭐⭐☆☆ | 5.5 | 5.6 | [Hugo ARNAL](https://github.com/hugoarnal) |
99101

100102
### category: textures [26]
101103

examples/examples_list.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ shapes;shapes_splines_drawing;★★★☆;5.0;5.0;2023;2025;"Ramon Santamaria";
7070
shapes;shapes_digital_clock;★★★★;5.5;5.6;2025;2025;"Hamza RAHAL";@hmz-rhl
7171
shapes;shapes_double_pendulum;★★☆☆;5.5;5.5;2025;2025;"JoeCheong";@Joecheong2006
7272
shapes;shapes_dashed_line;★☆☆☆;5.5;5.5;2025;2025;"Luís Almeida";@luis605
73+
shapes;shapes_triangle_strip;★★☆☆;5.6-dev;5.6-dev;2025;2025;"Jopestpe";@jopestpe
7374
shapes;shapes_vector_angle;★★☆☆;1.0;5.0;2023;2025;"Ramon Santamaria";@raysan5
7475
textures;textures_logo_raylib;★☆☆☆;1.0;1.0;2014;2025;"Ramon Santamaria";@raysan5
7576
textures;textures_srcrec_dstrec;★★★☆;1.3;1.3;2015;2025;"Ramon Santamaria";@raysan5
@@ -107,7 +108,7 @@ text;text_input_box;★★☆☆;1.7;3.5;2017;2025;"Ramon Santamaria";@raysan5
107108
text;text_writing_anim;★★☆☆;1.4;1.4;2016;2025;"Ramon Santamaria";@raysan5
108109
text;text_rectangle_bounds;★★★★;2.5;4.0;2018;2025;"Vlad Adrian";@demizdor
109110
text;text_unicode_emojis;★★★★;2.5;4.0;2019;2025;"Vlad Adrian";@demizdor
110-
text;text_unicode_ranges;★★★★;5.5;5.6;2025;2025;"Vlad Adrian";@demizdor
111+
text;text_unicode_ranges;★★★★;5.5;5.6;2025;2025;"Vadim Gunko";@GuvaCode
111112
text;text_3d_drawing;★★★★;3.5;4.0;2021;2025;"Vlad Adrian";@demizdor
112113
text;text_codepoints_loading;★★★☆;4.2;4.2;2022;2025;"Ramon Santamaria";@raysan5
113114
text;text_inline_styling;★★★☆;5.6-dev;5.6-dev;2025;2025;"Wagner Barongello";@SultansOfCode
@@ -180,3 +181,4 @@ others;easings_testbed;★★★☆;2.5;3.0;2019;2025;"Juan Miguel López";@flas
180181
others;raylib_opengl_interop;★★★★;3.8;4.0;2021;2025;"Stephan Soller";@arkanis
181182
others;embedded_files_loading;★★☆☆;3.0;3.5;2020;2025;"Kristian Holmgren";@defutura
182183
others;web_basic_window;★☆☆☆;5.6-dev;5.6-dev;2014;2025;"Ramon Santamaria";@raysan5
184+
shapes;shapes_kaleidoscope;★★☆☆;5.5;5.6;2025;2025;"Hugo ARNAL";@hugoarnal
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*******************************************************************************************
2+
*
3+
* raylib [shapes] example - kaleidoscope
4+
*
5+
* Example complexity rating: [★★☆☆] 2/4
6+
*
7+
* Example originally created with raylib 5.5, last time updated with raylib 5.6
8+
*
9+
* Example contributed by Hugo ARNAL (@hugoarnal) and reviewed by Ramon Santamaria (@raysan5)
10+
*
11+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
12+
* BSD-like license that allows static linking with closed source software
13+
*
14+
* Copyright (c) 2025 Hugo ARNAL (@hugoarnal)
15+
*
16+
********************************************************************************************/
17+
18+
#include "raylib.h"
19+
#include "raymath.h"
20+
21+
//------------------------------------------------------------------------------------
22+
// Program main entry point
23+
//------------------------------------------------------------------------------------
24+
int main(void)
25+
{
26+
// Initialization
27+
//--------------------------------------------------------------------------------------
28+
const int screenWidth = 800;
29+
const int screenHeight = 450;
30+
31+
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - kaleidoscope");
32+
33+
int symmetry = 6;
34+
float angle = 360.0f/(float)symmetry;
35+
float thickness = 3.0f;
36+
Vector2 prevMousePos = { 0 };
37+
38+
SetTargetFPS(60);
39+
ClearBackground(BLACK);
40+
41+
Vector2 offset = { (float)screenWidth/2.0f, (float)screenHeight/2.0f };
42+
Camera2D camera = { 0 };
43+
camera.target = (Vector2){ 0 };
44+
camera.offset = offset;
45+
camera.rotation = 0.0f;
46+
camera.zoom = 1.0f;
47+
48+
Vector2 scaleVector = { 1.0f, -1.0f };
49+
//--------------------------------------------------------------------------------------
50+
51+
// Main game loop
52+
while (!WindowShouldClose()) // Detect window close button or ESC key
53+
{
54+
// Update
55+
//----------------------------------------------------------------------------------
56+
Vector2 mousePos = GetMousePosition();
57+
Vector2 lineStart = Vector2Subtract(mousePos, offset);
58+
Vector2 lineEnd = Vector2Subtract(prevMousePos, offset);
59+
//----------------------------------------------------------------------------------
60+
61+
// Draw
62+
//----------------------------------------------------------------------------------
63+
BeginDrawing();
64+
BeginMode2D(camera);
65+
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) {
66+
for (int i = 0; i < symmetry; i++) {
67+
lineStart = Vector2Rotate(lineStart, angle*DEG2RAD);
68+
lineEnd = Vector2Rotate(lineEnd, angle*DEG2RAD);
69+
70+
DrawLineEx(lineStart, lineEnd, thickness, WHITE);
71+
72+
Vector2 reflectLineStart = Vector2Multiply(lineStart, scaleVector);
73+
Vector2 reflectLineEnd = Vector2Multiply(lineEnd, scaleVector);
74+
75+
DrawLineEx(reflectLineStart, reflectLineEnd, thickness, WHITE);
76+
}
77+
}
78+
79+
prevMousePos = mousePos;
80+
EndMode2D();
81+
EndDrawing();
82+
//----------------------------------------------------------------------------------
83+
}
84+
85+
// De-Initialization
86+
//--------------------------------------------------------------------------------------
87+
88+
CloseWindow(); // Close window and OpenGL context
89+
//--------------------------------------------------------------------------------------
90+
91+
return 0;
92+
}
38.4 KB
Loading
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*******************************************************************************************
2+
*
3+
* raylib [shapes] example - triangle strip
4+
*
5+
* Example complexity rating: [★★☆☆] 2/4
6+
*
7+
* Example originally created with raylib 5.6-dev, last time updated with raylib 5.6-dev
8+
*
9+
* Example contributed by Jopestpe (@jopestpe)
10+
*
11+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
12+
* BSD-like license that allows static linking with closed source software
13+
*
14+
* Copyright (c) 2018-2025 Jopestpe (@jopestpe)
15+
*
16+
********************************************************************************************/
17+
18+
#include "raylib.h"
19+
#include <math.h>
20+
21+
#define RAYGUI_IMPLEMENTATION
22+
#include "raygui.h" // Required for GUI controls
23+
24+
//------------------------------------------------------------------------------------
25+
// Program main entry point
26+
//------------------------------------------------------------------------------------
27+
int main(void)
28+
{
29+
// Initialization
30+
//--------------------------------------------------------------------------------------
31+
const int screenWidth = 800;
32+
const int screenHeight = 450;
33+
34+
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - triangle strip");
35+
36+
Vector2 points[120] = { 0 };
37+
Vector2 center = { (screenWidth/2.0f) - 125.f, screenHeight/2.0f };
38+
float segments = 6.0f;
39+
float insideRadius = 100.0f;
40+
float outsideRadius = 150.0f;
41+
bool outline = true;
42+
43+
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
44+
//--------------------------------------------------------------------------------------
45+
46+
// Main game loop
47+
while (!WindowShouldClose()) // Detect window close button or ESC key
48+
{
49+
// Update
50+
//----------------------------------------------------------------------------------
51+
int pointCount = (int)(segments);
52+
float angleStep = (360.0f/pointCount)*DEG2RAD;
53+
54+
for (int i = 0, i2 = 0; i < pointCount; i++, i2 += 2)
55+
{
56+
float angle1 = i*angleStep;
57+
points[i2] = (Vector2){ center.x + cosf(angle1)*insideRadius, center.y + sinf(angle1)*insideRadius };
58+
float angle2 = angle1 + angleStep/2.0f;
59+
points[i2 + 1] = (Vector2){ center.x + cosf(angle2)*outsideRadius, center.y + sinf(angle2)*outsideRadius };
60+
}
61+
62+
points[pointCount*2] = points[0];
63+
points[pointCount*2 + 1] = points[1];
64+
//----------------------------------------------------------------------------------
65+
66+
// Draw
67+
//----------------------------------------------------------------------------------
68+
BeginDrawing();
69+
70+
ClearBackground(RAYWHITE);
71+
72+
for (int i = 0, i2 = 0; i < pointCount; i++, i2 += 2)
73+
{
74+
float angle1 = i*angleStep;
75+
Color color = ColorFromHSV(angle1*RAD2DEG, 1.0f, 1.0f);
76+
DrawTriangle(points[i2 + 2], points[i2 + 1], points[i2], color);
77+
if (outline) DrawTriangleLines(points[i2], points[i2 + 1], points[i2 + 2], BLACK);
78+
79+
float angle2 = angle1 + angleStep/2.0f;
80+
color = ColorFromHSV(angle2*RAD2DEG, 1.0f, 1.0f);
81+
DrawTriangle(points[i2 + 3], points[i2 + 1], points[i2 + 2], color);
82+
if (outline) DrawTriangleLines(points[i2 + 2], points[i2 + 1], points[i2 + 3], BLACK);
83+
}
84+
85+
DrawLine(580, 0, 580, GetScreenHeight(), (Color){ 218, 218, 218, 255 });
86+
DrawRectangle(580, 0, GetScreenWidth(), GetScreenHeight(), (Color){ 232, 232, 232, 255 });
87+
88+
// Draw GUI controls
89+
//------------------------------------------------------------------------------
90+
GuiSliderBar((Rectangle){ 640, 40, 120, 20}, "Segments", TextFormat("%.0f", segments), &segments, 6.0f, 60.f);
91+
GuiCheckBox((Rectangle){ 640, 70, 20, 20 }, "Outline", &outline);
92+
//------------------------------------------------------------------------------
93+
94+
DrawFPS(10, 10);
95+
96+
EndDrawing();
97+
//----------------------------------------------------------------------------------
98+
}
99+
100+
// De-Initialization
101+
//--------------------------------------------------------------------------------------
102+
CloseWindow(); // Close window and OpenGL context
103+
//--------------------------------------------------------------------------------------
104+
105+
return 0;
106+
}
12.4 KB
Loading

examples/text/text_unicode_ranges.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
*
77
* Example originally created with raylib 5.5, last time updated with raylib 5.6
88
*
9-
* Example contributed by Vlad Adrian (@demizdor) and reviewed by Ramon Santamaria (@raysan5)
9+
* Example contributed by Vadim Gunko (@GuvaCode) and reviewed by Ramon Santamaria (@raysan5)
1010
*
1111
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
1212
* BSD-like license that allows static linking with closed source software
1313
*
14-
* Copyright (c) 2025 Vlad Adrian (@demizdor) and Ramon Santamaria (@raysan5)
14+
* Copyright (c) 2025 Vadim Gunko (@GuvaCode) and Ramon Santamaria (@raysan5)
1515
*
1616
********************************************************************************************/
1717

0 commit comments

Comments
 (0)