diff --git a/CHANGELOG b/CHANGELOG index f792bca4da92..4252c9bc34bb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -179,6 +179,19 @@ WIP: Last update with commit from 02-Nov-2024 [rshapes] REVIEWED: `CheckCollisionCircleRec()` (#3584) by @ubkp [rshapes] REVIEWED: Add more detail to function comment (#4344) by @Jeffery Myers [rshapes] REVIEWED: Functions that draw point arrays take them as const (#4051) by @Jeffery Myers +[rshapes] ADDED: `DrawSplineSegmentBezierCubicVar()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineVelocityLinear()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineVelocityBezierQuad()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineVelocityBezierCubic()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineAccelerationBezierQuad()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineAccelerationBezierCubic()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineJoltBezierCubic()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineBoundsBezierLinear()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineBoundsBezierQuad()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineBoundsBezierCubic()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineCurvatureBezierCubic()` (#4809) by @AmityWilder +[rshapes] ADDED: `GetSplineNearestTLinear()` (#4809) by @AmityWilder +[rshapes] ADDED: Example of `DrawSplineSegmentBezierCubicVar` in splines drawing example (#4809) by @AmityWilder [rtextures] ADDED: `ColorIsEqual()` by @Ray [rtextures] ADDED: `ColorLerp()`, to mix 2 colors together (#4310) by @SusgUY446 [rtextures] ADDED: `LoadImageAnimFromMemory()` (#3681) by @IoIxD diff --git a/examples/shapes/shapes_splines_drawing.c b/examples/shapes/shapes_splines_drawing.c index 3b4c9c2843eb..f311017a00db 100644 --- a/examples/shapes/shapes_splines_drawing.c +++ b/examples/shapes/shapes_splines_drawing.c @@ -14,6 +14,7 @@ ********************************************************************************************/ #include "raylib.h" +#include "raymath.h" #define RAYGUI_IMPLEMENTATION #include "raygui.h" // Required for UI controls @@ -21,9 +22,10 @@ #include // Required for: NULL #define MAX_SPLINE_POINTS 32 +#define SPLINE_THICK_COUNT 4 // Cubic Bezier spline control points -// NOTE: Every segment has two control points +// NOTE: Every segment has two control points typedef struct { Vector2 start; Vector2 end; @@ -34,7 +36,9 @@ typedef enum { SPLINE_LINEAR = 0, // Linear SPLINE_BASIS, // B-Spline SPLINE_CATMULLROM, // Catmull-Rom - SPLINE_BEZIER // Cubic Bezier + SPLINE_BEZIER, // Cubic Bezier + SPLINE_LINEAR_VAR, // Linear, variable thickness + SPLINE_BEZIER_VAR // Cubic Bezier, variable thickness } SplineType; //------------------------------------------------------------------------------------ @@ -57,19 +61,28 @@ int main(void) { 520.0f, 60.0f }, { 710.0f, 260.0f }, }; - - // Array required for spline bezier-cubic, + + float thicks[SPLINE_THICK_COUNT] = { + 0.0f, + 8.0f, + 8.0f, + 0.0f, + }; + + // Array required for spline bezier-cubic, // including control points interleaved with start-end segment points Vector2 pointsInterleaved[3*(MAX_SPLINE_POINTS - 1) + 1] = { 0 }; - + int pointCount = 5; int selectedPoint = -1; int focusedPoint = -1; + int selectedThickPoint = -1; + int focusedThickPoint = -1; Vector2 *selectedControlPoint = NULL; Vector2 *focusedControlPoint = NULL; - + // Cubic Bezier control points initialization - ControlPoint control[MAX_SPLINE_POINTS-1] = { 0 }; + ControlPoint control[MAX_SPLINE_POINTS - 1] = { 0 }; for (int i = 0; i < pointCount - 1; i++) { control[i].start = (Vector2){ points[i].x + 50, points[i].y }; @@ -78,10 +91,10 @@ int main(void) // Spline config variables float splineThickness = 8.0f; - int splineTypeActive = SPLINE_LINEAR; // 0-Linear, 1-BSpline, 2-CatmullRom, 3-Bezier - bool splineTypeEditMode = false; + int splineTypeActive = SPLINE_LINEAR; // 0-Linear, 1-BSpline, 2-CatmullRom, 3-Bezier, 4-LinearVar, 5-BezierVar + bool splineTypeEditMode = false; bool splineHelpersActive = true; - + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -100,10 +113,79 @@ int main(void) pointCount++; } + focusedPoint = selectedPoint; + focusedThickPoint = selectedThickPoint; + focusedControlPoint = selectedControlPoint; + + // Variable thickness control points logic (thickness controls are smaller so they have higher priority) + if ((selectedThickPoint == -1) && (selectedPoint == -1) && (selectedControlPoint == NULL)) + { + if (splineTypeActive == SPLINE_LINEAR_VAR) + { + for (int i = 0; i < pointCount - 1; i++) + { + Vector2 direction = Vector2Normalize(GetSplineVelocityLinear(points[i], points[i + 1])); + Vector2 perpendicular = (Vector2){ direction.y, -direction.x }; + + for (int j = 0; j < SPLINE_THICK_COUNT; j++) + { + float t = (float)j/(SPLINE_THICK_COUNT - 1); + Vector2 point = Vector2Add(GetSplinePointLinear(points[i], points[i + 1], t), Vector2Scale(perpendicular, thicks[j])); + if (CheckCollisionPointCircle(GetMousePosition(), point, 4.0f)) { + focusedThickPoint = i*SPLINE_THICK_COUNT + j; + break; + } + } + } + } + else if (splineTypeActive == SPLINE_BEZIER_VAR) + { + for (int i = 0; i < pointCount - 1; i++) + { + for (int j = 0; j < SPLINE_THICK_COUNT; j++) + { + float t = (float)j/(SPLINE_THICK_COUNT - 1); + Vector2 direction = Vector2Normalize(GetSplineVelocityBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], t)); + Vector2 perpendicular = (Vector2){ direction.y, -direction.x }; + Vector2 point = Vector2Add(GetSplinePointBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], t), Vector2Scale(perpendicular, thicks[j])); + if (CheckCollisionPointCircle(GetMousePosition(), point, 4.0f)) { + focusedThickPoint = i*SPLINE_THICK_COUNT + j; + break; + } + } + } + } + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedThickPoint = focusedThickPoint; + } + + // Spline thickness movement logic + if (selectedThickPoint >= 0) + { + int i = selectedThickPoint/SPLINE_THICK_COUNT; + int j = selectedThickPoint%SPLINE_THICK_COUNT; + if (splineTypeActive == SPLINE_LINEAR_VAR) + { + Vector2 direction = Vector2Normalize(GetSplineVelocityLinear(points[i], points[i + 1])); + Vector2 perpendicular = (Vector2){ direction.y, -direction.x }; + + thicks[j] = Vector2DotProduct(perpendicular, Vector2Subtract(GetMousePosition(), points[i])); + } + else if (splineTypeActive == SPLINE_BEZIER_VAR) + { + float t = (float)j/(SPLINE_THICK_COUNT - 1); + Vector2 direction = Vector2Normalize(GetSplineVelocityBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], t)); + Vector2 perpendicular = (Vector2){ direction.y, -direction.x }; + + thicks[j] = Vector2DotProduct(perpendicular, Vector2Subtract(GetMousePosition(), GetSplinePointBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], t))); + } + if (thicks[j] > 40.0f) thicks[j] = 40.0f; + if (thicks[j] < -40.0f) thicks[j] = -40.0f; + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) selectedThickPoint = -1; + } + // Spline point focus and selection logic - if ((selectedPoint == -1) && ((splineTypeActive != SPLINE_BEZIER) || (selectedControlPoint == NULL))) + if ((selectedPoint == -1) && (focusedThickPoint == -1) && (((splineTypeActive != SPLINE_BEZIER) && (splineTypeActive != SPLINE_BEZIER_VAR)) || (selectedControlPoint == NULL))) { - focusedPoint = -1; for (int i = 0; i < pointCount; i++) { if (CheckCollisionPointCircle(GetMousePosition(), points[i], 8.0f)) @@ -114,53 +196,61 @@ int main(void) } if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedPoint = focusedPoint; } - + // Spline point movement logic if (selectedPoint >= 0) { points[selectedPoint] = GetMousePosition(); + if (points[selectedPoint].x < 0.0f) points[selectedPoint].x = 0.0f; + if (points[selectedPoint].x > screenWidth) points[selectedPoint].x = screenWidth; + if (points[selectedPoint].y < 0.0f) points[selectedPoint].y = 0.0f; + if (points[selectedPoint].y > screenHeight) points[selectedPoint].y = screenHeight; if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) selectedPoint = -1; } - + // Cubic Bezier spline control points logic - if ((splineTypeActive == SPLINE_BEZIER) && (focusedPoint == -1)) + if (((splineTypeActive == SPLINE_BEZIER) || (splineTypeActive == SPLINE_BEZIER_VAR)) && (selectedControlPoint == NULL) && (focusedPoint == -1) && (selectedThickPoint == -1)) { - // Spline control point focus and selection logic - if (selectedControlPoint == NULL) + for (int i = 0; i < pointCount - 1; i++) { - focusedControlPoint = NULL; - for (int i = 0; i < pointCount - 1; i++) + if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f)) { - if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f)) - { - focusedControlPoint = &control[i].start; - break; - } - else if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f)) - { - focusedControlPoint = &control[i].end; - break; - } + focusedControlPoint = &control[i].start; + break; + } + else if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f)) + { + focusedControlPoint = &control[i].end; + break; } - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedControlPoint = focusedControlPoint; - } - - // Spline control point movement logic - if (selectedControlPoint != NULL) - { - *selectedControlPoint = GetMousePosition(); - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) selectedControlPoint = NULL; } + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedControlPoint = focusedControlPoint; } - + + // Spline control point movement logic + if (selectedControlPoint != NULL) + { + *selectedControlPoint = GetMousePosition(); + if (selectedControlPoint->x < 0.0f) selectedControlPoint->x = 0.0f; + if (selectedControlPoint->x > screenWidth) selectedControlPoint->x = screenWidth; + if (selectedControlPoint->y < 0.0f) selectedControlPoint->y = 0.0f; + if (selectedControlPoint->y > screenHeight) selectedControlPoint->y = screenHeight; + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) selectedControlPoint = NULL; + } + // Spline selection logic - if (IsKeyPressed(KEY_ONE)) splineTypeActive = 0; - else if (IsKeyPressed(KEY_TWO)) splineTypeActive = 1; - else if (IsKeyPressed(KEY_THREE)) splineTypeActive = 2; - else if (IsKeyPressed(KEY_FOUR)) splineTypeActive = 3; + if (IsKeyPressed(KEY_ONE)) splineTypeActive = SPLINE_LINEAR; + else if (IsKeyPressed(KEY_TWO)) splineTypeActive = SPLINE_BASIS; + else if (IsKeyPressed(KEY_THREE)) splineTypeActive = SPLINE_CATMULLROM; + else if (IsKeyPressed(KEY_FOUR)) splineTypeActive = SPLINE_BEZIER; + else if (IsKeyPressed(KEY_FIVE)) splineTypeActive = SPLINE_LINEAR_VAR; + else if (IsKeyPressed(KEY_SIX)) splineTypeActive = SPLINE_BEZIER_VAR; - // Clear selection when changing to a spline without control points - if (IsKeyPressed(KEY_ONE) || IsKeyPressed(KEY_TWO) || IsKeyPressed(KEY_THREE)) selectedControlPoint = NULL; + // Clear control point selection when changing to a spline without control points + if ((splineTypeActive != SPLINE_BEZIER) && (splineTypeActive != SPLINE_BEZIER_VAR)) selectedControlPoint = NULL; + + // Clear thickness selection when changing splines + if (IsKeyPressed(KEY_ONE) || IsKeyPressed(KEY_TWO) || IsKeyPressed(KEY_THREE) || IsKeyPressed(KEY_FOUR) || IsKeyPressed(KEY_FIVE) || IsKeyPressed(KEY_SIX)) selectedThickPoint = -1; //---------------------------------------------------------------------------------- // Draw @@ -168,7 +258,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + if (splineTypeActive == SPLINE_LINEAR) { // Draw spline: linear @@ -191,7 +281,7 @@ int main(void) { // Draw spline: catmull-rom DrawSplineCatmullRom(points, pointCount, splineThickness, RED); // Provide connected points array - + /* for (int i = 0; i < (pointCount - 3); i++) { @@ -202,20 +292,20 @@ int main(void) } else if (splineTypeActive == SPLINE_BEZIER) { - // NOTE: Cubic-bezier spline requires the 2 control points of each segnment to be + // NOTE: Cubic-bezier spline requires the 2 control points of each segnment to be // provided interleaved with the start and end point of every segment - for (int i = 0; i < (pointCount - 1); i++) + for (int i = 0; i < (pointCount - 1); i++) { pointsInterleaved[3*i] = points[i]; pointsInterleaved[3*i + 1] = control[i].start; pointsInterleaved[3*i + 2] = control[i].end; } - + pointsInterleaved[3*(pointCount - 1)] = points[pointCount - 1]; // Draw spline: cubic-bezier (with control points) DrawSplineBezierCubic(pointsInterleaved, 3*(pointCount - 1) + 1, splineThickness, RED); - + /* for (int i = 0; i < 3*(pointCount - 1); i += 3) { @@ -223,7 +313,37 @@ int main(void) DrawSplineSegmentBezierCubic(pointsInterleaved[i], pointsInterleaved[i + 1], pointsInterleaved[i + 2], pointsInterleaved[i + 3], splineThickness, MAROON); } */ + } + else if (splineTypeActive == SPLINE_LINEAR_VAR) + { + // Draw spline: variable-width linear + for (int i = 0; i < pointCount - 1; ++i) + { + DrawSplineSegmentLinearVar(points[i], points[i + 1], thicks, SPLINE_THICK_COUNT, RED); + } + } + else if (splineTypeActive == SPLINE_BEZIER_VAR) + { + // NOTE: Cubic-bezier spline requires the 2 control points of each segnment to be + // provided interleaved with the start and end point of every segment + for (int i = 0; i < (pointCount - 1); i++) + { + pointsInterleaved[3*i] = points[i]; + pointsInterleaved[3*i + 1] = control[i].start; + pointsInterleaved[3*i + 2] = control[i].end; + } + + pointsInterleaved[3*(pointCount - 1)] = points[pointCount - 1]; + // Draw spline: variable-width cubic-bezier (with control points) + for (int i = 0; i < pointCount - 1; ++i) + { + DrawSplineSegmentBezierCubicVar(points[i], control[i].start, control[i].end, points[i + 1], thicks, SPLINE_THICK_COUNT, RED); + } + } + + if ((splineTypeActive == SPLINE_BEZIER) || (splineTypeActive == SPLINE_BEZIER_VAR)) + { // Draw spline control points for (int i = 0; i < pointCount - 1; i++) { @@ -234,7 +354,7 @@ int main(void) else if (focusedControlPoint == &control[i].end) DrawCircleV(control[i].end, 8, GREEN); DrawLineEx(points[i], control[i].start, 1.0f, LIGHTGRAY); DrawLineEx(points[i + 1], control[i].end, 1.0f, LIGHTGRAY); - + // Draw spline control lines DrawLineV(points[i], control[i].start, GRAY); //DrawLineV(control[i].start, control[i].end, LIGHTGRAY); @@ -249,27 +369,86 @@ int main(void) { DrawCircleLinesV(points[i], (focusedPoint == i)? 12.0f : 8.0f, (focusedPoint == i)? BLUE: DARKBLUE); if ((splineTypeActive != SPLINE_LINEAR) && + (splineTypeActive != SPLINE_LINEAR_VAR) && (splineTypeActive != SPLINE_BEZIER) && + (splineTypeActive != SPLINE_BEZIER_VAR) && (i < pointCount - 1)) DrawLineV(points[i], points[i + 1], GRAY); DrawText(TextFormat("[%.0f, %.0f]", points[i].x, points[i].y), (int)points[i].x, (int)points[i].y + 10, 10, BLACK); } + + // Draw spline thickness helpers + if (splineTypeActive == SPLINE_LINEAR_VAR) + { + Vector2 thickPoints[SPLINE_THICK_COUNT] = { 0 }; + + for (int i = 0; i < pointCount - 1; i++) + { + DrawLineV(points[i], points[i + 1], BROWN); + + Vector2 direction = Vector2Normalize(GetSplineVelocityLinear(points[i], points[i + 1])); + Vector2 perpendicular = (Vector2){ direction.y, -direction.x }; + for (int j = 0; j < SPLINE_THICK_COUNT; j++) + { + float t = (float)j/(SPLINE_THICK_COUNT - 1); + Vector2 anchor = GetSplinePointLinear(points[i], points[i + 1], t); + thickPoints[j] = Vector2Add(anchor, Vector2Scale(perpendicular, thicks[j])); + DrawLineV(anchor, thickPoints[j], SKYBLUE); + DrawCircleV(thickPoints[j], (((focusedThickPoint%SPLINE_THICK_COUNT) == j)? 6.0f : 4.0f), (((focusedThickPoint%SPLINE_THICK_COUNT) == j)? VIOLET : PURPLE)); + } + + DrawSplineBezierCubic(thickPoints, SPLINE_THICK_COUNT, 1.0f, ORANGE); + } + } + else if (splineTypeActive == SPLINE_BEZIER_VAR) + { + for (int i = 0; i < pointCount - 1; i++) + { + DrawSplineSegmentBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], 1.0f, BROWN); + + for (int j = 0; j < SPLINE_THICK_COUNT; j++) + { + float t = (float)j/(SPLINE_THICK_COUNT - 1); + Vector2 direction = Vector2Normalize(GetSplineVelocityBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], t)); + Vector2 perpendicular = (Vector2){ direction.y, -direction.x }; + Vector2 anchor = GetSplinePointBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], t); + Vector2 thickPoint = Vector2Add(anchor, Vector2Scale(perpendicular, thicks[j])); + DrawLineV(anchor, thickPoint, SKYBLUE); + DrawCircleV(thickPoint, (((focusedThickPoint%SPLINE_THICK_COUNT) == j)? 6.0f : 4.0f), (((focusedThickPoint%SPLINE_THICK_COUNT) == j)? VIOLET : PURPLE)); + } + + // I tried: outlining the thickness isn't possible. + // A variable-thickness Bezier curve can potentially have more detail than can + // be expressed with another Bezier curve of the same degree. + // Example: https://www.desmos.com/calculator/qh31vr4rbf + } + } } // Check all possible UI states that require controls lock - if (splineTypeEditMode || (selectedPoint != -1) || (selectedControlPoint != NULL)) GuiLock(); - + if (splineTypeEditMode || (selectedPoint != -1) || (selectedThickPoint != -1) || (selectedControlPoint != NULL)) 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); + if ((splineTypeActive == SPLINE_LINEAR_VAR) || (splineTypeActive == SPLINE_BEZIER_VAR)) + { + GuiLabel((Rectangle){ 12, 68 + 24, 200, 24 }, TextFormat("Spline thickness: %i, %i, %i, %i", (int)thicks[0], (int)thicks[1], (int)thicks[2], (int)thicks[3])); + GuiSlider((Rectangle){ 12, 68 + 48, 140, 16 }, NULL, NULL, &thicks[0], -40.0, 40.0f); + GuiSlider((Rectangle){ 12, 68 + 48 + 20, 140, 16 }, NULL, NULL, &thicks[1], -40.0, 40.0f); + GuiSlider((Rectangle){ 12, 68 + 48 + 40, 140, 16 }, NULL, NULL, &thicks[2], -40.0, 40.0f); + GuiSlider((Rectangle){ 12, 68 + 48 + 60, 140, 16 }, NULL, NULL, &thicks[3], -40.0, 40.0f); + } + else + { + GuiLabel((Rectangle){ 12, 68 + 24, 140, 24 }, TextFormat("Spline thickness: %i", (int)splineThickness)); + GuiSliderBar((Rectangle){ 12, 68 + 48, 140, 16 }, NULL, NULL, &splineThickness, 1.0f, 40.0f); + } - GuiCheckBox((Rectangle){ 12, 110, 20, 20 }, "Show point helpers", &splineHelpersActive); + GuiCheckBox((Rectangle){ 12, 68, 20, 20 }, "Show point helpers", &splineHelpersActive); if (splineTypeEditMode) 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; - + if (GuiDropdownBox((Rectangle){ 12, 8 + 24, 140, 28 }, "LINEAR;BSPLINE;CATMULLROM;BEZIER;LINEAR VARIABLE;BEZIER VARIABLE", &splineTypeActive, splineTypeEditMode)) splineTypeEditMode = !splineTypeEditMode; GuiUnlock(); EndDrawing(); diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 9d85c3135778..8fdc47d6f5e1 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -6564,6 +6564,68 @@ } ] }, + { + "name": "DrawSplineSegmentLinearVar", + "description": "Draw spline segment with variable thickness: Linear Bezier, 2 points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "const float*", + "name": "thicks" + }, + { + "type": "int", + "name": "thickCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineSegmentBezierCubicVar", + "description": "Draw spline segment with variable thickness: Cubic Bezier, 2 points, 2 control points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "c2" + }, + { + "type": "Vector2", + "name": "c3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "const float*", + "name": "thicks" + }, + { + "type": "int", + "name": "thickCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "GetSplinePointLinear", "description": "Get (evaluate) spline point: Linear", @@ -6687,6 +6749,297 @@ } ] }, + { + "name": "GetSplineControlBezierQuad", + "description": "Get (evaluate) spline control point: Quadratic Bezier", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "midPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Vector2 *", + "name": "controlPos" + } + ] + }, + { + "name": "GetSplineControlBezierCubic", + "description": "Get (evaluate) spline control points: Cubic Bezier", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "oneThirdsPos" + }, + { + "type": "Vector2", + "name": "twoThirdsPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Vector2 *", + "name": "startControlPos" + }, + { + "type": "Vector2 *", + "name": "endControlPos" + } + ] + }, + { + "name": "GetSplineVelocityLinear", + "description": "Get (evaluate) spline velocity: Linear", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + } + ] + }, + { + "name": "GetSplineVelocityBezierQuad", + "description": "Get (evaluate) spline velocity: Quadratic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "controlPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplineVelocityBezierCubic", + "description": "Get (evaluate) spline velocity: Cubic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "startControlPos" + }, + { + "type": "Vector2", + "name": "endControlPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplineAccelerationBezierQuad", + "description": "Get (evaluate) spline acceleration: Quadratic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "controlPos" + }, + { + "type": "Vector2", + "name": "endPos" + } + ] + }, + { + "name": "GetSplineAccelerationBezierCubic", + "description": "Get (evaluate) spline acceleration: Cubic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "startControlPos" + }, + { + "type": "Vector2", + "name": "endControlPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplineJoltBezierCubic", + "description": "Get (evaluate) spline jolt: Cubic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "startControlPos" + }, + { + "type": "Vector2", + "name": "endControlPos" + }, + { + "type": "Vector2", + "name": "endPos" + } + ] + }, + { + "name": "GetSplineBoundsBezierLinear", + "description": "Get (evaluate) spline bounds rectangle: Linear", + "returnType": "Rectangle", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + } + ] + }, + { + "name": "GetSplineBoundsBezierQuad", + "description": "Get (evaluate) spline bounds rectangle: Quadratic Bezier", + "returnType": "Rectangle", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "controlPos" + }, + { + "type": "Vector2", + "name": "endPos" + } + ] + }, + { + "name": "GetSplineBoundsBezierCubic", + "description": "Get (evaluate) spline bounds rectangle: Cubic Bezier", + "returnType": "Rectangle", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "startControlPos" + }, + { + "type": "Vector2", + "name": "endControlPos" + }, + { + "type": "Vector2", + "name": "endPos" + } + ] + }, + { + "name": "GetSplineCurvatureBezierCubic", + "description": "Get (evaluate) spline curvature: Cubic Bezier", + "returnType": "float", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "startControlPos" + }, + { + "type": "Vector2", + "name": "endControlPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplineNearestTLinear", + "description": "Get (evaluate) nearest t value to point: Linear", + "returnType": "float", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Vector2", + "name": "point" + } + ] + }, { "name": "CheckCollisionRecs", "description": "Check collision between two rectangles", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 985a62c8b9fc..519f36d5b6ba 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5232,6 +5232,32 @@ return { {type = "Color", name = "color"} } }, + { + name = "DrawSplineSegmentLinearVar", + description = "Draw spline segment with variable thickness: Linear Bezier, 2 points", + returnType = "void", + params = { + {type = "Vector2", name = "p1"}, + {type = "Vector2", name = "p2"}, + {type = "const float*", name = "thicks"}, + {type = "int", name = "thickCount"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawSplineSegmentBezierCubicVar", + description = "Draw spline segment with variable thickness: Cubic Bezier, 2 points, 2 control points", + returnType = "void", + params = { + {type = "Vector2", name = "p1"}, + {type = "Vector2", name = "c2"}, + {type = "Vector2", name = "c3"}, + {type = "Vector2", name = "p4"}, + {type = "const float*", name = "thicks"}, + {type = "int", name = "thickCount"}, + {type = "Color", name = "color"} + } + }, { name = "GetSplinePointLinear", description = "Get (evaluate) spline point: Linear", @@ -5289,6 +5315,147 @@ return { {type = "float", name = "t"} } }, + { + name = "GetSplineControlBezierQuad", + description = "Get (evaluate) spline control point: Quadratic Bezier", + returnType = "void", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "midPos"}, + {type = "Vector2", name = "endPos"}, + {type = "Vector2 *", name = "controlPos"} + } + }, + { + name = "GetSplineControlBezierCubic", + description = "Get (evaluate) spline control points: Cubic Bezier", + returnType = "void", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "oneThirdsPos"}, + {type = "Vector2", name = "twoThirdsPos"}, + {type = "Vector2", name = "endPos"}, + {type = "Vector2 *", name = "startControlPos"}, + {type = "Vector2 *", name = "endControlPos"} + } + }, + { + name = "GetSplineVelocityLinear", + description = "Get (evaluate) spline velocity: Linear", + returnType = "Vector2", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "endPos"} + } + }, + { + name = "GetSplineVelocityBezierQuad", + description = "Get (evaluate) spline velocity: Quadratic Bezier", + returnType = "Vector2", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "controlPos"}, + {type = "Vector2", name = "endPos"}, + {type = "float", name = "t"} + } + }, + { + name = "GetSplineVelocityBezierCubic", + description = "Get (evaluate) spline velocity: Cubic Bezier", + returnType = "Vector2", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "startControlPos"}, + {type = "Vector2", name = "endControlPos"}, + {type = "Vector2", name = "endPos"}, + {type = "float", name = "t"} + } + }, + { + name = "GetSplineAccelerationBezierQuad", + description = "Get (evaluate) spline acceleration: Quadratic Bezier", + returnType = "Vector2", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "controlPos"}, + {type = "Vector2", name = "endPos"} + } + }, + { + name = "GetSplineAccelerationBezierCubic", + description = "Get (evaluate) spline acceleration: Cubic Bezier", + returnType = "Vector2", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "startControlPos"}, + {type = "Vector2", name = "endControlPos"}, + {type = "Vector2", name = "endPos"}, + {type = "float", name = "t"} + } + }, + { + name = "GetSplineJoltBezierCubic", + description = "Get (evaluate) spline jolt: Cubic Bezier", + returnType = "Vector2", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "startControlPos"}, + {type = "Vector2", name = "endControlPos"}, + {type = "Vector2", name = "endPos"} + } + }, + { + name = "GetSplineBoundsBezierLinear", + description = "Get (evaluate) spline bounds rectangle: Linear", + returnType = "Rectangle", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "endPos"} + } + }, + { + name = "GetSplineBoundsBezierQuad", + description = "Get (evaluate) spline bounds rectangle: Quadratic Bezier", + returnType = "Rectangle", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "controlPos"}, + {type = "Vector2", name = "endPos"} + } + }, + { + name = "GetSplineBoundsBezierCubic", + description = "Get (evaluate) spline bounds rectangle: Cubic Bezier", + returnType = "Rectangle", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "startControlPos"}, + {type = "Vector2", name = "endControlPos"}, + {type = "Vector2", name = "endPos"} + } + }, + { + name = "GetSplineCurvatureBezierCubic", + description = "Get (evaluate) spline curvature: Cubic Bezier", + returnType = "float", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "startControlPos"}, + {type = "Vector2", name = "endControlPos"}, + {type = "Vector2", name = "endPos"}, + {type = "float", name = "t"} + } + }, + { + name = "GetSplineNearestTLinear", + description = "Get (evaluate) nearest t value to point: Linear", + returnType = "float", + params = { + {type = "Vector2", name = "startPos"}, + {type = "Vector2", name = "endPos"}, + {type = "Vector2", name = "point"} + } + }, { name = "CheckCollisionRecs", description = "Check collision between two rectangles", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 2f9268cbf07f..8bcfd0897ac1 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -993,7 +993,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 584 +Functions found: 599 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -2544,14 +2544,34 @@ Function 261: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 262: GetSplinePointLinear() (3 input parameters) +Function 262: DrawSplineSegmentLinearVar() (5 input parameters) + Name: DrawSplineSegmentLinearVar + Return type: void + Description: Draw spline segment with variable thickness: Linear Bezier, 2 points + Param[1]: p1 (type: Vector2) + Param[2]: p2 (type: Vector2) + Param[3]: thicks (type: const float*) + Param[4]: thickCount (type: int) + Param[5]: color (type: Color) +Function 263: DrawSplineSegmentBezierCubicVar() (7 input parameters) + Name: DrawSplineSegmentBezierCubicVar + Return type: void + Description: Draw spline segment with variable thickness: Cubic Bezier, 2 points, 2 control points + Param[1]: p1 (type: Vector2) + Param[2]: c2 (type: Vector2) + Param[3]: c3 (type: Vector2) + Param[4]: p4 (type: Vector2) + Param[5]: thicks (type: const float*) + Param[6]: thickCount (type: int) + Param[7]: color (type: Color) +Function 264: GetSplinePointLinear() (3 input parameters) Name: GetSplinePointLinear Return type: Vector2 Description: Get (evaluate) spline point: Linear Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: t (type: float) -Function 263: GetSplinePointBasis() (5 input parameters) +Function 265: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2560,7 +2580,7 @@ Function 263: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 264: GetSplinePointCatmullRom() (5 input parameters) +Function 266: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2569,7 +2589,7 @@ Function 264: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 265: GetSplinePointBezierQuad() (4 input parameters) +Function 267: GetSplinePointBezierQuad() (4 input parameters) Name: GetSplinePointBezierQuad Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2577,7 +2597,7 @@ Function 265: GetSplinePointBezierQuad() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 266: GetSplinePointBezierCubic() (5 input parameters) +Function 268: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2586,13 +2606,115 @@ Function 266: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 267: CheckCollisionRecs() (2 input parameters) +Function 269: GetSplineControlBezierQuad() (4 input parameters) + Name: GetSplineControlBezierQuad + Return type: void + Description: Get (evaluate) spline control point: Quadratic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: midPos (type: Vector2) + Param[3]: endPos (type: Vector2) + Param[4]: controlPos (type: Vector2 *) +Function 270: GetSplineControlBezierCubic() (6 input parameters) + Name: GetSplineControlBezierCubic + Return type: void + Description: Get (evaluate) spline control points: Cubic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: oneThirdsPos (type: Vector2) + Param[3]: twoThirdsPos (type: Vector2) + Param[4]: endPos (type: Vector2) + Param[5]: startControlPos (type: Vector2 *) + Param[6]: endControlPos (type: Vector2 *) +Function 271: GetSplineVelocityLinear() (2 input parameters) + Name: GetSplineVelocityLinear + Return type: Vector2 + Description: Get (evaluate) spline velocity: Linear + Param[1]: startPos (type: Vector2) + Param[2]: endPos (type: Vector2) +Function 272: GetSplineVelocityBezierQuad() (4 input parameters) + Name: GetSplineVelocityBezierQuad + Return type: Vector2 + Description: Get (evaluate) spline velocity: Quadratic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: controlPos (type: Vector2) + Param[3]: endPos (type: Vector2) + Param[4]: t (type: float) +Function 273: GetSplineVelocityBezierCubic() (5 input parameters) + Name: GetSplineVelocityBezierCubic + Return type: Vector2 + Description: Get (evaluate) spline velocity: Cubic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: startControlPos (type: Vector2) + Param[3]: endControlPos (type: Vector2) + Param[4]: endPos (type: Vector2) + Param[5]: t (type: float) +Function 274: GetSplineAccelerationBezierQuad() (3 input parameters) + Name: GetSplineAccelerationBezierQuad + Return type: Vector2 + Description: Get (evaluate) spline acceleration: Quadratic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: controlPos (type: Vector2) + Param[3]: endPos (type: Vector2) +Function 275: GetSplineAccelerationBezierCubic() (5 input parameters) + Name: GetSplineAccelerationBezierCubic + Return type: Vector2 + Description: Get (evaluate) spline acceleration: Cubic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: startControlPos (type: Vector2) + Param[3]: endControlPos (type: Vector2) + Param[4]: endPos (type: Vector2) + Param[5]: t (type: float) +Function 276: GetSplineJoltBezierCubic() (4 input parameters) + Name: GetSplineJoltBezierCubic + Return type: Vector2 + Description: Get (evaluate) spline jolt: Cubic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: startControlPos (type: Vector2) + Param[3]: endControlPos (type: Vector2) + Param[4]: endPos (type: Vector2) +Function 277: GetSplineBoundsBezierLinear() (2 input parameters) + Name: GetSplineBoundsBezierLinear + Return type: Rectangle + Description: Get (evaluate) spline bounds rectangle: Linear + Param[1]: startPos (type: Vector2) + Param[2]: endPos (type: Vector2) +Function 278: GetSplineBoundsBezierQuad() (3 input parameters) + Name: GetSplineBoundsBezierQuad + Return type: Rectangle + Description: Get (evaluate) spline bounds rectangle: Quadratic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: controlPos (type: Vector2) + Param[3]: endPos (type: Vector2) +Function 279: GetSplineBoundsBezierCubic() (4 input parameters) + Name: GetSplineBoundsBezierCubic + Return type: Rectangle + Description: Get (evaluate) spline bounds rectangle: Cubic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: startControlPos (type: Vector2) + Param[3]: endControlPos (type: Vector2) + Param[4]: endPos (type: Vector2) +Function 280: GetSplineCurvatureBezierCubic() (5 input parameters) + Name: GetSplineCurvatureBezierCubic + Return type: float + Description: Get (evaluate) spline curvature: Cubic Bezier + Param[1]: startPos (type: Vector2) + Param[2]: startControlPos (type: Vector2) + Param[3]: endControlPos (type: Vector2) + Param[4]: endPos (type: Vector2) + Param[5]: t (type: float) +Function 281: GetSplineNearestTLinear() (3 input parameters) + Name: GetSplineNearestTLinear + Return type: float + Description: Get (evaluate) nearest t value to point: Linear + Param[1]: startPos (type: Vector2) + Param[2]: endPos (type: Vector2) + Param[3]: point (type: Vector2) +Function 282: CheckCollisionRecs() (2 input parameters) Name: CheckCollisionRecs Return type: bool Description: Check collision between two rectangles Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 268: CheckCollisionCircles() (4 input parameters) +Function 283: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2600,14 +2722,14 @@ Function 268: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 269: CheckCollisionCircleRec() (3 input parameters) +Function 284: CheckCollisionCircleRec() (3 input parameters) Name: CheckCollisionCircleRec Return type: bool Description: Check collision between circle and rectangle Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: rec (type: Rectangle) -Function 270: CheckCollisionCircleLine() (4 input parameters) +Function 285: CheckCollisionCircleLine() (4 input parameters) Name: CheckCollisionCircleLine Return type: bool Description: Check if circle collides with a line created betweeen two points [p1] and [p2] @@ -2615,20 +2737,20 @@ Function 270: CheckCollisionCircleLine() (4 input parameters) Param[2]: radius (type: float) Param[3]: p1 (type: Vector2) Param[4]: p2 (type: Vector2) -Function 271: CheckCollisionPointRec() (2 input parameters) +Function 286: CheckCollisionPointRec() (2 input parameters) Name: CheckCollisionPointRec Return type: bool Description: Check if point is inside rectangle Param[1]: point (type: Vector2) Param[2]: rec (type: Rectangle) -Function 272: CheckCollisionPointCircle() (3 input parameters) +Function 287: CheckCollisionPointCircle() (3 input parameters) Name: CheckCollisionPointCircle Return type: bool Description: Check if point is inside circle Param[1]: point (type: Vector2) Param[2]: center (type: Vector2) Param[3]: radius (type: float) -Function 273: CheckCollisionPointTriangle() (4 input parameters) +Function 288: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2636,7 +2758,7 @@ Function 273: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 274: CheckCollisionPointLine() (4 input parameters) +Function 289: CheckCollisionPointLine() (4 input parameters) Name: CheckCollisionPointLine Return type: bool Description: Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] @@ -2644,14 +2766,14 @@ Function 274: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 275: CheckCollisionPointPoly() (3 input parameters) +Function 290: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 276: CheckCollisionLines() (5 input parameters) +Function 291: CheckCollisionLines() (5 input parameters) Name: CheckCollisionLines Return type: bool Description: Check the collision between two lines defined by two points each, returns collision point by reference @@ -2660,18 +2782,18 @@ Function 276: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 277: GetCollisionRec() (2 input parameters) +Function 292: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle Description: Get collision rectangle for two rectangles collision Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 278: LoadImage() (1 input parameters) +Function 293: LoadImage() (1 input parameters) Name: LoadImage Return type: Image Description: Load image from file into CPU memory (RAM) Param[1]: fileName (type: const char *) -Function 279: LoadImageRaw() (5 input parameters) +Function 294: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2680,13 +2802,13 @@ Function 279: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 280: LoadImageAnim() (2 input parameters) +Function 295: LoadImageAnim() (2 input parameters) Name: LoadImageAnim Return type: Image Description: Load image sequence from file (frames appended to image.data) Param[1]: fileName (type: const char *) Param[2]: frames (type: int *) -Function 281: LoadImageAnimFromMemory() (4 input parameters) +Function 296: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2694,60 +2816,60 @@ Function 281: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 282: LoadImageFromMemory() (3 input parameters) +Function 297: LoadImageFromMemory() (3 input parameters) Name: LoadImageFromMemory Return type: Image Description: Load image from memory buffer, fileType refers to extension: i.e. '.png' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 283: LoadImageFromTexture() (1 input parameters) +Function 298: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 284: LoadImageFromScreen() (0 input parameters) +Function 299: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 285: IsImageValid() (1 input parameters) +Function 300: IsImageValid() (1 input parameters) Name: IsImageValid Return type: bool Description: Check if an image is valid (data and parameters) Param[1]: image (type: Image) -Function 286: UnloadImage() (1 input parameters) +Function 301: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 287: ExportImage() (2 input parameters) +Function 302: ExportImage() (2 input parameters) Name: ExportImage Return type: bool Description: Export image data to file, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 288: ExportImageToMemory() (3 input parameters) +Function 303: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 289: ExportImageAsCode() (2 input parameters) +Function 304: ExportImageAsCode() (2 input parameters) Name: ExportImageAsCode Return type: bool Description: Export image as code file defining an array of bytes, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 290: GenImageColor() (3 input parameters) +Function 305: GenImageColor() (3 input parameters) Name: GenImageColor Return type: Image Description: Generate image: plain color Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 291: GenImageGradientLinear() (5 input parameters) +Function 306: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2756,7 +2878,7 @@ Function 291: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 292: GenImageGradientRadial() (5 input parameters) +Function 307: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2765,7 +2887,7 @@ Function 292: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 293: GenImageGradientSquare() (5 input parameters) +Function 308: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2774,7 +2896,7 @@ Function 293: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 294: GenImageChecked() (6 input parameters) +Function 309: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2784,14 +2906,14 @@ Function 294: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 295: GenImageWhiteNoise() (3 input parameters) +Function 310: GenImageWhiteNoise() (3 input parameters) Name: GenImageWhiteNoise Return type: Image Description: Generate image: white noise Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: factor (type: float) -Function 296: GenImagePerlinNoise() (5 input parameters) +Function 311: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2800,45 +2922,45 @@ Function 296: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 297: GenImageCellular() (3 input parameters) +Function 312: GenImageCellular() (3 input parameters) Name: GenImageCellular Return type: Image Description: Generate image: cellular algorithm, bigger tileSize means bigger cells Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: tileSize (type: int) -Function 298: GenImageText() (3 input parameters) +Function 313: GenImageText() (3 input parameters) Name: GenImageText Return type: Image Description: Generate image: grayscale image from text data Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: text (type: const char *) -Function 299: ImageCopy() (1 input parameters) +Function 314: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 300: ImageFromImage() (2 input parameters) +Function 315: ImageFromImage() (2 input parameters) Name: ImageFromImage Return type: Image Description: Create an image from another image piece Param[1]: image (type: Image) Param[2]: rec (type: Rectangle) -Function 301: ImageFromChannel() (2 input parameters) +Function 316: ImageFromChannel() (2 input parameters) Name: ImageFromChannel Return type: Image Description: Create an image from a selected channel of another image (GRAYSCALE) Param[1]: image (type: Image) Param[2]: selectedChannel (type: int) -Function 302: ImageText() (3 input parameters) +Function 317: ImageText() (3 input parameters) Name: ImageText Return type: Image Description: Create an image from text (default font) Param[1]: text (type: const char *) Param[2]: fontSize (type: int) Param[3]: color (type: Color) -Function 303: ImageTextEx() (5 input parameters) +Function 318: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2847,76 +2969,76 @@ Function 303: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 304: ImageFormat() (2 input parameters) +Function 319: ImageFormat() (2 input parameters) Name: ImageFormat Return type: void Description: Convert image data to desired format Param[1]: image (type: Image *) Param[2]: newFormat (type: int) -Function 305: ImageToPOT() (2 input parameters) +Function 320: ImageToPOT() (2 input parameters) Name: ImageToPOT Return type: void Description: Convert image to POT (power-of-two) Param[1]: image (type: Image *) Param[2]: fill (type: Color) -Function 306: ImageCrop() (2 input parameters) +Function 321: ImageCrop() (2 input parameters) Name: ImageCrop Return type: void Description: Crop an image to a defined rectangle Param[1]: image (type: Image *) Param[2]: crop (type: Rectangle) -Function 307: ImageAlphaCrop() (2 input parameters) +Function 322: ImageAlphaCrop() (2 input parameters) Name: ImageAlphaCrop Return type: void Description: Crop image depending on alpha value Param[1]: image (type: Image *) Param[2]: threshold (type: float) -Function 308: ImageAlphaClear() (3 input parameters) +Function 323: ImageAlphaClear() (3 input parameters) Name: ImageAlphaClear Return type: void Description: Clear alpha channel to desired color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: threshold (type: float) -Function 309: ImageAlphaMask() (2 input parameters) +Function 324: ImageAlphaMask() (2 input parameters) Name: ImageAlphaMask Return type: void Description: Apply alpha mask to image Param[1]: image (type: Image *) Param[2]: alphaMask (type: Image) -Function 310: ImageAlphaPremultiply() (1 input parameters) +Function 325: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 311: ImageBlurGaussian() (2 input parameters) +Function 326: ImageBlurGaussian() (2 input parameters) Name: ImageBlurGaussian Return type: void Description: Apply Gaussian blur using a box blur approximation Param[1]: image (type: Image *) Param[2]: blurSize (type: int) -Function 312: ImageKernelConvolution() (3 input parameters) +Function 327: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) -Function 313: ImageResize() (3 input parameters) +Function 328: ImageResize() (3 input parameters) Name: ImageResize Return type: void Description: Resize image (Bicubic scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 314: ImageResizeNN() (3 input parameters) +Function 329: ImageResizeNN() (3 input parameters) Name: ImageResizeNN Return type: void Description: Resize image (Nearest-Neighbor scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 315: ImageResizeCanvas() (6 input parameters) +Function 330: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2926,12 +3048,12 @@ Function 315: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 316: ImageMipmaps() (1 input parameters) +Function 331: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 317: ImageDither() (5 input parameters) +Function 332: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2940,109 +3062,109 @@ Function 317: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 318: ImageFlipVertical() (1 input parameters) +Function 333: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 319: ImageFlipHorizontal() (1 input parameters) +Function 334: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 320: ImageRotate() (2 input parameters) +Function 335: ImageRotate() (2 input parameters) Name: ImageRotate Return type: void Description: Rotate image by input angle in degrees (-359 to 359) Param[1]: image (type: Image *) Param[2]: degrees (type: int) -Function 321: ImageRotateCW() (1 input parameters) +Function 336: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 322: ImageRotateCCW() (1 input parameters) +Function 337: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 323: ImageColorTint() (2 input parameters) +Function 338: ImageColorTint() (2 input parameters) Name: ImageColorTint Return type: void Description: Modify image color: tint Param[1]: image (type: Image *) Param[2]: color (type: Color) -Function 324: ImageColorInvert() (1 input parameters) +Function 339: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 325: ImageColorGrayscale() (1 input parameters) +Function 340: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 326: ImageColorContrast() (2 input parameters) +Function 341: ImageColorContrast() (2 input parameters) Name: ImageColorContrast Return type: void Description: Modify image color: contrast (-100 to 100) Param[1]: image (type: Image *) Param[2]: contrast (type: float) -Function 327: ImageColorBrightness() (2 input parameters) +Function 342: ImageColorBrightness() (2 input parameters) Name: ImageColorBrightness Return type: void Description: Modify image color: brightness (-255 to 255) Param[1]: image (type: Image *) Param[2]: brightness (type: int) -Function 328: ImageColorReplace() (3 input parameters) +Function 343: ImageColorReplace() (3 input parameters) Name: ImageColorReplace Return type: void Description: Modify image color: replace color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: replace (type: Color) -Function 329: LoadImageColors() (1 input parameters) +Function 344: LoadImageColors() (1 input parameters) Name: LoadImageColors Return type: Color * Description: Load color data from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) -Function 330: LoadImagePalette() (3 input parameters) +Function 345: LoadImagePalette() (3 input parameters) Name: LoadImagePalette Return type: Color * Description: Load colors palette from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) Param[2]: maxPaletteSize (type: int) Param[3]: colorCount (type: int *) -Function 331: UnloadImageColors() (1 input parameters) +Function 346: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 332: UnloadImagePalette() (1 input parameters) +Function 347: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 333: GetImageAlphaBorder() (2 input parameters) +Function 348: GetImageAlphaBorder() (2 input parameters) Name: GetImageAlphaBorder Return type: Rectangle Description: Get image alpha border rectangle Param[1]: image (type: Image) Param[2]: threshold (type: float) -Function 334: GetImageColor() (3 input parameters) +Function 349: GetImageColor() (3 input parameters) Name: GetImageColor Return type: Color Description: Get image pixel color at (x, y) position Param[1]: image (type: Image) Param[2]: x (type: int) Param[3]: y (type: int) -Function 335: ImageClearBackground() (2 input parameters) +Function 350: ImageClearBackground() (2 input parameters) Name: ImageClearBackground Return type: void Description: Clear image background with given color Param[1]: dst (type: Image *) Param[2]: color (type: Color) -Function 336: ImageDrawPixel() (4 input parameters) +Function 351: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -3050,14 +3172,14 @@ Function 336: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 337: ImageDrawPixelV() (3 input parameters) +Function 352: ImageDrawPixelV() (3 input parameters) Name: ImageDrawPixelV Return type: void Description: Draw pixel within an image (Vector version) Param[1]: dst (type: Image *) Param[2]: position (type: Vector2) Param[3]: color (type: Color) -Function 338: ImageDrawLine() (6 input parameters) +Function 353: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3067,7 +3189,7 @@ Function 338: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 339: ImageDrawLineV() (4 input parameters) +Function 354: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3075,7 +3197,7 @@ Function 339: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 340: ImageDrawLineEx() (5 input parameters) +Function 355: ImageDrawLineEx() (5 input parameters) Name: ImageDrawLineEx Return type: void Description: Draw a line defining thickness within an image @@ -3084,7 +3206,7 @@ Function 340: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 341: ImageDrawCircle() (5 input parameters) +Function 356: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3093,7 +3215,7 @@ Function 341: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 342: ImageDrawCircleV() (4 input parameters) +Function 357: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3101,7 +3223,7 @@ Function 342: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 343: ImageDrawCircleLines() (5 input parameters) +Function 358: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3110,7 +3232,7 @@ Function 343: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 344: ImageDrawCircleLinesV() (4 input parameters) +Function 359: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3118,7 +3240,7 @@ Function 344: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 345: ImageDrawRectangle() (6 input parameters) +Function 360: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3128,7 +3250,7 @@ Function 345: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 346: ImageDrawRectangleV() (4 input parameters) +Function 361: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3136,14 +3258,14 @@ Function 346: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 347: ImageDrawRectangleRec() (3 input parameters) +Function 362: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 348: ImageDrawRectangleLines() (4 input parameters) +Function 363: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3151,7 +3273,7 @@ Function 348: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 349: ImageDrawTriangle() (5 input parameters) +Function 364: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3160,7 +3282,7 @@ Function 349: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 350: ImageDrawTriangleEx() (7 input parameters) +Function 365: ImageDrawTriangleEx() (7 input parameters) Name: ImageDrawTriangleEx Return type: void Description: Draw triangle with interpolated colors within an image @@ -3171,7 +3293,7 @@ Function 350: ImageDrawTriangleEx() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 351: ImageDrawTriangleLines() (5 input parameters) +Function 366: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3180,7 +3302,7 @@ Function 351: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 352: ImageDrawTriangleFan() (4 input parameters) +Function 367: ImageDrawTriangleFan() (4 input parameters) Name: ImageDrawTriangleFan Return type: void Description: Draw a triangle fan defined by points within an image (first vertex is the center) @@ -3188,7 +3310,7 @@ Function 352: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 353: ImageDrawTriangleStrip() (4 input parameters) +Function 368: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3196,7 +3318,7 @@ Function 353: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 354: ImageDraw() (5 input parameters) +Function 369: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3205,7 +3327,7 @@ Function 354: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 355: ImageDrawText() (6 input parameters) +Function 370: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3215,7 +3337,7 @@ Function 355: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 356: ImageDrawTextEx() (7 input parameters) +Function 371: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3226,79 +3348,79 @@ Function 356: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 357: LoadTexture() (1 input parameters) +Function 372: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 358: LoadTextureFromImage() (1 input parameters) +Function 373: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 359: LoadTextureCubemap() (2 input parameters) +Function 374: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 360: LoadRenderTexture() (2 input parameters) +Function 375: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 361: IsTextureValid() (1 input parameters) +Function 376: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if a texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 362: UnloadTexture() (1 input parameters) +Function 377: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 363: IsRenderTextureValid() (1 input parameters) +Function 378: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if a render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 364: UnloadRenderTexture() (1 input parameters) +Function 379: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 365: UpdateTexture() (2 input parameters) +Function 380: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 366: UpdateTextureRec() (3 input parameters) +Function 381: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 367: GenTextureMipmaps() (1 input parameters) +Function 382: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 368: SetTextureFilter() (2 input parameters) +Function 383: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 369: SetTextureWrap() (2 input parameters) +Function 384: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 370: DrawTexture() (4 input parameters) +Function 385: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3306,14 +3428,14 @@ Function 370: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 371: DrawTextureV() (3 input parameters) +Function 386: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 372: DrawTextureEx() (5 input parameters) +Function 387: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3322,7 +3444,7 @@ Function 372: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 373: DrawTextureRec() (4 input parameters) +Function 388: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3330,7 +3452,7 @@ Function 373: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 374: DrawTexturePro() (6 input parameters) +Function 389: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3340,7 +3462,7 @@ Function 374: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 375: DrawTextureNPatch() (6 input parameters) +Function 390: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3350,119 +3472,119 @@ Function 375: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 376: ColorIsEqual() (2 input parameters) +Function 391: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 377: Fade() (2 input parameters) +Function 392: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 378: ColorToInt() (1 input parameters) +Function 393: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 379: ColorNormalize() (1 input parameters) +Function 394: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 380: ColorFromNormalized() (1 input parameters) +Function 395: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 381: ColorToHSV() (1 input parameters) +Function 396: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 382: ColorFromHSV() (3 input parameters) +Function 397: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 383: ColorTint() (2 input parameters) +Function 398: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 384: ColorBrightness() (2 input parameters) +Function 399: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 385: ColorContrast() (2 input parameters) +Function 400: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 386: ColorAlpha() (2 input parameters) +Function 401: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 387: ColorAlphaBlend() (3 input parameters) +Function 402: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 388: ColorLerp() (3 input parameters) +Function 403: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 389: GetColor() (1 input parameters) +Function 404: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 390: GetPixelColor() (2 input parameters) +Function 405: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: void *) Param[2]: format (type: int) -Function 391: SetPixelColor() (3 input parameters) +Function 406: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 392: GetPixelDataSize() (3 input parameters) +Function 407: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 393: GetFontDefault() (0 input parameters) +Function 408: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 394: LoadFont() (1 input parameters) +Function 409: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 395: LoadFontEx() (4 input parameters) +Function 410: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3470,14 +3592,14 @@ Function 395: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 396: LoadFontFromImage() (3 input parameters) +Function 411: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 397: LoadFontFromMemory() (6 input parameters) +Function 412: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3487,12 +3609,12 @@ Function 397: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 398: IsFontValid() (1 input parameters) +Function 413: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if a font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 399: LoadFontData() (6 input parameters) +Function 414: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3502,7 +3624,7 @@ Function 399: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 400: GenImageFontAtlas() (6 input parameters) +Function 415: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3512,30 +3634,30 @@ Function 400: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 401: UnloadFontData() (2 input parameters) +Function 416: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 402: UnloadFont() (1 input parameters) +Function 417: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 403: ExportFontAsCode() (2 input parameters) +Function 418: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 404: DrawFPS() (2 input parameters) +Function 419: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 405: DrawText() (5 input parameters) +Function 420: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3544,7 +3666,7 @@ Function 405: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 406: DrawTextEx() (6 input parameters) +Function 421: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3554,7 +3676,7 @@ Function 406: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 407: DrawTextPro() (8 input parameters) +Function 422: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3566,7 +3688,7 @@ Function 407: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 408: DrawTextCodepoint() (5 input parameters) +Function 423: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3575,7 +3697,7 @@ Function 408: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 409: DrawTextCodepoints() (7 input parameters) +Function 424: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3586,18 +3708,18 @@ Function 409: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 410: SetTextLineSpacing() (1 input parameters) +Function 425: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 411: MeasureText() (2 input parameters) +Function 426: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 412: MeasureTextEx() (4 input parameters) +Function 427: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3605,195 +3727,195 @@ Function 412: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 413: GetGlyphIndex() (2 input parameters) +Function 428: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 414: GetGlyphInfo() (2 input parameters) +Function 429: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 415: GetGlyphAtlasRec() (2 input parameters) +Function 430: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 416: LoadUTF8() (2 input parameters) +Function 431: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 417: UnloadUTF8() (1 input parameters) +Function 432: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 418: LoadCodepoints() (2 input parameters) +Function 433: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 419: UnloadCodepoints() (1 input parameters) +Function 434: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 420: GetCodepointCount() (1 input parameters) +Function 435: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 421: GetCodepoint() (2 input parameters) +Function 436: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 422: GetCodepointNext() (2 input parameters) +Function 437: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 423: GetCodepointPrevious() (2 input parameters) +Function 438: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 424: CodepointToUTF8() (2 input parameters) +Function 439: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 425: TextCopy() (2 input parameters) +Function 440: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 426: TextIsEqual() (2 input parameters) +Function 441: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text string are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 427: TextLength() (1 input parameters) +Function 442: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 428: TextFormat() (2 input parameters) +Function 443: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 429: TextSubtext() (3 input parameters) +Function 444: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 430: TextReplace() (3 input parameters) +Function 445: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: replace (type: const char *) Param[3]: by (type: const char *) -Function 431: TextInsert() (3 input parameters) +Function 446: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a position (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 432: TextJoin() (3 input parameters) +Function 447: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 433: TextSplit() (3 input parameters) +Function 448: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 434: TextAppend() (3 input parameters) +Function 449: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor! Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 435: TextFindIndex() (2 input parameters) +Function 450: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string Param[1]: text (type: const char *) Param[2]: find (type: const char *) -Function 436: TextToUpper() (1 input parameters) +Function 451: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 437: TextToLower() (1 input parameters) +Function 452: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 438: TextToPascal() (1 input parameters) +Function 453: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 439: TextToSnake() (1 input parameters) +Function 454: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 440: TextToCamel() (1 input parameters) +Function 455: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 441: TextToInteger() (1 input parameters) +Function 456: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 442: TextToFloat() (1 input parameters) +Function 457: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 443: DrawLine3D() (3 input parameters) +Function 458: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 444: DrawPoint3D() (2 input parameters) +Function 459: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 445: DrawCircle3D() (5 input parameters) +Function 460: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3802,7 +3924,7 @@ Function 445: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 446: DrawTriangle3D() (4 input parameters) +Function 461: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3810,14 +3932,14 @@ Function 446: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 447: DrawTriangleStrip3D() (3 input parameters) +Function 462: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 448: DrawCube() (5 input parameters) +Function 463: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3826,14 +3948,14 @@ Function 448: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 449: DrawCubeV() (3 input parameters) +Function 464: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 450: DrawCubeWires() (5 input parameters) +Function 465: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3842,21 +3964,21 @@ Function 450: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 451: DrawCubeWiresV() (3 input parameters) +Function 466: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 452: DrawSphere() (3 input parameters) +Function 467: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 453: DrawSphereEx() (5 input parameters) +Function 468: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3865,7 +3987,7 @@ Function 453: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 454: DrawSphereWires() (5 input parameters) +Function 469: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3874,7 +3996,7 @@ Function 454: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 455: DrawCylinder() (6 input parameters) +Function 470: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3884,7 +4006,7 @@ Function 455: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 456: DrawCylinderEx() (6 input parameters) +Function 471: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3894,7 +4016,7 @@ Function 456: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 457: DrawCylinderWires() (6 input parameters) +Function 472: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3904,7 +4026,7 @@ Function 457: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 458: DrawCylinderWiresEx() (6 input parameters) +Function 473: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3914,7 +4036,7 @@ Function 458: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 459: DrawCapsule() (6 input parameters) +Function 474: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3924,7 +4046,7 @@ Function 459: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 460: DrawCapsuleWires() (6 input parameters) +Function 475: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3934,51 +4056,51 @@ Function 460: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 461: DrawPlane() (3 input parameters) +Function 476: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 462: DrawRay() (2 input parameters) +Function 477: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 463: DrawGrid() (2 input parameters) +Function 478: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 464: LoadModel() (1 input parameters) +Function 479: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 465: LoadModelFromMesh() (1 input parameters) +Function 480: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 466: IsModelValid() (1 input parameters) +Function 481: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if a model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 467: UnloadModel() (1 input parameters) +Function 482: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 468: GetModelBoundingBox() (1 input parameters) +Function 483: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 469: DrawModel() (4 input parameters) +Function 484: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3986,7 +4108,7 @@ Function 469: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 470: DrawModelEx() (6 input parameters) +Function 485: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3996,7 +4118,7 @@ Function 470: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 471: DrawModelWires() (4 input parameters) +Function 486: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4004,7 +4126,7 @@ Function 471: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 472: DrawModelWiresEx() (6 input parameters) +Function 487: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -4014,7 +4136,7 @@ Function 472: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 473: DrawModelPoints() (4 input parameters) +Function 488: DrawModelPoints() (4 input parameters) Name: DrawModelPoints Return type: void Description: Draw a model as points @@ -4022,7 +4144,7 @@ Function 473: DrawModelPoints() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 474: DrawModelPointsEx() (6 input parameters) +Function 489: DrawModelPointsEx() (6 input parameters) Name: DrawModelPointsEx Return type: void Description: Draw a model as points with extended parameters @@ -4032,13 +4154,13 @@ Function 474: DrawModelPointsEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 475: DrawBoundingBox() (2 input parameters) +Function 490: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 476: DrawBillboard() (5 input parameters) +Function 491: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4047,7 +4169,7 @@ Function 476: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 477: DrawBillboardRec() (6 input parameters) +Function 492: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -4057,7 +4179,7 @@ Function 477: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 478: DrawBillboardPro() (9 input parameters) +Function 493: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -4070,13 +4192,13 @@ Function 478: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 479: UploadMesh() (2 input parameters) +Function 494: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 480: UpdateMeshBuffer() (5 input parameters) +Function 495: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4085,19 +4207,19 @@ Function 480: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 481: UnloadMesh() (1 input parameters) +Function 496: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 482: DrawMesh() (3 input parameters) +Function 497: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 483: DrawMeshInstanced() (4 input parameters) +Function 498: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4105,35 +4227,35 @@ Function 483: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 484: GetMeshBoundingBox() (1 input parameters) +Function 499: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 485: GenMeshTangents() (1 input parameters) +Function 500: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 486: ExportMesh() (2 input parameters) +Function 501: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 487: ExportMeshAsCode() (2 input parameters) +Function 502: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 488: GenMeshPoly() (2 input parameters) +Function 503: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 489: GenMeshPlane() (4 input parameters) +Function 504: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4141,42 +4263,42 @@ Function 489: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 490: GenMeshCube() (3 input parameters) +Function 505: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 491: GenMeshSphere() (3 input parameters) +Function 506: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 492: GenMeshHemiSphere() (3 input parameters) +Function 507: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 493: GenMeshCylinder() (3 input parameters) +Function 508: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 494: GenMeshCone() (3 input parameters) +Function 509: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 495: GenMeshTorus() (4 input parameters) +Function 510: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4184,7 +4306,7 @@ Function 495: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 496: GenMeshKnot() (4 input parameters) +Function 511: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4192,91 +4314,91 @@ Function 496: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 497: GenMeshHeightmap() (2 input parameters) +Function 512: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 498: GenMeshCubicmap() (2 input parameters) +Function 513: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 499: LoadMaterials() (2 input parameters) +Function 514: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 500: LoadMaterialDefault() (0 input parameters) +Function 515: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 501: IsMaterialValid() (1 input parameters) +Function 516: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if a material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 502: UnloadMaterial() (1 input parameters) +Function 517: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 503: SetMaterialTexture() (3 input parameters) +Function 518: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 504: SetModelMeshMaterial() (3 input parameters) +Function 519: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 505: LoadModelAnimations() (2 input parameters) +Function 520: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 506: UpdateModelAnimation() (3 input parameters) +Function 521: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (CPU) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 507: UpdateModelAnimationBones() (3 input parameters) +Function 522: UpdateModelAnimationBones() (3 input parameters) Name: UpdateModelAnimationBones Return type: void Description: Update model animation mesh bone matrices (GPU skinning) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 508: UnloadModelAnimation() (1 input parameters) +Function 523: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 509: UnloadModelAnimations() (2 input parameters) +Function 524: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 510: IsModelAnimationValid() (2 input parameters) +Function 525: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 511: CheckCollisionSpheres() (4 input parameters) +Function 526: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4284,40 +4406,40 @@ Function 511: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 512: CheckCollisionBoxes() (2 input parameters) +Function 527: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 513: CheckCollisionBoxSphere() (3 input parameters) +Function 528: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 514: GetRayCollisionSphere() (3 input parameters) +Function 529: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 515: GetRayCollisionBox() (2 input parameters) +Function 530: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 516: GetRayCollisionMesh() (3 input parameters) +Function 531: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 517: GetRayCollisionTriangle() (4 input parameters) +Function 532: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4325,7 +4447,7 @@ Function 517: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 518: GetRayCollisionQuad() (5 input parameters) +Function 533: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4334,158 +4456,158 @@ Function 518: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 519: InitAudioDevice() (0 input parameters) +Function 534: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 520: CloseAudioDevice() (0 input parameters) +Function 535: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 521: IsAudioDeviceReady() (0 input parameters) +Function 536: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 522: SetMasterVolume() (1 input parameters) +Function 537: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 523: GetMasterVolume() (0 input parameters) +Function 538: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 524: LoadWave() (1 input parameters) +Function 539: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 525: LoadWaveFromMemory() (3 input parameters) +Function 540: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 526: IsWaveValid() (1 input parameters) +Function 541: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Checks if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 527: LoadSound() (1 input parameters) +Function 542: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 528: LoadSoundFromWave() (1 input parameters) +Function 543: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 529: LoadSoundAlias() (1 input parameters) +Function 544: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 530: IsSoundValid() (1 input parameters) +Function 545: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Checks if a sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 531: UpdateSound() (3 input parameters) +Function 546: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (data and frame count should fit in sound) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 532: UnloadWave() (1 input parameters) +Function 547: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 533: UnloadSound() (1 input parameters) +Function 548: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 534: UnloadSoundAlias() (1 input parameters) +Function 549: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 535: ExportWave() (2 input parameters) +Function 550: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 536: ExportWaveAsCode() (2 input parameters) +Function 551: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 537: PlaySound() (1 input parameters) +Function 552: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 538: StopSound() (1 input parameters) +Function 553: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 539: PauseSound() (1 input parameters) +Function 554: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 540: ResumeSound() (1 input parameters) +Function 555: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 541: IsSoundPlaying() (1 input parameters) +Function 556: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 542: SetSoundVolume() (2 input parameters) +Function 557: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 543: SetSoundPitch() (2 input parameters) +Function 558: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 544: SetSoundPan() (2 input parameters) +Function 559: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 545: WaveCopy() (1 input parameters) +Function 560: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 546: WaveCrop() (3 input parameters) +Function 561: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 547: WaveFormat() (4 input parameters) +Function 562: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4493,203 +4615,203 @@ Function 547: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 548: LoadWaveSamples() (1 input parameters) +Function 563: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 549: UnloadWaveSamples() (1 input parameters) +Function 564: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 550: LoadMusicStream() (1 input parameters) +Function 565: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 551: LoadMusicStreamFromMemory() (3 input parameters) +Function 566: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 552: IsMusicValid() (1 input parameters) +Function 567: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Checks if a music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 553: UnloadMusicStream() (1 input parameters) +Function 568: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 554: PlayMusicStream() (1 input parameters) +Function 569: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 555: IsMusicStreamPlaying() (1 input parameters) +Function 570: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 556: UpdateMusicStream() (1 input parameters) +Function 571: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 557: StopMusicStream() (1 input parameters) +Function 572: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 558: PauseMusicStream() (1 input parameters) +Function 573: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 559: ResumeMusicStream() (1 input parameters) +Function 574: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 560: SeekMusicStream() (2 input parameters) +Function 575: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 561: SetMusicVolume() (2 input parameters) +Function 576: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 562: SetMusicPitch() (2 input parameters) +Function 577: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 563: SetMusicPan() (2 input parameters) +Function 578: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 564: GetMusicTimeLength() (1 input parameters) +Function 579: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 565: GetMusicTimePlayed() (1 input parameters) +Function 580: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 566: LoadAudioStream() (3 input parameters) +Function 581: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 567: IsAudioStreamValid() (1 input parameters) +Function 582: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Checks if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 568: UnloadAudioStream() (1 input parameters) +Function 583: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 569: UpdateAudioStream() (3 input parameters) +Function 584: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 570: IsAudioStreamProcessed() (1 input parameters) +Function 585: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 571: PlayAudioStream() (1 input parameters) +Function 586: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 572: PauseAudioStream() (1 input parameters) +Function 587: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 573: ResumeAudioStream() (1 input parameters) +Function 588: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 574: IsAudioStreamPlaying() (1 input parameters) +Function 589: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 575: StopAudioStream() (1 input parameters) +Function 590: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 576: SetAudioStreamVolume() (2 input parameters) +Function 591: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 577: SetAudioStreamPitch() (2 input parameters) +Function 592: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 578: SetAudioStreamPan() (2 input parameters) +Function 593: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 579: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 594: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 580: SetAudioStreamCallback() (2 input parameters) +Function 595: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 581: AttachAudioStreamProcessor() (2 input parameters) +Function 596: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 582: DetachAudioStreamProcessor() (2 input parameters) +Function 597: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 583: AttachAudioMixedProcessor() (1 input parameters) +Function 598: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 584: DetachAudioMixedProcessor() (1 input parameters) +Function 599: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 8125824e7726..993b5595daa7 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -679,7 +679,7 @@ - + @@ -1633,6 +1633,22 @@ + + + + + + + + + + + + + + + + @@ -1665,6 +1681,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/raylib.h b/src/raylib.h index 0ea0df316b50..d588084cb82d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1300,6 +1300,8 @@ RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4 RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points RLAPI void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color); // Draw spline segment: Quadratic Bezier, 2 points, 1 control point RLAPI void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color); // Draw spline segment: Cubic Bezier, 2 points, 2 control points +RLAPI void DrawSplineSegmentLinearVar(Vector2 p1, Vector2 p2, const float* thicks, int thickCount, Color color); // Draw spline segment with variable thickness: Linear Bezier, 2 points +RLAPI void DrawSplineSegmentBezierCubicVar(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, const float* thicks, int thickCount, Color color); // Draw spline segment with variable thickness: Cubic Bezier, 2 points, 2 control points // Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] RLAPI Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t); // Get (evaluate) spline point: Linear @@ -1308,6 +1310,26 @@ RLAPI Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vecto RLAPI Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float t); // Get (evaluate) spline point: Quadratic Bezier RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier +// Spline inverse point functions, for evenly-spaced points on the curve +RLAPI void GetSplineControlBezierQuad(Vector2 startPos, Vector2 midPos, Vector2 endPos, Vector2 *controlPos); // Get (evaluate) spline control point: Quadratic Bezier +RLAPI void GetSplineControlBezierCubic(Vector2 startPos, Vector2 oneThirdsPos, Vector2 twoThirdsPos, Vector2 endPos, Vector2 *startControlPos, Vector2 *endControlPos); // Get (evaluate) spline control points: Cubic Bezier + +// Spline segment slope evaluation functions, for a given t [0.0f .. 1.0f] +RLAPI Vector2 GetSplineVelocityLinear(Vector2 startPos, Vector2 endPos); // Get (evaluate) spline velocity: Linear +RLAPI Vector2 GetSplineVelocityBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos, float t); // Get (evaluate) spline velocity: Quadratic Bezier +RLAPI Vector2 GetSplineVelocityBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t); // Get (evaluate) spline velocity: Cubic Bezier +RLAPI Vector2 GetSplineAccelerationBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos); // Get (evaluate) spline acceleration: Quadratic Bezier +RLAPI Vector2 GetSplineAccelerationBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t); // Get (evaluate) spline acceleration: Cubic Bezier +RLAPI Vector2 GetSplineJoltBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos); // Get (evaluate) spline jolt: Cubic Bezier + +// Spline segment bounds evaluation functions +RLAPI Rectangle GetSplineBoundsBezierLinear(Vector2 startPos, Vector2 endPos); // Get (evaluate) spline bounds rectangle: Linear +RLAPI Rectangle GetSplineBoundsBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos); // Get (evaluate) spline bounds rectangle: Quadratic Bezier +RLAPI Rectangle GetSplineBoundsBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos); // Get (evaluate) spline bounds rectangle: Cubic Bezier + +RLAPI float GetSplineCurvatureBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t); // Get (evaluate) spline curvature: Cubic Bezier +RLAPI float GetSplineNearestTLinear(Vector2 startPos, Vector2 endPos, Vector2 point); // Get (evaluate) nearest t value to point: Linear + // Basic shapes collision detection functions RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles diff --git a/src/rshapes.c b/src/rshapes.c index be28e6caddcd..976a2c69a189 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -2121,6 +2121,177 @@ void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4 DrawTriangleStrip(points, 2*SPLINE_SEGMENT_DIVISIONS + 2, color); } +// Draw spline segment with variable thickness: Linear, 2 points +void DrawSplineSegmentLinearVar(Vector2 p1, Vector2 p2, const float* thicks, int thickCount, Color color) +{ + if (thickCount >= 4) + { + const float step = 1.0f/SPLINE_SEGMENT_DIVISIONS; + + Vector2 previous[2] = { 0 }; + Vector2 current[2] = { 0 }; + float t = 0.0f; + + // Linear velocity does not change across the curve + Vector2 tangent = { 0 }; + + tangent.x = p2.x - p1.x; + tangent.y = p2.y - p1.y; + + float speedSqr = tangent.x*tangent.x + tangent.y*tangent.y; + + if (speedSqr > 0) + { + float speedInv = 1.0f/sqrtf(speedSqr); + tangent.x *= speedInv; + tangent.y *= speedInv; + + rlBegin(RL_TRIANGLES); + rlColor4ub(color.r, color.g, color.b, color.a); + + for (int i = 0; i <= SPLINE_SEGMENT_DIVISIONS; i++) + { + t = step*(float)i; + + Vector2 point = { 0 }; + + point.x = p1.x*(1.0f - t) + p2.x*t; + point.y = p1.y*(1.0f - t) + p2.y*t; + + float thick; + { + float tMajor = t*(float)thickCount/3.0f; + int tIndex = (int)tMajor; + float tMinor = tMajor - (float)tIndex; + tIndex *= 3; + if (tIndex >= thickCount - 3) + { + tIndex = thickCount - 4; + tMinor = 1.0f; + } + float a = powf(1.0f - t, 3); + float b = 3.0f*powf(1.0f - t, 2)*t; + float c = 3.0f*(1.0f - t)*t*t; + float d = t*t*t; + + thick = a*thicks[tIndex] + b*thicks[tIndex + 1] + c*thicks[tIndex + 2] + d*thicks[tIndex + 3]; + } + + current[0].x = point.x + thick*tangent.y; + current[0].y = point.y - thick*tangent.x; + + current[1].x = point.x - thick*tangent.y; + current[1].y = point.y + thick*tangent.x; + + if (i > 0) + { + rlVertex2f(current[0].x, current[0].y); + rlVertex2f(previous[0].x, previous[0].y); + rlVertex2f(previous[1].x, previous[1].y); + + rlVertex2f(current[1].x, current[1].y); + rlVertex2f(current[0].x, current[0].y); + rlVertex2f(previous[1].x, previous[1].y); + } + + previous[0] = current[0]; + previous[1] = current[1]; + } + + rlEnd(); + } + } +} + +// Draw spline segment with variable thickness: Cubic Bezier, 2 points, 2 control points +void DrawSplineSegmentBezierCubicVar(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, const float* thicks, int thickCount, Color color) +{ + if (thickCount >= 4) + { + rlBegin(RL_TRIANGLES); + rlColor4ub(color.r, color.g, color.b, color.a); + + const float step = 1.0f/SPLINE_SEGMENT_DIVISIONS; + + Vector2 previous[2] = { 0 }; + Vector2 current[2] = { 0 }; + float t = 0.0f; + + for (int i = 0; i <= SPLINE_SEGMENT_DIVISIONS; i++) + { + t = step*(float)i; + + Vector2 tangent = { 0 }; + { + float a = 3.0f*powf(1.0f - t, 2); + float b = 6.0f*(1.0f - t)*t; + float c = 3.0f*t*t; + + tangent.x = a*(c2.x - p1.x) + b*(c3.x - c2.x) + c*(p4.x - c3.x); + tangent.y = a*(c2.y - p1.y) + b*(c3.y - c2.y) + c*(p4.y - c3.y); + } + + float speedSqr = (tangent.x*tangent.x + tangent.y*tangent.y); + if (speedSqr == 0) continue; + float speedInv = 1.0f/sqrtf(speedSqr); + tangent.x *= speedInv; + tangent.y *= speedInv; + + Vector2 point = { 0 }; + { + float a = powf(1.0f - t, 3); + float b = 3.0f*powf(1.0f - t, 2)*t; + float c = 3.0f*(1.0f - t)*powf(t, 2); + float d = powf(t, 3); + + point.y = a*p1.y + b*c2.y + c*c3.y + d*p4.y; + point.x = a*p1.x + b*c2.x + c*c3.x + d*p4.x; + } + + float thick; + { + float tMajor = t*(float)thickCount/3.0f; + int tIndex = (int)tMajor; + float tMinor = tMajor - (float)tIndex; + tIndex *= 3; + if (tIndex >= thickCount - 3) + { + tIndex = thickCount - 4; + tMinor = 1.0f; + } + float a = powf(1.0f - t, 3); + float b = 3.0f*powf(1.0f - t, 2)*t; + float c = 3.0f*(1.0f - t)*t*t; + float d = t*t*t; + + thick = a*thicks[tIndex] + b*thicks[tIndex + 1] + c*thicks[tIndex + 2] + d*thicks[tIndex + 3]; + } + + current[0].x = point.x + thick*tangent.y; + current[0].y = point.y - thick*tangent.x; + + current[1].x = point.x - thick*tangent.y; + current[1].y = point.y + thick*tangent.x; + + if (i > 0) // TODO: `previous` may be unassigned in i=1 if i=0 had a `speedSqr` of 0 + { + rlVertex2f(current[0].x, current[0].y); + rlVertex2f(previous[0].x, previous[0].y); + rlVertex2f(previous[1].x, previous[1].y); + + rlVertex2f(current[1].x, current[1].y); + rlVertex2f(current[0].x, current[0].y); + rlVertex2f(previous[1].x, previous[1].y); + } + + previous[0] = current[0]; + previous[1] = current[1]; + } + + rlEnd(); + } +} + // Get spline point for a given t [0.0f .. 1.0f], Linear Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t) { @@ -2187,6 +2358,14 @@ Vector2 GetSplinePointBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 e return point; } +// Get spline control point given evenly-spaced points on that curve, Quadratic Bezier +// NOTE: Assumes startPos has 0 entry velocity and endPos has 0 exit velocity +void GetSplineControlBezierQuad(Vector2 startPos, Vector2 midPos, Vector2 endPos, Vector2 *controlPos) +{ + controlPos->y = 2.0f*midPos.y - 0.5f*(startPos.y + endPos.y); + controlPos->x = 2.0f*midPos.x - 0.5f*(startPos.x + endPos.x); +} + // Get spline point for a given t [0.0f .. 1.0f], Cubic Bezier Vector2 GetSplinePointBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t) { @@ -2203,6 +2382,370 @@ Vector2 GetSplinePointBezierCubic(Vector2 startPos, Vector2 startControlPos, Vec return point; } +// Get spline control points given evenly-spaced points on that curve, Cubic Bezier +// NOTE: Assumes startPos has 0 entry velocity and endPos has 0 exit velocity +void GetSplineControlBezierCubic(Vector2 startPos, Vector2 oneThirdsPos, Vector2 twoThirdsPos, Vector2 endPos, Vector2 *startControlPos, Vector2 *endControlPos) +{ + const float a = -5.0f/6.0f; + const float b = 3.0f; + const float c = -3.0f/2.0f; + const float d = 1.0f/3.0f; + + startControlPos->x = a*startPos.x + b*oneThirdsPos.x + c*twoThirdsPos.x + d*endPos.x; + startControlPos->y = a*startPos.y + b*oneThirdsPos.y + c*twoThirdsPos.y + d*endPos.y; + + endControlPos->x = a*endPos.x + b*twoThirdsPos.x + c*oneThirdsPos.x + d*startPos.x; + endControlPos->y = a*endPos.y + b*twoThirdsPos.y + c*oneThirdsPos.y + d*startPos.y; +} + +// Get spline direction and speed, Linear Bezier +// +// Normalize to get the "forward" direction of the curve +Vector2 GetSplineVelocityLinear(Vector2 startPos, Vector2 endPos) +{ + Vector2 velocity = { 0 }; + + velocity.x = endPos.x - startPos.x; + velocity.y = endPos.y - startPos.y; + + return velocity; +} + +// Get spline direction and speed for a given t [0.0f .. 1.0f], Quadratic Bezier +// +// Normalize to get the "forward" direction of the curve at t +Vector2 GetSplineVelocityBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos, float t) +{ + Vector2 velocity = { 0 }; + + float a = 2.0f*(1.0f - t); + float b = 2.0f*t; + + velocity.x = a*(controlPos.x - startPos.x) + b*(endPos.x - controlPos.x); + velocity.y = a*(controlPos.y - startPos.y) + b*(endPos.y - controlPos.y); + + return velocity; +} + +// Get spline direction and speed for a given t [0.0f .. 1.0f], Cubic Bezier +// +// Normalize to get the "forward" direction of the curve at t +Vector2 GetSplineVelocityBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t) +{ + Vector2 velocity = { 0 }; + + float a = 3.0f*powf(1.0f - t, 2); + float b = 6.0f*(1.0f - t)*t; + float c = 3.0f*t*t; + + velocity.x = a*(startControlPos.x - startPos.x) + b*(endControlPos.x - startControlPos.x) + c*(endPos.x - endControlPos.x); + velocity.y = a*(startControlPos.y - startPos.y) + b*(endControlPos.y - startControlPos.y) + c*(endPos.y - endControlPos.y); + + return velocity; +} + +// Get spline rate of change, Quadratic Bezier +Vector2 GetSplineAccelerationBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos) +{ + Vector2 acceleration = { 0 }; + + acceleration.x = 2.0f*(endPos.x - 2.0f*controlPos.x - startPos.x); + acceleration.y = 2.0f*(endPos.y - 2.0f*controlPos.y - startPos.y); + + return acceleration; +} + +// Get spline rate of change for a given t [0.0f .. 1.0f], Cubic Bezier +Vector2 GetSplineAccelerationBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t) +{ + Vector2 acceleration = { 0 }; + + float a = 2.0f*(1.0f - t); + float b = 2.0f*t; + + acceleration.x = a*(endControlPos.x - 2.0f*startControlPos.x + startPos.x) + b*(endPos.x - 2.0f*endControlPos.x + startControlPos.x); + acceleration.y = a*(endControlPos.y - 2.0f*startControlPos.y + startPos.y) + b*(endPos.y - 2.0f*endControlPos.y + startControlPos.y); + + return acceleration; +} + +// Get spline rate of acceleration, Cubic Bezier +Vector2 GetSplineJoltBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos) +{ + Vector2 jolt = { 0 }; + + jolt.x = 6.0f*(endPos.x + 3.0f*(startControlPos.x - endControlPos.x) - startPos.x); + jolt.y = 6.0f*(endPos.y + 3.0f*(startControlPos.y - endControlPos.y) - startPos.y); + + return jolt; +} + +// Compute spline curve bounding rectangle, Linear Bezier +Rectangle GetSplineBoundsBezierLinear(Vector2 startPos, Vector2 endPos) +{ + float xMin; + float yMin; + float xMax; + float yMax; + + if (startPos.x < endPos.x) + { + xMin = startPos.x; + xMax = endPos.x; + } + else + { + xMin = endPos.x; + xMax = startPos.x; + } + + if (startPos.y < endPos.y) + { + yMin = startPos.y; + yMax = endPos.y; + } + else + { + yMin = endPos.y; + yMax = startPos.y; + } + + // straight line will never escape bounds + + Rectangle bounds = { xMin, yMin, xMax - xMin, yMax - yMin }; + + return bounds; +} + +// Compute spline curve bounding rectangle, Quadratic Bezier +Rectangle GetSplineBoundsBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos) +{ + float xMin; + float yMin; + float xMax; + float yMax; + + if (startPos.x < endPos.x) + { + xMin = startPos.x; + xMax = endPos.x; + } + else + { + xMin = endPos.x; + xMax = startPos.x; + } + + if (startPos.y < endPos.y) + { + yMin = startPos.y; + yMax = endPos.y; + } + else + { + yMin = endPos.y; + yMax = startPos.y; + } + + // curve velocity, rearranged to solve for t + // at^2 + bt + c + // local min/max occur where derivative (velocity) is zero, + // so we use quadratic formula to find values of t at zeros + + float a = startPos.x - 2.0f*controlPos.x + endPos.x; + float b = 2.0f*(controlPos.x - startPos.x); + float c = startPos.x; + + bool dejavu = false; + do + { + if (a != 0) + { + float bSqrMinus4ac = b*b - 4.0f*a*c; + float t[2] = { 0 }; + int tCount = 0; + if (bSqrMinus4ac > 0) + { + float denominator = 1.0f/(2.0f*a); + + float term0 = -b*denominator; + float term1 = sqrtf(bSqrMinus4ac)*denominator; + + t[0] = term0 + term1; + if (0.0f < t[0] && t[0] < 1.0f) ++tCount; + + t[tCount] = term0 - term1; + if (0.0f < t[tCount] && t[tCount] < 1.0f) ++tCount; + } + else if (bSqrMinus4ac == 0) + { + t[0] = -b/(2.0f*a); + if (0.0f < t[0] && t[0] < 1.0f) ++tCount; + } + // ignore imaginary solution + + for (int i = 0; i < tCount; ++i) + { + Vector2 point = GetSplinePointBezierQuad(startPos, controlPos, endPos, t[i]); + + if (point.x < xMin) xMin = point.x; + if (point.x > xMax) xMax = point.x; + if (point.y < yMin) yMin = point.y; + if (point.y > yMax) yMax = point.y; + } + } + // straight line will never escape bounds + + if (dejavu) break; + dejavu = true; + + a = startPos.y - 2.0f*controlPos.y + endPos.y; + b = 2.0f*(controlPos.y - startPos.y); + c = startPos.y; + } + while (true); + + Rectangle bounds = { xMin, yMin, xMax - xMin, yMax - yMin }; + + return bounds; +} + +// Compute spline curve bounding rectangle, Cubic Bezier +Rectangle GetSplineBoundsBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos) +{ + float xMin; + float yMin; + float xMax; + float yMax; + + if (startPos.x < endPos.x) + { + xMin = startPos.x; + xMax = endPos.x; + } + else + { + xMin = endPos.x; + xMax = startPos.x; + } + + if (startPos.y < endPos.y) + { + yMin = startPos.y; + yMax = endPos.y; + } + else + { + yMin = endPos.y; + yMax = startPos.y; + } + + // curve velocity, rearranged to solve for t + // at^2 + bt + c + // local min/max occur where derivative (velocity) is zero, + // so we use quadratic formula to find values of t at zeros + + float a = -3.0f*startPos.x + 9.0f*startControlPos.x - 9.0f*endControlPos.x + 3.0f*endPos.x; + float b = 6.0f*startPos.x - 12.0f*startControlPos.x + 6.0f*endControlPos.x; + float c = -3.0f*startPos.x + 3.0f*startControlPos.x; + + bool dejavu = false; + do + { + if (a != 0) + { + float bSqrMinus4ac = b*b - 4.0f*a*c; + float t[2] = { 0 }; + int tCount = 0; + if (bSqrMinus4ac > 0) + { + float denominator = 1.0f/(2.0f*a); + + float term0 = -b*denominator; + float term1 = sqrtf(bSqrMinus4ac)*denominator; + + t[0] = term0 + term1; + if (0.0f < t[0] && t[0] < 1.0f) ++tCount; + + t[tCount] = term0 - term1; + if (0.0f < t[tCount] && t[tCount] < 1.0f) ++tCount; + } + else if (bSqrMinus4ac == 0) + { + t[0] = -b/(2.0f*a); + if (0.0f < t[0] && t[0] < 1.0f) ++tCount; + } + // ignore imaginary solution + + for (int i = 0; i < tCount; ++i) + { + Vector2 point = GetSplinePointBezierCubic(startPos, startControlPos, endControlPos, endPos, t[i]); + + if (point.x < xMin) xMin = point.x; + if (point.x > xMax) xMax = point.x; + if (point.y < yMin) yMin = point.y; + if (point.y > yMax) yMax = point.y; + } + } + // straight line will never escape bounds + + if (dejavu) break; + dejavu = true; + + a = -3.0f*startPos.x + 9.0f*startControlPos.x - 9.0f*endControlPos.x + 3.0f*endPos.x; + b = 6.0f*startPos.x - 12.0f*startControlPos.x + 6.0f*endControlPos.x; + c = -3.0f*startPos.x + 3.0f*startControlPos.x; + } + while (true); + + Rectangle bounds = { xMin, yMin, xMax - xMin, yMax - yMin }; + + return bounds; +} + +// Reciprocal radius (or "radians per meter") for a given t [0.0f .. 1.0f], Cubic Bezier +float GetSplineCurvatureBezierCubic(Vector2 startPos, Vector2 startControlPos, Vector2 endControlPos, Vector2 endPos, float t) +{ + float curvature = 0.0f; + + float a = 3.0f*powf(1.0f - t, 2); + float b = 6.0f*(1.0f - t)*t; + float c = 3.0f*t*t; + + Vector2 velocity = { 0 }; + + velocity.x = a*(startControlPos.x - startPos.x) + b*(endControlPos.x - startControlPos.x) + c*(endPos.x - endControlPos.x); + velocity.y = a*(startControlPos.y - startPos.y) + b*(endControlPos.y - startControlPos.y) + c*(endPos.y - endControlPos.y); + + a = 2.0f*(1.0f - t); + b = 2.0f*t; + + Vector2 acceleration = { 0 }; + + acceleration.x = a*(endControlPos.x - 2.0f*startControlPos.x + startPos.x) + b*(endPos.x - 2.0f*endControlPos.x + startControlPos.x); + acceleration.y = a*(endControlPos.y - 2.0f*startControlPos.y + startPos.y) + b*(endPos.y - 2.0f*endControlPos.y + startControlPos.y); + + curvature = (velocity.x*acceleration.y - velocity.y*acceleration.x)/powf(sqrtf(velocity.x*velocity.x + velocity.y*velocity.y), 3); + + return curvature; +} + +// Get value of t (unbounded) for the point on the line closest to a given position +float GetSplineNearestTLinear(Vector2 startPos, Vector2 endPos, Vector2 point) +{ + Vector2 edge = { 0 }; + edge.x = endPos.x - startPos.x; + edge.y = endPos.y - startPos.y; + + Vector2 diff = { 0 }; + diff.x = point.x - startPos.x; + diff.y = point.y - startPos.y; + + float t = (edge.x*diff.x + edge.y*diff.y)/(edge.x*edge.x + edge.y*edge.y); + + return t; +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Collision Detection functions //----------------------------------------------------------------------------------