From b429dbdc4b41d57ff00456c73646bb1f6f14d8b5 Mon Sep 17 00:00:00 2001 From: listeria <56203103+ListeriaM@users.noreply.github.com> Date: Fri, 24 May 2024 13:24:40 -0300 Subject: [PATCH 01/71] fix WaveCrop(): update wave->frameCount (#4003) also allow `finalFrame = wave->frameCount' as the range of frames does not include it. Co-authored-by: Listeria monocytogenes --- src/raudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/raudio.c b/src/raudio.c index e74f8590e092..c6bd00165434 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1278,7 +1278,7 @@ Wave WaveCopy(Wave wave) // NOTE: Security check in case of out-of-range void WaveCrop(Wave *wave, int initFrame, int finalFrame) { - if ((initFrame >= 0) && (initFrame < finalFrame) && ((unsigned int)finalFrame < wave->frameCount)) + if ((initFrame >= 0) && (initFrame < finalFrame) && ((unsigned int)finalFrame <= wave->frameCount)) { int frameCount = finalFrame - initFrame; @@ -1288,6 +1288,7 @@ void WaveCrop(Wave *wave, int initFrame, int finalFrame) RL_FREE(wave->data); wave->data = data; + wave->frameCount = (unsigned int)frameCount; } else TRACELOG(LOG_WARNING, "WAVE: Crop range out of bounds"); } From 785ec74b92da4f91181ff7b1c89c8ae5ee19f1b6 Mon Sep 17 00:00:00 2001 From: Lionel Briand Date: Fri, 24 May 2024 18:26:17 +0200 Subject: [PATCH 02/71] Update BINDINGS.md (#4004) Add L-Briand/raylib-zig-bindings to the Language Bindings table --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index e5cae30d688b..118794d5299e 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -75,6 +75,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to | [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.0 | [Wren](http://wren.io) | ISC | | [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.0** | [Zig](https://ziglang.org) | MIT | | [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT | +| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib | | [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib | | [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | | [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **auto** | [BQN](https://mlochbaum.github.io/BQN) | MIT | From 9cc7e3528f37dd17c85334c16dffb9392b8a6ad2 Mon Sep 17 00:00:00 2001 From: avx0 Date: Wed, 29 May 2024 15:00:28 +0530 Subject: [PATCH 03/71] [parser] MemoryCopy() calls: Prevent buffer overflow by replacing hard-coded arguments (#4011) In future, if a dev edits the second arg and miscalulates the corresponding 3rd arg, there will be a buffer overflow or the string (2nd arg) will be cut short. This commit prevents that. --- parser/raylib_parser.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 3e36f41f184c..63f957284aca 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -202,9 +202,12 @@ int main(int argc, char* argv[]) { if (argc > 1) ProcessCommandLine(argc, argv); - if (inFileName[0] == '\0') MemoryCopy(inFileName, "../src/raylib.h\0", 16); - if (outFileName[0] == '\0') MemoryCopy(outFileName, "raylib_api.txt\0", 15); - if (apiDefine[0] == '\0') MemoryCopy(apiDefine, "RLAPI\0", 6); + const char *raylibhPath = "../src/raylib.h\0"; + const char *raylibapiPath = "raylib_api.txt\0"; + const char *rlapiPath = "RLAPI\0"; + if (inFileName[0] == '\0') MemoryCopy(inFileName, raylibhPath, TextLength(raylibhPath) + 1); + if (outFileName[0] == '\0') MemoryCopy(outFileName, raylibapiPath, TextLength(raylibapiPath) + 1); + if (apiDefine[0] == '\0') MemoryCopy(apiDefine, rlapiPath, TextLength(rlapiPath) + 1); int length = 0; char *buffer = LoadFileText(inFileName, &length); @@ -1277,8 +1280,10 @@ static void GetDataTypeAndName(const char *typeName, int typeNameLen, char *type } else if ((typeName[k] == '.') && (typeNameLen == 3)) // Handle varargs ...); { - MemoryCopy(type, "...", 3); - MemoryCopy(name, "args", 4); + const char *varargsDots = "..."; + const char *varargsArg = "args"; + MemoryCopy(type, varargsDots, TextLength(varargsDots)); + MemoryCopy(name, varargsArg, TextLength(varargsArg)); break; } } From 797de0f9ad6f69f78131591f9393e9e0ef9486a2 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Wed, 29 May 2024 13:16:19 +0200 Subject: [PATCH 04/71] [rmodels] Multiplication of colors in `DrawModelEx` which can be simplified (#4002) * simplifies color multiplication `DrawModelEx` * add explicit casts --- src/rmodels.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 2ef03018675a..4bf042d5cafc 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3546,10 +3546,10 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota Color color = model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color; Color colorTint = WHITE; - colorTint.r = (unsigned char)((((float)color.r/255.0f)*((float)tint.r/255.0f))*255.0f); - colorTint.g = (unsigned char)((((float)color.g/255.0f)*((float)tint.g/255.0f))*255.0f); - colorTint.b = (unsigned char)((((float)color.b/255.0f)*((float)tint.b/255.0f))*255.0f); - colorTint.a = (unsigned char)((((float)color.a/255.0f)*((float)tint.a/255.0f))*255.0f); + colorTint.r = (unsigned char)(((int)color.r*(int)tint.r)/255); + colorTint.g = (unsigned char)(((int)color.g*(int)tint.g)/255); + colorTint.b = (unsigned char)(((int)color.b*(int)tint.b)/255); + colorTint.a = (unsigned char)(((int)color.a*(int)tint.a)/255); model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = colorTint; DrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform); From c335c3c52c27ee68765ab3c3dde65190dbebe55c Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 May 2024 17:01:42 +0200 Subject: [PATCH 05/71] ADDED: `IsFileNameValid()` --- src/raylib.h | 1 + src/rcore.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index c53ea555bcf5..e810dcdca18c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1124,6 +1124,7 @@ RLAPI const char *GetWorkingDirectory(void); // Get current RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory +RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths diff --git a/src/rcore.c b/src/rcore.c index 1db865187e08..3aa5a7a65bc9 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2244,6 +2244,64 @@ bool IsPathFile(const char *path) return S_ISREG(result.st_mode); } +// Check if fileName is valid for the platform/OS +bool IsFileNameValid(const char *fileName) +{ + bool valid = true; + + if ((fileName != NULL) && (fileName[0] != '\0')) + { + int length = strlen(fileName); + bool allPeriods = true; + + for (int i = 0; i < length; i++) + { + // Check invalid characters + if ((fileName[i] == '<') || + (fileName[i] == '>') || + (fileName[i] == ':') || + (fileName[i] == '\"') || + (fileName[i] == '/') || + (fileName[i] == '\\') || + (fileName[i] == '|') || + (fileName[i] == '?') || + (fileName[i] == '*')) { valid = false; break; } + + // Check non-glyph characters + if ((unsigned char)fileName[i] < 32) { valid = false; break; } + + // TODO: Check trailing periods/spaces? + + // Check if filename is not all periods + if (fileName[i] != '.') allPeriods = false; + } + + if (allPeriods) valid = false; + +/* + if (valid) + { + // Check invalid DOS names + if (length >= 3) + { + if (((fileName[0] == 'C') && (fileName[1] == 'O') && (fileName[2] == 'N')) || // CON + ((fileName[0] == 'P') && (fileName[1] == 'R') && (fileName[2] == 'N')) || // PRN + ((fileName[0] == 'A') && (fileName[1] == 'U') && (fileName[2] == 'X')) || // AUX + ((fileName[0] == 'N') && (fileName[1] == 'U') && (fileName[2] == 'L'))) valid = false; // NUL + } + + if (length >= 4) + { + if (((fileName[0] == 'C') && (fileName[1] == 'O') && (fileName[2] == 'M') && ((fileName[3] >= '0') && (fileName[3] <= '9'))) || // COM0-9 + ((fileName[0] == 'L') && (fileName[1] == 'P') && (fileName[2] == 'T') && ((fileName[3] >= '0') && (fileName[3] <= '9')))) valid = false; // LPT0-9 + } + } +*/ + } + + return valid; +} + // Check if a file has been dropped into window bool IsFileDropped(void) { From a942a3bc70d994183fdd94b0346ba34211c50b20 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 29 May 2024 15:02:00 +0000 Subject: [PATCH 06/71] Update raylib_api.* by CI --- parser/output/raylib_api.json | 11 + parser/output/raylib_api.lua | 8 + parser/output/raylib_api.txt | 861 +++++++++++++++++----------------- parser/output/raylib_api.xml | 5 +- 4 files changed, 456 insertions(+), 429 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 5a9f4fc5d3aa..f2a9cc61edbb 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -4499,6 +4499,17 @@ } ] }, + { + "name": "IsFileNameValid", + "description": "Check if fileName is valid for the platform/OS", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, { "name": "LoadDirectoryFiles", "description": "Load directory filepaths", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d60ea191ca98..68fef97bb131 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4058,6 +4058,14 @@ return { {type = "const char *", name = "path"} } }, + { + name = "IsFileNameValid", + description = "Check if fileName is valid for the platform/OS", + returnType = "bool", + params = { + {type = "const char *", name = "fileName"} + } + }, { name = "LoadDirectoryFiles", description = "Load directory filepaths", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index f4973dae6a4a..d6576dee5920 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 562 +Functions found: 563 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -1709,358 +1709,363 @@ Function 135: IsPathFile() (1 input parameters) Return type: bool Description: Check if a given path is a file or a directory Param[1]: path (type: const char *) -Function 136: LoadDirectoryFiles() (1 input parameters) +Function 136: IsFileNameValid() (1 input parameters) + Name: IsFileNameValid + Return type: bool + Description: Check if fileName is valid for the platform/OS + Param[1]: fileName (type: const char *) +Function 137: LoadDirectoryFiles() (1 input parameters) Name: LoadDirectoryFiles Return type: FilePathList Description: Load directory filepaths Param[1]: dirPath (type: const char *) -Function 137: LoadDirectoryFilesEx() (3 input parameters) +Function 138: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList Description: Load directory filepaths with extension filtering and recursive directory scan Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) -Function 138: UnloadDirectoryFiles() (1 input parameters) +Function 139: UnloadDirectoryFiles() (1 input parameters) Name: UnloadDirectoryFiles Return type: void Description: Unload filepaths Param[1]: files (type: FilePathList) -Function 139: IsFileDropped() (0 input parameters) +Function 140: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool Description: Check if a file has been dropped into window No input parameters -Function 140: LoadDroppedFiles() (0 input parameters) +Function 141: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles Return type: FilePathList Description: Load dropped filepaths No input parameters -Function 141: UnloadDroppedFiles() (1 input parameters) +Function 142: UnloadDroppedFiles() (1 input parameters) Name: UnloadDroppedFiles Return type: void Description: Unload dropped filepaths Param[1]: files (type: FilePathList) -Function 142: GetFileModTime() (1 input parameters) +Function 143: GetFileModTime() (1 input parameters) Name: GetFileModTime Return type: long Description: Get file modification time (last write time) Param[1]: fileName (type: const char *) -Function 143: CompressData() (3 input parameters) +Function 144: CompressData() (3 input parameters) Name: CompressData Return type: unsigned char * Description: Compress data (DEFLATE algorithm), memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: compDataSize (type: int *) -Function 144: DecompressData() (3 input parameters) +Function 145: DecompressData() (3 input parameters) Name: DecompressData Return type: unsigned char * Description: Decompress data (DEFLATE algorithm), memory must be MemFree() Param[1]: compData (type: const unsigned char *) Param[2]: compDataSize (type: int) Param[3]: dataSize (type: int *) -Function 145: EncodeDataBase64() (3 input parameters) +Function 146: EncodeDataBase64() (3 input parameters) Name: EncodeDataBase64 Return type: char * Description: Encode data to Base64 string, memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: outputSize (type: int *) -Function 146: DecodeDataBase64() (2 input parameters) +Function 147: DecodeDataBase64() (2 input parameters) Name: DecodeDataBase64 Return type: unsigned char * Description: Decode Base64 string data, memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: outputSize (type: int *) -Function 147: LoadAutomationEventList() (1 input parameters) +Function 148: LoadAutomationEventList() (1 input parameters) Name: LoadAutomationEventList Return type: AutomationEventList Description: Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS Param[1]: fileName (type: const char *) -Function 148: UnloadAutomationEventList() (1 input parameters) +Function 149: UnloadAutomationEventList() (1 input parameters) Name: UnloadAutomationEventList Return type: void Description: Unload automation events list from file Param[1]: list (type: AutomationEventList) -Function 149: ExportAutomationEventList() (2 input parameters) +Function 150: ExportAutomationEventList() (2 input parameters) Name: ExportAutomationEventList Return type: bool Description: Export automation events list as text file Param[1]: list (type: AutomationEventList) Param[2]: fileName (type: const char *) -Function 150: SetAutomationEventList() (1 input parameters) +Function 151: SetAutomationEventList() (1 input parameters) Name: SetAutomationEventList Return type: void Description: Set automation event list to record to Param[1]: list (type: AutomationEventList *) -Function 151: SetAutomationEventBaseFrame() (1 input parameters) +Function 152: SetAutomationEventBaseFrame() (1 input parameters) Name: SetAutomationEventBaseFrame Return type: void Description: Set automation event internal base frame to start recording Param[1]: frame (type: int) -Function 152: StartAutomationEventRecording() (0 input parameters) +Function 153: StartAutomationEventRecording() (0 input parameters) Name: StartAutomationEventRecording Return type: void Description: Start recording automation events (AutomationEventList must be set) No input parameters -Function 153: StopAutomationEventRecording() (0 input parameters) +Function 154: StopAutomationEventRecording() (0 input parameters) Name: StopAutomationEventRecording Return type: void Description: Stop recording automation events No input parameters -Function 154: PlayAutomationEvent() (1 input parameters) +Function 155: PlayAutomationEvent() (1 input parameters) Name: PlayAutomationEvent Return type: void Description: Play a recorded automation event Param[1]: event (type: AutomationEvent) -Function 155: IsKeyPressed() (1 input parameters) +Function 156: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool Description: Check if a key has been pressed once Param[1]: key (type: int) -Function 156: IsKeyPressedRepeat() (1 input parameters) +Function 157: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool Description: Check if a key has been pressed again (Only PLATFORM_DESKTOP) Param[1]: key (type: int) -Function 157: IsKeyDown() (1 input parameters) +Function 158: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool Description: Check if a key is being pressed Param[1]: key (type: int) -Function 158: IsKeyReleased() (1 input parameters) +Function 159: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool Description: Check if a key has been released once Param[1]: key (type: int) -Function 159: IsKeyUp() (1 input parameters) +Function 160: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool Description: Check if a key is NOT being pressed Param[1]: key (type: int) -Function 160: GetKeyPressed() (0 input parameters) +Function 161: GetKeyPressed() (0 input parameters) Name: GetKeyPressed Return type: int Description: Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty No input parameters -Function 161: GetCharPressed() (0 input parameters) +Function 162: GetCharPressed() (0 input parameters) Name: GetCharPressed Return type: int Description: Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty No input parameters -Function 162: SetExitKey() (1 input parameters) +Function 163: SetExitKey() (1 input parameters) Name: SetExitKey Return type: void Description: Set a custom key to exit program (default is ESC) Param[1]: key (type: int) -Function 163: IsGamepadAvailable() (1 input parameters) +Function 164: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool Description: Check if a gamepad is available Param[1]: gamepad (type: int) -Function 164: GetGamepadName() (1 input parameters) +Function 165: GetGamepadName() (1 input parameters) Name: GetGamepadName Return type: const char * Description: Get gamepad internal name id Param[1]: gamepad (type: int) -Function 165: IsGamepadButtonPressed() (2 input parameters) +Function 166: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool Description: Check if a gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 166: IsGamepadButtonDown() (2 input parameters) +Function 167: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool Description: Check if a gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 167: IsGamepadButtonReleased() (2 input parameters) +Function 168: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool Description: Check if a gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 168: IsGamepadButtonUp() (2 input parameters) +Function 169: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool Description: Check if a gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 169: GetGamepadButtonPressed() (0 input parameters) +Function 170: GetGamepadButtonPressed() (0 input parameters) Name: GetGamepadButtonPressed Return type: int Description: Get the last gamepad button pressed No input parameters -Function 170: GetGamepadAxisCount() (1 input parameters) +Function 171: GetGamepadAxisCount() (1 input parameters) Name: GetGamepadAxisCount Return type: int Description: Get gamepad axis count for a gamepad Param[1]: gamepad (type: int) -Function 171: GetGamepadAxisMovement() (2 input parameters) +Function 172: GetGamepadAxisMovement() (2 input parameters) Name: GetGamepadAxisMovement Return type: float Description: Get axis movement value for a gamepad axis Param[1]: gamepad (type: int) Param[2]: axis (type: int) -Function 172: SetGamepadMappings() (1 input parameters) +Function 173: SetGamepadMappings() (1 input parameters) Name: SetGamepadMappings Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 173: SetGamepadVibration() (3 input parameters) +Function 174: SetGamepadVibration() (3 input parameters) Name: SetGamepadVibration Return type: void Description: Set gamepad vibration for both motors Param[1]: gamepad (type: int) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) -Function 174: IsMouseButtonPressed() (1 input parameters) +Function 175: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool Description: Check if a mouse button has been pressed once Param[1]: button (type: int) -Function 175: IsMouseButtonDown() (1 input parameters) +Function 176: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool Description: Check if a mouse button is being pressed Param[1]: button (type: int) -Function 176: IsMouseButtonReleased() (1 input parameters) +Function 177: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool Description: Check if a mouse button has been released once Param[1]: button (type: int) -Function 177: IsMouseButtonUp() (1 input parameters) +Function 178: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool Description: Check if a mouse button is NOT being pressed Param[1]: button (type: int) -Function 178: GetMouseX() (0 input parameters) +Function 179: GetMouseX() (0 input parameters) Name: GetMouseX Return type: int Description: Get mouse position X No input parameters -Function 179: GetMouseY() (0 input parameters) +Function 180: GetMouseY() (0 input parameters) Name: GetMouseY Return type: int Description: Get mouse position Y No input parameters -Function 180: GetMousePosition() (0 input parameters) +Function 181: GetMousePosition() (0 input parameters) Name: GetMousePosition Return type: Vector2 Description: Get mouse position XY No input parameters -Function 181: GetMouseDelta() (0 input parameters) +Function 182: GetMouseDelta() (0 input parameters) Name: GetMouseDelta Return type: Vector2 Description: Get mouse delta between frames No input parameters -Function 182: SetMousePosition() (2 input parameters) +Function 183: SetMousePosition() (2 input parameters) Name: SetMousePosition Return type: void Description: Set mouse position XY Param[1]: x (type: int) Param[2]: y (type: int) -Function 183: SetMouseOffset() (2 input parameters) +Function 184: SetMouseOffset() (2 input parameters) Name: SetMouseOffset Return type: void Description: Set mouse offset Param[1]: offsetX (type: int) Param[2]: offsetY (type: int) -Function 184: SetMouseScale() (2 input parameters) +Function 185: SetMouseScale() (2 input parameters) Name: SetMouseScale Return type: void Description: Set mouse scaling Param[1]: scaleX (type: float) Param[2]: scaleY (type: float) -Function 185: GetMouseWheelMove() (0 input parameters) +Function 186: GetMouseWheelMove() (0 input parameters) Name: GetMouseWheelMove Return type: float Description: Get mouse wheel movement for X or Y, whichever is larger No input parameters -Function 186: GetMouseWheelMoveV() (0 input parameters) +Function 187: GetMouseWheelMoveV() (0 input parameters) Name: GetMouseWheelMoveV Return type: Vector2 Description: Get mouse wheel movement for both X and Y No input parameters -Function 187: SetMouseCursor() (1 input parameters) +Function 188: SetMouseCursor() (1 input parameters) Name: SetMouseCursor Return type: void Description: Set mouse cursor Param[1]: cursor (type: int) -Function 188: GetTouchX() (0 input parameters) +Function 189: GetTouchX() (0 input parameters) Name: GetTouchX Return type: int Description: Get touch position X for touch point 0 (relative to screen size) No input parameters -Function 189: GetTouchY() (0 input parameters) +Function 190: GetTouchY() (0 input parameters) Name: GetTouchY Return type: int Description: Get touch position Y for touch point 0 (relative to screen size) No input parameters -Function 190: GetTouchPosition() (1 input parameters) +Function 191: GetTouchPosition() (1 input parameters) Name: GetTouchPosition Return type: Vector2 Description: Get touch position XY for a touch point index (relative to screen size) Param[1]: index (type: int) -Function 191: GetTouchPointId() (1 input parameters) +Function 192: GetTouchPointId() (1 input parameters) Name: GetTouchPointId Return type: int Description: Get touch point identifier for given index Param[1]: index (type: int) -Function 192: GetTouchPointCount() (0 input parameters) +Function 193: GetTouchPointCount() (0 input parameters) Name: GetTouchPointCount Return type: int Description: Get number of touch points No input parameters -Function 193: SetGesturesEnabled() (1 input parameters) +Function 194: SetGesturesEnabled() (1 input parameters) Name: SetGesturesEnabled Return type: void Description: Enable a set of gestures using flags Param[1]: flags (type: unsigned int) -Function 194: IsGestureDetected() (1 input parameters) +Function 195: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool Description: Check if a gesture have been detected Param[1]: gesture (type: unsigned int) -Function 195: GetGestureDetected() (0 input parameters) +Function 196: GetGestureDetected() (0 input parameters) Name: GetGestureDetected Return type: int Description: Get latest detected gesture No input parameters -Function 196: GetGestureHoldDuration() (0 input parameters) +Function 197: GetGestureHoldDuration() (0 input parameters) Name: GetGestureHoldDuration Return type: float Description: Get gesture hold time in milliseconds No input parameters -Function 197: GetGestureDragVector() (0 input parameters) +Function 198: GetGestureDragVector() (0 input parameters) Name: GetGestureDragVector Return type: Vector2 Description: Get gesture drag vector No input parameters -Function 198: GetGestureDragAngle() (0 input parameters) +Function 199: GetGestureDragAngle() (0 input parameters) Name: GetGestureDragAngle Return type: float Description: Get gesture drag angle No input parameters -Function 199: GetGesturePinchVector() (0 input parameters) +Function 200: GetGesturePinchVector() (0 input parameters) Name: GetGesturePinchVector Return type: Vector2 Description: Get gesture pinch delta No input parameters -Function 200: GetGesturePinchAngle() (0 input parameters) +Function 201: GetGesturePinchAngle() (0 input parameters) Name: GetGesturePinchAngle Return type: float Description: Get gesture pinch angle No input parameters -Function 201: UpdateCamera() (2 input parameters) +Function 202: UpdateCamera() (2 input parameters) Name: UpdateCamera Return type: void Description: Update camera position for selected mode Param[1]: camera (type: Camera *) Param[2]: mode (type: int) -Function 202: UpdateCameraPro() (4 input parameters) +Function 203: UpdateCameraPro() (4 input parameters) Name: UpdateCameraPro Return type: void Description: Update camera movement/rotation @@ -2068,36 +2073,36 @@ Function 202: UpdateCameraPro() (4 input parameters) Param[2]: movement (type: Vector3) Param[3]: rotation (type: Vector3) Param[4]: zoom (type: float) -Function 203: SetShapesTexture() (2 input parameters) +Function 204: SetShapesTexture() (2 input parameters) Name: SetShapesTexture Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) Param[2]: source (type: Rectangle) -Function 204: GetShapesTexture() (0 input parameters) +Function 205: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D Description: Get texture that is used for shapes drawing No input parameters -Function 205: GetShapesTextureRectangle() (0 input parameters) +Function 206: GetShapesTextureRectangle() (0 input parameters) Name: GetShapesTextureRectangle Return type: Rectangle Description: Get texture source rectangle that is used for shapes drawing No input parameters -Function 206: DrawPixel() (3 input parameters) +Function 207: DrawPixel() (3 input parameters) Name: DrawPixel Return type: void Description: Draw a pixel Param[1]: posX (type: int) Param[2]: posY (type: int) Param[3]: color (type: Color) -Function 207: DrawPixelV() (2 input parameters) +Function 208: DrawPixelV() (2 input parameters) Name: DrawPixelV Return type: void Description: Draw a pixel (Vector version) Param[1]: position (type: Vector2) Param[2]: color (type: Color) -Function 208: DrawLine() (5 input parameters) +Function 209: DrawLine() (5 input parameters) Name: DrawLine Return type: void Description: Draw a line @@ -2106,14 +2111,14 @@ Function 208: DrawLine() (5 input parameters) Param[3]: endPosX (type: int) Param[4]: endPosY (type: int) Param[5]: color (type: Color) -Function 209: DrawLineV() (3 input parameters) +Function 210: DrawLineV() (3 input parameters) Name: DrawLineV Return type: void Description: Draw a line (using gl lines) Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: color (type: Color) -Function 210: DrawLineEx() (4 input parameters) +Function 211: DrawLineEx() (4 input parameters) Name: DrawLineEx Return type: void Description: Draw a line (using triangles/quads) @@ -2121,14 +2126,14 @@ Function 210: DrawLineEx() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 211: DrawLineStrip() (3 input parameters) +Function 212: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) Param[1]: points (type: Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 212: DrawLineBezier() (4 input parameters) +Function 213: DrawLineBezier() (4 input parameters) Name: DrawLineBezier Return type: void Description: Draw line segment cubic-bezier in-out interpolation @@ -2136,7 +2141,7 @@ Function 212: DrawLineBezier() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 213: DrawCircle() (4 input parameters) +Function 214: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2144,7 +2149,7 @@ Function 213: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 214: DrawCircleSector() (6 input parameters) +Function 215: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2154,7 +2159,7 @@ Function 214: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 215: DrawCircleSectorLines() (6 input parameters) +Function 216: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2164,7 +2169,7 @@ Function 215: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 216: DrawCircleGradient() (5 input parameters) +Function 217: DrawCircleGradient() (5 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2173,14 +2178,14 @@ Function 216: DrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: color1 (type: Color) Param[5]: color2 (type: Color) -Function 217: DrawCircleV() (3 input parameters) +Function 218: DrawCircleV() (3 input parameters) Name: DrawCircleV Return type: void Description: Draw a color-filled circle (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 218: DrawCircleLines() (4 input parameters) +Function 219: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2188,14 +2193,14 @@ Function 218: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 219: DrawCircleLinesV() (3 input parameters) +Function 220: DrawCircleLinesV() (3 input parameters) Name: DrawCircleLinesV Return type: void Description: Draw circle outline (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 220: DrawEllipse() (5 input parameters) +Function 221: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2204,7 +2209,7 @@ Function 220: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 221: DrawEllipseLines() (5 input parameters) +Function 222: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2213,7 +2218,7 @@ Function 221: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 222: DrawRing() (7 input parameters) +Function 223: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2224,7 +2229,7 @@ Function 222: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 223: DrawRingLines() (7 input parameters) +Function 224: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2235,7 +2240,7 @@ Function 223: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 224: DrawRectangle() (5 input parameters) +Function 225: DrawRectangle() (5 input parameters) Name: DrawRectangle Return type: void Description: Draw a color-filled rectangle @@ -2244,20 +2249,20 @@ Function 224: DrawRectangle() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 225: DrawRectangleV() (3 input parameters) +Function 226: DrawRectangleV() (3 input parameters) Name: DrawRectangleV Return type: void Description: Draw a color-filled rectangle (Vector version) Param[1]: position (type: Vector2) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 226: DrawRectangleRec() (2 input parameters) +Function 227: DrawRectangleRec() (2 input parameters) Name: DrawRectangleRec Return type: void Description: Draw a color-filled rectangle Param[1]: rec (type: Rectangle) Param[2]: color (type: Color) -Function 227: DrawRectanglePro() (4 input parameters) +Function 228: DrawRectanglePro() (4 input parameters) Name: DrawRectanglePro Return type: void Description: Draw a color-filled rectangle with pro parameters @@ -2265,7 +2270,7 @@ Function 227: DrawRectanglePro() (4 input parameters) Param[2]: origin (type: Vector2) Param[3]: rotation (type: float) Param[4]: color (type: Color) -Function 228: DrawRectangleGradientV() (6 input parameters) +Function 229: DrawRectangleGradientV() (6 input parameters) Name: DrawRectangleGradientV Return type: void Description: Draw a vertical-gradient-filled rectangle @@ -2275,7 +2280,7 @@ Function 228: DrawRectangleGradientV() (6 input parameters) Param[4]: height (type: int) Param[5]: color1 (type: Color) Param[6]: color2 (type: Color) -Function 229: DrawRectangleGradientH() (6 input parameters) +Function 230: DrawRectangleGradientH() (6 input parameters) Name: DrawRectangleGradientH Return type: void Description: Draw a horizontal-gradient-filled rectangle @@ -2285,7 +2290,7 @@ Function 229: DrawRectangleGradientH() (6 input parameters) Param[4]: height (type: int) Param[5]: color1 (type: Color) Param[6]: color2 (type: Color) -Function 230: DrawRectangleGradientEx() (5 input parameters) +Function 231: DrawRectangleGradientEx() (5 input parameters) Name: DrawRectangleGradientEx Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors @@ -2294,7 +2299,7 @@ Function 230: DrawRectangleGradientEx() (5 input parameters) Param[3]: col2 (type: Color) Param[4]: col3 (type: Color) Param[5]: col4 (type: Color) -Function 231: DrawRectangleLines() (5 input parameters) +Function 232: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void Description: Draw rectangle outline @@ -2303,14 +2308,14 @@ Function 231: DrawRectangleLines() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 232: DrawRectangleLinesEx() (3 input parameters) +Function 233: DrawRectangleLinesEx() (3 input parameters) Name: DrawRectangleLinesEx Return type: void Description: Draw rectangle outline with extended parameters Param[1]: rec (type: Rectangle) Param[2]: lineThick (type: float) Param[3]: color (type: Color) -Function 233: DrawRectangleRounded() (4 input parameters) +Function 234: DrawRectangleRounded() (4 input parameters) Name: DrawRectangleRounded Return type: void Description: Draw rectangle with rounded edges @@ -2318,7 +2323,7 @@ Function 233: DrawRectangleRounded() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 234: DrawRectangleRoundedLines() (4 input parameters) +Function 235: DrawRectangleRoundedLines() (4 input parameters) Name: DrawRectangleRoundedLines Return type: void Description: Draw rectangle lines with rounded edges @@ -2326,7 +2331,7 @@ Function 234: DrawRectangleRoundedLines() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 235: DrawRectangleRoundedLinesEx() (5 input parameters) +Function 236: DrawRectangleRoundedLinesEx() (5 input parameters) Name: DrawRectangleRoundedLinesEx Return type: void Description: Draw rectangle with rounded edges outline @@ -2335,7 +2340,7 @@ Function 235: DrawRectangleRoundedLinesEx() (5 input parameters) Param[3]: segments (type: int) Param[4]: lineThick (type: float) Param[5]: color (type: Color) -Function 236: DrawTriangle() (4 input parameters) +Function 237: DrawTriangle() (4 input parameters) Name: DrawTriangle Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -2343,7 +2348,7 @@ Function 236: DrawTriangle() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 237: DrawTriangleLines() (4 input parameters) +Function 238: DrawTriangleLines() (4 input parameters) Name: DrawTriangleLines Return type: void Description: Draw triangle outline (vertex in counter-clockwise order!) @@ -2351,21 +2356,21 @@ Function 237: DrawTriangleLines() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 238: DrawTriangleFan() (3 input parameters) +Function 239: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) Param[1]: points (type: Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 239: DrawTriangleStrip() (3 input parameters) +Function 240: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 240: DrawPoly() (5 input parameters) +Function 241: DrawPoly() (5 input parameters) Name: DrawPoly Return type: void Description: Draw a regular polygon (Vector version) @@ -2374,7 +2379,7 @@ Function 240: DrawPoly() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 241: DrawPolyLines() (5 input parameters) +Function 242: DrawPolyLines() (5 input parameters) Name: DrawPolyLines Return type: void Description: Draw a polygon outline of n sides @@ -2383,7 +2388,7 @@ Function 241: DrawPolyLines() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 242: DrawPolyLinesEx() (6 input parameters) +Function 243: DrawPolyLinesEx() (6 input parameters) Name: DrawPolyLinesEx Return type: void Description: Draw a polygon outline of n sides with extended parameters @@ -2393,7 +2398,7 @@ Function 242: DrawPolyLinesEx() (6 input parameters) Param[4]: rotation (type: float) Param[5]: lineThick (type: float) Param[6]: color (type: Color) -Function 243: DrawSplineLinear() (4 input parameters) +Function 244: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2401,7 +2406,7 @@ Function 243: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 244: DrawSplineBasis() (4 input parameters) +Function 245: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2409,7 +2414,7 @@ Function 244: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 245: DrawSplineCatmullRom() (4 input parameters) +Function 246: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2417,7 +2422,7 @@ Function 245: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 246: DrawSplineBezierQuadratic() (4 input parameters) +Function 247: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2425,7 +2430,7 @@ Function 246: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 247: DrawSplineBezierCubic() (4 input parameters) +Function 248: DrawSplineBezierCubic() (4 input parameters) Name: DrawSplineBezierCubic Return type: void Description: Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] @@ -2433,7 +2438,7 @@ Function 247: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 248: DrawSplineSegmentLinear() (4 input parameters) +Function 249: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2441,7 +2446,7 @@ Function 248: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 249: DrawSplineSegmentBasis() (6 input parameters) +Function 250: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2451,7 +2456,7 @@ Function 249: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 250: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 251: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2461,7 +2466,7 @@ Function 250: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 251: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 252: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2470,7 +2475,7 @@ Function 251: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 252: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 253: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2480,14 +2485,14 @@ Function 252: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 253: GetSplinePointLinear() (3 input parameters) +Function 254: 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 254: GetSplinePointBasis() (5 input parameters) +Function 255: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2496,7 +2501,7 @@ Function 254: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 255: GetSplinePointCatmullRom() (5 input parameters) +Function 256: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2505,7 +2510,7 @@ Function 255: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 256: GetSplinePointBezierQuad() (4 input parameters) +Function 257: GetSplinePointBezierQuad() (4 input parameters) Name: GetSplinePointBezierQuad Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2513,7 +2518,7 @@ Function 256: GetSplinePointBezierQuad() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 257: GetSplinePointBezierCubic() (5 input parameters) +Function 258: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2522,13 +2527,13 @@ Function 257: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 258: CheckCollisionRecs() (2 input parameters) +Function 259: 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 259: CheckCollisionCircles() (4 input parameters) +Function 260: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2536,27 +2541,27 @@ Function 259: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 260: CheckCollisionCircleRec() (3 input parameters) +Function 261: 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 261: CheckCollisionPointRec() (2 input parameters) +Function 262: 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 262: CheckCollisionPointCircle() (3 input parameters) +Function 263: 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 263: CheckCollisionPointTriangle() (4 input parameters) +Function 264: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2564,14 +2569,14 @@ Function 263: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 264: CheckCollisionPointPoly() (3 input parameters) +Function 265: 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: Vector2 *) Param[3]: pointCount (type: int) -Function 265: CheckCollisionLines() (5 input parameters) +Function 266: 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 @@ -2580,7 +2585,7 @@ Function 265: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 266: CheckCollisionPointLine() (4 input parameters) +Function 267: 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] @@ -2588,18 +2593,18 @@ Function 266: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 267: GetCollisionRec() (2 input parameters) +Function 268: 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 268: LoadImage() (1 input parameters) +Function 269: 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 269: LoadImageRaw() (5 input parameters) +Function 270: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2608,20 +2613,20 @@ Function 269: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 270: LoadImageSvg() (3 input parameters) +Function 271: LoadImageSvg() (3 input parameters) Name: LoadImageSvg Return type: Image Description: Load image from SVG file data or string with specified size Param[1]: fileNameOrString (type: const char *) Param[2]: width (type: int) Param[3]: height (type: int) -Function 271: LoadImageAnim() (2 input parameters) +Function 272: 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 272: LoadImageAnimFromMemory() (4 input parameters) +Function 273: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2629,60 +2634,60 @@ Function 272: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 273: LoadImageFromMemory() (3 input parameters) +Function 274: 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 274: LoadImageFromTexture() (1 input parameters) +Function 275: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 275: LoadImageFromScreen() (0 input parameters) +Function 276: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 276: IsImageReady() (1 input parameters) +Function 277: IsImageReady() (1 input parameters) Name: IsImageReady Return type: bool Description: Check if an image is ready Param[1]: image (type: Image) -Function 277: UnloadImage() (1 input parameters) +Function 278: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 278: ExportImage() (2 input parameters) +Function 279: 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 279: ExportImageToMemory() (3 input parameters) +Function 280: 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 280: ExportImageAsCode() (2 input parameters) +Function 281: 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 281: GenImageColor() (3 input parameters) +Function 282: 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 282: GenImageGradientLinear() (5 input parameters) +Function 283: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2691,7 +2696,7 @@ Function 282: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 283: GenImageGradientRadial() (5 input parameters) +Function 284: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2700,7 +2705,7 @@ Function 283: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 284: GenImageGradientSquare() (5 input parameters) +Function 285: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2709,7 +2714,7 @@ Function 284: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 285: GenImageChecked() (6 input parameters) +Function 286: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2719,14 +2724,14 @@ Function 285: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 286: GenImageWhiteNoise() (3 input parameters) +Function 287: 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 287: GenImagePerlinNoise() (5 input parameters) +Function 288: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2735,39 +2740,39 @@ Function 287: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 288: GenImageCellular() (3 input parameters) +Function 289: 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 289: GenImageText() (3 input parameters) +Function 290: 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 290: ImageCopy() (1 input parameters) +Function 291: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 291: ImageFromImage() (2 input parameters) +Function 292: 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 292: ImageText() (3 input parameters) +Function 293: 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 293: ImageTextEx() (5 input parameters) +Function 294: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2776,76 +2781,76 @@ Function 293: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 294: ImageFormat() (2 input parameters) +Function 295: 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 295: ImageToPOT() (2 input parameters) +Function 296: 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 296: ImageCrop() (2 input parameters) +Function 297: 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 297: ImageAlphaCrop() (2 input parameters) +Function 298: 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 298: ImageAlphaClear() (3 input parameters) +Function 299: 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 299: ImageAlphaMask() (2 input parameters) +Function 300: 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 300: ImageAlphaPremultiply() (1 input parameters) +Function 301: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 301: ImageBlurGaussian() (2 input parameters) +Function 302: 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 302: ImageKernelConvolution() (3 input parameters) +Function 303: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply Custom Square image convolution kernel Param[1]: image (type: Image *) Param[2]: kernel (type: float*) Param[3]: kernelSize (type: int) -Function 303: ImageResize() (3 input parameters) +Function 304: 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 304: ImageResizeNN() (3 input parameters) +Function 305: 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 305: ImageResizeCanvas() (6 input parameters) +Function 306: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2855,12 +2860,12 @@ Function 305: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 306: ImageMipmaps() (1 input parameters) +Function 307: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 307: ImageDither() (5 input parameters) +Function 308: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2869,109 +2874,109 @@ Function 307: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 308: ImageFlipVertical() (1 input parameters) +Function 309: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 309: ImageFlipHorizontal() (1 input parameters) +Function 310: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 310: ImageRotate() (2 input parameters) +Function 311: 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 311: ImageRotateCW() (1 input parameters) +Function 312: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 312: ImageRotateCCW() (1 input parameters) +Function 313: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 313: ImageColorTint() (2 input parameters) +Function 314: 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 314: ImageColorInvert() (1 input parameters) +Function 315: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 315: ImageColorGrayscale() (1 input parameters) +Function 316: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 316: ImageColorContrast() (2 input parameters) +Function 317: 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 317: ImageColorBrightness() (2 input parameters) +Function 318: 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 318: ImageColorReplace() (3 input parameters) +Function 319: 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 319: LoadImageColors() (1 input parameters) +Function 320: 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 320: LoadImagePalette() (3 input parameters) +Function 321: 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 321: UnloadImageColors() (1 input parameters) +Function 322: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 322: UnloadImagePalette() (1 input parameters) +Function 323: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 323: GetImageAlphaBorder() (2 input parameters) +Function 324: 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 324: GetImageColor() (3 input parameters) +Function 325: 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 325: ImageClearBackground() (2 input parameters) +Function 326: 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 326: ImageDrawPixel() (4 input parameters) +Function 327: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -2979,14 +2984,14 @@ Function 326: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 327: ImageDrawPixelV() (3 input parameters) +Function 328: 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 328: ImageDrawLine() (6 input parameters) +Function 329: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -2996,7 +3001,7 @@ Function 328: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 329: ImageDrawLineV() (4 input parameters) +Function 330: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3004,7 +3009,7 @@ Function 329: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 330: ImageDrawCircle() (5 input parameters) +Function 331: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3013,7 +3018,7 @@ Function 330: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 331: ImageDrawCircleV() (4 input parameters) +Function 332: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3021,7 +3026,7 @@ Function 331: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 332: ImageDrawCircleLines() (5 input parameters) +Function 333: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3030,7 +3035,7 @@ Function 332: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 333: ImageDrawCircleLinesV() (4 input parameters) +Function 334: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3038,7 +3043,7 @@ Function 333: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 334: ImageDrawRectangle() (6 input parameters) +Function 335: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3048,7 +3053,7 @@ Function 334: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 335: ImageDrawRectangleV() (4 input parameters) +Function 336: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3056,14 +3061,14 @@ Function 335: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 336: ImageDrawRectangleRec() (3 input parameters) +Function 337: 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 337: ImageDrawRectangleLines() (4 input parameters) +Function 338: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3071,7 +3076,7 @@ Function 337: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 338: ImageDraw() (5 input parameters) +Function 339: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3080,7 +3085,7 @@ Function 338: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 339: ImageDrawText() (6 input parameters) +Function 340: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3090,7 +3095,7 @@ Function 339: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 340: ImageDrawTextEx() (7 input parameters) +Function 341: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3101,79 +3106,79 @@ Function 340: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 341: LoadTexture() (1 input parameters) +Function 342: 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 342: LoadTextureFromImage() (1 input parameters) +Function 343: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 343: LoadTextureCubemap() (2 input parameters) +Function 344: 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 344: LoadRenderTexture() (2 input parameters) +Function 345: 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 345: IsTextureReady() (1 input parameters) +Function 346: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 346: UnloadTexture() (1 input parameters) +Function 347: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 347: IsRenderTextureReady() (1 input parameters) +Function 348: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 348: UnloadRenderTexture() (1 input parameters) +Function 349: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 349: UpdateTexture() (2 input parameters) +Function 350: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 350: UpdateTextureRec() (3 input parameters) +Function 351: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 351: GenTextureMipmaps() (1 input parameters) +Function 352: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 352: SetTextureFilter() (2 input parameters) +Function 353: 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 353: SetTextureWrap() (2 input parameters) +Function 354: 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 354: DrawTexture() (4 input parameters) +Function 355: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3181,14 +3186,14 @@ Function 354: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 355: DrawTextureV() (3 input parameters) +Function 356: 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 356: DrawTextureEx() (5 input parameters) +Function 357: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3197,7 +3202,7 @@ Function 356: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 357: DrawTextureRec() (4 input parameters) +Function 358: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3205,7 +3210,7 @@ Function 357: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 358: DrawTexturePro() (6 input parameters) +Function 359: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3215,7 +3220,7 @@ Function 358: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 359: DrawTextureNPatch() (6 input parameters) +Function 360: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3225,112 +3230,112 @@ Function 359: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 360: ColorIsEqual() (2 input parameters) +Function 361: 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 361: Fade() (2 input parameters) +Function 362: 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 362: ColorToInt() (1 input parameters) +Function 363: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 363: ColorNormalize() (1 input parameters) +Function 364: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 364: ColorFromNormalized() (1 input parameters) +Function 365: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 365: ColorToHSV() (1 input parameters) +Function 366: 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 366: ColorFromHSV() (3 input parameters) +Function 367: 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 367: ColorTint() (2 input parameters) +Function 368: 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 368: ColorBrightness() (2 input parameters) +Function 369: 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 369: ColorContrast() (2 input parameters) +Function 370: 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 370: ColorAlpha() (2 input parameters) +Function 371: 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 371: ColorAlphaBlend() (3 input parameters) +Function 372: 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 372: GetColor() (1 input parameters) +Function 373: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 373: GetPixelColor() (2 input parameters) +Function 374: 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 374: SetPixelColor() (3 input parameters) +Function 375: 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 375: GetPixelDataSize() (3 input parameters) +Function 376: 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 376: GetFontDefault() (0 input parameters) +Function 377: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 377: LoadFont() (1 input parameters) +Function 378: 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 378: LoadFontEx() (4 input parameters) +Function 379: 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 setFont @@ -3338,14 +3343,14 @@ Function 378: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 379: LoadFontFromImage() (3 input parameters) +Function 380: 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 380: LoadFontFromMemory() (6 input parameters) +Function 381: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3355,12 +3360,12 @@ Function 380: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 381: IsFontReady() (1 input parameters) +Function 382: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 382: LoadFontData() (6 input parameters) +Function 383: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3370,7 +3375,7 @@ Function 382: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 383: GenImageFontAtlas() (6 input parameters) +Function 384: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3380,30 +3385,30 @@ Function 383: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 384: UnloadFontData() (2 input parameters) +Function 385: 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 385: UnloadFont() (1 input parameters) +Function 386: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 386: ExportFontAsCode() (2 input parameters) +Function 387: 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 387: DrawFPS() (2 input parameters) +Function 388: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 388: DrawText() (5 input parameters) +Function 389: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3412,7 +3417,7 @@ Function 388: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 389: DrawTextEx() (6 input parameters) +Function 390: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3422,7 +3427,7 @@ Function 389: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 390: DrawTextPro() (8 input parameters) +Function 391: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3434,7 +3439,7 @@ Function 390: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 391: DrawTextCodepoint() (5 input parameters) +Function 392: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3443,7 +3448,7 @@ Function 391: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 392: DrawTextCodepoints() (7 input parameters) +Function 393: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3454,18 +3459,18 @@ Function 392: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 393: SetTextLineSpacing() (1 input parameters) +Function 394: 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 394: MeasureText() (2 input parameters) +Function 395: 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 395: MeasureTextEx() (4 input parameters) +Function 396: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3473,185 +3478,185 @@ Function 395: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 396: GetGlyphIndex() (2 input parameters) +Function 397: 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 397: GetGlyphInfo() (2 input parameters) +Function 398: 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 398: GetGlyphAtlasRec() (2 input parameters) +Function 399: 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 399: LoadUTF8() (2 input parameters) +Function 400: 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 400: UnloadUTF8() (1 input parameters) +Function 401: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 401: LoadCodepoints() (2 input parameters) +Function 402: 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 402: UnloadCodepoints() (1 input parameters) +Function 403: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 403: GetCodepointCount() (1 input parameters) +Function 404: 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 404: GetCodepoint() (2 input parameters) +Function 405: 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 405: GetCodepointNext() (2 input parameters) +Function 406: 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 406: GetCodepointPrevious() (2 input parameters) +Function 407: 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 407: CodepointToUTF8() (2 input parameters) +Function 408: 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 408: TextCopy() (2 input parameters) +Function 409: 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 409: TextIsEqual() (2 input parameters) +Function 410: 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 410: TextLength() (1 input parameters) +Function 411: 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 411: TextFormat() (2 input parameters) +Function 412: 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 412: TextSubtext() (3 input parameters) +Function 413: 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 413: TextReplace() (3 input parameters) +Function 414: 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 414: TextInsert() (3 input parameters) +Function 415: 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 415: TextJoin() (3 input parameters) +Function 416: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 416: TextSplit() (3 input parameters) +Function 417: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 417: TextAppend() (3 input parameters) +Function 418: 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 418: TextFindIndex() (2 input parameters) +Function 419: 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 419: TextToUpper() (1 input parameters) +Function 420: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 420: TextToLower() (1 input parameters) +Function 421: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 421: TextToPascal() (1 input parameters) +Function 422: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 422: TextToInteger() (1 input parameters) +Function 423: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 423: TextToFloat() (1 input parameters) +Function 424: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 424: DrawLine3D() (3 input parameters) +Function 425: 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 425: DrawPoint3D() (2 input parameters) +Function 426: 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 426: DrawCircle3D() (5 input parameters) +Function 427: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3660,7 +3665,7 @@ Function 426: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 427: DrawTriangle3D() (4 input parameters) +Function 428: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3668,14 +3673,14 @@ Function 427: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 428: DrawTriangleStrip3D() (3 input parameters) +Function 429: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 429: DrawCube() (5 input parameters) +Function 430: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3684,14 +3689,14 @@ Function 429: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 430: DrawCubeV() (3 input parameters) +Function 431: 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 431: DrawCubeWires() (5 input parameters) +Function 432: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3700,21 +3705,21 @@ Function 431: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 432: DrawCubeWiresV() (3 input parameters) +Function 433: 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 433: DrawSphere() (3 input parameters) +Function 434: 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 434: DrawSphereEx() (5 input parameters) +Function 435: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3723,7 +3728,7 @@ Function 434: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 435: DrawSphereWires() (5 input parameters) +Function 436: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3732,7 +3737,7 @@ Function 435: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 436: DrawCylinder() (6 input parameters) +Function 437: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3742,7 +3747,7 @@ Function 436: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 437: DrawCylinderEx() (6 input parameters) +Function 438: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3752,7 +3757,7 @@ Function 437: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 438: DrawCylinderWires() (6 input parameters) +Function 439: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3762,7 +3767,7 @@ Function 438: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 439: DrawCylinderWiresEx() (6 input parameters) +Function 440: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3772,7 +3777,7 @@ Function 439: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 440: DrawCapsule() (6 input parameters) +Function 441: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3782,7 +3787,7 @@ Function 440: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 441: DrawCapsuleWires() (6 input parameters) +Function 442: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3792,51 +3797,51 @@ Function 441: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 442: DrawPlane() (3 input parameters) +Function 443: 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 443: DrawRay() (2 input parameters) +Function 444: 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 444: DrawGrid() (2 input parameters) +Function 445: 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 445: LoadModel() (1 input parameters) +Function 446: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 446: LoadModelFromMesh() (1 input parameters) +Function 447: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 447: IsModelReady() (1 input parameters) +Function 448: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 448: UnloadModel() (1 input parameters) +Function 449: 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 449: GetModelBoundingBox() (1 input parameters) +Function 450: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 450: DrawModel() (4 input parameters) +Function 451: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3844,7 +3849,7 @@ Function 450: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 451: DrawModelEx() (6 input parameters) +Function 452: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3854,7 +3859,7 @@ Function 451: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 452: DrawModelWires() (4 input parameters) +Function 453: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3862,7 +3867,7 @@ Function 452: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 453: DrawModelWiresEx() (6 input parameters) +Function 454: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3872,13 +3877,13 @@ Function 453: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 454: DrawBoundingBox() (2 input parameters) +Function 455: 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 455: DrawBillboard() (5 input parameters) +Function 456: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3887,7 +3892,7 @@ Function 455: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 456: DrawBillboardRec() (6 input parameters) +Function 457: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3897,7 +3902,7 @@ Function 456: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 457: DrawBillboardPro() (9 input parameters) +Function 458: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3910,13 +3915,13 @@ Function 457: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 458: UploadMesh() (2 input parameters) +Function 459: 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 459: UpdateMeshBuffer() (5 input parameters) +Function 460: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3925,19 +3930,19 @@ Function 459: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 460: UnloadMesh() (1 input parameters) +Function 461: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 461: DrawMesh() (3 input parameters) +Function 462: 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 462: DrawMeshInstanced() (4 input parameters) +Function 463: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3945,35 +3950,35 @@ Function 462: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 463: GetMeshBoundingBox() (1 input parameters) +Function 464: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 464: GenMeshTangents() (1 input parameters) +Function 465: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 465: ExportMesh() (2 input parameters) +Function 466: 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 466: ExportMeshAsCode() (2 input parameters) +Function 467: 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 467: GenMeshPoly() (2 input parameters) +Function 468: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 468: GenMeshPlane() (4 input parameters) +Function 469: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -3981,42 +3986,42 @@ Function 468: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 469: GenMeshCube() (3 input parameters) +Function 470: 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 470: GenMeshSphere() (3 input parameters) +Function 471: 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 471: GenMeshHemiSphere() (3 input parameters) +Function 472: 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 472: GenMeshCylinder() (3 input parameters) +Function 473: 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 473: GenMeshCone() (3 input parameters) +Function 474: 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 474: GenMeshTorus() (4 input parameters) +Function 475: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4024,7 +4029,7 @@ Function 474: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 475: GenMeshKnot() (4 input parameters) +Function 476: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4032,84 +4037,84 @@ Function 475: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 476: GenMeshHeightmap() (2 input parameters) +Function 477: 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 477: GenMeshCubicmap() (2 input parameters) +Function 478: 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 478: LoadMaterials() (2 input parameters) +Function 479: 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 479: LoadMaterialDefault() (0 input parameters) +Function 480: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 480: IsMaterialReady() (1 input parameters) +Function 481: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 481: UnloadMaterial() (1 input parameters) +Function 482: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 482: SetMaterialTexture() (3 input parameters) +Function 483: 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 483: SetModelMeshMaterial() (3 input parameters) +Function 484: 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 484: LoadModelAnimations() (2 input parameters) +Function 485: 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 485: UpdateModelAnimation() (3 input parameters) +Function 486: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 486: UnloadModelAnimation() (1 input parameters) +Function 487: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 487: UnloadModelAnimations() (2 input parameters) +Function 488: 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 488: IsModelAnimationValid() (2 input parameters) +Function 489: 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 489: CheckCollisionSpheres() (4 input parameters) +Function 490: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4117,40 +4122,40 @@ Function 489: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 490: CheckCollisionBoxes() (2 input parameters) +Function 491: 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 491: CheckCollisionBoxSphere() (3 input parameters) +Function 492: 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 492: GetRayCollisionSphere() (3 input parameters) +Function 493: 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 493: GetRayCollisionBox() (2 input parameters) +Function 494: 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 494: GetRayCollisionMesh() (3 input parameters) +Function 495: 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 495: GetRayCollisionTriangle() (4 input parameters) +Function 496: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4158,7 +4163,7 @@ Function 495: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 496: GetRayCollisionQuad() (5 input parameters) +Function 497: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4167,158 +4172,158 @@ Function 496: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 497: InitAudioDevice() (0 input parameters) +Function 498: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 498: CloseAudioDevice() (0 input parameters) +Function 499: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 499: IsAudioDeviceReady() (0 input parameters) +Function 500: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 500: SetMasterVolume() (1 input parameters) +Function 501: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 501: GetMasterVolume() (0 input parameters) +Function 502: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 502: LoadWave() (1 input parameters) +Function 503: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 503: LoadWaveFromMemory() (3 input parameters) +Function 504: 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 504: IsWaveReady() (1 input parameters) +Function 505: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 505: LoadSound() (1 input parameters) +Function 506: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 506: LoadSoundFromWave() (1 input parameters) +Function 507: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 507: LoadSoundAlias() (1 input parameters) +Function 508: 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 508: IsSoundReady() (1 input parameters) +Function 509: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 509: UpdateSound() (3 input parameters) +Function 510: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 510: UnloadWave() (1 input parameters) +Function 511: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 511: UnloadSound() (1 input parameters) +Function 512: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 512: UnloadSoundAlias() (1 input parameters) +Function 513: 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 513: ExportWave() (2 input parameters) +Function 514: 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 514: ExportWaveAsCode() (2 input parameters) +Function 515: 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 515: PlaySound() (1 input parameters) +Function 516: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 516: StopSound() (1 input parameters) +Function 517: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 517: PauseSound() (1 input parameters) +Function 518: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 518: ResumeSound() (1 input parameters) +Function 519: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 519: IsSoundPlaying() (1 input parameters) +Function 520: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 520: SetSoundVolume() (2 input parameters) +Function 521: 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 521: SetSoundPitch() (2 input parameters) +Function 522: 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 522: SetSoundPan() (2 input parameters) +Function 523: 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 523: WaveCopy() (1 input parameters) +Function 524: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 524: WaveCrop() (3 input parameters) +Function 525: 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 525: WaveFormat() (4 input parameters) +Function 526: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4326,203 +4331,203 @@ Function 525: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 526: LoadWaveSamples() (1 input parameters) +Function 527: 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 527: UnloadWaveSamples() (1 input parameters) +Function 528: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 528: LoadMusicStream() (1 input parameters) +Function 529: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 529: LoadMusicStreamFromMemory() (3 input parameters) +Function 530: 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 530: IsMusicReady() (1 input parameters) +Function 531: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 531: UnloadMusicStream() (1 input parameters) +Function 532: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 532: PlayMusicStream() (1 input parameters) +Function 533: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 533: IsMusicStreamPlaying() (1 input parameters) +Function 534: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 534: UpdateMusicStream() (1 input parameters) +Function 535: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 535: StopMusicStream() (1 input parameters) +Function 536: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 536: PauseMusicStream() (1 input parameters) +Function 537: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 537: ResumeMusicStream() (1 input parameters) +Function 538: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 538: SeekMusicStream() (2 input parameters) +Function 539: 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 539: SetMusicVolume() (2 input parameters) +Function 540: 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 540: SetMusicPitch() (2 input parameters) +Function 541: 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 541: SetMusicPan() (2 input parameters) +Function 542: 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 542: GetMusicTimeLength() (1 input parameters) +Function 543: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 543: GetMusicTimePlayed() (1 input parameters) +Function 544: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 544: LoadAudioStream() (3 input parameters) +Function 545: 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 545: IsAudioStreamReady() (1 input parameters) +Function 546: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 546: UnloadAudioStream() (1 input parameters) +Function 547: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 547: UpdateAudioStream() (3 input parameters) +Function 548: 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 548: IsAudioStreamProcessed() (1 input parameters) +Function 549: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 549: PlayAudioStream() (1 input parameters) +Function 550: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 550: PauseAudioStream() (1 input parameters) +Function 551: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 551: ResumeAudioStream() (1 input parameters) +Function 552: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 552: IsAudioStreamPlaying() (1 input parameters) +Function 553: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 553: StopAudioStream() (1 input parameters) +Function 554: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 554: SetAudioStreamVolume() (2 input parameters) +Function 555: 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 555: SetAudioStreamPitch() (2 input parameters) +Function 556: 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 556: SetAudioStreamPan() (2 input parameters) +Function 557: 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 557: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 558: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 558: SetAudioStreamCallback() (2 input parameters) +Function 559: 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 559: AttachAudioStreamProcessor() (2 input parameters) +Function 560: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 560: DetachAudioStreamProcessor() (2 input parameters) +Function 561: 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 561: AttachAudioMixedProcessor() (1 input parameters) +Function 562: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 562: DetachAudioMixedProcessor() (1 input parameters) +Function 563: 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 e079a198e370..e7fa157b2073 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -1075,6 +1075,9 @@ + + + From 2e38069475d78c75580e95c23c01216dda185ee4 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 29 May 2024 11:07:28 -0400 Subject: [PATCH 07/71] [build.zig] Fix Zig emscripten build (#4012) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix for issue #4010 Split the code for Zig's master branch and >= 0.12.0 due to changes in https://github.com/ziglang/zig/pull/19623 * Restore the cache_include path which was removed in error Accidently removed a couple lines I didn't mean to 🙈 --- src/build.zig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/build.zig b/src/build.zig index d172b3c2a789..51a8ab7b0837 100644 --- a/src/build.zig +++ b/src/build.zig @@ -201,10 +201,15 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. const cache_include = std.fs.path.join(b.allocator, &.{ b.sysroot.?, "cache", "sysroot", "include" }) catch @panic("Out of memory"); defer b.allocator.free(cache_include); - var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); - dir.close(); - - raylib.addIncludePath(b.path(cache_include)); + if (comptime builtin.zig_version.minor > 12) { + var dir = std.fs.cwd().openDir(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); + dir.close(); + raylib.addIncludePath(b.path(cache_include)); + } else { + var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); + dir.close(); + raylib.addIncludePath(.{ .path = cache_include }); + } }, else => { @panic("Unsupported OS"); From 2804e758694390d00a0784ebe761531f7021bfc9 Mon Sep 17 00:00:00 2001 From: DarkAssassin23 <15916504+DarkAssassin23@users.noreply.github.com> Date: Wed, 29 May 2024 11:22:59 -0400 Subject: [PATCH 08/71] [rtext] Added cast to ExportFontAsCode output to fix C++ compiler errors (#4013) --- src/rtext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 1ddb62509c3d..5ebabc662bdf 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1093,8 +1093,8 @@ bool ExportFontAsCode(Font font, const char *fileName) #else byteCount += sprintf(txtData + byteCount, " // Assign glyph recs and info data directly\n"); byteCount += sprintf(txtData + byteCount, " // WARNING: This font data must not be unloaded\n"); - byteCount += sprintf(txtData + byteCount, " font.recs = fontRecs_%s;\n", fileNamePascal); - byteCount += sprintf(txtData + byteCount, " font.glyphs = fontGlyphs_%s;\n\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)fontRecs_%s;\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.glyphs = (GlyphInfo *)fontGlyphs_%s;\n\n", fileNamePascal); #endif byteCount += sprintf(txtData + byteCount, " return font;\n"); byteCount += sprintf(txtData + byteCount, "}\n"); From e37d19ab1eae7d4d0e9d3229c7b2ececf3efb61f Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 May 2024 17:28:55 +0200 Subject: [PATCH 09/71] REVIEWED: `ExportFontAsCode()`, avoid `const` #4013 --- src/rtext.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 5ebabc662bdf..5ba4e8b6ab68 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1035,7 +1035,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // Save font recs data byteCount += sprintf(txtData + byteCount, "// Font characters rectangles data\n"); - byteCount += sprintf(txtData + byteCount, "static const Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %1.0f, %1.0f, %1.0f , %1.0f },\n", font.recs[i].x, font.recs[i].y, font.recs[i].width, font.recs[i].height); @@ -1047,7 +1047,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // it could be generated from image and recs byteCount += sprintf(txtData + byteCount, "// Font glyphs info data\n"); byteCount += sprintf(txtData + byteCount, "// NOTE: No glyphs.image data provided\n"); - byteCount += sprintf(txtData + byteCount, "static const GlyphInfo fontGlyphs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static GlyphInfo fontGlyphs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %i, %i, %i, %i, { 0 }},\n", font.glyphs[i].value, font.glyphs[i].offsetX, font.glyphs[i].offsetY, font.glyphs[i].advanceX); @@ -1093,8 +1093,8 @@ bool ExportFontAsCode(Font font, const char *fileName) #else byteCount += sprintf(txtData + byteCount, " // Assign glyph recs and info data directly\n"); byteCount += sprintf(txtData + byteCount, " // WARNING: This font data must not be unloaded\n"); - byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)fontRecs_%s;\n", fileNamePascal); - byteCount += sprintf(txtData + byteCount, " font.glyphs = (GlyphInfo *)fontGlyphs_%s;\n\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.recs = fontRecs_%s;\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.glyphs = fontGlyphs_%s;\n\n", fileNamePascal); #endif byteCount += sprintf(txtData + byteCount, " return font;\n"); byteCount += sprintf(txtData + byteCount, "}\n"); From c04629f6d46fbea68a69a3b376c02137a325ca53 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 May 2024 17:38:19 +0200 Subject: [PATCH 10/71] Update raylib.h --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index e810dcdca18c..b870cc6ca1bd 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1124,7 +1124,7 @@ RLAPI const char *GetWorkingDirectory(void); // Get current RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory -RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS +RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths From f2344cd08944a7be63b9e5ebf134daf5ff1cd84f Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Wed, 29 May 2024 23:44:20 +0200 Subject: [PATCH 11/71] review color tint functions (#4015) --- src/rtextures.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 571387f2370f..2f02afece039 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -2667,17 +2667,12 @@ void ImageColorTint(Image *image, Color color) Color *pixels = LoadImageColors(*image); - float cR = (float)color.r/255; - float cG = (float)color.g/255; - float cB = (float)color.b/255; - float cA = (float)color.a/255; - for (int i = 0; i < image->width*image->height; i++) { - unsigned char r = (unsigned char)(((float)pixels[i].r/255*cR)*255.0f); - unsigned char g = (unsigned char)(((float)pixels[i].g/255*cG)*255.0f); - unsigned char b = (unsigned char)(((float)pixels[i].b/255*cB)*255.0f); - unsigned char a = (unsigned char)(((float)pixels[i].a/255*cA)*255.0f); + unsigned char r = (unsigned char)(((int)pixels[i].r*(int)color.r)/255); + unsigned char g = (unsigned char)(((int)pixels[i].g*(int)color.g)/255); + unsigned char b = (unsigned char)(((int)pixels[i].b*(int)color.b)/255); + unsigned char a = (unsigned char)(((int)pixels[i].a*(int)color.a)/255); pixels[i].r = r; pixels[i].g = g; @@ -4639,15 +4634,10 @@ Color ColorTint(Color color, Color tint) { Color result = color; - float cR = (float)tint.r/255; - float cG = (float)tint.g/255; - float cB = (float)tint.b/255; - float cA = (float)tint.a/255; - - unsigned char r = (unsigned char)(((float)color.r/255*cR)*255.0f); - unsigned char g = (unsigned char)(((float)color.g/255*cG)*255.0f); - unsigned char b = (unsigned char)(((float)color.b/255*cB)*255.0f); - unsigned char a = (unsigned char)(((float)color.a/255*cA)*255.0f); + unsigned char r = (unsigned char)(((int)color.r*(int)tint.r)/255); + unsigned char g = (unsigned char)(((int)color.g*(int)tint.g)/255); + unsigned char b = (unsigned char)(((int)color.b*(int)tint.b)/255); + unsigned char a = (unsigned char)(((int)color.a*(int)tint.a)/255); result.r = r; result.g = g; From d7a8af144d066e28e821916ac10e66407e7bfa05 Mon Sep 17 00:00:00 2001 From: vaezim <91099081+vaezim@users.noreply.github.com> Date: Thu, 30 May 2024 02:22:07 -0400 Subject: [PATCH 12/71] Fix typos in markdowns and comments, Fix invalid links in HISTORY.md (#4017) --- BINDINGS.md | 2 +- CHANGELOG | 2 +- CONTRIBUTING.md | 12 +- CONVENTIONS.md | 4 +- FAQ.md | 20 +-- HISTORY.md | 150 +++++++++--------- ROADMAP.md | 4 +- examples/README.md | 2 +- examples/core/core_custom_frame_control.c | 2 +- .../raylib_npp_parser/raylib_npp.xml | 4 +- .../raylib_npp_parser/raylib_to_parse.h | 2 +- src/config.h | 2 +- src/raylib.h | 6 +- 13 files changed, 106 insertions(+), 106 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 118794d5299e..81bc6abda88c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -1,6 +1,6 @@ # raylib bindings and wrappers -Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list. +Some people ported raylib to other languages in the form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list. ### Language Bindings diff --git a/CHANGELOG b/CHANGELOG index 77df794dbc8e..2141926ce8b2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -642,7 +642,7 @@ Release: raylib 4.0 - 8th Anniversary Edition (05 November 2021) KEY CHANGES: - Naming consistency and coherency: Complete review of the library: syntax, naming, comments, decriptions, logs... - Event Automation System: Support for input events recording and automatic re-playing, useful for automated testing and more! - - Custom game-loop control: Intended for advance users that want to control the events polling and the timming mechanisms + - Custom game-loop control: Intended for advanced users that want to control the events polling and the timming mechanisms - rlgl 4.0: Completely decoupling from platform layer and raylib, intended for standalone usage as single-file header-only - raymath 1.5: Complete review following new conventions, to make it more portable and self-contained - raygui 3.0: Complete review and official new release, more portable and self-contained, intended for tools development diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 644a89bf4ce0..78f953baf196 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ Do you enjoy raylib and want to contribute? Nice! You can help with the followin - `Testing` - Can you find some bugs in raylib? This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules. -Use your best judgement, and feel free to propose changes to this document in a pull request. +Use your best judgment, and feel free to propose changes to this document in a pull request. ### raylib philosophy @@ -28,14 +28,14 @@ Use your best judgement, and feel free to propose changes to this document in a - [raylib license](LICENSE) - [raylib roadmap](ROADMAP.md) -[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone for edit. +[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone to edit. Feel free to review it if required, just take care not to break something. ### raylib C coding conventions Despite being written in C, raylib does not follow the standard Hungarian notation for C, it [follows Pascal-case/camel-case notation](https://github.com/raysan5/raylib/wiki/raylib-coding-conventions), -more common on C# language. All code formatting decisions have been carefully taken +more common in C# language. All code formatting decisions have been carefully taken to make it easier for students/users to read, write and understand code. Source code is extensively commented for that purpose, raylib primary learning method is: @@ -46,12 +46,12 @@ For detailed information on building raylib and examples, please check [raylib W ### Opening new Issues -To open new issue for raylib (bug, enhancement, discussion...), just try to follow these rules: +To open new issues for raylib (bug, enhancement, discussion...), just try to follow these rules: - Make sure the issue has not already been reported before by searching on GitHub under Issues. - If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample demonstrating the unexpected behavior. - - If applies, attach some screenshot of the issue and a .zip file with the code sample and required resources. + - If applicable, attach some screenshot of the issue and a .zip file with the code sample and required resources. - On issue description, add a brackets tag about the raylib module that relates to this issue. If don't know which module, just report the issue, I will review it. - You can check other issues to see how is being done! @@ -60,7 +60,7 @@ To open new issue for raylib (bug, enhancement, discussion...), just try to foll - Make sure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. - Don't send big pull requests (lots of changelists), they are difficult to review. It's better to send small pull requests, one at a time. - - Verify that changes don't break the build (at least on Windows platform). As many platforms where you can test it, the better, but don't worry + - Verify that changes don't break the build (at least on Windows platform). The more platforms where you can test it, the better, but don't worry if you cannot test all the platforms. ### Contact information diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 37db230e59db..b7ace0275b42 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -1,6 +1,6 @@ ## C Coding Style Conventions -Here it is a list with some of the code conventions used by raylib: +Here is a list with some of the code conventions used by raylib: Code element | Convention | Example --- | :---: | --- @@ -79,7 +79,7 @@ _NOTE: Avoid any space or special character in the files/dir naming!_ - Data files should be organized by context and usage in the game, think about the loading requirements for data and put all the resources that need to be loaded at the same time together. - Use descriptive names for the files, it would be perfect if just reading the name of the file, it was possible to know what is that file and where fits in the game. - - Here it is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font). + - Here is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font). ``` resources/audio/fx/long_jump.wav diff --git a/FAQ.md b/FAQ.md index be06657b92b1..d2f9308acf69 100644 --- a/FAQ.md +++ b/FAQ.md @@ -40,13 +40,13 @@ Yes, raylib can be used to create any kind of application, not just videogames. ### How can I learn to use raylib? Is there some official documentation or tutorials? -raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look to [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching. +raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look at [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching. raylib also provides a big [collection of examples](https://www.raylib.com/examples.html), to showcase the multiple functionality usage (+120 examples). Examples are categorized by the internal module functionality and also define an estimated level of difficulty to guide the users checking them. There is also a [FAQ on the raylib Wiki](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions) with common technical questions. -There are also many tutorials on the internet and YouTube created by the growing raylib community along the years. +There are also many tutorials on the internet and YouTube created by the growing raylib community over the years. [raylib Discord Community](https://discord.gg/raylib) is also a great place to join and ask questions, the community is very friendly and always ready to help. @@ -56,7 +56,7 @@ raylib is [free and open source](https://github.com/raysan5/raylib). Anyone can ### What is the raylib license? -raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details. +raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed-source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details. ### What platforms are supported by raylib? @@ -90,25 +90,25 @@ I personally consider raylib a graphics library with some high-level features ra ### What does raylib provide that other engines or libraries don't? -I would say "simplicity" and "enjoyment" at a really low-level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try. +I would say "simplicity" and "enjoyment" at a really low level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try. ### How does raylib compare to Unity/Unreal/Godot? Those engines are usually big and complex to use, providing lot of functionality. They require some time to learn and test, they usually abstract many parts of the game development process and they usually provide a set of tools to assist users on their creations (like a GUI editor). -raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low-level to create graphics applications in a more handmade way. +raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low level to create graphics applications in a more handmade way. ### What development tools are required for raylib? To develop raylib programs you only need a text editor (with recommended code syntax highlighting) and a compiler. -A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advance configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials. +A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advanced configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials. ### What are raylib's external dependencies? -raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file-formats. +raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file formats. -A detailed list of raylib dependencies could be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies). +A detailed list of raylib dependencies can be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies). ### Can I use raylib with other technologies or libraries? @@ -129,10 +129,10 @@ No, raylib is built on top of OpenGL API, and there are currently no plans to su ### What could I expect to see in raylib in the future? -The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features are regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable. +The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features being regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable. ### Who are the raylib developers? -The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there's 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib. +The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there are 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib. The full list of raylib contributors can be seen [on GitHub](https://github.com/raysan5/raylib/graphs/contributors). diff --git a/HISTORY.md b/HISTORY.md index de14b651c0a9..035054dbe971 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,13 +3,13 @@ introduction ------------ -I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profile, most of students had never written a single line of code. +I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profiles, most of students had never written a single line of code. I decided to start with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found [WinBGI](https://winbgim.codecutter.org/); it was great and it worked very well with students, in just a couple of weeks, those students that had never written a single line of code were able to program (and understand) a simple PONG game, some of them even a BREAKOUT! -But WinBGI was not the clearer and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration. +But WinBGI was not the clearest and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration. -So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, the most important, primarily intended to learn videogames programming. +So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, most importantly, primarily intended to learn videogames programming. My previous videogames development experience was mostly in C# and [XNA](https://en.wikipedia.org/wiki/Microsoft_XNA) and I really loved it, so, I decided to use C# language style notation and XNA naming conventions. That way, students were able to move from raylib to XNA, MonoGame or similar libs extremely easily. @@ -20,28 +20,28 @@ Enjoy it. notes on raylib 1.1 ------------------- -On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0. +On April 2014, after 6 months of first raylib release, raylib 1.1 was released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0. - A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define. - [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes a bunch of useful functions for 3d-math with vectors, matrices and quaternions. -Some other big changes of this new version have been the support for OGG files loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support. +Some other big changes of this new version have been the support for OGG file loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support. -Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1. +Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.1. notes on raylib 1.2 ------------------- -On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/). +On September 2014, after 5 months of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/). -It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch. +It's been some months of really hard work to accommodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cycle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch. - - A new display initialization system has been created to support multiple resolutions, adding black bars if required; user only defines desired screen size and it gets properly displayed. + - A new display initialization system has been created to support multiple resolutions, adding black bars if required; the user only defines the desired screen size and it gets properly displayed. - Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode). -Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2. +Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.2. In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/). @@ -50,26 +50,26 @@ notes on raylib 1.3 On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality, improves tremendously textures module and also provides some new modules (camera system, gestures system, immediate-mode gui). - - Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder. + - Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen post-processing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder. - Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files. - - A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_first_person.c). + - A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.h) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_first_person.c). - New [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module simplifies gestures detection on Android and HTML5 programs. - - [raygui](https://github.com/raysan5/raylib/blob/master/src/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional. + - [raygui](https://github.com/raysan5/raylib/blob/master/examples/shapes/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primarily intended for tools development. It's still in an experimental state but already fully functional. Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features. -Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3. +Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.3. notes on raylib 1.4 ------------------- On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added. - - First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage. + - First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1331) that have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now basic image processing can be done before converting the image to texture for usage. - SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file. @@ -77,12 +77,12 @@ On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For - [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline. - - [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code. + - [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module has been redesigned and simplified, now it can process touch events from any source, including the mouse. This way, gestures system can be used on any platform providing a unified way to work with inputs and allowing the user to create multiplatform games with only one source code. - Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental). Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions, -and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/src/easings.h) module has also been added for values animation. +and the addition of two simple functions for persistent data storage. Now raylib users can save and load game data in a file (only some platforms are supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/examples/shapes/reasings.h) module has also been added for values animation. Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris. @@ -94,36 +94,36 @@ notes on raylib 1.5 On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added. - - VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c). + - VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameters, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c). - New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally. - - New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material. + - New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages to render internally for every 3d object using standard material. - Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread. - - Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread. + - Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been significantly improved, now physic objects are managed internally in a second thread. - - Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck. + - Audio chiptunes support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All these features thanks to the amazing work of @kd7tck. -Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms. +Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms. -This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes. +This new version is so massive that is difficult to list all the improvements, most of the raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely redesigned to accommodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes. -Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries. +Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries. Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5. notes on raylib 1.6 ------------------- -On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features: +On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version commemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features: - Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality. - - Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more! + - Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completely self-contained, no external libraries are required anymore! - - [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing! + - [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, the library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing! - Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples. @@ -131,41 +131,41 @@ On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new v - Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support. -Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler. +Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advanced users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/projects/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler. New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games. notes on raylib 1.7 ------------------- -On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are: +On May 2017, around 6 months after raylib 1.6, comes another raylib installment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are: - More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, functions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions! - - Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality. + - Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advanced users can customize raylib just by choosing desired features, and defining some configuration flags on modules compilation. That way users can control library size and available functionality. - - Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags. + - Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compilation flags. - - New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems. + - New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All sample material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to the latest raylib version and tested on multiple platforms. Examples folder structure has been improved and also build systems. - - Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process... + - Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplified, some functions have been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process... Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timing improvements, public log system, rres file format support, automatic GIF recording... -And here it is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it. +And here is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it. notes on raylib 1.8 ------------------- October 2017, around 5 months after latest raylib version, another release is published: raylib 1.8. Again, several modules of the library have been reviewed and some new functionality added. Main changes of this new release are: - - [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses. + - [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning purposes. - [Parametric mesh generation](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing. - - PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference. + - PBR Materials support, a completely redesigned shaders and material system allows advanced materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference. - - Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts. + - Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into the final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts. - [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions. @@ -178,37 +178,37 @@ New installer provided, web updated, examples re-builded, documentation reviewed notes on raylib 2.0 ------------------- -It's been 9 month since last raylib version was published, a lots of things have changed since then... This new raylib version represents an inflexion point in the development of the library and so, we jump to a new major version... Here it is the result of almost **5 years and thousands of hours of hard work**... here it is... **raylib 2.0** +It's been 9 months since last raylib version was published, a lot of things have changed since then... This new raylib version represents an inflection point in the development of the library and so, we jump to a new major version... Here is the result of almost **5 years and thousands of hours of hard work**... here is... **raylib 2.0** In **raylib 2.0** the full API has been carefully reviewed for better consistency, some new functionality has been added and the overall raylib experience has been greatly improved... The key features of new version are: - - **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependant ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library. + - **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependent ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library. - **Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtedly, the perfect low-level companion for raylib audio module! - - **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplyfing the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release! + - **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplifying the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release! - **More platforms supported and tested**, including BSD family (FreeBSD, openBSD, NetBSD, DragonFly) and Linux-based family platforms (openSUSE, Debian, Ubuntu, Arch, NixOS...). raylib has already been added to some package managers! Oh, and last but not less important, **Android 64bit** is already supported by raylib! - - **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provide by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds! + - **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provided by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds! - - Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file-formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired! + - Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired! A part of that, lots of new features, like a brand **new font rendering and packaging system** for TTF fonts with **SDF support** (thanks to the amazing STB headers), new functions for **CPU image data manipulation**, new orthographic 3d camera mode, a complete review of `raymath.h` single-file header-only library for better consistency and performance, new examples and way, [way more](https://github.com/raysan5/raylib/blob/master/CHANGELOG). -Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtedly its development has exceeded any initial objective; raylib has become a simple and easy-to-use trully multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning! +Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtedly its development has exceeded any initial objective; raylib has become a simple and easy-to-use truly multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning! notes on raylib 2.5 ------------------- -After almost one years since latest raylib installment, here it is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here it is a short recap with the highlight improvements. +After almost one years since latest raylib installment, here is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here is a short recap with the highlight improvements. - New **window management and file system functions** to query monitor information, deal with clipboard, check directory files info and even launch a URL with default system web browser. Experimental **High-DPI monitor support** has also been added through a compile flag. - **Redesigned Gamepad mechanism**, now generic for all platforms and gamepads, no more specific gamepad configurations. **Redesigned UWP input system**, now raylib supports UWP seamlessly, previous implementation required a custom input system implemented in user code. - - `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behaviour. + - `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behavior. - **VR simulator** has been reviewed to **allow custom configuration of Head-Mounted-Device parameters and distortion shader**, `core_vr_simulator` has been properly adapted to showcase this new functionality, now the VR simulator is a generic configurable stereo rendering system that allows any VR device simulation with just a few lines of code or even dynamic tweaking of HMD parameters. @@ -220,30 +220,30 @@ After almost one years since latest raylib installment, here it is **raylib 2.5* - Experimental **cubemap support**, to automatically load multiple cubemap layouts (`LoadTextureCubemap()`). It required some internal `rlgl` redesign to allow cubemap textures. - - **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accomodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added. + - **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accommodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added. -This is a just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones. +This is just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones. It has been a long year of hard work to make raylib a solid technology to develop new products over it. notes on raylib 3.0 ------------------- -After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has reveived a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other progamming [language bindings](BINDINGS.md). +After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has received a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other programming [language bindings](BINDINGS.md). - - All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variables naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired. + - All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variable naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired. - - All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easely hook their own memory allocations mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074. + - All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easily hook their own memory allocation mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074. - All **I/O file accesses** from raylib are being moved to **memory data access**, now all I/O file access is centralized into just four functions: `LoadFileData()`, `SaveFileData()`, `LoadFileText()`, `SaveFileText()`. Users can just update those functions to any I/O file system. This change makes it easier to integrate raylib with **Virtual File Systems** or custom I/O file implementations. - All **raylib data structures** have been reviewed and optimized for pass-by-value usage. One of raylib distinctive design decisions is that most of its functions receive and return data by value. This design makes raylib really simple for newcomers, avoiding pointers and allowing complete access to all structures data in a simple way. The downside is that data is copied on stack every function call and that copy could be costly so, all raylib data structures have been optimized to **stay under 64 bytes** for fast copy and retrieve. - - All **raylib tracelog messages** have been reviewd and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages. + - All **raylib tracelog messages** have been reviewed and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages. - - `raudio` module has been internally reviewed to accomodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio). + - `raudio` module has been internally reviewed to accommodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio). - - `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accomodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding. + - `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accommodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding. - **Multiple new examples added** (most of them contributed by raylib users) and all examples reviewed for correct execution on most of the supported platforms, specially Web and Raspberry Pi. A detailed categorized table has been created on github for easy examples navigation and code access. @@ -274,19 +274,19 @@ Here the list with some highlights for `raylib 3.5`. - NEW **configuration options** exposed: For custom raylib builds, `config.h` now exposes **more than 150 flags and defines** to build raylib with only the desired features, for example, it allows to build a minimal raylib library in just some KB removing all external data filetypes supported, very useful to generate **small executables or embedded devices**. - - NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file-accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out! + - NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out! - - NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advance users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently. + - NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advanced users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently. - - NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advance Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API. + - NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advanced Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API. - Improved **software rendering**: raylib `Image*()` API is intended for software rendering, for those cases when **no GPU or no Window is available**. Those functions operate directly with **multi-format** pixel data on RAM and they have been completely redesigned to be way faster, specially for small resolutions and retro-gaming. Low-end embedded devices like **microcontrollers with custom displays** could benefit of this raylib functionality! - File **loading from memory**: Multiple functions have been redesigned to load data from memory buffers **instead of directly accessing the files**, now all raylib file loading/saving goes through a couple of functions that load data into memory. This feature allows **custom virtual-file-systems** and it gives more control to the user to access data already loaded in memory (i.e. images, fonts, sounds...). - - NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hidding, focusing, topmost and more. + - NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hiding, focusing, topmost and more. - - NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the diferent generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed. + - NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the different generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed. A part of those changes, many new functions have been added, some redundant functions removed and many functions have been reviewed for consistency with the full API (function name, parameters name and order, code formatting...). Again, this release represents is a **great improvement for raylib and marks the way forward** for the library. Make sure to check [CHANGELOG](CHANGELOG) for details! Hope you enjoy it! @@ -295,7 +295,7 @@ Happy holidays! :) notes on raylib 3.7 ------------------- -April 2021, it's been about 4 months since last raylib release and here it is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April the 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version: +April 2021, it's been about 4 months since the last raylib release and here is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version: Let's start with some numbers: @@ -315,18 +315,18 @@ Highlights for `raylib 3.7`: - **ADDED: glTF animations support**. glTF is the preferred models file format to be used with raylib and along the addition of a models animation API on latest raylib versions, now animations support for glTF format has come to raylib, thanks for this great contribution to [Hristo Stamenov](@object71) - - **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streamming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD. + - **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streaming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD. - **RENAMED: enums values for consistency**. Most raylib enums names and values names have been renamed for consistency, now all value names start with the type of data they represent. It increases clarity and readability when using those values and also **improves overall library consistency**. -Beside those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment! +Besides those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment! Happy **gamedev/tools/graphics** programming! :) notes on raylib 4.0 - 8th Anniversary Edition --------------------------------------------- -It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflexion point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long term version (LTS), stable and complete enough for any new graphic/game/tool application development. +It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflection point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long-term version (LTS), stable and complete enough for any new graphic/game/tool application development. Let's start with some numbers: @@ -339,11 +339,11 @@ Let's start with some numbers: Highlights for `raylib 4.0`: - - **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent. + - **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been written in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent. - - **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental. + - **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assisted game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental. - - **Custom game-loop control**: As requested by some advance users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advance users that want to control the events polling and also the timming mechanisms of their games. + - **Custom game-loop control**: As requested by some advanced users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advanced users that want to control the events polling and also the timing mechanisms of their games. - [**`rlgl 4.0`**](https://github.com/raysan5/raylib/blob/master/src/rlgl.h): This module has been completely **decoupled from platform layer** and raylib, now `rlgl` single-file header-only library only depends on the multiple OpenGL backends supported, even the dependency on `raymath` has been removed. Additionally, **support for OpenGL 4.3** has been added, supporting compute shaders and Shader Storage Buffer Objects (SSBO). Now `rlgl` can be used as a complete standalone portable library to wrap several OpenGL version and providing **a simple and easy-to-use pseudo-OpenGL immediate-mode API**. @@ -361,12 +361,12 @@ Highlights for `raylib 4.0`: Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes! -Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :) +Undoubtedly, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :) notes on raylib 4.2 ------------------- -**New raylib release!** Nine months after latest raylib, here it is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing! +**New raylib release!** Nine months after latest raylib, here is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing! Some numbers to start with: @@ -390,7 +390,7 @@ Highlights for `raylib 4.2`: - **New file system API**: Current API has been redesigned to be more comprehensive and better aligned with raylib naming conventions, two new functions are provided `LoadDirectoryFiles()`/`LoadDirectoryFilesEx()` to load a `FilePathList` for provided path, supporting extension filtering and recursive directory scan. `LoadDroppedFiles()` has been renamed to better reflect its internal functionality. Now, all raylib functions that start with `Load*()` allocate memory internally and a equivalent `Unload*()` function is defined to take care of that memory internally when not required any more! - - **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advance users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib. + - **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advanced users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib. As always, there are more improvements than the key features listed, make sure to check raylib [CHANGELOG](CHANGELOG) for the detailed list of changes; for this release a `WARNING` flag has been added to all the changes that could affect bindings or productivity code. **raylib keeps improving one more version** and a special focus on maintainability has been put on the library for the future. Specific/advance functionality will be provided through **raylib-extras** repos and raylib main repo devlelopment will be focused on what made raylib popular: being a simple and easy-to-use library to **enjoy videogames programming**. @@ -399,7 +399,7 @@ As always, there are more improvements than the key features listed, make sure t notes on raylib 4.5 ------------------- -It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here it is a small summary highlighting this new **rayib 4.5**. +It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here is a small summary highlighting this new **rayib 4.5**. Some numbers for this release: @@ -413,7 +413,7 @@ Highlights for `raylib 4.5`: - **`NEW` Improved ANGLE support on Desktop platforms**: Support for OpenGL ES 2.0 on Desktop platforms (Windows, Linux, macOS) has been reviewed by @wtnbgo GitHub user. Now raylib can be compiled on desktop for OpenGL ES 2.0 and linked against [`ANGLE`](https://github.com/google/angle). This _small_ addition open the door to building raylib for all **ANGLE supported backends: Direct3D 11, Vulkan and Metal**. Please note that this new feature is still experimental and requires further testing! - - **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advance users have **full control over camera inputs and movement/rotation speeds**! + - **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advanced users have **full control over camera inputs and movement/rotation speeds**! - **`NEW` Support for M3D models and M3D/GLTF animations**: 3d models animations support has been a limited aspect of raylib for long time, some versions ago IQM animations were supported but raylib 4.5 also adds support for the brand new [M3D file format](https://bztsrc.gitlab.io/model3d/), including animations and the long expected support for **GLTF animations**! The new M3D file format is **simple, portable, feature complete, extensible and open source**. It also provides a complete set of tools to export/visualize M3D models from/to Blender! Now raylib supports up to **3 model file-formats with animations**: `IQM`, `GLTF` and `M3D`. @@ -425,7 +425,7 @@ Highlights for `raylib 4.5`: - **Reviewed `rshapes` module to minimize the rlgl dependency**: Now `rshapes` 2d shapes drawing functions **only depend on 6 low-level functions**: `rlBegin()`, `rlEnd()`, `rlVertex3f()`, `rlTexCoord2f()`, `rlNormal3f()`, `rlSetTexture()`. With only those pseudo-OpenGl 1.1 minimal functionality, everything can be drawn! This improvement converts `rshapes` module in a **self-contained, portable shapes-drawing library that can be used independently of raylib**, as far as entry points for those 6 functions are provided by the user. It even allows to be used for software rendering, with the proper backend! - - **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselfs. + - **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselves. As usual, those are only some highlights but there is much more! New image generators, new color transformation functionality, improved blending support for color/alpha, etc... Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! Please, note that all breaking changes have been flagged with a `WARNING` in the CHANGELOG, specially useful for binding creators! @@ -436,7 +436,7 @@ Let's keep **enjoying games/tools/graphics programming!** :) notes on raylib 5.0 ------------------- -It's been **7 months** since latest raylib release and **10 years** since raylib 1.0 was officially released... what an adventure! In the last 10 years raylib has improved a lot, new functions have been added, many new features and improvements implemented, up to **500 contributors** have helped to shape the library as it is today. `raylib 5.0` is the final result of all this incredible amount of work and dedication. Here it is the summary with the key features and additions of this NEW major version of raylib. +It's been **7 months** since latest raylib release and **10 years** since raylib 1.0 was officially released... what an adventure! In the last 10 years raylib has improved a lot, new functions have been added, many new features and improvements implemented, up to **500 contributors** have helped to shape the library as it is today. `raylib 5.0` is the final result of all this incredible amount of work and dedication. Here is the summary with the key features and additions of this NEW major version of raylib. Some numbers for this release: @@ -448,9 +448,9 @@ Some numbers for this release: Highlights for `raylib 5.0`: - - **`rcore` module platform-split**: Probably the biggest raylib redesign in the last 10 years. raylib started as a library targeting 3 desktop platforms: `Windows`, `Linux` and `macOS` (thanks to `GLFW` underlying library) but with the years support for several new platforms has been added (`Android`, `Web`, `Rapsberry Pi`, `RPI native`...); lot of the platform code was shared so the logic was all together on `rcore.c` module, separated by compilation flags. This approach was very handy but also made it very difficult to support new platforms and specially painful for contributors not familiar with the module, navigating +8000 lines of code in a single file. A big redesign was really needed but the amount of work required was humungus and quite scary for a solo-developer like me, moreover considering that everything was working and the chances to break things were really high. Fortunately, some contributors were ready for the task (@ubkp, @michaelfiber, @Bigfoot71) and thanks to their initiative and super-hard work, the `rcore` [platform split](https://github.com/raysan5/raylib/blob/master/src/platforms) has been possible! This new raylib architecture greatly improves the platforms maintenance but also greatly simplifies the addition of new platforms. A [`platforms/rcore_template.c`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_template.c) file is provided with the required structure and functions to be filled for the addition of new platforms, actually it has been simplified to mostly filling some pre-defined functions: `InitPlatform()`, `ClosePlatform`, `PollInputEvents`... Undoubtely, **this redesign opens the doors to a new era for raylib**, letting the users to plug new platforms as desired. + - **`rcore` module platform-split**: Probably the biggest raylib redesign in the last 10 years. raylib started as a library targeting 3 desktop platforms: `Windows`, `Linux` and `macOS` (thanks to `GLFW` underlying library) but with the years support for several new platforms has been added (`Android`, `Web`, `Rapsberry Pi`, `RPI native`...); lot of the platform code was shared so the logic was all together on `rcore.c` module, separated by compilation flags. This approach was very handy but also made it very difficult to support new platforms and specially painful for contributors not familiar with the module, navigating +8000 lines of code in a single file. A big redesign was really needed but the amount of work required was humungous and quite scary for a solo-developer like me, moreover considering that everything was working and the chances to break things were really high. Fortunately, some contributors were ready for the task (@ubkp, @michaelfiber, @Bigfoot71) and thanks to their initiative and super-hard work, the `rcore` [platform split](https://github.com/raysan5/raylib/blob/master/src/platforms) has been possible! This new raylib architecture greatly improves the platforms maintenance but also greatly simplifies the addition of new platforms. A [`platforms/rcore_template.c`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_template.c) file is provided with the required structure and functions to be filled for the addition of new platforms, actually it has been simplified to mostly filling some pre-defined functions: `InitPlatform()`, `ClosePlatform`, `PollInputEvents`... Undoubtedly, **this redesign opens the doors to a new era for raylib**, letting the users to plug new platforms as desired. - - **`NEW` Platform backend supported: SDL**: Thanks to the new `rcore` platform-split, the addition of new platforms/backends to raylib has been greatly simplified. As a proof of concept, [`SDL2`](https://libsdl.org/) platform backend has been added to raylib as an aternative for `GLFW` library for desktop builds: [`platforms/rcore_desktop_sdl`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_sdl.c). Lot of work has been put to provide exactly the same features as the other platforms and carefully test the new implementation. Now `SDL2` fans can use this new backend, just providing the required include libraries on compilation and linkage (not included in raylib, like `GLFW`). `SDL` backend support also **eases the process of supporting a wider range of platforms** that already support `SDL`. + - **`NEW` Platform backend supported: SDL**: Thanks to the new `rcore` platform-split, the addition of new platforms/backends to raylib has been greatly simplified. As a proof of concept, [`SDL2`](https://libsdl.org/) platform backend has been added to raylib as an alternative for `GLFW` library for desktop builds: [`platforms/rcore_desktop_sdl`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_sdl.c). Lot of work has been put to provide exactly the same features as the other platforms and carefully test the new implementation. Now `SDL2` fans can use this new backend, just providing the required include libraries on compilation and linkage (not included in raylib, like `GLFW`). `SDL` backend support also **eases the process of supporting a wider range of platforms** that already support `SDL`. - **`NEW` Platform backend supported: Nintendo Switch (closed source)**: The addition of the `SDL` backend was quite a challenge but to really verify the robustness and ease of the new platform plugin system, adding support for a console was a more demanding adventure. Surprisingly, only two days of work were required to add support for `Nintendo Switch` to raylib! Implementation result showed an outstanding level of simplicity, with a **self-contained module** (`rcore_swith.cpp`) supporting graphics and inputs. Unfortunately this module can not be open-sourced due to licensing restrictions. @@ -468,6 +468,6 @@ As always, those are only some highlights of the new `raylib 5.0` but there is m Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! -Undoubtely, this is the **biggest raylib update in 10 years**. Many new features and improvements with a special focus on maintainabiliy and long-term sustainability. **Undoubtely, this is the raylib of the future**. +Undoubtedly, this is the **biggest raylib update in 10 years**. Many new features and improvements with a special focus on maintainability and long-term sustainability. **Undoubtedly, this is the raylib of the future**. **Enjoy programming!** :) diff --git a/ROADMAP.md b/ROADMAP.md index 8755333c86c5..87ca2e1c8a28 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,6 +1,6 @@ # raylib roadmap -Here it is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas: +Here is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas: - [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix. - [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve. @@ -73,7 +73,7 @@ _Current version of raylib is complete and functional but there is always room f **raylib 1.5** - [x] Support Oculus Rift CV1 and VR stereo rendering (simulator) - [x] Redesign Shaders/Textures system -> New Materials system - - [x] Support lighting: Omni, Directional and Spot lights + - [x] Support lighting: Omni, Directional and Spotlights - [x] Redesign physics module (physac) - [x] Chiptunes audio modules support diff --git a/examples/README.md b/examples/README.md index 94f5369db7cc..d790f7d84b4a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -202,5 +202,5 @@ Examples showing raylib misc functionality that does not fit in other categories | 125 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | raylib_opengl_interop | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) | | 126 | [embedded_files_loading](others/embedded_files_loading.c) | embedded_files_loading | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) | -As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with! +As always contributions are welcome, feel free to send new examples! Here is an [examples template](examples_template.c) to start with! diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index 6e494d86ec03..9793fc359256 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -2,7 +2,7 @@ * * raylib [core] example - custom frame control * -* NOTE: WARNING: This is an example for advance users willing to have full control over +* NOTE: WARNING: This is an example for advanced users willing to have full control over * the frame processes. By default, EndDrawing() calls the following processes: * 1. Draw remaining batch data: rlDrawRenderBatchActive() * 2. SwapScreenBuffer() diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index 6c0552974e35..c869a1a189dd 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -509,7 +509,7 @@ - + @@ -2822,7 +2822,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 8776d434969f..0a3c2417dbd7 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -134,7 +134,7 @@ RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal me RLAPI void MemFree(void *ptr); // Internal memory free // Set custom callbacks -// WARNING: Callbacks setup is intended for advance users +// WARNING: Callbacks setup is intended for advanced users RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver diff --git a/src/config.h b/src/config.h index 3c92de72d5a0..c54583e74fbb 100644 --- a/src/config.h +++ b/src/config.h @@ -66,7 +66,7 @@ #define SUPPORT_COMPRESSION_API 1 // Support automatic generated events, loading and recording of those events when required #define SUPPORT_AUTOMATION_EVENTS 1 -// Support custom frame control, only for advance users +// Support custom frame control, only for advanced users // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() // Enabling this flag allows manual control of the frame processes, use at your own risk //#define SUPPORT_CUSTOM_FRAME_CONTROL 1 diff --git a/src/raylib.h b/src/raylib.h index b870cc6ca1bd..1bf740b9bc94 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -934,7 +934,7 @@ typedef enum { } NPatchLayout; // Callbacks to hook some internal functions -// WARNING: These callbacks are intended for advance users +// WARNING: These callbacks are intended for advanced users typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, int *dataSize); // FileIO: Load binary data typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, int dataSize); // FileIO: Save binary data @@ -1066,7 +1066,7 @@ RLAPI double GetTime(void); // Get elapsed RLAPI int GetFPS(void); // Get current FPS // Custom frame control functions -// NOTE: Those functions are intended for advance users that want full control over the frame processing +// NOTE: Those functions are intended for advanced users that want full control over the frame processing // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) @@ -1093,7 +1093,7 @@ RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal me RLAPI void MemFree(void *ptr); // Internal memory free // Set custom callbacks -// WARNING: Callbacks setup is intended for advance users +// WARNING: Callbacks setup is intended for advanced users RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver From 606cc1d897db0a2df201b1c5f7e98bda29d74c64 Mon Sep 17 00:00:00 2001 From: kai-z99 <147789796+kai-z99@users.noreply.github.com> Date: Wed, 29 May 2024 23:24:44 -0700 Subject: [PATCH 13/71] [rshapes]Circle line collision function (#4018) * inital function * working 1 * optimize * optimized dot product * simplify * cleanup * cleanup * cleanup * comment * var name change * epsilon --- src/raylib.h | 1 + src/rshapes.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 1bf740b9bc94..dfa98efb88db 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1295,6 +1295,7 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ diff --git a/src/rshapes.c b/src/rshapes.c index 80df64e2d187..cb85c1c543ad 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -2315,6 +2315,30 @@ bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshol return collision; } +// Check if circle collides with a line created betweeen two points [p1] and [p2] +RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2) +{ + float dx = p1.x - p2.x; + float dy = p1.y - p2.y; + + if ((fabsf(dx) + fabsf(dy)) <= FLT_EPSILON) + { + return CheckCollisionCircles(p1, 0, center, radius); + } + + float lengthSQ = ((dx * dx) + (dy * dy)); + float dotProduct = (((center.x - p1.x) * (p2.x - p1.x)) + ((center.y - p1.y) * (p2.y - p1.y))) / (lengthSQ); + + if (dotProduct > 1.0f) dotProduct = 1.0f; + else if (dotProduct < 0.0f) dotProduct = 0.0f; + + float dx2 = (p1.x - (dotProduct * (dx))) - center.x; + float dy2 = (p1.y - (dotProduct * (dy))) - center.y; + float distanceSQ = ((dx2 * dx2) + (dy2 * dy2)); + + return (distanceSQ <= radius * radius); +} + // Get collision rectangle for two rectangles collision Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) { From 1344979c708bdf5000d8963d26d938ae4db5d771 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 May 2024 06:24:58 +0000 Subject: [PATCH 14/71] Update raylib_api.* by CI --- parser/output/raylib_api.json | 23 ++ parser/output/raylib_api.lua | 11 + parser/output/raylib_api.txt | 602 +++++++++++++++++----------------- parser/output/raylib_api.xml | 8 +- 4 files changed, 346 insertions(+), 298 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index f2a9cc61edbb..4bfce70d19df 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -6703,6 +6703,29 @@ } ] }, + { + "name": "CheckCollisionCircleLine", + "description": "Check if circle collides with a line created betweeen two points [p1] and [p2]", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + } + ] + }, { "name": "GetCollisionRec", "description": "Get collision rectangle for two rectangles collision", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 68fef97bb131..4a6998bbd3bf 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5266,6 +5266,17 @@ return { {type = "int", name = "threshold"} } }, + { + name = "CheckCollisionCircleLine", + description = "Check if circle collides with a line created betweeen two points [p1] and [p2]", + returnType = "bool", + params = { + {type = "Vector2", name = "center"}, + {type = "float", name = "radius"}, + {type = "Vector2", name = "p1"}, + {type = "Vector2", name = "p2"} + } + }, { name = "GetCollisionRec", description = "Get collision rectangle for two rectangles collision", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index d6576dee5920..979ef0d562f2 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 563 +Functions found: 564 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -2593,18 +2593,26 @@ Function 267: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 268: GetCollisionRec() (2 input parameters) +Function 268: CheckCollisionCircleLine() (4 input parameters) + Name: CheckCollisionCircleLine + Return type: bool + Description: Check if circle collides with a line created betweeen two points [p1] and [p2] + Param[1]: center (type: Vector2) + Param[2]: radius (type: float) + Param[3]: p1 (type: Vector2) + Param[4]: p2 (type: Vector2) +Function 269: 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 269: LoadImage() (1 input parameters) +Function 270: 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 270: LoadImageRaw() (5 input parameters) +Function 271: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2613,20 +2621,20 @@ Function 270: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 271: LoadImageSvg() (3 input parameters) +Function 272: LoadImageSvg() (3 input parameters) Name: LoadImageSvg Return type: Image Description: Load image from SVG file data or string with specified size Param[1]: fileNameOrString (type: const char *) Param[2]: width (type: int) Param[3]: height (type: int) -Function 272: LoadImageAnim() (2 input parameters) +Function 273: 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 273: LoadImageAnimFromMemory() (4 input parameters) +Function 274: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2634,60 +2642,60 @@ Function 273: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 274: LoadImageFromMemory() (3 input parameters) +Function 275: 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 275: LoadImageFromTexture() (1 input parameters) +Function 276: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 276: LoadImageFromScreen() (0 input parameters) +Function 277: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 277: IsImageReady() (1 input parameters) +Function 278: IsImageReady() (1 input parameters) Name: IsImageReady Return type: bool Description: Check if an image is ready Param[1]: image (type: Image) -Function 278: UnloadImage() (1 input parameters) +Function 279: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 279: ExportImage() (2 input parameters) +Function 280: 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 280: ExportImageToMemory() (3 input parameters) +Function 281: 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 281: ExportImageAsCode() (2 input parameters) +Function 282: 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 282: GenImageColor() (3 input parameters) +Function 283: 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 283: GenImageGradientLinear() (5 input parameters) +Function 284: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2696,7 +2704,7 @@ Function 283: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 284: GenImageGradientRadial() (5 input parameters) +Function 285: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2705,7 +2713,7 @@ Function 284: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 285: GenImageGradientSquare() (5 input parameters) +Function 286: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2714,7 +2722,7 @@ Function 285: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 286: GenImageChecked() (6 input parameters) +Function 287: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2724,14 +2732,14 @@ Function 286: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 287: GenImageWhiteNoise() (3 input parameters) +Function 288: 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 288: GenImagePerlinNoise() (5 input parameters) +Function 289: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2740,39 +2748,39 @@ Function 288: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 289: GenImageCellular() (3 input parameters) +Function 290: 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 290: GenImageText() (3 input parameters) +Function 291: 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 291: ImageCopy() (1 input parameters) +Function 292: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 292: ImageFromImage() (2 input parameters) +Function 293: 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 293: ImageText() (3 input parameters) +Function 294: 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 294: ImageTextEx() (5 input parameters) +Function 295: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2781,76 +2789,76 @@ Function 294: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 295: ImageFormat() (2 input parameters) +Function 296: 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 296: ImageToPOT() (2 input parameters) +Function 297: 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 297: ImageCrop() (2 input parameters) +Function 298: 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 298: ImageAlphaCrop() (2 input parameters) +Function 299: 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 299: ImageAlphaClear() (3 input parameters) +Function 300: 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 300: ImageAlphaMask() (2 input parameters) +Function 301: 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 301: ImageAlphaPremultiply() (1 input parameters) +Function 302: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 302: ImageBlurGaussian() (2 input parameters) +Function 303: 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 303: ImageKernelConvolution() (3 input parameters) +Function 304: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply Custom Square image convolution kernel Param[1]: image (type: Image *) Param[2]: kernel (type: float*) Param[3]: kernelSize (type: int) -Function 304: ImageResize() (3 input parameters) +Function 305: 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 305: ImageResizeNN() (3 input parameters) +Function 306: 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 306: ImageResizeCanvas() (6 input parameters) +Function 307: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2860,12 +2868,12 @@ Function 306: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 307: ImageMipmaps() (1 input parameters) +Function 308: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 308: ImageDither() (5 input parameters) +Function 309: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2874,109 +2882,109 @@ Function 308: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 309: ImageFlipVertical() (1 input parameters) +Function 310: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 310: ImageFlipHorizontal() (1 input parameters) +Function 311: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 311: ImageRotate() (2 input parameters) +Function 312: 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 312: ImageRotateCW() (1 input parameters) +Function 313: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 313: ImageRotateCCW() (1 input parameters) +Function 314: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 314: ImageColorTint() (2 input parameters) +Function 315: 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 315: ImageColorInvert() (1 input parameters) +Function 316: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 316: ImageColorGrayscale() (1 input parameters) +Function 317: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 317: ImageColorContrast() (2 input parameters) +Function 318: 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 318: ImageColorBrightness() (2 input parameters) +Function 319: 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 319: ImageColorReplace() (3 input parameters) +Function 320: 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 320: LoadImageColors() (1 input parameters) +Function 321: 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 321: LoadImagePalette() (3 input parameters) +Function 322: 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 322: UnloadImageColors() (1 input parameters) +Function 323: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 323: UnloadImagePalette() (1 input parameters) +Function 324: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 324: GetImageAlphaBorder() (2 input parameters) +Function 325: 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 325: GetImageColor() (3 input parameters) +Function 326: 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 326: ImageClearBackground() (2 input parameters) +Function 327: 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 327: ImageDrawPixel() (4 input parameters) +Function 328: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -2984,14 +2992,14 @@ Function 327: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 328: ImageDrawPixelV() (3 input parameters) +Function 329: 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 329: ImageDrawLine() (6 input parameters) +Function 330: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3001,7 +3009,7 @@ Function 329: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 330: ImageDrawLineV() (4 input parameters) +Function 331: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3009,7 +3017,7 @@ Function 330: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 331: ImageDrawCircle() (5 input parameters) +Function 332: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3018,7 +3026,7 @@ Function 331: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 332: ImageDrawCircleV() (4 input parameters) +Function 333: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3026,7 +3034,7 @@ Function 332: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 333: ImageDrawCircleLines() (5 input parameters) +Function 334: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3035,7 +3043,7 @@ Function 333: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 334: ImageDrawCircleLinesV() (4 input parameters) +Function 335: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3043,7 +3051,7 @@ Function 334: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 335: ImageDrawRectangle() (6 input parameters) +Function 336: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3053,7 +3061,7 @@ Function 335: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 336: ImageDrawRectangleV() (4 input parameters) +Function 337: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3061,14 +3069,14 @@ Function 336: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 337: ImageDrawRectangleRec() (3 input parameters) +Function 338: 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 338: ImageDrawRectangleLines() (4 input parameters) +Function 339: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3076,7 +3084,7 @@ Function 338: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 339: ImageDraw() (5 input parameters) +Function 340: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3085,7 +3093,7 @@ Function 339: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 340: ImageDrawText() (6 input parameters) +Function 341: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3095,7 +3103,7 @@ Function 340: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 341: ImageDrawTextEx() (7 input parameters) +Function 342: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3106,79 +3114,79 @@ Function 341: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 342: LoadTexture() (1 input parameters) +Function 343: 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 343: LoadTextureFromImage() (1 input parameters) +Function 344: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 344: LoadTextureCubemap() (2 input parameters) +Function 345: 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 345: LoadRenderTexture() (2 input parameters) +Function 346: 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 346: IsTextureReady() (1 input parameters) +Function 347: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 347: UnloadTexture() (1 input parameters) +Function 348: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 348: IsRenderTextureReady() (1 input parameters) +Function 349: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 349: UnloadRenderTexture() (1 input parameters) +Function 350: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 350: UpdateTexture() (2 input parameters) +Function 351: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 351: UpdateTextureRec() (3 input parameters) +Function 352: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 352: GenTextureMipmaps() (1 input parameters) +Function 353: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 353: SetTextureFilter() (2 input parameters) +Function 354: 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 354: SetTextureWrap() (2 input parameters) +Function 355: 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 355: DrawTexture() (4 input parameters) +Function 356: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3186,14 +3194,14 @@ Function 355: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 356: DrawTextureV() (3 input parameters) +Function 357: 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 357: DrawTextureEx() (5 input parameters) +Function 358: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3202,7 +3210,7 @@ Function 357: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 358: DrawTextureRec() (4 input parameters) +Function 359: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3210,7 +3218,7 @@ Function 358: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 359: DrawTexturePro() (6 input parameters) +Function 360: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3220,7 +3228,7 @@ Function 359: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 360: DrawTextureNPatch() (6 input parameters) +Function 361: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3230,112 +3238,112 @@ Function 360: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 361: ColorIsEqual() (2 input parameters) +Function 362: 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 362: Fade() (2 input parameters) +Function 363: 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 363: ColorToInt() (1 input parameters) +Function 364: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 364: ColorNormalize() (1 input parameters) +Function 365: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 365: ColorFromNormalized() (1 input parameters) +Function 366: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 366: ColorToHSV() (1 input parameters) +Function 367: 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 367: ColorFromHSV() (3 input parameters) +Function 368: 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 368: ColorTint() (2 input parameters) +Function 369: 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 369: ColorBrightness() (2 input parameters) +Function 370: 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 370: ColorContrast() (2 input parameters) +Function 371: 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 371: ColorAlpha() (2 input parameters) +Function 372: 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 372: ColorAlphaBlend() (3 input parameters) +Function 373: 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 373: GetColor() (1 input parameters) +Function 374: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 374: GetPixelColor() (2 input parameters) +Function 375: 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 375: SetPixelColor() (3 input parameters) +Function 376: 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 376: GetPixelDataSize() (3 input parameters) +Function 377: 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 377: GetFontDefault() (0 input parameters) +Function 378: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 378: LoadFont() (1 input parameters) +Function 379: 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 379: LoadFontEx() (4 input parameters) +Function 380: 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 setFont @@ -3343,14 +3351,14 @@ Function 379: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 380: LoadFontFromImage() (3 input parameters) +Function 381: 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 381: LoadFontFromMemory() (6 input parameters) +Function 382: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3360,12 +3368,12 @@ Function 381: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 382: IsFontReady() (1 input parameters) +Function 383: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 383: LoadFontData() (6 input parameters) +Function 384: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3375,7 +3383,7 @@ Function 383: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 384: GenImageFontAtlas() (6 input parameters) +Function 385: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3385,30 +3393,30 @@ Function 384: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 385: UnloadFontData() (2 input parameters) +Function 386: 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 386: UnloadFont() (1 input parameters) +Function 387: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 387: ExportFontAsCode() (2 input parameters) +Function 388: 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 388: DrawFPS() (2 input parameters) +Function 389: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 389: DrawText() (5 input parameters) +Function 390: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3417,7 +3425,7 @@ Function 389: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 390: DrawTextEx() (6 input parameters) +Function 391: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3427,7 +3435,7 @@ Function 390: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 391: DrawTextPro() (8 input parameters) +Function 392: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3439,7 +3447,7 @@ Function 391: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 392: DrawTextCodepoint() (5 input parameters) +Function 393: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3448,7 +3456,7 @@ Function 392: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 393: DrawTextCodepoints() (7 input parameters) +Function 394: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3459,18 +3467,18 @@ Function 393: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 394: SetTextLineSpacing() (1 input parameters) +Function 395: 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 395: MeasureText() (2 input parameters) +Function 396: 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 396: MeasureTextEx() (4 input parameters) +Function 397: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3478,185 +3486,185 @@ Function 396: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 397: GetGlyphIndex() (2 input parameters) +Function 398: 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 398: GetGlyphInfo() (2 input parameters) +Function 399: 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 399: GetGlyphAtlasRec() (2 input parameters) +Function 400: 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 400: LoadUTF8() (2 input parameters) +Function 401: 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 401: UnloadUTF8() (1 input parameters) +Function 402: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 402: LoadCodepoints() (2 input parameters) +Function 403: 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 403: UnloadCodepoints() (1 input parameters) +Function 404: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 404: GetCodepointCount() (1 input parameters) +Function 405: 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 405: GetCodepoint() (2 input parameters) +Function 406: 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 406: GetCodepointNext() (2 input parameters) +Function 407: 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 407: GetCodepointPrevious() (2 input parameters) +Function 408: 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 408: CodepointToUTF8() (2 input parameters) +Function 409: 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 409: TextCopy() (2 input parameters) +Function 410: 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 410: TextIsEqual() (2 input parameters) +Function 411: 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 411: TextLength() (1 input parameters) +Function 412: 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 412: TextFormat() (2 input parameters) +Function 413: 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 413: TextSubtext() (3 input parameters) +Function 414: 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 414: TextReplace() (3 input parameters) +Function 415: 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 415: TextInsert() (3 input parameters) +Function 416: 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 416: TextJoin() (3 input parameters) +Function 417: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 417: TextSplit() (3 input parameters) +Function 418: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 418: TextAppend() (3 input parameters) +Function 419: 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 419: TextFindIndex() (2 input parameters) +Function 420: 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 420: TextToUpper() (1 input parameters) +Function 421: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 421: TextToLower() (1 input parameters) +Function 422: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 422: TextToPascal() (1 input parameters) +Function 423: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 423: TextToInteger() (1 input parameters) +Function 424: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 424: TextToFloat() (1 input parameters) +Function 425: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 425: DrawLine3D() (3 input parameters) +Function 426: 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 426: DrawPoint3D() (2 input parameters) +Function 427: 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 427: DrawCircle3D() (5 input parameters) +Function 428: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3665,7 +3673,7 @@ Function 427: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 428: DrawTriangle3D() (4 input parameters) +Function 429: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3673,14 +3681,14 @@ Function 428: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 429: DrawTriangleStrip3D() (3 input parameters) +Function 430: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 430: DrawCube() (5 input parameters) +Function 431: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3689,14 +3697,14 @@ Function 430: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 431: DrawCubeV() (3 input parameters) +Function 432: 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 432: DrawCubeWires() (5 input parameters) +Function 433: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3705,21 +3713,21 @@ Function 432: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 433: DrawCubeWiresV() (3 input parameters) +Function 434: 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 434: DrawSphere() (3 input parameters) +Function 435: 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 435: DrawSphereEx() (5 input parameters) +Function 436: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3728,7 +3736,7 @@ Function 435: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 436: DrawSphereWires() (5 input parameters) +Function 437: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3737,7 +3745,7 @@ Function 436: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 437: DrawCylinder() (6 input parameters) +Function 438: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3747,7 +3755,7 @@ Function 437: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 438: DrawCylinderEx() (6 input parameters) +Function 439: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3757,7 +3765,7 @@ Function 438: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 439: DrawCylinderWires() (6 input parameters) +Function 440: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3767,7 +3775,7 @@ Function 439: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 440: DrawCylinderWiresEx() (6 input parameters) +Function 441: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3777,7 +3785,7 @@ Function 440: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 441: DrawCapsule() (6 input parameters) +Function 442: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3787,7 +3795,7 @@ Function 441: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 442: DrawCapsuleWires() (6 input parameters) +Function 443: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3797,51 +3805,51 @@ Function 442: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 443: DrawPlane() (3 input parameters) +Function 444: 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 444: DrawRay() (2 input parameters) +Function 445: 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 445: DrawGrid() (2 input parameters) +Function 446: 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 446: LoadModel() (1 input parameters) +Function 447: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 447: LoadModelFromMesh() (1 input parameters) +Function 448: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 448: IsModelReady() (1 input parameters) +Function 449: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 449: UnloadModel() (1 input parameters) +Function 450: 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 450: GetModelBoundingBox() (1 input parameters) +Function 451: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 451: DrawModel() (4 input parameters) +Function 452: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3849,7 +3857,7 @@ Function 451: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 452: DrawModelEx() (6 input parameters) +Function 453: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3859,7 +3867,7 @@ Function 452: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 453: DrawModelWires() (4 input parameters) +Function 454: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3867,7 +3875,7 @@ Function 453: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 454: DrawModelWiresEx() (6 input parameters) +Function 455: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3877,13 +3885,13 @@ Function 454: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 455: DrawBoundingBox() (2 input parameters) +Function 456: 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 456: DrawBillboard() (5 input parameters) +Function 457: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3892,7 +3900,7 @@ Function 456: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 457: DrawBillboardRec() (6 input parameters) +Function 458: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3902,7 +3910,7 @@ Function 457: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 458: DrawBillboardPro() (9 input parameters) +Function 459: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3915,13 +3923,13 @@ Function 458: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 459: UploadMesh() (2 input parameters) +Function 460: 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 460: UpdateMeshBuffer() (5 input parameters) +Function 461: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3930,19 +3938,19 @@ Function 460: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 461: UnloadMesh() (1 input parameters) +Function 462: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 462: DrawMesh() (3 input parameters) +Function 463: 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 463: DrawMeshInstanced() (4 input parameters) +Function 464: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3950,35 +3958,35 @@ Function 463: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 464: GetMeshBoundingBox() (1 input parameters) +Function 465: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 465: GenMeshTangents() (1 input parameters) +Function 466: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 466: ExportMesh() (2 input parameters) +Function 467: 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 467: ExportMeshAsCode() (2 input parameters) +Function 468: 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 468: GenMeshPoly() (2 input parameters) +Function 469: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 469: GenMeshPlane() (4 input parameters) +Function 470: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -3986,42 +3994,42 @@ Function 469: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 470: GenMeshCube() (3 input parameters) +Function 471: 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 471: GenMeshSphere() (3 input parameters) +Function 472: 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 472: GenMeshHemiSphere() (3 input parameters) +Function 473: 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 473: GenMeshCylinder() (3 input parameters) +Function 474: 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 474: GenMeshCone() (3 input parameters) +Function 475: 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 475: GenMeshTorus() (4 input parameters) +Function 476: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4029,7 +4037,7 @@ Function 475: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 476: GenMeshKnot() (4 input parameters) +Function 477: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4037,84 +4045,84 @@ Function 476: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 477: GenMeshHeightmap() (2 input parameters) +Function 478: 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 478: GenMeshCubicmap() (2 input parameters) +Function 479: 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 479: LoadMaterials() (2 input parameters) +Function 480: 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 480: LoadMaterialDefault() (0 input parameters) +Function 481: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 481: IsMaterialReady() (1 input parameters) +Function 482: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 482: UnloadMaterial() (1 input parameters) +Function 483: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 483: SetMaterialTexture() (3 input parameters) +Function 484: 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 484: SetModelMeshMaterial() (3 input parameters) +Function 485: 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 485: LoadModelAnimations() (2 input parameters) +Function 486: 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 486: UpdateModelAnimation() (3 input parameters) +Function 487: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 487: UnloadModelAnimation() (1 input parameters) +Function 488: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 488: UnloadModelAnimations() (2 input parameters) +Function 489: 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 489: IsModelAnimationValid() (2 input parameters) +Function 490: 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 490: CheckCollisionSpheres() (4 input parameters) +Function 491: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4122,40 +4130,40 @@ Function 490: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 491: CheckCollisionBoxes() (2 input parameters) +Function 492: 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 492: CheckCollisionBoxSphere() (3 input parameters) +Function 493: 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 493: GetRayCollisionSphere() (3 input parameters) +Function 494: 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 494: GetRayCollisionBox() (2 input parameters) +Function 495: 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 495: GetRayCollisionMesh() (3 input parameters) +Function 496: 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 496: GetRayCollisionTriangle() (4 input parameters) +Function 497: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4163,7 +4171,7 @@ Function 496: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 497: GetRayCollisionQuad() (5 input parameters) +Function 498: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4172,158 +4180,158 @@ Function 497: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 498: InitAudioDevice() (0 input parameters) +Function 499: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 499: CloseAudioDevice() (0 input parameters) +Function 500: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 500: IsAudioDeviceReady() (0 input parameters) +Function 501: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 501: SetMasterVolume() (1 input parameters) +Function 502: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 502: GetMasterVolume() (0 input parameters) +Function 503: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 503: LoadWave() (1 input parameters) +Function 504: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 504: LoadWaveFromMemory() (3 input parameters) +Function 505: 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 505: IsWaveReady() (1 input parameters) +Function 506: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 506: LoadSound() (1 input parameters) +Function 507: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 507: LoadSoundFromWave() (1 input parameters) +Function 508: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 508: LoadSoundAlias() (1 input parameters) +Function 509: 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 509: IsSoundReady() (1 input parameters) +Function 510: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 510: UpdateSound() (3 input parameters) +Function 511: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 511: UnloadWave() (1 input parameters) +Function 512: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 512: UnloadSound() (1 input parameters) +Function 513: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 513: UnloadSoundAlias() (1 input parameters) +Function 514: 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 514: ExportWave() (2 input parameters) +Function 515: 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 515: ExportWaveAsCode() (2 input parameters) +Function 516: 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 516: PlaySound() (1 input parameters) +Function 517: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 517: StopSound() (1 input parameters) +Function 518: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 518: PauseSound() (1 input parameters) +Function 519: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 519: ResumeSound() (1 input parameters) +Function 520: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 520: IsSoundPlaying() (1 input parameters) +Function 521: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 521: SetSoundVolume() (2 input parameters) +Function 522: 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 522: SetSoundPitch() (2 input parameters) +Function 523: 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 523: SetSoundPan() (2 input parameters) +Function 524: 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 524: WaveCopy() (1 input parameters) +Function 525: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 525: WaveCrop() (3 input parameters) +Function 526: 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 526: WaveFormat() (4 input parameters) +Function 527: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4331,203 +4339,203 @@ Function 526: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 527: LoadWaveSamples() (1 input parameters) +Function 528: 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 528: UnloadWaveSamples() (1 input parameters) +Function 529: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 529: LoadMusicStream() (1 input parameters) +Function 530: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 530: LoadMusicStreamFromMemory() (3 input parameters) +Function 531: 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 531: IsMusicReady() (1 input parameters) +Function 532: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 532: UnloadMusicStream() (1 input parameters) +Function 533: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 533: PlayMusicStream() (1 input parameters) +Function 534: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 534: IsMusicStreamPlaying() (1 input parameters) +Function 535: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 535: UpdateMusicStream() (1 input parameters) +Function 536: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 536: StopMusicStream() (1 input parameters) +Function 537: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 537: PauseMusicStream() (1 input parameters) +Function 538: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 538: ResumeMusicStream() (1 input parameters) +Function 539: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 539: SeekMusicStream() (2 input parameters) +Function 540: 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 540: SetMusicVolume() (2 input parameters) +Function 541: 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 541: SetMusicPitch() (2 input parameters) +Function 542: 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 542: SetMusicPan() (2 input parameters) +Function 543: 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 543: GetMusicTimeLength() (1 input parameters) +Function 544: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 544: GetMusicTimePlayed() (1 input parameters) +Function 545: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 545: LoadAudioStream() (3 input parameters) +Function 546: 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 546: IsAudioStreamReady() (1 input parameters) +Function 547: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 547: UnloadAudioStream() (1 input parameters) +Function 548: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 548: UpdateAudioStream() (3 input parameters) +Function 549: 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 549: IsAudioStreamProcessed() (1 input parameters) +Function 550: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 550: PlayAudioStream() (1 input parameters) +Function 551: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 551: PauseAudioStream() (1 input parameters) +Function 552: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 552: ResumeAudioStream() (1 input parameters) +Function 553: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 553: IsAudioStreamPlaying() (1 input parameters) +Function 554: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 554: StopAudioStream() (1 input parameters) +Function 555: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 555: SetAudioStreamVolume() (2 input parameters) +Function 556: 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 556: SetAudioStreamPitch() (2 input parameters) +Function 557: 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 557: SetAudioStreamPan() (2 input parameters) +Function 558: 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 558: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 559: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 559: SetAudioStreamCallback() (2 input parameters) +Function 560: 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 560: AttachAudioStreamProcessor() (2 input parameters) +Function 561: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 561: DetachAudioStreamProcessor() (2 input parameters) +Function 562: 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 562: AttachAudioMixedProcessor() (1 input parameters) +Function 563: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 563: DetachAudioMixedProcessor() (1 input parameters) +Function 564: 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 e7fa157b2073..c4a16f97ee4d 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -1671,6 +1671,12 @@ + + + + + + From 2998f8671beaec6d1faed8f40c16a9ec31cab7c0 Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Sun, 2 Jun 2024 05:51:25 -0400 Subject: [PATCH 15/71] LoadModelAnimationsIQM: fix corrupted animation names (#4026) Correctly copies animation names from IQM animation to raylib animation. --- src/rmodels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 4bf042d5cafc..e1e9418cb115 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4621,6 +4621,8 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, int *animCou animations[a].boneCount = iqmHeader->num_poses; animations[a].bones = RL_MALLOC(iqmHeader->num_poses*sizeof(BoneInfo)); animations[a].framePoses = RL_MALLOC(anim[a].num_frames*sizeof(Transform *)); + memcpy(animations[a].name, fileDataPtr + iqmHeader->ofs_text + anim[a].name, 32); // I don't like this 32 here + TraceLog(LOG_INFO, "IQM Anim %s", animations[a].name); // animations[a].framerate = anim.framerate; // TODO: Use animation framerate data? for (unsigned int j = 0; j < iqmHeader->num_poses; j++) From 11202bf299a70a8ef30e28ab99a8184bbb119a99 Mon Sep 17 00:00:00 2001 From: David Holland Date: Sun, 2 Jun 2024 19:52:00 +1000 Subject: [PATCH 16/71] [rmodels] Send full matModel to shader in DrawMesh (#4005) (#4022) --- src/rmodels.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index e1e9418cb115..5cf848b68243 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1389,14 +1389,14 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform) if (material.shader.locs[SHADER_LOC_MATRIX_VIEW] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_VIEW], matView); if (material.shader.locs[SHADER_LOC_MATRIX_PROJECTION] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_PROJECTION], matProjection); - // Model transformation matrix is sent to shader uniform location: SHADER_LOC_MATRIX_MODEL - if (material.shader.locs[SHADER_LOC_MATRIX_MODEL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_MODEL], transform); - // Accumulate several model transformations: // transform: model transformation provided (includes DrawModel() params combined with model.transform) // rlGetMatrixTransform(): rlgl internal transform matrix due to push/pop matrix stack matModel = MatrixMultiply(transform, rlGetMatrixTransform()); + // Model transformation matrix is sent to shader uniform location: SHADER_LOC_MATRIX_MODEL + if (material.shader.locs[SHADER_LOC_MATRIX_MODEL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_MODEL], matModel); + // Get model-view matrix matModelView = MatrixMultiply(matModel, matView); From 0cad25f79878211783ce550b06e20f13cc9176a1 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Mon, 3 Jun 2024 08:52:51 +0200 Subject: [PATCH 17/71] Update Raylib-CSharp to `5.1-dev`. (#4030) * Update BINDINGS.md * Update BINDINGS.md * Update BINDINGS.md --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 81bc6abda88c..9ec8c3c3c7d5 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -12,7 +12,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | -| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | +| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | | [Raylib.NET](https://github.com/Odex64/Raylib.NET) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | | [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT | | [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | From 06f8c4f73318488e5a4bf1f7bd82fe991a66827e Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Mon, 3 Jun 2024 03:03:33 -0400 Subject: [PATCH 18/71] LoadIQM: attempt to load texture from IQM at loadtime. (#4029) tries to load the texture with the base path of the original IQM file, relative paths should work. --- src/rmodels.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 5cf848b68243..249201513c0d 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4268,6 +4268,8 @@ static Model LoadIQM(const char *fileName) // In case file can not be read, return an empty model if (fileDataPtr == NULL) return model; + const char* basePath = GetDirectoryPath(fileName); + // Read IQM header IQMHeader *iqmHeader = (IQMHeader *)fileDataPtr; @@ -4312,6 +4314,7 @@ static Model LoadIQM(const char *fileName) memcpy(material, fileDataPtr + iqmHeader->ofs_text + imesh[i].material, MATERIAL_NAME_LENGTH*sizeof(char)); model.materials[i] = LoadMaterialDefault(); + model.materials[i].maps[MATERIAL_MAP_ALBEDO].texture = LoadTexture(TextFormat("%s/%s", basePath, material)); TRACELOG(LOG_DEBUG, "MODEL: [%s] mesh name (%s), material (%s)", fileName, name, material); From 39f12859dcdf92822c8fefece1135bf6e76a1573 Mon Sep 17 00:00:00 2001 From: IoIxD <30945097+IoIxD@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:13:28 -0700 Subject: [PATCH 19/71] rtext: added functions for camel case and snake case (reopened due to formatting errors) (#4033) * rtext: added functions for camel case and snake case * Update raylib_api.* by CI * rtext: removed always false comparison --------- Co-authored-by: github-actions[bot] --- parser/output/raylib_api.json | 22 +++ parser/output/raylib_api.lua | 16 ++ parser/output/raylib_api.txt | 294 ++++++++++++++++++---------------- parser/output/raylib_api.xml | 8 +- src/raylib.h | 3 + src/rtext.c | 65 ++++++++ 6 files changed, 265 insertions(+), 143 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 4bfce70d19df..961578e5313f 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -9479,6 +9479,28 @@ } ] }, + { + "name": "TextToSnake", + "description": "Get Snake case notation version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToCamel", + "description": "Get Camel case notation version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, { "name": "TextToInteger", "description": "Get integer value from text (negative values not supported)", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 4a6998bbd3bf..eb88daab9a63 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -6776,6 +6776,22 @@ return { {type = "const char *", name = "text"} } }, + { + name = "TextToSnake", + description = "Get Snake case notation version of provided string", + returnType = "const char *", + params = { + {type = "const char *", name = "text"} + } + }, + { + name = "TextToCamel", + description = "Get Camel case notation version of provided string", + returnType = "const char *", + params = { + {type = "const char *", name = "text"} + } + }, { name = "TextToInteger", description = "Get integer value from text (negative values not supported)", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 979ef0d562f2..66880130ed7f 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 564 +Functions found: 566 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3641,30 +3641,40 @@ Function 423: TextToPascal() (1 input parameters) Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 424: TextToInteger() (1 input parameters) +Function 424: TextToSnake() (1 input parameters) + Name: TextToSnake + Return type: const char * + Description: Get Snake case notation version of provided string + Param[1]: text (type: const char *) +Function 425: TextToCamel() (1 input parameters) + Name: TextToCamel + Return type: const char * + Description: Get Camel case notation version of provided string + Param[1]: text (type: const char *) +Function 426: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 425: TextToFloat() (1 input parameters) +Function 427: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 426: DrawLine3D() (3 input parameters) +Function 428: 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 427: DrawPoint3D() (2 input parameters) +Function 429: 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 428: DrawCircle3D() (5 input parameters) +Function 430: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3673,7 +3683,7 @@ Function 428: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 429: DrawTriangle3D() (4 input parameters) +Function 431: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3681,14 +3691,14 @@ Function 429: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 430: DrawTriangleStrip3D() (3 input parameters) +Function 432: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 431: DrawCube() (5 input parameters) +Function 433: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3697,14 +3707,14 @@ Function 431: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 432: DrawCubeV() (3 input parameters) +Function 434: 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 433: DrawCubeWires() (5 input parameters) +Function 435: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3713,21 +3723,21 @@ Function 433: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 434: DrawCubeWiresV() (3 input parameters) +Function 436: 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 435: DrawSphere() (3 input parameters) +Function 437: 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 436: DrawSphereEx() (5 input parameters) +Function 438: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3736,7 +3746,7 @@ Function 436: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 437: DrawSphereWires() (5 input parameters) +Function 439: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3745,7 +3755,7 @@ Function 437: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 438: DrawCylinder() (6 input parameters) +Function 440: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3755,7 +3765,7 @@ Function 438: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 439: DrawCylinderEx() (6 input parameters) +Function 441: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3765,7 +3775,7 @@ Function 439: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 440: DrawCylinderWires() (6 input parameters) +Function 442: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3775,7 +3785,7 @@ Function 440: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 441: DrawCylinderWiresEx() (6 input parameters) +Function 443: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3785,7 +3795,7 @@ Function 441: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 442: DrawCapsule() (6 input parameters) +Function 444: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3795,7 +3805,7 @@ Function 442: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 443: DrawCapsuleWires() (6 input parameters) +Function 445: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3805,51 +3815,51 @@ Function 443: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 444: DrawPlane() (3 input parameters) +Function 446: 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 445: DrawRay() (2 input parameters) +Function 447: 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 446: DrawGrid() (2 input parameters) +Function 448: 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 447: LoadModel() (1 input parameters) +Function 449: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 448: LoadModelFromMesh() (1 input parameters) +Function 450: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 449: IsModelReady() (1 input parameters) +Function 451: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 450: UnloadModel() (1 input parameters) +Function 452: 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 451: GetModelBoundingBox() (1 input parameters) +Function 453: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 452: DrawModel() (4 input parameters) +Function 454: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3857,7 +3867,7 @@ Function 452: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 453: DrawModelEx() (6 input parameters) +Function 455: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3867,7 +3877,7 @@ Function 453: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 454: DrawModelWires() (4 input parameters) +Function 456: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3875,7 +3885,7 @@ Function 454: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 455: DrawModelWiresEx() (6 input parameters) +Function 457: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3885,13 +3895,13 @@ Function 455: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 456: DrawBoundingBox() (2 input parameters) +Function 458: 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 457: DrawBillboard() (5 input parameters) +Function 459: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3900,7 +3910,7 @@ Function 457: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 458: DrawBillboardRec() (6 input parameters) +Function 460: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3910,7 +3920,7 @@ Function 458: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 459: DrawBillboardPro() (9 input parameters) +Function 461: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3923,13 +3933,13 @@ Function 459: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 460: UploadMesh() (2 input parameters) +Function 462: 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 461: UpdateMeshBuffer() (5 input parameters) +Function 463: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3938,19 +3948,19 @@ Function 461: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 462: UnloadMesh() (1 input parameters) +Function 464: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 463: DrawMesh() (3 input parameters) +Function 465: 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 464: DrawMeshInstanced() (4 input parameters) +Function 466: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3958,35 +3968,35 @@ Function 464: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 465: GetMeshBoundingBox() (1 input parameters) +Function 467: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 466: GenMeshTangents() (1 input parameters) +Function 468: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 467: ExportMesh() (2 input parameters) +Function 469: 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 468: ExportMeshAsCode() (2 input parameters) +Function 470: 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 469: GenMeshPoly() (2 input parameters) +Function 471: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 470: GenMeshPlane() (4 input parameters) +Function 472: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -3994,42 +4004,42 @@ Function 470: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 471: GenMeshCube() (3 input parameters) +Function 473: 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 472: GenMeshSphere() (3 input parameters) +Function 474: 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 473: GenMeshHemiSphere() (3 input parameters) +Function 475: 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 474: GenMeshCylinder() (3 input parameters) +Function 476: 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 475: GenMeshCone() (3 input parameters) +Function 477: 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 476: GenMeshTorus() (4 input parameters) +Function 478: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4037,7 +4047,7 @@ Function 476: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 477: GenMeshKnot() (4 input parameters) +Function 479: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4045,84 +4055,84 @@ Function 477: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 478: GenMeshHeightmap() (2 input parameters) +Function 480: 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 479: GenMeshCubicmap() (2 input parameters) +Function 481: 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 480: LoadMaterials() (2 input parameters) +Function 482: 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 481: LoadMaterialDefault() (0 input parameters) +Function 483: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 482: IsMaterialReady() (1 input parameters) +Function 484: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 483: UnloadMaterial() (1 input parameters) +Function 485: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 484: SetMaterialTexture() (3 input parameters) +Function 486: 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 485: SetModelMeshMaterial() (3 input parameters) +Function 487: 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 486: LoadModelAnimations() (2 input parameters) +Function 488: 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 487: UpdateModelAnimation() (3 input parameters) +Function 489: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 488: UnloadModelAnimation() (1 input parameters) +Function 490: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 489: UnloadModelAnimations() (2 input parameters) +Function 491: 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 490: IsModelAnimationValid() (2 input parameters) +Function 492: 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 491: CheckCollisionSpheres() (4 input parameters) +Function 493: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4130,40 +4140,40 @@ Function 491: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 492: CheckCollisionBoxes() (2 input parameters) +Function 494: 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 493: CheckCollisionBoxSphere() (3 input parameters) +Function 495: 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 494: GetRayCollisionSphere() (3 input parameters) +Function 496: 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 495: GetRayCollisionBox() (2 input parameters) +Function 497: 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 496: GetRayCollisionMesh() (3 input parameters) +Function 498: 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 497: GetRayCollisionTriangle() (4 input parameters) +Function 499: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4171,7 +4181,7 @@ Function 497: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 498: GetRayCollisionQuad() (5 input parameters) +Function 500: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4180,158 +4190,158 @@ Function 498: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 499: InitAudioDevice() (0 input parameters) +Function 501: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 500: CloseAudioDevice() (0 input parameters) +Function 502: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 501: IsAudioDeviceReady() (0 input parameters) +Function 503: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 502: SetMasterVolume() (1 input parameters) +Function 504: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 503: GetMasterVolume() (0 input parameters) +Function 505: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 504: LoadWave() (1 input parameters) +Function 506: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 505: LoadWaveFromMemory() (3 input parameters) +Function 507: 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 506: IsWaveReady() (1 input parameters) +Function 508: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 507: LoadSound() (1 input parameters) +Function 509: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 508: LoadSoundFromWave() (1 input parameters) +Function 510: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 509: LoadSoundAlias() (1 input parameters) +Function 511: 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 510: IsSoundReady() (1 input parameters) +Function 512: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 511: UpdateSound() (3 input parameters) +Function 513: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 512: UnloadWave() (1 input parameters) +Function 514: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 513: UnloadSound() (1 input parameters) +Function 515: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 514: UnloadSoundAlias() (1 input parameters) +Function 516: 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 515: ExportWave() (2 input parameters) +Function 517: 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 516: ExportWaveAsCode() (2 input parameters) +Function 518: 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 517: PlaySound() (1 input parameters) +Function 519: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 518: StopSound() (1 input parameters) +Function 520: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 519: PauseSound() (1 input parameters) +Function 521: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 520: ResumeSound() (1 input parameters) +Function 522: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 521: IsSoundPlaying() (1 input parameters) +Function 523: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 522: SetSoundVolume() (2 input parameters) +Function 524: 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 523: SetSoundPitch() (2 input parameters) +Function 525: 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 524: SetSoundPan() (2 input parameters) +Function 526: 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 525: WaveCopy() (1 input parameters) +Function 527: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 526: WaveCrop() (3 input parameters) +Function 528: 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 527: WaveFormat() (4 input parameters) +Function 529: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4339,203 +4349,203 @@ Function 527: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 528: LoadWaveSamples() (1 input parameters) +Function 530: 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 529: UnloadWaveSamples() (1 input parameters) +Function 531: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 530: LoadMusicStream() (1 input parameters) +Function 532: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 531: LoadMusicStreamFromMemory() (3 input parameters) +Function 533: 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 532: IsMusicReady() (1 input parameters) +Function 534: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 533: UnloadMusicStream() (1 input parameters) +Function 535: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 534: PlayMusicStream() (1 input parameters) +Function 536: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 535: IsMusicStreamPlaying() (1 input parameters) +Function 537: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 536: UpdateMusicStream() (1 input parameters) +Function 538: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 537: StopMusicStream() (1 input parameters) +Function 539: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 538: PauseMusicStream() (1 input parameters) +Function 540: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 539: ResumeMusicStream() (1 input parameters) +Function 541: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 540: SeekMusicStream() (2 input parameters) +Function 542: 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 541: SetMusicVolume() (2 input parameters) +Function 543: 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 542: SetMusicPitch() (2 input parameters) +Function 544: 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 543: SetMusicPan() (2 input parameters) +Function 545: 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 544: GetMusicTimeLength() (1 input parameters) +Function 546: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 545: GetMusicTimePlayed() (1 input parameters) +Function 547: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 546: LoadAudioStream() (3 input parameters) +Function 548: 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 547: IsAudioStreamReady() (1 input parameters) +Function 549: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 548: UnloadAudioStream() (1 input parameters) +Function 550: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 549: UpdateAudioStream() (3 input parameters) +Function 551: 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 550: IsAudioStreamProcessed() (1 input parameters) +Function 552: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 551: PlayAudioStream() (1 input parameters) +Function 553: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 552: PauseAudioStream() (1 input parameters) +Function 554: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 553: ResumeAudioStream() (1 input parameters) +Function 555: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 554: IsAudioStreamPlaying() (1 input parameters) +Function 556: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 555: StopAudioStream() (1 input parameters) +Function 557: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 556: SetAudioStreamVolume() (2 input parameters) +Function 558: 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 557: SetAudioStreamPitch() (2 input parameters) +Function 559: 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 558: SetAudioStreamPan() (2 input parameters) +Function 560: 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 559: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 561: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 560: SetAudioStreamCallback() (2 input parameters) +Function 562: 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 561: AttachAudioStreamProcessor() (2 input parameters) +Function 563: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 562: DetachAudioStreamProcessor() (2 input parameters) +Function 564: 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 563: AttachAudioMixedProcessor() (1 input parameters) +Function 565: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 564: DetachAudioMixedProcessor() (1 input parameters) +Function 566: 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 c4a16f97ee4d..0e096d5a2d62 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -2405,6 +2405,12 @@ + + + + + + diff --git a/src/raylib.h b/src/raylib.h index dfa98efb88db..c612856416c3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1489,6 +1489,9 @@ RLAPI int TextFindIndex(const char *text, const char *find); RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string +RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string + RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) diff --git a/src/rtext.c b/src/rtext.c index 5ba4e8b6ab68..118a559d6e0b 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1786,6 +1786,71 @@ const char *TextToPascal(const char *text) return buffer; } +// Get snake case notation version of provided string +// WARNING: Limited functionality, only basic characters set +const char *TextToSnake(const char *text) +{ + static char buffer[MAX_TEXT_BUFFER_LENGTH] = {0}; + memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); + + if (text != NULL) + { + // Check for next separator to upper case another character + for (int i = 0, j = 0; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) + { + if ((text[j] >= 'A') && (text[j] <= 'Z')) + { + if (i >= 1) + { + buffer[i] = '_'; + i++; + } + buffer[i] = text[j] + 32; + } + else + { + buffer[i] = text[j]; + } + } + } + + return buffer; +} + +// Get Camel case notation version of provided string +// WARNING: Limited functionality, only basic characters set +const char *TextToCamel(const char *text) +{ + static char buffer[MAX_TEXT_BUFFER_LENGTH] = {0}; + memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); + + if (text != NULL) + { + // Lower case first character + if ((text[0] >= 'A') && (text[0] <= 'Z')) + buffer[0] = text[0] + 32; + else + buffer[0] = text[0]; + + // Check for next separator to upper case another character + for (int i = 1, j = 1; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) + { + if (text[j] != '_') + buffer[i] = text[j]; + else + { + j++; + if ((text[j] >= 'a') && (text[j] <= 'z')) + { + buffer[i] = text[j] - 32; + } + } + } + } + + return buffer; +} + // Encode text codepoint into UTF-8 text // REQUIRES: memcpy() // WARNING: Allocated memory must be manually freed From e1379afb01e5ad758b3928d055e418c2fb511d2a Mon Sep 17 00:00:00 2001 From: Paul Melis Date: Tue, 4 Jun 2024 11:46:57 +0200 Subject: [PATCH 20/71] Fix #4024, cylinder drawing was incorrect due to imprecise angle (#4034) * Fix #4024, cylinder drawing was incorrect due to imprecise angle stepping (mostly noticeable with semi-transparent cylinders) * Fix var name and spacing --- src/rmodels.c | 55 ++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 249201513c0d..57059a0175b0 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -508,6 +508,8 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h { if (sides < 3) sides = 3; + const float angleStep = 360.0f/sides; + rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -517,43 +519,44 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h if (radiusTop > 0) { // Draw Body ------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); //Bottom Right - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); //Bottom Left + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); //Bottom Right + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); //Top Right - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); //Top Left - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); //Top Left + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); //Bottom Left + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); //Top Right } // Draw Cap -------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { rlVertex3f(0, height, 0); - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); } } else { // Draw Cone ------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { rlVertex3f(0, height, 0); - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); } } // Draw Base ----------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { rlVertex3f(0, 0, 0); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); } + rlEnd(); rlPopMatrix(); } @@ -623,25 +626,27 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl { if (sides < 3) sides = 3; + const float angleStep = 360.0f/sides; + rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); } rlEnd(); rlPopMatrix(); From 5767c4cd059e07355ae5588966d0aee97038a86b Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 4 Jun 2024 23:00:12 +0200 Subject: [PATCH 21/71] Update rcore_desktop.c --- src/platforms/rcore_desktop.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index f08774165b1f..6fe054a8aa59 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -1443,15 +1443,12 @@ int InitPlatform(void) else { // No-fullscreen window creation - bool wantWindowedFullscreen = (CORE.Window.screen.height == 0) && (CORE.Window.screen.width == 0); + bool requestWindowedFullscreen = (CORE.Window.screen.height == 0) && (CORE.Window.screen.width == 0); // If we are windowed fullscreen, ensures that window does not minimize when focus is lost. // This hinting code will not work if the user already specified the correct monitor dimensions; // at this point we don't know the monitor's dimensions. (Though, how did the user then?) - if (wantWindowedFullscreen) - { - glfwWindowHint(GLFW_AUTO_ICONIFY, 0); - } + if (requestWindowedFullscreen) glfwWindowHint(GLFW_AUTO_ICONIFY, 0); // Default to at least one pixel in size, as creation with a zero dimension is not allowed. int creationWidth = CORE.Window.screen.width != 0 ? CORE.Window.screen.width : 1; @@ -1471,11 +1468,7 @@ int InitPlatform(void) monitor = monitors[monitorIndex]; SetDimensionsFromMonitor(monitor); - TRACELOG(LOG_INFO, "wantWindowed: %d, size: %dx%d", wantWindowedFullscreen, CORE.Window.screen.width, CORE.Window.screen.height); - if (wantWindowedFullscreen) - { - glfwSetWindowSize(platform.handle, CORE.Window.screen.width, CORE.Window.screen.height); - } + if (requestWindowedFullscreen) glfwSetWindowSize(platform.handle, CORE.Window.screen.width, CORE.Window.screen.height); } else { From 38018192b8055024c4aa9b041943aa4e85bdd773 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 6 Jun 2024 10:12:23 +0200 Subject: [PATCH 22/71] RENAME: near, far vaiables --- src/raymath.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index d036721a233b..8b69cbd53c0a 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -1837,32 +1837,32 @@ RMAPI Matrix MatrixScale(float x, float y, float z) } // Get perspective projection matrix -RMAPI Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far) +RMAPI Matrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane) { Matrix result = { 0 }; float rl = (float)(right - left); float tb = (float)(top - bottom); - float fn = (float)(far - near); + float fn = (float)(farPlane - nearPlane); - result.m0 = ((float)near*2.0f)/rl; + result.m0 = ((float)nearPlane*2.0f)/rl; result.m1 = 0.0f; result.m2 = 0.0f; result.m3 = 0.0f; result.m4 = 0.0f; - result.m5 = ((float)near*2.0f)/tb; + result.m5 = ((float)nearPlane*2.0f)/tb; result.m6 = 0.0f; result.m7 = 0.0f; result.m8 = ((float)right + (float)left)/rl; result.m9 = ((float)top + (float)bottom)/tb; - result.m10 = -((float)far + (float)near)/fn; + result.m10 = -((float)farPlane + (float)nearPlane)/fn; result.m11 = -1.0f; result.m12 = 0.0f; result.m13 = 0.0f; - result.m14 = -((float)far*(float)near*2.0f)/fn; + result.m14 = -((float)farPlane*(float)nearPlane*2.0f)/fn; result.m15 = 0.0f; return result; From e74d13e6dbdd8bbdde8112f396935b8b88349f5f Mon Sep 17 00:00:00 2001 From: Sprix <91488389+Sprixitite@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:47:07 +0100 Subject: [PATCH 23/71] Fix examples not building with gestures system disabled (#4020) Build no longer fails with -DSUPPORT_GESTURES_SYSTEM=OFF and -DBUILD_EXAMPLES=ON --- examples/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9223236741c8..28550eaecb65 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -113,6 +113,13 @@ elseif ("${PLATFORM}" STREQUAL "DRM") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c) +elseif (NOT SUPPORT_GESTURES_SYSTEM) + # Items requiring gestures system + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_mouse_painting.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_basic_screen_manager.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_input_gestures_web.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_input_gestures.c) + endif () # The rlgl_standalone example only targets desktop, without shared libraries. From f05316b11d0a1b17088e3e75e4682e2e7ce54b91 Mon Sep 17 00:00:00 2001 From: jgabaut <109908086+jgabaut@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:29:15 +0200 Subject: [PATCH 24/71] [rlgl] Rename near, far variables (#4039) --- src/rlgl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index bef7eaf18ef6..2f6a03b8aa07 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -590,7 +590,7 @@ RLAPI void rlMultMatrixf(const float *matf); // Multiply the current RLAPI void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar); RLAPI void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar); RLAPI void rlViewport(int x, int y, int width, int height); // Set the viewport area -RLAPI void rlSetClipPlanes(double near, double far); // Set clip planes distances +RLAPI void rlSetClipPlanes(double nearPlane, double farPlane); // Set clip planes distances RLAPI double rlGetCullDistanceNear(void); // Get cull plane distance near RLAPI double rlGetCullDistanceFar(void); // Get cull plane distance far @@ -1371,10 +1371,10 @@ void rlViewport(int x, int y, int width, int height) } // Set clip planes distances -void rlSetClipPlanes(double near, double far) +void rlSetClipPlanes(double nearPlane, double farPlane) { - rlCullDistanceNear = near; - rlCullDistanceFar = far; + rlCullDistanceNear = nearPlane; + rlCullDistanceFar = farPlane; } // Get cull plane distance near From 3948656d84da2e02ba4c2fda80ac813f6c81813e Mon Sep 17 00:00:00 2001 From: Konrad Gutvik Grande Date: Fri, 7 Jun 2024 10:21:02 +0200 Subject: [PATCH 25/71] The example always showed a xbox controller, never a ps3 controller (#4040) --- examples/core/core_input_gamepad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 843d5d90bc8b..656f7c244f83 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -22,7 +22,7 @@ // NOTE: Gamepad name ID depends on drivers and OS #define XBOX360_LEGACY_NAME_ID "Xbox Controller" #define XBOX360_NAME_ID "Xbox 360 Controller" -#define PS3_NAME_ID "PLAYSTATION(R)3 Controller" +#define PS3_NAME_ID "Sony PLAYSTATION(R)3 Controller" //------------------------------------------------------------------------------------ // Program main entry point @@ -67,7 +67,7 @@ int main(void) { DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK); - if (true) + if (TextIsEqual(GetGamepadName(gamepad), XBOX360_LEGACY_NAME_ID) || TextIsEqual(GetGamepadName(gamepad), XBOX360_NAME_ID)) { DrawTexture(texXboxPad, 0, 0, DARKGRAY); From 7b92b5bde77f857dbf25a2e0aaacb79f592c18b2 Mon Sep 17 00:00:00 2001 From: fruzitent <40008647+fruzitent@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:22:24 +0300 Subject: [PATCH 26/71] fix: infer CMAKE_MODULE_PATH in super-build (#4042) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57719691aa5a..a5e3408c8f09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_policy(SET CMP0063 NEW) # Directory for easier includes # Anywhere you see include(...) you can check /cmake for that file -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # RAYLIB_IS_MAIN determines whether the project is being used from root # or if it is added as a dependency (through add_subdirectory for example). @@ -51,7 +51,7 @@ add_subdirectory(src raylib) # Uninstall target if(NOT TARGET uninstall) configure_file( - "${CMAKE_MODULE_PATH}/Uninstall.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) From 8c712f82d12c08fd4710468d908be765ee54e748 Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Sat, 8 Jun 2024 16:26:46 -0400 Subject: [PATCH 27/71] Update RGFW (#4048) * Fix Makefile issues (RGFW) (linux) (macOS) * Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW) * remove #define RGFWDEF and make the #undefs only happen for their OS * Update RGFW.h * fix to match the RGFW updates * remove line that shows the cursor for no reason --- src/external/RGFW.h | 872 ++++++++++++++++++----------- src/platforms/rcore_desktop_rgfw.c | 8 +- 2 files changed, 556 insertions(+), 324 deletions(-) diff --git a/src/external/RGFW.h b/src/external/RGFW.h index 67c67e91c9f2..a0ca21cec639 100644 --- a/src/external/RGFW.h +++ b/src/external/RGFW.h @@ -34,7 +34,9 @@ #define RGFW_BUFFER - (optional) just draw directly to (RGFW) window pixel buffer that is drawn to screen (the buffer is in the RGBA format) #define RGFW_EGL - (optional) use EGL for loading an OpenGL context (instead of the system's opengl api) #define RGFW_OPENGL_ES1 - (optional) use EGL to load and use Opengl ES (version 1) for backend rendering (instead of the system's opengl api) + This version doesn't work for desktops (I'm pretty sure) #define RGFW_OPENGL_ES2 - (optional) use OpenGL ES (version 2) + #define RGFW_OPENGL_ES3 - (optional) use OpenGL ES (version 3) #define RGFW_VULKAN - (optional) use vulkan for the rendering backend (rather than opengl) #define RGFW_DIRECTX - (optional) use directX for the rendering backend (rather than opengl) (windows only, defaults to opengl for unix) #define RGFW_NO_API - (optional) don't use any rendering API (no opengl, no vulkan, no directX) @@ -90,12 +92,16 @@ #ifndef RGFWDEF #ifdef __APPLE__ -#define RGFWDEF extern inline +#define RGFWDEF static inline #else #define RGFWDEF inline #endif #endif +#ifndef RGFW_UNUSED +#define RGFW_UNUSED(x) if (x){} +#endif + #ifdef __cplusplus extern "C" { #endif @@ -106,7 +112,7 @@ extern "C" { #define RGFW_HEADER #if !defined(u8) -#include + #include typedef uint8_t u8; typedef int8_t i8; @@ -130,12 +136,16 @@ extern "C" { #define RGFW_WINDOWS -#if defined(_WIN32) +#if defined(_WIN32) && !defined(WIN32) #define WIN32 #endif #if defined(_WIN64) + +#ifndef WIN64 #define WIN64 +#endif + #define _AMD64_ #undef _X86_ #else @@ -163,7 +173,7 @@ extern "C" { #define RGFW_MACOS #endif -#if (defined(RGFW_OPENGL_ES1) || defined(RGFW_OPENGL_ES2)) && !defined(RGFW_EGL) +#if (defined(RGFW_OPENGL_ES1) || defined(RGFW_OPENGL_ES2) || defined(RGFW_OPENGL_ES3)) && !defined(RGFW_EGL) #define RGFW_EGL #endif #if defined(RGFW_EGL) && defined(__APPLE__) @@ -193,7 +203,7 @@ extern "C" { #include #endif -#if defined(RGFW_X11) && defined(RGFW_OPENGL) +#if defined(RGFW_X11) && (defined(RGFW_OPENGL)) #ifndef GLX_MESA_swap_control #define GLX_MESA_swap_control #endif @@ -384,10 +394,10 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_vector point; /*!< mouse x, y of event (or drop point) */ u32 keyCode; /*!< keycode of event !!Keycodes defined at the bottom of the header file!! */ - u32 inFocus; /*if the window is in focus or not*/ - u32 fps; /*the current fps of the window [the fps is checked when events are checked]*/ - u32 current_ticks, frames; /* this is used for counting the fps */ + u64 frameTime, frameTime2; /* this is used for counting the fps */ + + u8 inFocus; /*if the window is in focus or not*/ u8 lockState; @@ -416,9 +426,10 @@ typedef struct { i32 x, y; } RGFW_vector; u32 display; void* displayLink; void* window; + u8 dndPassed; #endif -#if defined(RGFW_OPENGL) && !defined(RGFW_OSMESA) +#if (defined(RGFW_OPENGL)) && !defined(RGFW_OSMESA) #ifdef RGFW_MACOS void* rSurf; /*!< source graphics context */ #endif @@ -460,6 +471,7 @@ typedef struct { i32 x, y; } RGFW_vector; #ifdef RGFW_EGL EGLSurface EGL_surface; EGLDisplay EGL_display; + EGLContext EGL_context; #endif #if defined(RGFW_OSMESA) || defined(RGFW_BUFFER) @@ -508,7 +520,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_rect r; /* the x, y, w and h of the struct */ - u8 fpsCap; /*!< the fps cap of the window should run at (change this var to change the fps cap, 0 = no limit)*/ + u32 fpsCap; /*!< the fps cap of the window should run at (change this var to change the fps cap, 0 = no limit)*/ /*[the fps is capped when events are checked]*/ } RGFW_window; /*!< Window structure for managing the window */ @@ -627,7 +639,6 @@ typedef struct { i32 x, y; } RGFW_vector; this is run by default if the user uses the arg `RGFW_SCALE_TO_MONITOR` during window creation */ RGFWDEF void RGFW_window_scaleToMonitor(RGFW_window* win); - /* get the struct of the window's monitor */ RGFWDEF RGFW_monitor RGFW_window_getMonitor(RGFW_window* win); @@ -635,11 +646,16 @@ typedef struct { i32 x, y; } RGFW_vector; RGFWDEF void RGFW_window_makeCurrent(RGFW_window* win); /*error handling*/ - RGFWDEF u8 RGFW_Error(); /* returns true if an error has occurred (doesn't print errors itself) */ + RGFWDEF u8 RGFW_Error(void); /* returns true if an error has occurred (doesn't print errors itself) */ /*!< if window == NULL, it checks if the key is pressed globally. Otherwise, it checks only if the key is pressed while the window in focus.*/ RGFWDEF u8 RGFW_isPressedI(RGFW_window* win, u32 key); /*!< if key is pressed (key code)*/ + RGFWDEF u8 RGFW_wasPressedI(RGFW_window* win, u32 key); /*!< if key was pressed (checks prev keymap only) (key code)*/ + + RGFWDEF u8 RGFW_isHeldI(RGFW_window* win, u32 key); /*!< if key is held (key code)*/ + RGFWDEF u8 RGFW_isReleasedI(RGFW_window* win, u32 key); /*!< if key is released (key code)*/ + /* !!Keycodes defined at the bottom of the header file!! */ @@ -676,7 +692,14 @@ typedef struct { i32 x, y; } RGFW_vector; if you're going to use sili which is a good idea generally */ - RGFWDEF RGFW_thread RGFW_createThread(void* (*function_ptr)(void*), void* args); /*!< create a thread*/ + + #if defined(__unix__) || defined(__APPLE__) + typedef void* (* RGFW_threadFunc_ptr)(void*); + #else + typedef DWORD (* RGFW_threadFunc_ptr)(void*); + #endif + + RGFWDEF RGFW_thread RGFW_createThread(RGFW_threadFunc_ptr ptr, void* args); /*!< create a thread*/ RGFWDEF void RGFW_cancelThread(RGFW_thread thread); /*!< cancels a thread*/ RGFWDEF void RGFW_joinThread(RGFW_thread thread); /*!< join thread to current thread */ RGFWDEF void RGFW_setThreadPriority(RGFW_thread thread, u8 priority); /*!< sets the priority priority */ @@ -694,7 +717,7 @@ typedef struct { i32 x, y; } RGFW_vector; /*! native opengl functions */ #ifdef RGFW_OPENGL /*! Get max OpenGL version */ - RGFWDEF u8* RGFW_getMaxGLVersion(); + RGFWDEF u8* RGFW_getMaxGLVersion(void); /* OpenGL init hints */ RGFWDEF void RGFW_setGLStencil(i32 stencil); /* set stencil buffer bit size (8 by default) */ RGFWDEF void RGFW_setGLSamples(i32 samples); /* set number of sampiling buffers (4 by default) */ @@ -754,8 +777,8 @@ typedef struct { i32 x, y; } RGFW_vector; RGFWDEF void RGFW_createSurface(VkInstance instance, RGFW_window* win); int RGFW_deviceInitialization(RGFW_window* win); int RGFW_createSwapchain(RGFW_window* win); - RGFWDEF int RGFW_createRenderPass(); - int RGFW_createCommandPool(); + RGFWDEF int RGFW_createRenderPass(void); + int RGFW_createCommandPool(void); int RGFW_createCommandBuffers(RGFW_window* win); int RGFW_createSyncObjects(RGFW_window* win); RGFWDEF int RGFW_createFramebuffers(RGFW_window* win); @@ -780,8 +803,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFWDEF void RGFW_window_checkFPS(RGFW_window* win); /*!< updates fps / sets fps to cap (ran by RGFW_window_checkEvent)*/ RGFWDEF u64 RGFW_getTime(void); /* get time in seconds */ RGFWDEF u64 RGFW_getTimeNS(void); /* get time in nanoseconds */ - RGFWDEF u32 RGFW_getFPS(void); /* get current FPS (win->event.fps) */ - RGFWDEF void RGFW_sleep(u32 microsecond); /* sleep for a set time */ + RGFWDEF void RGFW_sleep(u64 microsecond); /* sleep for a set time */ #endif /* RGFW_HEADER */ /* @@ -859,20 +881,19 @@ typedef struct { i32 x, y; } RGFW_vector; #ifdef RGFW_WINDOWS -#define WIN32_LEAN_AND_MEAN - #include #endif #ifdef RGFW_MACOS -#include - /* based on silicon.h */ +#ifndef GL_SILENCE_DEPRECATION #define GL_SILENCE_DEPRECATION +#endif + #include #include #include @@ -914,7 +935,7 @@ typedef struct { i32 x, y; } RGFW_vector; #define abi_objc_msgSend_fpret objc_msgSend_fpret #endif -#define NSAlloc(nsclass) objc_msgSend_id(nsclass, sel_registerName("alloc")) +#define NSAlloc(nsclass) objc_msgSend_id((id)nsclass, sel_registerName("alloc")) #define objc_msgSend_bool ((BOOL (*)(id, SEL))objc_msgSend) #define objc_msgSend_void ((void (*)(id, SEL))objc_msgSend) #define objc_msgSend_void_id ((void (*)(id, SEL, id))objc_msgSend) @@ -948,7 +969,7 @@ typedef struct { i32 x, y; } RGFW_vector; loadFunc("stringWithUTF8String:"); return ((id(*)(id, SEL, const char*))objc_msgSend) - (objc_getClass("NSString"), func, str); + ((id)objc_getClass("NSString"), func, str); } const char* NSString_to_char(NSString* str) { @@ -1053,7 +1074,7 @@ typedef struct { i32 x, y; } RGFW_vector; void* func = sel_registerName("initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:"); return (NSBitmapImageRep*) ((id(*)(id, SEL, unsigned char**, NSInteger, NSInteger, NSInteger, NSInteger, bool, bool, const char*, NSBitmapFormat, NSInteger, NSInteger))objc_msgSend) - (NSAlloc(objc_getClass("NSBitmapImageRep")), func, planes, width, height, bps, spp, alpha, isPlanar, NSString_stringWithUTF8String(colorSpaceName), bitmapFormat, rowBytes, pixelBits); + (NSAlloc((id)objc_getClass("NSBitmapImageRep")), func, planes, width, height, bps, spp, alpha, isPlanar, NSString_stringWithUTF8String(colorSpaceName), bitmapFormat, rowBytes, pixelBits); } NSColor* NSColor_colorWithSRGB(CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) { @@ -1079,7 +1100,7 @@ typedef struct { i32 x, y; } RGFW_vector; NSImage* NSImage_initWithSize(NSSize size) { void* func = sel_registerName("initWithSize:"); return ((id(*)(id, SEL, NSSize))objc_msgSend) - (NSAlloc(objc_getClass("NSImage")), func, size); + (NSAlloc((id)objc_getClass("NSImage")), func, size); } #define NS_OPENGL_ENUM_DEPRECATED(minVers, maxVers) API_AVAILABLE(macos(minVers)) typedef NS_ENUM(NSInteger, NSOpenGLContextParameter) { @@ -1111,13 +1132,13 @@ typedef struct { i32 x, y; } RGFW_vector; void* NSOpenGLPixelFormat_initWithAttributes(const uint32_t* attribs) { void* func = sel_registerName("initWithAttributes:"); return (void*) ((id(*)(id, SEL, const uint32_t*))objc_msgSend) - (NSAlloc(objc_getClass("NSOpenGLPixelFormat")), func, attribs); + (NSAlloc((id)objc_getClass("NSOpenGLPixelFormat")), func, attribs); } NSOpenGLView* NSOpenGLView_initWithFrame(NSRect frameRect, uint32_t* format) { void* func = sel_registerName("initWithFrame:pixelFormat:"); return (NSOpenGLView*) ((id(*)(id, SEL, NSRect, uint32_t*))objc_msgSend) - (NSAlloc(objc_getClass("NSOpenGLView")), func, frameRect, format); + (NSAlloc((id)objc_getClass("NSOpenGLView")), func, frameRect, format); } void NSCursor_performSelector(NSCursor* cursor, void* selector) { @@ -1126,7 +1147,7 @@ typedef struct { i32 x, y; } RGFW_vector; } NSPasteboard* NSPasteboard_generalPasteboard(void) { - return (NSPasteboard*) objc_msgSend_id(objc_getClass("NSPasteboard"), sel_registerName("generalPasteboard")); + return (NSPasteboard*) objc_msgSend_id((id)objc_getClass("NSPasteboard"), sel_registerName("generalPasteboard")); } NSString** cstrToNSStringArray(char** strs, size_t len) { @@ -1144,27 +1165,22 @@ typedef struct { i32 x, y; } RGFW_vector; } NSArray* c_array_to_NSArray(void* array, size_t len) { - void* func = sel_registerName("initWithObjects:count:"); + SEL func = sel_registerName("initWithObjects:count:"); void* nsclass = objc_getClass("NSArray"); - - return ((id(*)(id, SEL, void*, NSUInteger))objc_msgSend) - (NSAlloc(nsclass), func, array, len); + return ((id (*)(id, SEL, void*, NSUInteger))objc_msgSend) + (NSAlloc(nsclass), func, array, len); } - + void NSregisterForDraggedTypes(void* view, NSPasteboardType* newTypes, size_t len) { - NSString** ntypes = cstrToNSStringArray(newTypes, len); - - void* func = sel_registerName("registerForDraggedTypes:"); + NSString** ntypes = cstrToNSStringArray((char**)newTypes, len); NSArray* array = c_array_to_NSArray(ntypes, len); - objc_msgSend_void_id(view, sel_registerName("registerForDraggedTypes:"), array); - NSRelease(array); } NSInteger NSPasteBoard_declareTypes(NSPasteboard* pasteboard, NSPasteboardType* newTypes, size_t len, void* owner) { - NSString** ntypes = cstrToNSStringArray(newTypes, len); + NSString** ntypes = cstrToNSStringArray((char**)newTypes, len); void* func = sel_registerName("declareTypes:owner:"); @@ -1252,13 +1268,17 @@ typedef struct { i32 x, y; } RGFW_vector; (pasteboard, func, array, options); NSRelease(array); - NSUInteger count = NSArray_count(output); const char** res = si_array_init_reserve(sizeof(const char*), count); - for (NSUInteger i = 0; i < count; i++) - res[i] = NSString_to_char(NSArray_objectAtIndex(output, i)); + void* path_func = sel_registerName("path"); + + for (NSUInteger i = 0; i < count; i++) { + void* url = NSArray_objectAtIndex(output, i); + NSString* url_str = ((id(*)(id, SEL))objc_msgSend)(url, path_func); + res[i] = NSString_to_char(url_str); + } return res; } @@ -1301,12 +1321,20 @@ typedef struct { i32 x, y; } RGFW_vector; } #endif + #ifdef RGFW_WINDOWS + __declspec(dllimport) u32 __stdcall timeBeginPeriod(u32 uPeriod); + #endif + RGFWDEF RGFW_window* RGFW_window_basic_init(RGFW_rect rect, u16 args); RGFWDEF void RGFW_init_buffer(RGFW_window* win); RGFW_window* RGFW_window_basic_init(RGFW_rect rect, u16 args) { RGFW_window* win = (RGFW_window*) RGFW_MALLOC(sizeof(RGFW_window)); /* make a new RGFW struct */ + #ifdef RGFW_WINDOWS + timeBeginPeriod(1); + #endif + #ifdef RGFW_ALLOC_DROPFILES win->event.droppedFiles = (char**) RGFW_MALLOC(sizeof(char*) * RGFW_MAX_DROPS); u32 i; @@ -1406,6 +1434,8 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.hdcMem = CreateCompatibleDC(win->src.hdc); #endif +#else +RGFW_UNUSED(win); /* if buffer rendering is not being used */ #endif } @@ -1827,9 +1857,18 @@ typedef struct { i32 x, y; } RGFW_vector; #endif #if defined(RGFW_MACOS) - u8 RGFW_keyMap[128] = { 0 }; + u8 RGFW_keyBoard[128] = { 0 }; + u8 RGFW_keyBoard_prev[128]; #endif + u8 RGFW_isHeldI(RGFW_window* win, u32 key) { + return (RGFW_isPressedI(win, key) && RGFW_wasPressedI(win, key)); + } + + u8 RGFW_isReleasedI(RGFW_window* win, u32 key) { + return (!RGFW_isPressedI(win, key) && RGFW_wasPressedI(win, key)); + } + char* RGFW_keyCodeTokeyStr(u64 key) { #if defined(RGFW_MACOS) static char* keyStrs[128] = { "a", "s", "d", "f", "h", "g", "z", "x", "c", "v", "0", "b", "q", "w", "e", "r", "y", "t", "1", "2", "3", "4", "6", "5", "Equals", "9", "7", "Minus", "8", "0", "CloseBracket", "o", "u", "Bracket", "i", "p", "Return", "l", "j", "Apostrophe", "k", "Semicolon", "BackSlash", "Comma", "Slash", "n", "m", "Period", "Tab", "Space", "Backtick", "BackSpace", "0", "Escape", "0", "Super", "Shift", "CapsLock", "Alt", "Control", "0", "0", "0", "0", "0", "KP_Period", "0", "KP_Minus", "0", "0", "0", "0", "Numlock", "0", "0", "0", "KP_Multiply", "KP_Return", "0", "0", "0", "0", "KP_Slash", "KP_0", "KP_1", "KP_2", "KP_3", "KP_4", "KP_5", "KP_6", "KP_7", "0", "KP_8", "KP_9", "0", "0", "0", "F5", "F6", "F7", "F3", "F8", "F9", "0", "F11", "0", "F13", "0", "F14", "0", "F10", "0", "F12", "0", "F15", "Insert", "Home", "PageUp", "Delete", "F4", "End", "F2", "PageDown", "Left", "Right", "Down", "Up", "F1" }; @@ -1998,12 +2037,14 @@ typedef struct { i32 x, y; } RGFW_vector; u32 RGFW_isPressedJS(RGFW_window* win, u16 c, u8 button) { return win->src.jsPressed[c][button]; } #else - typedef DWORD (WINAPI * PFN_XInputGetState)(DWORD,XINPUT_STATE*); + typedef u64 (WINAPI * PFN_XInputGetState)(DWORD,XINPUT_STATE*); PFN_XInputGetState XInputGetStateSRC = NULL; #define XInputGetState XInputGetStateSRC static HMODULE RGFW_XInput_dll = NULL; u32 RGFW_isPressedJS(RGFW_window* win, u16 c, u8 button) { + RGFW_UNUSED(win) + XINPUT_STATE state; if (XInputGetState == NULL || XInputGetState(c, &state) == ERROR_DEVICE_NOT_CONNECTED) return 0; @@ -2027,9 +2068,15 @@ typedef struct { i32 x, y; } RGFW_vector; } #endif -#ifdef RGFW_OPENGL +#if defined(RGFW_OPENGL) || defined(RGFW_EGL) i32 RGFW_majorVersion = 0, RGFW_minorVersion = 0; + + #ifndef RGFW_EGL i32 RGFW_STENCIL = 8, RGFW_SAMPLES = 4, RGFW_STEREO = GL_FALSE, RGFW_AUX_BUFFERS = 0; + #else + i32 RGFW_STENCIL = 0, RGFW_SAMPLES = 0, RGFW_STEREO = GL_FALSE, RGFW_AUX_BUFFERS = 0; + #endif + void RGFW_setGLStencil(i32 stencil) { RGFW_STENCIL = stencil; } void RGFW_setGLSamples(i32 samples) { RGFW_SAMPLES = samples; } @@ -2041,7 +2088,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_minorVersion = minor; } - u8* RGFW_getMaxGLVersion() { + u8* RGFW_getMaxGLVersion(void) { RGFW_window* dummy = RGFW_createWindow("dummy", RGFW_RECT(0, 0, 1, 1), 0); const char* versionStr = (const char*) glGetString(GL_VERSION); @@ -2055,6 +2102,8 @@ typedef struct { i32 x, y; } RGFW_vector; return version; } +#ifndef RGFW_EGL + #define RGFW_GL_RENDER_TYPE RGFW_OS_BASED_VALUE(GLX_X_VISUAL_TYPE, 0x2003, 73) #define RGFW_GL_ALPHA_SIZE RGFW_OS_BASED_VALUE(GLX_ALPHA_SIZE, 0x201b, 11) #define RGFW_GL_DEPTH_SIZE RGFW_OS_BASED_VALUE(GLX_DEPTH_SIZE, 0x2022, 12) @@ -2087,6 +2136,7 @@ typedef struct { i32 x, y; } RGFW_vector; #endif static u32* RGFW_initAttribs(u32 useSoftware) { + RGFW_UNUSED(useSoftware); static u32 attribs[] = { #ifndef RGFW_MACOS RGFW_GL_RENDER_TYPE, @@ -2165,9 +2215,9 @@ typedef struct { i32 x, y; } RGFW_vector; return attribs; } -#endif +#else -#ifdef RGFW_EGL +#include #if defined(RGFW_LINK_EGL) typedef EGLBoolean(EGLAPIENTRY* PFN_eglInitialize)(EGLDisplay, EGLint*, EGLint*); @@ -2202,8 +2252,8 @@ typedef struct { i32 x, y; } RGFW_vector; #endif -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30fb +#define EGL_SURFACE_MAJOR_VERSION_KHR 0x3098 +#define EGL_SURFACE_MINOR_VERSION_KHR 0x30fb #ifndef RGFW_GL_ADD_ATTRIB #define RGFW_GL_ADD_ATTRIB(attrib, attVal) \ @@ -2214,9 +2264,8 @@ typedef struct { i32 x, y; } RGFW_vector; } #endif - void RGFW_createOpenGLContext(RGFW_window* win) { - static EGLContext globalCtx = EGL_NO_CONTEXT; + void RGFW_createOpenGLContext(RGFW_window* win) { #if defined(RGFW_LINK_EGL) eglInitializeSource = (PFNEGLINITIALIZEPROC) eglGetProcAddress("eglInitialize"); eglGetConfigsSource = (PFNEGLGETCONFIGSPROC) eglGetProcAddress("eglGetConfigs"); @@ -2233,69 +2282,101 @@ typedef struct { i32 x, y; } RGFW_vector; eglDestroySurfaceSource = (PFNEGLDESTROYSURFACEPROC) eglGetProcAddress("eglDestroySurface"); #endif /* RGFW_LINK_EGL */ + #ifdef RGFW_WINDOWS + win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.hdc); + #else win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.display); + #endif EGLint major, minor; eglInitialize(win->src.EGL_display, &major, &minor); - EGLint config_attribs[] = { + #ifndef EGL_OPENGL_ES1_BIT + #define EGL_OPENGL_ES1_BIT 0x1 + #endif + + EGLint egl_config[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDERABLE_TYPE, #ifdef RGFW_OPENGL_ES1 EGL_OPENGL_ES1_BIT, - #endif - #ifdef RGFW_OPENGL_ES2 + #elif defined(RGFW_OPENGL_ES3) + EGL_OPENGL_ES3_BIT, + #elif defined(RGFW_OPENGL_ES2) EGL_OPENGL_ES2_BIT, #else EGL_OPENGL_BIT, #endif - EGL_NONE + EGL_NONE, EGL_NONE }; EGLConfig config; - EGLint num_configs; - eglChooseConfig(win->src.EGL_display, config_attribs, &config, 1, &num_configs); + EGLint numConfigs; + eglChooseConfig(win->src.EGL_display, egl_config, &config, 1, &numConfigs); -#if defined(RGFW_OPENGL_ES2) || defined(RGFW_OPENGL_ES1) - eglBindAPI(EGL_OPENGL_ES_API); -#else - eglBindAPI(EGL_OPENGL_API); -#endif - EGLint attribs[]{ - EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT, - 0, 0, 0, 0 + win->src.EGL_surface = eglCreateWindowSurface(win->src.EGL_display, config, (EGLNativeWindowType) win->src.window, NULL); + + EGLint attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, + #ifdef RGFW_OPENGL_ES1 + 1, + #else + 2, + #endif + EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE }; - size_t index = 2; + size_t index = 4; RGFW_GL_ADD_ATTRIB(EGL_STENCIL_SIZE, RGFW_STENCIL); RGFW_GL_ADD_ATTRIB(EGL_SAMPLES, RGFW_SAMPLES); - RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MAJOR_VERSION, RGFW_majorVersion); - RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MINOR_VERSION, RGFW_minorVersion); - win->src.rSurf = eglCreateContext(win->src.EGL_display, config, globalCtx, attribs); - win->src.EGL_surface = eglCreateWindowSurface(win->src.EGL_display, config, (EGLNativeWindowType) win->src.window, NULL); + if (RGFW_majorVersion) { + attribs[1] = RGFW_majorVersion; + RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT); + RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MAJOR_VERSION, RGFW_majorVersion); + RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MINOR_VERSION, RGFW_minorVersion); + } - if (globalCtx == EGL_NO_CONTEXT) - RGFW_EGLglobalContext = win->src.rSurf; + #if defined(RGFW_OPENGL_ES1) || defined(RGFW_OPENGL_ES2) || defined(RGFW_OPENGL_ES3) + eglBindAPI(EGL_OPENGL_ES_API); + #else + eglBindAPI(EGL_OPENGL_API); + #endif - eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.rSurf); - eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); + win->src.EGL_context = eglCreateContext(win->src.EGL_display, config, EGL_NO_CONTEXT, attribs); - eglSwapInterval(win->src.EGL_display, 1); + eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.EGL_context); + eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); } - void* RGFW_getProcAddress(const char* procname) { return (void*) eglGetProcAddress(procname); } + #ifdef RGFW_APPLE + void* RGFWnsglFramework = NULL; + #elif defined(RGFW_WINDOWS) + static HMODULE wglinstance = NULL; + #endif + + void* RGFW_getProcAddress(const char* procname) { + #if defined(RGFW_WINDOWS) + void* proc = (void*) GetProcAddress(wglinstance, procname); + + if (proc) + return proc; + #endif + + return (void*) eglGetProcAddress(procname); + } void RGFW_closeEGL(RGFW_window* win) { eglDestroySurface(win->src.EGL_display, win->src.EGL_surface); - eglDestroyContext(win->src.EGL_display, win->src.rSurf); + eglDestroyContext(win->src.EGL_display, win->src.EGL_context); eglTerminate(win->src.EGL_display); } #endif /* RGFW_EGL */ +#endif /* RGFW_GL stuff? */ /* This is where OS specific stuff starts @@ -2388,7 +2469,7 @@ typedef struct { i32 x, y; } RGFW_vector; } u32 i; - for (i = 0; i < fbcount; i++) { + for (i = 0; i < (u32)fbcount; i++) { XVisualInfo* vi = glXGetVisualFromFBConfig((Display*) win->src.display, fbc[i]); if (vi == NULL) continue; @@ -2398,8 +2479,9 @@ typedef struct { i32 x, y; } RGFW_vector; i32 samp_buf, samples; glXGetFBConfigAttrib((Display*) win->src.display, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf); glXGetFBConfigAttrib((Display*) win->src.display, fbc[i], GLX_SAMPLES, &samples); - if ((best_fbc < 0 || samp_buf) && (samples == RGFW_SAMPLES)) + if ((best_fbc < 0 || samp_buf) && (samples == RGFW_SAMPLES || best_fbc == -1)) { best_fbc = i; + } } if (best_fbc == -1) { @@ -2471,11 +2553,6 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.rSurf = glXCreateContextAttribsARB((Display*) win->src.display, bestFbc, ctx, True, context_attribs); #endif - -#ifdef RGFW_EGL - RGFW_createOpenGLContext(win); -#endif - if (RGFW_root == NULL) RGFW_root = win; @@ -2558,6 +2635,10 @@ typedef struct { i32 x, y; } RGFW_vector; PropModeReplace, (u8*) &version, 1); /* turns on drag and drop */ } + #ifdef RGFW_EGL + RGFW_createOpenGLContext(win); + #endif + RGFW_window_setMouseDefault(win); RGFW_windowsOpen++; @@ -2593,9 +2674,11 @@ typedef struct { i32 x, y; } RGFW_vector; int xAxis = 0, yAxis = 0; + char RGFW_keyboard[32]; + char RGFW_keyboard_prev[32]; + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { assert(win != NULL); - win->event.type = 0; #ifdef __linux__ @@ -2650,13 +2733,6 @@ typedef struct { i32 x, y; } RGFW_vector; } u32 i; - - if (win->event.droppedFilesCount) { - for (i = 0; i < win->event.droppedFilesCount; i++) - win->event.droppedFiles[i][0] = '\0'; - } - - win->event.droppedFilesCount = 0; win->event.type = 0; @@ -2676,6 +2752,11 @@ typedef struct { i32 x, y; } RGFW_vector; win->event.keyCode = XkbKeycodeToKeysym((Display*) win->src.display, E.xkey.keycode, 0, E.xkey.state & ShiftMask ? 1 : 0); win->event.keyName = XKeysymToString(win->event.keyCode); /* convert to string */ + if (RGFW_isPressedI(win, win->event.keyCode)) + RGFW_keyboard_prev[E.xkey.keycode >> 3] |= (1 << (E.xkey.keycode & 7)); + else + RGFW_keyboard_prev[E.xkey.keycode >> 3] |= 0; + /* get keystate data */ win->event.type = (E.type == KeyPress) ? RGFW_keyPressed : RGFW_keyReleased; @@ -2690,6 +2771,8 @@ typedef struct { i32 x, y; } RGFW_vector; else if (win->event.keyCode == XK_Num_Lock) win->event.lockState |= RGFW_NUMLOCK; } + + XQueryKeymap(win->src.display, RGFW_keyboard); /* query the keymap */ break; case ButtonPress: @@ -2718,6 +2801,14 @@ typedef struct { i32 x, y; } RGFW_vector; win->event.type = RGFW_quit; break; } + + /* reset DND values */ + if (win->event.droppedFilesCount) { + for (i = 0; i < win->event.droppedFilesCount; i++) + win->event.droppedFiles[i][0] = '\0'; + } + + win->event.droppedFilesCount = 0; /* much of this event (drag and drop code) is source from glfw @@ -3002,13 +3093,13 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.winArgs &= ~RGFW_MOUSE_CHANGED; } - if (win->src.winArgs & RGFW_HOLD_MOUSE && win->event.inFocus && win->event.type == RGFW_mousePosChanged) { - RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); - - if (XEventsQueued((Display*) win->src.display, QueuedAfterReading) <= 1) - XSync(win->src.display, True); - } + if (win->src.winArgs & RGFW_HOLD_MOUSE && win->event.inFocus && win->event.type == RGFW_mousePosChanged) { + RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + if (XEventsQueued((Display*) win->src.display, QueuedAfterReading) <= 1) + XSync(win->src.display, True); + } + XFlush((Display*) win->src.display); @@ -3022,7 +3113,7 @@ typedef struct { i32 x, y; } RGFW_vector; assert(win != NULL); #ifdef RGFW_VULKAN - for (int i = 0; i < win->src.image_count; i++) { + for (u32 i = 0; i < win->src.image_count; i++) { vkDestroyImageView(RGFW_vulkan_info.device, win->src.swapchain_image_views[i], NULL); } @@ -3212,7 +3303,7 @@ typedef struct { i32 x, y; } RGFW_vector; #ifndef RGFW_NO_X11_CURSOR /* free the previous cursor */ - if (win->src.cursor && win->src.cursor != -1) + if (win->src.cursor) XFreeCursor((Display*) win->src.display, (Cursor) win->src.cursor); XcursorImage* native = XcursorImageCreate(a.w, a.h); @@ -3235,6 +3326,8 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.cursor = XcursorImageLoadCursor((Display*) win->src.display, native); XcursorImageDestroy(native); +#else + RGFW_UNUSED(image) RGFW_UNUSED(a.w) RGFW_UNUSED(channels) #endif } @@ -3256,7 +3349,7 @@ typedef struct { i32 x, y; } RGFW_vector; } RGFWDEF void RGFW_window_disableMouse(RGFW_window* win) { - + RGFW_UNUSED(win); } void RGFW_window_setMouseDefault(RGFW_window* win) { @@ -3267,7 +3360,7 @@ typedef struct { i32 x, y; } RGFW_vector; assert(win != NULL); /* free the previous cursor */ - if (win->src.cursor && win->src.cursor != -1) + if (win->src.cursor) XFreeCursor((Display*) win->src.display, (Cursor) win->src.cursor); win->src.winArgs |= RGFW_MOUSE_CHANGED; @@ -3615,7 +3708,7 @@ typedef struct { i32 x, y; } RGFW_vector; monitor.physW = (monitor.rect.w * 25.4f / 96.f); monitor.physH = (monitor.rect.h * 25.4f / 96.f); - strncpy(monitor.name, DisplayString(display), 128); + strcpy(monitor.name, DisplayString(display)); XGetSystemContentScale(display, &monitor.scaleX, &monitor.scaleY); @@ -3648,7 +3741,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_monitor RGFW_monitors[6]; RGFW_monitor* RGFW_getMonitors(void) { size_t i; - for (i = 0; i < ScreenCount(RGFW_root->src.display) && i < 6; i++) + for (i = 0; i < (size_t)ScreenCount(RGFW_root->src.display) && i < 6; i++) RGFW_monitors[i] = RGFW_XCreateMonitor(i); return RGFW_monitors; @@ -3684,9 +3777,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_monitor RGFW_window_getMonitor(RGFW_window* win) { return RGFW_XCreateMonitor(DefaultScreen(win->src.display)); } - - char keyboard[32]; - + u8 RGFW_isPressedI(RGFW_window* win, u32 key) { Display* d; if (win == (RGFW_window*) 0) @@ -3695,11 +3786,22 @@ typedef struct { i32 x, y; } RGFW_vector; return 0; else d = (Display*) win->src.display; + + KeyCode kc2 = XKeysymToKeycode(d, key); /* convert the key to a keycode */ + return (RGFW_keyboard[kc2 >> 3] & (1 << (kc2 & 7))); /* check if the key is pressed */ + } - XQueryKeymap(d, keyboard); /* query the keymap */ - + u8 RGFW_wasPressedI(RGFW_window* win, u32 key) { + Display* d; + if (win == (RGFW_window*) 0) + d = RGFW_root->src.display; + else if (!win->event.inFocus) + return 0; + else + d = (Display*) win->src.display; + KeyCode kc2 = XKeysymToKeycode(d, key); /* convert the key to a keycode */ - return !!(keyboard[kc2 >> 3] & (1 << (kc2 & 7))); /* check if the key is pressed */ + return !!(RGFW_keyboard_prev[kc2 >> 3] & (1 << (kc2 & 7))); /* check if the key is pressed */ } #endif @@ -3742,8 +3844,8 @@ typedef struct { i32 x, y; } RGFW_vector; void* RGFWjoystickApi = NULL; /* these two wgl functions need to be preloaded */ - typedef HGLRC(WINAPI* wglCreateContextAttribsARB_type)(HDC hdc, HGLRC hShareContext, - const i32* attribList); + typedef long long int (WINAPI* wglCreateContextAttribsARB_type)(HDC hdc, HGLRC hShareContext, + const int* attribList); wglCreateContextAttribsARB_type wglCreateContextAttribsARB = NULL; /* defines for creating ARB attributes */ @@ -3785,7 +3887,9 @@ typedef struct { i32 x, y; } RGFW_vector; #define WGL_SAMPLES_ARB 0x2042 #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20a9 +#ifndef RGFW_EGL static HMODULE wglinstance = NULL; +#endif #ifdef RGFW_WGL_LOAD typedef HGLRC(WINAPI* PFN_wglCreateContext)(HDC); @@ -3802,13 +3906,13 @@ static HMODULE wglinstance = NULL; PFN_wglGetCurrentDC wglGetCurrentDCSRC; PFN_wglGetCurrentContext wglGetCurrentContextSRC; -#define wglCreateContext wglCreateContextSRC -#define wglDeleteContext wglDeleteContextSRC -#define wglGetProcAddress wglGetProcAddressSRC -#define wglMakeCurrent wglMakeCurrentSRC + #define wglCreateContext wglCreateContextSRC + #define wglDeleteContext wglDeleteContextSRC + #define wglGetProcAddress wglGetProcAddressSRC + #define wglMakeCurrent wglMakeCurrentSRC -#define wglGetCurrentDC wglGetCurrentDCSRC -#define wglGetCurrentContext wglGetCurrentContextSRC + #define wglGetCurrentDC wglGetCurrentDCSRC + #define wglGetCurrentContext wglGetCurrentContextSRC #endif #ifdef RGFW_OPENGL @@ -3820,11 +3924,11 @@ static HMODULE wglinstance = NULL; return (void*) GetProcAddress(wglinstance, procname); } - typedef BOOL(APIENTRY* PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats); + typedef u64 (APIENTRY* PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats); static PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = NULL; #endif - RGFW_window RGFW_eventWindow = { {NULL} }; + RGFW_window RGFW_eventWindow; LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -3845,7 +3949,7 @@ static HMODULE wglinstance = NULL; #ifndef RGFW_NO_DPI static HMODULE RGFW_Shcore_dll = NULL; - typedef HRESULT (WINAPI * PFN_GetDpiForMonitor)(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*); + typedef u64 (WINAPI * PFN_GetDpiForMonitor)(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*); PFN_GetDpiForMonitor GetDpiForMonitorSRC = NULL; #define GetDpiForMonitor GetDpiForMonitorSRC #endif @@ -3898,6 +4002,7 @@ static HMODULE wglinstance = NULL; if (name[0] == 0) name = (char*) " "; RGFW_eventWindow.r = RGFW_RECT(-1, -1, -1, -1); + RGFW_eventWindow.src.window = NULL; RGFW_window* win = RGFW_window_basic_init(rect, args); @@ -4036,7 +4141,7 @@ static HMODULE wglinstance = NULL; ReleaseDC(dummyWin, dummy_dc); if (wglCreateContextAttribsARB != NULL) { - PIXELFORMATDESCRIPTOR pfd = { sizeof(pfd), 1, PFD_TYPE_RGBA, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, 32, 8, PFD_MAIN_PLANE, 24, 8 }; + PIXELFORMATDESCRIPTOR pfd = (PIXELFORMATDESCRIPTOR){ sizeof(pfd), 1, PFD_TYPE_RGBA, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, 32, 8, PFD_MAIN_PLANE, 24, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (args & RGFW_OPENGL_SOFTWARE) pfd.dwFlags |= PFD_GENERIC_FORMAT | PFD_GENERIC_ACCELERATED; @@ -4059,15 +4164,15 @@ static HMODULE wglinstance = NULL; u32 index = 0; i32 attribs[40]; -#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 - SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB); + + SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB); if (RGFW_majorVersion || RGFW_minorVersion) { SET_ATTRIB(WGL_CONTEXT_MAJOR_VERSION_ARB, RGFW_majorVersion); SET_ATTRIB(WGL_CONTEXT_MINOR_VERSION_ARB, RGFW_minorVersion); } - SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB); + SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB); if (RGFW_majorVersion || RGFW_minorVersion) { SET_ATTRIB(WGL_CONTEXT_MAJOR_VERSION_ARB, RGFW_majorVersion); @@ -4076,7 +4181,7 @@ static HMODULE wglinstance = NULL; SET_ATTRIB(0, 0); - win->src.rSurf = wglCreateContextAttribsARB(win->src.hdc, NULL, attribs); + win->src.rSurf = (HGLRC)wglCreateContextAttribsARB(win->src.hdc, NULL, attribs); } else { fprintf(stderr, "Failed to create an accelerated OpenGL Context\n"); @@ -4293,6 +4398,9 @@ static HMODULE wglinstance = NULL; return 0; } + BYTE RGFW_keyBoard[256]; + BYTE RGFW_keyBoard_prev[256]; + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { assert(win != NULL); @@ -4317,14 +4425,6 @@ static HMODULE wglinstance = NULL; return &win->event; } - if (win->event.droppedFilesCount) { - u32 i; - for (i = 0; i < win->event.droppedFilesCount; i++) - win->event.droppedFiles[i][0] = '\0'; - } - - win->event.droppedFilesCount = 0; - win->event.inFocus = (GetForegroundWindow() == win->src.window); if (RGFW_checkXInput(&win->event)) @@ -4334,7 +4434,6 @@ static HMODULE wglinstance = NULL; return NULL; static BYTE keyboardState[256]; - GetKeyboardState(keyboardState); if (PeekMessageA(&msg, win->src.window, 0u, 0u, PM_REMOVE)) { switch (msg.message) { @@ -4345,24 +4444,37 @@ static HMODULE wglinstance = NULL; case WM_KEYUP: win->event.keyCode = (u32) msg.wParam; + if (RGFW_isPressedI(win, win->event.keyCode)) + RGFW_keyBoard_prev[win->event.keyCode] |= 0x80; + else + RGFW_keyBoard_prev[win->event.keyCode] = 0; + strncpy(win->event.keyName, RGFW_keyCodeTokeyStr(msg.lParam), 16); - if (GetKeyState(VK_SHIFT) & 0x8000) { + if (RGFW_isPressedI(win, VK_SHIFT)) { ToAscii((UINT) msg.wParam, MapVirtualKey((UINT) msg.wParam, MAPVK_VK_TO_CHAR), keyboardState, (LPWORD) win->event.keyName, 0); } win->event.type = RGFW_keyReleased; + GetKeyboardState(RGFW_keyBoard); break; case WM_KEYDOWN: win->event.keyCode = (u32) msg.wParam; + + if (RGFW_isPressedI(win, win->event.keyCode)) + RGFW_keyBoard_prev[win->event.keyCode] |= 0x80; + else + RGFW_keyBoard_prev[win->event.keyCode] = 0; + strncpy(win->event.keyName, RGFW_keyCodeTokeyStr(msg.lParam), 16); - if (GetKeyState(VK_SHIFT) & 0x8000) { + if (RGFW_isPressedI(win, VK_SHIFT) & 0x8000) { ToAscii((UINT) msg.wParam, MapVirtualKey((UINT) msg.wParam, MAPVK_VK_TO_CHAR), keyboardState, (LPWORD) win->event.keyName, 0); } win->event.type = RGFW_keyPressed; + GetKeyboardState(RGFW_keyBoard); break; case WM_MOUSEMOVE: @@ -4413,6 +4525,15 @@ static HMODULE wglinstance = NULL; much of this event is source from glfw */ case WM_DROPFILES: { + + if (win->event.droppedFilesCount) { + u32 i; + for (i = 0; i < win->event.droppedFilesCount; i++) + win->event.droppedFiles[i][0] = '\0'; + } + + win->event.droppedFilesCount = 0; + win->event.type = RGFW_dnd; HDROP drop = (HDROP) msg.wParam; @@ -4522,6 +4643,9 @@ static HMODULE wglinstance = NULL; typedef struct { int iIndex; HMONITOR hMonitor; } RGFW_mInfo; BOOL CALLBACK GetMonitorByHandle(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { + RGFW_UNUSED(hdcMonitor) + RGFW_UNUSED(lprcMonitor) + RGFW_mInfo* info = (RGFW_mInfo*) dwData; if (info->hMonitor == hMonitor) return FALSE; @@ -4586,6 +4710,9 @@ static HMODULE wglinstance = NULL; RGFW_monitor RGFW_monitors[6]; BOOL CALLBACK GetMonitorHandle(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { + RGFW_UNUSED(hdcMonitor) + RGFW_UNUSED(lprcMonitor) + RGFW_mInfo* info = (RGFW_mInfo*) dwData; if (info->iIndex >= 6) @@ -4618,9 +4745,20 @@ static HMODULE wglinstance = NULL; if (win != NULL && !win->event.inFocus) return 0; - if (GetAsyncKeyState(key) & 0x8000) + if (RGFW_keyBoard[key] & 0x80) return 1; - else return 0; + + return 0; + } + + u8 RGFW_wasPressedI(RGFW_window* win, u32 key) { + if (win != NULL && !win->event.inFocus) + return 0; + + if (RGFW_keyBoard_prev[key] & 0x80) + return 1; + + return 0; } HICON RGFW_loadHandleImage(RGFW_window* win, u8* src, RGFW_area a, BOOL icon) { @@ -4684,6 +4822,7 @@ static HMODULE wglinstance = NULL; void RGFW_window_setMouse(RGFW_window* win, u8* image, RGFW_area a, i32 channels) { assert(win != NULL); + RGFW_UNUSED(channels) HCURSOR cursor = (HCURSOR) RGFW_loadHandleImage(win, image, a, FALSE); SetClassLongPtrA(win->src.window, GCLP_HCURSOR, (LPARAM) cursor); @@ -4824,6 +4963,7 @@ static HMODULE wglinstance = NULL; /* much of this function is sourced from GLFW */ void RGFW_window_setIcon(RGFW_window* win, u8* src, RGFW_area a, i32 channels) { assert(win != NULL); + RGFW_UNUSED(channels) HICON handle = RGFW_loadHandleImage(win, src, a, TRUE); @@ -4900,12 +5040,14 @@ static HMODULE wglinstance = NULL; u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { assert(win != NULL); + RGFW_UNUSED(jsNumber) + return RGFW_registerJoystickF(win, (char*) ""); } u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { assert(win != NULL); - + RGFW_UNUSED(file) return win->src.joystickCount - 1; } @@ -4936,7 +5078,7 @@ static HMODULE wglinstance = NULL; } #ifndef RGFW_NO_THREADS - RGFW_thread RGFW_createThread(void* (*function_ptr)(void*), void* args) { return CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) *function_ptr, args, 0, NULL); } + RGFW_thread RGFW_createThread(RGFW_threadFunc_ptr ptr, void* args) { return CreateThread(NULL, 0, ptr, args, 0, NULL); } void RGFW_cancelThread(RGFW_thread thread) { CloseHandle((HANDLE) thread); } void RGFW_joinThread(RGFW_thread thread) { WaitForSingleObject((HANDLE) thread, INFINITE); } void RGFW_setThreadPriority(RGFW_thread thread, u8 priority) { SetThreadPriority((HANDLE) thread, priority); } @@ -4962,7 +5104,10 @@ static HMODULE wglinstance = NULL; } #endif - CVReturn displayCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* inNow, const CVTimeStamp* inOutputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { return kCVReturnSuccess; } + CVReturn displayCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* inNow, const CVTimeStamp* inOutputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { + RGFW_UNUSED(displayLink) RGFW_UNUSED(inNow) RGFW_UNUSED(inOutputTime) RGFW_UNUSED(flagsIn) RGFW_UNUSED(flagsOut) RGFW_UNUSED(displayLinkContext) + return kCVReturnSuccess; + } RGFW_window* RGFW_windows[10]; u32 RGFW_windows_size = 0; @@ -4983,17 +5128,25 @@ static HMODULE wglinstance = NULL; } /* NOTE(EimaMei): Fixes the constant clicking when the app is running under a terminal. */ - bool acceptsFirstResponder() { return true; } - bool performKeyEquivalent(NSEvent* event) { return true; } + bool acceptsFirstResponder(void) { return true; } + bool performKeyEquivalent(NSEvent* event) { RGFW_UNUSED(event); return true; } - NSDragOperation draggingEntered(id self, SEL sel, id sender) { return NSDragOperationCopy; } - NSDragOperation draggingUpdated(id self, SEL sel, id sender) { return NSDragOperationCopy; } + NSDragOperation draggingEntered(id self, SEL sel, id sender) { + RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + return NSDragOperationCopy; + } + NSDragOperation draggingUpdated(id self, SEL sel, id sender) { + RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + return NSDragOperationCopy; + } bool prepareForDragOperation(void) { return true; } - void RGFW__osxDraggingEnded(id self, SEL sel, id sender) { return; } + void RGFW__osxDraggingEnded(id self, SEL sel, id sender) { RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); return; } /* NOTE(EimaMei): Usually, you never need 'id self, SEL cmd' for C -> Obj-C methods. This isn't the case. */ bool performDragOperation(id self, SEL sel, id sender) { + RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + NSWindow* window = objc_msgSend_id(sender, sel_registerName("draggingDestinationWindow")); u32 i; bool found = false; @@ -5007,10 +5160,10 @@ static HMODULE wglinstance = NULL; if (!found) i = 0; - Class* array[] = { objc_getClass("NSURL"), NULL }; - char** droppedFiles = (char**) NSPasteboard_readObjectsForClasses( - (NSPasteboard*) objc_msgSend_id(sender, sel_registerName("draggingPasteboard")), - array, 1, NULL); + Class array[] = { objc_getClass("NSURL"), NULL }; + NSPasteboard* pasteBoard = objc_msgSend_id(sender, sel_registerName("draggingPasteboard")); + + char** droppedFiles = (char**) NSPasteboard_readObjectsForClasses(pasteBoard, array, 1, NULL); RGFW_windows[i]->event.droppedFilesCount = si_array_len(droppedFiles); @@ -5020,11 +5173,12 @@ static HMODULE wglinstance = NULL; strcpy(RGFW_windows[i]->event.droppedFiles[y], droppedFiles[y]); RGFW_windows[i]->event.type = RGFW_dnd; + RGFW_windows[i]->src.dndPassed = false; - NSPoint p = *(NSPoint*) objc_msgSend_id(sender, sel_registerName("draggingLocation")); - RGFW_windows[i]->event.point.x = p.x; - RGFW_windows[i]->event.point.x = p.y; + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(sender, sel_registerName("draggingLocation")); + RGFW_windows[i]->event.point.x = (i32)p.x; + RGFW_windows[i]->event.point.x = (i32)p.y; return true; } @@ -5059,6 +5213,8 @@ static HMODULE wglinstance = NULL; NSSize RGFW__osxWindowResize(void* self, SEL sel, NSSize frameSize) { + RGFW_UNUSED(sel); + u32 i; for (i = 0; i < RGFW_windows_size; i++) { if (RGFW_windows[i] && NSWindow_delegate(RGFW_windows[i]) == self) { @@ -5074,6 +5230,8 @@ static HMODULE wglinstance = NULL; } void RGFW__osxWindowMove(void* self, SEL sel) { + RGFW_UNUSED(sel); + u32 i; for (i = 0; i < RGFW_windows_size; i++) { if (RGFW_windows[i] && NSWindow_delegate(RGFW_windows[i]) == self) { @@ -5093,8 +5251,8 @@ static HMODULE wglinstance = NULL; #define APPKIT_EXTERN extern #endif - APPKIT_EXTERN NSPasteboardType const NSPasteboardTypeURL = "public.url"; API_AVAILABLE(macos(10.13)); // Equivalent to kUTTypeURL - APPKIT_EXTERN NSPasteboardType const NSPasteboardTypeFileURL = "public.file-url"; API_AVAILABLE(macos(10.13)); // Equivalent to kUTTypeFileURL + NSPasteboardType const NSPasteboardTypeURL = "public.url"; + NSPasteboardType const NSPasteboardTypeFileURL = "public.file-url"; RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { static u8 RGFW_loaded = 0; @@ -5109,7 +5267,7 @@ static HMODULE wglinstance = NULL; si_func_to_SEL("NSWindow", performKeyEquivalent); if (NSApp == NULL) { - NSApp = objc_msgSend_id(objc_getClass("NSApplication"), sel_registerName("sharedApplication")); + NSApp = objc_msgSend_id((id)objc_getClass("NSApplication"), sel_registerName("sharedApplication")); ((void (*)(id, SEL, NSUInteger))objc_msgSend) (NSApp, sel_registerName("setActivationPolicy:"), NSApplicationActivationPolicyRegular); @@ -5164,7 +5322,7 @@ static HMODULE wglinstance = NULL; #else NSRect contentRect = NSMakeRect(0, 0, win->r.w, win->r.h); win->src.view = ((id(*)(id, SEL, NSRect))objc_msgSend) - (NSAlloc(objc_getClass("NSView")), sel_registerName("initWithFrame:"), + (NSAlloc((id)objc_getClass("NSView")), sel_registerName("initWithFrame:"), contentRect); #endif @@ -5193,7 +5351,7 @@ static HMODULE wglinstance = NULL; } win->src.display = CGMainDisplayID(); - CVDisplayLinkCreateWithCGDisplay(win->src.display, &win->src.displayLink); + CVDisplayLinkCreateWithCGDisplay(win->src.display, (CVDisplayLinkRef*)&win->src.displayLink); CVDisplayLinkSetOutputCallback(win->src.displayLink, displayCallback, win); CVDisplayLinkStart(win->src.displayLink); @@ -5213,35 +5371,17 @@ static HMODULE wglinstance = NULL; NSMoveToResourceDir(); Class delegateClass = objc_allocateClassPair(objc_getClass("NSObject"), "WindowDelegate", 0); + + class_addMethod(delegateClass, sel_registerName("windowWillResize:toSize:"), (IMP) RGFW__osxWindowResize, "{NSSize=ff}@:{NSSize=ff}"); class_addMethod(delegateClass, sel_registerName("windowWillMove:"), (IMP) RGFW__osxWindowMove, ""); class_addMethod(delegateClass, sel_registerName("windowDidMove:"), (IMP) RGFW__osxWindowMove, ""); - - - if (args & RGFW_ALLOW_DND) { - win->src.winArgs |= RGFW_ALLOW_DND; - -/* - NSPasteboardType types[] = {NSPasteboardTypeURL, NSPasteboardTypeFileURL, NSPasteboardTypeString}; - - siArray(NSPasteboardType) array = sic_arrayInit(types, sizeof(id), countof(types)); - NSWindow_registerForDraggedTypes(win->hwnd, array); - - win->dndHead = win->dndPrev = out; -*/ - - NSPasteboardType array[] = {NSPasteboardTypeURL, NSPasteboardTypeFileURL, NSPasteboardTypeString}; - NSregisterForDraggedTypes(win->src.window, array, 3); - - /* NOTE(EimaMei): Drag 'n Drop requires too many damn functions for just a Drag 'n Drop event. */ - class_addMethod(delegateClass, "draggingEntered:", draggingEntered, "l@:@"); - class_addMethod(delegateClass, "draggingUpdated:", draggingUpdated, "l@:@"); - class_addMethod(delegateClass, "draggingExited:", RGFW__osxDraggingEnded, "v@:@"); - class_addMethod(delegateClass, "draggingEnded:", RGFW__osxDraggingEnded, "v@:@"); - class_addMethod(delegateClass, "prepareForDragOperation:", prepareForDragOperation, "B@:@"); - class_addMethod(delegateClass, "performDragOperation:", performDragOperation, "B@:@"); - - } + class_addMethod(delegateClass, sel_registerName("draggingEntered:"), (IMP)draggingEntered, "l@:@"); + class_addMethod(delegateClass, sel_registerName("draggingUpdated:"), (IMP)draggingUpdated, "l@:@"); + class_addMethod(delegateClass, sel_registerName("draggingExited:"), (IMP)RGFW__osxDraggingEnded, "v@:@"); + class_addMethod(delegateClass, sel_registerName("draggingEnded:"), (IMP)RGFW__osxDraggingEnded, "v@:@"); + class_addMethod(delegateClass, sel_registerName("prepareForDragOperation:"), (IMP)prepareForDragOperation, "B@:@"); + class_addMethod(delegateClass, sel_registerName("performDragOperation:"), (IMP)performDragOperation, "B@:@"); id delegate = objc_msgSend_id(NSAlloc(delegateClass), sel_registerName("init")); @@ -5249,6 +5389,13 @@ static HMODULE wglinstance = NULL; objc_msgSend_void_id(win->src.window, sel_registerName("setDelegate:"), delegate); + if (args & RGFW_ALLOW_DND) { + win->src.winArgs |= RGFW_ALLOW_DND; + + NSPasteboardType types[] = {NSPasteboardTypeURL, NSPasteboardTypeFileURL, NSPasteboardTypeString}; + NSregisterForDraggedTypes(win->src.window, types, 3); + } + // Show the window ((id(*)(id, SEL, SEL))objc_msgSend)(win->src.window, sel_registerName("makeKeyAndOrderFront:"), NULL); objc_msgSend_void_bool(win->src.window, sel_registerName("setIsVisible:"), true); @@ -5259,6 +5406,8 @@ static HMODULE wglinstance = NULL; RGFW_loaded = 1; } + objc_msgSend_void(win->src.window, sel_registerName("makeKeyWindow")); + NSApplication_finishLaunching(NSApp); RGFW_windows_size++; @@ -5385,12 +5534,25 @@ static HMODULE wglinstance = NULL; }; + typedef enum NSEventModifierFlags { + NSEventModifierFlagCapsLock = 1 << 16, + NSEventModifierFlagShift = 1 << 17, + NSEventModifierFlagControl = 1 << 18, + NSEventModifierFlagOption = 1 << 19, + NSEventModifierFlagCommand = 1 << 20 + } NSEventModifierFlags; + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { assert(win != NULL); if (win->event.type == RGFW_quit) return &win->event; + if (win->event.type == RGFW_dnd && win->src.dndPassed == 0) { + win->src.dndPassed = 1; + return &win->event; + } + static void* eventFunc = NULL; if (eventFunc == NULL) eventFunc = sel_registerName("nextEventMatchingMask:untilDate:inMode:dequeue:"); @@ -5426,85 +5588,156 @@ static HMODULE wglinstance = NULL; win->event.inFocus = (bool) objc_msgSend_bool(win->src.window, sel_registerName("isKeyWindow")); switch (objc_msgSend_uint(e, sel_registerName("type"))) { - case NSEventTypeKeyDown: - win->event.type = RGFW_keyPressed; - win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - win->event.keyName = (const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); + case NSEventTypeKeyDown: + win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); + RGFW_keyBoard_prev[win->event.keyCode] = RGFW_keyBoard[win->event.keyCode]; - RGFW_keyMap[win->event.keyCode] = 1; - break; + win->event.type = RGFW_keyPressed; + win->event.keyName = (char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); - case NSEventTypeKeyUp: - win->event.type = RGFW_keyReleased; - win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - win->event.keyName = (const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); + RGFW_keyBoard[win->event.keyCode] = 1; + break; - RGFW_keyMap[win->event.keyCode] = 0; - break; + case NSEventTypeKeyUp: + win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - case NSEventTypeLeftMouseDragged: - case NSEventTypeOtherMouseDragged: - case NSEventTypeRightMouseDragged: - case NSEventTypeMouseMoved: - win->event.type = RGFW_mousePosChanged; - NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(e, sel_registerName("locationInWindow")); + RGFW_keyBoard_prev[win->event.keyCode] = RGFW_keyBoard[win->event.keyCode]; + + win->event.type = RGFW_keyReleased; + win->event.keyName = (char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); + + RGFW_keyBoard[win->event.keyCode] = 0; + break; + + case NSEventTypeFlagsChanged: { + u32 flags = objc_msgSend_uint(e, sel_registerName("modifierFlags")); + memcpy(RGFW_keyBoard_prev + 55, RGFW_keyBoard + 55, 5); - win->event.point = RGFW_VECTOR((u32) p.x, (u32) (win->r.h - p.y)); + if ((flags & NSEventModifierFlagCapsLock) && !RGFW_wasPressedI(win, 57)) { + RGFW_keyBoard[57] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 57; + break; + } if (!(flags & NSEventModifierFlagCapsLock) && RGFW_wasPressedI(win, 57)) { + RGFW_keyBoard[57] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 57; + break; + } + + if ((flags & NSEventModifierFlagOption) && !RGFW_wasPressedI(win, 58)) { + RGFW_keyBoard[58] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 58; + break; + } if (!(flags & NSEventModifierFlagOption) && RGFW_wasPressedI(win, 58)) { + RGFW_keyBoard[58] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 58; + break; + } + + if ((flags & NSEventModifierFlagControl) && !RGFW_wasPressedI(win, 59)) { + RGFW_keyBoard[59] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 59; + break; + } if (!(flags & NSEventModifierFlagControl) && RGFW_wasPressedI(win, 59)) { + RGFW_keyBoard[59] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 59; + break; + } + + if ((flags & NSEventModifierFlagCommand) && !RGFW_wasPressedI(win, 55)) { + RGFW_keyBoard[55] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 55; + break; + } if (!(flags & NSEventModifierFlagCommand) && RGFW_wasPressedI(win, 55)) { + RGFW_keyBoard[55] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 55; + break; + } - if (win->src.winArgs & RGFW_HOLD_MOUSE) { - RGFW_vector mouse = RGFW_getGlobalMousePoint(); - if ((mouse.x != win->r.x + (win->r.w / 2) || mouse.y != win->r.y + (win->r.h / 2))) { - RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + if ((flags & NSEventModifierFlagShift) && !RGFW_wasPressedI(win, 56)) { + RGFW_keyBoard[56] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 56; + break; + } if (!(flags & NSEventModifierFlagShift) && RGFW_wasPressedI(win, 56)) { + RGFW_keyBoard[56] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 56; + break; } + + break; } - break; + case NSEventTypeLeftMouseDragged: + case NSEventTypeOtherMouseDragged: + case NSEventTypeRightMouseDragged: + case NSEventTypeMouseMoved: + win->event.type = RGFW_mousePosChanged; + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(e, sel_registerName("locationInWindow")); - case NSEventTypeLeftMouseDown: - win->event.button = RGFW_mouseLeft; - win->event.type = RGFW_mouseButtonPressed; - break; + win->event.point = RGFW_VECTOR((u32) p.x, (u32) (win->r.h - p.y)); - case NSEventTypeOtherMouseDown: - win->event.button = RGFW_mouseMiddle; - win->event.type = RGFW_mouseButtonPressed; - break; + if (win->src.winArgs & RGFW_HOLD_MOUSE) { + RGFW_vector mouse = RGFW_getGlobalMousePoint(); + if ((mouse.x != win->r.x + (win->r.w / 2) || mouse.y != win->r.y + (win->r.h / 2))) { + RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + } + } + break; - case NSEventTypeRightMouseDown: - win->event.button = RGFW_mouseRight; - win->event.type = RGFW_mouseButtonPressed; - break; + case NSEventTypeLeftMouseDown: + win->event.button = RGFW_mouseLeft; + win->event.type = RGFW_mouseButtonPressed; + break; - case NSEventTypeLeftMouseUp: - win->event.button = RGFW_mouseLeft; - win->event.type = RGFW_mouseButtonReleased; - break; + case NSEventTypeOtherMouseDown: + win->event.button = RGFW_mouseMiddle; + win->event.type = RGFW_mouseButtonPressed; + break; - case NSEventTypeOtherMouseUp: - win->event.button = RGFW_mouseMiddle; - win->event.type = RGFW_mouseButtonReleased; - break; + case NSEventTypeRightMouseDown: + win->event.button = RGFW_mouseRight; + win->event.type = RGFW_mouseButtonPressed; + break; - case NSEventTypeScrollWheel: { - double deltaY = ((CGFloat(*)(id, SEL))abi_objc_msgSend_fpret)(e, sel_registerName("deltaY")); + case NSEventTypeLeftMouseUp: + win->event.button = RGFW_mouseLeft; + win->event.type = RGFW_mouseButtonReleased; + break; + + case NSEventTypeOtherMouseUp: + win->event.button = RGFW_mouseMiddle; + win->event.type = RGFW_mouseButtonReleased; + break; - if (deltaY > 0) - win->event.button = RGFW_mouseScrollUp; + case NSEventTypeScrollWheel: { + double deltaY = ((CGFloat(*)(id, SEL))abi_objc_msgSend_fpret)(e, sel_registerName("deltaY")); - else if (deltaY < 0) - win->event.button = RGFW_mouseScrollDown; + if (deltaY > 0) + win->event.button = RGFW_mouseScrollUp; - win->event.scroll = deltaY; + else if (deltaY < 0) + win->event.button = RGFW_mouseScrollDown; - win->event.type = RGFW_mouseButtonReleased; - break; - } - case NSEventTypeRightMouseUp: - win->event.button = RGFW_mouseRight; - win->event.type = RGFW_mouseButtonReleased; - break; + win->event.scroll = deltaY; - default: - break; + win->event.type = RGFW_mouseButtonReleased; + break; + } + case NSEventTypeRightMouseUp: + win->event.button = RGFW_mouseRight; + win->event.type = RGFW_mouseButtonReleased; + break; + + default: + break; } objc_msgSend_void_id(NSApp, sel_registerName("sendEvent:"), e); @@ -5617,6 +5850,8 @@ static HMODULE wglinstance = NULL; } void RGFW_window_showMouse(RGFW_window* win, i8 show) { + RGFW_UNUSED(win); + if (show) { CGDisplayShowCursor(kCGDirectMainDisplay); } @@ -5626,11 +5861,13 @@ static HMODULE wglinstance = NULL; } void RGFW_window_setMouseStandard(RGFW_window* win, void* mouse) { + RGFW_UNUSED(win); CGDisplayShowCursor(kCGDirectMainDisplay); objc_msgSend_void(mouse, sel_registerName("set")); } void RGFW_window_moveMouse(RGFW_window* win, RGFW_vector v) { + RGFW_UNUSED(win); assert(win != NULL); CGWarpMouseCursorPosition(CGPointMake(v.x, v.y)); @@ -5716,6 +5953,7 @@ static HMODULE wglinstance = NULL; } u8 RGFW_isPressedI(RGFW_window* win, u32 key) { + RGFW_UNUSED(win); if (key >= 128) { #ifdef RGFW_PRINT_ERRORS fprintf(stderr, "RGFW_isPressedI : invalid keycode\n"); @@ -5723,7 +5961,19 @@ static HMODULE wglinstance = NULL; RGFW_error = 1; } - return RGFW_keyMap[key]; + return RGFW_keyBoard[key]; + } + + u8 RGFW_wasPressedI(RGFW_window* win, u32 key) { + RGFW_UNUSED(win); + if (key >= 128) { +#ifdef RGFW_PRINT_ERRORS + fprintf(stderr, "RGFW_wasPressedI : invalid keycode\n"); +#endif + RGFW_error = 1; + } + + return RGFW_keyBoard_prev[key]; } #ifdef __cplusplus @@ -5740,6 +5990,8 @@ static HMODULE wglinstance = NULL; } void RGFW_writeClipboard(const char* text, u32 textLen) { + RGFW_UNUSED(textLen); + NSPasteboardType array[] = { NSPasteboardTypeString, NULL }; NSPasteBoard_declareTypes(NSPasteboard_generalPasteboard(), array, 1, NULL); @@ -5747,12 +5999,16 @@ static HMODULE wglinstance = NULL; } u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { + RGFW_UNUSED(jsNumber); + assert(win != NULL); return RGFW_registerJoystickF(win, (char*) ""); } u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { + RGFW_UNUSED(file); + assert(win != NULL); return win->src.joystickCount - 1; @@ -5820,9 +6076,11 @@ static HMODULE wglinstance = NULL; #ifndef RGFW_NO_THREADS #include - RGFW_thread RGFW_createThread(void* (*function_ptr)(void*), void* args) { + RGFW_thread RGFW_createThread(RGFW_threadFunc_ptr ptr, void* args) { + RGFW_UNUSED(args); + RGFW_thread t; - pthread_create((pthread_t*) &t, NULL, *function_ptr, NULL); + pthread_create((pthread_t*) &t, NULL, *ptr, NULL); return t; } void RGFW_cancelThread(RGFW_thread thread) { pthread_cancel((pthread_t) thread); } @@ -5848,7 +6106,7 @@ static HMODULE wglinstance = NULL; #endif #else #ifdef RGFW_EGL - eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.rSurf); + eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.EGL_context); #endif #endif @@ -5927,9 +6185,6 @@ static HMODULE wglinstance = NULL; void RGFW_window_swapBuffers(RGFW_window* win) { assert(win != NULL); - win->event.frames++; - RGFW_window_checkFPS(win); - RGFW_window_makeCurrent(win); /* clear the window*/ @@ -5958,10 +6213,10 @@ static HMODULE wglinstance = NULL; RGFW_area area = RGFW_getScreenSize(); #ifndef RGFW_X11_DONT_CONVERT_BGR - win->src.bitmap->data = (const char*) win->buffer; + win->src.bitmap->data = (char*) win->buffer; u32 x, y; - for (y = 0; y < win->r.h; y++) { - for (x = 0; x < win->r.w; x++) { + for (y = 0; y < (u32)win->r.h; y++) { + for (x = 0; x < (u32)win->r.w; x++) { u32 index = (y * 4 * area.w) + x * 4; u8 red = win->src.bitmap->data[index]; @@ -5992,7 +6247,7 @@ static HMODULE wglinstance = NULL; "NSDeviceRGBColorSpace", 0, area.w * 4, 32 ); - id image = NSAlloc(objc_getClass("NSImage")); + id image = NSAlloc((id)objc_getClass("NSImage")); NSImage_addRepresentation(image, rep); objc_msgSend_void_id(layer, sel_registerName("setContents:"), (id) image); @@ -6009,28 +6264,25 @@ static HMODULE wglinstance = NULL; #endif } - if (win->src.winArgs & RGFW_NO_GPU_RENDER) - return; + if (!(win->src.winArgs & RGFW_NO_GPU_RENDER)) { + #ifdef RGFW_EGL + eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); + #elif defined(RGFW_OPENGL) + #if defined(RGFW_X11) && defined(RGFW_OPENGL) + glXSwapBuffers((Display*) win->src.display, (Window) win->src.window); + #elif defined(RGFW_WINDOWS) + SwapBuffers(win->src.hdc); + #elif defined(RGFW_MACOS) + NSOpenGLContext_flushBuffer(win->src.rSurf); + #endif + #endif -#ifdef RGFW_OPENGL -#ifdef RGFW_EGL - eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); -#else -#if defined(RGFW_X11) && defined(RGFW_OPENGL) - glXSwapBuffers((Display*) win->src.display, (Window) win->src.window); -#endif -#ifdef RGFW_WINDOWS - SwapBuffers(win->src.hdc); -#endif -#if defined(RGFW_MACOS) - NSOpenGLContext_flushBuffer(win->src.rSurf); -#endif -#endif -#endif + #if defined(RGFW_WINDOWS) && defined(RGFW_DIRECTX) + win->src.swapchain->lpVtbl->Present(win->src.swapchain, 0, 0); + #endif + } -#if defined(RGFW_WINDOWS) && defined(RGFW_DIRECTX) - win->src.swapchain->lpVtbl->Present(win->src.swapchain, 0, 0); -#endif + RGFW_window_checkFPS(win); } void RGFW_window_maximize(RGFW_window* win) { @@ -6072,11 +6324,11 @@ static HMODULE wglinstance = NULL; #endif } - void RGFW_sleep(u32 ms) { + void RGFW_sleep(u64 ms) { #ifndef RGFW_WINDOWS struct timespec time; time.tv_sec = 0; - time.tv_nsec = ms * 1000; + time.tv_nsec = ms * 1e+6; nanosleep(&time, NULL); #else @@ -6084,32 +6336,31 @@ static HMODULE wglinstance = NULL; #endif } - static float currentFrameTime = 0; - void RGFW_window_checkFPS(RGFW_window* win) { - assert(win != NULL); - - win->event.fps = RGFW_getFPS(); + u64 deltaTime = RGFW_getTimeNS() - win->event.frameTime; - if (win->fpsCap == 0) - return; + u64 fps = round(1e+9 / deltaTime); + win->event.fps = fps; - double targetFrameTime = 1.0 / win->fpsCap; - double elapsedTime = RGFW_getTime() - currentFrameTime; + if (win->fpsCap && fps > win->fpsCap) { + u64 frameTimeNS = 1e+9 / win->fpsCap; + u64 sleepTimeMS = (frameTimeNS - deltaTime) / 1e6; - if (elapsedTime < targetFrameTime) { - u32 sleepTime = (u32) ((targetFrameTime - elapsedTime) * 1e3); - RGFW_sleep(sleepTime); + if (sleepTimeMS > 0) { + RGFW_sleep(sleepTimeMS); + win->event.frameTime = 0; + } } - currentFrameTime = (float) RGFW_getTime(); + win->event.frameTime = RGFW_getTimeNS(); + + if (win->fpsCap) { + u64 deltaTime = RGFW_getTimeNS() - win->event.frameTime2; - if (elapsedTime < targetFrameTime) { - u32 sleepTime = (u32) ((targetFrameTime - elapsedTime) * 1e3); - RGFW_sleep(sleepTime); + win->event.fps = round(1e+9 / deltaTime); + + win->event.frameTime2 = RGFW_getTimeNS(); } - - currentFrameTime = (float) RGFW_getTime(); } #ifdef __APPLE__ @@ -6127,7 +6378,7 @@ static HMODULE wglinstance = NULL; return (u64) (counter.QuadPart * 1e9 / frequency.QuadPart); #elif defined(__unix__) struct timespec ts = { 0 }; - clock_gettime(CLOCK_MONOTONIC, &ts); + clock_gettime(1, &ts); unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec; return nanoSeconds; @@ -6151,7 +6402,7 @@ static HMODULE wglinstance = NULL; return (u64) (counter.QuadPart / (double) frequency.QuadPart); #elif defined(__unix__) struct timespec ts = { 0 }; - clock_gettime(CLOCK_MONOTONIC, &ts); + clock_gettime(1, &ts); unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec; return (double)(nanoSeconds) * 1e-9; @@ -6165,27 +6416,6 @@ static HMODULE wglinstance = NULL; return 0; } - u32 RGFW_getFPS(void) { - static double previousSeconds = 0.0; - if (previousSeconds == 0.0) - previousSeconds = (double) RGFW_getTime();//glfwGetTime(); - - static i16 frameCount; - double currentSeconds = (double) RGFW_getTime();//glfwGetTime(); - double elapsedSeconds = currentSeconds - previousSeconds; - static double fps = 0; - - if (elapsedSeconds > 0.25) { - previousSeconds = currentSeconds; - fps = (double) frameCount / elapsedSeconds; - frameCount = 0; - } - - frameCount++; - - return (u32) fps; - } - #endif /*RGFW_IMPLEMENTATION*/ #define RGFW_Escape RGFW_OS_BASED_VALUE(0xff1b, 0x1B, 53) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 623dc0e763d9..f4e3174971e5 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -431,7 +431,11 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - return platform.window->src.window; + #ifndef RGFW_WINDOWS + return (void*)platform.window->src.window; + #else + return platform.window->src.hwnd; + #endif } // Get number of monitors @@ -890,8 +894,6 @@ void PollInputEvents(void) CORE.Input.Mouse.currentPosition.x = (event->point.x - (platform.window->r.w / 2)) * 2; CORE.Input.Mouse.currentPosition.y = (event->point.y - (platform.window->r.h / 2)) * 2; - - RGFW_window_showMouse(platform.window, 1); } else { CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; From 6b3c1148bfbcd354dc7e6c825fb1e452c6e0fbfd Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Jun 2024 13:16:18 +0200 Subject: [PATCH 28/71] REVIEWED: Animation name being NULL #4037 --- src/rmodels.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 57059a0175b0..14cfc64aab43 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5772,8 +5772,11 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo animDuration = (t > animDuration)? t : animDuration; } - strncpy(animations[i].name, animData.name, sizeof(animations[i].name)); - animations[i].name[sizeof(animations[i].name) - 1] = '\0'; + if (animData.name != NULL) + { + strncpy(animations[i].name, animData.name, sizeof(animations[i].name)); + animations[i].name[sizeof(animations[i].name) - 1] = '\0'; + } animations[i].frameCount = (int)(animDuration*1000.0f/GLTF_ANIMDELAY) + 1; animations[i].framePoses = RL_MALLOC(animations[i].frameCount*sizeof(Transform *)); @@ -5823,7 +5826,7 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo BuildPoseFromParentJoints(animations[i].bones, animations[i].boneCount, animations[i].framePoses[j]); } - TRACELOG(LOG_INFO, "MODEL: [%s] Loaded animation: %s (%d frames, %fs)", fileName, animData.name, animations[i].frameCount, animDuration); + TRACELOG(LOG_INFO, "MODEL: [%s] Loaded animation: %s (%d frames, %fs)", fileName, (animData.name != NULL)? animData.name : "NULL", animations[i].frameCount, animDuration); RL_FREE(boneChannels); } } From 8cbde7f84c345b9c8ae9d226ed9ba315f14658b4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Jun 2024 13:16:29 +0200 Subject: [PATCH 29/71] tweaks --- src/rcore.c | 2 +- src/rtext.c | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 3aa5a7a65bc9..a4fc4d675a0d 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2251,7 +2251,7 @@ bool IsFileNameValid(const char *fileName) if ((fileName != NULL) && (fileName[0] != '\0')) { - int length = strlen(fileName); + int length = (int)strlen(fileName); bool allPeriods = true; for (int i = 0; i < length; i++) diff --git a/src/rtext.c b/src/rtext.c index 118a559d6e0b..6ad0f90a0e9e 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1807,10 +1807,7 @@ const char *TextToSnake(const char *text) } buffer[i] = text[j] + 32; } - else - { - buffer[i] = text[j]; - } + else buffer[i] = text[j]; } } @@ -1827,23 +1824,17 @@ const char *TextToCamel(const char *text) if (text != NULL) { // Lower case first character - if ((text[0] >= 'A') && (text[0] <= 'Z')) - buffer[0] = text[0] + 32; - else - buffer[0] = text[0]; + if ((text[0] >= 'A') && (text[0] <= 'Z')) buffer[0] = text[0] + 32; + else buffer[0] = text[0]; // Check for next separator to upper case another character for (int i = 1, j = 1; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) { - if (text[j] != '_') - buffer[i] = text[j]; + if (text[j] != '_') buffer[i] = text[j]; else { j++; - if ((text[j] >= 'a') && (text[j] <= 'z')) - { - buffer[i] = text[j] - 32; - } + if ((text[j] >= 'a') && (text[j] <= 'z')) buffer[i] = text[j] - 32; } } } From a0a81fddee9365657015b300ed1b892db74acff5 Mon Sep 17 00:00:00 2001 From: carverdamien Date: Sun, 9 Jun 2024 13:29:09 +0200 Subject: [PATCH 30/71] Make addRaylib use options.opengl_version (#4049) --- src/build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build.zig b/src/build.zig index 51a8ab7b0837..35622a462f31 100644 --- a/src/build.zig +++ b/src/build.zig @@ -22,6 +22,7 @@ pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .platform_drm = options.platform_drm, .shared = options.shared, .linux_display_backend = options.linux_display_backend, + .opengl_version = options.opengl_version, }); const raylib = raylib_dep.artifact("raylib"); From 29ac31f40980d48087db36072693e62743c96ce1 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Sun, 9 Jun 2024 18:03:05 +0200 Subject: [PATCH 31/71] Removed Raylib.NET (#4050) --- BINDINGS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 9ec8c3c3c7d5..d24bf67c7d39 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -13,7 +13,6 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | -| [Raylib.NET](https://github.com/Odex64/Raylib.NET) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | | [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT | | [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | | [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 | From c636618d777053d1a2b968c1aa76e8e06190f29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Albuquerque?= <33807434+lzralbu@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:50:09 -0400 Subject: [PATCH 32/71] Update Makefile (#4054) Since the flag CUSTOM_CFLAGS should allow users customize things, in particular the optimization level, I figured it should come after other default ones. Based on: "If you use multiple -O options, with or without level numbers, the last such option is the one that is effective." Source: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 23742565d2f9..19251b95692e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -316,7 +316,7 @@ endif # -D_GNU_SOURCE access to lots of nonstandard GNU/Linux extension functions # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers # -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing) -CFLAGS = -Wall -D_GNU_SOURCE -D$(PLATFORM) -D$(GRAPHICS) -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing $(CUSTOM_CFLAGS) +CFLAGS = -Wall -D_GNU_SOURCE -D$(PLATFORM) -D$(GRAPHICS) -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing ifneq ($(RAYLIB_CONFIG_FLAGS), NONE) CFLAGS += -DEXTERNAL_CONFIG_FLAGS $(RAYLIB_CONFIG_FLAGS) @@ -449,6 +449,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif +CFLAGS += $(CUSTOM_CFLAGS) + # Define include paths for required headers: INCLUDE_PATHS # NOTE: Several external required libraries (stb and others) #------------------------------------------------------------------------------------------------ From 0fc4b619065291a06787fe38388d1318f7ecfc12 Mon Sep 17 00:00:00 2001 From: VitoTringolo Date: Tue, 11 Jun 2024 11:50:42 +0200 Subject: [PATCH 33/71] LoadBoneInfoGLTF add check for animation name being NULL (#4053) Co-authored-by: Vito Tringolo --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 14cfc64aab43..1ee27602da52 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4864,7 +4864,7 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount) for (unsigned int i = 0; i < skin.joints_count; i++) { cgltf_node node = *skin.joints[i]; - strncpy(bones[i].name, node.name, sizeof(bones[i].name)); + if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name)); // Find parent bone index unsigned int parentIndex = -1; From 2609211207419ceab2e00113b4a442bfdab434d3 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Tue, 11 Jun 2024 02:51:49 -0700 Subject: [PATCH 34/71] [SHAPES] Make functions that draw point arrays take them as const (#4051) * Update raylib_api.* by CI * make functions that take a pointer to an array take them as const pointers * Update raylib_api.* by CI * fix comment alignment. --------- Co-authored-by: github-actions[bot] --- parser/output/raylib_api.json | 20 ++++++++++---------- parser/output/raylib_api.lua | 20 ++++++++++---------- parser/output/raylib_api.txt | 20 ++++++++++---------- parser/output/raylib_api.xml | 20 ++++++++++---------- src/raylib.h | 22 +++++++++++----------- src/rmodels.c | 2 +- src/rshapes.c | 18 +++++++++--------- 7 files changed, 61 insertions(+), 61 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 961578e5313f..1a38c03ab80c 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -5345,7 +5345,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6022,7 +6022,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6041,7 +6041,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6145,7 +6145,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6168,7 +6168,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6191,7 +6191,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6214,7 +6214,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6237,7 +6237,7 @@ "returnType": "void", "params": [ { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -6644,7 +6644,7 @@ "name": "point" }, { - "type": "Vector2 *", + "type": "const Vector2 *", "name": "points" }, { @@ -9613,7 +9613,7 @@ "returnType": "void", "params": [ { - "type": "Vector3 *", + "type": "const Vector3 *", "name": "points" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index eb88daab9a63..3dec7f371eb4 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4636,7 +4636,7 @@ return { description = "Draw lines sequence (using gl lines)", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "Color", name = "color"} } @@ -4947,7 +4947,7 @@ return { description = "Draw a triangle fan defined by points (first vertex is the center)", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "Color", name = "color"} } @@ -4957,7 +4957,7 @@ return { description = "Draw a triangle strip defined by points", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "Color", name = "color"} } @@ -5004,7 +5004,7 @@ return { description = "Draw spline: Linear, minimum 2 points", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "float", name = "thick"}, {type = "Color", name = "color"} @@ -5015,7 +5015,7 @@ return { description = "Draw spline: B-Spline, minimum 4 points", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "float", name = "thick"}, {type = "Color", name = "color"} @@ -5026,7 +5026,7 @@ return { description = "Draw spline: Catmull-Rom, minimum 4 points", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "float", name = "thick"}, {type = "Color", name = "color"} @@ -5037,7 +5037,7 @@ return { description = "Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "float", name = "thick"}, {type = "Color", name = "color"} @@ -5048,7 +5048,7 @@ return { description = "Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]", returnType = "void", params = { - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "float", name = "thick"}, {type = "Color", name = "color"} @@ -5239,7 +5239,7 @@ return { returnType = "bool", params = { {type = "Vector2", name = "point"}, - {type = "Vector2 *", name = "points"}, + {type = "const Vector2 *", name = "points"}, {type = "int", name = "pointCount"} } }, @@ -6855,7 +6855,7 @@ return { description = "Draw a triangle strip defined by points", returnType = "void", params = { - {type = "Vector3 *", name = "points"}, + {type = "const Vector3 *", name = "points"}, {type = "int", name = "pointCount"}, {type = "Color", name = "color"} } diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 66880130ed7f..2a33a995fad5 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -2130,7 +2130,7 @@ Function 212: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) Function 213: DrawLineBezier() (4 input parameters) @@ -2360,14 +2360,14 @@ Function 239: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) Function 240: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) Function 241: DrawPoly() (5 input parameters) @@ -2402,7 +2402,7 @@ Function 244: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) @@ -2410,7 +2410,7 @@ Function 245: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) @@ -2418,7 +2418,7 @@ Function 246: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) @@ -2426,7 +2426,7 @@ Function 247: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) @@ -2434,7 +2434,7 @@ Function 248: DrawSplineBezierCubic() (4 input parameters) Name: DrawSplineBezierCubic Return type: void Description: Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] - Param[1]: points (type: Vector2 *) + Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) @@ -2574,7 +2574,7 @@ Function 265: CheckCollisionPointPoly() (3 input parameters) 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: Vector2 *) + Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Function 266: CheckCollisionLines() (5 input parameters) Name: CheckCollisionLines @@ -3695,7 +3695,7 @@ Function 432: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points - Param[1]: points (type: Vector3 *) + Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) Function 433: DrawCube() (5 input parameters) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 0e096d5a2d62..130f22f75229 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1317,7 +1317,7 @@ - + @@ -1493,12 +1493,12 @@ - + - + @@ -1525,31 +1525,31 @@ - + - + - + - + - + @@ -1655,7 +1655,7 @@ - + @@ -2440,7 +2440,7 @@ - + diff --git a/src/raylib.h b/src/raylib.h index c612856416c3..b1da83cb8afb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1233,7 +1233,7 @@ RLAPI void DrawPixelV(Vector2 position, Color color); RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (using gl lines) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads) -RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) +RLAPI void DrawLineStrip(const Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle @@ -1260,18 +1260,18 @@ RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segment RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +RLAPI void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Splines drawing functions -RLAPI void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points -RLAPI void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points -RLAPI void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points -RLAPI void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] -RLAPI void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] +RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points +RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points +RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points +RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] +RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] RLAPI void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points @@ -1292,7 +1292,7 @@ RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices +RLAPI bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] @@ -1342,7 +1342,7 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -RLAPI void ImageKernelConvolution(Image *image, float* kernel, int kernelSize); // Apply Custom Square image convolution kernel +RLAPI void ImageKernelConvolution(Image *image, float* kernel, int kernelSize); // Apply Custom Square image convolution kernel RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color @@ -1504,7 +1504,7 @@ RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires diff --git a/src/rmodels.c b/src/rmodels.c index 1ee27602da52..5a6c6414c7e7 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -226,7 +226,7 @@ void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color) } // Draw a triangle strip defined by points -void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color) +void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color) { if (pointCount < 3) return; // Security check diff --git a/src/rshapes.c b/src/rshapes.c index cb85c1c543ad..058c96863642 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -196,7 +196,7 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) } // Draw lines sequuence (using gl lines) -void DrawLineStrip(Vector2 *points, int pointCount, Color color) +void DrawLineStrip(const Vector2 *points, int pointCount, Color color) { if (pointCount < 2) return; // Security check @@ -1385,7 +1385,7 @@ void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color) // Draw a triangle fan defined by points // NOTE: First vertex provided is the center, shared by all triangles // By default, following vertex should be provided in counter-clockwise order -void DrawTriangleFan(Vector2 *points, int pointCount, Color color) +void DrawTriangleFan(const Vector2 *points, int pointCount, Color color) { if (pointCount >= 3) { @@ -1416,7 +1416,7 @@ void DrawTriangleFan(Vector2 *points, int pointCount, Color color) // Draw a triangle strip defined by points // NOTE: Every new vertex connects with previous two -void DrawTriangleStrip(Vector2 *points, int pointCount, Color color) +void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color) { if (pointCount >= 3) { @@ -1570,7 +1570,7 @@ void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, fl //---------------------------------------------------------------------------------- // Draw spline: linear, minimum 2 points -void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color) +void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 2) return; @@ -1687,7 +1687,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color) } // Draw spline: B-Spline, minimum 4 points -void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color) +void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 4) return; @@ -1763,7 +1763,7 @@ void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color) } // Draw spline: Catmull-Rom, minimum 4 points -void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color) +void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 4) return; @@ -1829,7 +1829,7 @@ void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color co } // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] -void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color) +void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 3) return; @@ -1840,7 +1840,7 @@ void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Col } // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] -void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color) +void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 4) return; @@ -2195,7 +2195,7 @@ bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 // Check if point is within a polygon described by array of vertices // NOTE: Based on http://jeffreythompson.org/collision-detection/poly-point.php -bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount) +bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount) { bool inside = false; From fffae1a975dbfff8e6c8ee37c989f5256debc90f Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Tue, 11 Jun 2024 20:55:13 +0200 Subject: [PATCH 35/71] Fix fragPosition using wrong matrix in lighting_instancing.vs (#4056) fragPosition was multiplied by mvp*instanceTransform, but it should only be multiplied by instanceTransform. Compare to lighting.vs, there we only use mvp for gl_Position, but matModel for the fragPosition. --- .../resources/shaders/glsl330/lighting_instancing.vs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs b/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs index 6775a2eb6350..3e4da1e288b9 100644 --- a/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs +++ b/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs @@ -22,15 +22,12 @@ out vec3 fragNormal; void main() { - // Compute MVP for current instance - mat4 mvpi = mvp*instanceTransform; - // Send vertex attributes to fragment shader - fragPosition = vec3(mvpi*vec4(vertexPosition, 1.0)); + fragPosition = vec3(instanceTransform*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; //fragColor = vertexColor; fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0))); - // Calculate final vertex position - gl_Position = mvpi*vec4(vertexPosition, 1.0); + // Calculate final vertex position, note that we multiply mvp by instanceTransform + gl_Position = mvp*instanceTransform*vec4(vertexPosition, 1.0); } From 33c598123c4b6ef78ff2ac3dcc1094da4dd6efef Mon Sep 17 00:00:00 2001 From: Alexey Kutepov Date: Wed, 12 Jun 2024 16:42:41 +0700 Subject: [PATCH 36/71] [raudio] Add 24 bits samples support for FLAC format (#4058) Similarly to how it's done for WAV format, by forcing the conversion to s16 on UpdateMusicStream(). --- src/raudio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/raudio.c b/src/raudio.c index c6bd00165434..177bdb5aa023 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1428,7 +1428,9 @@ Music LoadMusicStream(const char *fileName) { music.ctxType = MUSIC_AUDIO_FLAC; music.ctxData = ctxFlac; - music.stream = LoadAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels); + int sampleSize = ctxFlac->bitsPerSample; + if (ctxFlac->bitsPerSample == 24) sampleSize = 16; // Forcing conversion to s16 on UpdateMusicStream() + music.stream = LoadAudioStream(ctxFlac->sampleRate, sampleSize, ctxFlac->channels); music.frameCount = (unsigned int)ctxFlac->totalPCMFrameCount; music.looping = true; // Looping enabled by default musicLoaded = true; From 735c0160b5cc5fa2a2cdd60843d61afa25551991 Mon Sep 17 00:00:00 2001 From: TokyoSU <77746747+TokyoSU@users.noreply.github.com> Date: Wed, 12 Jun 2024 19:36:25 +0200 Subject: [PATCH 37/71] Update rlgl.h (#4059) - The function rlGetMatrixProjectionStereo and rlGetMatrixViewOffsetStereo have RLAPI for the function declaration and cause error when compiling using RLGL_IMPLEMENTATION. --- src/rlgl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 2f6a03b8aa07..530e44efcc86 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -4518,7 +4518,7 @@ Matrix rlGetMatrixTransform(void) } // Get internal projection matrix for stereo render (selected eye) -RLAPI Matrix rlGetMatrixProjectionStereo(int eye) +Matrix rlGetMatrixProjectionStereo(int eye) { Matrix mat = rlMatrixIdentity(); #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) @@ -4528,7 +4528,7 @@ RLAPI Matrix rlGetMatrixProjectionStereo(int eye) } // Get internal view offset matrix for stereo render (selected eye) -RLAPI Matrix rlGetMatrixViewOffsetStereo(int eye) +Matrix rlGetMatrixViewOffsetStereo(int eye) { Matrix mat = rlMatrixIdentity(); #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) From df849d2fb0c7df6a818f2f79dd8343565dd1274c Mon Sep 17 00:00:00 2001 From: listeria <56203103+ListeriaM@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:05:22 -0300 Subject: [PATCH 38/71] [raudio] fix mapping of wave data in LoadWaveSamples() (#4062) Co-authored-by: Listeria monocytogenes --- src/raudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raudio.c b/src/raudio.c index 177bdb5aa023..623984e1dc26 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1304,8 +1304,8 @@ float *LoadWaveSamples(Wave wave) for (unsigned int i = 0; i < wave.frameCount*wave.channels; i++) { - if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 127)/256.0f; - else if (wave.sampleSize == 16) samples[i] = (float)(((short *)wave.data)[i])/32767.0f; + if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 128)/128.0f; + else if (wave.sampleSize == 16) samples[i] = (float)(((short *)wave.data)[i])/32768.0f; else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; } From fca53c77996ab0b723dd4ee5235671cba9274ca7 Mon Sep 17 00:00:00 2001 From: kai-z99 <147789796+kai-z99@users.noreply.github.com> Date: Thu, 13 Jun 2024 23:19:17 -0700 Subject: [PATCH 39/71] optimize (#4065) --- src/rshapes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 058c96863642..e9a84834eff2 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -2233,9 +2233,10 @@ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, floa float dx = center2.x - center1.x; // X distance between centers float dy = center2.y - center1.y; // Y distance between centers - float distance = sqrtf(dx*dx + dy*dy); // Distance between centers + float distanceSquared = dx * dx + dy * dy; // Distance between centers squared + float radiusSum = radius1 + radius2; - if (distance <= (radius1 + radius2)) collision = true; + collision = (distanceSquared <= (radiusSum * radiusSum)); return collision; } From b4fbdc028302f9a697f196e8d02a7dca28912f59 Mon Sep 17 00:00:00 2001 From: ShalokShalom Date: Fri, 14 Jun 2024 22:46:50 +0200 Subject: [PATCH 40/71] Update Julia Bindings (#4068) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index d24bf67c7d39..22b740588dd5 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -36,7 +36,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT | | [jaylib](https://github.com/electronstudio/jaylib/) | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | | [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | -| [raylib.jl](https://github.com/irishgreencitrus/raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | +| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 4.5 | [Lua](http://www.lua.org) | ISC | From eff7b065eba17725ddc3c16aef16eb8eeca1d888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Poceduli=C4=87?= <58425080+okvik@users.noreply.github.com> Date: Sun, 16 Jun 2024 09:37:45 +0200 Subject: [PATCH 41/71] [build.zig] Fix raygui build when using addRaygui externally (#4027) When addRaygui is used from an external build, for example in a bindings project, the build of a generated `raygui.c` fails with "raylib.h not found" error from the compiler. I've traced this down to a raylib step not adding its `src/` to the shared list of include paths using `addIncludePath` but relying on `addCSourceFiles` `.root` to provide the implicit include path for raylib proper's own files. If raygui is later added to the step the compiler won't know where to look for `raylib.h` and friends and will fail to build. This change simply adds raylib's `src/` to the include path list. --- src/build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build.zig b/src/build.zig index 35622a462f31..81d4a766263d 100644 --- a/src/build.zig +++ b/src/build.zig @@ -217,6 +217,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. }, } + raylib.addIncludePath(b.path("src")); raylib.root_module.addCSourceFiles(.{ .root = b.path("src"), .files = c_source_files.items, From 81ff879b047186e1453cb682c70782c0bd338f2a Mon Sep 17 00:00:00 2001 From: Mike Will Date: Sun, 16 Jun 2024 03:38:54 -0400 Subject: [PATCH 42/71] zig: run examples from their directories (#4063) So that they can find their respective resource folders. --- examples/build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/build.zig b/examples/build.zig index 5a17382caca1..df0cdf8c17f0 100644 --- a/examples/build.zig +++ b/examples/build.zig @@ -75,6 +75,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso const install_cmd = b.addInstallArtifact(exe, .{}); const run_cmd = b.addRunArtifact(exe); + run_cmd.cwd = b.path(module); run_cmd.step.dependOn(&install_cmd.step); const run_step = b.step(name, name); From 640eaca8bf1d2b49a6a730c274b94a96c3a87146 Mon Sep 17 00:00:00 2001 From: Santiago Pelufo Date: Sun, 16 Jun 2024 05:21:54 -0300 Subject: [PATCH 43/71] [rshapes] Fix multisegment Bezier splines. (#3744) * [rshapes] Fix multisegment Bezier splines. It seems to me that these functions are wrong, if you step the index by 1 you move to a control point instead of the next segment. * Fix example shapes/shapes_splines_drawing for bezier splines. * Draw circles to fill gaps between bezier segments. --- examples/shapes/shapes_splines_drawing.c | 21 +++++++++++++++++---- src/rshapes.c | 14 ++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/examples/shapes/shapes_splines_drawing.c b/examples/shapes/shapes_splines_drawing.c index 8df5f09f487b..0d5693eb2676 100644 --- a/examples/shapes/shapes_splines_drawing.c +++ b/examples/shapes/shapes_splines_drawing.c @@ -63,7 +63,7 @@ int main(void) Vector2 *focusedControlPoint = NULL; // Cubic Bezier control points initialization - ControlPoint control[MAX_SPLINE_POINTS] = { 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 }; @@ -88,6 +88,9 @@ int main(void) if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON) && (pointCount < MAX_SPLINE_POINTS)) { points[pointCount] = GetMousePosition(); + int i = pointCount - 1; + control[i].start = (Vector2){ points[i].x + 50, points[i].y }; + control[i].end = (Vector2){ points[i + 1].x - 50, points[i + 1].y }; pointCount++; } @@ -114,7 +117,7 @@ int main(void) if ((splineTypeActive == SPLINE_BEZIER) && (focusedPoint == -1)) { // Spline control point focus and selection logic - for (int i = 0; i < pointCount; i++) + for (int i = 0; i < pointCount - 1; i++) { if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f)) { @@ -186,10 +189,20 @@ int main(void) else if (splineTypeActive == SPLINE_BEZIER) { // Draw spline: cubic-bezier (with control points) + + Vector2 fullPoints[3*(MAX_SPLINE_POINTS-1)+1] = {0}; + for (int i = 0; i < pointCount-1; i++) { + fullPoints[3*i] = points[i]; + fullPoints[3*i+1] = control[i].start; + fullPoints[3*i+2] = control[i].end; + } + fullPoints[3*(pointCount-1)] = points[pointCount-1], + DrawSplineBezierCubic(fullPoints, 3*(pointCount-1)+1, splineThickness, RED); + for (int i = 0; i < pointCount - 1; i++) { // Drawing individual segments, not considering thickness connection compensation - DrawSplineSegmentBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], splineThickness, RED); + // DrawSplineSegmentBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], splineThickness, RED); // Every cubic bezier point should have two control points DrawCircleV(control[i].start, 6, GOLD); @@ -244,4 +257,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} diff --git a/src/rshapes.c b/src/rshapes.c index e9a84834eff2..2c4a57d38bc7 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1832,8 +1832,11 @@ void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Co void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 3) return; - - for (int i = 0; i < pointCount - 2; i++) + for (int i = 2; i < pointCount - 2; i += 2) + { + DrawCircleV(points[i], thick/2.0f, color); + } + for (int i = 0; i < pointCount - 2; i += 2) { DrawSplineSegmentBezierQuadratic(points[i], points[i + 1], points[i + 2], thick, color); } @@ -1843,8 +1846,11 @@ void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thic void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 4) return; - - for (int i = 0; i < pointCount - 3; i++) + for (int i = 3; i < pointCount - 3; i += 3) + { + DrawCircleV(points[i], thick/2.0f, color); + } + for (int i = 0; i < pointCount - 3; i += 3) { DrawSplineSegmentBezierCubic(points[i], points[i + 1], points[i + 2], points[i + 3], thick, color); } From 4119b6dd660544bff9f6431fa04f162eacb612a3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 16 Jun 2024 10:23:38 +0200 Subject: [PATCH 44/71] Update raylib.h --- src/raylib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index b1da83cb8afb..9f06462fb251 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1141,7 +1141,7 @@ RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize // Automation events functionality RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS -RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file +RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording @@ -1342,10 +1342,10 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -RLAPI void ImageKernelConvolution(Image *image, float* kernel, int kernelSize); // Apply Custom Square image convolution kernel +RLAPI void ImageKernelConvolution(Image *image, float *kernel, int kernelSize); // Apply Custom Square image convolution kernel RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically @@ -1436,7 +1436,7 @@ RLAPI int GetPixelDataSize(int width, int height, int format); // G // Font loading/unloading functions RLAPI Font GetFontDefault(void); // Get the default Font RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' RLAPI bool IsFontReady(Font font); // Check if a font is ready From 32c98717b159c3b34ab1e22a6bf99a8d70b4a9e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 16 Jun 2024 08:23:57 +0000 Subject: [PATCH 45/71] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 2 +- parser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 1a38c03ab80c..ad49b64a5ba7 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -7359,7 +7359,7 @@ "name": "image" }, { - "type": "float*", + "type": "float *", "name": "kernel" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 3dec7f371eb4..2918b934c885 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5621,7 +5621,7 @@ return { returnType = "void", params = { {type = "Image *", name = "image"}, - {type = "float*", name = "kernel"}, + {type = "float *", name = "kernel"}, {type = "int", name = "kernelSize"} } }, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 2a33a995fad5..ffcea16159d1 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -2842,7 +2842,7 @@ Function 304: ImageKernelConvolution() (3 input parameters) Return type: void Description: Apply Custom Square image convolution kernel Param[1]: image (type: Image *) - Param[2]: kernel (type: float*) + Param[2]: kernel (type: float *) Param[3]: kernelSize (type: int) Function 305: ImageResize() (3 input parameters) Name: ImageResize diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 130f22f75229..58f7df8066ec 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1844,7 +1844,7 @@ - + From 715633e0de101cb1a2b7b322455e4eab047f5f15 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 16 Jun 2024 10:41:47 +0200 Subject: [PATCH 46/71] REVIEWED: Spline cubic bezier example --- examples/shapes/shapes_splines_drawing.c | 37 ++++++++++++++++-------- src/rshapes.c | 30 +++++++++---------- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/examples/shapes/shapes_splines_drawing.c b/examples/shapes/shapes_splines_drawing.c index 0d5693eb2676..7c099e7ef5ca 100644 --- a/examples/shapes/shapes_splines_drawing.c +++ b/examples/shapes/shapes_splines_drawing.c @@ -56,6 +56,10 @@ int main(void) { 710.0f, 260.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; @@ -188,23 +192,32 @@ int main(void) } else if (splineTypeActive == SPLINE_BEZIER) { - // Draw spline: cubic-bezier (with control points) - - Vector2 fullPoints[3*(MAX_SPLINE_POINTS-1)+1] = {0}; - for (int i = 0; i < pointCount-1; i++) { - fullPoints[3*i] = points[i]; - fullPoints[3*i+1] = control[i].start; - fullPoints[3*i+2] = control[i].end; + // 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; } - fullPoints[3*(pointCount-1)] = points[pointCount-1], - DrawSplineBezierCubic(fullPoints, 3*(pointCount-1)+1, splineThickness, RED); + + pointsInterleaved[3*(pointCount - 1)] = points[pointCount - 1]; - for (int i = 0; i < pointCount - 1; i++) + // 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) { // Drawing individual segments, not considering thickness connection compensation - // DrawSplineSegmentBezierCubic(points[i], control[i].start, control[i].end, points[i + 1], splineThickness, RED); + DrawSplineSegmentBezierCubic(pointsInterleaved[i], pointsInterleaved[i + 1], pointsInterleaved[i + 2], pointsInterleaved[i + 3], splineThickness, MAROON); + } + */ - // Every cubic bezier point should have two control points + // Draw spline control points + for (int i = 0; i < pointCount - 1; i++) + { + // Every cubic bezier point have two control points DrawCircleV(control[i].start, 6, GOLD); DrawCircleV(control[i].end, 6, GOLD); if (focusedControlPoint == &control[i].start) DrawCircleV(control[i].start, 8, GREEN); diff --git a/src/rshapes.c b/src/rshapes.c index 2c4a57d38bc7..95c54770e001 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1759,7 +1759,8 @@ void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color c DrawTriangleStrip(vertices, 2*SPLINE_SEGMENT_DIVISIONS + 2, color); } - DrawCircleV(currentPoint, thick/2.0f, color); // Draw end line circle-cap + // Cap circle drawing at the end of every segment + DrawCircleV(currentPoint, thick/2.0f, color); } // Draw spline: Catmull-Rom, minimum 4 points @@ -1825,34 +1826,31 @@ void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Co DrawTriangleStrip(vertices, 2*SPLINE_SEGMENT_DIVISIONS + 2, color); } - DrawCircleV(currentPoint, thick/2.0f, color); // Draw end line circle-cap + // Cap circle drawing at the end of every segment + DrawCircleV(currentPoint, thick/2.0f, color); } // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color) { - if (pointCount < 3) return; - for (int i = 2; i < pointCount - 2; i += 2) - { - DrawCircleV(points[i], thick/2.0f, color); - } - for (int i = 0; i < pointCount - 2; i += 2) + if (pointCount >= 3) { - DrawSplineSegmentBezierQuadratic(points[i], points[i + 1], points[i + 2], thick, color); + for (int i = 0; i < pointCount - 2; i += 2) DrawSplineSegmentBezierQuadratic(points[i], points[i + 1], points[i + 2], thick, color); + + // Cap circle drawing at the end of every segment + //for (int i = 2; i < pointCount - 2; i += 2) DrawCircleV(points[i], thick/2.0f, color); } } // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color) { - if (pointCount < 4) return; - for (int i = 3; i < pointCount - 3; i += 3) - { - DrawCircleV(points[i], thick/2.0f, color); - } - for (int i = 0; i < pointCount - 3; i += 3) + if (pointCount >= 4) { - DrawSplineSegmentBezierCubic(points[i], points[i + 1], points[i + 2], points[i + 3], thick, color); + for (int i = 0; i < pointCount - 3; i += 3) DrawSplineSegmentBezierCubic(points[i], points[i + 1], points[i + 2], points[i + 3], thick, color); + + // Cap circle drawing at the end of every segment + //for (int i = 3; i < pointCount - 3; i += 3) DrawCircleV(points[i], thick/2.0f, color); } } From cc40a91343b124abf87ab0ae2fae22abf1f9561b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Albuquerque?= <33807434+lzralbu@users.noreply.github.com> Date: Sun, 16 Jun 2024 04:42:50 -0400 Subject: [PATCH 47/71] [build] Fix some warnings on web builds and remove some redundant flags. (#4069) * update * Revert "update" This reverts commit e8adcabd94830be66938e12143c8fe23cdeab605. * update * remove a not stricly required flag --- cmake/LibraryConfigurations.cmake | 1 - examples/CMakeLists.txt | 5 ++--- src/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index 23a7ec2f0479..f6dd4f314ba7 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -59,7 +59,6 @@ if (${PLATFORM} MATCHES "Desktop") elseif (${PLATFORM} MATCHES "Web") set(PLATFORM_CPP "PLATFORM_WEB") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") elseif (${PLATFORM} MATCHES "Android") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 28550eaecb65..64b6d76040e8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -96,10 +96,9 @@ if (${PLATFORM} MATCHES "Android") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_basic_lighting.c) elseif (${PLATFORM} MATCHES "Web") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os") # Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s WASM=1 -s ASYNCIFY -s ALLOW_MEMORY_GROWTH=1 --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") set(CMAKE_EXECUTABLE_SUFFIX ".html") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 387665705c3d..bfb4b05b57b7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -69,7 +69,7 @@ else() endif() if (${PLATFORM} MATCHES "Web") - target_link_options(raylib PRIVATE "-sUSE_GLFW=3") + target_link_options(raylib PUBLIC "-sUSE_GLFW=3") endif() set_target_properties(raylib PROPERTIES From a29d334734f720431872266743ba5560870e3453 Mon Sep 17 00:00:00 2001 From: kai-z99 <147789796+kai-z99@users.noreply.github.com> Date: Sun, 16 Jun 2024 01:44:31 -0700 Subject: [PATCH 48/71] [rmodels] Read uninitialized values in GenMeshTangents() - fix bounding case (#4066) * fix * assert --- src/rmodels.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 5a6c6414c7e7..308fb0a70ba3 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3436,7 +3436,12 @@ void GenMeshTangents(Mesh *mesh) Vector3 *tan1 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3)); Vector3 *tan2 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3)); - for (int i = 0; i < mesh->vertexCount - 3; i += 3) + if (mesh->vertexCount % 3 != 0) + { + TRACELOG(LOG_WARNING, "MESH: vertexCount expected to be a multiple of 3. Expect uninitialized values."); + } + + for (int i = 0; i <= mesh->vertexCount - 3; i += 3) { // Get triangle vertices Vector3 v1 = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] }; From 307c998495a769092a8587c91a3efdb526de909c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Albuquerque?= <33807434+lzralbu@users.noreply.github.com> Date: Sun, 16 Jun 2024 04:49:59 -0400 Subject: [PATCH 49/71] [build] Making `config.h` fully available to CMake users (#4044) * Create ParseConfigHeader.cmake This script parses the config.h file to automate the process of exposing the configuration flags and configuration values found in the latter. * Update CompileDefinitions.cmake Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeOptions.txt Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeLists.txt Changes required to make possible building raylib for web on Windows 10. * Update LibraryConfigurations.cmake Removes a warning that linker-only flags were being passed to the compiler, which is in accordance to https://emscripten.org/docs/tools_reference/settings_reference.html. * Update CMakeOptions.txt Removed clutter. * Update CompileDefinitions.cmake Removed clutter. * Update CompileDefinitions.cmake Some applications might check for PLATFORM_WEB instead of __EMSCRIPTEN__. * Update CompileDefinitions.cmake Reverting * Update CMakeLists.txt USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update CompileDefinitions.cmake USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update ParseConfigHeader.cmake * Revert "Update CMakeLists.txt" This reverts commit 1785fc06b5b89e65515cea3afd3e3c095f15e350. * Revert "Update CompileDefinitions.cmake" This reverts commit 62f9a3a0ea21af7bd0a1ab74d10a305fca2a5695. * Revert "Update CMakeLists.txt" This reverts commit 3e7912144edc5c69c53ed5a9515ae21d66937963. * Revert "Update LibraryConfigurations.cmake" This reverts commit bcc4310c4960c200c340671caa298983340ea386. --- CMakeOptions.txt | 84 ++------------------- cmake/CompileDefinitions.cmake | 130 ++++----------------------------- cmake/ParseConfigHeader.cmake | 17 +++++ 3 files changed, 38 insertions(+), 193 deletions(-) create mode 100644 cmake/ParseConfigHeader.cmake diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 2c58cd5cc227..b063f02a1516 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -1,4 +1,4 @@ -### Config options ### +# ## Config options ### include(CMakeDependentOption) include(EnumOption) @@ -9,14 +9,14 @@ enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific # Configuration options option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN}) option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF) -option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF) +option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF) option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF) option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF) # Shared library is always PIC. Static library should be PIC too if linked into a shared library option(WITH_PIC "Compile static library as position-independent code" OFF) option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF) -option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF) +option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF) cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON) enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one") @@ -28,77 +28,9 @@ option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON) option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF) set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option") -# raylib modules included -cmake_dependent_option(SUPPORT_MODULE_RSHAPES "Include module: rshapes" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_MODULE_RTEXTURES "Include module: rtextures" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_MODULE_RTEXT "Include module: rtext" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_MODULE_RMODELS "Include module: rmodels" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_MODULE_RAUDIO "Include module: raudio" ON CUSTOMIZE_BUILD ON) +include(ParseConfigHeader) -# rcore.c -cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_RPRAND_GENERATOR "Include pseudo-random numbers generator (rprand.h), based on Xoshiro128** and SplitMix64" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_EVENTS_AUTOMATION "Support automatic generated events, loading and recording of those events when required" OFF CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_CUSTOM_FRAME_CONTROL "Enabling this flag allows manual control of the frame processes, use at your own risk" OFF CUSTOMIZE_BUILD OFF) - -# rshapes.c -cmake_dependent_option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON CUSTOMIZE_BUILD ON) - -# rtextures.c -cmake_dependent_option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_PIC "Support loading PIC as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_PNM "Support loading PNM as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF) -cmake_dependent_option(SUPPORT_FILEFORMAT_SVG "Support loading SVG as textures" ${OFF} CUSTOMIZE_BUILD OFF) - -# rtext.c -cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_TEXT_MANIPULATION "Support text manipulation functions" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FONT_ATLAS_WHITE_REC "Support white rec on font atlas bottom-right corner" ON CUSTOMIZE_BUILD ON) - -# rmodels.c -cmake_dependent_option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_VOX "Support loading VOX file format" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_M3D "Support loading M3D file format" ON CUSTOMIZE_BUILD ON) - -# raudio.c -cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_QOA "Support loading QOA for sound" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF) - -# utils.c -cmake_dependent_option(SUPPORT_STANDARD_FILEIO "Support standard file io library (stdio.h)" ON CUSTOMIZE_BUILD ON) -cmake_dependent_option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON CUSTOMIZE_BUILD ON) +foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS) + string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG}) + cmake_dependent_option(${CMAKE_MATCH_1} "" ${CMAKE_MATCH_2} CUSTOMIZE_BUILD ${CMAKE_MATCH_2}) +endforeach() diff --git a/cmake/CompileDefinitions.cmake b/cmake/CompileDefinitions.cmake index cc8324c4be68..0acbe2fa5b96 100644 --- a/cmake/CompileDefinitions.cmake +++ b/cmake/CompileDefinitions.cmake @@ -3,126 +3,22 @@ target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}") target_compile_definitions("raylib" PUBLIC "${GRAPHICS}") function(define_if target variable) - if (${${variable}}) + if(${${variable}}) message(STATUS "${variable}=${${variable}}") - target_compile_definitions(${target} PUBLIC "${variable}") - endif () + target_compile_definitions(${target} PRIVATE "${variable}") + endif() endfunction() -if (${CUSTOMIZE_BUILD}) - target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS) +if(${CUSTOMIZE_BUILD}) + target_compile_definitions("raylib" PRIVATE EXTERNAL_CONFIG_FLAGS) define_if("raylib" USE_AUDIO) - define_if("raylib" SUPPORT_MODULE_RSHAPES) - define_if("raylib" SUPPORT_MODULE_RTEXTURES) - define_if("raylib" SUPPORT_MODULE_RTEXT) - define_if("raylib" SUPPORT_MODULE_RMODELS) - define_if("raylib" SUPPORT_MODULE_RAUDIO) - define_if("raylib" SUPPORT_CAMERA_SYSTEM) - define_if("raylib" SUPPORT_GESTURES_SYSTEM) - define_if("raylib" SUPPORT_MOUSE_GESTURES) - define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI) - define_if("raylib" SUPPORT_DEFAULT_FONT) - define_if("raylib" SUPPORT_SCREEN_CAPTURE) - define_if("raylib" SUPPORT_GIF_RECORDING) - define_if("raylib" SUPPORT_BUSY_WAIT_LOOP) - define_if("raylib" SUPPORT_EVENTS_WAITING) - define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER) - define_if("raylib" SUPPORT_COMPRESSION_API) - define_if("raylib" SUPPORT_EVENTS_AUTOMATION) - define_if("raylib" SUPPORT_CUSTOM_FRAME_CONTROL) - define_if("raylib" SUPPORT_QUADS_DRAW_MODE) - define_if("raylib" SUPPORT_IMAGE_EXPORT) - define_if("raylib" SUPPORT_IMAGE_GENERATION) - define_if("raylib" SUPPORT_IMAGE_MANIPULATION) - define_if("raylib" SUPPORT_FILEFORMAT_PNG) - define_if("raylib" SUPPORT_FILEFORMAT_DDS) - define_if("raylib" SUPPORT_FILEFORMAT_HDR) - define_if("raylib" SUPPORT_FILEFORMAT_PIC) - define_if("raylib" SUPPORT_FILEFORMAT_PNM) - define_if("raylib" SUPPORT_FILEFORMAT_KTX) - define_if("raylib" SUPPORT_FILEFORMAT_ASTC) - define_if("raylib" SUPPORT_FILEFORMAT_BMP) - define_if("raylib" SUPPORT_FILEFORMAT_TGA) - define_if("raylib" SUPPORT_FILEFORMAT_JPG) - define_if("raylib" SUPPORT_FILEFORMAT_GIF) - define_if("raylib" SUPPORT_FILEFORMAT_QOI) - define_if("raylib" SUPPORT_FILEFORMAT_PSD) - define_if("raylib" SUPPORT_FILEFORMAT_PKM) - define_if("raylib" SUPPORT_FILEFORMAT_PVR) - define_if("raylib" SUPPORT_FILEFORMAT_SVG) - define_if("raylib" SUPPORT_FILEFORMAT_FNT) - define_if("raylib" SUPPORT_FILEFORMAT_TTF) - define_if("raylib" SUPPORT_TEXT_MANIPULATION) - define_if("raylib" SUPPORT_MESH_GENERATION) - define_if("raylib" SUPPORT_FILEFORMAT_OBJ) - define_if("raylib" SUPPORT_FILEFORMAT_MTL) - define_if("raylib" SUPPORT_FILEFORMAT_IQM) - define_if("raylib" SUPPORT_FILEFORMAT_GLTF) - define_if("raylib" SUPPORT_FILEFORMAT_VOX) - define_if("raylib" SUPPORT_FILEFORMAT_M3D) - define_if("raylib" SUPPORT_FILEFORMAT_WAV) - define_if("raylib" SUPPORT_FILEFORMAT_OGG) - define_if("raylib" SUPPORT_FILEFORMAT_XM) - define_if("raylib" SUPPORT_FILEFORMAT_MOD) - define_if("raylib" SUPPORT_FILEFORMAT_MP3) - define_if("raylib" SUPPORT_FILEFORMAT_QOA) - define_if("raylib" SUPPORT_FILEFORMAT_FLAC) - define_if("raylib" SUPPORT_STANDARD_FILEIO) - define_if("raylib" SUPPORT_TRACELOG) - if (UNIX AND NOT APPLE) - target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096") - else () - target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=512") - endif () - - target_compile_definitions("raylib" PUBLIC "MAX_GAMEPADS=4") - target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_AXIS=8") - target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_BUTTONS=32") - target_compile_definitions("raylib" PUBLIC "MAX_TOUCH_POINTS=10") - target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16") - - target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"") - target_compile_definitions("raylib" PUBLIC "MAX_CHAR_PRESSED_QUEUE=16") - target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64") - - if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11") - target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=8192") - elseif (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES2") - target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=2048") - endif () - - target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_DRAWCALLS=256") - target_compile_definitions("raylib" PUBLIC "MAX_MATRIX_STACK_SIZE=32") - target_compile_definitions("raylib" PUBLIC "MAX_SHADER_LOCATIONS=32") - target_compile_definitions("raylib" PUBLIC "MAX_MATERIAL_MAPS=12") - target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_NEAR=0.01") - target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_FAR=1000.0") - - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION=0") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD=1") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL=2") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR=3") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT=4") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2=5") - - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION=\"vertexPosition\"") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD=\"vertexTexCoord\"") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL=\"vertexNormal\"") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR=\"vertexColor\"") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT=\"vertexTangent\"") - target_compile_definitions("raylib" PUBLIC "RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2=\"vertexTexCoord2\"") - - target_compile_definitions("raylib" PUBLIC "MAX_TEXT_BUFFER_LENGTH=1024") - target_compile_definitions("raylib" PUBLIC "MAX_TEXT_UNICODE_CHARS=512") - target_compile_definitions("raylib" PUBLIC "MAX_TEXTSPLIT_COUNT=128") - - target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_FORMAT=ma_format_f32") - target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_CHANNELS=2") - target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_SAMPLE_RATE=44100") - target_compile_definitions("raylib" PUBLIC "DEFAULT_AUDIO_BUFFER_SIZE=4096") - - target_compile_definitions("raylib" PUBLIC "MAX_TRACELOG_MSG_LENGTH=128") - target_compile_definitions("raylib" PUBLIC "MAX_UWP_MESSAGES=512") -endif () + foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS) + string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG}) + define_if("raylib" ${CMAKE_MATCH_1}) + endforeach() + foreach(VALUE IN LISTS CONFIG_HEADER_VALUES) + target_compile_definitions("raylib" PRIVATE ${VALUE}) + endforeach() +endif() diff --git a/cmake/ParseConfigHeader.cmake b/cmake/ParseConfigHeader.cmake new file mode 100644 index 000000000000..797eea3cd69d --- /dev/null +++ b/cmake/ParseConfigHeader.cmake @@ -0,0 +1,17 @@ +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/config.h" CONFIG_HEADER_CONTENT) + +set(BLANK_OR_BACKSLASH_PATTERN "[ \t\r\n\\]") +set(VALID_IDENTIFIER_PATTERN "[A-Za-z_]+[A-Za-z_0-9]*") +set(VALID_VALUE_PATTERN [=["?[A-Za-z_0-9.-]+"?]=]) # not really correct but does the job since the config.h file hopefully will have been checked by a C preprocessor. +set(MACRO_REGEX "(//${BLANK_OR_BACKSLASH_PATTERN}*)?\#define${BLANK_OR_BACKSLASH_PATTERN}+(${VALID_IDENTIFIER_PATTERN})${BLANK_OR_BACKSLASH_PATTERN}+(${VALID_VALUE_PATTERN})") + +string(REGEX MATCHALL ${MACRO_REGEX} MACRO_LIST ${CONFIG_HEADER_CONTENT}) + +set(CONFIG_HEADER_FLAGS ${MACRO_LIST}) +list(FILTER CONFIG_HEADER_FLAGS INCLUDE REGEX "^.+SUPPORT_") +list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=OFF]] REGEX "^//") +list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=ON]]) + +set(CONFIG_HEADER_VALUES ${MACRO_LIST}) +list(FILTER CONFIG_HEADER_VALUES EXCLUDE REGEX "(^.+SUPPORT_)|(^//)") +list(TRANSFORM CONFIG_HEADER_VALUES REPLACE ${MACRO_REGEX} [[\2=\3]]) From dcf2f6a8e97911c90efce5722bd7f0c7cdc8601e Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 16 Jun 2024 11:17:34 +0200 Subject: [PATCH 50/71] Added note about performace #4067 --- examples/models/models_waving_cubes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/models/models_waving_cubes.c b/examples/models/models_waving_cubes.c index 5dc1fc4aa74e..521a4afd516e 100644 --- a/examples/models/models_waving_cubes.c +++ b/examples/models/models_waving_cubes.c @@ -89,6 +89,8 @@ int main() }; // Pick a color with a hue depending on cube position for the rainbow color effect + // NOTE: This function is quite costly to be done per cube and frame, + // pre-catching the results into a separate array could improve performance Color cubeColor = ColorFromHSV((float)(((x + y + z)*18)%360), 0.75f, 0.9f); // Calculate cube size From 52f2a10db610d0e9f619fd7c521db08a876547d0 Mon Sep 17 00:00:00 2001 From: Anthony Carbajal <5776225+CrackedPixel@users.noreply.github.com> Date: Mon, 17 Jun 2024 06:42:53 -0500 Subject: [PATCH 51/71] fixed issue with GetScreenWidth/GetScreenHeight (#4074) --- src/platforms/rcore_desktop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index 6fe054a8aa59..bb3fcf4f0cd5 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -666,6 +666,9 @@ void SetWindowMaxSize(int width, int height) // Set window dimensions void SetWindowSize(int width, int height) { + CORE.Window.screen.width = width; + CORE.Window.screen.height = height; + glfwSetWindowSize(platform.handle, width, height); } From e7acdd12d8b02617728f11720725ca989fe2390b Mon Sep 17 00:00:00 2001 From: manuel5975p Date: Fri, 21 Jun 2024 09:07:01 +0200 Subject: [PATCH 52/71] [build] CMake: support OpenGL ES3 in `LibraryConfigurations.cmake` (#4079) * Allow ES3 in LibraryConfigurations.cmake * Put FULL_ES3 as linker option --- cmake/LibraryConfigurations.cmake | 4 +++- src/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index f6dd4f314ba7..6d2250c715be 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -58,7 +58,9 @@ if (${PLATFORM} MATCHES "Desktop") elseif (${PLATFORM} MATCHES "Web") set(PLATFORM_CPP "PLATFORM_WEB") - set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + if(NOT GRAPHICS) + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + endif() set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") elseif (${PLATFORM} MATCHES "Android") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bfb4b05b57b7..4ba1c700732a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,6 +70,9 @@ endif() if (${PLATFORM} MATCHES "Web") target_link_options(raylib PUBLIC "-sUSE_GLFW=3") + if(${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES3") + target_link_options(raylib PUBLIC "-sFULL_ES3=1") + endif() endif() set_target_properties(raylib PROPERTIES From 0d59235adef78ca11e1d6940521815b3b0786286 Mon Sep 17 00:00:00 2001 From: Anthony Carbajal <5776225+CrackedPixel@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:15:21 -0500 Subject: [PATCH 53/71] add warning log multiple of 4 (#4080) --- src/external/rl_gputex.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/external/rl_gputex.h b/src/external/rl_gputex.h index c577305522cd..6b26d1c8d9b0 100644 --- a/src/external/rl_gputex.h +++ b/src/external/rl_gputex.h @@ -171,6 +171,10 @@ void *rl_load_dds_from_memory(const unsigned char *file_data, unsigned int file_ *width = header->width; *height = header->height; + + if (*width % 4 != 0) LOG("WARNING: IMAGE: DDS file width must be multiple of 4. Image will not display correctly"); + if (*height % 4 != 0) LOG("WARNING: IMAGE: DDS file height must be multiple of 4. Image will not display correctly"); + image_pixel_size = header->width*header->height; if (header->mipmap_count == 0) *mips = 1; // Parameter not used From 28f88fd9840057991a1573212a497b0123631fbc Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Sat, 22 Jun 2024 18:16:36 +0100 Subject: [PATCH 54/71] Fix mistakes in example usages in raylib_parser help text (#4084) --- parser/raylib_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 63f957284aca..cfb0133c3d2e 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -1100,7 +1100,7 @@ static void ShowCommandLineInfo(void) printf(" NOTE: If not specified, defaults to: raylib_api.txt\n\n"); printf(" -f, --format : Define output format for parser data.\n"); printf(" Supported types: DEFAULT, JSON, XML, LUA, CODE\n\n"); - printf(" -d, --define : Define functions specifiers (i.e. RLAPI for raylib.h, RMDEF for raymath.h, etc.)\n"); + printf(" -d, --define : Define functions specifiers (i.e. RLAPI for raylib.h, RMAPI for raymath.h, etc.)\n"); printf(" NOTE: If no specifier defined, defaults to: RLAPI\n\n"); printf(" -t, --truncate : Define string to truncate input after (i.e. \"RLGL IMPLEMENTATION\" for rlgl.h)\n"); printf(" NOTE: If not specified, the full input file is parsed.\n\n"); @@ -1110,7 +1110,7 @@ static void ShowCommandLineInfo(void) printf(" Process to generate \n\n"); printf(" > raylib_parser --output raylib_data.info --format XML\n"); printf(" Process to generate as XML text data\n\n"); - printf(" > raylib_parser --input raymath.h --output raymath_data.info --format XML\n"); + printf(" > raylib_parser --input raymath.h --output raymath_data.info --format XML --define RMAPI\n"); printf(" Process to generate as XML text data\n\n"); } From b0d49579c17e7b2bcebd0afc0b8cdb7314b5f41d Mon Sep 17 00:00:00 2001 From: Alice Nyaa <62451415+Minnowo@users.noreply.github.com> Date: Sat, 22 Jun 2024 13:17:31 -0400 Subject: [PATCH 55/71] fixed LoadCodepoints returning a freed ptr when count is 0 (#4089) --- src/rtext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 6ad0f90a0e9e..62d786eacc5d 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1892,8 +1892,7 @@ int *LoadCodepoints(const char *text, int *count) } // Re-allocate buffer to the actual number of codepoints loaded - int *temp = (int *)RL_REALLOC(codepoints, codepointCount*sizeof(int)); - if (temp != NULL) codepoints = temp; + codepoints = (int *)RL_REALLOC(codepoints, codepointCount*sizeof(int)); *count = codepointCount; From 5ba18575decc14409d9aecb6614624abb7a313b6 Mon Sep 17 00:00:00 2001 From: manuel5975p Date: Sat, 22 Jun 2024 19:20:33 +0200 Subject: [PATCH 56/71] [build] CMake: pass -sFULL_ES3 instead of -sFULL_ES3=1 (#4090) * Allow ES3 in LibraryConfigurations.cmake * Put FULL_ES3 as linker option * Remove =1 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ba1c700732a..c1360ee299e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,7 +71,7 @@ endif() if (${PLATFORM} MATCHES "Web") target_link_options(raylib PUBLIC "-sUSE_GLFW=3") if(${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES3") - target_link_options(raylib PUBLIC "-sFULL_ES3=1") + target_link_options(raylib PUBLIC "-sFULL_ES3") endif() endif() From d582becbc2a358202de65cac39bd68ed9148a731 Mon Sep 17 00:00:00 2001 From: Paul Melis Date: Sat, 22 Jun 2024 19:42:11 +0200 Subject: [PATCH 57/71] [rmodels] Initial work to correctly handle the node hierarchy in a glTF file (#4037) * Initial work to correctly handle the node hierarchy in a glTF file. Static meshes seem to work fine in my tests. Haven't tried anything animated yet, but it's almost certainly broken. * Fix variable naming, some comment tweaks * Only count primitives made up of triangles in glTF meshes * Update processing of gltf mesh animation data, to match earlier changes to vertex/normal/tangent data --- src/rmodels.c | 143 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 112 insertions(+), 31 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 308fb0a70ba3..e48ec9dfd133 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4895,6 +4895,7 @@ static Model LoadGLTF(const char *fileName) /********************************************************************************************* Function implemented by Wilhem Barbier(@wbrbr), with modifications by Tyler Bezera(@gamerfiend) + Transform handling implemented by Paul Melis (@paulmelis). Reviewed by Ramon Santamaria (@raysan5) FEATURES: @@ -4904,6 +4905,10 @@ static Model LoadGLTF(const char *fileName) PBR specular/glossiness flow and extended texture flows not supported - Supports multiple meshes per model (every primitives is loaded as a separate mesh) - Supports basic animations + - Transforms, including parent-child relations, are applied on the mesh data, but the + hierarchy is not kept (as it can't be represented). + - Mesh instances in the glTF file (i.e. same mesh linked from multiple nodes) + are turned into separate raylib Meshes. RESTRICTIONS: - Only triangle meshes supported @@ -4913,7 +4918,8 @@ static Model LoadGLTF(const char *fileName) > Texcoords: vec2: float > Colors: vec4: u8, u16, f32 (normalized) > Indices: u16, u32 (truncated to u16) - - Node hierarchies or transforms not supported + - Scenes defined in the glTF file are ignored. All nodes in the file + are used. ***********************************************************************************************/ @@ -4965,8 +4971,22 @@ static Model LoadGLTF(const char *fileName) if (result != cgltf_result_success) TRACELOG(LOG_INFO, "MODEL: [%s] Failed to load mesh/material buffers", fileName); int primitivesCount = 0; - // NOTE: We will load every primitive in the glTF as a separate raylib mesh - for (unsigned int i = 0; i < data->meshes_count; i++) primitivesCount += (int)data->meshes[i].primitives_count; + // NOTE: We will load every primitive in the glTF as a separate raylib Mesh. + // Determine total number of meshes needed from the node hierarchy. + for (unsigned int i = 0; i < data->nodes_count; i++) + { + cgltf_node *node = &(data->nodes[i]); + cgltf_mesh *mesh = node->mesh; + if (!mesh) + continue; + + for (unsigned int p = 0; p < mesh->primitives_count; p++) + { + if (mesh->primitives[p].type == cgltf_primitive_type_triangles) + primitivesCount++; + } + } + TRACELOG(LOG_DEBUG, " > Primitives (triangles only) count based on hierarchy : %i", primitivesCount); // Load our model data: meshes and materials model.meshCount = primitivesCount; @@ -5069,27 +5089,51 @@ static Model LoadGLTF(const char *fileName) // has_clearcoat, has_transmission, has_volume, has_ior, has specular, has_sheen } - // Load meshes data + // Visit each node in the hierarchy and process any mesh linked from it. + // Each primitive within a glTF node becomes a Raylib Mesh. + // The local-to-world transform of each node is used to transform the + // points/normals/tangents of the created Mesh(es). + // Any glTF mesh linked from more than one Node (i.e. instancing) + // is turned into multiple Mesh's, as each Node will have its own + // transform applied. + // Note: the code below disregards the scenes defined in the file, all nodes are used. //---------------------------------------------------------------------------------------------------- - for (unsigned int i = 0, meshIndex = 0; i < data->meshes_count; i++) + int meshIndex = 0; + for (unsigned int i = 0; i < data->nodes_count; i++) { - // NOTE: meshIndex accumulates primitives + cgltf_node *node = &(data->nodes[i]); - for (unsigned int p = 0; p < data->meshes[i].primitives_count; p++) + cgltf_mesh *mesh = node->mesh; + if (!mesh) + continue; + + cgltf_float worldTransform[16]; + cgltf_node_transform_world(node, worldTransform); + + Matrix worldMatrix = { + worldTransform[0], worldTransform[4], worldTransform[8], worldTransform[12], + worldTransform[1], worldTransform[5], worldTransform[9], worldTransform[13], + worldTransform[2], worldTransform[6], worldTransform[10], worldTransform[14], + worldTransform[3], worldTransform[7], worldTransform[11], worldTransform[15] + }; + + Matrix worldMatrixNormals = MatrixTranspose(MatrixInvert(worldMatrix)); + + for (unsigned int p = 0; p < mesh->primitives_count; p++) { // NOTE: We only support primitives defined by triangles // Other alternatives: points, lines, line_strip, triangle_strip - if (data->meshes[i].primitives[p].type != cgltf_primitive_type_triangles) continue; + if (mesh->primitives[p].type != cgltf_primitive_type_triangles) continue; // NOTE: Attributes data could be provided in several data formats (8, 8u, 16u, 32...), // Only some formats for each attribute type are supported, read info at the top of this function! - for (unsigned int j = 0; j < data->meshes[i].primitives[p].attributes_count; j++) + for (unsigned int j = 0; j < mesh->primitives[p].attributes_count; j++) { // Check the different attributes for every primitive - if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_position) // POSITION, vec3, float + if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_position) // POSITION, vec3, float { - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; // WARNING: SPECS: POSITION accessor MUST have its min and max properties defined @@ -5101,12 +5145,22 @@ static Model LoadGLTF(const char *fileName) // Load 3 components of float data type into mesh.vertices LOAD_ATTRIBUTE(attribute, 3, float, model.meshes[meshIndex].vertices) + + // Transform the vertices + float *vertices = model.meshes[meshIndex].vertices; + for (int k = 0; k < attribute->count; k++) + { + Vector3 vt = Vector3Transform((Vector3){ vertices[3*k], vertices[3*k+1], vertices[3*k+2] }, worldMatrix); + vertices[3*k] = vt.x; + vertices[3*k+1] = vt.y; + vertices[3*k+2] = vt.z; + } } else TRACELOG(LOG_WARNING, "MODEL: [%s] Vertices attribute data format not supported, use vec3 float", fileName); } - else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_normal) // NORMAL, vec3, float + else if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_normal) // NORMAL, vec3, float { - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; if ((attribute->type == cgltf_type_vec3) && (attribute->component_type == cgltf_component_type_r_32f)) { @@ -5115,12 +5169,22 @@ static Model LoadGLTF(const char *fileName) // Load 3 components of float data type into mesh.normals LOAD_ATTRIBUTE(attribute, 3, float, model.meshes[meshIndex].normals) + + // Transform the normals + float *normals = model.meshes[meshIndex].normals; + for (int k = 0; k < attribute->count; k++) + { + Vector3 nt = Vector3Transform((Vector3){ normals[3*k], normals[3*k+1], normals[3*k+2] }, worldMatrixNormals); + normals[3*k] = nt.x; + normals[3*k+1] = nt.y; + normals[3*k+2] = nt.z; + } } else TRACELOG(LOG_WARNING, "MODEL: [%s] Normal attribute data format not supported, use vec3 float", fileName); } - else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_tangent) // TANGENT, vec3, float + else if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_tangent) // TANGENT, vec3, float { - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; if ((attribute->type == cgltf_type_vec4) && (attribute->component_type == cgltf_component_type_r_32f)) { @@ -5129,15 +5193,25 @@ static Model LoadGLTF(const char *fileName) // Load 4 components of float data type into mesh.tangents LOAD_ATTRIBUTE(attribute, 4, float, model.meshes[meshIndex].tangents) + + // Transform the tangents + float *tangents = model.meshes[meshIndex].tangents; + for (int k = 0; k < attribute->count; k++) + { + Vector3 tt = Vector3Transform((Vector3){ tangents[3*k], tangents[3*k+1], tangents[3*k+2] }, worldMatrix); + tangents[3*k] = tt.x; + tangents[3*k+1] = tt.y; + tangents[3*k+2] = tt.z; + } } else TRACELOG(LOG_WARNING, "MODEL: [%s] Tangent attribute data format not supported, use vec4 float", fileName); } - else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_texcoord) // TEXCOORD_n, vec2, float/u8n/u16n + else if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_texcoord) // TEXCOORD_n, vec2, float/u8n/u16n { // Support up to 2 texture coordinates attributes float *texcoordPtr = NULL; - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; if (attribute->type == cgltf_type_vec2) { @@ -5181,7 +5255,7 @@ static Model LoadGLTF(const char *fileName) } else TRACELOG(LOG_WARNING, "MODEL: [%s] Texcoords attribute data format not supported, use vec2 float", fileName); - int index = data->meshes[i].primitives[p].attributes[j].index; + int index = mesh->primitives[p].attributes[j].index; if (index == 0) model.meshes[meshIndex].texcoords = texcoordPtr; else if (index == 1) model.meshes[meshIndex].texcoords2 = texcoordPtr; else @@ -5190,9 +5264,9 @@ static Model LoadGLTF(const char *fileName) if (texcoordPtr != NULL) RL_FREE(texcoordPtr); } } - else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_color) // COLOR_n, vec3/vec4, float/u8n/u16n + else if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_color) // COLOR_n, vec3/vec4, float/u8n/u16n { - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; // WARNING: SPECS: All components of each COLOR_n accessor element MUST be clamped to [0.0, 1.0] range @@ -5309,9 +5383,9 @@ static Model LoadGLTF(const char *fileName) } // Load primitive indices data (if provided) - if (data->meshes[i].primitives[p].indices != NULL) + if (mesh->primitives[p].indices != NULL) { - cgltf_accessor *attribute = data->meshes[i].primitives[p].indices; + cgltf_accessor *attribute = mesh->primitives[p].indices; model.meshes[meshIndex].triangleCount = (int)attribute->count/3; @@ -5351,7 +5425,7 @@ static Model LoadGLTF(const char *fileName) // raylib instead assigns to the mesh the by its index, as loaded in model.materials array // To get the index, we check if material pointers match, and we assign the corresponding index, // skipping index 0, the default material - if (&data->materials[m] == data->meshes[i].primitives[p].material) + if (&data->materials[m] == mesh->primitives[p].material) { model.meshMaterial[meshIndex] = m + 1; break; @@ -5401,20 +5475,27 @@ static Model LoadGLTF(const char *fileName) TRACELOG(LOG_ERROR, "MODEL: [%s] can only load one skin (armature) per model, but gltf skins_count == %i", fileName, data->skins_count); } - for (unsigned int i = 0, meshIndex = 0; i < data->meshes_count; i++) + meshIndex = 0; + for (unsigned int i = 0; i < data->nodes_count; i++) { - for (unsigned int p = 0; p < data->meshes[i].primitives_count; p++) + cgltf_node *node = &(data->nodes[i]); + + cgltf_mesh *mesh = node->mesh; + if (!mesh) + continue; + + for (unsigned int p = 0; p < mesh->primitives_count; p++) { // NOTE: We only support primitives defined by triangles - if (data->meshes[i].primitives[p].type != cgltf_primitive_type_triangles) continue; + if (mesh->primitives[p].type != cgltf_primitive_type_triangles) continue; - for (unsigned int j = 0; j < data->meshes[i].primitives[p].attributes_count; j++) + for (unsigned int j = 0; j < mesh->primitives[p].attributes_count; j++) { // NOTE: JOINTS_1 + WEIGHT_1 will be used for +4 joints influencing a vertex -> Not supported by raylib - if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_joints) // JOINTS_n (vec4: 4 bones max per vertex / u8, u16) + if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_joints) // JOINTS_n (vec4: 4 bones max per vertex / u8, u16) { - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; // NOTE: JOINTS_n can only be vec4 and u8/u16 // SPECS: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#meshes-overview @@ -5462,9 +5543,9 @@ static Model LoadGLTF(const char *fileName) } else TRACELOG(LOG_WARNING, "MODEL: [%s] Joint attribute data format not supported", fileName); } - else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_weights) // WEIGHTS_n (vec4, u8n/u16n/f32) + else if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_weights) // WEIGHTS_n (vec4, u8n/u16n/f32) { - cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data; + cgltf_accessor *attribute = mesh->primitives[p].attributes[j].data; if (attribute->type == cgltf_type_vec4) { From 77732540225eabb0ff659710167315265401c772 Mon Sep 17 00:00:00 2001 From: SuperUserNameMan <9801802+SuperUserNameMan@users.noreply.github.com> Date: Sun, 23 Jun 2024 21:14:03 +0200 Subject: [PATCH 58/71] LoadIQM() set model.meshMaterial[] (#4092) --- src/rmodels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index e48ec9dfd133..a169ec50dc94 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4326,6 +4326,8 @@ static Model LoadIQM(const char *fileName) model.materials[i] = LoadMaterialDefault(); model.materials[i].maps[MATERIAL_MAP_ALBEDO].texture = LoadTexture(TextFormat("%s/%s", basePath, material)); + model.meshMaterial[i] = i; + TRACELOG(LOG_DEBUG, "MODEL: [%s] mesh name (%s), material (%s)", fileName, name, material); model.meshes[i].vertexCount = imesh[i].num_vertexes; From 7e50270d496762e7202b61e26ba1c42c47161c4e Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:51:24 +0200 Subject: [PATCH 59/71] [rtextures] Adding triangle drawing function for images (#4094) * adding triangle drawing function for images * remove unnecessary check * fix an iteration mistake --- src/raylib.h | 5 ++ src/rtextures.c | 188 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 9f06462fb251..7195fd55fe8d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1381,6 +1381,11 @@ RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int hei RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image +RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image +RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image +RLAPI void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center) +RLAPI void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) diff --git a/src/rtextures.c b/src/rtextures.c index 2f02afece039..39c0f78f2aae 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3627,6 +3627,194 @@ void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color) ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + rec.height - thick), (int)rec.width, thick, color); } +// Draw triangle within an image +void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color) +{ + // Calculate the 2D bounding box of the triangle + // Determine the minimum and maximum x and y coordinates of the triangle vertices + int xMin = (v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x); + int yMin = (v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y); + int xMax = (v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x); + int yMax = (v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y); + + // Clamp the bounding box to the image dimensions + if (xMin < 0) xMin = 0; + if (yMin < 0) yMin = 0; + if (xMax > dst->width) xMax = dst->width; + if (yMax > dst->height) yMax = dst->height; + + // Check the order of the vertices to determine if it's a front or back face + // NOTE: if signedArea is equal to 0, the face is degenerate + float signedArea = (v2.x - v1.x)*(v3.y - v1.y) - (v3.x - v1.x)*(v2.y - v1.y); + bool isBackFace = (signedArea > 0); + + // Barycentric interpolation setup + // Calculate the step increments for the barycentric coordinates + int w1XStep = v3.y - v2.y, w1YStep = v2.x - v3.x; + int w2XStep = v1.y - v3.y, w2YStep = v3.x - v1.x; + int w3XStep = v2.y - v1.y, w3YStep = v1.x - v2.x; + + // If the triangle is a back face, invert the steps + if (isBackFace) + { + w1XStep = -w1XStep, w1YStep = -w1YStep; + w2XStep = -w2XStep, w2YStep = -w2YStep; + w3XStep = -w3XStep, w3YStep = -w3YStep; + } + + // Calculate the initial barycentric coordinates for the top-left point of the bounding box + int w1Row = (xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y); + int w2Row = (xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y); + int w3Row = (xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y); + + // Rasterization loop + // Iterate through each pixel in the bounding box + for (int y = yMin; y <= yMax; y++) + { + int w1 = w1Row; + int w2 = w2Row; + int w3 = w3Row; + + for (int x = xMin; x <= xMax; x++) + { + // Check if the pixel is inside the triangle using barycentric coordinates + // If it is then we can draw the pixel with the given color + if ((w1 | w2 | w3) >= 0) ImageDrawPixel(dst, x, y, color); + + // Increment the barycentric coordinates for the next pixel + w1 += w1XStep; + w2 += w2XStep; + w3 += w3XStep; + } + + // Move to the next row in the bounding box + w1Row += w1YStep; + w2Row += w2YStep; + w3Row += w3YStep; + } +} + +// Draw triangle with interpolated colors within an image +void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3) +{ + // Calculate the 2D bounding box of the triangle + // Determine the minimum and maximum x and y coordinates of the triangle vertices + int xMin = (v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x); + int yMin = (v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y); + int xMax = (v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x); + int yMax = (v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y); + + // Clamp the bounding box to the image dimensions + if (xMin < 0) xMin = 0; + if (yMin < 0) yMin = 0; + if (xMax > dst->width) xMax = dst->width; + if (yMax > dst->height) yMax = dst->height; + + // Check the order of the vertices to determine if it's a front or back face + // NOTE: if signedArea is equal to 0, the face is degenerate + float signedArea = (v2.x - v1.x)*(v3.y - v1.y) - (v3.x - v1.x)*(v2.y - v1.y); + bool isBackFace = (signedArea > 0); + + // Barycentric interpolation setup + // Calculate the step increments for the barycentric coordinates + int w1XStep = v3.y - v2.y, w1YStep = v2.x - v3.x; + int w2XStep = v1.y - v3.y, w2YStep = v3.x - v1.x; + int w3XStep = v2.y - v1.y, w3YStep = v1.x - v2.x; + + // If the triangle is a back face, invert the steps + if (isBackFace) + { + w1XStep = -w1XStep, w1YStep = -w1YStep; + w2XStep = -w2XStep, w2YStep = -w2YStep; + w3XStep = -w3XStep, w3YStep = -w3YStep; + } + + // Calculate the initial barycentric coordinates for the top-left point of the bounding box + int w1Row = (xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y); + int w2Row = (xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y); + int w3Row = (xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y); + + // Calculate the inverse of the sum of the barycentric coordinates for normalization + // NOTE 1: Here, we act as if we multiply by 255 the reciprocal, which avoids additional + // calculations in the loop. This is acceptable because we are only interpolating colors. + // NOTE 2: This sum remains constant throughout the triangle + float wInvSum = 255.0f/(w1Row + w2Row + w3Row); + + // Rasterization loop + // Iterate through each pixel in the bounding box + for (int y = yMin; y <= yMax; y++) + { + int w1 = w1Row; + int w2 = w2Row; + int w3 = w3Row; + + for (int x = xMin; x <= xMax; x++) + { + // Check if the pixel is inside the triangle using barycentric coordinates + if ((w1 | w2 | w3) >= 0) + { + // Compute the normalized barycentric coordinates + unsigned char aW1 = (unsigned char)((float)w1*wInvSum); + unsigned char aW2 = (unsigned char)((float)w2*wInvSum); + unsigned char aW3 = (unsigned char)((float)w3*wInvSum); + + // Interpolate the color using the barycentric coordinates + Color finalColor = { 0 }; + finalColor.r = (c1.r*aW1 + c2.r*aW2 + c3.r*aW3)/255; + finalColor.g = (c1.g*aW1 + c2.g*aW2 + c3.g*aW3)/255; + finalColor.b = (c1.b*aW1 + c2.b*aW2 + c3.b*aW3)/255; + finalColor.a = (c1.a*aW1 + c2.a*aW2 + c3.a*aW3)/255; + + // Draw the pixel with the interpolated color + ImageDrawPixel(dst, x, y, finalColor); + } + + // Increment the barycentric coordinates for the next pixel + w1 += w1XStep; + w2 += w2XStep; + w3 += w3XStep; + } + + // Move to the next row in the bounding box + w1Row += w1YStep; + w2Row += w2YStep; + w3Row += w3YStep; + } +} + +// Draw triangle outline within an image +void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color) +{ + ImageDrawLine(dst, v1.x, v1.y, v2.x, v2.y, color); + ImageDrawLine(dst, v2.x, v2.y, v3.x, v3.y, color); + ImageDrawLine(dst, v3.x, v3.y, v1.x, v1.y, color); +} + +// Draw a triangle fan defined by points within an image (first vertex is the center) +void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color) +{ + if (pointCount >= 3) + { + for (int i = 1; i < pointCount - 1; i++) + { + ImageDrawTriangle(dst, points[0], points[i], points[i + 1], color); + } + } +} + +// Draw a triangle strip defined by points within an image +void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color) +{ + if (pointCount >= 3) + { + for (int i = 2; i < pointCount; i++) + { + if ((i%2) == 0) ImageDrawTriangle(dst, points[i], points[i - 2], points[i - 1], color); + else ImageDrawTriangle(dst, points[i], points[i - 1], points[i - 2], color); + } + } +} + // Draw an image (source) within an image (destination) // NOTE: Color tint is applied to source image void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint) From c7bda3d10fe27051ad41cdb30146a884ce6b35af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 23 Jun 2024 20:51:38 +0000 Subject: [PATCH 60/71] Update raylib_api.* by CI --- parser/output/raylib_api.json | 135 +++++++++ parser/output/raylib_api.lua | 60 ++++ parser/output/raylib_api.txt | 501 ++++++++++++++++++---------------- parser/output/raylib_api.xml | 37 ++- 4 files changed, 504 insertions(+), 229 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index ad49b64a5ba7..c4577e68dbf3 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -8013,6 +8013,141 @@ } ] }, + { + "name": "ImageDrawTriangle", + "description": "Draw triangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTriangleEx", + "description": "Draw triangle with interpolated colors within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "c1" + }, + { + "type": "Color", + "name": "c2" + }, + { + "type": "Color", + "name": "c3" + } + ] + }, + { + "name": "ImageDrawTriangleLines", + "description": "Draw triangle outline within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTriangleFan", + "description": "Draw a triangle fan defined by points within an image (first vertex is the center)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTriangleStrip", + "description": "Draw a triangle strip defined by points within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "ImageDraw", "description": "Draw a source image within a destination image (tint applied to source)", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 2918b934c885..7cd1b5f20a41 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5970,6 +5970,66 @@ return { {type = "Color", name = "color"} } }, + { + name = "ImageDrawTriangle", + description = "Draw triangle within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "v1"}, + {type = "Vector2", name = "v2"}, + {type = "Vector2", name = "v3"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawTriangleEx", + description = "Draw triangle with interpolated colors within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "v1"}, + {type = "Vector2", name = "v2"}, + {type = "Vector2", name = "v3"}, + {type = "Color", name = "c1"}, + {type = "Color", name = "c2"}, + {type = "Color", name = "c3"} + } + }, + { + name = "ImageDrawTriangleLines", + description = "Draw triangle outline within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "v1"}, + {type = "Vector2", name = "v2"}, + {type = "Vector2", name = "v3"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawTriangleFan", + description = "Draw a triangle fan defined by points within an image (first vertex is the center)", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2 *", name = "points"}, + {type = "int", name = "pointCount"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawTriangleStrip", + description = "Draw a triangle strip defined by points within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2 *", name = "points"}, + {type = "int", name = "pointCount"}, + {type = "Color", name = "color"} + } + }, { name = "ImageDraw", description = "Draw a source image within a destination image (tint applied to source)", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index ffcea16159d1..5b09bb972840 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 566 +Functions found: 571 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3084,7 +3084,52 @@ Function 339: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 340: ImageDraw() (5 input parameters) +Function 340: ImageDrawTriangle() (5 input parameters) + Name: ImageDrawTriangle + Return type: void + Description: Draw triangle within an image + Param[1]: dst (type: Image *) + Param[2]: v1 (type: Vector2) + Param[3]: v2 (type: Vector2) + Param[4]: v3 (type: Vector2) + Param[5]: color (type: Color) +Function 341: ImageDrawTriangleEx() (7 input parameters) + Name: ImageDrawTriangleEx + Return type: void + Description: Draw triangle with interpolated colors within an image + Param[1]: dst (type: Image *) + Param[2]: v1 (type: Vector2) + Param[3]: v2 (type: Vector2) + Param[4]: v3 (type: Vector2) + Param[5]: c1 (type: Color) + Param[6]: c2 (type: Color) + Param[7]: c3 (type: Color) +Function 342: ImageDrawTriangleLines() (5 input parameters) + Name: ImageDrawTriangleLines + Return type: void + Description: Draw triangle outline within an image + Param[1]: dst (type: Image *) + Param[2]: v1 (type: Vector2) + Param[3]: v2 (type: Vector2) + Param[4]: v3 (type: Vector2) + Param[5]: color (type: Color) +Function 343: 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) + Param[1]: dst (type: Image *) + Param[2]: points (type: Vector2 *) + Param[3]: pointCount (type: int) + Param[4]: color (type: Color) +Function 344: ImageDrawTriangleStrip() (4 input parameters) + Name: ImageDrawTriangleStrip + Return type: void + Description: Draw a triangle strip defined by points within an image + Param[1]: dst (type: Image *) + Param[2]: points (type: Vector2 *) + Param[3]: pointCount (type: int) + Param[4]: color (type: Color) +Function 345: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3093,7 +3138,7 @@ Function 340: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 341: ImageDrawText() (6 input parameters) +Function 346: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3103,7 +3148,7 @@ Function 341: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 342: ImageDrawTextEx() (7 input parameters) +Function 347: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3114,79 +3159,79 @@ Function 342: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 343: LoadTexture() (1 input parameters) +Function 348: 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 344: LoadTextureFromImage() (1 input parameters) +Function 349: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 345: LoadTextureCubemap() (2 input parameters) +Function 350: 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 346: LoadRenderTexture() (2 input parameters) +Function 351: 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 347: IsTextureReady() (1 input parameters) +Function 352: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 348: UnloadTexture() (1 input parameters) +Function 353: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 349: IsRenderTextureReady() (1 input parameters) +Function 354: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 350: UnloadRenderTexture() (1 input parameters) +Function 355: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 351: UpdateTexture() (2 input parameters) +Function 356: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 352: UpdateTextureRec() (3 input parameters) +Function 357: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 353: GenTextureMipmaps() (1 input parameters) +Function 358: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 354: SetTextureFilter() (2 input parameters) +Function 359: 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 355: SetTextureWrap() (2 input parameters) +Function 360: 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 356: DrawTexture() (4 input parameters) +Function 361: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3194,14 +3239,14 @@ Function 356: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 357: DrawTextureV() (3 input parameters) +Function 362: 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 358: DrawTextureEx() (5 input parameters) +Function 363: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3210,7 +3255,7 @@ Function 358: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 359: DrawTextureRec() (4 input parameters) +Function 364: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3218,7 +3263,7 @@ Function 359: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 360: DrawTexturePro() (6 input parameters) +Function 365: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3228,7 +3273,7 @@ Function 360: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 361: DrawTextureNPatch() (6 input parameters) +Function 366: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3238,112 +3283,112 @@ Function 361: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 362: ColorIsEqual() (2 input parameters) +Function 367: 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 363: Fade() (2 input parameters) +Function 368: 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 364: ColorToInt() (1 input parameters) +Function 369: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 365: ColorNormalize() (1 input parameters) +Function 370: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 366: ColorFromNormalized() (1 input parameters) +Function 371: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 367: ColorToHSV() (1 input parameters) +Function 372: 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 368: ColorFromHSV() (3 input parameters) +Function 373: 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 369: ColorTint() (2 input parameters) +Function 374: 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 370: ColorBrightness() (2 input parameters) +Function 375: 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 371: ColorContrast() (2 input parameters) +Function 376: 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 372: ColorAlpha() (2 input parameters) +Function 377: 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 373: ColorAlphaBlend() (3 input parameters) +Function 378: 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 374: GetColor() (1 input parameters) +Function 379: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 375: GetPixelColor() (2 input parameters) +Function 380: 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 376: SetPixelColor() (3 input parameters) +Function 381: 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 377: GetPixelDataSize() (3 input parameters) +Function 382: 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 378: GetFontDefault() (0 input parameters) +Function 383: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 379: LoadFont() (1 input parameters) +Function 384: 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 380: LoadFontEx() (4 input parameters) +Function 385: 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 setFont @@ -3351,14 +3396,14 @@ Function 380: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 381: LoadFontFromImage() (3 input parameters) +Function 386: 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 382: LoadFontFromMemory() (6 input parameters) +Function 387: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3368,12 +3413,12 @@ Function 382: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 383: IsFontReady() (1 input parameters) +Function 388: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 384: LoadFontData() (6 input parameters) +Function 389: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3383,7 +3428,7 @@ Function 384: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 385: GenImageFontAtlas() (6 input parameters) +Function 390: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3393,30 +3438,30 @@ Function 385: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 386: UnloadFontData() (2 input parameters) +Function 391: 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 387: UnloadFont() (1 input parameters) +Function 392: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 388: ExportFontAsCode() (2 input parameters) +Function 393: 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 389: DrawFPS() (2 input parameters) +Function 394: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 390: DrawText() (5 input parameters) +Function 395: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3425,7 +3470,7 @@ Function 390: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 391: DrawTextEx() (6 input parameters) +Function 396: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3435,7 +3480,7 @@ Function 391: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 392: DrawTextPro() (8 input parameters) +Function 397: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3447,7 +3492,7 @@ Function 392: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 393: DrawTextCodepoint() (5 input parameters) +Function 398: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3456,7 +3501,7 @@ Function 393: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 394: DrawTextCodepoints() (7 input parameters) +Function 399: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3467,18 +3512,18 @@ Function 394: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 395: SetTextLineSpacing() (1 input parameters) +Function 400: 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 396: MeasureText() (2 input parameters) +Function 401: 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 397: MeasureTextEx() (4 input parameters) +Function 402: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3486,195 +3531,195 @@ Function 397: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 398: GetGlyphIndex() (2 input parameters) +Function 403: 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 399: GetGlyphInfo() (2 input parameters) +Function 404: 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 400: GetGlyphAtlasRec() (2 input parameters) +Function 405: 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 401: LoadUTF8() (2 input parameters) +Function 406: 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 402: UnloadUTF8() (1 input parameters) +Function 407: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 403: LoadCodepoints() (2 input parameters) +Function 408: 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 404: UnloadCodepoints() (1 input parameters) +Function 409: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 405: GetCodepointCount() (1 input parameters) +Function 410: 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 406: GetCodepoint() (2 input parameters) +Function 411: 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 407: GetCodepointNext() (2 input parameters) +Function 412: 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 408: GetCodepointPrevious() (2 input parameters) +Function 413: 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 409: CodepointToUTF8() (2 input parameters) +Function 414: 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 410: TextCopy() (2 input parameters) +Function 415: 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 411: TextIsEqual() (2 input parameters) +Function 416: 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 412: TextLength() (1 input parameters) +Function 417: 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 413: TextFormat() (2 input parameters) +Function 418: 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 414: TextSubtext() (3 input parameters) +Function 419: 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 415: TextReplace() (3 input parameters) +Function 420: 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 416: TextInsert() (3 input parameters) +Function 421: 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 417: TextJoin() (3 input parameters) +Function 422: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 418: TextSplit() (3 input parameters) +Function 423: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 419: TextAppend() (3 input parameters) +Function 424: 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 420: TextFindIndex() (2 input parameters) +Function 425: 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 421: TextToUpper() (1 input parameters) +Function 426: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 422: TextToLower() (1 input parameters) +Function 427: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 423: TextToPascal() (1 input parameters) +Function 428: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 424: TextToSnake() (1 input parameters) +Function 429: TextToSnake() (1 input parameters) Name: TextToSnake Return type: const char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 425: TextToCamel() (1 input parameters) +Function 430: TextToCamel() (1 input parameters) Name: TextToCamel Return type: const char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 426: TextToInteger() (1 input parameters) +Function 431: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 427: TextToFloat() (1 input parameters) +Function 432: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 428: DrawLine3D() (3 input parameters) +Function 433: 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 429: DrawPoint3D() (2 input parameters) +Function 434: 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 430: DrawCircle3D() (5 input parameters) +Function 435: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3683,7 +3728,7 @@ Function 430: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 431: DrawTriangle3D() (4 input parameters) +Function 436: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3691,14 +3736,14 @@ Function 431: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 432: DrawTriangleStrip3D() (3 input parameters) +Function 437: 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 433: DrawCube() (5 input parameters) +Function 438: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3707,14 +3752,14 @@ Function 433: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 434: DrawCubeV() (3 input parameters) +Function 439: 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 435: DrawCubeWires() (5 input parameters) +Function 440: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3723,21 +3768,21 @@ Function 435: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 436: DrawCubeWiresV() (3 input parameters) +Function 441: 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 437: DrawSphere() (3 input parameters) +Function 442: 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 438: DrawSphereEx() (5 input parameters) +Function 443: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3746,7 +3791,7 @@ Function 438: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 439: DrawSphereWires() (5 input parameters) +Function 444: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3755,7 +3800,7 @@ Function 439: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 440: DrawCylinder() (6 input parameters) +Function 445: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3765,7 +3810,7 @@ Function 440: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 441: DrawCylinderEx() (6 input parameters) +Function 446: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3775,7 +3820,7 @@ Function 441: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 442: DrawCylinderWires() (6 input parameters) +Function 447: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3785,7 +3830,7 @@ Function 442: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 443: DrawCylinderWiresEx() (6 input parameters) +Function 448: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3795,7 +3840,7 @@ Function 443: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 444: DrawCapsule() (6 input parameters) +Function 449: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3805,7 +3850,7 @@ Function 444: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 445: DrawCapsuleWires() (6 input parameters) +Function 450: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3815,51 +3860,51 @@ Function 445: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 446: DrawPlane() (3 input parameters) +Function 451: 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 447: DrawRay() (2 input parameters) +Function 452: 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 448: DrawGrid() (2 input parameters) +Function 453: 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 449: LoadModel() (1 input parameters) +Function 454: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 450: LoadModelFromMesh() (1 input parameters) +Function 455: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 451: IsModelReady() (1 input parameters) +Function 456: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 452: UnloadModel() (1 input parameters) +Function 457: 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 453: GetModelBoundingBox() (1 input parameters) +Function 458: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 454: DrawModel() (4 input parameters) +Function 459: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3867,7 +3912,7 @@ Function 454: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 455: DrawModelEx() (6 input parameters) +Function 460: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3877,7 +3922,7 @@ Function 455: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 456: DrawModelWires() (4 input parameters) +Function 461: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3885,7 +3930,7 @@ Function 456: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 457: DrawModelWiresEx() (6 input parameters) +Function 462: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3895,13 +3940,13 @@ Function 457: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 458: DrawBoundingBox() (2 input parameters) +Function 463: 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 459: DrawBillboard() (5 input parameters) +Function 464: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3910,7 +3955,7 @@ Function 459: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 460: DrawBillboardRec() (6 input parameters) +Function 465: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3920,7 +3965,7 @@ Function 460: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 461: DrawBillboardPro() (9 input parameters) +Function 466: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3933,13 +3978,13 @@ Function 461: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 462: UploadMesh() (2 input parameters) +Function 467: 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 463: UpdateMeshBuffer() (5 input parameters) +Function 468: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3948,19 +3993,19 @@ Function 463: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 464: UnloadMesh() (1 input parameters) +Function 469: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 465: DrawMesh() (3 input parameters) +Function 470: 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 466: DrawMeshInstanced() (4 input parameters) +Function 471: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3968,35 +4013,35 @@ Function 466: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 467: GetMeshBoundingBox() (1 input parameters) +Function 472: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 468: GenMeshTangents() (1 input parameters) +Function 473: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 469: ExportMesh() (2 input parameters) +Function 474: 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 470: ExportMeshAsCode() (2 input parameters) +Function 475: 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 471: GenMeshPoly() (2 input parameters) +Function 476: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 472: GenMeshPlane() (4 input parameters) +Function 477: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4004,42 +4049,42 @@ Function 472: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 473: GenMeshCube() (3 input parameters) +Function 478: 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 474: GenMeshSphere() (3 input parameters) +Function 479: 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 475: GenMeshHemiSphere() (3 input parameters) +Function 480: 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 476: GenMeshCylinder() (3 input parameters) +Function 481: 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 477: GenMeshCone() (3 input parameters) +Function 482: 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 478: GenMeshTorus() (4 input parameters) +Function 483: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4047,7 +4092,7 @@ Function 478: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 479: GenMeshKnot() (4 input parameters) +Function 484: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4055,84 +4100,84 @@ Function 479: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 480: GenMeshHeightmap() (2 input parameters) +Function 485: 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 481: GenMeshCubicmap() (2 input parameters) +Function 486: 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 482: LoadMaterials() (2 input parameters) +Function 487: 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 483: LoadMaterialDefault() (0 input parameters) +Function 488: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 484: IsMaterialReady() (1 input parameters) +Function 489: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 485: UnloadMaterial() (1 input parameters) +Function 490: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 486: SetMaterialTexture() (3 input parameters) +Function 491: 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 487: SetModelMeshMaterial() (3 input parameters) +Function 492: 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 488: LoadModelAnimations() (2 input parameters) +Function 493: 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 489: UpdateModelAnimation() (3 input parameters) +Function 494: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 490: UnloadModelAnimation() (1 input parameters) +Function 495: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 491: UnloadModelAnimations() (2 input parameters) +Function 496: 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 492: IsModelAnimationValid() (2 input parameters) +Function 497: 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 493: CheckCollisionSpheres() (4 input parameters) +Function 498: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4140,40 +4185,40 @@ Function 493: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 494: CheckCollisionBoxes() (2 input parameters) +Function 499: 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 495: CheckCollisionBoxSphere() (3 input parameters) +Function 500: 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 496: GetRayCollisionSphere() (3 input parameters) +Function 501: 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 497: GetRayCollisionBox() (2 input parameters) +Function 502: 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 498: GetRayCollisionMesh() (3 input parameters) +Function 503: 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 499: GetRayCollisionTriangle() (4 input parameters) +Function 504: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4181,7 +4226,7 @@ Function 499: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 500: GetRayCollisionQuad() (5 input parameters) +Function 505: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4190,158 +4235,158 @@ Function 500: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 501: InitAudioDevice() (0 input parameters) +Function 506: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 502: CloseAudioDevice() (0 input parameters) +Function 507: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 503: IsAudioDeviceReady() (0 input parameters) +Function 508: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 504: SetMasterVolume() (1 input parameters) +Function 509: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 505: GetMasterVolume() (0 input parameters) +Function 510: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 506: LoadWave() (1 input parameters) +Function 511: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 507: LoadWaveFromMemory() (3 input parameters) +Function 512: 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 508: IsWaveReady() (1 input parameters) +Function 513: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 509: LoadSound() (1 input parameters) +Function 514: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 510: LoadSoundFromWave() (1 input parameters) +Function 515: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 511: LoadSoundAlias() (1 input parameters) +Function 516: 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 512: IsSoundReady() (1 input parameters) +Function 517: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 513: UpdateSound() (3 input parameters) +Function 518: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 514: UnloadWave() (1 input parameters) +Function 519: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 515: UnloadSound() (1 input parameters) +Function 520: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 516: UnloadSoundAlias() (1 input parameters) +Function 521: 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 517: ExportWave() (2 input parameters) +Function 522: 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 518: ExportWaveAsCode() (2 input parameters) +Function 523: 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 519: PlaySound() (1 input parameters) +Function 524: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 520: StopSound() (1 input parameters) +Function 525: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 521: PauseSound() (1 input parameters) +Function 526: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 522: ResumeSound() (1 input parameters) +Function 527: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 523: IsSoundPlaying() (1 input parameters) +Function 528: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 524: SetSoundVolume() (2 input parameters) +Function 529: 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 525: SetSoundPitch() (2 input parameters) +Function 530: 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 526: SetSoundPan() (2 input parameters) +Function 531: 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 527: WaveCopy() (1 input parameters) +Function 532: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 528: WaveCrop() (3 input parameters) +Function 533: 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 529: WaveFormat() (4 input parameters) +Function 534: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4349,203 +4394,203 @@ Function 529: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 530: LoadWaveSamples() (1 input parameters) +Function 535: 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 531: UnloadWaveSamples() (1 input parameters) +Function 536: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 532: LoadMusicStream() (1 input parameters) +Function 537: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 533: LoadMusicStreamFromMemory() (3 input parameters) +Function 538: 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 534: IsMusicReady() (1 input parameters) +Function 539: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 535: UnloadMusicStream() (1 input parameters) +Function 540: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 536: PlayMusicStream() (1 input parameters) +Function 541: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 537: IsMusicStreamPlaying() (1 input parameters) +Function 542: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 538: UpdateMusicStream() (1 input parameters) +Function 543: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 539: StopMusicStream() (1 input parameters) +Function 544: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 540: PauseMusicStream() (1 input parameters) +Function 545: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 541: ResumeMusicStream() (1 input parameters) +Function 546: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 542: SeekMusicStream() (2 input parameters) +Function 547: 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 543: SetMusicVolume() (2 input parameters) +Function 548: 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 544: SetMusicPitch() (2 input parameters) +Function 549: 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 545: SetMusicPan() (2 input parameters) +Function 550: 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 546: GetMusicTimeLength() (1 input parameters) +Function 551: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 547: GetMusicTimePlayed() (1 input parameters) +Function 552: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 548: LoadAudioStream() (3 input parameters) +Function 553: 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 549: IsAudioStreamReady() (1 input parameters) +Function 554: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 550: UnloadAudioStream() (1 input parameters) +Function 555: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 551: UpdateAudioStream() (3 input parameters) +Function 556: 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 552: IsAudioStreamProcessed() (1 input parameters) +Function 557: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 553: PlayAudioStream() (1 input parameters) +Function 558: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 554: PauseAudioStream() (1 input parameters) +Function 559: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 555: ResumeAudioStream() (1 input parameters) +Function 560: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 556: IsAudioStreamPlaying() (1 input parameters) +Function 561: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 557: StopAudioStream() (1 input parameters) +Function 562: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 558: SetAudioStreamVolume() (2 input parameters) +Function 563: 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 559: SetAudioStreamPitch() (2 input parameters) +Function 564: 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 560: SetAudioStreamPan() (2 input parameters) +Function 565: 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 561: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 566: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 562: SetAudioStreamCallback() (2 input parameters) +Function 567: 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 563: AttachAudioStreamProcessor() (2 input parameters) +Function 568: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 564: DetachAudioStreamProcessor() (2 input parameters) +Function 569: 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 565: AttachAudioMixedProcessor() (1 input parameters) +Function 570: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 566: DetachAudioMixedProcessor() (1 input parameters) +Function 571: 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 58f7df8066ec..39e86c211f0c 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -2017,6 +2017,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c2df1698473687a97e0f40562477921aee07b3e7 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:27:59 +0200 Subject: [PATCH 61/71] [rtextures] Adding `ImageDrawLineEx` function (#4097) * adding `ImageDrawLineEx` function also review other functions for drawing lines in images * fix `ImageDrawLineV` --- src/raylib.h | 1 + src/rtextures.c | 158 ++++++++++++++++++++++++++---------------------- 2 files changed, 87 insertions(+), 72 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 7195fd55fe8d..8cd1d1ec02d4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1373,6 +1373,7 @@ RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image diff --git a/src/rtextures.c b/src/rtextures.c index 39c0f78f2aae..df9ccbdf4860 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3403,98 +3403,112 @@ void ImageDrawPixelV(Image *dst, Vector2 position, Color color) // Draw line within an image void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color) { - // Using Bresenham's algorithm as described in - // Drawing Lines with Pixels - Joshua Scott - March 2012 - // https://classic.csunplugged.org/wp-content/uploads/2014/12/Lines.pdf + // Calculate differences in coordinates + int shortLen = endPosY - startPosY; + int longLen = endPosX - startPosX; + bool yLonger = false; - int changeInX = (endPosX - startPosX); - int absChangeInX = (changeInX < 0)? -changeInX : changeInX; - int changeInY = (endPosY - startPosY); - int absChangeInY = (changeInY < 0)? -changeInY : changeInY; + // Determine if the line is more vertical than horizontal + if (abs(shortLen) > abs(longLen)) + { + // Swap the lengths if the line is more vertical + int temp = shortLen; + shortLen = longLen; + longLen = temp; + yLonger = true; + } - int startU, startV, endU, stepV; // Substitutions, either U = X, V = Y or vice versa. See loop at end of function - //int endV; // Not needed but left for better understanding, check code below - int A, B, P; // See linked paper above, explained down in the main loop - int reversedXY = (absChangeInY < absChangeInX); + // Initialize variables for drawing loop + int endVal = longLen; + int sgnInc = 1; - if (reversedXY) + // Adjust direction increment based on longLen sign + if (longLen < 0) { - A = 2*absChangeInY; - B = A - 2*absChangeInX; - P = A - absChangeInX; + longLen = -longLen; + sgnInc = -1; + } - if (changeInX > 0) - { - startU = startPosX; - startV = startPosY; - endU = endPosX; - //endV = endPosY; - } - else + // Calculate fixed-point increment for shorter length + int decInc = (longLen == 0)? 0 : (shortLen<<16) / longLen; + + // Draw the line pixel by pixel + if (yLonger) + { + // If line is more vertical, iterate over y-axis + for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) { - startU = endPosX; - startV = endPosY; - endU = startPosX; - //endV = startPosY; - - // Since start and end are reversed - changeInX = -changeInX; - changeInY = -changeInY; + // Calculate pixel position and draw it + ImageDrawPixel(dst, startPosX + (j>>16), startPosY + i, color); } - - stepV = (changeInY < 0)? -1 : 1; - - ImageDrawPixel(dst, startU, startV, color); // At this point they are correctly ordered... } else { - A = 2*absChangeInX; - B = A - 2*absChangeInY; - P = A - absChangeInY; - - if (changeInY > 0) - { - startU = startPosY; - startV = startPosX; - endU = endPosY; - //endV = endPosX; - } - else + // If line is more horizontal, iterate over x-axis + for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) { - startU = endPosY; - startV = endPosX; - endU = startPosY; - //endV = startPosX; - - // Since start and end are reversed - changeInX = -changeInX; - changeInY = -changeInY; + // Calculate pixel position and draw it + ImageDrawPixel(dst, startPosX + i, startPosY + (j>>16), color); } + } +} + +// Draw line within an image (Vector version) +void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color) +{ + // Round start and end positions to nearest integer coordinates + int x1 = (int)(start.x + 0.5f); + int y1 = (int)(start.y + 0.5f); + int x2 = (int)(end.x + 0.5f); + int y2 = (int)(end.y + 0.5f); + + // Draw a vertical line using ImageDrawLine function + ImageDrawLine(dst, x1, y1, x2, y2, color); +} - stepV = (changeInX < 0)? -1 : 1; +// Draw a line defining thickness within an image +void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color) +{ + // Round start and end positions to nearest integer coordinates + int x1 = (int)(start.x + 0.5f); + int y1 = (int)(start.y + 0.5f); + int x2 = (int)(end.x + 0.5f); + int y2 = (int)(end.y + 0.5f); - ImageDrawPixel(dst, startV, startU, color); // ... but need to be reversed here. Repeated in the main loop below - } + // Calculate differences in x and y coordinates + int dx = x2 - x1; + int dy = y2 - y1; + + // Draw the main line between (x1, y1) and (x2, y2) + ImageDrawLine(dst, x1, y1, x2, y2, color); - // We already drew the start point. If we started at startU + 0, the line would be crooked and too short - for (int u = startU + 1, v = startV; u <= endU; u++) + // Determine if the line is more horizontal or vertical + if (dx != 0 && abs(dy/dx) < 1) { - if (P >= 0) + // Line is more horizontal + // Calculate half the width of the line + int wy = (thick - 1)*sqrtf(dx*dx + dy*dy)/(2*abs(dx)); + + // Draw additional lines above and below the main line + for (int i = 1; i <= wy; i++) { - v += stepV; // Adjusts whenever we stray too far from the direct line. Details in the linked paper above - P += B; // Remembers that we corrected our path + ImageDrawLine(dst, x1, y1 - i, x2, y2 - i, color); // Draw above the main line + ImageDrawLine(dst, x1, y1 + i, x2, y2 + i, color); // Draw below the main line } - else P += A; // Remembers how far we are from the direct line - - if (reversedXY) ImageDrawPixel(dst, u, v, color); - else ImageDrawPixel(dst, v, u, color); } -} + else if (dy != 0) + { + // Line is more vertical or perfectly horizontal + // Calculate half the width of the line + int wx = (thick - 1)*sqrtf(dx*dx + dy*dy)/(2*abs(dy)); -// Draw line within an image (Vector version) -void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color) -{ - ImageDrawLine(dst, (int)start.x, (int)start.y, (int)end.x, (int)end.y, color); + // Draw additional lines to the left and right of the main line + for (int i = 1; i <= wx; i++) + { + ImageDrawLine(dst, x1 - i, y1, x2 - i, y2, color); // Draw left of the main line + ImageDrawLine(dst, x1 + i, y1, x2 + i, y2, color); // Draw right of the main line + } + } } // Draw circle within an image From f947f890617fade5bdcaccaaeb812306dc7658de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Jun 2024 07:28:17 +0000 Subject: [PATCH 62/71] Update raylib_api.* by CI --- parser/output/raylib_api.json | 27 ++ parser/output/raylib_api.lua | 12 + parser/output/raylib_api.txt | 491 +++++++++++++++++----------------- parser/output/raylib_api.xml | 9 +- 4 files changed, 297 insertions(+), 242 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index c4577e68dbf3..a75b94ed0ec4 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -7817,6 +7817,33 @@ } ] }, + { + "name": "ImageDrawLineEx", + "description": "Draw a line defining thickness within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "start" + }, + { + "type": "Vector2", + "name": "end" + }, + { + "type": "int", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "ImageDrawCircle", "description": "Draw a filled circle within an image", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 7cd1b5f20a41..7dcb1fa41741 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5879,6 +5879,18 @@ return { {type = "Color", name = "color"} } }, + { + name = "ImageDrawLineEx", + description = "Draw a line defining thickness within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "start"}, + {type = "Vector2", name = "end"}, + {type = "int", name = "thick"}, + {type = "Color", name = "color"} + } + }, { name = "ImageDrawCircle", description = "Draw a filled circle within an image", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 5b09bb972840..fd082d07439d 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 571 +Functions found: 572 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3017,7 +3017,16 @@ Function 331: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 332: ImageDrawCircle() (5 input parameters) +Function 332: ImageDrawLineEx() (5 input parameters) + Name: ImageDrawLineEx + Return type: void + Description: Draw a line defining thickness within an image + Param[1]: dst (type: Image *) + Param[2]: start (type: Vector2) + Param[3]: end (type: Vector2) + Param[4]: thick (type: int) + Param[5]: color (type: Color) +Function 333: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3026,7 +3035,7 @@ Function 332: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 333: ImageDrawCircleV() (4 input parameters) +Function 334: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3034,7 +3043,7 @@ Function 333: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 334: ImageDrawCircleLines() (5 input parameters) +Function 335: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3043,7 +3052,7 @@ Function 334: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 335: ImageDrawCircleLinesV() (4 input parameters) +Function 336: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3051,7 +3060,7 @@ Function 335: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 336: ImageDrawRectangle() (6 input parameters) +Function 337: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3061,7 +3070,7 @@ Function 336: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 337: ImageDrawRectangleV() (4 input parameters) +Function 338: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3069,14 +3078,14 @@ Function 337: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 338: ImageDrawRectangleRec() (3 input parameters) +Function 339: 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 339: ImageDrawRectangleLines() (4 input parameters) +Function 340: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3084,7 +3093,7 @@ Function 339: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 340: ImageDrawTriangle() (5 input parameters) +Function 341: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3093,7 +3102,7 @@ Function 340: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 341: ImageDrawTriangleEx() (7 input parameters) +Function 342: ImageDrawTriangleEx() (7 input parameters) Name: ImageDrawTriangleEx Return type: void Description: Draw triangle with interpolated colors within an image @@ -3104,7 +3113,7 @@ Function 341: ImageDrawTriangleEx() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 342: ImageDrawTriangleLines() (5 input parameters) +Function 343: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3113,7 +3122,7 @@ Function 342: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 343: ImageDrawTriangleFan() (4 input parameters) +Function 344: 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) @@ -3121,7 +3130,7 @@ Function 343: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 344: ImageDrawTriangleStrip() (4 input parameters) +Function 345: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3129,7 +3138,7 @@ Function 344: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 345: ImageDraw() (5 input parameters) +Function 346: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3138,7 +3147,7 @@ Function 345: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 346: ImageDrawText() (6 input parameters) +Function 347: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3148,7 +3157,7 @@ Function 346: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 347: ImageDrawTextEx() (7 input parameters) +Function 348: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3159,79 +3168,79 @@ Function 347: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 348: LoadTexture() (1 input parameters) +Function 349: 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 349: LoadTextureFromImage() (1 input parameters) +Function 350: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 350: LoadTextureCubemap() (2 input parameters) +Function 351: 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 351: LoadRenderTexture() (2 input parameters) +Function 352: 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 352: IsTextureReady() (1 input parameters) +Function 353: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 353: UnloadTexture() (1 input parameters) +Function 354: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 354: IsRenderTextureReady() (1 input parameters) +Function 355: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 355: UnloadRenderTexture() (1 input parameters) +Function 356: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 356: UpdateTexture() (2 input parameters) +Function 357: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 357: UpdateTextureRec() (3 input parameters) +Function 358: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 358: GenTextureMipmaps() (1 input parameters) +Function 359: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 359: SetTextureFilter() (2 input parameters) +Function 360: 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 360: SetTextureWrap() (2 input parameters) +Function 361: 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 361: DrawTexture() (4 input parameters) +Function 362: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3239,14 +3248,14 @@ Function 361: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 362: DrawTextureV() (3 input parameters) +Function 363: 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 363: DrawTextureEx() (5 input parameters) +Function 364: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3255,7 +3264,7 @@ Function 363: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 364: DrawTextureRec() (4 input parameters) +Function 365: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3263,7 +3272,7 @@ Function 364: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 365: DrawTexturePro() (6 input parameters) +Function 366: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3273,7 +3282,7 @@ Function 365: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 366: DrawTextureNPatch() (6 input parameters) +Function 367: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3283,112 +3292,112 @@ Function 366: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 367: ColorIsEqual() (2 input parameters) +Function 368: 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 368: Fade() (2 input parameters) +Function 369: 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 369: ColorToInt() (1 input parameters) +Function 370: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 370: ColorNormalize() (1 input parameters) +Function 371: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 371: ColorFromNormalized() (1 input parameters) +Function 372: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 372: ColorToHSV() (1 input parameters) +Function 373: 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 373: ColorFromHSV() (3 input parameters) +Function 374: 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 374: ColorTint() (2 input parameters) +Function 375: 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 375: ColorBrightness() (2 input parameters) +Function 376: 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 376: ColorContrast() (2 input parameters) +Function 377: 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 377: ColorAlpha() (2 input parameters) +Function 378: 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 378: ColorAlphaBlend() (3 input parameters) +Function 379: 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 379: GetColor() (1 input parameters) +Function 380: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 380: GetPixelColor() (2 input parameters) +Function 381: 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 381: SetPixelColor() (3 input parameters) +Function 382: 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 382: GetPixelDataSize() (3 input parameters) +Function 383: 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 383: GetFontDefault() (0 input parameters) +Function 384: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 384: LoadFont() (1 input parameters) +Function 385: 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 385: LoadFontEx() (4 input parameters) +Function 386: 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 setFont @@ -3396,14 +3405,14 @@ Function 385: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 386: LoadFontFromImage() (3 input parameters) +Function 387: 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 387: LoadFontFromMemory() (6 input parameters) +Function 388: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3413,12 +3422,12 @@ Function 387: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 388: IsFontReady() (1 input parameters) +Function 389: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 389: LoadFontData() (6 input parameters) +Function 390: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3428,7 +3437,7 @@ Function 389: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 390: GenImageFontAtlas() (6 input parameters) +Function 391: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3438,30 +3447,30 @@ Function 390: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 391: UnloadFontData() (2 input parameters) +Function 392: 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 392: UnloadFont() (1 input parameters) +Function 393: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 393: ExportFontAsCode() (2 input parameters) +Function 394: 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 394: DrawFPS() (2 input parameters) +Function 395: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 395: DrawText() (5 input parameters) +Function 396: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3470,7 +3479,7 @@ Function 395: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 396: DrawTextEx() (6 input parameters) +Function 397: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3480,7 +3489,7 @@ Function 396: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 397: DrawTextPro() (8 input parameters) +Function 398: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3492,7 +3501,7 @@ Function 397: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 398: DrawTextCodepoint() (5 input parameters) +Function 399: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3501,7 +3510,7 @@ Function 398: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 399: DrawTextCodepoints() (7 input parameters) +Function 400: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3512,18 +3521,18 @@ Function 399: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 400: SetTextLineSpacing() (1 input parameters) +Function 401: 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 401: MeasureText() (2 input parameters) +Function 402: 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 402: MeasureTextEx() (4 input parameters) +Function 403: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3531,195 +3540,195 @@ Function 402: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 403: GetGlyphIndex() (2 input parameters) +Function 404: 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 404: GetGlyphInfo() (2 input parameters) +Function 405: 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 405: GetGlyphAtlasRec() (2 input parameters) +Function 406: 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 406: LoadUTF8() (2 input parameters) +Function 407: 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 407: UnloadUTF8() (1 input parameters) +Function 408: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 408: LoadCodepoints() (2 input parameters) +Function 409: 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 409: UnloadCodepoints() (1 input parameters) +Function 410: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 410: GetCodepointCount() (1 input parameters) +Function 411: 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 411: GetCodepoint() (2 input parameters) +Function 412: 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 412: GetCodepointNext() (2 input parameters) +Function 413: 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 413: GetCodepointPrevious() (2 input parameters) +Function 414: 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 414: CodepointToUTF8() (2 input parameters) +Function 415: 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 415: TextCopy() (2 input parameters) +Function 416: 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 416: TextIsEqual() (2 input parameters) +Function 417: 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 417: TextLength() (1 input parameters) +Function 418: 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 418: TextFormat() (2 input parameters) +Function 419: 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 419: TextSubtext() (3 input parameters) +Function 420: 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 420: TextReplace() (3 input parameters) +Function 421: 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 421: TextInsert() (3 input parameters) +Function 422: 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 422: TextJoin() (3 input parameters) +Function 423: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 423: TextSplit() (3 input parameters) +Function 424: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 424: TextAppend() (3 input parameters) +Function 425: 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 425: TextFindIndex() (2 input parameters) +Function 426: 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 426: TextToUpper() (1 input parameters) +Function 427: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 427: TextToLower() (1 input parameters) +Function 428: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 428: TextToPascal() (1 input parameters) +Function 429: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 429: TextToSnake() (1 input parameters) +Function 430: TextToSnake() (1 input parameters) Name: TextToSnake Return type: const char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 430: TextToCamel() (1 input parameters) +Function 431: TextToCamel() (1 input parameters) Name: TextToCamel Return type: const char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 431: TextToInteger() (1 input parameters) +Function 432: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 432: TextToFloat() (1 input parameters) +Function 433: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 433: DrawLine3D() (3 input parameters) +Function 434: 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 434: DrawPoint3D() (2 input parameters) +Function 435: 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 435: DrawCircle3D() (5 input parameters) +Function 436: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3728,7 +3737,7 @@ Function 435: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 436: DrawTriangle3D() (4 input parameters) +Function 437: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3736,14 +3745,14 @@ Function 436: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 437: DrawTriangleStrip3D() (3 input parameters) +Function 438: 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 438: DrawCube() (5 input parameters) +Function 439: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3752,14 +3761,14 @@ Function 438: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 439: DrawCubeV() (3 input parameters) +Function 440: 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 440: DrawCubeWires() (5 input parameters) +Function 441: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3768,21 +3777,21 @@ Function 440: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 441: DrawCubeWiresV() (3 input parameters) +Function 442: 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 442: DrawSphere() (3 input parameters) +Function 443: 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 443: DrawSphereEx() (5 input parameters) +Function 444: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3791,7 +3800,7 @@ Function 443: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 444: DrawSphereWires() (5 input parameters) +Function 445: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3800,7 +3809,7 @@ Function 444: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 445: DrawCylinder() (6 input parameters) +Function 446: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3810,7 +3819,7 @@ Function 445: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 446: DrawCylinderEx() (6 input parameters) +Function 447: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3820,7 +3829,7 @@ Function 446: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 447: DrawCylinderWires() (6 input parameters) +Function 448: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3830,7 +3839,7 @@ Function 447: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 448: DrawCylinderWiresEx() (6 input parameters) +Function 449: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3840,7 +3849,7 @@ Function 448: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 449: DrawCapsule() (6 input parameters) +Function 450: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3850,7 +3859,7 @@ Function 449: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 450: DrawCapsuleWires() (6 input parameters) +Function 451: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3860,51 +3869,51 @@ Function 450: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 451: DrawPlane() (3 input parameters) +Function 452: 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 452: DrawRay() (2 input parameters) +Function 453: 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 453: DrawGrid() (2 input parameters) +Function 454: 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 454: LoadModel() (1 input parameters) +Function 455: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 455: LoadModelFromMesh() (1 input parameters) +Function 456: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 456: IsModelReady() (1 input parameters) +Function 457: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 457: UnloadModel() (1 input parameters) +Function 458: 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 458: GetModelBoundingBox() (1 input parameters) +Function 459: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 459: DrawModel() (4 input parameters) +Function 460: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3912,7 +3921,7 @@ Function 459: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 460: DrawModelEx() (6 input parameters) +Function 461: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3922,7 +3931,7 @@ Function 460: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 461: DrawModelWires() (4 input parameters) +Function 462: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3930,7 +3939,7 @@ Function 461: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 462: DrawModelWiresEx() (6 input parameters) +Function 463: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3940,13 +3949,13 @@ Function 462: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 463: DrawBoundingBox() (2 input parameters) +Function 464: 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 464: DrawBillboard() (5 input parameters) +Function 465: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3955,7 +3964,7 @@ Function 464: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 465: DrawBillboardRec() (6 input parameters) +Function 466: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3965,7 +3974,7 @@ Function 465: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 466: DrawBillboardPro() (9 input parameters) +Function 467: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3978,13 +3987,13 @@ Function 466: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 467: UploadMesh() (2 input parameters) +Function 468: 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 468: UpdateMeshBuffer() (5 input parameters) +Function 469: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3993,19 +4002,19 @@ Function 468: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 469: UnloadMesh() (1 input parameters) +Function 470: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 470: DrawMesh() (3 input parameters) +Function 471: 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 471: DrawMeshInstanced() (4 input parameters) +Function 472: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4013,35 +4022,35 @@ Function 471: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 472: GetMeshBoundingBox() (1 input parameters) +Function 473: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 473: GenMeshTangents() (1 input parameters) +Function 474: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 474: ExportMesh() (2 input parameters) +Function 475: 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 475: ExportMeshAsCode() (2 input parameters) +Function 476: 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 476: GenMeshPoly() (2 input parameters) +Function 477: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 477: GenMeshPlane() (4 input parameters) +Function 478: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4049,42 +4058,42 @@ Function 477: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 478: GenMeshCube() (3 input parameters) +Function 479: 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 479: GenMeshSphere() (3 input parameters) +Function 480: 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 480: GenMeshHemiSphere() (3 input parameters) +Function 481: 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 481: GenMeshCylinder() (3 input parameters) +Function 482: 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 482: GenMeshCone() (3 input parameters) +Function 483: 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 483: GenMeshTorus() (4 input parameters) +Function 484: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4092,7 +4101,7 @@ Function 483: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 484: GenMeshKnot() (4 input parameters) +Function 485: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4100,84 +4109,84 @@ Function 484: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 485: GenMeshHeightmap() (2 input parameters) +Function 486: 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 486: GenMeshCubicmap() (2 input parameters) +Function 487: 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 487: LoadMaterials() (2 input parameters) +Function 488: 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 488: LoadMaterialDefault() (0 input parameters) +Function 489: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 489: IsMaterialReady() (1 input parameters) +Function 490: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 490: UnloadMaterial() (1 input parameters) +Function 491: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 491: SetMaterialTexture() (3 input parameters) +Function 492: 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 492: SetModelMeshMaterial() (3 input parameters) +Function 493: 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 493: LoadModelAnimations() (2 input parameters) +Function 494: 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 494: UpdateModelAnimation() (3 input parameters) +Function 495: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 495: UnloadModelAnimation() (1 input parameters) +Function 496: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 496: UnloadModelAnimations() (2 input parameters) +Function 497: 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 497: IsModelAnimationValid() (2 input parameters) +Function 498: 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 498: CheckCollisionSpheres() (4 input parameters) +Function 499: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4185,40 +4194,40 @@ Function 498: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 499: CheckCollisionBoxes() (2 input parameters) +Function 500: 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 500: CheckCollisionBoxSphere() (3 input parameters) +Function 501: 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 501: GetRayCollisionSphere() (3 input parameters) +Function 502: 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 502: GetRayCollisionBox() (2 input parameters) +Function 503: 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 503: GetRayCollisionMesh() (3 input parameters) +Function 504: 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 504: GetRayCollisionTriangle() (4 input parameters) +Function 505: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4226,7 +4235,7 @@ Function 504: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 505: GetRayCollisionQuad() (5 input parameters) +Function 506: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4235,158 +4244,158 @@ Function 505: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 506: InitAudioDevice() (0 input parameters) +Function 507: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 507: CloseAudioDevice() (0 input parameters) +Function 508: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 508: IsAudioDeviceReady() (0 input parameters) +Function 509: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 509: SetMasterVolume() (1 input parameters) +Function 510: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 510: GetMasterVolume() (0 input parameters) +Function 511: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 511: LoadWave() (1 input parameters) +Function 512: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 512: LoadWaveFromMemory() (3 input parameters) +Function 513: 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 513: IsWaveReady() (1 input parameters) +Function 514: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 514: LoadSound() (1 input parameters) +Function 515: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 515: LoadSoundFromWave() (1 input parameters) +Function 516: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 516: LoadSoundAlias() (1 input parameters) +Function 517: 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 517: IsSoundReady() (1 input parameters) +Function 518: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 518: UpdateSound() (3 input parameters) +Function 519: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 519: UnloadWave() (1 input parameters) +Function 520: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 520: UnloadSound() (1 input parameters) +Function 521: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 521: UnloadSoundAlias() (1 input parameters) +Function 522: 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 522: ExportWave() (2 input parameters) +Function 523: 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 523: ExportWaveAsCode() (2 input parameters) +Function 524: 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 524: PlaySound() (1 input parameters) +Function 525: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 525: StopSound() (1 input parameters) +Function 526: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 526: PauseSound() (1 input parameters) +Function 527: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 527: ResumeSound() (1 input parameters) +Function 528: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 528: IsSoundPlaying() (1 input parameters) +Function 529: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 529: SetSoundVolume() (2 input parameters) +Function 530: 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 530: SetSoundPitch() (2 input parameters) +Function 531: 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 531: SetSoundPan() (2 input parameters) +Function 532: 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 532: WaveCopy() (1 input parameters) +Function 533: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 533: WaveCrop() (3 input parameters) +Function 534: 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 534: WaveFormat() (4 input parameters) +Function 535: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4394,203 +4403,203 @@ Function 534: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 535: LoadWaveSamples() (1 input parameters) +Function 536: 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 536: UnloadWaveSamples() (1 input parameters) +Function 537: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 537: LoadMusicStream() (1 input parameters) +Function 538: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 538: LoadMusicStreamFromMemory() (3 input parameters) +Function 539: 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 539: IsMusicReady() (1 input parameters) +Function 540: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 540: UnloadMusicStream() (1 input parameters) +Function 541: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 541: PlayMusicStream() (1 input parameters) +Function 542: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 542: IsMusicStreamPlaying() (1 input parameters) +Function 543: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 543: UpdateMusicStream() (1 input parameters) +Function 544: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 544: StopMusicStream() (1 input parameters) +Function 545: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 545: PauseMusicStream() (1 input parameters) +Function 546: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 546: ResumeMusicStream() (1 input parameters) +Function 547: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 547: SeekMusicStream() (2 input parameters) +Function 548: 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 548: SetMusicVolume() (2 input parameters) +Function 549: 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 549: SetMusicPitch() (2 input parameters) +Function 550: 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 550: SetMusicPan() (2 input parameters) +Function 551: 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 551: GetMusicTimeLength() (1 input parameters) +Function 552: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 552: GetMusicTimePlayed() (1 input parameters) +Function 553: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 553: LoadAudioStream() (3 input parameters) +Function 554: 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 554: IsAudioStreamReady() (1 input parameters) +Function 555: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 555: UnloadAudioStream() (1 input parameters) +Function 556: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 556: UpdateAudioStream() (3 input parameters) +Function 557: 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 557: IsAudioStreamProcessed() (1 input parameters) +Function 558: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 558: PlayAudioStream() (1 input parameters) +Function 559: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 559: PauseAudioStream() (1 input parameters) +Function 560: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 560: ResumeAudioStream() (1 input parameters) +Function 561: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 561: IsAudioStreamPlaying() (1 input parameters) +Function 562: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 562: StopAudioStream() (1 input parameters) +Function 563: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 563: SetAudioStreamVolume() (2 input parameters) +Function 564: 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 564: SetAudioStreamPitch() (2 input parameters) +Function 565: 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 565: SetAudioStreamPan() (2 input parameters) +Function 566: 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 566: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 567: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 567: SetAudioStreamCallback() (2 input parameters) +Function 568: 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 568: AttachAudioStreamProcessor() (2 input parameters) +Function 569: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 569: DetachAudioStreamProcessor() (2 input parameters) +Function 570: 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 570: AttachAudioMixedProcessor() (1 input parameters) +Function 571: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 571: DetachAudioMixedProcessor() (1 input parameters) +Function 572: 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 39e86c211f0c..22f9b0ec7610 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -1966,6 +1966,13 @@ + + + + + + + From 4311db5ba5eb23c8f1d71268010afb135f3e1e25 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Mon, 24 Jun 2024 08:29:10 +0100 Subject: [PATCH 63/71] [rmodels] Fix -Wstringop-truncation warning (#4096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rmodels.c: In function ‘LoadBoneInfoGLTF.isra’: rmodels.c:4874:32: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] 4874 | if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/rmodels.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index a169ec50dc94..a323292ca7d8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4871,7 +4871,11 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount) for (unsigned int i = 0; i < skin.joints_count; i++) { cgltf_node node = *skin.joints[i]; - if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name)); + if (node.name != NULL) + { + strncpy(bones[i].name, node.name, sizeof(bones[i].name)); + bones[i].name[sizeof(bones[i].name) - 1] = '\0'; + } // Find parent bone index unsigned int parentIndex = -1; From e96bab7ce63568d86fae4fd664fa06625f76f1ee Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 24 Jun 2024 08:47:32 -0700 Subject: [PATCH 64/71] [Build] Fix warnings when building in VS 2022 (#4095) * Update raylib_api.* by CI * Fix warnings when building examples in MSVC 2022 * fix auto-format that sneaked in there. --------- Co-authored-by: github-actions[bot] --- examples/audio/audio_mixed_processor.c | 2 +- examples/core/core_2d_camera_platformer.c | 4 +- examples/core/core_input_mouse_wheel.c | 2 +- examples/core/core_random_sequence.c | 16 +++---- examples/core/core_smooth_pixelperfect.c | 8 ++-- examples/core/core_storage_values.c | 2 +- examples/models/models_draw_cube_texture.c | 2 +- examples/shaders/shaders_deferred_render.c | 6 +-- examples/shapes/shapes_lines_bezier.c | 4 +- examples/shapes/shapes_splines_drawing.c | 2 +- .../examples/shapes_splines_drawing.vcxproj | 16 +++---- src/rcore.c | 2 +- src/rlgl.h | 4 +- src/rtext.c | 2 +- src/rtextures.c | 46 +++++++++---------- 15 files changed, 60 insertions(+), 58 deletions(-) diff --git a/examples/audio/audio_mixed_processor.c b/examples/audio/audio_mixed_processor.c index 3a008f3e22cd..fd970dd19b0a 100644 --- a/examples/audio/audio_mixed_processor.c +++ b/examples/audio/audio_mixed_processor.c @@ -97,7 +97,7 @@ int main(void) DrawRectangle(199, 199, 402, 34, LIGHTGRAY); for (int i = 0; i < 400; i++) { - DrawLine(201 + i, 232 - averageVolume[i] * 32, 201 + i, 232, MAROON); + DrawLine(201 + i, 232 - (int)averageVolume[i] * 32, 201 + i, 232, MAROON); } DrawRectangleLines(199, 199, 402, 34, GRAY); diff --git a/examples/core/core_2d_camera_platformer.c b/examples/core/core_2d_camera_platformer.c index 75fd6cf6ad94..3743de80b0ef 100644 --- a/examples/core/core_2d_camera_platformer.c +++ b/examples/core/core_2d_camera_platformer.c @@ -133,10 +133,10 @@ int main(void) for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color); - Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40, 40 }; + Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40.0f, 40.0f }; DrawRectangleRec(playerRect, RED); - DrawCircle(player.position.x, player.position.y, 5, GOLD); + DrawCircleV(player.position, 5.0f, GOLD); EndMode2D(); diff --git a/examples/core/core_input_mouse_wheel.c b/examples/core/core_input_mouse_wheel.c index 54f33545ef6a..d261e9348796 100644 --- a/examples/core/core_input_mouse_wheel.c +++ b/examples/core/core_input_mouse_wheel.c @@ -36,7 +36,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - boxPositionY -= (GetMouseWheelMove()*scrollSpeed); + boxPositionY -= (int)(GetMouseWheelMove()*scrollSpeed); //---------------------------------------------------------------------------------- // Draw diff --git a/examples/core/core_random_sequence.c b/examples/core/core_random_sequence.c index c946b64dad80..2f7c3be95832 100644 --- a/examples/core/core_random_sequence.c +++ b/examples/core/core_random_sequence.c @@ -41,7 +41,7 @@ int main(void) { int rectCount = 20; float rectSize = (float)screenWidth/rectCount; - ColorRect* rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight); + ColorRect* rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); SetTargetFPS(60); //-------------------------------------------------------------------------------------- @@ -62,7 +62,7 @@ int main(void) { rectCount++; rectSize = (float)screenWidth/rectCount; free(rectangles); - rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight); + rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); } if(IsKeyPressed(KEY_DOWN)) @@ -71,7 +71,7 @@ int main(void) { rectCount--; rectSize = (float)screenWidth/rectCount; free(rectangles); - rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight); + rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); } } @@ -121,17 +121,17 @@ static Color GenerateRandomColor() } static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight){ - int *seq = LoadRandomSequence(rectCount, 0, rectCount-1); - ColorRect* rectangles = (ColorRect *)malloc(rectCount*sizeof(ColorRect)); + int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount-1); + ColorRect* rectangles = (ColorRect *)malloc((int)rectCount*sizeof(ColorRect)); float rectSeqWidth = rectCount * rectWidth; - int startX = (screenWidth - rectSeqWidth) * 0.5f; + float startX = (screenWidth - rectSeqWidth) * 0.5f; for(int x=0;x Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/src/rcore.c b/src/rcore.c index a4fc4d675a0d..2c9af11d5224 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -856,7 +856,7 @@ void EndDrawing(void) #ifndef GIF_RECORD_FRAMERATE #define GIF_RECORD_FRAMERATE 10 #endif - gifFrameCounter += GetFrameTime()*1000; + gifFrameCounter += (unsigned int)(GetFrameTime()*1000); // NOTE: We record one gif frame depending on the desired gif framerate if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE) diff --git a/src/rlgl.h b/src/rlgl.h index 530e44efcc86..bdf665a44366 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3945,7 +3945,9 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma // Additional types (depends on OpenGL version or extensions): // - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED, // - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV - glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offset); + + size_t offsetNative = offset; + glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offsetNative); #endif } diff --git a/src/rtext.c b/src/rtext.c index 62d786eacc5d..35e69420fbf7 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2297,7 +2297,7 @@ static Font LoadBMFont(const char *fileName) } else { - font.glyphs[i].image = GenImageColor(font.recs[i].width, font.recs[i].height, BLACK); + font.glyphs[i].image = GenImageColor((int)font.recs[i].width, (int)font.recs[i].height, BLACK); TRACELOG(LOG_WARNING, "FONT: [%s] Some characters data not correctly provided", fileName); } } diff --git a/src/rtextures.c b/src/rtextures.c index df9ccbdf4860..783e9b7f9b23 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3646,10 +3646,10 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col { // Calculate the 2D bounding box of the triangle // Determine the minimum and maximum x and y coordinates of the triangle vertices - int xMin = (v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x); - int yMin = (v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y); - int xMax = (v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x); - int yMax = (v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y); + int xMin = (int)((v1.x < v2.x)? ((v1.x < v3.x) ? v1.x : v3.x) : ((v2.x < v3.x) ? v2.x : v3.x)); + int yMin = (int)((v1.y < v2.y)? ((v1.y < v3.y) ? v1.y : v3.y) : ((v2.y < v3.y) ? v2.y : v3.y)); + int xMax = (int)((v1.x > v2.x)? ((v1.x > v3.x) ? v1.x : v3.x) : ((v2.x > v3.x) ? v2.x : v3.x)); + int yMax = (int)((v1.y > v2.y)? ((v1.y > v3.y) ? v1.y : v3.y) : ((v2.y > v3.y) ? v2.y : v3.y)); // Clamp the bounding box to the image dimensions if (xMin < 0) xMin = 0; @@ -3664,9 +3664,9 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col // Barycentric interpolation setup // Calculate the step increments for the barycentric coordinates - int w1XStep = v3.y - v2.y, w1YStep = v2.x - v3.x; - int w2XStep = v1.y - v3.y, w2YStep = v3.x - v1.x; - int w3XStep = v2.y - v1.y, w3YStep = v1.x - v2.x; + int w1XStep = (int)(v3.y - v2.y), w1YStep = (int)(v2.x - v3.x); + int w2XStep = (int)(v1.y - v3.y), w2YStep = (int)(v3.x - v1.x); + int w3XStep = (int)(v2.y - v1.y), w3YStep = (int)(v1.x - v2.x); // If the triangle is a back face, invert the steps if (isBackFace) @@ -3677,9 +3677,9 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col } // Calculate the initial barycentric coordinates for the top-left point of the bounding box - int w1Row = (xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y); - int w2Row = (xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y); - int w3Row = (xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y); + int w1Row = (int)((xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y)); + int w2Row = (int)((xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y)); + int w3Row = (int)((xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y)); // Rasterization loop // Iterate through each pixel in the bounding box @@ -3713,10 +3713,10 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c { // Calculate the 2D bounding box of the triangle // Determine the minimum and maximum x and y coordinates of the triangle vertices - int xMin = (v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x); - int yMin = (v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y); - int xMax = (v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x); - int yMax = (v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y); + int xMin = (int)((v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x)); + int yMin = (int)((v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y)); + int xMax = (int)((v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x)); + int yMax = (int)((v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y)); // Clamp the bounding box to the image dimensions if (xMin < 0) xMin = 0; @@ -3731,9 +3731,9 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c // Barycentric interpolation setup // Calculate the step increments for the barycentric coordinates - int w1XStep = v3.y - v2.y, w1YStep = v2.x - v3.x; - int w2XStep = v1.y - v3.y, w2YStep = v3.x - v1.x; - int w3XStep = v2.y - v1.y, w3YStep = v1.x - v2.x; + int w1XStep = (int)(v3.y - v2.y), w1YStep = (int)(v2.x - v3.x); + int w2XStep = (int)(v1.y - v3.y), w2YStep = (int)(v3.x - v1.x); + int w3XStep = (int)(v2.y - v1.y), w3YStep = (int)(v1.x - v2.x); // If the triangle is a back face, invert the steps if (isBackFace) @@ -3744,9 +3744,9 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c } // Calculate the initial barycentric coordinates for the top-left point of the bounding box - int w1Row = (xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y); - int w2Row = (xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y); - int w3Row = (xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y); + int w1Row = (int)((xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y)); + int w2Row = (int)((xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y)); + int w3Row = (int)((xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y)); // Calculate the inverse of the sum of the barycentric coordinates for normalization // NOTE 1: Here, we act as if we multiply by 255 the reciprocal, which avoids additional @@ -3799,9 +3799,9 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c // Draw triangle outline within an image void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color) { - ImageDrawLine(dst, v1.x, v1.y, v2.x, v2.y, color); - ImageDrawLine(dst, v2.x, v2.y, v3.x, v3.y, color); - ImageDrawLine(dst, v3.x, v3.y, v1.x, v1.y, color); + ImageDrawLine(dst, (int)v1.x, (int)v1.y, (int)v2.x, (int)v2.y, color); + ImageDrawLine(dst, (int)v2.x, (int)v2.y, (int)v3.x, (int)v3.y, color); + ImageDrawLine(dst, (int)v3.x, (int)v3.y, (int)v1.x, (int)v1.y, color); } // Draw a triangle fan defined by points within an image (first vertex is the center) From 385e60dd41d49d56ac1bf44b68549070d108e941 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 24 Jun 2024 18:41:33 +0200 Subject: [PATCH 65/71] Minor tweaks --- src/raylib.h | 2 +- src/rlgl.h | 2 +- src/rshapes.c | 2 +- src/rtextures.c | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 8cd1d1ec02d4..c3c546c368f4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1342,7 +1342,7 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -RLAPI void ImageKernelConvolution(Image *image, float *kernel, int kernelSize); // Apply Custom Square image convolution kernel +RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color diff --git a/src/rlgl.h b/src/rlgl.h index bdf665a44366..98d43ea57dac 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1406,7 +1406,7 @@ void rlBegin(int mode) } } -void rlEnd() { glEnd(); } +void rlEnd(void) { glEnd(); } void rlVertex2i(int x, int y) { glVertex2i(x, y); } void rlVertex2f(float x, float y) { glVertex2f(x, y); } void rlVertex3f(float x, float y, float z) { glVertex3f(x, y, z); } diff --git a/src/rshapes.c b/src/rshapes.c index 95c54770e001..49970d7fbe84 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -126,7 +126,7 @@ Rectangle GetShapesTextureRectangle(void) // Draw a pixel void DrawPixel(int posX, int posY, Color color) { - DrawPixelV((Vector2){ (float)posX, (float)posY }, color); + DrawPixelV((Vector2){ (float)posX, (float)posY }, color); } // Draw a pixel (Vector version) diff --git a/src/rtextures.c b/src/rtextures.c index 783e9b7f9b23..e914db4190db 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -2156,8 +2156,9 @@ void ImageBlurGaussian(Image *image, int blurSize) ImageFormat(image, format); } -// The kernel matrix is assumed to be square. Only supply the width of the kernel -void ImageKernelConvolution(Image *image, float* kernel, int kernelSize) +// Apply custom square convolution kernel to image +// NOTE: The convolution kernel matrix is expected to be square +void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize) { if ((image->data == NULL) || (image->width == 0) || (image->height == 0) || kernel == NULL) return; From ec95ee85a386db29f059b9738cd5ec9329f1661e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Jun 2024 16:42:01 +0000 Subject: [PATCH 66/71] Update raylib_api.* by CI --- parser/output/raylib_api.json | 4 ++-- parser/output/raylib_api.lua | 4 ++-- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index a75b94ed0ec4..2baa6c3f3fc0 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -7351,7 +7351,7 @@ }, { "name": "ImageKernelConvolution", - "description": "Apply Custom Square image convolution kernel", + "description": "Apply custom square convolution kernel to image", "returnType": "void", "params": [ { @@ -7359,7 +7359,7 @@ "name": "image" }, { - "type": "float *", + "type": "const float *", "name": "kernel" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 7dcb1fa41741..a6d91cd6db49 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5617,11 +5617,11 @@ return { }, { name = "ImageKernelConvolution", - description = "Apply Custom Square image convolution kernel", + description = "Apply custom square convolution kernel to image", returnType = "void", params = { {type = "Image *", name = "image"}, - {type = "float *", name = "kernel"}, + {type = "const float *", name = "kernel"}, {type = "int", name = "kernelSize"} } }, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index fd082d07439d..f283ad795002 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -2840,9 +2840,9 @@ Function 303: ImageBlurGaussian() (2 input parameters) Function 304: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void - Description: Apply Custom Square image convolution kernel + Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) - Param[2]: kernel (type: float *) + Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) Function 305: ImageResize() (3 input parameters) Name: ImageResize diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 22f9b0ec7610..fa953b626f1e 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1842,9 +1842,9 @@ - + - + From 3e441ae98b262c1f5a746d49491918c862137fef Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jun 2024 16:37:20 +0200 Subject: [PATCH 67/71] REVIEWED: `DrawLine()` #4075 --- src/rshapes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 49970d7fbe84..a08cb49e1442 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -179,8 +179,8 @@ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color colo rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); // WARNING: Adding 0.5f offset to "center" point on selected pixel - rlVertex2f((float)startPosX + 0.5f, (float)startPosY + 0.5f); - rlVertex2f((float)endPosX + 0.5f, (float)endPosY + 0.5f); + rlVertex2f((float)startPosX, (float)startPosY); + rlVertex2f((float)endPosX, (float)endPosY); rlEnd(); } @@ -190,8 +190,8 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); // WARNING: Adding 0.5f offset to "center" point on selected pixel - rlVertex2f(startPos.x + 0.5f, startPos.y + 0.5f); - rlVertex2f(endPos.x + 0.5f, endPos.y + 0.5f); + rlVertex2f(startPos.x, startPos.y); + rlVertex2f(endPos.x, endPos.y); rlEnd(); } From dfabbd8ba8342169247685c294ae09f882f48e2c Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Tue, 25 Jun 2024 20:38:55 +0100 Subject: [PATCH 68/71] [rtext] Don't return default font if LoadFontEx fails (#4077) It is currently impossible to check a font loaded successfully with IsFontReady because LoadFontEx will always return a valid font. DrawTextEx has this check: if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font So anyone relying on the default font as a fallback for fonts failing to load should still be covered. --- src/rtext.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 35e69420fbf7..55061a1bd41b 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -394,7 +394,6 @@ Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepoi UnloadFileData(fileData); } - else font = GetFontDefault(); return font; } From 4239e66c55cc36ac5fe4c764d786638b4cece312 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jun 2024 21:39:43 +0200 Subject: [PATCH 69/71] Update rshapes.c --- src/rshapes.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index a08cb49e1442..b119f50ec1b8 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -178,7 +178,6 @@ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color colo { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - // WARNING: Adding 0.5f offset to "center" point on selected pixel rlVertex2f((float)startPosX, (float)startPosY); rlVertex2f((float)endPosX, (float)endPosY); rlEnd(); @@ -189,7 +188,6 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - // WARNING: Adding 0.5f offset to "center" point on selected pixel rlVertex2f(startPos.x, startPos.y); rlVertex2f(endPos.x, endPos.y); rlEnd(); From 0979eafa84c7c5b330a99067411afbc9d5cd13b5 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jun 2024 21:40:41 +0200 Subject: [PATCH 70/71] WARNING: REMOVED: Default font fallback --- src/rtext.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 55061a1bd41b..8daf3a7bc16a 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -362,11 +362,7 @@ Font LoadFont(const char *fileName) UnloadImage(image); } - if (font.texture.id == 0) - { - TRACELOG(LOG_WARNING, "FONT: [%s] Failed to load font texture -> Using default font", fileName); - font = GetFontDefault(); - } + if (font.texture.id == 0) TRACELOG(LOG_WARNING, "FONT: [%s] Failed to load font texture -> Using default font", fileName); else { SetTextureFilter(font.texture, TEXTURE_FILTER_POINT); // By default, we set point filter (the best performance) From 37205bba84263c5168f7aaeef4da9c43c56a87e1 Mon Sep 17 00:00:00 2001 From: jspast <140563347+jspast@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:15:29 -0300 Subject: [PATCH 71/71] [web] Fix undesired scrollbars on shell files (#4104) --- src/minshell.html | 8 ++++++-- src/shell.html | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/minshell.html b/src/minshell.html index 38f3672b9161..4068ca36c750 100644 --- a/src/minshell.html +++ b/src/minshell.html @@ -34,8 +34,12 @@