Merge branch 'master' into master

This commit is contained in:
Jon Daniel 2025-08-08 02:24:57 +02:00 • committed by GitHub
commit 0842aabe5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [shaders] example - Rounded Rectangle
* raylib [shaders] example - rounded rectangle
*
* Example complexity rating: [★★★☆] 3/4
*
@ -24,9 +24,8 @@
#endif
//------------------------------------------------------------------------------------
// Declare custom Structs
// Structs definition
//------------------------------------------------------------------------------------
// Rounded rectangle data
typedef struct {
Vector4 cornerRadius; // Individual corner radius (top-left, top-right, bottom-left, bottom-right)
@ -54,7 +53,6 @@ typedef struct {
//------------------------------------------------------------------------------------
// 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);
@ -71,11 +69,7 @@ int main(void)
int screenWidth = 800;
int screenHeight = 450;
const Color rectangleColor = BLUE;
const Color shadowColor = DARKBLUE;
const Color borderColor = SKYBLUE;
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Rounded Rectangle");
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - rounded rectangle");
// Load the shader
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base.vs", GLSL_VERSION),
@ -94,6 +88,10 @@ int main(void)
// Update shader uniforms
UpdateRoundedRectangle(roundedRectangle, shader);
const Color rectangleColor = BLUE;
const Color shadowColor = DARKBLUE;
const Color borderColor = SKYBLUE;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@ -131,8 +129,6 @@ int main(void)
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
EndShaderMode();
// Draw rectangle shadow using shader
rec = (Rectangle){ 50, 200, 110, 60 };
DrawRectangleLines((int)rec.x - 20, (int)rec.y - 20, (int)rec.width + 40, (int)rec.height + 40, DARKGRAY);
@ -150,8 +146,6 @@ int main(void)
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
EndShaderMode();
// Draw rectangle's border using shader
rec = (Rectangle){ 50, 330, 110, 60 };
DrawRectangleLines((int)rec.x - 20, (int)rec.y - 20, (int)rec.width + 40, (int)rec.height + 40, DARKGRAY);