feat(fixLib): fix release raylib

This commit is contained in:
Arthur Bichara 2025-01-17 17:30:47 +01:00
commit 2f5406bbd9
18 changed files with 1840 additions and 1840 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [shapes] example - Draw basic shapes 2d (rectangle, circle, line...)
* raylib [shapes] example - Draw basic shapes 2d (rayRectangle, circle, line...)
*
* Example originally created with raylib 1.0, last time updated with raylib 4.2
*
@ -51,10 +51,10 @@ int main(void)
DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE);
DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE);
// Rectangle shapes and lines
DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED);
DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD);
DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines
// rayRectangle shapes and lines
DrawrayRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED);
DrawrayRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD);
DrawrayRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines
// Triangle shapes and lines
DrawTriangle((Vector2){ screenWidth/4.0f *3.0f, 80.0f },
@ -79,7 +79,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -75,7 +75,7 @@ int main(void)
// De-Initialization
//---------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//----------------------------------------------------------
return 0;

View file

@ -28,13 +28,13 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - collision area");
// Box A: Moving box
Rectangle boxA = { 10, GetScreenHeight()/2.0f - 50, 200, 100 };
rayRectangle boxA = { 10, GetScreenHeight()/2.0f - 50, 200, 100 };
int boxASpeedX = 4;
// Box B: Mouse moved box
Rectangle boxB = { GetScreenWidth()/2.0f - 30, GetScreenHeight()/2.0f - 30, 60, 60 };
rayRectangle boxB = { GetScreenWidth()/2.0f - 30, GetScreenHeight()/2.0f - 30, 60, 60 };
Rectangle boxCollision = { 0 }; // Collision rectangle
rayRectangle boxCollision = { 0 }; // Collision rayRectangle
int screenUpperLimit = 40; // Top menu limits
@ -69,7 +69,7 @@ int main(void)
// Check boxes collision
collision = CheckCollisionRecs(boxA, boxB);
// Get collision rectangle (only on collision)
// Get collision rayRectangle (only on collision)
if (collision) boxCollision = GetCollisionRec(boxA, boxB);
// Pause Box A movement
@ -82,15 +82,15 @@ int main(void)
ClearBackground(RAYWHITE);
DrawRectangle(0, 0, screenWidth, screenUpperLimit, collision? RED : BLACK);
DrawrayRectangle(0, 0, screenWidth, screenUpperLimit, collision? RED : BLACK);
DrawRectangleRec(boxA, GOLD);
DrawRectangleRec(boxB, BLUE);
DrawrayRectangleRec(boxA, GOLD);
DrawrayRectangleRec(boxB, BLUE);
if (collision)
{
// Draw collision area
DrawRectangleRec(boxCollision, LIME);
DrawrayRectangleRec(boxCollision, LIME);
// Draw collision message
DrawText("COLLISION!", GetScreenWidth()/2 - MeasureText("COLLISION!", 20)/2, screenUpperLimit/2 - 10, 20, BLACK);
@ -110,7 +110,7 @@ int main(void)
// De-Initialization
//---------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//----------------------------------------------------------
return 0;

View file

@ -37,9 +37,9 @@ int main(void)
"DARKBROWN", "GRAY", "RED", "GOLD", "LIME", "BLUE", "VIOLET", "BROWN",
"LIGHTGRAY", "PINK", "YELLOW", "GREEN", "SKYBLUE", "PURPLE", "BEIGE" };
Rectangle colorsRecs[MAX_COLORS_COUNT] = { 0 }; // Rectangles array
rayRectangle colorsRecs[MAX_COLORS_COUNT] = { 0 }; // rayRectangles array
// Fills colorsRecs data (for every rectangle)
// Fills colorsRecs data (for every rayRectangle)
for (int i = 0; i < MAX_COLORS_COUNT; i++)
{
colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
@ -78,14 +78,14 @@ int main(void)
DrawText("raylib colors palette", 28, 42, 20, BLACK);
DrawText("press SPACE to see all colors", GetScreenWidth() - 180, GetScreenHeight() - 40, 10, GRAY);
for (int i = 0; i < MAX_COLORS_COUNT; i++) // Draw all rectangles
for (int i = 0; i < MAX_COLORS_COUNT; i++) // Draw all rayRectangles
{
DrawRectangleRec(colorsRecs[i], Fade(colors[i], colorState[i]? 0.6f : 1.0f));
DrawrayRectangleRec(colorsRecs[i], Fade(colors[i], colorState[i]? 0.6f : 1.0f));
if (IsKeyDown(KEY_SPACE) || colorState[i])
{
DrawRectangle((int)colorsRecs[i].x, (int)(colorsRecs[i].y + colorsRecs[i].height - 26), (int)colorsRecs[i].width, 20, BLACK);
DrawRectangleLinesEx(colorsRecs[i], 6, Fade(BLACK, 0.3f));
DrawrayRectangle((int)colorsRecs[i].x, (int)(colorsRecs[i].y + colorsRecs[i].height - 26), (int)colorsRecs[i].width, 20, BLACK);
DrawrayRectangleLinesEx(colorsRecs[i], 6, Fade(BLACK, 0.3f));
DrawText(colorNames[i], (int)(colorsRecs[i].x + colorsRecs[i].width - MeasureText(colorNames[i], 10) - 12),
(int)(colorsRecs[i].y + colorsRecs[i].height - 20), 10, colors[i]);
}
@ -97,7 +97,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -56,18 +56,18 @@ int main(void)
ClearBackground(RAYWHITE);
DrawLine(500, 0, 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.6f));
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
DrawrayRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
DrawCircleSector(center, outerRadius, startAngle, endAngle, (int)segments, Fade(MAROON, 0.3f));
DrawCircleSectorLines(center, outerRadius, startAngle, endAngle, (int)segments, Fade(MAROON, 0.6f));
// Draw GUI controls
//------------------------------------------------------------------------------
GuiSliderBar((Rectangle){ 600, 40, 120, 20}, "StartAngle", NULL, &startAngle, 0, 720);
GuiSliderBar((Rectangle){ 600, 70, 120, 20}, "EndAngle", NULL, &endAngle, 0, 720);
GuiSliderBar((rayRectangle){ 600, 40, 120, 20}, "StartAngle", NULL, &startAngle, 0, 720);
GuiSliderBar((rayRectangle){ 600, 70, 120, 20}, "EndAngle", NULL, &endAngle, 0, 720);
GuiSliderBar((Rectangle){ 600, 140, 120, 20}, "Radius", NULL, &outerRadius, 0, 200);
GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", NULL, &segments, 0, 100);
GuiSliderBar((rayRectangle){ 600, 140, 120, 20}, "Radius", NULL, &outerRadius, 0, 200);
GuiSliderBar((rayRectangle){ 600, 170, 120, 20}, "Segments", NULL, &segments, 0, 100);
//------------------------------------------------------------------------------
minSegments = truncf(ceilf((endAngle - startAngle) / 90));
@ -81,7 +81,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [shapes] example - draw rectangle rounded (with gui options)
* raylib [shapes] example - draw rayRectangle rounded (with gui options)
*
* Example originally created with raylib 2.5, last time updated with raylib 2.5
*
@ -28,7 +28,7 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - draw rectangle rounded");
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - draw rayRectangle rounded");
float roundness = 0.2f;
float width = 200.0f;
@ -48,7 +48,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
Rectangle rec = { ((float)GetScreenWidth() - width - 250)/2, (GetScreenHeight() - height)/2.0f, (float)width, (float)height };
rayRectangle rec = { ((float)GetScreenWidth() - width - 250)/2, (GetScreenHeight() - height)/2.0f, (float)width, (float)height };
//----------------------------------------------------------------------------------
// Draw
@ -58,23 +58,23 @@ int main(void)
ClearBackground(RAYWHITE);
DrawLine(560, 0, 560, GetScreenHeight(), Fade(LIGHTGRAY, 0.6f));
DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
DrawrayRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
if (drawRect) DrawRectangleRec(rec, Fade(GOLD, 0.6f));
if (drawRoundedRect) DrawRectangleRounded(rec, roundness, (int)segments, Fade(MAROON, 0.2f));
if (drawRoundedLines) DrawRectangleRoundedLines(rec, roundness, (int)segments, lineThick, Fade(MAROON, 0.4f));
if (drawRect) DrawrayRectangleRec(rec, Fade(GOLD, 0.6f));
if (drawRoundedRect) DrawrayRectangleRounded(rec, roundness, (int)segments, Fade(MAROON, 0.2f));
if (drawRoundedLines) DrawrayRectangleRoundedLines(rec, roundness, (int)segments, lineThick, Fade(MAROON, 0.4f));
// Draw GUI controls
//------------------------------------------------------------------------------
GuiSliderBar((Rectangle){ 640, 40, 105, 20 }, "Width", NULL, &width, 0, (float)GetScreenWidth() - 300);
GuiSliderBar((Rectangle){ 640, 70, 105, 20 }, "Height", NULL, &height, 0, (float)GetScreenHeight() - 50);
GuiSliderBar((Rectangle){ 640, 140, 105, 20 }, "Roundness", NULL, &roundness, 0.0f, 1.0f);
GuiSliderBar((Rectangle){ 640, 170, 105, 20 }, "Thickness", NULL, &lineThick, 0, 20);
GuiSliderBar((Rectangle){ 640, 240, 105, 20}, "Segments", NULL, &segments, 0, 60);
GuiSliderBar((rayRectangle){ 640, 40, 105, 20 }, "Width", NULL, &width, 0, (float)GetScreenWidth() - 300);
GuiSliderBar((rayRectangle){ 640, 70, 105, 20 }, "Height", NULL, &height, 0, (float)GetScreenHeight() - 50);
GuiSliderBar((rayRectangle){ 640, 140, 105, 20 }, "Roundness", NULL, &roundness, 0.0f, 1.0f);
GuiSliderBar((rayRectangle){ 640, 170, 105, 20 }, "Thickness", NULL, &lineThick, 0, 20);
GuiSliderBar((rayRectangle){ 640, 240, 105, 20}, "Segments", NULL, &segments, 0, 60);
GuiCheckBox((Rectangle){ 640, 320, 20, 20 }, "DrawRoundedRect", &drawRoundedRect);
GuiCheckBox((Rectangle){ 640, 350, 20, 20 }, "DrawRoundedLines", &drawRoundedLines);
GuiCheckBox((Rectangle){ 640, 380, 20, 20}, "DrawRect", &drawRect);
GuiCheckBox((rayRectangle){ 640, 320, 20, 20 }, "DrawRoundedRect", &drawRoundedRect);
GuiCheckBox((rayRectangle){ 640, 350, 20, 20 }, "DrawRoundedLines", &drawRoundedLines);
GuiCheckBox((rayRectangle){ 640, 380, 20, 20}, "DrawRect", &drawRect);
//------------------------------------------------------------------------------
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 640, 280, 10, (segments >= 4)? MAROON : DARKGRAY);
@ -87,7 +87,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -61,7 +61,7 @@ int main(void)
ClearBackground(RAYWHITE);
DrawLine(500, 0, 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.6f));
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
DrawrayRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
if (drawRing) DrawRing(center, innerRadius, outerRadius, startAngle, endAngle, (int)segments, Fade(MAROON, 0.3f));
if (drawRingLines) DrawRingLines(center, innerRadius, outerRadius, startAngle, endAngle, (int)segments, Fade(BLACK, 0.4f));
@ -69,17 +69,17 @@ int main(void)
// Draw GUI controls
//------------------------------------------------------------------------------
GuiSliderBar((Rectangle){ 600, 40, 120, 20 }, "StartAngle", NULL, &startAngle, -450, 450);
GuiSliderBar((Rectangle){ 600, 70, 120, 20 }, "EndAngle", NULL, &endAngle, -450, 450);
GuiSliderBar((rayRectangle){ 600, 40, 120, 20 }, "StartAngle", NULL, &startAngle, -450, 450);
GuiSliderBar((rayRectangle){ 600, 70, 120, 20 }, "EndAngle", NULL, &endAngle, -450, 450);
GuiSliderBar((Rectangle){ 600, 140, 120, 20 }, "InnerRadius", NULL, &innerRadius, 0, 100);
GuiSliderBar((Rectangle){ 600, 170, 120, 20 }, "OuterRadius", NULL, &outerRadius, 0, 200);
GuiSliderBar((rayRectangle){ 600, 140, 120, 20 }, "InnerRadius", NULL, &innerRadius, 0, 100);
GuiSliderBar((rayRectangle){ 600, 170, 120, 20 }, "OuterRadius", NULL, &outerRadius, 0, 200);
GuiSliderBar((Rectangle){ 600, 240, 120, 20 }, "Segments", NULL, &segments, 0, 100);
GuiSliderBar((rayRectangle){ 600, 240, 120, 20 }, "Segments", NULL, &segments, 0, 100);
GuiCheckBox((Rectangle){ 600, 320, 20, 20 }, "Draw Ring", &drawRing);
GuiCheckBox((Rectangle){ 600, 350, 20, 20 }, "Draw RingLines", &drawRingLines);
GuiCheckBox((Rectangle){ 600, 380, 20, 20 }, "Draw CircleLines", &drawCircleLines);
GuiCheckBox((rayRectangle){ 600, 320, 20, 20 }, "Draw Ring", &drawRing);
GuiCheckBox((rayRectangle){ 600, 350, 20, 20 }, "Draw RingLines", &drawRingLines);
GuiCheckBox((rayRectangle){ 600, 380, 20, 20 }, "Draw CircleLines", &drawCircleLines);
//------------------------------------------------------------------------------
int minSegments = (int)ceilf((endAngle - startAngle)/90);
@ -93,7 +93,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -97,7 +97,7 @@ int main(void)
ClearBackground(RAYWHITE);
if (state >= 2) DrawRectangle(0, 0, screenWidth, screenHeight, GREEN);
if (state >= 2) DrawrayRectangle(0, 0, screenWidth, screenHeight, GREEN);
DrawCircle(ballPositionX, 200, (float)ballRadius, Fade(RED, 1.0f - ballAlpha));
if (state == 3) DrawText("PRESS [ENTER] TO PLAY AGAIN!", 240, 200, 20, BLACK);
@ -108,7 +108,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -28,7 +28,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - easings box anim");
// Box variables to be animated with easings
Rectangle rec = { GetScreenWidth()/2.0f, -100, 100, 100 };
rayRectangle rec = { GetScreenWidth()/2.0f, -100, 100, 100 };
float rotation = 0.0f;
float alpha = 1.0f;
@ -71,7 +71,7 @@ int main(void)
state = 2;
}
} break;
case 2: // Rotate horizontal bar rectangle
case 2: // Rotate horizontal bar rayRectangle
{
framesCounter++;
rotation = EaseQuadOut((float)framesCounter, 0.0f, 270.0f, 240);
@ -110,7 +110,7 @@ int main(void)
// Reset animation at any moment
if (IsKeyPressed(KEY_SPACE))
{
rec = (Rectangle){ GetScreenWidth()/2.0f, -100, 100, 100 };
rec = (rayRectangle){ GetScreenWidth()/2.0f, -100, 100, 100 };
rotation = 0.0f;
alpha = 1.0f;
state = 0;
@ -124,7 +124,7 @@ int main(void)
ClearBackground(RAYWHITE);
DrawRectanglePro(rec, (Vector2){ rec.width/2, rec.height/2 }, rotation, Fade(BLACK, alpha));
DrawrayRectanglePro(rec, (Vector2){ rec.width/2, rec.height/2 }, rotation, Fade(BLACK, alpha));
DrawText("PRESS [SPACE] TO RESET BOX ANIMATION!", 10, GetScreenHeight() - 25, 20, LIGHTGRAY);
@ -134,7 +134,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [shapes] example - easings rectangle array
* raylib [shapes] example - easings rayRectangle array
*
* 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.
@ -36,9 +36,9 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - easings rectangle array");
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - easings rayRectangle array");
Rectangle recs[MAX_RECS_X*MAX_RECS_Y] = { 0 };
rayRectangle recs[MAX_RECS_X*MAX_RECS_Y] = { 0 };
for (int y = 0; y < MAX_RECS_Y; y++)
{
@ -53,7 +53,7 @@ int main(void)
float rotation = 0.0f;
int framesCounter = 0;
int state = 0; // Rectangles animation state: 0-Playing, 1-Finished
int state = 0; // rayRectangles animation state: 0-Playing, 1-Finished
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@ -105,7 +105,7 @@ int main(void)
{
for (int i = 0; i < MAX_RECS_X*MAX_RECS_Y; i++)
{
DrawRectanglePro(recs[i], (Vector2){ recs[i].width/2, recs[i].height/2 }, rotation, RED);
DrawrayRectanglePro(recs[i], (Vector2){ recs[i].width/2, recs[i].height/2 }, rotation, RED);
}
}
else if (state == 1) DrawText("PRESS [SPACE] TO PLAY AGAIN!", 240, 200, 20, GRAY);
@ -116,7 +116,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -102,7 +102,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -78,7 +78,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -42,8 +42,8 @@ int main(void)
ClearBackground(RAYWHITE);
DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK);
DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE);
DrawrayRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK);
DrawrayRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE);
DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 48, 50, BLACK);
DrawText("this is NOT a texture!", 350, 370, 10, GRAY);
@ -54,7 +54,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -120,30 +120,30 @@ int main(void)
if (state == 0)
{
if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK);
if ((framesCounter/15)%2) DrawrayRectangle(logoPositionX, logoPositionY, 16, 16, BLACK);
}
else if (state == 1)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
DrawrayRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawrayRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
}
else if (state == 2)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
DrawrayRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawrayRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK);
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK);
DrawrayRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK);
DrawrayRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK);
}
else if (state == 3)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha));
DrawrayRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha));
DrawrayRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha));
DrawrayRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha));
DrawrayRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawrayRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawText(TextSubtext("raylib", 0, lettersCount), GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha));
}
@ -158,7 +158,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [shapes] example - rectangle scaling by mouse
* raylib [shapes] example - rayRectangle scaling by mouse
*
* Example originally created with raylib 2.5, last time updated with raylib 2.5
*
@ -27,9 +27,9 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rectangle scaling mouse");
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rayRectangle scaling mouse");
Rectangle rec = { 100, 100, 200, 80 };
rayRectangle rec = { 100, 100, 200, 80 };
Vector2 mousePosition = { 0 };
@ -46,7 +46,7 @@ int main(void)
//----------------------------------------------------------------------------------
mousePosition = GetMousePosition();
if (CheckCollisionPointRec(mousePosition, (Rectangle){ rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, rec.y + rec.height - MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE }))
if (CheckCollisionPointRec(mousePosition, (rayRectangle){ rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, rec.y + rec.height - MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE }))
{
mouseScaleReady = true;
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) mouseScaleMode = true;
@ -78,13 +78,13 @@ int main(void)
ClearBackground(RAYWHITE);
DrawText("Scale rectangle dragging from bottom-right corner!", 10, 10, 20, GRAY);
DrawText("Scale rayRectangle dragging from bottom-right corner!", 10, 10, 20, GRAY);
DrawRectangleRec(rec, Fade(GREEN, 0.5f));
DrawrayRectangleRec(rec, Fade(GREEN, 0.5f));
if (mouseScaleReady)
{
DrawRectangleLinesEx(rec, 1, RED);
DrawrayRectangleLinesEx(rec, 1, RED);
DrawTriangle((Vector2){ rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, rec.y + rec.height },
(Vector2){ rec.x + rec.width, rec.y + rec.height },
(Vector2){ rec.x + rec.width, rec.y + rec.height - MOUSE_SCALE_MARK_SIZE }, RED);
@ -96,7 +96,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -224,15 +224,15 @@ int main(void)
if (splineTypeEditMode) GuiLock();
// Draw spline config
GuiLabel((Rectangle){ 12, 62, 140, 24 }, TextFormat("Spline thickness: %i", (int)splineThickness));
GuiSliderBar((Rectangle){ 12, 60 + 24, 140, 16 }, NULL, NULL, &splineThickness, 1.0f, 40.0f);
GuiLabel((rayRectangle){ 12, 62, 140, 24 }, TextFormat("Spline thickness: %i", (int)splineThickness));
GuiSliderBar((rayRectangle){ 12, 60 + 24, 140, 16 }, NULL, NULL, &splineThickness, 1.0f, 40.0f);
GuiCheckBox((Rectangle){ 12, 110, 20, 20 }, "Show point helpers", &splineHelpersActive);
GuiCheckBox((rayRectangle){ 12, 110, 20, 20 }, "Show point helpers", &splineHelpersActive);
GuiUnlock();
GuiLabel((Rectangle){ 12, 10, 140, 24 }, "Spline type:");
if (GuiDropdownBox((Rectangle){ 12, 8 + 24, 140, 28 }, "LINEAR;BSPLINE;CATMULLROM;BEZIER", &splineTypeActive, splineTypeEditMode)) splineTypeEditMode = !splineTypeEditMode;
GuiLabel((rayRectangle){ 12, 10, 140, 24 }, "Spline type:");
if (GuiDropdownBox((rayRectangle){ 12, 8 + 24, 140, 28 }, "LINEAR;BSPLINE;CATMULLROM;BEZIER", &splineTypeActive, splineTypeEditMode)) splineTypeEditMode = !splineTypeEditMode;
EndDrawing();
//----------------------------------------------------------------------------------
@ -240,7 +240,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View file

@ -40,7 +40,7 @@ typedef struct LightInfo {
Vector2 position; // Light position
RenderTexture mask; // Alpha mask for the light
float outerRadius; // The distance the light touches
Rectangle bounds; // A cached rectangle of the light bounds to help with culling
rayRectangle bounds; // A cached rayRectangle of the light bounds to help with culling
ShadowGeometry shadows[MAX_SHADOWS];
int shadowCount;
@ -137,7 +137,7 @@ void SetupLight(int slot, float x, float y, float radius)
}
// See if a light needs to update it's mask
bool UpdateLight(int slot, Rectangle* boxes, int count)
bool UpdateLight(int slot, rayRectangle* boxes, int count)
{
if (!lights[slot].active || !lights[slot].dirty) return false;
@ -192,17 +192,17 @@ bool UpdateLight(int slot, Rectangle* boxes, int count)
}
// Set up some boxes
void SetupBoxes(Rectangle *boxes, int *count)
void SetupBoxes(rayRectangle *boxes, int *count)
{
boxes[0] = (Rectangle){ 150,80, 40, 40 };
boxes[1] = (Rectangle){ 1200, 700, 40, 40 };
boxes[2] = (Rectangle){ 200, 600, 40, 40 };
boxes[3] = (Rectangle){ 1000, 50, 40, 40 };
boxes[4] = (Rectangle){ 500, 350, 40, 40 };
boxes[0] = (rayRectangle){ 150,80, 40, 40 };
boxes[1] = (rayRectangle){ 1200, 700, 40, 40 };
boxes[2] = (rayRectangle){ 200, 600, 40, 40 };
boxes[3] = (rayRectangle){ 1000, 50, 40, 40 };
boxes[4] = (rayRectangle){ 500, 350, 40, 40 };
for (int i = 5; i < MAX_BOXES; i++)
{
boxes[i] = (Rectangle){(float)GetRandomValue(0,GetScreenWidth()), (float)GetRandomValue(0,GetScreenHeight()), (float)GetRandomValue(10,100), (float)GetRandomValue(10,100) };
boxes[i] = (rayRectangle){(float)GetRandomValue(0,GetScreenWidth()), (float)GetRandomValue(0,GetScreenHeight()), (float)GetRandomValue(10,100), (float)GetRandomValue(10,100) };
}
*count = MAX_BOXES;
@ -222,7 +222,7 @@ int main(void)
// Initialize our 'world' of boxes
int boxCount = 0;
Rectangle boxes[MAX_BOXES] = { 0 };
rayRectangle boxes[MAX_BOXES] = { 0 };
SetupBoxes(boxes, &boxCount);
// Create a checkerboard ground texture
@ -282,7 +282,7 @@ int main(void)
// Merge in all the light masks
for (int i = 0; i < MAX_LIGHTS; i++)
{
if (lights[i].active) DrawTextureRec(lights[i].mask.texture, (Rectangle){ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), WHITE);
if (lights[i].active) DrawTextureRec(lights[i].mask.texture, (rayRectangle){ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), WHITE);
}
rlDrawRenderBatchActive();
@ -300,10 +300,10 @@ int main(void)
ClearBackground(BLACK);
// Draw the tile background
DrawTextureRec(backgroundTexture, (Rectangle){ 0, 0, (float)GetScreenWidth(), (float)GetScreenHeight() }, Vector2Zero(), WHITE);
DrawTextureRec(backgroundTexture, (rayRectangle){ 0, 0, (float)GetScreenWidth(), (float)GetScreenHeight() }, Vector2Zero(), WHITE);
// Overlay the shadows from all the lights
DrawTextureRec(lightMask.texture, (Rectangle){ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), ColorAlpha(WHITE, showLines? 0.75f : 1.0f));
DrawTextureRec(lightMask.texture, (rayRectangle){ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), ColorAlpha(WHITE, showLines? 0.75f : 1.0f));
// Draw the lights
for (int i = 0; i < MAX_LIGHTS; i++)
@ -320,9 +320,9 @@ int main(void)
for (int b = 0; b < boxCount; b++)
{
if (CheckCollisionRecs(boxes[b],lights[0].bounds)) DrawRectangleRec(boxes[b], PURPLE);
if (CheckCollisionRecs(boxes[b],lights[0].bounds)) DrawrayRectangleRec(boxes[b], PURPLE);
DrawRectangleLines((int)boxes[b].x, (int)boxes[b].y, (int)boxes[b].width, (int)boxes[b].height, DARKBLUE);
DrawrayRectangleLines((int)boxes[b].x, (int)boxes[b].y, (int)boxes[b].width, (int)boxes[b].height, DARKBLUE);
}
DrawText("(F1) Hide Shadow Volumes", 10, 50, 10, GREEN);
@ -349,7 +349,7 @@ int main(void)
if (lights[i].active) UnloadRenderTexture(lights[i].mask);
}
CloseWindow(); // Close window and OpenGL context
rayCloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;