From f65d5ad7a9682696f96ef7fbca13609126139a71 Mon Sep 17 00:00:00 2001 From: ghera Date: Sun, 24 May 2026 08:55:08 +0200 Subject: [PATCH 01/63] rshapes: fix auto segment rounded-corner math and rounding (#5883) --- src/rshapes.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 69c1dacea..5ef988e38 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -361,7 +361,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -453,7 +453,7 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -579,7 +579,7 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startA { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -670,7 +670,7 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float s { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); - segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); if (segments <= 0) segments = minSegments; } @@ -960,7 +960,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)(ceilf(2*PI/th)/2.0f); + segments = (int)ceilf((2*PI/th)/4.0f); if (segments <= 0) segments = 4; } @@ -1195,7 +1195,7 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)(ceilf(2*PI/th)/2.0f); + segments = (int)ceilf((2*PI/th)/4.0f); if (segments <= 0) segments = 4; } From f17babfe8af98e7a6bf565f790cccf43177187c6 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 24 May 2026 09:24:26 +0200 Subject: [PATCH 02/63] REVIEWED: #5879 --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index e8164073f..286f33c28 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1164,7 +1164,7 @@ RLAPI bool ChangeDirectory(const char *dirPath); // Change wo 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, files and directories, no subdirs scan -RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*` +RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths From 7dd72e73284f7d6ed8d9e292ea421071117757a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 07:25:01 +0000 Subject: [PATCH 03/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 2 +- tools/rlparser/output/raylib_api.lua | 2 +- tools/rlparser/output/raylib_api.txt | 2 +- tools/rlparser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index aa018051a..b42fd2d61 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -4696,7 +4696,7 @@ }, { "name": "LoadDirectoryFilesEx", - "description": "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`", + "description": "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'", "returnType": "FilePathList", "params": [ { diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index e88db0b7e..859ef38ba 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4207,7 +4207,7 @@ return { }, { name = "LoadDirectoryFilesEx", - description = "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`", + description = "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'", returnType = "FilePathList", params = { {type = "const char *", name = "basePath"}, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 0447edd23..0051c6a14 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1789,7 +1789,7 @@ Function 146: LoadDirectoryFiles() (1 input parameters) Function 147: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList - Description: Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*` + Description: Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index e9db25846..fdc1481ec 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1125,7 +1125,7 @@ - + From 808e6b9b20f76de5af1f512ae2a76af01627de74 Mon Sep 17 00:00:00 2001 From: keyle Date: Mon, 25 May 2026 01:36:12 +1000 Subject: [PATCH 04/63] Raylib-lua version to 5.5 (#5884) raylib-lua from 5.0 to 5.5 in bindings. --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 7d350a9b0..710a7a1ed 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -49,7 +49,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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) | 5.0 | [Lua](http://www.lua.org) | ISC | +| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.5 | [Lua](http://www.lua.org) | ISC | | [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC | | [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib | From eaf32c83bf40c873f4ae9b455752a5c5ac05dae0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 25 May 2026 00:26:26 +0200 Subject: [PATCH 05/63] REXM: Latest w64devkit supports `make` directly, simplifying code to avoid `mingw32-make` --- tools/rexm/rexm.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index 71404dcf8..75eb3dc99 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -675,13 +675,12 @@ int main(int argc, char *argv[]) // WARNING 2: raylib.a and raylib.web.a must be available when compiling locally #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", GetFileNameWithoutExt(inFileName)); - //putenv("RAYLIB_DIR=C:\\GitHub\\raylib"); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); #else LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", GetFileNameWithoutExt(inFileName)); - system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); #endif + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); + // Update generated .html metadata LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName)); UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName), @@ -778,10 +777,9 @@ int main(int argc, char *argv[]) // WARNING: EMSDK_PATH must be set to proper location when calling from GitHub Actions #if defined(_WIN32) _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename)); -#else - system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename)); #endif + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename)); + // Update generated .html metadata UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exRename), TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename)); @@ -917,7 +915,7 @@ int main(int argc, char *argv[]) // Set required environment variables //putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath)); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - //putenv("MAKE=mingw32-make"); + //putenv("MAKE=make"); //ChangeDirectory(exBasePath); #endif for (int i = 0; i < exBuildListCount; i++) @@ -933,7 +931,7 @@ int main(int argc, char *argv[]) // Build example for PLATFORM_DESKTOP #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName)); + system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName)); #elif defined(PLATFORM_DRM) LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName); system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1", @@ -949,13 +947,9 @@ int main(int argc, char *argv[]) // Build: raylib.com/examples//_example_name.data // Build: raylib.com/examples//_example_name.wasm // Build: raylib.com/examples//_example_name.js - #if defined(_WIN32) - LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); - #else - LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName); + LOG("INFO: [%s] Building example for PLATFORM_WEB\n", exName); system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName)); - #endif + // Update generated .html metadata LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName)); UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName), @@ -1312,11 +1306,10 @@ int main(int argc, char *argv[]) #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exInfo->name); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name)); #else LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exInfo->name); - system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name)); #endif + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name)); // Update generated .html metadata LOG("INFO: [%s.html] Updating HTML Metadata...\n", exInfo->name); @@ -1495,7 +1488,7 @@ int main(int argc, char *argv[]) // Set required environment variables //putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath)); //_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - //putenv("MAKE=mingw32-make"); + //putenv("MAKE=make"); //ChangeDirectory(exBasePath); //_putenv("MAKE_PATH=C:\\raylib\\w64devkit\\bin"); //_putenv("EMSDK_PATH = C:\\raylib\\emsdk"); @@ -1592,7 +1585,7 @@ int main(int argc, char *argv[]) // Build: raylib.com/examples//_example_name.js #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B > %s/%s/logs/%s.build.log 2>&1", + system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B > %s/%s/logs/%s.build.log 2>&1", exBasePath, exCategory, exName, exBasePath, exCategory, exName)); #else LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName); @@ -1641,13 +1634,13 @@ int main(int argc, char *argv[]) // Set required environment variables //putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath)); _putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin"); - //putenv("MAKE=mingw32-make"); + //putenv("MAKE=make"); //ChangeDirectory(exBasePath); #endif // Build example for PLATFORM_DESKTOP #if defined(_WIN32) LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName); - system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", + system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", exBasePath, exCategory, exName, exBasePath, exCategory, exName)); #elif defined(PLATFORM_DRM) LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName); From 4d845608b8bd6cdda173917521c4c61e7d639f1e Mon Sep 17 00:00:00 2001 From: coal Date: Mon, 25 May 2026 02:32:52 -0400 Subject: [PATCH 06/63] Update listed Raylib version for zig bindings (#5886) As per the README at https://github.com/raylib-zig/raylib-zig, raylib-zig now supports raylib 6.0 --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 710a7a1ed..256c82c2c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -90,7 +90,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib | | [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib | | [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC | -| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT | +| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **6.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 | From 34b06ca5871d7f6fa39e9e37f7f8f453db9f6cee Mon Sep 17 00:00:00 2001 From: Rgebee Date: Mon, 25 May 2026 15:05:20 +0100 Subject: [PATCH 07/63] Update BINDINGS.md (#5887) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 256c82c2c..bd5d6b213 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -11,7 +11,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | | [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib6.c3l) | **6** | [C3](https://c3-lang.org) | MIT | -| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | +| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **6.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.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | From 7f9ded76425d4c28d9a53843dfe5acd9bfe128ae Mon Sep 17 00:00:00 2001 From: Fipaan Date: Tue, 26 May 2026 21:13:58 +0500 Subject: [PATCH 08/63] [makefile] ANDROID_ARCH check (#5888) --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile b/src/Makefile index 13f132707..6d918215a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -240,6 +240,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) ifeq ($(ANDROID_ARCH),x86_64) ANDROID_COMPILER_ARCH = x86_64 endif + ifndef ANDROID_COMPILER_ARCH + $(error ANDROID_COMPILER_ARCH: Unknown ANDROID_ARCH=$(ANDROID_ARCH)) + endif endif # Define raylib graphics api depending on selected platform From ef8b3e619532fa95a93040c7e7349f55366689bd Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 26 May 2026 20:46:56 +0200 Subject: [PATCH 09/63] Update rlgl.h --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index ea5673397..e1c0089dc 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -896,7 +896,7 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad // It seems OpenGL ES 2.0 instancing entry points are not defined on Raspberry Pi // provided headers (despite being defined in official Khronos GLES2 headers) // TODO: Avoid raylib platform-dependent code on rlgl, it should be a completely portable library - #if defined(PLATFORM_DRM) + #if defined(PLATFORM_DRM) // Use CONFIG_DRM? typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); From e7edb181dc070e0abf90792204b4b6b02bcdd508 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 27 May 2026 03:20:11 -0400 Subject: [PATCH 10/63] cmake: Reduce minimum CMake version from 3.25 to 3.22 (#5890) There isn't anything in 3.25 that we actually need, so we can reduce the minimum requirement. 3.22 is commonly available across many package managers. For a list of the changes in `FetchContent`, see: https://cmake.org/cmake/help/latest/module/FetchContent.html --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1d319e8d..ca29ce0d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.25) +cmake_minimum_required(VERSION 3.22) #this change avoid the warning that appear when we include raylib using Cmake fatch content project(raylib) From 186d3ce9fb472ae20c1692b30b1245a31a2d1bf1 Mon Sep 17 00:00:00 2001 From: Colin James Wood <82226641+NighthowlerStudios@users.noreply.github.com> Date: Fri, 29 May 2026 17:16:17 +0100 Subject: [PATCH 11/63] [CMake] Properly remove raudio.c and rmodels.c if they're disabled modules (#5878) * only build raudio.c in cmake if it's still enabled * only compile rmodels if it's supported --- src/CMakeLists.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e5dd91ee..55428e882 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,14 +30,22 @@ set(raylib_public_headers # Sources to be compiled set(raylib_sources - raudio.c rcore.c - rmodels.c rshapes.c rtext.c rtextures.c ) +# Only build raudio if it's enabled +if (NOT DEFINED SUPPORT_MODULE_RAUDIO OR SUPPORT_MODULE_RAUDIO) + list(APPEND raylib_sources raudio.c) +endif() + +# Only build rmodels if it's enabled +if (NOT DEFINED SUPPORT_MODULE_RMODELS OR SUPPORT_MODULE_RMODELS) + list(APPEND raylib_sources rmodels.c) +endif() + # /cmake/GlfwImport.cmake handles the details around the inclusion of glfw if (NOT ${PLATFORM} MATCHES "Web") include(GlfwImport) @@ -48,10 +56,10 @@ endif () # Produces a variable LIBS_PRIVATE that will be used later include(LibraryConfigurations) -if (SUPPORT_MODULE_RAUDIO) - MESSAGE(STATUS "Audio Backend: miniaudio") -else () +if (DEFINED SUPPORT_MODULE_RAUDIO AND NOT SUPPORT_MODULE_RAUDIO) MESSAGE(STATUS "Audio Backend: None (-DCUSTOMIZE_BUILD=ON -DSUPPORT_MODULE_RAUDIO=OFF)") +else () + MESSAGE(STATUS "Audio Backend: miniaudio") endif () add_library(raylib ${raylib_sources} ${raylib_public_headers}) From 81c7cb65274bf2a952a97fb32bc153a3c71ba5c1 Mon Sep 17 00:00:00 2001 From: Caleb Seelhoff Date: Fri, 29 May 2026 12:17:04 -0400 Subject: [PATCH 12/63] [rmodels] Fix glTF skinning when joints have non-joint parent nodes (#5876) * [rmodels] Fix glTF skinning when joints have non-joint parent nodes Some glTF exporters (notably wow.export, but also various other DCC pipelines) place skin joints under intermediate non-joint transform nodes that carry part of the bind-pose offset. raylib's existing LoadBoneInfoGLTF and LoadModelAnimationsGLTF only inspected a joint's immediate parent and only sampled joint-local TRS, so any transform stored on an intermediate non-joint ancestor was silently dropped, producing exploded or stretched meshes at runtime. Two surgical changes: LoadBoneInfoGLTF: walk the parent chain past any non-joint ancestors when looking up parentIndex, instead of comparing only against node.parent. Joints whose direct parent is a non-joint were previously treated as skeleton roots. LoadModelAnimationsGLTF: precompute a per-joint extOffset matrix that bakes in the static TRS contribution of any intermediate non-joint nodes between the joint and its nearest joint ancestor. Apply it to each frame's joint TRS before BuildPoseFromParentJoints so the per-frame world transforms match the bind-pose world transforms (LoadGLTF already used cgltf_node_transform_world for bindPose, so this aligns the two code paths). The replaced root-only worldTransform adjustment is a strict subset of the new per-joint extOffset machinery, so it has been removed. Spec-compliant files (the six skeletal-skinning .glb examples shipped with raylib) render bit-identically before and after; previously broken files (e.g. wow.export's babyoctopus.gltf) now match the reference rendering from f3d, the Khronos sample viewer, and three.js. * Resolve review: NULL-check joint offset allocation, fail fast [rmodels] Address review feedback on glTF joint offset handling Resolve the open review points raised on PR #5876 for the per-joint extOffset precompute in LoadModelAnimationsGLTF. * NULL check: validate the extOffset RL_MALLOC result before use, which was previously missing. * Fail-fast handling: detect the allocation failure at its source and abort animation loading (log a warning, free resources, return NULL) instead of propagating a NULL pointer into the per-frame loop. * Brace formatting: expand the collapsed one-line joint-match check (if (...) { isJoint = true; break; }) into raylib's standard Allman brace style. * Readability: break the deeply nested MatrixMultiply(MatrixMultiply(...)) into named nodeScale/nodeRotation/nodeTranslation/nodeTransform locals, mirroring the existing S/R/T composition later in the function. * Spacing/line breaks: add blank lines within the precompute block to match the surrounding code style. --- src/rmodels.c | 100 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 29 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index eb7f30cb8..eeebc3d2b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5375,16 +5375,18 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount) cgltf_node node = *skin.joints[i]; if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name) - 1); - // Find parent bone index + // Find parent bone index by walking up the node tree past any + // non-joint ancestors (intermediate transform nodes used by some + // DCC exporters), until we hit a node that is also in skin.joints. int parentIndex = -1; - - for (unsigned int j = 0; j < skin.joints_count; j++) + cgltf_node *ancestor = node.parent; + while (ancestor != NULL && parentIndex == -1) { - if (skin.joints[j] == node.parent) + for (unsigned int j = 0; j < skin.joints_count; j++) { - parentIndex = (int)j; - break; + if (skin.joints[j] == ancestor) { parentIndex = (int)j; break; } } + if (parentIndex == -1) ancestor = ancestor->parent; } bones[i].parent = parentIndex; @@ -6515,20 +6517,58 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo if (data->skins_count > 0) { cgltf_skin skin = data->skins[0]; + + // Precompute, per joint, the static transform contributed by any + // intermediate non-joint nodes between the joint and its nearest + // joint ancestor. This handles exporters (e.g. wow.export) that + // store bone offsets on dummy parent nodes rather than on the + // joints themselves. Depends only on the skin, not the animation. + int jointCount = (int)skin.joints_count; + Matrix *extOffset = (Matrix *)RL_MALLOC(jointCount*sizeof(Matrix)); + + if (extOffset == NULL) + { + // Allocation failed: abort animation loading at the source rather than + // propagating a NULL pointer into the per-frame transform loop below + TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to allocate joint offset buffer", fileName); + cgltf_free(data); + UnloadFileData(fileData); + *animCount = 0; + return NULL; + } + *animCount = (int)data->animations_count; animations = (ModelAnimation *)RL_CALLOC(data->animations_count, sizeof(ModelAnimation)); - Transform worldTransform = { 0 }; - cgltf_float cgltf_worldTransform[16] = { 0 }; - cgltf_node *node = skin.joints[0]; - cgltf_node_transform_world(node->parent, cgltf_worldTransform); - Matrix worldMatrix = { - cgltf_worldTransform[0], cgltf_worldTransform[4], cgltf_worldTransform[8], cgltf_worldTransform[12], - cgltf_worldTransform[1], cgltf_worldTransform[5], cgltf_worldTransform[9], cgltf_worldTransform[13], - cgltf_worldTransform[2], cgltf_worldTransform[6], cgltf_worldTransform[10], cgltf_worldTransform[14], - cgltf_worldTransform[3], cgltf_worldTransform[7], cgltf_worldTransform[11], cgltf_worldTransform[15] - }; - MatrixDecompose(worldMatrix, &worldTransform.translation, &worldTransform.rotation, &worldTransform.scale); + for (int k = 0; k < jointCount; k++) + { + extOffset[k] = MatrixIdentity(); + cgltf_node *n = skin.joints[k]->parent; + + while (n != NULL) + { + bool isJoint = false; + for (int jj = 0; jj < jointCount; jj++) + { + if (skin.joints[jj] == n) + { + isJoint = true; + break; + } + } + + if (isJoint) break; + + // Compose the intermediate node's local TRS (scale, then rotation, then translation) + Matrix nodeScale = MatrixScale(n->scale[0], n->scale[1], n->scale[2]); + Matrix nodeRotation = QuaternionToMatrix((Quaternion){ n->rotation[0], n->rotation[1], n->rotation[2], n->rotation[3] }); + Matrix nodeTranslation = MatrixTranslate(n->translation[0], n->translation[1], n->translation[2]); + Matrix nodeTransform = MatrixMultiply(MatrixMultiply(nodeScale, nodeRotation), nodeTranslation); + + extOffset[k] = MatrixMultiply(extOffset[k], nodeTransform); + n = n->parent; + } + } for (unsigned int a = 0; a < data->animations_count; a++) { @@ -6637,19 +6677,19 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo } } - animations[a].keyframePoses[j][k] = (Transform){ - .translation = translation, - .rotation = rotation, - .scale = scale - }; - } + // Compose joint local TRS, then prepend the static + // intermediate non-joint offsets so the final TRS is + // expressed relative to the joint's skeleton parent. + Matrix S = MatrixScale(scale.x, scale.y, scale.z); + Matrix R = QuaternionToMatrix(rotation); + Matrix T = MatrixTranslate(translation.x, translation.y, translation.z); + Matrix jointLocal = MatrixMultiply(MatrixMultiply(S, R), T); + Matrix combined = MatrixMultiply(jointLocal, extOffset[k]); - Transform *root = &animations[a].keyframePoses[j][0]; - root->rotation = QuaternionMultiply(worldTransform.rotation, root->rotation); - root->scale = Vector3Multiply(root->scale, worldTransform.scale); - root->translation = Vector3Multiply(root->translation, worldTransform.scale); - root->translation = Vector3RotateByQuaternion(root->translation, worldTransform.rotation); - root->translation = Vector3Add(root->translation, worldTransform.translation); + Transform tr; + MatrixDecompose(combined, &tr.translation, &tr.rotation, &tr.scale); + animations[a].keyframePoses[j][k] = tr; + } BuildPoseFromParentJoints(bones, animations[a].boneCount, animations[a].keyframePoses[j]); } @@ -6658,6 +6698,8 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo RL_FREE(boneChannels); RL_FREE(bones); } + + RL_FREE(extOffset); } if (data->skins_count > 1) From 7b96144716e1c133aa89e473efac2533ae12395e Mon Sep 17 00:00:00 2001 From: Vasilis Narain <79228641+Vasilis-Narain@users.noreply.github.com> Date: Fri, 29 May 2026 18:18:18 +0200 Subject: [PATCH 13/63] [rcore] `GetCurrentMonitor()`, fix for integer overflow in distance calculation (#5842) * Fix signed integer overflow in GetCurrentMonitor distance calc * Revert "Fix signed integer overflow in GetCurrentMonitor distance calc" This reverts commit e0083bc7fe8a4dab23e6c1783402e37aec2661d2. * fix GetCurrentMonitor() distance calc overflow * fix GetCurrentMonitor() distance calc --- src/platforms/rcore_desktop_glfw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 6def8e77a..16f22f605 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -839,7 +839,7 @@ int GetCurrentMonitor(void) // this is probably an overengineered solution for a side case // trying to match SDL behaviour - int closestDist = 0x7FFFFFFF; + unsigned int closestDist = 0xFFFFFFFFu; // Window center position int wcx = 0; @@ -883,7 +883,14 @@ int GetCurrentMonitor(void) int dx = wcx - xclosest; int dy = wcy - yclosest; - int dist = (dx*dx) + (dy*dy); + + // Unsigned to dodge signed overflow UB; (-x)^2 == x^2 mod 2^32 so sign drops out. + // If |dx| or |dy| >= 65536, dist wraps and the wrong monitor may win. + // Not a concern for realistic monitor layouts. + unsigned int ux = (unsigned int)dx; + unsigned int uy = (unsigned int)dy; + unsigned int dist = ux*ux + uy*uy; + if (dist < closestDist) { index = i; From 7c284cc5bc4a573596104a42f34d5518ff080949 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sat, 30 May 2026 03:47:35 -0300 Subject: [PATCH 14/63] Fix warning about unused variables (#5898) --- src/rcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index 74774e77b..9f93ecbbc 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2277,10 +2277,11 @@ int FileMove(const char *srcPath, const char *dstPath) int FileTextReplace(const char *fileName, const char *search, const char *replacement) { int result = 0; + +#if SUPPORT_MODULE_RTEXT char *fileText = NULL; char *fileTextUpdated = { 0 }; -#if SUPPORT_MODULE_RTEXT if (FileExists(fileName)) { fileText = LoadFileText(fileName); From f0d3e9a5c8466bb0971be14ade7730ce0eaec45d Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sat, 30 May 2026 03:49:34 -0300 Subject: [PATCH 15/63] Security fixes (rcore_desktop_win32.c) (#5899) * Security fixes in rcore_desktop_win32.c * Avoid calling strlen() twice --- src/platforms/rcore_desktop_win32.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index a797234ba..33ce1f661 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1257,8 +1257,9 @@ void OpenURL(const char *url) if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); else { - char *cmd = (char *)RL_CALLOC(strlen(url) + 32, sizeof(char)); - sprintf(cmd, "explorer \"%s\"", url); + int len = strlen(url) + 32; + char *cmd = (char *)RL_CALLOC(len, sizeof(char)); + snprintf(cmd, len, "explorer \"%s\"", url); int result = system(cmd); if (result == -1) TRACELOG(LOG_WARNING, "OpenURL() child process could not be created"); RL_FREE(cmd); @@ -2052,8 +2053,11 @@ static void HandleMouseButton(int button, char state) static void HandleRawInput(LPARAM lparam) { RAWINPUT input = { 0 }; + UINT inputSize = 0; + + if (GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &inputSize, sizeof(RAWINPUTHEADER)) != 0) return; + if (inputSize > sizeof(input)) return; - UINT inputSize = sizeof(input); UINT size = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &input, &inputSize, sizeof(RAWINPUTHEADER)); if (size == (UINT)-1) TRACELOG(LOG_ERROR, "WIN32: Failed to get raw input data [ERROR: %lu]", GetLastError()); From 2ee6a764641dd7392d1b8c606519135c14ace1a3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 30 May 2026 12:20:58 +0200 Subject: [PATCH 16/63] REVIEWED: `GetWindowHandle()`, to be consistent between backends, fix #5885 Returns the underlying window handle for platforms with some windowing system. --- src/platforms/rcore_android.c | 3 +- src/platforms/rcore_desktop_glfw.c | 24 ++++++------ src/platforms/rcore_desktop_rgfw.c | 27 +++++++++---- src/platforms/rcore_desktop_sdl.c | 61 ++++++++++++++++++++++++++++- src/platforms/rcore_desktop_win32.c | 2 +- 5 files changed, 94 insertions(+), 23 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 990b2fe6a..78abe9ed6 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -473,8 +473,7 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - TRACELOG(LOG_WARNING, "GetWindowHandle() not implemented on target platform"); - return NULL; + return (void *)platform.app->window; // Type: ANativeWindow* } // Get number of monitors diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 16f22f605..d885acf43 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -115,7 +115,7 @@ typedef struct { // Local storage for the window handle returned by glfwGetX11Window // This is needed as X11 handles are integers and may not fit inside a pointer depending on platform // Storing the handle locally and returning a pointer in GetWindowHandle allows the code to work regardless of pointer width - XID windowHandleX11; + Window windowHandleX11; // Underlying type: unsigned long (XID, Window) #endif } PlatformData; @@ -764,9 +764,10 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { + void *handle = NULL; + #if defined(_WIN32) - // NOTE: Returned handle is: void *HWND (windows.h) - return glfwGetWin32Window(platform.handle); + handle = glfwGetWin32Window(platform.handle); // Type: HWND #endif #if defined(__linux__) #if defined(_GLFW_WAYLAND) @@ -774,28 +775,27 @@ void *GetWindowHandle(void) int platformID = glfwGetPlatform(); if (platformID == GLFW_PLATFORM_WAYLAND) { - return glfwGetWaylandWindow(platform.handle); + handle = (void *)glfwGetWaylandWindow(platform.handle); // Type: struct wl_surface* } else { - platform.windowHandleX11 = glfwGetX11Window(platform.handle); - return &platform.windowHandleX11; + platform.windowHandleX11 = glfwGetX11Window(platform.handle); // Type: Window (unsigned long) + handle = &platform.windowHandleX11; } #else - return glfwGetWaylandWindow(platform.handle); + handle = (void *)glfwGetWaylandWindow(platform.handle); #endif #elif defined(_GLFW_X11) - // Store the window handle localy and return a pointer to the variable instead + // Store the window handle locally and return a pointer to the variable instead platform.windowHandleX11 = glfwGetX11Window(platform.handle); - return &platform.windowHandleX11; + handle = &platform.windowHandleX11; #endif #endif #if defined(__APPLE__) - // NOTE: Returned handle is: (objc_object *) - return (void *)glfwGetCocoaWindow(platform.handle); + handle = (void *)glfwGetCocoaWindow(platform.handle); // Type: NSWindow* #endif - return NULL; + return handle; } // Get number of monitors diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 1cb38ff61..4f54e1708 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -184,6 +184,9 @@ typedef struct { i32 surfaceWidth; i32 surfaceHeight; #endif +#if defined(__linux__) && defined(RGFW_X11) + Window windowHandleX11; // Underlying type: unsigned long +#endif } PlatformData; //---------------------------------------------------------------------------------- @@ -851,15 +854,25 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - if (platform.window == NULL) return NULL; + void *handle = NULL; -#if defined(RGFW_WASM) - return (void *)&platform.window->src.ctx; -#elif defined(RGFW_WAYLAND) - return (void *)platform.window->src.surface; -#else - return (void *)platform.window->src.window; + if (platform.window != NULL) + { +#if defined(_WIN32) + handle = (void *)platform.window->src.window; // Type: HWND +#elif defined(__linux__) + #if defined(RGFW_X11) + platform.windowHandleX11 = platform.window->src.window; // Type: Window (unsigned long) + handle = &platform.window->src.window; + #elif defined(RGFW_WAYLAND) + handle = (void *)platform.window->src.surface; // Type: struct wl_surface* + #endif +#elif defined(__APPLE__) + handle = (void *)platform.window->src.window; // Type: id, NSWindow* #endif + } + + return handle; } // Get number of monitors diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 1b434b5d2..d568ec095 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -56,6 +56,7 @@ #include "SDL3/SDL.h" #elif defined(USING_SDL2_PROJECT) #include "SDL2/SDL.h" + #include "SDL2/SDL_syswm.h" // Required to get window handlers #else #include "SDL.h" #endif @@ -101,6 +102,13 @@ typedef struct { SDL_GameController *gamepad[MAX_GAMEPADS]; SDL_JoystickID gamepadId[MAX_GAMEPADS]; // Joystick instance ids, they do not start from 0 SDL_Cursor *cursor; + +#if defined(__linux__) + // Local storage for the window handle (X11) + // NOTE: On SDL is not possible to know windowing backend at compile time, so, + // just in case, avoiding X11 specific types here + unsigned long windowHandleX11; // Underlying type for: XID, Window +#endif } PlatformData; //---------------------------------------------------------------------------------- @@ -920,9 +928,60 @@ void SetWindowFocused(void) } // Get native window handle +// NOTE: Handle type depends on OS and windowing system void *GetWindowHandle(void) { - return (void *)platform.window; + void *handle = NULL; + +#if defined(USING_SDL3_PROJECT) + // REF: https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_video.h#L1590 + SDL_PropertiesID props = SDL_GetWindowProperties(platform.window); + #if defined(_WIN32) + handle = (void *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); // Type: HWND + #elif defined(__linux__) + unsigned long windowId = (unsigned long)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); // Type: unsigned long (XID, Window) + if (windowId != 0) + { + // X11 window ID + platform.windowHandleX11 = windowId; + handle = &platform.windowHandleX11; + } + else + { + // Wayland, get display surface pointer + // NOTE: Alternative SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER + handle = (void *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); // Type: struct wl_surface* + } + #elif defined(__APPLE__) + handle = (void *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); // Type: NSWindow* + #endif +#elif defined(USING_SDL2_PROJECT) + SDL_SysWMinfo wmInfo = { 0 }; + SDL_VERSION(&wmInfo.version); + if (SDL_GetWindowWMInfo(platform.window, &wmInfo)) + { + #if defined(_WIN32) + handle = (void *)wmInfo.info.win.window; // Type: HWND + #elif defined(__linux__) + if (wmInfo.subsystem == SDL_SYSWM_X11) + { + // X11, get window ID (unsigned long) + platform.windowHandleX11 = (unsigned long)wmInfo.info.x11.window; + handle = &platform.windowHandleX11; + } + else if (wmInfo.subsystem == SDL_SYSWM_WAYLAND) + { + // Wayland, get display surface pointer + // NOTE: Alternative: wmInfo.info.wl.display + handle = (void *)wmInfo.info.wl.surface; // Type: struct wl_surface* + } + #elif defined(__APPLE__) + handle = (void *)wmInfo.info.cocoa.window; // Type: NSWindow* + #endif + } +#endif + + return handle; } // Get number of monitors diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index 33ce1f661..517af1eb8 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1023,7 +1023,7 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - return platform.hwnd; + return (void *)platform.hwnd; } int GetMonitorCount(void) From b7f50b2fb65b3d1a18a0551ef03f4d3845a9bec6 Mon Sep 17 00:00:00 2001 From: Kaggen67 Date: Sat, 30 May 2026 19:39:16 +0200 Subject: [PATCH 17/63] [rtextures] ImageDrawLine() rounding and length fix (#5896) * Fixing ImageDrawLine to be more pixel accurate Changes to ImageDrawLine() function. . Added one pixel to the length of a line so it wont draw lines one pixel short. . Changed rounding by adding 0.5 in 16 bit fixed point to 'j' in for-loop. * Changed ImagDrawLine to be more acurate --- src/rtextures.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index ba50d9d02..bedcdb6a4 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3506,7 +3506,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en } // Initialize variables for drawing loop - int endVal = longLen; + int endVal = longLen + 1; int sgnInc = 1; // Adjust direction increment based on longLen sign @@ -3514,6 +3514,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en { longLen = -longLen; sgnInc = -1; + endVal -= 2; } // Calculate fixed-point increment for shorter length @@ -3523,7 +3524,8 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en if (yLonger) { // If line is more vertical, iterate over y-axis - for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) + // Init j with 0.5 in 16-bit fixed point (1 << 15) for better rounding. + for (int i = 0, j = (1 << 15); i != endVal; i += sgnInc, j += decInc) { // Calculate pixel position and draw it ImageDrawPixel(dst, startPosX + (j >> 16), startPosY + i, color); @@ -3532,7 +3534,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en else { // If line is more horizontal, iterate over x-axis - for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) + for (int i = 0, j = (1 << 15); i != endVal; i += sgnInc, j += decInc) { // Calculate pixel position and draw it ImageDrawPixel(dst, startPosX + i, startPosY + (j >> 16), color); From 10a889c482bc001533536162cc2cc9d193845eae Mon Sep 17 00:00:00 2001 From: Bigfoot <90587919+Bigfoot71@users.noreply.github.com> Date: Sat, 30 May 2026 19:44:45 +0200 Subject: [PATCH 18/63] [rlsw] Replace `SW_TEXTURE_REPEAT_POT_FAST` with `SW_SUPPORT_NPOT_TEXTURE` (#5901) * replace `SW_TEXTURE_REPEAT_POT_FAST` by `SW_SUPPORT_NPOT_TEXTURE` * tweak `SW_SUPPORT_NPOT_TEXTURE` comment * remove extra comment --- src/external/rlsw.h | 124 +++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 64 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index ffbdaae81..b98a3f684 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -164,17 +164,10 @@ #endif #endif -// Fast power-of-two texture wrap (SW_REPEAT mode only) -// When defined, textures whose width/height are powers of two use a bitmask -// wrap (`x & (size-1)`) instead of `floorf`-based fractional wrap or the signed `%` chain in the linear sampler -// Saves a software divide on Xtensa and a few instructions everywhere -// NPOT textures keep using the original path via a runtime `(size & (size-1)) == 0` check, -// so SW_REPEAT remains correct for them -// The only observable behavior change is for POT textures sampled with negative UV coordinates: -// bitmask wrap (two's complement) can differ from `sw_fract` by one texel -// Off by default to keep bit-for-bit behavior; opt in if you control your asset UVs -// -//#define SW_TEXTURE_REPEAT_POT_FAST +// Full NPOT texture support (enabled by default) +// When disabled, SW_REPEAT requires POT on its axis (fast bitmask wrap) +// SW_CLAMP remains supported for any dimension, per-axis +#define SW_SUPPORT_NPOT_TEXTURE true //---------------------------------------------------------------------------------- // OpenGL Compatibility Types @@ -2406,6 +2399,14 @@ static inline bool sw_texture_alloc(sw_texture_t *texture, const void *data, int int bpp = SW_PIXELFORMAT_SIZE[format]; int newSize = w*h*bpp; + if (texture->pixels == NULL) + { + texture->minFilter = SW_NEAREST; + texture->magFilter = SW_NEAREST; + texture->sWrap = SW_CLAMP; + texture->tWrap = SW_CLAMP; + } + if (newSize > texture->allocSz) { void *ptr = SW_REALLOC(texture->pixels, newSize); @@ -2470,38 +2471,25 @@ static inline void sw_texture_sample_nearest(float *SW_RESTRICT color, const sw_ { int x, y; -#ifdef SW_TEXTURE_REPEAT_POT_FAST - if ((tex->sWrap == SW_REPEAT) && ((tex->width & tex->wMinus1) == 0)) - { - x = (int)(u*tex->width) & tex->wMinus1; - } - else -#endif - { - u = (tex->sWrap == SW_REPEAT)? sw_fract(u) : sw_saturate(u); - x = (int)(u*tex->width); - } +#if SW_SUPPORT_NPOT_TEXTURE + if (tex->sWrap == SW_REPEAT) x = (int)(sw_fract(u)*tex->width); + else x = (int)(sw_saturate(u)*tex->width); -#ifdef SW_TEXTURE_REPEAT_POT_FAST - if ((tex->tWrap == SW_REPEAT) && ((tex->height & tex->hMinus1) == 0)) - { - y = (int)(v*tex->height) & tex->hMinus1; - } - else + if (tex->tWrap == SW_REPEAT) y = (int)(sw_fract(v)*tex->height); + else y = (int)(sw_saturate(v)*tex->height); +#else + if (tex->sWrap == SW_REPEAT) x = (int)(u*tex->width) & tex->wMinus1; + else x = (int)(sw_saturate(u)*tex->width); + + if (tex->tWrap == SW_REPEAT) y = (int)(v*tex->height) & tex->hMinus1; + else y = (int)(sw_saturate(v)*tex->height); #endif - { - v = (tex->tWrap == SW_REPEAT)? sw_fract(v) : sw_saturate(v); - y = (int)(v*tex->height); - } tex->readColor(color, tex->pixels, y*tex->width + x); } static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_texture_t *SW_RESTRICT tex, float u, float v) { - // TODO: With a bit more cleverness the number of operations can - // be clearly reduced, but for now it works fine - float xf = (u*tex->width) - 0.5f; float yf = (v*tex->height) - 0.5f; @@ -2514,41 +2502,36 @@ static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_t int x1 = x0 + 1; int y1 = y0 + 1; - if (tex->sWrap == SW_CLAMP) - { - x0 = (x0 > tex->wMinus1)? tex->wMinus1 : x0; - x1 = (x1 > tex->wMinus1)? tex->wMinus1 : x1; - } -#ifdef SW_TEXTURE_REPEAT_POT_FAST - else if ((tex->width & tex->wMinus1) == 0) - { - // POT fast path: bitmask wrap covers negative ints via two's complement - x0 = x0 & tex->wMinus1; - x1 = x1 & tex->wMinus1; - } -#endif - else + if (tex->sWrap == SW_REPEAT) { + #if SW_SUPPORT_NPOT_TEXTURE x0 = (x0%tex->width + tex->width)%tex->width; x1 = (x1%tex->width + tex->width)%tex->width; + #else + x0 = x0 & tex->wMinus1; + x1 = x1 & tex->wMinus1; + #endif } - - if (tex->tWrap == SW_CLAMP) - { - y0 = (y0 > tex->hMinus1)? tex->hMinus1 : y0; - y1 = (y1 > tex->hMinus1)? tex->hMinus1 : y1; - } -#ifdef SW_TEXTURE_REPEAT_POT_FAST - else if ((tex->height & tex->hMinus1) == 0) - { - y0 = y0 & tex->hMinus1; - y1 = y1 & tex->hMinus1; - } -#endif else { + x0 = sw_clamp_int(x0, 0, tex->wMinus1); + x1 = sw_clamp_int(x1, 0, tex->wMinus1); + } + + if (tex->tWrap == SW_REPEAT) + { + #if SW_SUPPORT_NPOT_TEXTURE y0 = (y0%tex->height + tex->height)%tex->height; y1 = (y1%tex->height + tex->height)%tex->height; + #else + y0 = y0 & tex->hMinus1; + y1 = y1 & tex->hMinus1; + #endif + } + else + { + y0 = sw_clamp_int(y0, 0, tex->hMinus1); + y1 = sw_clamp_int(y1, 0, tex->hMinus1); } float c00[4], c10[4], c01[4], c11[4]; @@ -5187,11 +5170,25 @@ void swTexParameteri(int param, int value) case SW_TEXTURE_WRAP_S: { if (!sw_is_texture_wrap_valid(value)) { RLSW.errCode = SW_INVALID_ENUM; return; } + #if !SW_SUPPORT_NPOT_TEXTURE + if (value == SW_REPEAT && (RLSW.boundTexture->width & RLSW.boundTexture->wMinus1) != 0) + { + RLSW.errCode = SW_INVALID_OPERATION; + return; + } + #endif RLSW.boundTexture->sWrap = (SWwrap)value; } break; case SW_TEXTURE_WRAP_T: { if (!sw_is_texture_wrap_valid(value)) { RLSW.errCode = SW_INVALID_ENUM; return; } + #if !SW_SUPPORT_NPOT_TEXTURE + if (value == SW_REPEAT && (RLSW.boundTexture->height & RLSW.boundTexture->hMinus1) != 0) + { + RLSW.errCode = SW_INVALID_OPERATION; + return; + } + #endif RLSW.boundTexture->tWrap = (SWwrap)value; } break; default: RLSW.errCode = SW_INVALID_ENUM; break; @@ -5574,8 +5571,7 @@ static void SW_RASTER_TRIANGLE(const sw_vertex_t *v0, const sw_vertex_t *v1, con if (v1->position[1] > v2->position[1]) { const sw_vertex_t *tmp = v1; v1 = v2; v2 = tmp; } if (v0->position[1] > v1->position[1]) { const sw_vertex_t *tmp = v0; v0 = v1; v1 = tmp; } - // Extracting coordinates from the sorted vertices - // Put x away for safe keeping; only y is used right now; silences warnings + // Extracting Y coordinates from the sorted vertices float y0 = v0->position[1]; float y1 = v1->position[1]; float y2 = v2->position[1]; From f1d602029c86bb36e9b0c28adc86d7c1843ff02b Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 1 Jun 2026 11:25:09 -0700 Subject: [PATCH 19/63] Enable GPU skinning for GL 3.3+, (#5902) only do GPU skinning if the shader supports bone IDs. --- src/config.h | 6 +++++- src/rmodels.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/config.h b/src/config.h index 97f5ba544..86239d47d 100644 --- a/src/config.h +++ b/src/config.h @@ -322,7 +322,11 @@ #endif #ifndef SUPPORT_GPU_SKINNING // GPU skinning disabled by default, some GPUs do not support more than 8 VBOs - #define SUPPORT_GPU_SKINNING 0 + #if defined (GRAPHICS_API_OPENGL_33) || defined (GRAPHICS_API_OPENGL_43) + #define SUPPORT_GPU_SKINNING 1 + #else + #define SUPPORT_GPU_SKINNING 0 + #endif #endif //------------------------------------------------------------------------------------ diff --git a/src/rmodels.c b/src/rmodels.c index eeebc3d2b..e10f888f8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2487,9 +2487,12 @@ static void UpdateModelAnimationVertexBuffers(Model model) float boneWeight = 0.0f; bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated +#if defined (SUPPORT_GPU_SKINNING) + Material material = model.materials[model.meshMaterial[m]]; // Skip if missing bone data or missing anim buffers initialization - if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || + if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) && (mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || (mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue; +#endif for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3) { From 90edc3b0a5fe1304118ba5eb51b08284a008bece Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Jun 2026 20:42:38 +0200 Subject: [PATCH 20/63] Update models_animation_blending.c --- examples/models/models_animation_blending.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/models/models_animation_blending.c b/examples/models/models_animation_blending.c index 63eba61cd..e98547c7e 100644 --- a/examples/models/models_animation_blending.c +++ b/examples/models/models_animation_blending.c @@ -58,7 +58,7 @@ int main(void) Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); - // Assign skinning shader to all materials shaders + // NOTE: Assign skinning shader to all materials shaders //for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader; // Load model animations @@ -244,6 +244,12 @@ int main(void) if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170.0f, 10, 160, 24 }, TextJoin(animNames, animCount, ";"), &animIndex1, dropdownEditMode1)) dropdownEditMode1 = !dropdownEditMode1; + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); + GuiSetStyle(DEFAULT, TEXT_SIZE, GuiGetFont().baseSize*2); + GuiLabel((Rectangle){ 0, GetScreenHeight() - 100.0f, GetScreenWidth(), 40 }, "PRESS SPACE to START BLENDING"); + GuiSetStyle(DEFAULT, TEXT_SIZE, GuiGetFont().baseSize); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); + // Draw playing timeline with keyframes for anim0[] GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 0", TextFormat("FRAME: %.2f / %i", animFrameProgress0, anims[animIndex0].keyframeCount), From f421b74c0f447c641722b8a46a68ce8d8a7f5b13 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Jun 2026 20:42:48 +0200 Subject: [PATCH 21/63] Revert "Enable GPU skinning for GL 3.3+, (#5902)" This reverts commit f1d602029c86bb36e9b0c28adc86d7c1843ff02b. --- src/config.h | 6 +----- src/rmodels.c | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/config.h b/src/config.h index 86239d47d..97f5ba544 100644 --- a/src/config.h +++ b/src/config.h @@ -322,11 +322,7 @@ #endif #ifndef SUPPORT_GPU_SKINNING // GPU skinning disabled by default, some GPUs do not support more than 8 VBOs - #if defined (GRAPHICS_API_OPENGL_33) || defined (GRAPHICS_API_OPENGL_43) - #define SUPPORT_GPU_SKINNING 1 - #else - #define SUPPORT_GPU_SKINNING 0 - #endif + #define SUPPORT_GPU_SKINNING 0 #endif //------------------------------------------------------------------------------------ diff --git a/src/rmodels.c b/src/rmodels.c index e10f888f8..eeebc3d2b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2487,12 +2487,9 @@ static void UpdateModelAnimationVertexBuffers(Model model) float boneWeight = 0.0f; bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated -#if defined (SUPPORT_GPU_SKINNING) - Material material = model.materials[model.meshMaterial[m]]; // Skip if missing bone data or missing anim buffers initialization - if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) && (mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || + if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || (mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue; -#endif for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3) { From 895154bcb2c55540cee9e2aa2de95c0e5ba9b729 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Jun 2026 21:00:17 +0200 Subject: [PATCH 22/63] Clarify that GPU_SKINNING is not enabled by default and the requirements --- examples/models/models_animation_blending.c | 14 +++++++++++--- examples/models/models_animation_gpu_skinning.c | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/examples/models/models_animation_blending.c b/examples/models/models_animation_blending.c index e98547c7e..3fc43711e 100644 --- a/examples/models/models_animation_blending.c +++ b/examples/models/models_animation_blending.c @@ -53,13 +53,19 @@ int main(void) Model model = LoadModel("resources/models/gltf/robot.glb"); // Load character model Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model world position +#if SUPPORT_GPU_SKINNING + // WARNING: SUPPORT_GPU_SKINNING is required to be enabled at raylib compile time (disabled by default) + // It will skip loading CPU required buffers to store animation updated data, so, both modes are exclusive + // Load skinning shader - // WARNING: It requires SUPPORT_GPU_SKINNING enabled on raylib (disabled by default) + // NOTE: It must be a valid shader, following raylib attribs/uniform conventions for GPU skinning Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); - // NOTE: Assign skinning shader to all materials shaders - //for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader; + // Skinning shader could be required to be assigned to all materials shaders, just to make + // sure required uniforms are being updated for the mesh using that material (and shader) + for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader; +#endif // Load model animations int animCount = 0; @@ -275,7 +281,9 @@ int main(void) //-------------------------------------------------------------------------------------- UnloadModelAnimations(anims, animCount); // Unload model animation UnloadModel(model); // Unload model and meshes/material +#if SUPPORT_GPU_SKINNING UnloadShader(skinningShader); // Unload GPU skinning shader +#endif CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/models/models_animation_gpu_skinning.c b/examples/models/models_animation_gpu_skinning.c index b50dd86a3..4349ff0c2 100644 --- a/examples/models/models_animation_gpu_skinning.c +++ b/examples/models/models_animation_gpu_skinning.c @@ -52,12 +52,19 @@ int main(void) Model model = LoadModel("resources/models/gltf/greenman.glb"); // Load character model Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position +#if SUPPORT_GPU_SKINNING + // WARNING: SUPPORT_GPU_SKINNING is required to be enabled at raylib compile time (disabled by default) + // It will skip loading CPU required buffers to store animation updated data, so, both modes are exclusive + // Load skinning shader - // WARNING: GPU skinning must be enabled in raylib with a compilation flag, - // if not enabled, CPU skinning will be used instead + // NOTE: It must be a valid shader, following raylib attribs/uniform conventions for GPU skinning Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION), - TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); - model.materials[1].shader = skinningShader; + TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION)); + + // Skinning shader could be required to be assigned to all materials shaders, just to make + // sure required uniforms are being updated for the mesh using that material (and shader) + model.materials[1].shader = skinningShader; // Just assigning to materials[1] for this model +#endif // Load gltf model animations int animCount = 0; @@ -111,7 +118,9 @@ int main(void) //-------------------------------------------------------------------------------------- UnloadModelAnimations(anims, animCount); // Unload model animation UnloadModel(model); // Unload model and meshes/material +#if SUPPORT_GPU_SKINNING UnloadShader(skinningShader); // Unload GPU skinning shader +#endif CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- From cef7718468dc0c6cdeb1a2d90cbaab5bf0a72220 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 20:16:12 +0200 Subject: [PATCH 23/63] RENAMED: Some Rectangle parameters with more descriptive names --- src/raylib.h | 12 +++---- src/rmodels.c | 30 ++++++++-------- src/rshapes.c | 6 ++-- src/rtext.c | 4 +-- src/rtextures.c | 96 ++++++++++++++++++++++++------------------------- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 286f33c28..866f2473f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1267,7 +1267,7 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI void SetShapesTexture(Texture2D texture, Rectangle rec); // Set texture and rectangle to be used on shapes drawing RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing @@ -1462,9 +1462,9 @@ RLAPI void SetTextureWrap(Texture2D texture, int wrap); RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a texture (or part of it) that stretches or shrinks nicely // Color/pixel related functions RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal @@ -1605,8 +1605,8 @@ RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by rectangle +RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source rectangle with scaling and rotation // Mesh management functions RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids diff --git a/src/rmodels.c b/src/rmodels.c index eeebc3d2b..861680c00 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3983,22 +3983,22 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float // Draw a billboard void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint) { - Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; + Rectangle rec = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - DrawBillboardRec(camera, texture, source, position, (Vector2){ scale*fabsf((float)source.width/source.height), scale }, tint); + DrawBillboardRec(camera, texture, rec, position, (Vector2){ scale*fabsf((float)rec.width/rec.height), scale }, tint); } // Draw a billboard (part of a texture defined by a rectangle) -void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) +void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint) { // NOTE: Billboard locked on axis-Y Vector3 up = { 0.0f, 1.0f, 0.0f }; - DrawBillboardPro(camera, texture, source, position, up, size, Vector2Scale(size, 0.5), 0.0f, tint); + DrawBillboardPro(camera, texture, rec, position, up, size, Vector2Scale(size, 0.5), 0.0f, tint); } -// Draw a billboard with additional parameters -void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) +// Draw a billboard texture defined by source rectangle with scaling and rotation +void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) { // Compute the up vector and the right vector Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); @@ -4009,20 +4009,20 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector // Flip the content of the billboard while maintaining the counterclockwise edge rendering order if (size.x < 0.0f) { - source.x -= size.x; - source.width *= -1.0; + rec.x -= size.x; + rec.width *= -1.0; right = Vector3Negate(right); origin.x *= -1.0f; } if (size.y < 0.0f) { - source.y -= size.y; - source.height *= -1.0; + rec.y -= size.y; + rec.height *= -1.0; up = Vector3Negate(up); origin.y *= -1.0f; } - // Draw the texture region described by source on the following rectangle in 3D space: + // Draw the texture region described by rec on the following rectangle in 3D space: // // size.x <--. // 3 ^---------------------------+ 2 \ rotation @@ -4054,10 +4054,10 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector } Vector2 texcoords[4]; - texcoords[0] = (Vector2){ (float)source.x/texture.width, (float)(source.y + source.height)/texture.height }; - texcoords[1] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height }; - texcoords[2] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)source.y/texture.height }; - texcoords[3] = (Vector2){ (float)source.x/texture.width, (float)source.y/texture.height }; + texcoords[0] = (Vector2){ (float)rec.x/texture.width, (float)(rec.y + rec.height)/texture.height }; + texcoords[1] = (Vector2){ (float)(rec.x + rec.width)/texture.width, (float)(rec.y + rec.height)/texture.height }; + texcoords[2] = (Vector2){ (float)(rec.x + rec.width)/texture.width, (float)rec.y/texture.height }; + texcoords[3] = (Vector2){ (float)rec.x/texture.width, (float)rec.y/texture.height }; rlSetTexture(texture.id); rlBegin(RL_QUADS); diff --git a/src/rshapes.c b/src/rshapes.c index 5ef988e38..38c8a1fbe 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -90,12 +90,12 @@ static float EaseCubicInOut(float t, float b, float c, float d); // Cubic eas // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -void SetShapesTexture(Texture2D texture, Rectangle source) +void SetShapesTexture(Texture2D texture, Rectangle rec) { // Reset texture to default pixel if required // WARNING: Shapes texture should be probably better validated, // it can break the rendering of all shapes if misused - if ((texture.id == 0) || (source.width == 0) || (source.height == 0)) + if ((texture.id == 0) || (rec.width == 0) || (rec.height == 0)) { texShapes = (Texture2D){ 1, 1, 1, 1, 7 }; texShapesRec = (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; @@ -103,7 +103,7 @@ void SetShapesTexture(Texture2D texture, Rectangle source) else { texShapes = texture; - texShapesRec = source; + texShapesRec = rec; } } diff --git a/src/rtext.c b/src/rtext.c index c0434db63..14a3e39c6 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2672,8 +2672,8 @@ static Font LoadBMFont(const char *fileName) for (int i = 1; i < pageCount; i++) { Rectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; - Rectangle destRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; - ImageDraw(&fullFont, imFonts[i], srcRec, destRec, WHITE); + Rectangle dstRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; + ImageDraw(&fullFont, imFonts[i], srcRec, dstRec, WHITE); } } diff --git a/src/rtextures.c b/src/rtextures.c index bedcdb6a4..d2cfb9f78 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4491,25 +4491,25 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) // Draw a texture with extended parameters void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { - Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - Rectangle dest = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; + Rectangle srcrec = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; + Rectangle dstrec = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; Vector2 origin = { 0.0f, 0.0f }; - DrawTexturePro(texture, source, dest, origin, rotation, tint); + DrawTexturePro(texture, srcrec, dstrec, origin, rotation, tint); } // Draw a part of a texture (defined by a rectangle) -void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint) +void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint) { - Rectangle dest = { position.x, position.y, fabsf(source.width), fabsf(source.height) }; + Rectangle dstrec = { position.x, position.y, fabsf(rec.width), fabsf(rec.height) }; Vector2 origin = { 0.0f, 0.0f }; - DrawTexturePro(texture, source, dest, origin, 0.0f, tint); + DrawTexturePro(texture, rec, dstrec, origin, 0.0f, tint); } // Draw a part of a texture (defined by a rectangle) with 'pro' parameters // NOTE: origin is relative to destination rectangle size -void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint) +void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint) { // Check if texture is valid if (texture.id > 0) @@ -4519,11 +4519,11 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 bool flipX = false; - if (source.width < 0) { flipX = true; source.width *= -1; } - if (source.height < 0) source.y -= source.height; + if (srcrec.width < 0) { flipX = true; srcrec.width *= -1; } + if (srcrec.height < 0) srcrec.y -= srcrec.height; - if (dest.width < 0) dest.width *= -1; - if (dest.height < 0) dest.height *= -1; + if (dstrec.width < 0) dstrec.width *= -1; + if (dstrec.height < 0) dstrec.height *= -1; Vector2 topLeft = { 0 }; Vector2 topRight = { 0 }; @@ -4533,33 +4533,33 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 // Only calculate rotation if needed if (rotation == 0.0f) { - float x = dest.x - origin.x; - float y = dest.y - origin.y; + float x = dstrec.x - origin.x; + float y = dstrec.y - origin.y; topLeft = (Vector2){ x, y }; - topRight = (Vector2){ x + dest.width, y }; - bottomLeft = (Vector2){ x, y + dest.height }; - bottomRight = (Vector2){ x + dest.width, y + dest.height }; + topRight = (Vector2){ x + dstrec.width, y }; + bottomLeft = (Vector2){ x, y + dstrec.height }; + bottomRight = (Vector2){ x + dstrec.width, y + dstrec.height }; } else { float sinRotation = sinf(rotation*DEG2RAD); float cosRotation = cosf(rotation*DEG2RAD); - float x = dest.x; - float y = dest.y; + float x = dstrec.x; + float y = dstrec.y; float dx = -origin.x; float dy = -origin.y; topLeft.x = x + dx*cosRotation - dy*sinRotation; topLeft.y = y + dx*sinRotation + dy*cosRotation; - topRight.x = x + (dx + dest.width)*cosRotation - dy*sinRotation; - topRight.y = y + (dx + dest.width)*sinRotation + dy*cosRotation; + topRight.x = x + (dx + dstrec.width)*cosRotation - dy*sinRotation; + topRight.y = y + (dx + dstrec.width)*sinRotation + dy*cosRotation; - bottomLeft.x = x + dx*cosRotation - (dy + dest.height)*sinRotation; - bottomLeft.y = y + dx*sinRotation + (dy + dest.height)*cosRotation; + bottomLeft.x = x + dx*cosRotation - (dy + dstrec.height)*sinRotation; + bottomLeft.y = y + dx*sinRotation + (dy + dstrec.height)*cosRotation; - bottomRight.x = x + (dx + dest.width)*cosRotation - (dy + dest.height)*sinRotation; - bottomRight.y = y + (dx + dest.width)*sinRotation + (dy + dest.height)*cosRotation; + bottomRight.x = x + (dx + dstrec.width)*cosRotation - (dy + dstrec.height)*sinRotation; + bottomRight.y = y + (dx + dstrec.width)*sinRotation + (dy + dstrec.height)*cosRotation; } rlSetTexture(texture.id); @@ -4569,23 +4569,23 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer // Top-left corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height); - else rlTexCoord2f(source.x/width, source.y/height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); + else rlTexCoord2f(srcrec.x/width, srcrec.y/height); rlVertex2f(topLeft.x, topLeft.y); // Bottom-left corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); - else rlTexCoord2f(source.x/width, (source.y + source.height)/height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); rlVertex2f(bottomLeft.x, bottomLeft.y); // Bottom-right corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height); - else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); + if (flipX) rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); rlVertex2f(bottomRight.x, bottomRight.y); // Top-right corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, source.y/height); - else rlTexCoord2f((source.x + source.width)/width, source.y/height); + if (flipX) rlTexCoord2f(srcrec.x/width, srcrec.y/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); rlVertex2f(topRight.x, topRight.y); rlEnd(); @@ -4599,7 +4599,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 /* rlSetTexture(texture.id); rlPushMatrix(); - rlTranslatef(dest.x, dest.y, 0.0f); + rlTranslatef(dstrec.x, dstrec.y, 0.0f); if (rotation != 0.0f) rlRotatef(rotation, 0.0f, 0.0f, 1.0f); rlTranslatef(-origin.x, -origin.y, 0.0f); @@ -4608,24 +4608,24 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer // Bottom-left corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height); - else rlTexCoord2f(source.x/width, source.y/height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); + else rlTexCoord2f(srcrec.x/width, srcrec.y/height); rlVertex2f(0.0f, 0.0f); // Bottom-right corner for texture and quad - if (flipX) rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); - else rlTexCoord2f(source.x/width, (source.y + source.height)/height); - rlVertex2f(0.0f, dest.height); + if (flipX) rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); + rlVertex2f(0.0f, dstrec.height); // Top-right corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height); - else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); - rlVertex2f(dest.width, dest.height); + if (flipX) rlTexCoord2f(srcrec.x/width, (srcrec.y + srcrec.height)/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, (srcrec.y + srcrec.height)/height); + rlVertex2f(dstrec.width, dstrec.height); // Top-left corner for texture and quad - if (flipX) rlTexCoord2f(source.x/width, source.y/height); - else rlTexCoord2f((source.x + source.width)/width, source.y/height); - rlVertex2f(dest.width, 0.0f); + if (flipX) rlTexCoord2f(srcrec.x/width, srcrec.y/height); + else rlTexCoord2f((srcrec.x + srcrec.width)/width, srcrec.y/height); + rlVertex2f(dstrec.width, 0.0f); rlEnd(); rlPopMatrix(); rlSetTexture(0); @@ -4634,15 +4634,15 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 } // Draw a texture (or part of it) that stretches or shrinks nicely using n-patch info -void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) +void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint) { if (texture.id > 0) { float width = (float)texture.width; float height = (float)texture.height; - float patchWidth = ((int)dest.width <= 0)? 0.0f : dest.width; - float patchHeight = ((int)dest.height <= 0)? 0.0f : dest.height; + float patchWidth = ((int)dstrec.width <= 0)? 0.0f : dstrec.width; + float patchHeight = ((int)dstrec.height <= 0)? 0.0f : dstrec.height; if (nPatchInfo.source.width < 0) nPatchInfo.source.x -= nPatchInfo.source.width; if (nPatchInfo.source.height < 0) nPatchInfo.source.y -= nPatchInfo.source.height; @@ -4701,7 +4701,7 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, rlSetTexture(texture.id); rlPushMatrix(); - rlTranslatef(dest.x, dest.y, 0.0f); + rlTranslatef(dstrec.x, dstrec.y, 0.0f); rlRotatef(rotation, 0.0f, 0.0f, 1.0f); rlTranslatef(-origin.x, -origin.y, 0.0f); From e8650c1b8e49783bcbd407603f68bc15d86b6796 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:16:31 +0000 Subject: [PATCH 24/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 20 ++++++++++---------- tools/rlparser/output/raylib_api.lua | 20 ++++++++++---------- tools/rlparser/output/raylib_api.txt | 20 ++++++++++---------- tools/rlparser/output/raylib_api.xml | 20 ++++++++++---------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index b42fd2d61..915d5c665 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -5489,7 +5489,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" } ] }, @@ -8913,7 +8913,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" }, { "type": "Vector2", @@ -8927,7 +8927,7 @@ }, { "name": "DrawTexturePro", - "description": "Draw a part of a texture defined by a rectangle with 'pro' parameters", + "description": "Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation", "returnType": "void", "params": [ { @@ -8936,11 +8936,11 @@ }, { "type": "Rectangle", - "name": "source" + "name": "srcrec" }, { "type": "Rectangle", - "name": "dest" + "name": "dstrec" }, { "type": "Vector2", @@ -8971,7 +8971,7 @@ }, { "type": "Rectangle", - "name": "dest" + "name": "dstrec" }, { "type": "Vector2", @@ -10983,7 +10983,7 @@ }, { "name": "DrawBillboardRec", - "description": "Draw a billboard texture defined by source", + "description": "Draw a billboard texture defined by rectangle", "returnType": "void", "params": [ { @@ -10996,7 +10996,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" }, { "type": "Vector3", @@ -11014,7 +11014,7 @@ }, { "name": "DrawBillboardPro", - "description": "Draw a billboard texture defined by source and rotation", + "description": "Draw a billboard texture defined by source rectangle with scaling and rotation", "returnType": "void", "params": [ { @@ -11027,7 +11027,7 @@ }, { "type": "Rectangle", - "name": "source" + "name": "rec" }, { "type": "Vector3", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 859ef38ba..d784cb768 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4752,7 +4752,7 @@ return { returnType = "void", params = { {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"} + {type = "Rectangle", name = "rec"} } }, { @@ -6475,19 +6475,19 @@ return { returnType = "void", params = { {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, + {type = "Rectangle", name = "rec"}, {type = "Vector2", name = "position"}, {type = "Color", name = "tint"} } }, { name = "DrawTexturePro", - description = "Draw a part of a texture defined by a rectangle with 'pro' parameters", + description = "Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation", returnType = "void", params = { {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, - {type = "Rectangle", name = "dest"}, + {type = "Rectangle", name = "srcrec"}, + {type = "Rectangle", name = "dstrec"}, {type = "Vector2", name = "origin"}, {type = "float", name = "rotation"}, {type = "Color", name = "tint"} @@ -6500,7 +6500,7 @@ return { params = { {type = "Texture2D", name = "texture"}, {type = "NPatchInfo", name = "nPatchInfo"}, - {type = "Rectangle", name = "dest"}, + {type = "Rectangle", name = "dstrec"}, {type = "Vector2", name = "origin"}, {type = "float", name = "rotation"}, {type = "Color", name = "tint"} @@ -7572,12 +7572,12 @@ return { }, { name = "DrawBillboardRec", - description = "Draw a billboard texture defined by source", + description = "Draw a billboard texture defined by rectangle", returnType = "void", params = { {type = "Camera", name = "camera"}, {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, + {type = "Rectangle", name = "rec"}, {type = "Vector3", name = "position"}, {type = "Vector2", name = "size"}, {type = "Color", name = "tint"} @@ -7585,12 +7585,12 @@ return { }, { name = "DrawBillboardPro", - description = "Draw a billboard texture defined by source and rotation", + description = "Draw a billboard texture defined by source rectangle with scaling and rotation", returnType = "void", params = { {type = "Camera", name = "camera"}, {type = "Texture2D", name = "texture"}, - {type = "Rectangle", name = "source"}, + {type = "Rectangle", name = "rec"}, {type = "Vector3", name = "position"}, {type = "Vector3", name = "up"}, {type = "Vector2", name = "size"}, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 0051c6a14..11f23d80a 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -2182,7 +2182,7 @@ Function 219: SetShapesTexture() (2 input parameters) Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) - Param[2]: source (type: Rectangle) + Param[2]: rec (type: Rectangle) Function 220: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D @@ -3416,16 +3416,16 @@ Function 385: DrawTextureRec() (4 input parameters) Return type: void Description: Draw a part of a texture defined by a rectangle Param[1]: texture (type: Texture2D) - Param[2]: source (type: Rectangle) + Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) Function 386: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void - Description: Draw a part of a texture defined by a rectangle with 'pro' parameters + Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation Param[1]: texture (type: Texture2D) - Param[2]: source (type: Rectangle) - Param[3]: dest (type: Rectangle) + Param[2]: srcrec (type: Rectangle) + Param[3]: dstrec (type: Rectangle) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) @@ -3435,7 +3435,7 @@ Function 387: DrawTextureNPatch() (6 input parameters) Description: Draw a texture (or part of it) that stretches or shrinks nicely Param[1]: texture (type: Texture2D) Param[2]: nPatchInfo (type: NPatchInfo) - Param[3]: dest (type: Rectangle) + Param[3]: dstrec (type: Rectangle) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) @@ -4185,20 +4185,20 @@ Function 495: DrawBillboard() (5 input parameters) Function 496: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void - Description: Draw a billboard texture defined by source + Description: Draw a billboard texture defined by rectangle Param[1]: camera (type: Camera) Param[2]: texture (type: Texture2D) - Param[3]: source (type: Rectangle) + Param[3]: rec (type: Rectangle) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) Function 497: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void - Description: Draw a billboard texture defined by source and rotation + Description: Draw a billboard texture defined by source rectangle with scaling and rotation Param[1]: camera (type: Camera) Param[2]: texture (type: Texture2D) - Param[3]: source (type: Rectangle) + Param[3]: rec (type: Rectangle) Param[4]: position (type: Vector3) Param[5]: up (type: Vector3) Param[6]: size (type: Vector2) diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index fdc1481ec..11ba9fccb 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1352,7 +1352,7 @@ - + @@ -2251,14 +2251,14 @@ - + - + - - + + @@ -2266,7 +2266,7 @@ - + @@ -2797,18 +2797,18 @@ - + - + - + - + From ee71f0f870a1c19d1bb7e476e1d819acac99ab5b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:00:34 +0200 Subject: [PATCH 25/63] REVIEWED: `GetPixelColor()` const --- src/raylib.h | 2 +- src/rtextures.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 866f2473f..8e4d830c8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1481,7 +1481,7 @@ RLAPI Color ColorAlpha(Color color, float alpha); // G RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint RLAPI Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f] RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value -RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format +RLAPI Color GetPixelColor(const void *srcPtr, int format); // Get Color from a source pixel pointer of certain format RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format diff --git a/src/rtextures.c b/src/rtextures.c index d2cfb9f78..1ab5cb3d9 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -5180,7 +5180,7 @@ Color GetColor(unsigned int hexValue) } // Get color from a pixel from certain format -Color GetPixelColor(void *srcPtr, int format) +Color GetPixelColor(const void *srcPtr, int format) { Color color = { 0 }; From 2c690425c9801e70d0d7bdba4ebff732d6a949eb Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:02:59 +0200 Subject: [PATCH 26/63] Reviewed comments, remove article usage --- src/platforms/rcore_memory.c | 4 +-- src/raudio.c | 6 ++-- src/raylib.h | 54 ++++++++++++++++++------------------ src/rcore.c | 36 ++++++++++++------------ src/rgestures.h | 4 +-- src/rmodels.c | 4 +-- src/rtext.c | 4 +-- src/rtextures.c | 6 ++-- 8 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/platforms/rcore_memory.c b/src/platforms/rcore_memory.c index 155073ad1..e7934bd96 100644 --- a/src/platforms/rcore_memory.c +++ b/src/platforms/rcore_memory.c @@ -91,7 +91,7 @@ bool InitGraphicsDevice(void); // Initialize graphics device // Module Internal Functions Declaration //---------------------------------------------------------------------------------- #if !defined(_WIN32) -static int kbhit(void); // Check if a key has been pressed +static int kbhit(void); // Check if key has been pressed static char getch(void) { return getchar(); } // Get pressed character #endif @@ -562,7 +562,7 @@ void ClosePlatform(void) // Module Internal Functions Definition //---------------------------------------------------------------------------------- #if !defined(_WIN32) -// Check if a key has been pressed +// Check if key has been pressed static int kbhit(void) { struct termios oldt = { 0 }; diff --git a/src/raudio.c b/src/raudio.c index ff90d8e43..3ae2fba0f 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1013,7 +1013,7 @@ Sound LoadSoundAlias(Sound source) return sound; } -// Check if a sound is valid (data loaded and buffers initialized) +// Check if sound is valid (data loaded and buffers initialized) bool IsSoundValid(Sound sound) { bool result = false; @@ -1215,7 +1215,7 @@ void StopSound(Sound sound) StopAudioBuffer(sound.stream.buffer); } -// Check if a sound is playing +// Check if sound is playing bool IsSoundPlaying(Sound sound) { bool result = false; @@ -1751,7 +1751,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, return music; } -// Check if a music stream is valid (context and buffers initialized) +// Check if music stream is valid (context and buffers initialized) bool IsMusicValid(Music music) { return ((music.ctxData != NULL) && // Validate context loaded diff --git a/src/raylib.h b/src/raylib.h index 8e4d830c8..cb02d533b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1070,7 +1070,7 @@ RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR s // NOTE: Shader functionality is not available on OpenGL 1.1 RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU) +RLAPI bool IsShaderValid(Shader shader); // Check if shader is valid (loaded on GPU) RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value @@ -1148,7 +1148,7 @@ RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file RLAPI bool FileExists(const char *fileName); // Check if file exists -RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists +RLAPI bool DirectoryExists(const char *dirPath); // Check if directory path exists RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (recommended include point: .png, .wav) RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) @@ -1161,12 +1161,12 @@ RLAPI const char *GetWorkingDirectory(void); // Get curre RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success RLAPI bool ChangeDirectory(const char *dirPath); // 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 IsPathFile(const char *path); // Check if 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, files and directories, no subdirs scan RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths -RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window +RLAPI bool IsFileDropped(void); // Check if file has been dropped into window RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths RLAPI unsigned int GetDirectoryFileCount(const char *dirPath); // Get the file count in a directory @@ -1197,23 +1197,23 @@ RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a reco //------------------------------------------------------------------------------------ // Input-related functions: keyboard -RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again -RLAPI bool IsKeyDown(int key); // Check if a key is being pressed -RLAPI bool IsKeyReleased(int key); // Check if a key has been released once -RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed +RLAPI bool IsKeyPressed(int key); // Check if key has been pressed once +RLAPI bool IsKeyPressedRepeat(int key); // Check if key has been pressed again +RLAPI bool IsKeyDown(int key); // Check if key is being pressed +RLAPI bool IsKeyReleased(int key); // Check if key has been released once +RLAPI bool IsKeyUp(int key); // Check if key is NOT being pressed RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI bool IsGamepadAvailable(int gamepad); // Check if gamepad is available RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if gamepad button is NOT being pressed RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed RLAPI int GetGamepadAxisCount(int gamepad); // Get axis count for a gamepad RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get movement value for a gamepad axis @@ -1221,10 +1221,10 @@ RLAPI int SetGamepadMappings(const char *mappings); // Set internal ga RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse -RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once -RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed -RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once -RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed +RLAPI bool IsMouseButtonPressed(int button); // Check if mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Check if mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Check if mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Check if mouse button is NOT being pressed RLAPI int GetMouseX(void); // Get mouse position X RLAPI int GetMouseY(void); // Get mouse position Y RLAPI Vector2 GetMousePosition(void); // Get mouse position XY @@ -1247,7 +1247,7 @@ RLAPI int GetTouchPointCount(void); // Get number of t // Gestures and Touch Handling Functions (Module: rgestures) //------------------------------------------------------------------------------------ RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture has been detected +RLAPI bool IsGestureDetected(unsigned int gesture); // Check if gesture has been detected RLAPI int GetGestureDetected(void); // Get latest detected gesture RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector @@ -1446,9 +1446,9 @@ RLAPI Texture2D LoadTexture(const char *fileName); RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -RLAPI bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU) +RLAPI bool IsTextureValid(Texture2D texture); // Check if texture is valid (loaded in GPU) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) +RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if render texture is valid (loaded in GPU) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data (pixels should be able to fill texture) RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data (pixels and rec should fit in texture) @@ -1495,7 +1495,7 @@ RLAPI Font LoadFont(const char *fileName); RLAPI Font LoadFontEx(const char *fileName, int fontSize, const 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, font size is provided in pixels height 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, const int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) +RLAPI bool IsFontValid(Font font); // Check if font is valid (font data loaded, WARNING: GPU texture not checked) RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount, int type, int *glyphCount); // Load font data for further use RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) @@ -1594,7 +1594,7 @@ RLAPI void DrawGrid(int slices, float spacing); // Model management functions RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs) +RLAPI bool IsModelValid(Model model); // Check if model is valid (loaded in GPU, VAO/VBOs) RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) @@ -1635,7 +1635,7 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Material loading/unloading functions RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU) +RLAPI bool IsMaterialValid(Material material); // Check if material is valid (shader assigned, map textures loaded in GPU) RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh @@ -1676,7 +1676,7 @@ RLAPI bool IsWaveValid(Wave wave); // Check i RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data RLAPI Sound LoadSoundAlias(Sound source); // Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data -RLAPI bool IsSoundValid(Sound sound); // Check if a sound is valid (data loaded and buffers initialized) +RLAPI bool IsSoundValid(Sound sound); // Check if sound is valid (data loaded and buffers initialized) RLAPI void UpdateSound(Sound sound, const void *data, int frameCount); // Update sound buffer with new data (default data format: 32 bit float, stereo) RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound @@ -1689,7 +1689,7 @@ RLAPI void PlaySound(Sound sound); // Play a RLAPI void StopSound(Sound sound); // Stop playing a sound RLAPI void PauseSound(Sound sound); // Pause a sound RLAPI void ResumeSound(Sound sound); // Resume a paused sound -RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +RLAPI bool IsSoundPlaying(Sound sound); // Check if sound is currently playing RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) @@ -1702,7 +1702,7 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data -RLAPI bool IsMusicValid(Music music); // Check if a music stream is valid (context and buffers initialized) +RLAPI bool IsMusicValid(Music music); // Check if music stream is valid (context and buffers initialized) RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing diff --git a/src/rcore.c b/src/rcore.c index 9f93ecbbc..d31ae25b8 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1293,7 +1293,7 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode) return shader; } -// Check if a shader is valid (loaded on GPU) +// Check if shader is valid (loaded on GPU) bool IsShaderValid(Shader shader) { return ((shader.id > 0) && // Validate shader id (GPU loaded successfully) @@ -2396,7 +2396,7 @@ bool IsFileExtension(const char *fileName, const char *ext) return result; } -// Check if a directory path exists +// Check if directory path exists bool DirectoryExists(const char *dirPath) { bool result = false; @@ -2811,7 +2811,7 @@ bool ChangeDirectory(const char *dirPath) return (result == 0); } -// Check if a given path point to a file +// Check if given path point to a file bool IsPathFile(const char *path) { struct stat result = { 0 }; @@ -2876,7 +2876,7 @@ bool IsFileNameValid(const char *fileName) return valid; } -// Check if a file has been dropped into window +// Check if file has been dropped into window bool IsFileDropped(void) { bool result = false; @@ -3787,7 +3787,7 @@ void PlayAutomationEvent(AutomationEvent event) // Module Functions Definition: Input Handling: Keyboard //---------------------------------------------------------------------------------- -// Check if a key has been pressed once +// Check if key has been pressed once bool IsKeyPressed(int key) { bool pressed = false; @@ -3800,7 +3800,7 @@ bool IsKeyPressed(int key) return pressed; } -// Check if a key has been pressed again +// Check if key has been pressed again bool IsKeyPressedRepeat(int key) { bool repeat = false; @@ -3813,7 +3813,7 @@ bool IsKeyPressedRepeat(int key) return repeat; } -// Check if a key is being pressed (key held down) +// Check if key is being pressed (key held down) bool IsKeyDown(int key) { bool down = false; @@ -3826,7 +3826,7 @@ bool IsKeyDown(int key) return down; } -// Check if a key has been released once +// Check if key has been released once bool IsKeyReleased(int key) { bool released = false; @@ -3839,7 +3839,7 @@ bool IsKeyReleased(int key) return released; } -// Check if a key is NOT being pressed (key not held down) +// Check if key is NOT being pressed (key not held down) bool IsKeyUp(int key) { bool up = false; @@ -3910,7 +3910,7 @@ void SetExitKey(int key) // NOTE: Functions with a platform-specific implementation on rcore_.c //int SetGamepadMappings(const char *mappings) -// Check if a gamepad is available +// Check if gamepad is available bool IsGamepadAvailable(int gamepad) { bool result = false; @@ -3926,7 +3926,7 @@ const char *GetGamepadName(int gamepad) return CORE.Input.Gamepad.name[gamepad]; } -// Check if a gamepad button has been pressed once +// Check if gamepad button has been pressed once bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; @@ -3939,7 +3939,7 @@ bool IsGamepadButtonPressed(int gamepad, int button) return pressed; } -// Check if a gamepad button is being pressed +// Check if gamepad button is being pressed bool IsGamepadButtonDown(int gamepad, int button) { bool down = false; @@ -3952,7 +3952,7 @@ bool IsGamepadButtonDown(int gamepad, int button) return down; } -// Check if a gamepad button has NOT been pressed once +// Check if gamepad button has NOT been pressed once bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; @@ -3965,7 +3965,7 @@ bool IsGamepadButtonReleased(int gamepad, int button) return released; } -// Check if a gamepad button is NOT being pressed +// Check if gamepad button is NOT being pressed bool IsGamepadButtonUp(int gamepad, int button) { bool up = false; @@ -4014,7 +4014,7 @@ float GetGamepadAxisMovement(int gamepad, int axis) //void SetMousePosition(int x, int y) //void SetMouseCursor(int cursor) -// Check if a mouse button has been pressed once +// Check if mouse button has been pressed once bool IsMouseButtonPressed(int button) { bool pressed = false; @@ -4030,7 +4030,7 @@ bool IsMouseButtonPressed(int button) return pressed; } -// Check if a mouse button is being pressed +// Check if mouse button is being pressed bool IsMouseButtonDown(int button) { bool down = false; @@ -4046,7 +4046,7 @@ bool IsMouseButtonDown(int button) return down; } -// Check if a mouse button has been released once +// Check if mouse button has been released once bool IsMouseButtonReleased(int button) { bool released = false; @@ -4062,7 +4062,7 @@ bool IsMouseButtonReleased(int button) return released; } -// Check if a mouse button is NOT being pressed +// Check if mouse button is NOT being pressed bool IsMouseButtonUp(int button) { bool up = false; diff --git a/src/rgestures.h b/src/rgestures.h index 248e1f71a..eeeb6b010 100644 --- a/src/rgestures.h +++ b/src/rgestures.h @@ -127,7 +127,7 @@ void UpdateGestures(void); // Update gestures detec #if defined(RGESTURES_STANDALONE) void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -bool IsGestureDetected(int gesture); // Check if a gesture has been detected +bool IsGestureDetected(int gesture); // Check if gesture has been detected int GetGestureDetected(void); // Get latest detected gesture float GetGestureHoldDuration(void); // Get gesture hold time in seconds @@ -257,7 +257,7 @@ void SetGesturesEnabled(unsigned int flags) GESTURES.enabledFlags = flags; } -// Check if a gesture have been detected +// Check if gesture have been detected bool IsGestureDetected(unsigned int gesture) { if ((GESTURES.enabledFlags & GESTURES.current) == gesture) return true; diff --git a/src/rmodels.c b/src/rmodels.c index 861680c00..32ade139f 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1167,7 +1167,7 @@ Model LoadModelFromMesh(Mesh mesh) return model; } -// Check if a model is valid (loaded in GPU, VAO/VBOs) +// Check if model is valid (loaded in GPU, VAO/VBOs) bool IsModelValid(Model model) { bool result = false; @@ -2228,7 +2228,7 @@ Material LoadMaterialDefault(void) return material; } -// Check if a material is valid (map textures loaded in GPU) +// Check if material is valid (map textures loaded in GPU) bool IsMaterialValid(Material material) { bool result = false; diff --git a/src/rtext.c b/src/rtext.c index 14a3e39c6..f1de75421 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -593,7 +593,7 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int return font; } -// Check if a font is valid (font data loaded) +// Check if font is valid (font data loaded) // WARNING: GPU texture not checked bool IsFontValid(Font font) { @@ -683,7 +683,7 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz // stbtt_GetCodepointBitmapBox() -- how big the bitmap must be // stbtt_MakeCodepointBitmap() -- renders into a provided bitmap - // Check if a glyph is available in the font + // Check if glyph is available in the font // WARNING: if (index == 0), glyph not found, it could fallback to default .notdef glyph (if defined in font) int index = stbtt_FindGlyphIndex(&fontInfo, cp); diff --git a/src/rtextures.c b/src/rtextures.c index 1ab5cb3d9..9a359f0f2 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -1744,7 +1744,7 @@ void ImageResize(Image *image, int newWidth, int newHeight) // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; - // Check if a fast path can be used on image scaling + // Check if fast path can be used on image scaling // It can be for 8 bit per channel images with 1 to 4 channels per pixel if ((image->format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) || (image->format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) || @@ -4295,7 +4295,7 @@ RenderTexture2D LoadRenderTexture(int width, int height) return target; } -// Check if a texture is valid (loaded in GPU) +// Check if texture is valid (loaded in GPU) bool IsTextureValid(Texture2D texture) { bool result = false; @@ -4320,7 +4320,7 @@ void UnloadTexture(Texture2D texture) } } -// Check if a render texture is valid (loaded in GPU) +// Check if render texture is valid (loaded in GPU) bool IsRenderTextureValid(RenderTexture2D target) { bool result = false; From fc824ff6d44696a36912e0820746c6977cd969be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:03:21 +0000 Subject: [PATCH 27/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 56 +++++++++++++-------------- tools/rlparser/output/raylib_api.lua | 56 +++++++++++++-------------- tools/rlparser/output/raylib_api.txt | 56 +++++++++++++-------------- tools/rlparser/output/raylib_api.xml | 56 +++++++++++++-------------- 4 files changed, 112 insertions(+), 112 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 915d5c665..1c882cd88 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -3800,7 +3800,7 @@ }, { "name": "IsShaderValid", - "description": "Check if a shader is valid (loaded on GPU)", + "description": "Check if shader is valid (loaded on GPU)", "returnType": "bool", "params": [ { @@ -4528,7 +4528,7 @@ }, { "name": "DirectoryExists", - "description": "Check if a directory path exists", + "description": "Check if directory path exists", "returnType": "bool", "params": [ { @@ -4663,7 +4663,7 @@ }, { "name": "IsPathFile", - "description": "Check if a given path is a file or a directory", + "description": "Check if given path is a file or a directory", "returnType": "bool", "params": [ { @@ -4726,7 +4726,7 @@ }, { "name": "IsFileDropped", - "description": "Check if a file has been dropped into window", + "description": "Check if file has been dropped into window", "returnType": "bool" }, { @@ -4989,7 +4989,7 @@ }, { "name": "IsKeyPressed", - "description": "Check if a key has been pressed once", + "description": "Check if key has been pressed once", "returnType": "bool", "params": [ { @@ -5000,7 +5000,7 @@ }, { "name": "IsKeyPressedRepeat", - "description": "Check if a key has been pressed again", + "description": "Check if key has been pressed again", "returnType": "bool", "params": [ { @@ -5011,7 +5011,7 @@ }, { "name": "IsKeyDown", - "description": "Check if a key is being pressed", + "description": "Check if key is being pressed", "returnType": "bool", "params": [ { @@ -5022,7 +5022,7 @@ }, { "name": "IsKeyReleased", - "description": "Check if a key has been released once", + "description": "Check if key has been released once", "returnType": "bool", "params": [ { @@ -5033,7 +5033,7 @@ }, { "name": "IsKeyUp", - "description": "Check if a key is NOT being pressed", + "description": "Check if key is NOT being pressed", "returnType": "bool", "params": [ { @@ -5076,7 +5076,7 @@ }, { "name": "IsGamepadAvailable", - "description": "Check if a gamepad is available", + "description": "Check if gamepad is available", "returnType": "bool", "params": [ { @@ -5098,7 +5098,7 @@ }, { "name": "IsGamepadButtonPressed", - "description": "Check if a gamepad button has been pressed once", + "description": "Check if gamepad button has been pressed once", "returnType": "bool", "params": [ { @@ -5113,7 +5113,7 @@ }, { "name": "IsGamepadButtonDown", - "description": "Check if a gamepad button is being pressed", + "description": "Check if gamepad button is being pressed", "returnType": "bool", "params": [ { @@ -5128,7 +5128,7 @@ }, { "name": "IsGamepadButtonReleased", - "description": "Check if a gamepad button has been released once", + "description": "Check if gamepad button has been released once", "returnType": "bool", "params": [ { @@ -5143,7 +5143,7 @@ }, { "name": "IsGamepadButtonUp", - "description": "Check if a gamepad button is NOT being pressed", + "description": "Check if gamepad button is NOT being pressed", "returnType": "bool", "params": [ { @@ -5223,7 +5223,7 @@ }, { "name": "IsMouseButtonPressed", - "description": "Check if a mouse button has been pressed once", + "description": "Check if mouse button has been pressed once", "returnType": "bool", "params": [ { @@ -5234,7 +5234,7 @@ }, { "name": "IsMouseButtonDown", - "description": "Check if a mouse button is being pressed", + "description": "Check if mouse button is being pressed", "returnType": "bool", "params": [ { @@ -5245,7 +5245,7 @@ }, { "name": "IsMouseButtonReleased", - "description": "Check if a mouse button has been released once", + "description": "Check if mouse button has been released once", "returnType": "bool", "params": [ { @@ -5256,7 +5256,7 @@ }, { "name": "IsMouseButtonUp", - "description": "Check if a mouse button is NOT being pressed", + "description": "Check if mouse button is NOT being pressed", "returnType": "bool", "params": [ { @@ -5401,7 +5401,7 @@ }, { "name": "IsGestureDetected", - "description": "Check if a gesture has been detected", + "description": "Check if gesture has been detected", "returnType": "bool", "params": [ { @@ -8716,7 +8716,7 @@ }, { "name": "IsTextureValid", - "description": "Check if a texture is valid (loaded in GPU)", + "description": "Check if texture is valid (loaded in GPU)", "returnType": "bool", "params": [ { @@ -8738,7 +8738,7 @@ }, { "name": "IsRenderTextureValid", - "description": "Check if a render texture is valid (loaded in GPU)", + "description": "Check if render texture is valid (loaded in GPU)", "returnType": "bool", "params": [ { @@ -9195,7 +9195,7 @@ "returnType": "Color", "params": [ { - "type": "void *", + "type": "const void *", "name": "srcPtr" }, { @@ -9333,7 +9333,7 @@ }, { "name": "IsFontValid", - "description": "Check if a font is valid (font data loaded, WARNING: GPU texture not checked)", + "description": "Check if font is valid (font data loaded, WARNING: GPU texture not checked)", "returnType": "bool", "params": [ { @@ -10800,7 +10800,7 @@ }, { "name": "IsModelValid", - "description": "Check if a model is valid (loaded in GPU, VAO/VBOs)", + "description": "Check if model is valid (loaded in GPU, VAO/VBOs)", "returnType": "bool", "params": [ { @@ -11433,7 +11433,7 @@ }, { "name": "IsMaterialValid", - "description": "Check if a material is valid (shader assigned, map textures loaded in GPU)", + "description": "Check if material is valid (shader assigned, map textures loaded in GPU)", "returnType": "bool", "params": [ { @@ -11853,7 +11853,7 @@ }, { "name": "IsSoundValid", - "description": "Check if a sound is valid (data loaded and buffers initialized)", + "description": "Check if sound is valid (data loaded and buffers initialized)", "returnType": "bool", "params": [ { @@ -11990,7 +11990,7 @@ }, { "name": "IsSoundPlaying", - "description": "Check if a sound is currently playing", + "description": "Check if sound is currently playing", "returnType": "bool", "params": [ { @@ -12151,7 +12151,7 @@ }, { "name": "IsMusicValid", - "description": "Check if a music stream is valid (context and buffers initialized)", + "description": "Check if music stream is valid (context and buffers initialized)", "returnType": "bool", "params": [ { diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index d784cb768..d5024fd45 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -3626,7 +3626,7 @@ return { }, { name = "IsShaderValid", - description = "Check if a shader is valid (loaded on GPU)", + description = "Check if shader is valid (loaded on GPU)", returnType = "bool", params = { {type = "Shader", name = "shader"} @@ -4084,7 +4084,7 @@ return { }, { name = "DirectoryExists", - description = "Check if a directory path exists", + description = "Check if directory path exists", returnType = "bool", params = { {type = "const char *", name = "dirPath"} @@ -4183,7 +4183,7 @@ return { }, { name = "IsPathFile", - description = "Check if a given path is a file or a directory", + description = "Check if given path is a file or a directory", returnType = "bool", params = { {type = "const char *", name = "path"} @@ -4225,7 +4225,7 @@ return { }, { name = "IsFileDropped", - description = "Check if a file has been dropped into window", + description = "Check if file has been dropped into window", returnType = "bool" }, { @@ -4395,7 +4395,7 @@ return { }, { name = "IsKeyPressed", - description = "Check if a key has been pressed once", + description = "Check if key has been pressed once", returnType = "bool", params = { {type = "int", name = "key"} @@ -4403,7 +4403,7 @@ return { }, { name = "IsKeyPressedRepeat", - description = "Check if a key has been pressed again", + description = "Check if key has been pressed again", returnType = "bool", params = { {type = "int", name = "key"} @@ -4411,7 +4411,7 @@ return { }, { name = "IsKeyDown", - description = "Check if a key is being pressed", + description = "Check if key is being pressed", returnType = "bool", params = { {type = "int", name = "key"} @@ -4419,7 +4419,7 @@ return { }, { name = "IsKeyReleased", - description = "Check if a key has been released once", + description = "Check if key has been released once", returnType = "bool", params = { {type = "int", name = "key"} @@ -4427,7 +4427,7 @@ return { }, { name = "IsKeyUp", - description = "Check if a key is NOT being pressed", + description = "Check if key is NOT being pressed", returnType = "bool", params = { {type = "int", name = "key"} @@ -4461,7 +4461,7 @@ return { }, { name = "IsGamepadAvailable", - description = "Check if a gamepad is available", + description = "Check if gamepad is available", returnType = "bool", params = { {type = "int", name = "gamepad"} @@ -4477,7 +4477,7 @@ return { }, { name = "IsGamepadButtonPressed", - description = "Check if a gamepad button has been pressed once", + description = "Check if gamepad button has been pressed once", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4486,7 +4486,7 @@ return { }, { name = "IsGamepadButtonDown", - description = "Check if a gamepad button is being pressed", + description = "Check if gamepad button is being pressed", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4495,7 +4495,7 @@ return { }, { name = "IsGamepadButtonReleased", - description = "Check if a gamepad button has been released once", + description = "Check if gamepad button has been released once", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4504,7 +4504,7 @@ return { }, { name = "IsGamepadButtonUp", - description = "Check if a gamepad button is NOT being pressed", + description = "Check if gamepad button is NOT being pressed", returnType = "bool", params = { {type = "int", name = "gamepad"}, @@ -4554,7 +4554,7 @@ return { }, { name = "IsMouseButtonPressed", - description = "Check if a mouse button has been pressed once", + description = "Check if mouse button has been pressed once", returnType = "bool", params = { {type = "int", name = "button"} @@ -4562,7 +4562,7 @@ return { }, { name = "IsMouseButtonDown", - description = "Check if a mouse button is being pressed", + description = "Check if mouse button is being pressed", returnType = "bool", params = { {type = "int", name = "button"} @@ -4570,7 +4570,7 @@ return { }, { name = "IsMouseButtonReleased", - description = "Check if a mouse button has been released once", + description = "Check if mouse button has been released once", returnType = "bool", params = { {type = "int", name = "button"} @@ -4578,7 +4578,7 @@ return { }, { name = "IsMouseButtonUp", - description = "Check if a mouse button is NOT being pressed", + description = "Check if mouse button is NOT being pressed", returnType = "bool", params = { {type = "int", name = "button"} @@ -4690,7 +4690,7 @@ return { }, { name = "IsGestureDetected", - description = "Check if a gesture has been detected", + description = "Check if gesture has been detected", returnType = "bool", params = { {type = "unsigned int", name = "gesture"} @@ -6361,7 +6361,7 @@ return { }, { name = "IsTextureValid", - description = "Check if a texture is valid (loaded in GPU)", + description = "Check if texture is valid (loaded in GPU)", returnType = "bool", params = { {type = "Texture2D", name = "texture"} @@ -6377,7 +6377,7 @@ return { }, { name = "IsRenderTextureValid", - description = "Check if a render texture is valid (loaded in GPU)", + description = "Check if render texture is valid (loaded in GPU)", returnType = "bool", params = { {type = "RenderTexture2D", name = "target"} @@ -6635,7 +6635,7 @@ return { description = "Get Color from a source pixel pointer of certain format", returnType = "Color", params = { - {type = "void *", name = "srcPtr"}, + {type = "const void *", name = "srcPtr"}, {type = "int", name = "format"} } }, @@ -6708,7 +6708,7 @@ return { }, { name = "IsFontValid", - description = "Check if a font is valid (font data loaded, WARNING: GPU texture not checked)", + description = "Check if font is valid (font data loaded, WARNING: GPU texture not checked)", returnType = "bool", params = { {type = "Font", name = "font"} @@ -7479,7 +7479,7 @@ return { }, { name = "IsModelValid", - description = "Check if a model is valid (loaded in GPU, VAO/VBOs)", + description = "Check if model is valid (loaded in GPU, VAO/VBOs)", returnType = "bool", params = { {type = "Model", name = "model"} @@ -7809,7 +7809,7 @@ return { }, { name = "IsMaterialValid", - description = "Check if a material is valid (shader assigned, map textures loaded in GPU)", + description = "Check if material is valid (shader assigned, map textures loaded in GPU)", returnType = "bool", params = { {type = "Material", name = "material"} @@ -8055,7 +8055,7 @@ return { }, { name = "IsSoundValid", - description = "Check if a sound is valid (data loaded and buffers initialized)", + description = "Check if sound is valid (data loaded and buffers initialized)", returnType = "bool", params = { {type = "Sound", name = "sound"} @@ -8147,7 +8147,7 @@ return { }, { name = "IsSoundPlaying", - description = "Check if a sound is currently playing", + description = "Check if sound is currently playing", returnType = "bool", params = { {type = "Sound", name = "sound"} @@ -8245,7 +8245,7 @@ return { }, { name = "IsMusicValid", - description = "Check if a music stream is valid (context and buffers initialized)", + description = "Check if music stream is valid (context and buffers initialized)", returnType = "bool", params = { {type = "Music", name = "music"} diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 11f23d80a..e322d5fe7 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1397,7 +1397,7 @@ Function 076: LoadShaderFromMemory() (2 input parameters) Function 077: IsShaderValid() (1 input parameters) Name: IsShaderValid Return type: bool - Description: Check if a shader is valid (loaded on GPU) + Description: Check if shader is valid (loaded on GPU) Param[1]: shader (type: Shader) Function 078: GetShaderLocation() (2 input parameters) Name: GetShaderLocation @@ -1708,7 +1708,7 @@ Function 130: FileExists() (1 input parameters) Function 131: DirectoryExists() (1 input parameters) Name: DirectoryExists Return type: bool - Description: Check if a directory path exists + Description: Check if directory path exists Param[1]: dirPath (type: const char *) Function 132: IsFileExtension() (2 input parameters) Name: IsFileExtension @@ -1774,7 +1774,7 @@ Function 143: ChangeDirectory() (1 input parameters) Function 144: IsPathFile() (1 input parameters) Name: IsPathFile Return type: bool - Description: Check if a given path is a file or a directory + Description: Check if given path is a file or a directory Param[1]: path (type: const char *) Function 145: IsFileNameValid() (1 input parameters) Name: IsFileNameValid @@ -1801,7 +1801,7 @@ Function 148: UnloadDirectoryFiles() (1 input parameters) Function 149: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool - Description: Check if a file has been dropped into window + Description: Check if file has been dropped into window No input parameters Function 150: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles @@ -1920,27 +1920,27 @@ Function 169: PlayAutomationEvent() (1 input parameters) Function 170: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool - Description: Check if a key has been pressed once + Description: Check if key has been pressed once Param[1]: key (type: int) Function 171: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool - Description: Check if a key has been pressed again + Description: Check if key has been pressed again Param[1]: key (type: int) Function 172: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool - Description: Check if a key is being pressed + Description: Check if key is being pressed Param[1]: key (type: int) Function 173: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool - Description: Check if a key has been released once + Description: Check if key has been released once Param[1]: key (type: int) Function 174: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool - Description: Check if a key is NOT being pressed + Description: Check if key is NOT being pressed Param[1]: key (type: int) Function 175: GetKeyPressed() (0 input parameters) Name: GetKeyPressed @@ -1965,7 +1965,7 @@ Function 178: SetExitKey() (1 input parameters) Function 179: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool - Description: Check if a gamepad is available + Description: Check if gamepad is available Param[1]: gamepad (type: int) Function 180: GetGamepadName() (1 input parameters) Name: GetGamepadName @@ -1975,25 +1975,25 @@ Function 180: GetGamepadName() (1 input parameters) Function 181: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool - Description: Check if a gamepad button has been pressed once + Description: Check if gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 182: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool - Description: Check if a gamepad button is being pressed + Description: Check if gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 183: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool - Description: Check if a gamepad button has been released once + Description: Check if gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 184: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool - Description: Check if a gamepad button is NOT being pressed + Description: Check if gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) Function 185: GetGamepadButtonPressed() (0 input parameters) @@ -2028,22 +2028,22 @@ Function 189: SetGamepadVibration() (4 input parameters) Function 190: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool - Description: Check if a mouse button has been pressed once + Description: Check if mouse button has been pressed once Param[1]: button (type: int) Function 191: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool - Description: Check if a mouse button is being pressed + Description: Check if mouse button is being pressed Param[1]: button (type: int) Function 192: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool - Description: Check if a mouse button has been released once + Description: Check if mouse button has been released once Param[1]: button (type: int) Function 193: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool - Description: Check if a mouse button is NOT being pressed + Description: Check if mouse button is NOT being pressed Param[1]: button (type: int) Function 194: GetMouseX() (0 input parameters) Name: GetMouseX @@ -2131,7 +2131,7 @@ Function 209: SetGesturesEnabled() (1 input parameters) Function 210: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool - Description: Check if a gesture has been detected + Description: Check if gesture has been detected Param[1]: gesture (type: unsigned int) Function 211: GetGestureDetected() (0 input parameters) Name: GetGestureDetected @@ -3340,7 +3340,7 @@ Function 372: LoadRenderTexture() (2 input parameters) Function 373: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool - Description: Check if a texture is valid (loaded in GPU) + Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) Function 374: UnloadTexture() (1 input parameters) Name: UnloadTexture @@ -3350,7 +3350,7 @@ Function 374: UnloadTexture() (1 input parameters) Function 375: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool - Description: Check if a render texture is valid (loaded in GPU) + Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) Function 376: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture @@ -3525,7 +3525,7 @@ Function 402: 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[1]: srcPtr (type: const void *) Param[2]: format (type: int) Function 403: SetPixelColor() (3 input parameters) Name: SetPixelColor @@ -3579,7 +3579,7 @@ Function 409: LoadFontFromMemory() (6 input parameters) Function 410: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool - Description: Check if a font is valid (font data loaded, WARNING: GPU texture not checked) + Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) Function 411: LoadFontData() (7 input parameters) Name: LoadFontData @@ -4119,7 +4119,7 @@ Function 486: LoadModelFromMesh() (1 input parameters) Function 487: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool - Description: Check if a model is valid (loaded in GPU, VAO/VBOs) + Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) Function 488: UnloadModel() (1 input parameters) Name: UnloadModel @@ -4353,7 +4353,7 @@ Function 519: LoadMaterialDefault() (0 input parameters) Function 520: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool - Description: Check if a material is valid (shader assigned, map textures loaded in GPU) + Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) Function 521: UnloadMaterial() (1 input parameters) Name: UnloadMaterial @@ -4527,7 +4527,7 @@ Function 547: LoadSoundAlias() (1 input parameters) Function 548: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool - Description: Check if a sound is valid (data loaded and buffers initialized) + Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) Function 549: UpdateSound() (3 input parameters) Name: UpdateSound @@ -4586,7 +4586,7 @@ Function 558: ResumeSound() (1 input parameters) Function 559: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool - Description: Check if a sound is currently playing + Description: Check if sound is currently playing Param[1]: sound (type: Sound) Function 560: SetSoundVolume() (2 input parameters) Name: SetSoundVolume @@ -4651,7 +4651,7 @@ Function 569: LoadMusicStreamFromMemory() (3 input parameters) Function 570: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool - Description: Check if a music stream is valid (context and buffers initialized) + Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) Function 571: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 11ba9fccb..75720ce9f 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -880,7 +880,7 @@ - + @@ -1078,7 +1078,7 @@ - + @@ -1116,7 +1116,7 @@ - + @@ -1133,7 +1133,7 @@ - + @@ -1206,19 +1206,19 @@ - + - + - + - + - + @@ -1231,25 +1231,25 @@ - + - + - + - + - + @@ -1271,16 +1271,16 @@ - + - + - + - + @@ -1325,7 +1325,7 @@ - + @@ -2199,13 +2199,13 @@ - + - + @@ -2326,7 +2326,7 @@ - + @@ -2363,7 +2363,7 @@ - + @@ -2749,7 +2749,7 @@ - + @@ -2916,7 +2916,7 @@ - + @@ -3030,7 +3030,7 @@ - + @@ -3067,7 +3067,7 @@ - + @@ -3110,7 +3110,7 @@ - + From 1a4445f510c20339ea1fcaaad3c6f26ea7327b5b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:03:47 +0200 Subject: [PATCH 28/63] Renamed parameters to align with internal implementations --- src/raylib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index cb02d533b..e63227ef7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1577,10 +1577,10 @@ RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color); // Draw a cylinder/cone RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos -RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color); // Draw a cylinder wires with base at startPos and top at endPos +RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color); // Draw a cylinder/cone wires +RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ From fadcd1fac5b2f8b7003bec3af600a743244cba3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:05:06 +0000 Subject: [PATCH 29/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 6 +++--- tools/rlparser/output/raylib_api.lua | 6 +++--- tools/rlparser/output/raylib_api.txt | 6 +++--- tools/rlparser/output/raylib_api.xml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 1c882cd88..1d6b19c3f 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -10564,7 +10564,7 @@ }, { "type": "int", - "name": "slices" + "name": "sides" }, { "type": "Color", @@ -10626,7 +10626,7 @@ }, { "type": "int", - "name": "slices" + "name": "sides" }, { "type": "Color", @@ -10657,7 +10657,7 @@ }, { "type": "int", - "name": "slices" + "name": "sides" }, { "type": "Color", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index d5024fd45..eaae7e493 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -7364,7 +7364,7 @@ return { {type = "float", name = "radiusTop"}, {type = "float", name = "radiusBottom"}, {type = "float", name = "height"}, - {type = "int", name = "slices"}, + {type = "int", name = "sides"}, {type = "Color", name = "color"} } }, @@ -7390,7 +7390,7 @@ return { {type = "float", name = "radiusTop"}, {type = "float", name = "radiusBottom"}, {type = "float", name = "height"}, - {type = "int", name = "slices"}, + {type = "int", name = "sides"}, {type = "Color", name = "color"} } }, @@ -7403,7 +7403,7 @@ return { {type = "Vector3", name = "endPos"}, {type = "float", name = "startRadius"}, {type = "float", name = "endRadius"}, - {type = "int", name = "slices"}, + {type = "int", name = "sides"}, {type = "Color", name = "color"} } }, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index e322d5fe7..ee54892d9 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -4035,7 +4035,7 @@ Function 476: DrawCylinder() (6 input parameters) Param[2]: radiusTop (type: float) Param[3]: radiusBottom (type: float) Param[4]: height (type: float) - Param[5]: slices (type: int) + Param[5]: sides (type: int) Param[6]: color (type: Color) Function 477: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx @@ -4055,7 +4055,7 @@ Function 478: DrawCylinderWires() (6 input parameters) Param[2]: radiusTop (type: float) Param[3]: radiusBottom (type: float) Param[4]: height (type: float) - Param[5]: slices (type: int) + Param[5]: sides (type: int) Param[6]: color (type: Color) Function 479: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx @@ -4065,7 +4065,7 @@ Function 479: DrawCylinderWiresEx() (6 input parameters) Param[2]: endPos (type: Vector3) Param[3]: startRadius (type: float) Param[4]: endRadius (type: float) - Param[5]: slices (type: int) + Param[5]: sides (type: int) Param[6]: color (type: Color) Function 480: DrawCapsule() (6 input parameters) Name: DrawCapsule diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 75720ce9f..798cdd4cb 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -2687,7 +2687,7 @@ - + @@ -2703,7 +2703,7 @@ - + @@ -2711,7 +2711,7 @@ - + From a85c9f489824ffea71e30c8e35b2eea34c446857 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Jun 2026 21:07:07 +0200 Subject: [PATCH 30/63] REVIEWED: `File*()` functions for consistent return result value NOTE: `SaveFile*()` still follows original convention, returning true on success... --- src/raylib.h | 14 +++++++------- src/rcore.c | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index e63227ef7..7313ffaf3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1141,12 +1141,12 @@ RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custo RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver -RLAPI int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists) -RLAPI int FileRemove(const char *fileName); // Remove file (if exists) -RLAPI int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist -RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist -RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file -RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file +RLAPI int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists), returns 0 on success +RLAPI int FileRemove(const char *fileName); // Remove file (if exists), returns 0 on success +RLAPI int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success +RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success +RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file, returns 0 on success +RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file, returns -1 if index not found or index otherwise RLAPI bool FileExists(const char *fileName); // Check if file exists RLAPI bool DirectoryExists(const char *dirPath); // Check if directory path exists RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (recommended include point: .png, .wav) @@ -1160,7 +1160,7 @@ RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previ RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success -RLAPI bool ChangeDirectory(const char *dirPath); // Change working directory, return true on success +RLAPI int ChangeDirectory(const char *dirPath); // Change working directory, returns 0 on success RLAPI bool IsPathFile(const char *path); // Check if 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, files and directories, no subdirs scan diff --git a/src/rcore.c b/src/rcore.c index d31ae25b8..137dd99ce 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2205,13 +2205,12 @@ void SetSaveFileTextCallback(SaveFileTextCallback callback) // NOTE: Only rename file name required, not full path int FileRename(const char *fileName, const char *fileRename) { - int result = 0; + int result = -1; if (FileExists(fileName)) { result = rename(fileName, fileRename); } - else result = -1; return result; } @@ -2219,13 +2218,12 @@ int FileRename(const char *fileName, const char *fileRename) // Remove file (if exists) int FileRemove(const char *fileName) { - int result = 0; + int result = -1; if (FileExists(fileName)) { result = remove(fileName); } - else result = -1; return result; } @@ -2234,7 +2232,7 @@ int FileRemove(const char *fileName) // NOTE: If destination path does not exist, it is created! int FileCopy(const char *srcPath, const char *dstPath) { - int result = 0; + int result = -1; int srcDataSize = 0; unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize); @@ -2245,7 +2243,10 @@ int FileCopy(const char *srcPath, const char *dstPath) if (result == 0) // Directory created successfully (or already exists) { if ((srcFileData != NULL) && (srcDataSize > 0)) - result = SaveFileData(dstPath, srcFileData, srcDataSize); + { + bool saved = SaveFileData(dstPath, srcFileData, srcDataSize); + if (saved) result = 0; + } } UnloadFileData(srcFileData); @@ -2261,11 +2262,18 @@ int FileMove(const char *srcPath, const char *dstPath) if (FileExists(srcPath)) { - FileCopy(srcPath, dstPath); - - // Make sure file has been correctly copied before removing - if (FileExists(dstPath) && (GetFileLength(srcPath) == GetFileLength(dstPath))) result = FileRemove(srcPath); - else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to copy file to [%s]", srcPath, dstPath); + result = FileCopy(srcPath, dstPath); + + if (result == 0) + { + // Make sure file has been correctly copied before removing + if (FileExists(dstPath) && (GetFileLength(srcPath) == GetFileLength(dstPath))) + { + result = FileRemove(srcPath); + if (result != 0) TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to remove source file after copy", srcPath); + } + else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to copy file to [%s]", srcPath, dstPath); + } } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Source file does not exist", srcPath); @@ -2276,7 +2284,7 @@ int FileMove(const char *srcPath, const char *dstPath) // WARNING: DEPENDENCY: [rtext] module int FileTextReplace(const char *fileName, const char *search, const char *replacement) { - int result = 0; + int result = -1; #if SUPPORT_MODULE_RTEXT char *fileText = NULL; @@ -2286,7 +2294,8 @@ int FileTextReplace(const char *fileName, const char *search, const char *replac { fileText = LoadFileText(fileName); fileTextUpdated = TextReplaceAlloc(fileText, search, replacement); - result = SaveFileText(fileName, fileTextUpdated); + bool saved = SaveFileText(fileName, fileTextUpdated); + if (saved) result = 0; MemFree(fileTextUpdated); UnloadFileText(fileText); } @@ -2801,14 +2810,16 @@ int MakeDirectory(const char *dirPath) } // Change working directory, returns true on success -bool ChangeDirectory(const char *dirPath) +int ChangeDirectory(const char *dirPath) { - bool result = CHDIR(dirPath); + // NOTE: On success, CHDIR() return 0; on error, returns -1 and errno is set to indicate the error, + // depending on the filesystem, other errors can be returned + int result = CHDIR(dirPath); if (result != 0) TRACELOG(LOG_WARNING, "SYSTEM: Failed to change to directory: %s", dirPath); else TRACELOG(LOG_INFO, "SYSTEM: Working Directory: %s", dirPath); - return (result == 0); + return result; } // Check if given path point to a file From 9ace1489175a375529a6e8510b75f0c8a7b34cc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:07:28 +0000 Subject: [PATCH 31/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 16 ++++++++-------- tools/rlparser/output/raylib_api.lua | 16 ++++++++-------- tools/rlparser/output/raylib_api.txt | 16 ++++++++-------- tools/rlparser/output/raylib_api.xml | 14 +++++++------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 1d6b19c3f..0da5fc3e0 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -4427,7 +4427,7 @@ }, { "name": "FileRename", - "description": "Rename file (if exists)", + "description": "Rename file (if exists), returns 0 on success", "returnType": "int", "params": [ { @@ -4442,7 +4442,7 @@ }, { "name": "FileRemove", - "description": "Remove file (if exists)", + "description": "Remove file (if exists), returns 0 on success", "returnType": "int", "params": [ { @@ -4453,7 +4453,7 @@ }, { "name": "FileCopy", - "description": "Copy file from one path to another, dstPath created if it doesn't exist", + "description": "Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success", "returnType": "int", "params": [ { @@ -4468,7 +4468,7 @@ }, { "name": "FileMove", - "description": "Move file from one directory to another, dstPath created if it doesn't exist", + "description": "Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success", "returnType": "int", "params": [ { @@ -4483,7 +4483,7 @@ }, { "name": "FileTextReplace", - "description": "Replace text in an existing file", + "description": "Replace text in an existing file, returns 0 on success", "returnType": "int", "params": [ { @@ -4502,7 +4502,7 @@ }, { "name": "FileTextFindIndex", - "description": "Find text in existing file", + "description": "Find text in existing file, returns -1 if index not found or index otherwise", "returnType": "int", "params": [ { @@ -4652,8 +4652,8 @@ }, { "name": "ChangeDirectory", - "description": "Change working directory, return true on success", - "returnType": "bool", + "description": "Change working directory, returns 0 on success", + "returnType": "int", "params": [ { "type": "const char *", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index eaae7e493..6fa5d9321 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4022,7 +4022,7 @@ return { }, { name = "FileRename", - description = "Rename file (if exists)", + description = "Rename file (if exists), returns 0 on success", returnType = "int", params = { {type = "const char *", name = "fileName"}, @@ -4031,7 +4031,7 @@ return { }, { name = "FileRemove", - description = "Remove file (if exists)", + description = "Remove file (if exists), returns 0 on success", returnType = "int", params = { {type = "const char *", name = "fileName"} @@ -4039,7 +4039,7 @@ return { }, { name = "FileCopy", - description = "Copy file from one path to another, dstPath created if it doesn't exist", + description = "Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success", returnType = "int", params = { {type = "const char *", name = "srcPath"}, @@ -4048,7 +4048,7 @@ return { }, { name = "FileMove", - description = "Move file from one directory to another, dstPath created if it doesn't exist", + description = "Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success", returnType = "int", params = { {type = "const char *", name = "srcPath"}, @@ -4057,7 +4057,7 @@ return { }, { name = "FileTextReplace", - description = "Replace text in an existing file", + description = "Replace text in an existing file, returns 0 on success", returnType = "int", params = { {type = "const char *", name = "fileName"}, @@ -4067,7 +4067,7 @@ return { }, { name = "FileTextFindIndex", - description = "Find text in existing file", + description = "Find text in existing file, returns -1 if index not found or index otherwise", returnType = "int", params = { {type = "const char *", name = "fileName"}, @@ -4175,8 +4175,8 @@ return { }, { name = "ChangeDirectory", - description = "Change working directory, return true on success", - returnType = "bool", + description = "Change working directory, returns 0 on success", + returnType = "int", params = { {type = "const char *", name = "dirPath"} } diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index ee54892d9..97d2350c0 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1667,37 +1667,37 @@ Function 123: SetSaveFileTextCallback() (1 input parameters) Function 124: FileRename() (2 input parameters) Name: FileRename Return type: int - Description: Rename file (if exists) + Description: Rename file (if exists), returns 0 on success Param[1]: fileName (type: const char *) Param[2]: fileRename (type: const char *) Function 125: FileRemove() (1 input parameters) Name: FileRemove Return type: int - Description: Remove file (if exists) + Description: Remove file (if exists), returns 0 on success Param[1]: fileName (type: const char *) Function 126: FileCopy() (2 input parameters) Name: FileCopy Return type: int - Description: Copy file from one path to another, dstPath created if it doesn't exist + Description: Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success Param[1]: srcPath (type: const char *) Param[2]: dstPath (type: const char *) Function 127: FileMove() (2 input parameters) Name: FileMove Return type: int - Description: Move file from one directory to another, dstPath created if it doesn't exist + Description: Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success Param[1]: srcPath (type: const char *) Param[2]: dstPath (type: const char *) Function 128: FileTextReplace() (3 input parameters) Name: FileTextReplace Return type: int - Description: Replace text in an existing file + Description: Replace text in an existing file, returns 0 on success Param[1]: fileName (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) Function 129: FileTextFindIndex() (2 input parameters) Name: FileTextFindIndex Return type: int - Description: Find text in existing file + Description: Find text in existing file, returns -1 if index not found or index otherwise Param[1]: fileName (type: const char *) Param[2]: search (type: const char *) Function 130: FileExists() (1 input parameters) @@ -1768,8 +1768,8 @@ Function 142: MakeDirectory() (1 input parameters) Param[1]: dirPath (type: const char *) Function 143: ChangeDirectory() (1 input parameters) Name: ChangeDirectory - Return type: bool - Description: Change working directory, return true on success + Return type: int + Description: Change working directory, returns 0 on success Param[1]: dirPath (type: const char *) Function 144: IsPathFile() (1 input parameters) Name: IsPathFile diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 798cdd4cb..7fd73e2ed 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1051,27 +1051,27 @@ - + - + - + - + - + - + @@ -1113,7 +1113,7 @@ - + From fd79b8191841a24ec60287b404edfb45b1936f38 Mon Sep 17 00:00:00 2001 From: Luis <113704180+LuisR385@users.noreply.github.com> Date: Fri, 5 Jun 2026 06:32:52 +0900 Subject: [PATCH 32/63] Fix memory leak in UnloadModel() (#5907) --- src/rmodels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 32ade139f..ee795dd26 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1222,6 +1222,8 @@ void UnloadModel(Model model) // Unload animation data RL_FREE(model.skeleton.bones); RL_FREE(model.skeleton.bindPose); + RL_FREE(model.currentPose); + RL_FREE(model.boneMatrices); TRACELOG(LOG_INFO, "MODEL: Unloaded model (and meshes) from RAM and VRAM"); } From ca46387b64d7c1d7505828b2c67d234d1ed0b81d Mon Sep 17 00:00:00 2001 From: fyl2xp1 <97300304+fyl2xp1@users.noreply.github.com> Date: Fri, 5 Jun 2026 07:27:05 +0000 Subject: [PATCH 33/63] use inverse bind matrices for bind pose in gltf loader (#5832) --- src/rmodels.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index ee795dd26..7b4083323 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -6144,17 +6144,36 @@ static Model LoadGLTF(const char *fileName) for (int i = 0; i < model.skeleton.boneCount; i++) { - cgltf_node *node = skin.joints[i]; - 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 bindMatrix = { 0 }; + cgltf_float inverseBindTransform[16] = { 0 }; - MatrixDecompose(worldMatrix, + if ((skin.inverse_bind_matrices != NULL) && + (skin.inverse_bind_matrices->count >= skin.joints_count) && + cgltf_accessor_read_float(skin.inverse_bind_matrices, i, inverseBindTransform, 16)) + { + Matrix inverseBindMatrix = { + inverseBindTransform[0], inverseBindTransform[4], inverseBindTransform[8], inverseBindTransform[12], + inverseBindTransform[1], inverseBindTransform[5], inverseBindTransform[9], inverseBindTransform[13], + inverseBindTransform[2], inverseBindTransform[6], inverseBindTransform[10], inverseBindTransform[14], + inverseBindTransform[3], inverseBindTransform[7], inverseBindTransform[11], inverseBindTransform[15] + }; + bindMatrix = MatrixInvert(inverseBindMatrix); + } + else + { + cgltf_float worldTransform[16] = { 0 }; + cgltf_node_transform_world(skin.joints[i], 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] + }; + bindMatrix = worldMatrix; + } + + MatrixDecompose(bindMatrix, &(model.skeleton.bindPose[i].translation), &(model.skeleton.bindPose[i].rotation), &(model.skeleton.bindPose[i].scale)); From acfcf2f1d19bd9348eba9f94e8977e2f81923a6a Mon Sep 17 00:00:00 2001 From: Luis <113704180+LuisR385@users.noreply.github.com> Date: Sun, 7 Jun 2026 02:47:57 +0900 Subject: [PATCH 34/63] [rmodels] Fix minimum rings validation in DrawCapsule and DrawCapsuleWires (#5909) Ensure rings is at least 1 to prevent rendering issues or crashes when 0 or negative values are passed. --- src/rmodels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 7b4083323..7f140bb6b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -772,7 +772,7 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color) { if (slices < 3) slices = 3; - + if (rings < 1) rings = 1; Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z }; // draw a sphere if start and end points are the same @@ -911,7 +911,7 @@ void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color) { if (slices < 3) slices = 3; - + if (rings < 1) rings = 1; Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z }; // draw a sphere if start and end points are the same From 796e1ad22a68a430169c6e60d904cc0eec1d5baf Mon Sep 17 00:00:00 2001 From: rvnfml <158546973+aceinetx@users.noreply.github.com> Date: Sat, 6 Jun 2026 20:25:48 +0000 Subject: [PATCH 35/63] Use CORE.Input.Keyboard.exitKey instead of KEY_ESCAPE (#5911) ... in rcore_desktop_win32 when handling window closing --- src/platforms/rcore_desktop_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index 517af1eb8..16ac21e26 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -2034,7 +2034,7 @@ static void HandleKey(WPARAM wparam, LPARAM lparam, char state) { CORE.Input.Keyboard.currentKeyState[key] = state; - if ((key == KEY_ESCAPE) && (state == 1)) CORE.Window.shouldClose = true; + if ((key == CORE.Input.Keyboard.exitKey) && (state == 1)) CORE.Window.shouldClose = true; } else TRACELOG(LOG_WARNING, "INPUT: Unknown (or currently unhandled) virtual keycode %d (0x%x)", wparam, wparam); @@ -2274,4 +2274,4 @@ static bool IsWglExtensionAvailable(HDC hdc, const char *extension) } return result; -} \ No newline at end of file +} From 22509ab2d4b1e1b9b8fb874c05b08ae9a26d44d8 Mon Sep 17 00:00:00 2001 From: Tobias Mock Date: Sat, 6 Jun 2026 23:30:21 +0200 Subject: [PATCH 36/63] Update ocaml bindings version (#5912) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index bd5d6b213..10c8d2ee3 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -62,7 +62,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib | | [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | Zlib | | [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT | -| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT | +| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **6.0** | [OCaml](https://ocaml.org) | MIT | | [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | | [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **6.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)/[Delphi](https://en.wikipedia.org/wiki/Delphi_(software)) | Zlib | | [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | From 15d25242be1fa49632512a243a4f50a5a864e9b4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 18:41:44 +0200 Subject: [PATCH 37/63] REVIEWED: Comments to be more descriptive --- src/raylib.h | 12 ++++++------ src/rmodels.c | 6 +++--- src/rshapes.c | 4 ++-- src/rtext.c | 8 ++++---- src/rtextures.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 7313ffaf3..5b282ea5a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1461,7 +1461,7 @@ RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Texture drawing functions RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with rotation and scale RLAPI void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle RLAPI void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a texture (or part of it) that stretches or shrinks nicely @@ -1492,7 +1492,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, const 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, font size is provided in pixels height +RLAPI Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount); // Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height 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, const int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' RLAPI bool IsFontValid(Font font); // Check if font is valid (font data loaded, WARNING: GPU texture not checked) @@ -1568,14 +1568,14 @@ RLAPI float TextToFloat(const char *text); RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space 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 DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle, counter-clockwise vertex order 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 RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with defined rings and slices RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color); // Draw a cylinder/cone RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos @@ -1600,9 +1600,9 @@ RLAPI BoundingBox GetModelBoundingBox(Model model); // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with custom transform RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires with custom transform RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by rectangle diff --git a/src/rmodels.c b/src/rmodels.c index 7f140bb6b..21f69c92e 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -435,7 +435,7 @@ void DrawSphere(Vector3 centerPos, float radius, Color color) DrawSphereEx(centerPos, radius, 16, 16, color); } -// Draw sphere with extended parameters +// Draw sphere with defined rings and slices void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color) { #if 0 @@ -3918,7 +3918,7 @@ void DrawModel(Model model, Vector3 position, float scale, Color tint) DrawModelEx(model, position, rotationAxis, 0.0f, vScale, tint); } -// Draw a model with extended parameters +// Draw a model with custom transform void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { // Calculate transformation matrix from function parameters @@ -3972,7 +3972,7 @@ void DrawModelWires(Model model, Vector3 position, float scale, Color tint) rlDisableWireMode(); } -// Draw a model wires (with texture if set) with extended parameters +// Draw a model wires with custom transform void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { rlEnableWireMode(); diff --git a/src/rshapes.c b/src/rshapes.c index 38c8a1fbe..627ee24f0 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -908,8 +908,8 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) */ } -// Draw rectangle outline with extended parameters -void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) +// Draw rectangle outline with line thickness +void DrawRectangleLinesEx(Rectangle rec, float thick, Color color) { if ((lineThick > rec.width) || (lineThick > rec.height)) { diff --git a/src/rtext.c b/src/rtext.c index f1de75421..79baa85e1 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -327,7 +327,7 @@ extern void UnloadFontDefault(void) defaultFont.recs = NULL; } -// Get the default font, useful to be used with extended parameters +// Get the default font Font GetFontDefault() { return defaultFont; @@ -381,9 +381,9 @@ Font LoadFont(const char *fileName) return font; } -// Load Font from TTF or BDF font file with generation parameters -// NOTE: You can pass an array with desired characters, those characters should be available in the font -// if array is NULL, default char set is selected 32..126 +// Load font from file with defined codepoints and generation size +// NOTE: NULL for codepoints and 0 for codepointCount to load the default character set (32..126), +// font size is provided in pixels height Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount) { Font font = { 0 }; diff --git a/src/rtextures.c b/src/rtextures.c index 9a359f0f2..84e4406bc 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3738,7 +3738,7 @@ void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int heig ImageDrawRectangleLinesEx(dst, rec, 1, color); } -// Draw rectangle lines within an image with extended parameters +// Draw rectangle lines within an image with line thickness void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color) { ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); @@ -4488,7 +4488,7 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) DrawTextureEx(texture, position, 0, 1.0f, tint); } -// Draw a texture with extended parameters +// Draw a texture with rotation and scale void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { Rectangle srcrec = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; From 45f1af2bded6ec52ccc49229f78ecec37a5ece24 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 16:42:02 +0000 Subject: [PATCH 38/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 12 ++++++------ tools/rlparser/output/raylib_api.lua | 12 ++++++------ tools/rlparser/output/raylib_api.txt | 12 ++++++------ tools/rlparser/output/raylib_api.xml | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 0da5fc3e0..396dc7bbe 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -8877,7 +8877,7 @@ }, { "name": "DrawTextureEx", - "description": "Draw a Texture2D with extended parameters", + "description": "Draw a Texture2D with rotation and scale", "returnType": "void", "params": [ { @@ -9260,7 +9260,7 @@ }, { "name": "LoadFontEx", - "description": "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height", + "description": "Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height", "returnType": "Font", "params": [ { @@ -10336,7 +10336,7 @@ }, { "name": "DrawTriangle3D", - "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", + "description": "Draw a color-filled triangle, counter-clockwise vertex order", "returnType": "void", "params": [ { @@ -10489,7 +10489,7 @@ }, { "name": "DrawSphereEx", - "description": "Draw sphere with extended parameters", + "description": "Draw sphere with defined rings and slices", "returnType": "void", "params": [ { @@ -10856,7 +10856,7 @@ }, { "name": "DrawModelEx", - "description": "Draw a model with extended parameters", + "description": "Draw a model with custom transform", "returnType": "void", "params": [ { @@ -10910,7 +10910,7 @@ }, { "name": "DrawModelWiresEx", - "description": "Draw a model wires (with texture if set) with extended parameters", + "description": "Draw a model wires with custom transform", "returnType": "void", "params": [ { diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 6fa5d9321..f35c4c688 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -6459,7 +6459,7 @@ return { }, { name = "DrawTextureEx", - description = "Draw a Texture2D with extended parameters", + description = "Draw a Texture2D with rotation and scale", returnType = "void", params = { {type = "Texture2D", name = "texture"}, @@ -6674,7 +6674,7 @@ return { }, { name = "LoadFontEx", - description = "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height", + description = "Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height", returnType = "Font", params = { {type = "const char *", name = "fileName"}, @@ -7258,7 +7258,7 @@ return { }, { name = "DrawTriangle3D", - description = "Draw a color-filled triangle (vertex in counter-clockwise order!)", + description = "Draw a color-filled triangle, counter-clockwise vertex order", returnType = "void", params = { {type = "Vector3", name = "v1"}, @@ -7333,7 +7333,7 @@ return { }, { name = "DrawSphereEx", - description = "Draw sphere with extended parameters", + description = "Draw sphere with defined rings and slices", returnType = "void", params = { {type = "Vector3", name = "centerPos"}, @@ -7514,7 +7514,7 @@ return { }, { name = "DrawModelEx", - description = "Draw a model with extended parameters", + description = "Draw a model with custom transform", returnType = "void", params = { {type = "Model", name = "model"}, @@ -7538,7 +7538,7 @@ return { }, { name = "DrawModelWiresEx", - description = "Draw a model wires (with texture if set) with extended parameters", + description = "Draw a model wires with custom transform", returnType = "void", params = { {type = "Model", name = "model"}, diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 97d2350c0..722d85d0a 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -3405,7 +3405,7 @@ Function 383: DrawTextureV() (3 input parameters) Function 384: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void - Description: Draw a Texture2D with extended parameters + Description: Draw a Texture2D with rotation and scale Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: rotation (type: float) @@ -3554,7 +3554,7 @@ Function 406: LoadFont() (1 input parameters) Function 407: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font - Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height + Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height Param[1]: fileName (type: const char *) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) @@ -3958,7 +3958,7 @@ Function 466: DrawCircle3D() (5 input parameters) Function 467: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void - Description: Draw a color-filled triangle (vertex in counter-clockwise order!) + Description: Draw a color-filled triangle, counter-clockwise vertex order Param[1]: v1 (type: Vector3) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) @@ -4012,7 +4012,7 @@ Function 473: DrawSphere() (3 input parameters) Function 474: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void - Description: Draw sphere with extended parameters + Description: Draw sphere with defined rings and slices Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: rings (type: int) @@ -4142,7 +4142,7 @@ Function 490: DrawModel() (4 input parameters) Function 491: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void - Description: Draw a model with extended parameters + Description: Draw a model with custom transform Param[1]: model (type: Model) Param[2]: position (type: Vector3) Param[3]: rotationAxis (type: Vector3) @@ -4160,7 +4160,7 @@ Function 492: DrawModelWires() (4 input parameters) Function 493: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void - Description: Draw a model wires (with texture if set) with extended parameters + Description: Draw a model wires with custom transform Param[1]: model (type: Model) Param[2]: position (type: Vector3) Param[3]: rotationAxis (type: Vector3) diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 7fd73e2ed..6235a6de8 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -2242,7 +2242,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2628,7 +2628,7 @@ - + @@ -2668,7 +2668,7 @@ - + @@ -2764,7 +2764,7 @@ - + @@ -2778,7 +2778,7 @@ - + From 869251e590e283ecaa15911971430c2741ebee3d Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 18:42:50 +0200 Subject: [PATCH 39/63] REVIEWED: Parameter name, shorter --- src/rshapes.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 627ee24f0..1cf1af2d0 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -911,13 +911,13 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) // Draw rectangle outline with line thickness void DrawRectangleLinesEx(Rectangle rec, float thick, Color color) { - if ((lineThick > rec.width) || (lineThick > rec.height)) + if ((thick > rec.width) || (thick > rec.height)) { - if (rec.width >= rec.height) lineThick = rec.height/2; - else if (rec.width <= rec.height) lineThick = rec.width/2; + if (rec.width >= rec.height) thick = rec.height/2; + else if (rec.width <= rec.height) thick = rec.width/2; } - // When rec = { x, y, 8.0f, 6.0f } and lineThick = 2, the following + // When rec = { x, y, 8.0f, 6.0f } and thick = 2, the following // four rectangles are drawn ([T]op, [B]ottom, [L]eft, [R]ight): // // TTTTTTTT @@ -928,10 +928,10 @@ void DrawRectangleLinesEx(Rectangle rec, float thick, Color color) // BBBBBBBB // - Rectangle top = { rec.x, rec.y, rec.width, lineThick }; - Rectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick }; - Rectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; - Rectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; + Rectangle top = { rec.x, rec.y, rec.width, thick }; + Rectangle bottom = { rec.x, rec.y - thick + rec.height, rec.width, thick }; + Rectangle left = { rec.x, rec.y + thick, thick, rec.height - thick*2.0f }; + Rectangle right = { rec.x - thick + rec.width, rec.y + thick, thick, rec.height - thick*2.0f }; DrawRectangleRec(top, color); DrawRectangleRec(bottom, color); @@ -1172,15 +1172,15 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Col DrawRectangleRoundedLinesEx(rec, roundness, segments, 1.0f, color); } -// Draw rectangle with rounded edges outline -void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color) +// Draw rectangle with rounded edges outline with line thickness +void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float thick, Color color) { - if (lineThick < 0) lineThick = 0; + if (thick < 0) thick = 0; // Not a rounded rectangle if (roundness <= 0.0f) { - DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color); + DrawRectangleLinesEx((Rectangle){rec.x - thick, rec.y - thick, rec.width + 2*thick, rec.height + 2*thick}, thick, color); return; } @@ -1200,7 +1200,7 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f } float stepLength = 90.0f/(float)segments; - const float outerRadius = radius + lineThick, innerRadius = radius; + const float outerRadius = radius + thick, innerRadius = radius; /* Quick sketch to make sense of all of this, @@ -1219,14 +1219,14 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f P5 ================== P4 */ const Vector2 point[16] = { - {(float)rec.x + innerRadius + 0.5f, rec.y - lineThick + 0.5f}, - {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y - lineThick + 0.5f}, - {rec.x + rec.width + lineThick - 0.5f, (float)rec.y + innerRadius + 0.5f}, // PO, P1, P2 - {rec.x + rec.width + lineThick - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, - {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height + lineThick - 0.5f}, // P3, P4 - {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height + lineThick - 0.5f}, - {rec.x - lineThick + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, - {rec.x - lineThick + 0.5f, (float)rec.y + innerRadius + 0.5f}, // P5, P6, P7 + {(float)rec.x + innerRadius + 0.5f, rec.y - thick + 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y - thick + 0.5f}, + {rec.x + rec.width + thick - 0.5f, (float)rec.y + innerRadius + 0.5f}, // PO, P1, P2 + {rec.x + rec.width + thick - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height + thick - 0.5f}, // P3, P4 + {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height + thick - 0.5f}, + {rec.x - thick + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {rec.x - thick + 0.5f, (float)rec.y + innerRadius + 0.5f}, // P5, P6, P7 {(float)rec.x + innerRadius + 0.5f, rec.y + 0.5f}, {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + 0.5f}, // P8, P9 {rec.x + rec.width - 0.5f, (float)rec.y + innerRadius + 0.5f}, @@ -1246,7 +1246,7 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f const float angles[4] = { 180.0f, 270.0f, 0.0f, 90.0f }; - if (lineThick > 1) + if (thick > 1) { #if SUPPORT_QUADS_DRAW_MODE rlSetTexture(GetShapesTexture().id); @@ -1611,12 +1611,12 @@ void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Colo rlEnd(); } -void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color) +void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float thick, Color color) { if (sides < 3) sides = 3; float centralAngle = rotation*DEG2RAD; float exteriorAngle = 360.0f/(float)sides*DEG2RAD; - float innerRadius = radius - (lineThick*cosf(DEG2RAD*exteriorAngle/2.0f)); + float innerRadius = radius - (thick*cosf(DEG2RAD*exteriorAngle/2.0f)); #if SUPPORT_QUADS_DRAW_MODE rlSetTexture(GetShapesTexture().id); From a41bb7c07a3340a362ca5114f1b7c699677c46d3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 18:47:14 +0200 Subject: [PATCH 40/63] Reorder shapes drawing API functions by number of vertices NOTE: Consistency between shapes and Image drawing functionality is being aligned (as much as possible) --- src/raylib.h | 59 ++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 5b282ea5a..4aec696b3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1280,6 +1280,26 @@ RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color 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 DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color); // Draw a dashed line +RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle, counter-clockwise vertex order +RLAPI void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors, counter-clockwise vertex/color order +RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline, counter-clockwise vertex order +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 DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) +RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight); // Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order +RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline +RLAPI void DrawRectangleLinesEx(Rectangle rec, float thick, Color color); // Draw rectangle outline with line thickness +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges +RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float thick, Color color); // Draw rectangle lines with rounded edges outline and line thickness +RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon of n sides +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 thick, Color color); // Draw a polygon outline of n sides with line thickness RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-filled circle @@ -1293,26 +1313,6 @@ RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiu RLAPI void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse outline (Vector version) RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline -RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle -RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight); // Draw a gradient-filled rectangle with custom vertex colors -RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters -RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges -RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle lines 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 DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors (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(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 polygon of n sides -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(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points @@ -1422,21 +1422,22 @@ RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); 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 -RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) -RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image -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, int posX, int posY, int width, int height, Color color); // Draw rectangle lines within an image -RLAPI void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image with extended parameters RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image RLAPI void ImageDrawTriangleGradient(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, const 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, const 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 ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image +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, int posX, int posY, int width, int height, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image with line thickness +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 +RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) +RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image into 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) From 20aa6cb764387e2fe7761341ef84c60c13ed8f91 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 16:47:29 +0000 Subject: [PATCH 41/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 1465 +++++++++++++------------ tools/rlparser/output/raylib_api.lua | 676 ++++++------ tools/rlparser/output/raylib_api.txt | 1011 ++++++++--------- tools/rlparser/output/raylib_api.xml | 383 +++---- 4 files changed, 1795 insertions(+), 1740 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 396dc7bbe..2ab5b39c5 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -5675,6 +5675,498 @@ } ] }, + { + "name": "DrawTriangle", + "description": "Draw a color-filled triangle, counter-clockwise vertex order", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleGradient", + "description": "Draw triangle with interpolated colors, counter-clockwise vertex/color order", + "returnType": "void", + "params": [ + { + "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": "DrawTriangleLines", + "description": "Draw triangle outline, counter-clockwise vertex order", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleFan", + "description": "Draw a triangle fan defined by points (first vertex is the center)", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleStrip", + "description": "Draw a triangle strip defined by points", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangle", + "description": "Draw a color-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleV", + "description": "Draw a color-filled rectangle (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRec", + "description": "Draw a color-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectanglePro", + "description": "Draw a color-filled rectangle with pro parameters", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleGradientV", + "description": "Draw a vertical-gradient-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "top" + }, + { + "type": "Color", + "name": "bottom" + } + ] + }, + { + "name": "DrawRectangleGradientH", + "description": "Draw a horizontal-gradient-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "left" + }, + { + "type": "Color", + "name": "right" + } + ] + }, + { + "name": "DrawRectangleGradientEx", + "description": "Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "topLeft" + }, + { + "type": "Color", + "name": "bottomLeft" + }, + { + "type": "Color", + "name": "bottomRight" + }, + { + "type": "Color", + "name": "topRight" + } + ] + }, + { + "name": "DrawRectangleLines", + "description": "Draw rectangle outline", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleLinesEx", + "description": "Draw rectangle outline with line thickness", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRounded", + "description": "Draw rectangle with rounded edges", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "roundness" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRoundedLines", + "description": "Draw rectangle lines with rounded edges", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "roundness" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRoundedLinesEx", + "description": "Draw rectangle lines with rounded edges outline and line thickness", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "roundness" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPoly", + "description": "Draw a polygon of n sides", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPolyLines", + "description": "Draw a polygon outline of n sides", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPolyLinesEx", + "description": "Draw a polygon outline of n sides with line thickness", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "DrawCircle", "description": "Draw a color-filled circle", @@ -6014,498 +6506,6 @@ } ] }, - { - "name": "DrawRectangle", - "description": "Draw a color-filled rectangle", - "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleV", - "description": "Draw a color-filled rectangle (Vector version)", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleRec", - "description": "Draw a color-filled rectangle", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectanglePro", - "description": "Draw a color-filled rectangle with pro parameters", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleGradientV", - "description": "Draw a vertical-gradient-filled rectangle", - "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "top" - }, - { - "type": "Color", - "name": "bottom" - } - ] - }, - { - "name": "DrawRectangleGradientH", - "description": "Draw a horizontal-gradient-filled rectangle", - "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "left" - }, - { - "type": "Color", - "name": "right" - } - ] - }, - { - "name": "DrawRectangleGradientEx", - "description": "Draw a gradient-filled rectangle with custom vertex colors", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Color", - "name": "topLeft" - }, - { - "type": "Color", - "name": "bottomLeft" - }, - { - "type": "Color", - "name": "bottomRight" - }, - { - "type": "Color", - "name": "topRight" - } - ] - }, - { - "name": "DrawRectangleLines", - "description": "Draw rectangle outline", - "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleLinesEx", - "description": "Draw rectangle outline with extended parameters", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "lineThick" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleRounded", - "description": "Draw rectangle with rounded edges", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "roundness" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleRoundedLines", - "description": "Draw rectangle lines with rounded edges", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "roundness" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRectangleRoundedLinesEx", - "description": "Draw rectangle lines with rounded edges outline", - "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "roundness" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "float", - "name": "lineThick" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawTriangle", - "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "v1" - }, - { - "type": "Vector2", - "name": "v2" - }, - { - "type": "Vector2", - "name": "v3" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawTriangleGradient", - "description": "Draw triangle with interpolated colors (vertex in counter-clockwise order!)", - "returnType": "void", - "params": [ - { - "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": "DrawTriangleLines", - "description": "Draw triangle outline (vertex in counter-clockwise order!)", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "v1" - }, - { - "type": "Vector2", - "name": "v2" - }, - { - "type": "Vector2", - "name": "v3" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawTriangleFan", - "description": "Draw a triangle fan defined by points (first vertex is the center)", - "returnType": "void", - "params": [ - { - "type": "const Vector2 *", - "name": "points" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawTriangleStrip", - "description": "Draw a triangle strip defined by points", - "returnType": "void", - "params": [ - { - "type": "const Vector2 *", - "name": "points" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawPoly", - "description": "Draw a polygon of n sides", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawPolyLines", - "description": "Draw a polygon outline of n sides", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawPolyLinesEx", - "description": "Draw a polygon outline of n sides with extended parameters", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "float", - "name": "lineThick" - }, - { - "type": "Color", - "name": "color" - } - ] - }, { "name": "DrawSplineLinear", "description": "Draw spline: Linear, minimum 2 points", @@ -8207,233 +8207,6 @@ } ] }, - { - "name": "ImageDrawCircle", - "description": "Draw a filled circle within an image", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "int", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawCircleV", - "description": "Draw a filled circle within an image (Vector version)", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawCircleLines", - "description": "Draw circle outline within an image", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "int", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawCircleLinesV", - "description": "Draw circle outline within an image (Vector version)", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawRectangle", - "description": "Draw rectangle within an image", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawRectangleV", - "description": "Draw rectangle within an image (Vector version)", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawRectangleRec", - "description": "Draw rectangle within an image", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawRectangleLines", - "description": "Draw rectangle lines within an image", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "ImageDrawRectangleLinesEx", - "description": "Draw rectangle lines within an image with extended parameters", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "int", - "name": "thick" - }, - { - "type": "Color", - "name": "color" - } - ] - }, { "name": "ImageDrawTriangle", "description": "Draw triangle within an image", @@ -8596,6 +8369,260 @@ } ] }, + { + "name": "ImageDrawRectangle", + "description": "Draw rectangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleV", + "description": "Draw rectangle within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleRec", + "description": "Draw rectangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleLines", + "description": "Draw rectangle lines within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleLinesEx", + "description": "Draw rectangle lines within an image with line thickness", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "int", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircle", + "description": "Draw a filled circle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "int", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircleV", + "description": "Draw a filled circle within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircleLines", + "description": "Draw circle outline within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "int", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircleLinesV", + "description": "Draw circle outline within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDraw", + "description": "Draw a source image into a destination image (tint applied to source)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Image", + "name": "src" + }, + { + "type": "Rectangle", + "name": "srcRec" + }, + { + "type": "Rectangle", + "name": "dstRec" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, { "name": "ImageDrawText", "description": "Draw text (using default font) within an image (destination)", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index f35c4c688..45f15a56e 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4850,6 +4850,234 @@ return { {type = "Color", name = "color"} } }, + { + name = "DrawTriangle", + description = "Draw a color-filled triangle, counter-clockwise vertex order", + returnType = "void", + params = { + {type = "Vector2", name = "v1"}, + {type = "Vector2", name = "v2"}, + {type = "Vector2", name = "v3"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawTriangleGradient", + description = "Draw triangle with interpolated colors, counter-clockwise vertex/color order", + returnType = "void", + params = { + {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 = "DrawTriangleLines", + description = "Draw triangle outline, counter-clockwise vertex order", + returnType = "void", + params = { + {type = "Vector2", name = "v1"}, + {type = "Vector2", name = "v2"}, + {type = "Vector2", name = "v3"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawTriangleFan", + description = "Draw a triangle fan defined by points (first vertex is the center)", + returnType = "void", + params = { + {type = "const Vector2 *", name = "points"}, + {type = "int", name = "pointCount"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawTriangleStrip", + description = "Draw a triangle strip defined by points", + returnType = "void", + params = { + {type = "const Vector2 *", name = "points"}, + {type = "int", name = "pointCount"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangle", + description = "Draw a color-filled rectangle", + returnType = "void", + params = { + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "int", name = "width"}, + {type = "int", name = "height"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleV", + description = "Draw a color-filled rectangle (Vector version)", + returnType = "void", + params = { + {type = "Vector2", name = "position"}, + {type = "Vector2", name = "size"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleRec", + description = "Draw a color-filled rectangle", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectanglePro", + description = "Draw a color-filled rectangle with pro parameters", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "Vector2", name = "origin"}, + {type = "float", name = "rotation"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleGradientV", + description = "Draw a vertical-gradient-filled rectangle", + returnType = "void", + params = { + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "int", name = "width"}, + {type = "int", name = "height"}, + {type = "Color", name = "top"}, + {type = "Color", name = "bottom"} + } + }, + { + name = "DrawRectangleGradientH", + description = "Draw a horizontal-gradient-filled rectangle", + returnType = "void", + params = { + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "int", name = "width"}, + {type = "int", name = "height"}, + {type = "Color", name = "left"}, + {type = "Color", name = "right"} + } + }, + { + name = "DrawRectangleGradientEx", + description = "Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "Color", name = "topLeft"}, + {type = "Color", name = "bottomLeft"}, + {type = "Color", name = "bottomRight"}, + {type = "Color", name = "topRight"} + } + }, + { + name = "DrawRectangleLines", + description = "Draw rectangle outline", + returnType = "void", + params = { + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "int", name = "width"}, + {type = "int", name = "height"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleLinesEx", + description = "Draw rectangle outline with line thickness", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "float", name = "thick"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleRounded", + description = "Draw rectangle with rounded edges", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "float", name = "roundness"}, + {type = "int", name = "segments"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleRoundedLines", + description = "Draw rectangle lines with rounded edges", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "float", name = "roundness"}, + {type = "int", name = "segments"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawRectangleRoundedLinesEx", + description = "Draw rectangle lines with rounded edges outline and line thickness", + returnType = "void", + params = { + {type = "Rectangle", name = "rec"}, + {type = "float", name = "roundness"}, + {type = "int", name = "segments"}, + {type = "float", name = "thick"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawPoly", + description = "Draw a polygon of n sides", + returnType = "void", + params = { + {type = "Vector2", name = "center"}, + {type = "int", name = "sides"}, + {type = "float", name = "radius"}, + {type = "float", name = "rotation"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawPolyLines", + description = "Draw a polygon outline of n sides", + returnType = "void", + params = { + {type = "Vector2", name = "center"}, + {type = "int", name = "sides"}, + {type = "float", name = "radius"}, + {type = "float", name = "rotation"}, + {type = "Color", name = "color"} + } + }, + { + name = "DrawPolyLinesEx", + description = "Draw a polygon outline of n sides with line thickness", + returnType = "void", + params = { + {type = "Vector2", name = "center"}, + {type = "int", name = "sides"}, + {type = "float", name = "radius"}, + {type = "float", name = "rotation"}, + {type = "float", name = "thick"}, + {type = "Color", name = "color"} + } + }, { name = "DrawCircle", description = "Draw a color-filled circle", @@ -5003,234 +5231,6 @@ return { {type = "Color", name = "color"} } }, - { - name = "DrawRectangle", - description = "Draw a color-filled rectangle", - returnType = "void", - params = { - {type = "int", name = "posX"}, - {type = "int", name = "posY"}, - {type = "int", name = "width"}, - {type = "int", name = "height"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleV", - description = "Draw a color-filled rectangle (Vector version)", - returnType = "void", - params = { - {type = "Vector2", name = "position"}, - {type = "Vector2", name = "size"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleRec", - description = "Draw a color-filled rectangle", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectanglePro", - description = "Draw a color-filled rectangle with pro parameters", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "Vector2", name = "origin"}, - {type = "float", name = "rotation"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleGradientV", - description = "Draw a vertical-gradient-filled rectangle", - returnType = "void", - params = { - {type = "int", name = "posX"}, - {type = "int", name = "posY"}, - {type = "int", name = "width"}, - {type = "int", name = "height"}, - {type = "Color", name = "top"}, - {type = "Color", name = "bottom"} - } - }, - { - name = "DrawRectangleGradientH", - description = "Draw a horizontal-gradient-filled rectangle", - returnType = "void", - params = { - {type = "int", name = "posX"}, - {type = "int", name = "posY"}, - {type = "int", name = "width"}, - {type = "int", name = "height"}, - {type = "Color", name = "left"}, - {type = "Color", name = "right"} - } - }, - { - name = "DrawRectangleGradientEx", - description = "Draw a gradient-filled rectangle with custom vertex colors", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "Color", name = "topLeft"}, - {type = "Color", name = "bottomLeft"}, - {type = "Color", name = "bottomRight"}, - {type = "Color", name = "topRight"} - } - }, - { - name = "DrawRectangleLines", - description = "Draw rectangle outline", - returnType = "void", - params = { - {type = "int", name = "posX"}, - {type = "int", name = "posY"}, - {type = "int", name = "width"}, - {type = "int", name = "height"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleLinesEx", - description = "Draw rectangle outline with extended parameters", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "float", name = "lineThick"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleRounded", - description = "Draw rectangle with rounded edges", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "float", name = "roundness"}, - {type = "int", name = "segments"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleRoundedLines", - description = "Draw rectangle lines with rounded edges", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "float", name = "roundness"}, - {type = "int", name = "segments"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawRectangleRoundedLinesEx", - description = "Draw rectangle lines with rounded edges outline", - returnType = "void", - params = { - {type = "Rectangle", name = "rec"}, - {type = "float", name = "roundness"}, - {type = "int", name = "segments"}, - {type = "float", name = "lineThick"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawTriangle", - description = "Draw a color-filled triangle (vertex in counter-clockwise order!)", - returnType = "void", - params = { - {type = "Vector2", name = "v1"}, - {type = "Vector2", name = "v2"}, - {type = "Vector2", name = "v3"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawTriangleGradient", - description = "Draw triangle with interpolated colors (vertex in counter-clockwise order!)", - returnType = "void", - params = { - {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 = "DrawTriangleLines", - description = "Draw triangle outline (vertex in counter-clockwise order!)", - returnType = "void", - params = { - {type = "Vector2", name = "v1"}, - {type = "Vector2", name = "v2"}, - {type = "Vector2", name = "v3"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawTriangleFan", - description = "Draw a triangle fan defined by points (first vertex is the center)", - returnType = "void", - params = { - {type = "const Vector2 *", name = "points"}, - {type = "int", name = "pointCount"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawTriangleStrip", - description = "Draw a triangle strip defined by points", - returnType = "void", - params = { - {type = "const Vector2 *", name = "points"}, - {type = "int", name = "pointCount"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawPoly", - description = "Draw a polygon of n sides", - returnType = "void", - params = { - {type = "Vector2", name = "center"}, - {type = "int", name = "sides"}, - {type = "float", name = "radius"}, - {type = "float", name = "rotation"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawPolyLines", - description = "Draw a polygon outline of n sides", - returnType = "void", - params = { - {type = "Vector2", name = "center"}, - {type = "int", name = "sides"}, - {type = "float", name = "radius"}, - {type = "float", name = "rotation"}, - {type = "Color", name = "color"} - } - }, - { - name = "DrawPolyLinesEx", - description = "Draw a polygon outline of n sides with extended parameters", - returnType = "void", - params = { - {type = "Vector2", name = "center"}, - {type = "int", name = "sides"}, - {type = "float", name = "radius"}, - {type = "float", name = "rotation"}, - {type = "float", name = "lineThick"}, - {type = "Color", name = "color"} - } - }, { name = "DrawSplineLinear", description = "Draw spline: Linear, minimum 2 points", @@ -6122,110 +6122,6 @@ return { {type = "Color", name = "color"} } }, - { - name = "ImageDrawCircle", - description = "Draw a filled circle within an image", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "int", name = "centerX"}, - {type = "int", name = "centerY"}, - {type = "int", name = "radius"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawCircleV", - description = "Draw a filled circle within an image (Vector version)", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Vector2", name = "center"}, - {type = "int", name = "radius"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawCircleLines", - description = "Draw circle outline within an image", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "int", name = "centerX"}, - {type = "int", name = "centerY"}, - {type = "int", name = "radius"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawCircleLinesV", - description = "Draw circle outline within an image (Vector version)", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Vector2", name = "center"}, - {type = "int", name = "radius"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawRectangle", - description = "Draw rectangle within an image", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "int", name = "posX"}, - {type = "int", name = "posY"}, - {type = "int", name = "width"}, - {type = "int", name = "height"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawRectangleV", - description = "Draw rectangle within an image (Vector version)", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Vector2", name = "position"}, - {type = "Vector2", name = "size"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawRectangleRec", - description = "Draw rectangle within an image", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Rectangle", name = "rec"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawRectangleLines", - description = "Draw rectangle lines within an image", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "int", name = "posX"}, - {type = "int", name = "posY"}, - {type = "int", name = "width"}, - {type = "int", name = "height"}, - {type = "Color", name = "color"} - } - }, - { - name = "ImageDrawRectangleLinesEx", - description = "Draw rectangle lines within an image with extended parameters", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Rectangle", name = "rec"}, - {type = "int", name = "thick"}, - {type = "Color", name = "color"} - } - }, { name = "ImageDrawTriangle", description = "Draw triangle within an image", @@ -6298,6 +6194,122 @@ return { {type = "Color", name = "tint"} } }, + { + name = "ImageDrawRectangle", + description = "Draw rectangle within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "int", name = "width"}, + {type = "int", name = "height"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawRectangleV", + description = "Draw rectangle within an image (Vector version)", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "position"}, + {type = "Vector2", name = "size"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawRectangleRec", + description = "Draw rectangle within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Rectangle", name = "rec"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawRectangleLines", + description = "Draw rectangle lines within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "int", name = "width"}, + {type = "int", name = "height"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawRectangleLinesEx", + description = "Draw rectangle lines within an image with line thickness", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Rectangle", name = "rec"}, + {type = "int", name = "thick"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawCircle", + description = "Draw a filled circle within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "int", name = "centerX"}, + {type = "int", name = "centerY"}, + {type = "int", name = "radius"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawCircleV", + description = "Draw a filled circle within an image (Vector version)", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "center"}, + {type = "int", name = "radius"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawCircleLines", + description = "Draw circle outline within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "int", name = "centerX"}, + {type = "int", name = "centerY"}, + {type = "int", name = "radius"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDrawCircleLinesV", + description = "Draw circle outline within an image (Vector version)", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "center"}, + {type = "int", name = "radius"}, + {type = "Color", name = "color"} + } + }, + { + name = "ImageDraw", + description = "Draw a source image into a destination image (tint applied to source)", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Image", name = "src"}, + {type = "Rectangle", name = "srcRec"}, + {type = "Rectangle", name = "dstRec"}, + {type = "Color", name = "tint"} + } + }, { name = "ImageDrawText", description = "Draw text (using default font) within an image (destination)", diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 722d85d0a..2c68bce51 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1000,7 +1000,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 602 +Functions found: 603 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -2254,7 +2254,175 @@ Function 229: DrawLineDashed() (5 input parameters) Param[3]: dashSize (type: int) Param[4]: spaceSize (type: int) Param[5]: color (type: Color) -Function 230: DrawCircle() (4 input parameters) +Function 230: DrawTriangle() (4 input parameters) + Name: DrawTriangle + Return type: void + Description: Draw a color-filled triangle, counter-clockwise vertex order + Param[1]: v1 (type: Vector2) + Param[2]: v2 (type: Vector2) + Param[3]: v3 (type: Vector2) + Param[4]: color (type: Color) +Function 231: DrawTriangleGradient() (6 input parameters) + Name: DrawTriangleGradient + Return type: void + Description: Draw triangle with interpolated colors, counter-clockwise vertex/color order + Param[1]: v1 (type: Vector2) + Param[2]: v2 (type: Vector2) + Param[3]: v3 (type: Vector2) + Param[4]: c1 (type: Color) + Param[5]: c2 (type: Color) + Param[6]: c3 (type: Color) +Function 232: DrawTriangleLines() (4 input parameters) + Name: DrawTriangleLines + Return type: void + Description: Draw triangle outline, counter-clockwise vertex order + Param[1]: v1 (type: Vector2) + Param[2]: v2 (type: Vector2) + Param[3]: v3 (type: Vector2) + Param[4]: color (type: Color) +Function 233: 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: const Vector2 *) + Param[2]: pointCount (type: int) + Param[3]: color (type: Color) +Function 234: DrawTriangleStrip() (3 input parameters) + Name: DrawTriangleStrip + Return type: void + Description: Draw a triangle strip defined by points + Param[1]: points (type: const Vector2 *) + Param[2]: pointCount (type: int) + Param[3]: color (type: Color) +Function 235: DrawRectangle() (5 input parameters) + Name: DrawRectangle + Return type: void + Description: Draw a color-filled rectangle + Param[1]: posX (type: int) + Param[2]: posY (type: int) + Param[3]: width (type: int) + Param[4]: height (type: int) + Param[5]: color (type: Color) +Function 236: 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 237: 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 238: DrawRectanglePro() (4 input parameters) + Name: DrawRectanglePro + Return type: void + Description: Draw a color-filled rectangle with pro parameters + Param[1]: rec (type: Rectangle) + Param[2]: origin (type: Vector2) + Param[3]: rotation (type: float) + Param[4]: color (type: Color) +Function 239: DrawRectangleGradientV() (6 input parameters) + Name: DrawRectangleGradientV + Return type: void + Description: Draw a vertical-gradient-filled rectangle + Param[1]: posX (type: int) + Param[2]: posY (type: int) + Param[3]: width (type: int) + Param[4]: height (type: int) + Param[5]: top (type: Color) + Param[6]: bottom (type: Color) +Function 240: DrawRectangleGradientH() (6 input parameters) + Name: DrawRectangleGradientH + Return type: void + Description: Draw a horizontal-gradient-filled rectangle + Param[1]: posX (type: int) + Param[2]: posY (type: int) + Param[3]: width (type: int) + Param[4]: height (type: int) + Param[5]: left (type: Color) + Param[6]: right (type: Color) +Function 241: DrawRectangleGradientEx() (5 input parameters) + Name: DrawRectangleGradientEx + Return type: void + Description: Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order + Param[1]: rec (type: Rectangle) + Param[2]: topLeft (type: Color) + Param[3]: bottomLeft (type: Color) + Param[4]: bottomRight (type: Color) + Param[5]: topRight (type: Color) +Function 242: DrawRectangleLines() (5 input parameters) + Name: DrawRectangleLines + Return type: void + Description: Draw rectangle outline + Param[1]: posX (type: int) + Param[2]: posY (type: int) + Param[3]: width (type: int) + Param[4]: height (type: int) + Param[5]: color (type: Color) +Function 243: DrawRectangleLinesEx() (3 input parameters) + Name: DrawRectangleLinesEx + Return type: void + Description: Draw rectangle outline with line thickness + Param[1]: rec (type: Rectangle) + Param[2]: thick (type: float) + Param[3]: color (type: Color) +Function 244: DrawRectangleRounded() (4 input parameters) + Name: DrawRectangleRounded + Return type: void + Description: Draw rectangle with rounded edges + Param[1]: rec (type: Rectangle) + Param[2]: roundness (type: float) + Param[3]: segments (type: int) + Param[4]: color (type: Color) +Function 245: DrawRectangleRoundedLines() (4 input parameters) + Name: DrawRectangleRoundedLines + Return type: void + Description: Draw rectangle lines with rounded edges + Param[1]: rec (type: Rectangle) + Param[2]: roundness (type: float) + Param[3]: segments (type: int) + Param[4]: color (type: Color) +Function 246: DrawRectangleRoundedLinesEx() (5 input parameters) + Name: DrawRectangleRoundedLinesEx + Return type: void + Description: Draw rectangle lines with rounded edges outline and line thickness + Param[1]: rec (type: Rectangle) + Param[2]: roundness (type: float) + Param[3]: segments (type: int) + Param[4]: thick (type: float) + Param[5]: color (type: Color) +Function 247: DrawPoly() (5 input parameters) + Name: DrawPoly + Return type: void + Description: Draw a polygon of n sides + Param[1]: center (type: Vector2) + Param[2]: sides (type: int) + Param[3]: radius (type: float) + Param[4]: rotation (type: float) + Param[5]: color (type: Color) +Function 248: DrawPolyLines() (5 input parameters) + Name: DrawPolyLines + Return type: void + Description: Draw a polygon outline of n sides + Param[1]: center (type: Vector2) + Param[2]: sides (type: int) + Param[3]: radius (type: float) + Param[4]: rotation (type: float) + Param[5]: color (type: Color) +Function 249: DrawPolyLinesEx() (6 input parameters) + Name: DrawPolyLinesEx + Return type: void + Description: Draw a polygon outline of n sides with line thickness + Param[1]: center (type: Vector2) + Param[2]: sides (type: int) + Param[3]: radius (type: float) + Param[4]: rotation (type: float) + Param[5]: thick (type: float) + Param[6]: color (type: Color) +Function 250: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2262,14 +2430,14 @@ Function 230: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 231: DrawCircleV() (3 input parameters) +Function 251: 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 232: DrawCircleGradient() (4 input parameters) +Function 252: DrawCircleGradient() (4 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2277,7 +2445,7 @@ Function 232: DrawCircleGradient() (4 input parameters) Param[2]: radius (type: float) Param[3]: inner (type: Color) Param[4]: outer (type: Color) -Function 233: DrawCircleSector() (6 input parameters) +Function 253: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2287,7 +2455,7 @@ Function 233: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 234: DrawCircleSectorLines() (6 input parameters) +Function 254: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2297,7 +2465,7 @@ Function 234: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 235: DrawCircleLines() (4 input parameters) +Function 255: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2305,14 +2473,14 @@ Function 235: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 236: DrawCircleLinesV() (3 input parameters) +Function 256: 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 237: DrawEllipse() (5 input parameters) +Function 257: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2321,7 +2489,7 @@ Function 237: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 238: DrawEllipseV() (4 input parameters) +Function 258: DrawEllipseV() (4 input parameters) Name: DrawEllipseV Return type: void Description: Draw ellipse (Vector version) @@ -2329,7 +2497,7 @@ Function 238: DrawEllipseV() (4 input parameters) Param[2]: radiusH (type: float) Param[3]: radiusV (type: float) Param[4]: color (type: Color) -Function 239: DrawEllipseLines() (5 input parameters) +Function 259: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2338,7 +2506,7 @@ Function 239: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 240: DrawEllipseLinesV() (4 input parameters) +Function 260: DrawEllipseLinesV() (4 input parameters) Name: DrawEllipseLinesV Return type: void Description: Draw ellipse outline (Vector version) @@ -2346,7 +2514,7 @@ Function 240: DrawEllipseLinesV() (4 input parameters) Param[2]: radiusH (type: float) Param[3]: radiusV (type: float) Param[4]: color (type: Color) -Function 241: DrawRing() (7 input parameters) +Function 261: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2357,7 +2525,7 @@ Function 241: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 242: DrawRingLines() (7 input parameters) +Function 262: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2368,174 +2536,6 @@ Function 242: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 243: DrawRectangle() (5 input parameters) - Name: DrawRectangle - Return type: void - Description: Draw a color-filled rectangle - Param[1]: posX (type: int) - Param[2]: posY (type: int) - Param[3]: width (type: int) - Param[4]: height (type: int) - Param[5]: color (type: Color) -Function 244: 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 245: 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 246: DrawRectanglePro() (4 input parameters) - Name: DrawRectanglePro - Return type: void - Description: Draw a color-filled rectangle with pro parameters - Param[1]: rec (type: Rectangle) - Param[2]: origin (type: Vector2) - Param[3]: rotation (type: float) - Param[4]: color (type: Color) -Function 247: DrawRectangleGradientV() (6 input parameters) - Name: DrawRectangleGradientV - Return type: void - Description: Draw a vertical-gradient-filled rectangle - Param[1]: posX (type: int) - Param[2]: posY (type: int) - Param[3]: width (type: int) - Param[4]: height (type: int) - Param[5]: top (type: Color) - Param[6]: bottom (type: Color) -Function 248: DrawRectangleGradientH() (6 input parameters) - Name: DrawRectangleGradientH - Return type: void - Description: Draw a horizontal-gradient-filled rectangle - Param[1]: posX (type: int) - Param[2]: posY (type: int) - Param[3]: width (type: int) - Param[4]: height (type: int) - Param[5]: left (type: Color) - Param[6]: right (type: Color) -Function 249: DrawRectangleGradientEx() (5 input parameters) - Name: DrawRectangleGradientEx - Return type: void - Description: Draw a gradient-filled rectangle with custom vertex colors - Param[1]: rec (type: Rectangle) - Param[2]: topLeft (type: Color) - Param[3]: bottomLeft (type: Color) - Param[4]: bottomRight (type: Color) - Param[5]: topRight (type: Color) -Function 250: DrawRectangleLines() (5 input parameters) - Name: DrawRectangleLines - Return type: void - Description: Draw rectangle outline - Param[1]: posX (type: int) - Param[2]: posY (type: int) - Param[3]: width (type: int) - Param[4]: height (type: int) - Param[5]: color (type: Color) -Function 251: 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 252: DrawRectangleRounded() (4 input parameters) - Name: DrawRectangleRounded - Return type: void - Description: Draw rectangle with rounded edges - Param[1]: rec (type: Rectangle) - Param[2]: roundness (type: float) - Param[3]: segments (type: int) - Param[4]: color (type: Color) -Function 253: DrawRectangleRoundedLines() (4 input parameters) - Name: DrawRectangleRoundedLines - Return type: void - Description: Draw rectangle lines with rounded edges - Param[1]: rec (type: Rectangle) - Param[2]: roundness (type: float) - Param[3]: segments (type: int) - Param[4]: color (type: Color) -Function 254: DrawRectangleRoundedLinesEx() (5 input parameters) - Name: DrawRectangleRoundedLinesEx - Return type: void - Description: Draw rectangle lines with rounded edges outline - Param[1]: rec (type: Rectangle) - Param[2]: roundness (type: float) - Param[3]: segments (type: int) - Param[4]: lineThick (type: float) - Param[5]: color (type: Color) -Function 255: DrawTriangle() (4 input parameters) - Name: DrawTriangle - Return type: void - Description: Draw a color-filled triangle (vertex in counter-clockwise order!) - Param[1]: v1 (type: Vector2) - Param[2]: v2 (type: Vector2) - Param[3]: v3 (type: Vector2) - Param[4]: color (type: Color) -Function 256: DrawTriangleGradient() (6 input parameters) - Name: DrawTriangleGradient - Return type: void - Description: Draw triangle with interpolated colors (vertex in counter-clockwise order!) - Param[1]: v1 (type: Vector2) - Param[2]: v2 (type: Vector2) - Param[3]: v3 (type: Vector2) - Param[4]: c1 (type: Color) - Param[5]: c2 (type: Color) - Param[6]: c3 (type: Color) -Function 257: DrawTriangleLines() (4 input parameters) - Name: DrawTriangleLines - Return type: void - Description: Draw triangle outline (vertex in counter-clockwise order!) - Param[1]: v1 (type: Vector2) - Param[2]: v2 (type: Vector2) - Param[3]: v3 (type: Vector2) - Param[4]: color (type: Color) -Function 258: 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: const Vector2 *) - Param[2]: pointCount (type: int) - Param[3]: color (type: Color) -Function 259: DrawTriangleStrip() (3 input parameters) - Name: DrawTriangleStrip - Return type: void - Description: Draw a triangle strip defined by points - Param[1]: points (type: const Vector2 *) - Param[2]: pointCount (type: int) - Param[3]: color (type: Color) -Function 260: DrawPoly() (5 input parameters) - Name: DrawPoly - Return type: void - Description: Draw a polygon of n sides - Param[1]: center (type: Vector2) - Param[2]: sides (type: int) - Param[3]: radius (type: float) - Param[4]: rotation (type: float) - Param[5]: color (type: Color) -Function 261: DrawPolyLines() (5 input parameters) - Name: DrawPolyLines - Return type: void - Description: Draw a polygon outline of n sides - Param[1]: center (type: Vector2) - Param[2]: sides (type: int) - Param[3]: radius (type: float) - Param[4]: rotation (type: float) - Param[5]: color (type: Color) -Function 262: DrawPolyLinesEx() (6 input parameters) - Name: DrawPolyLinesEx - Return type: void - Description: Draw a polygon outline of n sides with extended parameters - Param[1]: center (type: Vector2) - Param[2]: sides (type: int) - Param[3]: radius (type: float) - Param[4]: rotation (type: float) - Param[5]: lineThick (type: float) - Param[6]: color (type: Color) Function 263: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void @@ -3163,84 +3163,7 @@ Function 351: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 352: ImageDrawCircle() (5 input parameters) - Name: ImageDrawCircle - Return type: void - Description: Draw a filled circle within an image - Param[1]: dst (type: Image *) - Param[2]: centerX (type: int) - Param[3]: centerY (type: int) - Param[4]: radius (type: int) - Param[5]: color (type: Color) -Function 353: ImageDrawCircleV() (4 input parameters) - Name: ImageDrawCircleV - Return type: void - Description: Draw a filled circle within an image (Vector version) - Param[1]: dst (type: Image *) - Param[2]: center (type: Vector2) - Param[3]: radius (type: int) - Param[4]: color (type: Color) -Function 354: ImageDrawCircleLines() (5 input parameters) - Name: ImageDrawCircleLines - Return type: void - Description: Draw circle outline within an image - Param[1]: dst (type: Image *) - Param[2]: centerX (type: int) - Param[3]: centerY (type: int) - Param[4]: radius (type: int) - Param[5]: color (type: Color) -Function 355: ImageDrawCircleLinesV() (4 input parameters) - Name: ImageDrawCircleLinesV - Return type: void - Description: Draw circle outline within an image (Vector version) - Param[1]: dst (type: Image *) - Param[2]: center (type: Vector2) - Param[3]: radius (type: int) - Param[4]: color (type: Color) -Function 356: ImageDrawRectangle() (6 input parameters) - Name: ImageDrawRectangle - Return type: void - Description: Draw rectangle within an image - Param[1]: dst (type: Image *) - Param[2]: posX (type: int) - Param[3]: posY (type: int) - Param[4]: width (type: int) - Param[5]: height (type: int) - Param[6]: color (type: Color) -Function 357: ImageDrawRectangleV() (4 input parameters) - Name: ImageDrawRectangleV - Return type: void - Description: Draw rectangle within an image (Vector version) - Param[1]: dst (type: Image *) - Param[2]: position (type: Vector2) - Param[3]: size (type: Vector2) - Param[4]: color (type: Color) -Function 358: 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 359: ImageDrawRectangleLines() (6 input parameters) - Name: ImageDrawRectangleLines - Return type: void - Description: Draw rectangle lines within an image - Param[1]: dst (type: Image *) - Param[2]: posX (type: int) - Param[3]: posY (type: int) - Param[4]: width (type: int) - Param[5]: height (type: int) - Param[6]: color (type: Color) -Function 360: ImageDrawRectangleLinesEx() (4 input parameters) - Name: ImageDrawRectangleLinesEx - Return type: void - Description: Draw rectangle lines within an image with extended parameters - Param[1]: dst (type: Image *) - Param[2]: rec (type: Rectangle) - Param[3]: thick (type: int) - Param[4]: color (type: Color) -Function 361: ImageDrawTriangle() (5 input parameters) +Function 352: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3249,7 +3172,7 @@ Function 361: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 362: ImageDrawTriangleGradient() (7 input parameters) +Function 353: ImageDrawTriangleGradient() (7 input parameters) Name: ImageDrawTriangleGradient Return type: void Description: Draw triangle with interpolated colors within an image @@ -3260,7 +3183,7 @@ Function 362: ImageDrawTriangleGradient() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 363: ImageDrawTriangleLines() (5 input parameters) +Function 354: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3269,7 +3192,7 @@ Function 363: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 364: ImageDrawTriangleFan() (4 input parameters) +Function 355: 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) @@ -3277,7 +3200,7 @@ Function 364: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 365: ImageDrawTriangleStrip() (4 input parameters) +Function 356: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3285,7 +3208,7 @@ Function 365: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 366: ImageDraw() (5 input parameters) +Function 357: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3294,7 +3217,93 @@ Function 366: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 367: ImageDrawText() (6 input parameters) +Function 358: ImageDrawRectangle() (6 input parameters) + Name: ImageDrawRectangle + Return type: void + Description: Draw rectangle within an image + Param[1]: dst (type: Image *) + Param[2]: posX (type: int) + Param[3]: posY (type: int) + Param[4]: width (type: int) + Param[5]: height (type: int) + Param[6]: color (type: Color) +Function 359: ImageDrawRectangleV() (4 input parameters) + Name: ImageDrawRectangleV + Return type: void + Description: Draw rectangle within an image (Vector version) + Param[1]: dst (type: Image *) + Param[2]: position (type: Vector2) + Param[3]: size (type: Vector2) + Param[4]: color (type: Color) +Function 360: 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 361: ImageDrawRectangleLines() (6 input parameters) + Name: ImageDrawRectangleLines + Return type: void + Description: Draw rectangle lines within an image + Param[1]: dst (type: Image *) + Param[2]: posX (type: int) + Param[3]: posY (type: int) + Param[4]: width (type: int) + Param[5]: height (type: int) + Param[6]: color (type: Color) +Function 362: ImageDrawRectangleLinesEx() (4 input parameters) + Name: ImageDrawRectangleLinesEx + Return type: void + Description: Draw rectangle lines within an image with line thickness + Param[1]: dst (type: Image *) + Param[2]: rec (type: Rectangle) + Param[3]: thick (type: int) + Param[4]: color (type: Color) +Function 363: ImageDrawCircle() (5 input parameters) + Name: ImageDrawCircle + Return type: void + Description: Draw a filled circle within an image + Param[1]: dst (type: Image *) + Param[2]: centerX (type: int) + Param[3]: centerY (type: int) + Param[4]: radius (type: int) + Param[5]: color (type: Color) +Function 364: ImageDrawCircleV() (4 input parameters) + Name: ImageDrawCircleV + Return type: void + Description: Draw a filled circle within an image (Vector version) + Param[1]: dst (type: Image *) + Param[2]: center (type: Vector2) + Param[3]: radius (type: int) + Param[4]: color (type: Color) +Function 365: ImageDrawCircleLines() (5 input parameters) + Name: ImageDrawCircleLines + Return type: void + Description: Draw circle outline within an image + Param[1]: dst (type: Image *) + Param[2]: centerX (type: int) + Param[3]: centerY (type: int) + Param[4]: radius (type: int) + Param[5]: color (type: Color) +Function 366: ImageDrawCircleLinesV() (4 input parameters) + Name: ImageDrawCircleLinesV + Return type: void + Description: Draw circle outline within an image (Vector version) + Param[1]: dst (type: Image *) + Param[2]: center (type: Vector2) + Param[3]: radius (type: int) + Param[4]: color (type: Color) +Function 367: ImageDraw() (5 input parameters) + Name: ImageDraw + Return type: void + Description: Draw a source image into a destination image (tint applied to source) + Param[1]: dst (type: Image *) + Param[2]: src (type: Image) + Param[3]: srcRec (type: Rectangle) + Param[4]: dstRec (type: Rectangle) + Param[5]: tint (type: Color) +Function 368: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3304,7 +3313,7 @@ Function 367: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 368: ImageDrawTextEx() (7 input parameters) +Function 369: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3315,79 +3324,79 @@ Function 368: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 369: LoadTexture() (1 input parameters) +Function 370: 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 370: LoadTextureFromImage() (1 input parameters) +Function 371: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 371: LoadTextureCubemap() (2 input parameters) +Function 372: 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 372: LoadRenderTexture() (2 input parameters) +Function 373: 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 373: IsTextureValid() (1 input parameters) +Function 374: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 374: UnloadTexture() (1 input parameters) +Function 375: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 375: IsRenderTextureValid() (1 input parameters) +Function 376: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 376: UnloadRenderTexture() (1 input parameters) +Function 377: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 377: UpdateTexture() (2 input parameters) +Function 378: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 378: UpdateTextureRec() (3 input parameters) +Function 379: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 379: GenTextureMipmaps() (1 input parameters) +Function 380: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 380: SetTextureFilter() (2 input parameters) +Function 381: 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 381: SetTextureWrap() (2 input parameters) +Function 382: 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 382: DrawTexture() (4 input parameters) +Function 383: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3395,14 +3404,14 @@ Function 382: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 383: DrawTextureV() (3 input parameters) +Function 384: 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 384: DrawTextureEx() (5 input parameters) +Function 385: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with rotation and scale @@ -3411,7 +3420,7 @@ Function 384: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 385: DrawTextureRec() (4 input parameters) +Function 386: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3419,7 +3428,7 @@ Function 385: DrawTextureRec() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 386: DrawTexturePro() (6 input parameters) +Function 387: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation @@ -3429,7 +3438,7 @@ Function 386: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 387: DrawTextureNPatch() (6 input parameters) +Function 388: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draw a texture (or part of it) that stretches or shrinks nicely @@ -3439,119 +3448,119 @@ Function 387: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 388: ColorIsEqual() (2 input parameters) +Function 389: 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 389: Fade() (2 input parameters) +Function 390: 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 390: ColorToInt() (1 input parameters) +Function 391: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 391: ColorNormalize() (1 input parameters) +Function 392: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 392: ColorFromNormalized() (1 input parameters) +Function 393: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 393: ColorToHSV() (1 input parameters) +Function 394: 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 394: ColorFromHSV() (3 input parameters) +Function 395: 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 395: ColorTint() (2 input parameters) +Function 396: 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 396: ColorBrightness() (2 input parameters) +Function 397: 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 397: ColorContrast() (2 input parameters) +Function 398: 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 398: ColorAlpha() (2 input parameters) +Function 399: 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 399: ColorAlphaBlend() (3 input parameters) +Function 400: 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 400: ColorLerp() (3 input parameters) +Function 401: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 401: GetColor() (1 input parameters) +Function 402: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 402: GetPixelColor() (2 input parameters) +Function 403: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) -Function 403: SetPixelColor() (3 input parameters) +Function 404: 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 404: GetPixelDataSize() (3 input parameters) +Function 405: 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 405: GetFontDefault() (0 input parameters) +Function 406: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 406: LoadFont() (1 input parameters) +Function 407: 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 407: LoadFontEx() (4 input parameters) +Function 408: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3559,14 +3568,14 @@ Function 407: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) Param[4]: codepointCount (type: int) -Function 408: LoadFontFromImage() (3 input parameters) +Function 409: 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 409: LoadFontFromMemory() (6 input parameters) +Function 410: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3576,12 +3585,12 @@ Function 409: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: const int *) Param[6]: codepointCount (type: int) -Function 410: IsFontValid() (1 input parameters) +Function 411: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 411: LoadFontData() (7 input parameters) +Function 412: LoadFontData() (7 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3592,7 +3601,7 @@ Function 411: LoadFontData() (7 input parameters) Param[5]: codepointCount (type: int) Param[6]: type (type: int) Param[7]: glyphCount (type: int *) -Function 412: GenImageFontAtlas() (6 input parameters) +Function 413: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3602,30 +3611,30 @@ Function 412: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 413: UnloadFontData() (2 input parameters) +Function 414: 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 414: UnloadFont() (1 input parameters) +Function 415: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 415: ExportFontAsCode() (2 input parameters) +Function 416: 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 416: DrawFPS() (2 input parameters) +Function 417: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 417: DrawText() (5 input parameters) +Function 418: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3634,7 +3643,7 @@ Function 417: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 418: DrawTextEx() (6 input parameters) +Function 419: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3644,7 +3653,7 @@ Function 418: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 419: DrawTextPro() (8 input parameters) +Function 420: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3656,7 +3665,7 @@ Function 419: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 420: DrawTextCodepoint() (5 input parameters) +Function 421: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3665,7 +3674,7 @@ Function 420: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 421: DrawTextCodepoints() (7 input parameters) +Function 422: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple characters (codepoint) @@ -3676,18 +3685,18 @@ Function 421: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 422: SetTextLineSpacing() (1 input parameters) +Function 423: 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 423: MeasureText() (2 input parameters) +Function 424: 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 424: MeasureTextEx() (4 input parameters) +Function 425: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3695,7 +3704,7 @@ Function 424: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 425: MeasureTextCodepoints() (5 input parameters) +Function 426: MeasureTextCodepoints() (5 input parameters) Name: MeasureTextCodepoints Return type: Vector2 Description: Measure string size for an existing array of codepoints for Font @@ -3704,144 +3713,144 @@ Function 425: MeasureTextCodepoints() (5 input parameters) Param[3]: length (type: int) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) -Function 426: GetGlyphIndex() (2 input parameters) +Function 427: 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 427: GetGlyphInfo() (2 input parameters) +Function 428: 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 428: GetGlyphAtlasRec() (2 input parameters) +Function 429: 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 429: LoadUTF8() (2 input parameters) +Function 430: 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 430: UnloadUTF8() (1 input parameters) +Function 431: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 431: LoadCodepoints() (2 input parameters) +Function 432: 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 432: UnloadCodepoints() (1 input parameters) +Function 433: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 433: GetCodepointCount() (1 input parameters) +Function 434: 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 434: GetCodepoint() (2 input parameters) +Function 435: 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 435: GetCodepointNext() (2 input parameters) +Function 436: 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 436: GetCodepointPrevious() (2 input parameters) +Function 437: 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 437: CodepointToUTF8() (2 input parameters) +Function 438: 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 438: LoadTextLines() (2 input parameters) +Function 439: LoadTextLines() (2 input parameters) Name: LoadTextLines Return type: char ** Description: Load text as separate lines ('\n') Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 439: UnloadTextLines() (2 input parameters) +Function 440: UnloadTextLines() (2 input parameters) Name: UnloadTextLines Return type: void Description: Unload text lines Param[1]: text (type: char **) Param[2]: lineCount (type: int) -Function 440: TextCopy() (2 input parameters) +Function 441: 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 441: TextIsEqual() (2 input parameters) +Function 442: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text strings are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 442: TextLength() (1 input parameters) +Function 443: 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 443: TextFormat() (2 input parameters) +Function 444: 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 444: TextSubtext() (3 input parameters) +Function 445: 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 445: TextRemoveSpaces() (1 input parameters) +Function 446: TextRemoveSpaces() (1 input parameters) Name: TextRemoveSpaces Return type: const char * Description: Remove text spaces, concat words Param[1]: text (type: const char *) -Function 446: GetTextBetween() (3 input parameters) +Function 447: GetTextBetween() (3 input parameters) Name: GetTextBetween Return type: char * Description: Get text between two strings Param[1]: text (type: const char *) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) -Function 447: TextReplace() (3 input parameters) +Function 448: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string with new string Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 448: TextReplaceAlloc() (3 input parameters) +Function 449: TextReplaceAlloc() (3 input parameters) Name: TextReplaceAlloc Return type: char * Description: Replace text string with new string, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 449: TextReplaceBetween() (4 input parameters) +Function 450: TextReplaceBetween() (4 input parameters) Name: TextReplaceBetween Return type: char * Description: Replace text between two specific strings @@ -3849,7 +3858,7 @@ Function 449: TextReplaceBetween() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 450: TextReplaceBetweenAlloc() (4 input parameters) +Function 451: TextReplaceBetweenAlloc() (4 input parameters) Name: TextReplaceBetweenAlloc Return type: char * Description: Replace text between two specific strings, memory must be MemFree() @@ -3857,96 +3866,96 @@ Function 450: TextReplaceBetweenAlloc() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 451: TextInsert() (3 input parameters) +Function 452: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a defined byte position Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 452: TextInsertAlloc() (3 input parameters) +Function 453: TextInsertAlloc() (3 input parameters) Name: TextInsertAlloc Return type: char * Description: Insert text in a defined byte position, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 453: TextJoin() (3 input parameters) +Function 454: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 454: TextSplit() (3 input parameters) +Function 455: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 455: TextAppend() (3 input parameters) +Function 456: 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 456: TextFindIndex() (2 input parameters) +Function 457: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string, -1 if not found Param[1]: text (type: const char *) Param[2]: search (type: const char *) -Function 457: TextToUpper() (1 input parameters) +Function 458: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 458: TextToLower() (1 input parameters) +Function 459: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 459: TextToPascal() (1 input parameters) +Function 460: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 460: TextToSnake() (1 input parameters) +Function 461: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 461: TextToCamel() (1 input parameters) +Function 462: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 462: TextToInteger() (1 input parameters) +Function 463: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 463: TextToFloat() (1 input parameters) +Function 464: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 464: DrawLine3D() (3 input parameters) +Function 465: 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 465: DrawPoint3D() (2 input parameters) +Function 466: 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 466: DrawCircle3D() (5 input parameters) +Function 467: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3955,7 +3964,7 @@ Function 466: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 467: DrawTriangle3D() (4 input parameters) +Function 468: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -3963,14 +3972,14 @@ Function 467: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 468: DrawTriangleStrip3D() (3 input parameters) +Function 469: 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 469: DrawCube() (5 input parameters) +Function 470: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3979,14 +3988,14 @@ Function 469: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 470: DrawCubeV() (3 input parameters) +Function 471: 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 471: DrawCubeWires() (5 input parameters) +Function 472: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3995,21 +4004,21 @@ Function 471: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 472: DrawCubeWiresV() (3 input parameters) +Function 473: 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 473: DrawSphere() (3 input parameters) +Function 474: 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 474: DrawSphereEx() (5 input parameters) +Function 475: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with defined rings and slices @@ -4018,7 +4027,7 @@ Function 474: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 475: DrawSphereWires() (5 input parameters) +Function 476: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -4027,7 +4036,7 @@ Function 475: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 476: DrawCylinder() (6 input parameters) +Function 477: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -4037,7 +4046,7 @@ Function 476: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 477: DrawCylinderEx() (6 input parameters) +Function 478: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -4047,7 +4056,7 @@ Function 477: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 478: DrawCylinderWires() (6 input parameters) +Function 479: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -4057,7 +4066,7 @@ Function 478: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 479: DrawCylinderWiresEx() (6 input parameters) +Function 480: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -4067,7 +4076,7 @@ Function 479: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 480: DrawCapsule() (6 input parameters) +Function 481: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -4077,7 +4086,7 @@ Function 480: DrawCapsule() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 481: DrawCapsuleWires() (6 input parameters) +Function 482: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -4087,51 +4096,51 @@ Function 481: DrawCapsuleWires() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 482: DrawPlane() (3 input parameters) +Function 483: 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 483: DrawRay() (2 input parameters) +Function 484: 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 484: DrawGrid() (2 input parameters) +Function 485: 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 485: LoadModel() (1 input parameters) +Function 486: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 486: LoadModelFromMesh() (1 input parameters) +Function 487: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 487: IsModelValid() (1 input parameters) +Function 488: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 488: UnloadModel() (1 input parameters) +Function 489: 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 489: GetModelBoundingBox() (1 input parameters) +Function 490: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 490: DrawModel() (4 input parameters) +Function 491: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -4139,7 +4148,7 @@ Function 490: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 491: DrawModelEx() (6 input parameters) +Function 492: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with custom transform @@ -4149,7 +4158,7 @@ Function 491: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 492: DrawModelWires() (4 input parameters) +Function 493: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4157,7 +4166,7 @@ Function 492: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 493: DrawModelWiresEx() (6 input parameters) +Function 494: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires with custom transform @@ -4167,13 +4176,13 @@ Function 493: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 494: DrawBoundingBox() (2 input parameters) +Function 495: 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 495: DrawBillboard() (5 input parameters) +Function 496: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4182,7 +4191,7 @@ Function 495: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 496: DrawBillboardRec() (6 input parameters) +Function 497: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by rectangle @@ -4192,7 +4201,7 @@ Function 496: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 497: DrawBillboardPro() (9 input parameters) +Function 498: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source rectangle with scaling and rotation @@ -4205,13 +4214,13 @@ Function 497: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 498: UploadMesh() (2 input parameters) +Function 499: 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 499: UpdateMeshBuffer() (5 input parameters) +Function 500: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4220,19 +4229,19 @@ Function 499: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 500: UnloadMesh() (1 input parameters) +Function 501: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 501: DrawMesh() (3 input parameters) +Function 502: 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 502: DrawMeshInstanced() (4 input parameters) +Function 503: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4240,35 +4249,35 @@ Function 502: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 503: GetMeshBoundingBox() (1 input parameters) +Function 504: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 504: GenMeshTangents() (1 input parameters) +Function 505: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 505: ExportMesh() (2 input parameters) +Function 506: 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 506: ExportMeshAsCode() (2 input parameters) +Function 507: 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 507: GenMeshPoly() (2 input parameters) +Function 508: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 508: GenMeshPlane() (4 input parameters) +Function 509: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4276,42 +4285,42 @@ Function 508: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 509: GenMeshCube() (3 input parameters) +Function 510: 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 510: GenMeshSphere() (3 input parameters) +Function 511: 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 511: GenMeshHemiSphere() (3 input parameters) +Function 512: 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 512: GenMeshCylinder() (3 input parameters) +Function 513: 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 513: GenMeshCone() (3 input parameters) +Function 514: 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 514: GenMeshTorus() (4 input parameters) +Function 515: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4319,7 +4328,7 @@ Function 514: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 515: GenMeshKnot() (4 input parameters) +Function 516: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4327,67 +4336,67 @@ Function 515: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 516: GenMeshHeightmap() (2 input parameters) +Function 517: 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 517: GenMeshCubicmap() (2 input parameters) +Function 518: 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 518: LoadMaterials() (2 input parameters) +Function 519: 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 519: LoadMaterialDefault() (0 input parameters) +Function 520: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 520: IsMaterialValid() (1 input parameters) +Function 521: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 521: UnloadMaterial() (1 input parameters) +Function 522: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 522: SetMaterialTexture() (3 input parameters) +Function 523: 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 523: SetModelMeshMaterial() (3 input parameters) +Function 524: 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 524: LoadModelAnimations() (2 input parameters) +Function 525: 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 525: UpdateModelAnimation() (3 input parameters) +Function 526: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (vertex buffers and bone matrices) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: float) -Function 526: UpdateModelAnimationEx() (6 input parameters) +Function 527: UpdateModelAnimationEx() (6 input parameters) Name: UpdateModelAnimationEx Return type: void Description: Update model animation pose, blending two animations @@ -4397,19 +4406,19 @@ Function 526: UpdateModelAnimationEx() (6 input parameters) Param[4]: animB (type: ModelAnimation) Param[5]: frameB (type: float) Param[6]: blend (type: float) -Function 527: UnloadModelAnimations() (2 input parameters) +Function 528: 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 528: IsModelAnimationValid() (2 input parameters) +Function 529: 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 529: CheckCollisionSpheres() (4 input parameters) +Function 530: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4417,40 +4426,40 @@ Function 529: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 530: CheckCollisionBoxes() (2 input parameters) +Function 531: 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 531: CheckCollisionBoxSphere() (3 input parameters) +Function 532: 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 532: GetRayCollisionSphere() (3 input parameters) +Function 533: 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 533: GetRayCollisionBox() (2 input parameters) +Function 534: 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 534: GetRayCollisionMesh() (3 input parameters) +Function 535: 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 535: GetRayCollisionTriangle() (4 input parameters) +Function 536: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4458,7 +4467,7 @@ Function 535: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 536: GetRayCollisionQuad() (5 input parameters) +Function 537: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4467,158 +4476,158 @@ Function 536: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 537: InitAudioDevice() (0 input parameters) +Function 538: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 538: CloseAudioDevice() (0 input parameters) +Function 539: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 539: IsAudioDeviceReady() (0 input parameters) +Function 540: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 540: SetMasterVolume() (1 input parameters) +Function 541: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 541: GetMasterVolume() (0 input parameters) +Function 542: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 542: LoadWave() (1 input parameters) +Function 543: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 543: LoadWaveFromMemory() (3 input parameters) +Function 544: 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 544: IsWaveValid() (1 input parameters) +Function 545: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Check if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 545: LoadSound() (1 input parameters) +Function 546: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 546: LoadSoundFromWave() (1 input parameters) +Function 547: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 547: LoadSoundAlias() (1 input parameters) +Function 548: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 548: IsSoundValid() (1 input parameters) +Function 549: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 549: UpdateSound() (3 input parameters) +Function 550: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 550: UnloadWave() (1 input parameters) +Function 551: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 551: UnloadSound() (1 input parameters) +Function 552: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 552: UnloadSoundAlias() (1 input parameters) +Function 553: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 553: ExportWave() (2 input parameters) +Function 554: 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 554: ExportWaveAsCode() (2 input parameters) +Function 555: 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 555: PlaySound() (1 input parameters) +Function 556: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 556: StopSound() (1 input parameters) +Function 557: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 557: PauseSound() (1 input parameters) +Function 558: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 558: ResumeSound() (1 input parameters) +Function 559: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 559: IsSoundPlaying() (1 input parameters) +Function 560: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if sound is currently playing Param[1]: sound (type: Sound) -Function 560: SetSoundVolume() (2 input parameters) +Function 561: 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 561: SetSoundPitch() (2 input parameters) +Function 562: 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 562: SetSoundPan() (2 input parameters) +Function 563: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 563: WaveCopy() (1 input parameters) +Function 564: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 564: WaveCrop() (3 input parameters) +Function 565: 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 565: WaveFormat() (4 input parameters) +Function 566: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4626,203 +4635,203 @@ Function 565: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 566: LoadWaveSamples() (1 input parameters) +Function 567: 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 567: UnloadWaveSamples() (1 input parameters) +Function 568: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 568: LoadMusicStream() (1 input parameters) +Function 569: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 569: LoadMusicStreamFromMemory() (3 input parameters) +Function 570: 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 570: IsMusicValid() (1 input parameters) +Function 571: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 571: UnloadMusicStream() (1 input parameters) +Function 572: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 572: PlayMusicStream() (1 input parameters) +Function 573: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 573: IsMusicStreamPlaying() (1 input parameters) +Function 574: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 574: UpdateMusicStream() (1 input parameters) +Function 575: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Update buffers for music streaming Param[1]: music (type: Music) -Function 575: StopMusicStream() (1 input parameters) +Function 576: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 576: PauseMusicStream() (1 input parameters) +Function 577: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 577: ResumeMusicStream() (1 input parameters) +Function 578: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 578: SeekMusicStream() (2 input parameters) +Function 579: 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 579: SetMusicVolume() (2 input parameters) +Function 580: 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 580: SetMusicPitch() (2 input parameters) +Function 581: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 581: SetMusicPan() (2 input parameters) +Function 582: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 582: GetMusicTimeLength() (1 input parameters) +Function 583: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 583: GetMusicTimePlayed() (1 input parameters) +Function 584: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 584: LoadAudioStream() (3 input parameters) +Function 585: 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 585: IsAudioStreamValid() (1 input parameters) +Function 586: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Check if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 586: UnloadAudioStream() (1 input parameters) +Function 587: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 587: UpdateAudioStream() (3 input parameters) +Function 588: 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 588: IsAudioStreamProcessed() (1 input parameters) +Function 589: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 589: PlayAudioStream() (1 input parameters) +Function 590: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 590: PauseAudioStream() (1 input parameters) +Function 591: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 591: ResumeAudioStream() (1 input parameters) +Function 592: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 592: IsAudioStreamPlaying() (1 input parameters) +Function 593: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 593: StopAudioStream() (1 input parameters) +Function 594: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 594: SetAudioStreamVolume() (2 input parameters) +Function 595: 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 595: SetAudioStreamPitch() (2 input parameters) +Function 596: 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 596: SetAudioStreamPan() (2 input parameters) +Function 597: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 597: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 598: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 598: SetAudioStreamCallback() (2 input parameters) +Function 599: 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 599: AttachAudioStreamProcessor() (2 input parameters) +Function 600: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 600: DetachAudioStreamProcessor() (2 input parameters) +Function 601: 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 601: AttachAudioMixedProcessor() (1 input parameters) +Function 602: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 602: DetachAudioMixedProcessor() (1 input parameters) +Function 603: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 6235a6de8..d7ecaf7d4 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -682,7 +682,7 @@ - + @@ -1403,6 +1403,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1491,134 +1619,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2067,65 +2067,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2168,6 +2109,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d3d1b0cbcc6a612a22c7ea79e9afbf1ad03dfd44 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 18:48:16 +0200 Subject: [PATCH 42/63] ADDED: `DrawCircleLinesEx()`, simpler naming than `DrawRing()` --- src/raylib.h | 1 + src/rshapes.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 4aec696b3..fbca31863 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1307,6 +1307,7 @@ RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, floa RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version) +RLAPI void DrawCircleLinesEx(Vector2 center, float radius, float thick, Color color); // Draw circle outline with line thickness RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse RLAPI void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse (Vector version) RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline diff --git a/src/rshapes.c b/src/rshapes.c index 1cf1af2d0..b6d0f0944 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -510,6 +510,11 @@ void DrawCircleLinesV(Vector2 center, float radius, Color color) rlEnd(); } +void DrawCircleLinesEx(Vector2 center, float radius, float thick, Color color) +{ + DrawRing(center, radius - thick, radius, 0.0f, 360.0f, 36, color); +} + // Draw ellipse void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color) { From 4724e5fec3853062341226b959e461045847be7f Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 18:48:41 +0200 Subject: [PATCH 43/63] ADDED: `ImageDrawLineStrip()` --- src/raylib.h | 1 + src/rtextures.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index fbca31863..857df2217 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1423,6 +1423,7 @@ RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); 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 ImageDrawLineStrip(Image *dst, const Vector2 *points, int pointCount, Color color); // Draw a lines sequence within an image RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image RLAPI void ImageDrawTriangleGradient(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 diff --git a/src/rtextures.c b/src/rtextures.c index 84e4406bc..103309a19 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3609,6 +3609,15 @@ void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color co } } +// Draw a lines sequence within an image +void ImageDrawLineStrip(Image *dst, const Vector2 *points, int pointCount, Color color) +{ + for (int i = 0; i < pointCount - 1; i++) + { + ImageDrawLineV(dst, points[i], points[i + 1], color); + } +} + // Draw circle within an image void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color) { From f5ea52a2b8f07f92d8caa423ff26f4cb065d4700 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 16:49:09 +0000 Subject: [PATCH 44/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 46 ++ tools/rlparser/output/raylib_api.lua | 22 + tools/rlparser/output/raylib_api.txt | 712 +++++++++++++------------- tools/rlparser/output/raylib_api.xml | 14 +- 4 files changed, 445 insertions(+), 349 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 2ab5b39c5..136c500b3 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -6336,6 +6336,29 @@ } ] }, + { + "name": "DrawCircleLinesEx", + "description": "Draw circle outline with line thickness", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "DrawEllipse", "description": "Draw ellipse", @@ -8207,6 +8230,29 @@ } ] }, + { + "name": "ImageDrawLineStrip", + "description": "Draw a lines sequence within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "ImageDrawTriangle", "description": "Draw triangle within an image", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 45f15a56e..76b0e12f3 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -5157,6 +5157,17 @@ return { {type = "Color", name = "color"} } }, + { + name = "DrawCircleLinesEx", + description = "Draw circle outline with line thickness", + returnType = "void", + params = { + {type = "Vector2", name = "center"}, + {type = "float", name = "radius"}, + {type = "float", name = "thick"}, + {type = "Color", name = "color"} + } + }, { name = "DrawEllipse", description = "Draw ellipse", @@ -6122,6 +6133,17 @@ return { {type = "Color", name = "color"} } }, + { + name = "ImageDrawLineStrip", + description = "Draw a lines sequence within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "const Vector2 *", name = "points"}, + {type = "int", name = "pointCount"}, + {type = "Color", name = "color"} + } + }, { name = "ImageDrawTriangle", description = "Draw triangle within an image", diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 2c68bce51..c3516f6fd 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1000,7 +1000,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 603 +Functions found: 605 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -2480,7 +2480,15 @@ Function 256: DrawCircleLinesV() (3 input parameters) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 257: DrawEllipse() (5 input parameters) +Function 257: DrawCircleLinesEx() (4 input parameters) + Name: DrawCircleLinesEx + Return type: void + Description: Draw circle outline with line thickness + Param[1]: center (type: Vector2) + Param[2]: radius (type: float) + Param[3]: thick (type: float) + Param[4]: color (type: Color) +Function 258: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2489,7 +2497,7 @@ Function 257: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 258: DrawEllipseV() (4 input parameters) +Function 259: DrawEllipseV() (4 input parameters) Name: DrawEllipseV Return type: void Description: Draw ellipse (Vector version) @@ -2497,7 +2505,7 @@ Function 258: DrawEllipseV() (4 input parameters) Param[2]: radiusH (type: float) Param[3]: radiusV (type: float) Param[4]: color (type: Color) -Function 259: DrawEllipseLines() (5 input parameters) +Function 260: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2506,7 +2514,7 @@ Function 259: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 260: DrawEllipseLinesV() (4 input parameters) +Function 261: DrawEllipseLinesV() (4 input parameters) Name: DrawEllipseLinesV Return type: void Description: Draw ellipse outline (Vector version) @@ -2514,7 +2522,7 @@ Function 260: DrawEllipseLinesV() (4 input parameters) Param[2]: radiusH (type: float) Param[3]: radiusV (type: float) Param[4]: color (type: Color) -Function 261: DrawRing() (7 input parameters) +Function 262: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2525,7 +2533,7 @@ Function 261: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 262: DrawRingLines() (7 input parameters) +Function 263: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2536,7 +2544,7 @@ Function 262: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 263: DrawSplineLinear() (4 input parameters) +Function 264: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2544,7 +2552,7 @@ Function 263: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 264: DrawSplineBasis() (4 input parameters) +Function 265: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2552,7 +2560,7 @@ Function 264: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 265: DrawSplineCatmullRom() (4 input parameters) +Function 266: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2560,7 +2568,7 @@ Function 265: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 266: DrawSplineBezierQuadratic() (4 input parameters) +Function 267: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2568,7 +2576,7 @@ Function 266: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 267: DrawSplineBezierCubic() (4 input parameters) +Function 268: 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...] @@ -2576,7 +2584,7 @@ Function 267: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 268: DrawSplineSegmentLinear() (4 input parameters) +Function 269: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2584,7 +2592,7 @@ Function 268: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 269: DrawSplineSegmentBasis() (6 input parameters) +Function 270: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2594,7 +2602,7 @@ Function 269: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 270: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 271: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2604,7 +2612,7 @@ Function 270: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 271: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 272: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2613,7 +2621,7 @@ Function 271: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 272: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 273: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2623,14 +2631,14 @@ Function 272: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 273: GetSplinePointLinear() (3 input parameters) +Function 274: 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 274: GetSplinePointBasis() (5 input parameters) +Function 275: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2639,7 +2647,7 @@ Function 274: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 275: GetSplinePointCatmullRom() (5 input parameters) +Function 276: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2648,7 +2656,7 @@ Function 275: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 276: GetSplinePointBezierQuadratic() (4 input parameters) +Function 277: GetSplinePointBezierQuadratic() (4 input parameters) Name: GetSplinePointBezierQuadratic Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2656,7 +2664,7 @@ Function 276: GetSplinePointBezierQuadratic() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 277: GetSplinePointBezierCubic() (5 input parameters) +Function 278: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2665,13 +2673,13 @@ Function 277: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 278: CheckCollisionRecs() (2 input parameters) +Function 279: 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 279: CheckCollisionCircles() (4 input parameters) +Function 280: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2679,14 +2687,14 @@ Function 279: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 280: CheckCollisionCircleRec() (3 input parameters) +Function 281: 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 281: CheckCollisionCircleLine() (4 input parameters) +Function 282: CheckCollisionCircleLine() (4 input parameters) Name: CheckCollisionCircleLine Return type: bool Description: Check if circle collides with a line created between two points [p1] and [p2] @@ -2694,20 +2702,20 @@ Function 281: CheckCollisionCircleLine() (4 input parameters) Param[2]: radius (type: float) Param[3]: p1 (type: Vector2) Param[4]: p2 (type: Vector2) -Function 282: CheckCollisionPointRec() (2 input parameters) +Function 283: 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 283: CheckCollisionPointCircle() (3 input parameters) +Function 284: 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 284: CheckCollisionPointTriangle() (4 input parameters) +Function 285: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2715,7 +2723,7 @@ Function 284: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 285: CheckCollisionPointLine() (4 input parameters) +Function 286: 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] @@ -2723,14 +2731,14 @@ Function 285: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 286: CheckCollisionPointPoly() (3 input parameters) +Function 287: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 287: CheckCollisionLines() (5 input parameters) +Function 288: 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 @@ -2739,18 +2747,18 @@ Function 287: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 288: GetCollisionRec() (2 input parameters) +Function 289: 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 289: LoadImage() (1 input parameters) +Function 290: 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 290: LoadImageRaw() (5 input parameters) +Function 291: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2759,13 +2767,13 @@ Function 290: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 291: LoadImageAnim() (2 input parameters) +Function 292: 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 292: LoadImageAnimFromMemory() (4 input parameters) +Function 293: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2773,60 +2781,60 @@ Function 292: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 293: LoadImageFromMemory() (3 input parameters) +Function 294: 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 294: LoadImageFromTexture() (1 input parameters) +Function 295: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 295: LoadImageFromScreen() (0 input parameters) +Function 296: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer (screenshot) No input parameters -Function 296: IsImageValid() (1 input parameters) +Function 297: IsImageValid() (1 input parameters) Name: IsImageValid Return type: bool Description: Check if an image is valid (data and parameters) Param[1]: image (type: Image) -Function 297: UnloadImage() (1 input parameters) +Function 298: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 298: ExportImage() (2 input parameters) +Function 299: 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 299: ExportImageToMemory() (3 input parameters) +Function 300: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer, memory must be MemFree() Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 300: ExportImageAsCode() (2 input parameters) +Function 301: 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 301: GenImageColor() (3 input parameters) +Function 302: 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 302: GenImageGradientLinear() (5 input parameters) +Function 303: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2835,7 +2843,7 @@ Function 302: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 303: GenImageGradientRadial() (5 input parameters) +Function 304: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2844,7 +2852,7 @@ Function 303: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 304: GenImageGradientSquare() (5 input parameters) +Function 305: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2853,7 +2861,7 @@ Function 304: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 305: GenImageChecked() (6 input parameters) +Function 306: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2863,14 +2871,14 @@ Function 305: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 306: GenImageWhiteNoise() (3 input parameters) +Function 307: 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 307: GenImagePerlinNoise() (5 input parameters) +Function 308: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2879,45 +2887,45 @@ Function 307: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 308: GenImageCellular() (3 input parameters) +Function 309: 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 309: GenImageText() (3 input parameters) +Function 310: 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 310: ImageCopy() (1 input parameters) +Function 311: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 311: ImageFromImage() (2 input parameters) +Function 312: 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 312: ImageFromChannel() (2 input parameters) +Function 313: ImageFromChannel() (2 input parameters) Name: ImageFromChannel Return type: Image Description: Create an image from a selected channel of another image (GRAYSCALE) Param[1]: image (type: Image) Param[2]: selectedChannel (type: int) -Function 313: ImageText() (3 input parameters) +Function 314: 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 314: ImageTextEx() (5 input parameters) +Function 315: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2926,76 +2934,76 @@ Function 314: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 315: ImageFormat() (2 input parameters) +Function 316: 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 316: ImageToPOT() (2 input parameters) +Function 317: 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 317: ImageCrop() (2 input parameters) +Function 318: 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 318: ImageAlphaCrop() (2 input parameters) +Function 319: 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 319: ImageAlphaClear() (3 input parameters) +Function 320: 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 320: ImageAlphaMask() (2 input parameters) +Function 321: 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 321: ImageAlphaPremultiply() (1 input parameters) +Function 322: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 322: ImageBlurGaussian() (2 input parameters) +Function 323: 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 323: ImageKernelConvolution() (3 input parameters) +Function 324: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) -Function 324: ImageResize() (3 input parameters) +Function 325: 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 325: ImageResizeNN() (3 input parameters) +Function 326: 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 326: ImageResizeCanvas() (6 input parameters) +Function 327: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -3005,12 +3013,12 @@ Function 326: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 327: ImageMipmaps() (1 input parameters) +Function 328: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 328: ImageDither() (5 input parameters) +Function 329: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -3019,109 +3027,109 @@ Function 328: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 329: ImageFlipVertical() (1 input parameters) +Function 330: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 330: ImageFlipHorizontal() (1 input parameters) +Function 331: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 331: ImageRotate() (2 input parameters) +Function 332: 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 332: ImageRotateCW() (1 input parameters) +Function 333: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 333: ImageRotateCCW() (1 input parameters) +Function 334: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 334: ImageColorTint() (2 input parameters) +Function 335: 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 335: ImageColorInvert() (1 input parameters) +Function 336: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 336: ImageColorGrayscale() (1 input parameters) +Function 337: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 337: ImageColorContrast() (2 input parameters) +Function 338: 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: int) -Function 338: ImageColorBrightness() (2 input parameters) +Function 339: 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 339: ImageColorReplace() (3 input parameters) +Function 340: 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 340: LoadImageColors() (1 input parameters) +Function 341: 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 341: LoadImagePalette() (3 input parameters) +Function 342: 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 342: UnloadImageColors() (1 input parameters) +Function 343: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 343: UnloadImagePalette() (1 input parameters) +Function 344: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 344: GetImageAlphaBorder() (2 input parameters) +Function 345: 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 345: GetImageColor() (3 input parameters) +Function 346: 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 346: ImageClearBackground() (2 input parameters) +Function 347: 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 347: ImageDrawPixel() (4 input parameters) +Function 348: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -3129,14 +3137,14 @@ Function 347: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 348: ImageDrawPixelV() (3 input parameters) +Function 349: 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 349: ImageDrawLine() (6 input parameters) +Function 350: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3146,7 +3154,7 @@ Function 349: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 350: ImageDrawLineV() (4 input parameters) +Function 351: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3154,7 +3162,7 @@ Function 350: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 351: ImageDrawLineEx() (5 input parameters) +Function 352: ImageDrawLineEx() (5 input parameters) Name: ImageDrawLineEx Return type: void Description: Draw a line defining thickness within an image @@ -3163,7 +3171,15 @@ Function 351: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 352: ImageDrawTriangle() (5 input parameters) +Function 353: ImageDrawLineStrip() (4 input parameters) + Name: ImageDrawLineStrip + Return type: void + Description: Draw a lines sequence within an image + Param[1]: dst (type: Image *) + Param[2]: points (type: const Vector2 *) + Param[3]: pointCount (type: int) + Param[4]: color (type: Color) +Function 354: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3172,7 +3188,7 @@ Function 352: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 353: ImageDrawTriangleGradient() (7 input parameters) +Function 355: ImageDrawTriangleGradient() (7 input parameters) Name: ImageDrawTriangleGradient Return type: void Description: Draw triangle with interpolated colors within an image @@ -3183,7 +3199,7 @@ Function 353: ImageDrawTriangleGradient() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 354: ImageDrawTriangleLines() (5 input parameters) +Function 356: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3192,7 +3208,7 @@ Function 354: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 355: ImageDrawTriangleFan() (4 input parameters) +Function 357: 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) @@ -3200,7 +3216,7 @@ Function 355: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 356: ImageDrawTriangleStrip() (4 input parameters) +Function 358: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3208,7 +3224,7 @@ Function 356: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 357: ImageDraw() (5 input parameters) +Function 359: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3217,7 +3233,7 @@ Function 357: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 358: ImageDrawRectangle() (6 input parameters) +Function 360: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3227,7 +3243,7 @@ Function 358: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 359: ImageDrawRectangleV() (4 input parameters) +Function 361: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3235,14 +3251,14 @@ Function 359: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 360: ImageDrawRectangleRec() (3 input parameters) +Function 362: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 361: ImageDrawRectangleLines() (6 input parameters) +Function 363: ImageDrawRectangleLines() (6 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3252,7 +3268,7 @@ Function 361: ImageDrawRectangleLines() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 362: ImageDrawRectangleLinesEx() (4 input parameters) +Function 364: ImageDrawRectangleLinesEx() (4 input parameters) Name: ImageDrawRectangleLinesEx Return type: void Description: Draw rectangle lines within an image with line thickness @@ -3260,7 +3276,7 @@ Function 362: ImageDrawRectangleLinesEx() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 363: ImageDrawCircle() (5 input parameters) +Function 365: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3269,7 +3285,7 @@ Function 363: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 364: ImageDrawCircleV() (4 input parameters) +Function 366: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3277,7 +3293,7 @@ Function 364: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 365: ImageDrawCircleLines() (5 input parameters) +Function 367: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3286,7 +3302,7 @@ Function 365: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 366: ImageDrawCircleLinesV() (4 input parameters) +Function 368: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3294,7 +3310,7 @@ Function 366: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 367: ImageDraw() (5 input parameters) +Function 369: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image into a destination image (tint applied to source) @@ -3303,7 +3319,7 @@ Function 367: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 368: ImageDrawText() (6 input parameters) +Function 370: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3313,7 +3329,7 @@ Function 368: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 369: ImageDrawTextEx() (7 input parameters) +Function 371: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3324,79 +3340,79 @@ Function 369: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 370: LoadTexture() (1 input parameters) +Function 372: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 371: LoadTextureFromImage() (1 input parameters) +Function 373: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 372: LoadTextureCubemap() (2 input parameters) +Function 374: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 373: LoadRenderTexture() (2 input parameters) +Function 375: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 374: IsTextureValid() (1 input parameters) +Function 376: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 375: UnloadTexture() (1 input parameters) +Function 377: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 376: IsRenderTextureValid() (1 input parameters) +Function 378: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 377: UnloadRenderTexture() (1 input parameters) +Function 379: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 378: UpdateTexture() (2 input parameters) +Function 380: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 379: UpdateTextureRec() (3 input parameters) +Function 381: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 380: GenTextureMipmaps() (1 input parameters) +Function 382: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 381: SetTextureFilter() (2 input parameters) +Function 383: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 382: SetTextureWrap() (2 input parameters) +Function 384: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 383: DrawTexture() (4 input parameters) +Function 385: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3404,14 +3420,14 @@ Function 383: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 384: DrawTextureV() (3 input parameters) +Function 386: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 385: DrawTextureEx() (5 input parameters) +Function 387: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with rotation and scale @@ -3420,7 +3436,7 @@ Function 385: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 386: DrawTextureRec() (4 input parameters) +Function 388: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3428,7 +3444,7 @@ Function 386: DrawTextureRec() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 387: DrawTexturePro() (6 input parameters) +Function 389: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation @@ -3438,7 +3454,7 @@ Function 387: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 388: DrawTextureNPatch() (6 input parameters) +Function 390: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draw a texture (or part of it) that stretches or shrinks nicely @@ -3448,119 +3464,119 @@ Function 388: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 389: ColorIsEqual() (2 input parameters) +Function 391: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 390: Fade() (2 input parameters) +Function 392: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 391: ColorToInt() (1 input parameters) +Function 393: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 392: ColorNormalize() (1 input parameters) +Function 394: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 393: ColorFromNormalized() (1 input parameters) +Function 395: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 394: ColorToHSV() (1 input parameters) +Function 396: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 395: ColorFromHSV() (3 input parameters) +Function 397: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 396: ColorTint() (2 input parameters) +Function 398: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 397: ColorBrightness() (2 input parameters) +Function 399: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 398: ColorContrast() (2 input parameters) +Function 400: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 399: ColorAlpha() (2 input parameters) +Function 401: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 400: ColorAlphaBlend() (3 input parameters) +Function 402: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 401: ColorLerp() (3 input parameters) +Function 403: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 402: GetColor() (1 input parameters) +Function 404: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 403: GetPixelColor() (2 input parameters) +Function 405: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) -Function 404: SetPixelColor() (3 input parameters) +Function 406: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 405: GetPixelDataSize() (3 input parameters) +Function 407: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 406: GetFontDefault() (0 input parameters) +Function 408: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 407: LoadFont() (1 input parameters) +Function 409: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 408: LoadFontEx() (4 input parameters) +Function 410: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3568,14 +3584,14 @@ Function 408: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) Param[4]: codepointCount (type: int) -Function 409: LoadFontFromImage() (3 input parameters) +Function 411: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 410: LoadFontFromMemory() (6 input parameters) +Function 412: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3585,12 +3601,12 @@ Function 410: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: const int *) Param[6]: codepointCount (type: int) -Function 411: IsFontValid() (1 input parameters) +Function 413: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 412: LoadFontData() (7 input parameters) +Function 414: LoadFontData() (7 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3601,7 +3617,7 @@ Function 412: LoadFontData() (7 input parameters) Param[5]: codepointCount (type: int) Param[6]: type (type: int) Param[7]: glyphCount (type: int *) -Function 413: GenImageFontAtlas() (6 input parameters) +Function 415: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3611,30 +3627,30 @@ Function 413: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 414: UnloadFontData() (2 input parameters) +Function 416: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 415: UnloadFont() (1 input parameters) +Function 417: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 416: ExportFontAsCode() (2 input parameters) +Function 418: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 417: DrawFPS() (2 input parameters) +Function 419: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 418: DrawText() (5 input parameters) +Function 420: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3643,7 +3659,7 @@ Function 418: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 419: DrawTextEx() (6 input parameters) +Function 421: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3653,7 +3669,7 @@ Function 419: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 420: DrawTextPro() (8 input parameters) +Function 422: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3665,7 +3681,7 @@ Function 420: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 421: DrawTextCodepoint() (5 input parameters) +Function 423: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3674,7 +3690,7 @@ Function 421: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 422: DrawTextCodepoints() (7 input parameters) +Function 424: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple characters (codepoint) @@ -3685,18 +3701,18 @@ Function 422: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 423: SetTextLineSpacing() (1 input parameters) +Function 425: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 424: MeasureText() (2 input parameters) +Function 426: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 425: MeasureTextEx() (4 input parameters) +Function 427: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3704,7 +3720,7 @@ Function 425: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 426: MeasureTextCodepoints() (5 input parameters) +Function 428: MeasureTextCodepoints() (5 input parameters) Name: MeasureTextCodepoints Return type: Vector2 Description: Measure string size for an existing array of codepoints for Font @@ -3713,144 +3729,144 @@ Function 426: MeasureTextCodepoints() (5 input parameters) Param[3]: length (type: int) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) -Function 427: GetGlyphIndex() (2 input parameters) +Function 429: 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 428: GetGlyphInfo() (2 input parameters) +Function 430: 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 429: GetGlyphAtlasRec() (2 input parameters) +Function 431: 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 430: LoadUTF8() (2 input parameters) +Function 432: 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 431: UnloadUTF8() (1 input parameters) +Function 433: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 432: LoadCodepoints() (2 input parameters) +Function 434: 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 433: UnloadCodepoints() (1 input parameters) +Function 435: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 434: GetCodepointCount() (1 input parameters) +Function 436: 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 435: GetCodepoint() (2 input parameters) +Function 437: 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 436: GetCodepointNext() (2 input parameters) +Function 438: 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 437: GetCodepointPrevious() (2 input parameters) +Function 439: 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 438: CodepointToUTF8() (2 input parameters) +Function 440: 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 439: LoadTextLines() (2 input parameters) +Function 441: LoadTextLines() (2 input parameters) Name: LoadTextLines Return type: char ** Description: Load text as separate lines ('\n') Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 440: UnloadTextLines() (2 input parameters) +Function 442: UnloadTextLines() (2 input parameters) Name: UnloadTextLines Return type: void Description: Unload text lines Param[1]: text (type: char **) Param[2]: lineCount (type: int) -Function 441: TextCopy() (2 input parameters) +Function 443: 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 442: TextIsEqual() (2 input parameters) +Function 444: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text strings are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 443: TextLength() (1 input parameters) +Function 445: 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 444: TextFormat() (2 input parameters) +Function 446: 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 445: TextSubtext() (3 input parameters) +Function 447: 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 446: TextRemoveSpaces() (1 input parameters) +Function 448: TextRemoveSpaces() (1 input parameters) Name: TextRemoveSpaces Return type: const char * Description: Remove text spaces, concat words Param[1]: text (type: const char *) -Function 447: GetTextBetween() (3 input parameters) +Function 449: GetTextBetween() (3 input parameters) Name: GetTextBetween Return type: char * Description: Get text between two strings Param[1]: text (type: const char *) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) -Function 448: TextReplace() (3 input parameters) +Function 450: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string with new string Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 449: TextReplaceAlloc() (3 input parameters) +Function 451: TextReplaceAlloc() (3 input parameters) Name: TextReplaceAlloc Return type: char * Description: Replace text string with new string, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 450: TextReplaceBetween() (4 input parameters) +Function 452: TextReplaceBetween() (4 input parameters) Name: TextReplaceBetween Return type: char * Description: Replace text between two specific strings @@ -3858,7 +3874,7 @@ Function 450: TextReplaceBetween() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 451: TextReplaceBetweenAlloc() (4 input parameters) +Function 453: TextReplaceBetweenAlloc() (4 input parameters) Name: TextReplaceBetweenAlloc Return type: char * Description: Replace text between two specific strings, memory must be MemFree() @@ -3866,96 +3882,96 @@ Function 451: TextReplaceBetweenAlloc() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 452: TextInsert() (3 input parameters) +Function 454: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a defined byte position Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 453: TextInsertAlloc() (3 input parameters) +Function 455: TextInsertAlloc() (3 input parameters) Name: TextInsertAlloc Return type: char * Description: Insert text in a defined byte position, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 454: TextJoin() (3 input parameters) +Function 456: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 455: TextSplit() (3 input parameters) +Function 457: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 456: TextAppend() (3 input parameters) +Function 458: 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 457: TextFindIndex() (2 input parameters) +Function 459: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string, -1 if not found Param[1]: text (type: const char *) Param[2]: search (type: const char *) -Function 458: TextToUpper() (1 input parameters) +Function 460: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 459: TextToLower() (1 input parameters) +Function 461: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 460: TextToPascal() (1 input parameters) +Function 462: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 461: TextToSnake() (1 input parameters) +Function 463: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 462: TextToCamel() (1 input parameters) +Function 464: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 463: TextToInteger() (1 input parameters) +Function 465: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 464: TextToFloat() (1 input parameters) +Function 466: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 465: DrawLine3D() (3 input parameters) +Function 467: 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 466: DrawPoint3D() (2 input parameters) +Function 468: 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 467: DrawCircle3D() (5 input parameters) +Function 469: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3964,7 +3980,7 @@ Function 467: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 468: DrawTriangle3D() (4 input parameters) +Function 470: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -3972,14 +3988,14 @@ Function 468: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 469: DrawTriangleStrip3D() (3 input parameters) +Function 471: 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 470: DrawCube() (5 input parameters) +Function 472: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3988,14 +4004,14 @@ Function 470: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 471: DrawCubeV() (3 input parameters) +Function 473: 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 472: DrawCubeWires() (5 input parameters) +Function 474: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -4004,21 +4020,21 @@ Function 472: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 473: DrawCubeWiresV() (3 input parameters) +Function 475: 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 474: DrawSphere() (3 input parameters) +Function 476: 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 475: DrawSphereEx() (5 input parameters) +Function 477: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with defined rings and slices @@ -4027,7 +4043,7 @@ Function 475: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 476: DrawSphereWires() (5 input parameters) +Function 478: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -4036,7 +4052,7 @@ Function 476: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 477: DrawCylinder() (6 input parameters) +Function 479: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -4046,7 +4062,7 @@ Function 477: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 478: DrawCylinderEx() (6 input parameters) +Function 480: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -4056,7 +4072,7 @@ Function 478: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 479: DrawCylinderWires() (6 input parameters) +Function 481: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -4066,7 +4082,7 @@ Function 479: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 480: DrawCylinderWiresEx() (6 input parameters) +Function 482: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -4076,7 +4092,7 @@ Function 480: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 481: DrawCapsule() (6 input parameters) +Function 483: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -4086,7 +4102,7 @@ Function 481: DrawCapsule() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 482: DrawCapsuleWires() (6 input parameters) +Function 484: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -4096,51 +4112,51 @@ Function 482: DrawCapsuleWires() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 483: DrawPlane() (3 input parameters) +Function 485: 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 484: DrawRay() (2 input parameters) +Function 486: 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 485: DrawGrid() (2 input parameters) +Function 487: 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 486: LoadModel() (1 input parameters) +Function 488: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 487: LoadModelFromMesh() (1 input parameters) +Function 489: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 488: IsModelValid() (1 input parameters) +Function 490: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 489: UnloadModel() (1 input parameters) +Function 491: 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 490: GetModelBoundingBox() (1 input parameters) +Function 492: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 491: DrawModel() (4 input parameters) +Function 493: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -4148,7 +4164,7 @@ Function 491: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 492: DrawModelEx() (6 input parameters) +Function 494: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with custom transform @@ -4158,7 +4174,7 @@ Function 492: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 493: DrawModelWires() (4 input parameters) +Function 495: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4166,7 +4182,7 @@ Function 493: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 494: DrawModelWiresEx() (6 input parameters) +Function 496: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires with custom transform @@ -4176,13 +4192,13 @@ Function 494: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 495: DrawBoundingBox() (2 input parameters) +Function 497: 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 496: DrawBillboard() (5 input parameters) +Function 498: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4191,7 +4207,7 @@ Function 496: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 497: DrawBillboardRec() (6 input parameters) +Function 499: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by rectangle @@ -4201,7 +4217,7 @@ Function 497: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 498: DrawBillboardPro() (9 input parameters) +Function 500: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source rectangle with scaling and rotation @@ -4214,13 +4230,13 @@ Function 498: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 499: UploadMesh() (2 input parameters) +Function 501: 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 500: UpdateMeshBuffer() (5 input parameters) +Function 502: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4229,19 +4245,19 @@ Function 500: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 501: UnloadMesh() (1 input parameters) +Function 503: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 502: DrawMesh() (3 input parameters) +Function 504: 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 503: DrawMeshInstanced() (4 input parameters) +Function 505: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4249,35 +4265,35 @@ Function 503: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 504: GetMeshBoundingBox() (1 input parameters) +Function 506: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 505: GenMeshTangents() (1 input parameters) +Function 507: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 506: ExportMesh() (2 input parameters) +Function 508: 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 507: ExportMeshAsCode() (2 input parameters) +Function 509: 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 508: GenMeshPoly() (2 input parameters) +Function 510: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 509: GenMeshPlane() (4 input parameters) +Function 511: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4285,42 +4301,42 @@ Function 509: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 510: GenMeshCube() (3 input parameters) +Function 512: 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 511: GenMeshSphere() (3 input parameters) +Function 513: 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 512: GenMeshHemiSphere() (3 input parameters) +Function 514: 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 513: GenMeshCylinder() (3 input parameters) +Function 515: 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 514: GenMeshCone() (3 input parameters) +Function 516: 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 515: GenMeshTorus() (4 input parameters) +Function 517: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4328,7 +4344,7 @@ Function 515: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 516: GenMeshKnot() (4 input parameters) +Function 518: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4336,67 +4352,67 @@ Function 516: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 517: GenMeshHeightmap() (2 input parameters) +Function 519: 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 518: GenMeshCubicmap() (2 input parameters) +Function 520: 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 519: LoadMaterials() (2 input parameters) +Function 521: 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 520: LoadMaterialDefault() (0 input parameters) +Function 522: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 521: IsMaterialValid() (1 input parameters) +Function 523: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 522: UnloadMaterial() (1 input parameters) +Function 524: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 523: SetMaterialTexture() (3 input parameters) +Function 525: 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 524: SetModelMeshMaterial() (3 input parameters) +Function 526: 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 525: LoadModelAnimations() (2 input parameters) +Function 527: 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 526: UpdateModelAnimation() (3 input parameters) +Function 528: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (vertex buffers and bone matrices) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: float) -Function 527: UpdateModelAnimationEx() (6 input parameters) +Function 529: UpdateModelAnimationEx() (6 input parameters) Name: UpdateModelAnimationEx Return type: void Description: Update model animation pose, blending two animations @@ -4406,19 +4422,19 @@ Function 527: UpdateModelAnimationEx() (6 input parameters) Param[4]: animB (type: ModelAnimation) Param[5]: frameB (type: float) Param[6]: blend (type: float) -Function 528: UnloadModelAnimations() (2 input parameters) +Function 530: 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 529: IsModelAnimationValid() (2 input parameters) +Function 531: 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 530: CheckCollisionSpheres() (4 input parameters) +Function 532: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4426,40 +4442,40 @@ Function 530: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 531: CheckCollisionBoxes() (2 input parameters) +Function 533: 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 532: CheckCollisionBoxSphere() (3 input parameters) +Function 534: 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 533: GetRayCollisionSphere() (3 input parameters) +Function 535: 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 534: GetRayCollisionBox() (2 input parameters) +Function 536: 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 535: GetRayCollisionMesh() (3 input parameters) +Function 537: 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 536: GetRayCollisionTriangle() (4 input parameters) +Function 538: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4467,7 +4483,7 @@ Function 536: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 537: GetRayCollisionQuad() (5 input parameters) +Function 539: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4476,158 +4492,158 @@ Function 537: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 538: InitAudioDevice() (0 input parameters) +Function 540: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 539: CloseAudioDevice() (0 input parameters) +Function 541: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 540: IsAudioDeviceReady() (0 input parameters) +Function 542: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 541: SetMasterVolume() (1 input parameters) +Function 543: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 542: GetMasterVolume() (0 input parameters) +Function 544: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 543: LoadWave() (1 input parameters) +Function 545: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 544: LoadWaveFromMemory() (3 input parameters) +Function 546: 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 545: IsWaveValid() (1 input parameters) +Function 547: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Check if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 546: LoadSound() (1 input parameters) +Function 548: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 547: LoadSoundFromWave() (1 input parameters) +Function 549: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 548: LoadSoundAlias() (1 input parameters) +Function 550: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 549: IsSoundValid() (1 input parameters) +Function 551: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 550: UpdateSound() (3 input parameters) +Function 552: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 551: UnloadWave() (1 input parameters) +Function 553: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 552: UnloadSound() (1 input parameters) +Function 554: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 553: UnloadSoundAlias() (1 input parameters) +Function 555: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 554: ExportWave() (2 input parameters) +Function 556: 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 555: ExportWaveAsCode() (2 input parameters) +Function 557: 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 556: PlaySound() (1 input parameters) +Function 558: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 557: StopSound() (1 input parameters) +Function 559: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 558: PauseSound() (1 input parameters) +Function 560: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 559: ResumeSound() (1 input parameters) +Function 561: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 560: IsSoundPlaying() (1 input parameters) +Function 562: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if sound is currently playing Param[1]: sound (type: Sound) -Function 561: SetSoundVolume() (2 input parameters) +Function 563: 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 562: SetSoundPitch() (2 input parameters) +Function 564: 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 563: SetSoundPan() (2 input parameters) +Function 565: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 564: WaveCopy() (1 input parameters) +Function 566: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 565: WaveCrop() (3 input parameters) +Function 567: 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 566: WaveFormat() (4 input parameters) +Function 568: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4635,203 +4651,203 @@ Function 566: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 567: LoadWaveSamples() (1 input parameters) +Function 569: 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 568: UnloadWaveSamples() (1 input parameters) +Function 570: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 569: LoadMusicStream() (1 input parameters) +Function 571: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 570: LoadMusicStreamFromMemory() (3 input parameters) +Function 572: 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 571: IsMusicValid() (1 input parameters) +Function 573: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 572: UnloadMusicStream() (1 input parameters) +Function 574: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 573: PlayMusicStream() (1 input parameters) +Function 575: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 574: IsMusicStreamPlaying() (1 input parameters) +Function 576: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 575: UpdateMusicStream() (1 input parameters) +Function 577: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Update buffers for music streaming Param[1]: music (type: Music) -Function 576: StopMusicStream() (1 input parameters) +Function 578: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 577: PauseMusicStream() (1 input parameters) +Function 579: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 578: ResumeMusicStream() (1 input parameters) +Function 580: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 579: SeekMusicStream() (2 input parameters) +Function 581: 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 580: SetMusicVolume() (2 input parameters) +Function 582: 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 581: SetMusicPitch() (2 input parameters) +Function 583: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 582: SetMusicPan() (2 input parameters) +Function 584: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 583: GetMusicTimeLength() (1 input parameters) +Function 585: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 584: GetMusicTimePlayed() (1 input parameters) +Function 586: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 585: LoadAudioStream() (3 input parameters) +Function 587: 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 586: IsAudioStreamValid() (1 input parameters) +Function 588: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Check if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 587: UnloadAudioStream() (1 input parameters) +Function 589: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 588: UpdateAudioStream() (3 input parameters) +Function 590: 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 589: IsAudioStreamProcessed() (1 input parameters) +Function 591: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 590: PlayAudioStream() (1 input parameters) +Function 592: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 591: PauseAudioStream() (1 input parameters) +Function 593: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 592: ResumeAudioStream() (1 input parameters) +Function 594: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 593: IsAudioStreamPlaying() (1 input parameters) +Function 595: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 594: StopAudioStream() (1 input parameters) +Function 596: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 595: SetAudioStreamVolume() (2 input parameters) +Function 597: 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 596: SetAudioStreamPitch() (2 input parameters) +Function 598: 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 597: SetAudioStreamPan() (2 input parameters) +Function 599: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 598: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 600: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 599: SetAudioStreamCallback() (2 input parameters) +Function 601: 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 600: AttachAudioStreamProcessor() (2 input parameters) +Function 602: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 601: DetachAudioStreamProcessor() (2 input parameters) +Function 603: 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 602: AttachAudioMixedProcessor() (1 input parameters) +Function 604: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 603: DetachAudioMixedProcessor() (1 input parameters) +Function 605: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index d7ecaf7d4..0848d94a4 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -682,7 +682,7 @@ - + @@ -1575,6 +1575,12 @@ + + + + + + @@ -2067,6 +2073,12 @@ + + + + + + From 236618f87bfb50d67dea039b8927e85b83f68047 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 21:06:53 +0200 Subject: [PATCH 45/63] Reorder functions by drawing vertex/sides --- src/rshapes.c | 988 ++++++++++++++++++++++++------------------------ src/rtextures.c | 276 +++++++------- 2 files changed, 632 insertions(+), 632 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index b6d0f0944..51bc15a60 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -311,413 +311,128 @@ void DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSiz rlEnd(); } -// Draw a color-filled circle -void DrawCircle(int centerX, int centerY, float radius, Color color) +// Draw a triangle +// NOTE: Vertex must be provided in counter-clockwise order +void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { - DrawCircleV((Vector2){ (float)centerX, (float)centerY }, radius, color); + DrawTriangleGradient(v1, v2, v3, color, color, color); } -// Draw a color-filled circle (Vector version) -// NOTE: On OpenGL 3.3 and ES2 using QUADS to avoid drawing order issues -void DrawCircleV(Vector2 center, float radius, Color color) +// Draw triangle with interpolated colors (vertex in counter-clockwise order!) +void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3) { - DrawCircleSector(center, radius, 0, 360, 36, color); -} - -// Draw a gradient-filled circle -void DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer) -{ - rlBegin(RL_TRIANGLES); - for (int i = 0; i < 360; i += 10) - { - rlColor4ub(inner.r, inner.g, inner.b, inner.a); - rlVertex2f(center.x, center.y); - rlColor4ub(outer.r, outer.g, outer.b, outer.a); - rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radius, center.y + sinf(DEG2RAD*(i + 10))*radius); - rlColor4ub(outer.r, outer.g, outer.b, outer.a); - rlVertex2f(center.x + cosf(DEG2RAD*i)*radius, center.y + sinf(DEG2RAD*i)*radius); - } - rlEnd(); -} - -// Draw a piece of a circle -void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) -{ - if (startAngle == endAngle) return; - if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero - - // Function expects (endAngle > startAngle) - if (endAngle < startAngle) - { - // Swap values - float tmp = startAngle; - startAngle = endAngle; - endAngle = tmp; - } - - int minSegments = (int)ceilf((endAngle - startAngle)/90); - - if (segments < minSegments) - { - // Calculate the maximum angle between segments based on the error rate (usually 0.5f) - float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); - - if (segments <= 0) segments = minSegments; - } - - float stepLength = (endAngle - startAngle)/(float)segments; - float angle = startAngle; - #if SUPPORT_QUADS_DRAW_MODE rlSetTexture(GetShapesTexture().id); Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); + rlNormal3f(0.0f, 0.0f, 1.0f); - // NOTE: Every QUAD actually represents two segments - for (int i = 0; i < segments/2; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); + rlColor4ub(c1.r, c1.g, c1.b, c1.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(v1.x, v1.y); - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x, center.y); + rlColor4ub(c2.r, c2.g, c2.b, c2.a); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(v2.x, v2.y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength*2.0f))*radius, center.y + sinf(DEG2RAD*(angle + stepLength*2.0f))*radius); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); - - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); - - angle += (stepLength*2.0f); - } - - // NOTE: In case number of segments is odd, adding one last piece to the cake - if ((((unsigned int)segments)%2) == 1) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x, center.y); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); - - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x, center.y); - } + rlColor4ub(c3.r, c3.g, c3.b, c3.a); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(v3.x, v3.y); + rlColor4ub(c3.r, c3.g, c3.b, c3.a); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(v3.x, v3.y); rlEnd(); rlSetTexture(0); #else rlBegin(RL_TRIANGLES); - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlVertex2f(center.x, center.y); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); - - angle += stepLength; - } + rlColor4ub(c1.r, c1.g, c1.b, c1.a); + rlVertex2f(v1.x, v1.y); + rlColor4ub(c2.r, c2.g, c2.b, c2.a); + rlVertex2f(v2.x, v2.y); + rlColor4ub(c3.r, c3.g, c3.b, c3.a); + rlVertex2f(v3.x, v3.y); rlEnd(); #endif } -// Draw a piece of a circle outlines -void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) -{ - if (startAngle == endAngle) return; - if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero issue - - // Function expects (endAngle > startAngle) - if (endAngle < startAngle) - { - // Swap values - float tmp = startAngle; - startAngle = endAngle; - endAngle = tmp; - } - - int minSegments = (int)ceilf((endAngle - startAngle)/90); - - if (segments < minSegments) - { - // Calculate the maximum angle between segments based on the error rate (usually 0.5f) - float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); - segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); - - if (segments <= 0) segments = minSegments; - } - - float stepLength = (endAngle - startAngle)/(float)segments; - float angle = startAngle; - bool showCapLines = true; - - rlBegin(RL_LINES); - if (showCapLines) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x, center.y); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); - } - - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); - - angle += stepLength; - } - - if (showCapLines) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x, center.y); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); - } - rlEnd(); -} - -// Draw circle outline -void DrawCircleLines(int centerX, int centerY, float radius, Color color) -{ - DrawCircleLinesV((Vector2){ (float)centerX, (float)centerY }, radius, color); -} - -// Draw circle outline (Vector version) -void DrawCircleLinesV(Vector2 center, float radius, Color color) +// Draw a triangle using lines +// NOTE: Vertex must be provided in counter-clockwise order +void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(v1.x, v1.y); + rlVertex2f(v2.x, v2.y); - // NOTE: Circle outline is drawn pixel by pixel every degree (0 to 360) - for (int i = 0; i < 360; i += 10) - { - rlVertex2f(center.x + cosf(DEG2RAD*i)*radius, center.y + sinf(DEG2RAD*i)*radius); - rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radius, center.y + sinf(DEG2RAD*(i + 10))*radius); - } + rlVertex2f(v2.x, v2.y); + rlVertex2f(v3.x, v3.y); + + rlVertex2f(v3.x, v3.y); + rlVertex2f(v1.x, v1.y); rlEnd(); } -void DrawCircleLinesEx(Vector2 center, float radius, float thick, 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(const Vector2 *points, int pointCount, Color color) { - DrawRing(center, radius - thick, radius, 0.0f, 360.0f, 36, color); + if (pointCount >= 3) + { + rlSetTexture(GetShapesTexture().id); + Rectangle shapeRect = GetShapesTextureRectangle(); + + rlBegin(RL_QUADS); + rlColor4ub(color.r, color.g, color.b, color.a); + + for (int i = 1; i < pointCount - 1; i++) + { + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(points[0].x, points[0].y); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(points[i].x, points[i].y); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(points[i + 1].x, points[i + 1].y); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(points[i + 1].x, points[i + 1].y); + } + rlEnd(); + rlSetTexture(0); + } } -// Draw ellipse -void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color) +// Draw a triangle strip defined by points +// NOTE: Every new vertex connects with previous two +void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color) { - DrawEllipseV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color); -} - -// Draw ellipse (Vector version) -void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color) -{ - rlBegin(RL_TRIANGLES); - for (int i = 0; i < 360; i += 10) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x, center.y); - rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV); - rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV); - } - rlEnd(); -} - -// Draw ellipse outline -void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color) -{ - DrawEllipseLinesV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color); -} - -// Draw ellipse outline -void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color) -{ - rlBegin(RL_LINES); - for (int i = 0; i < 360; i += 10) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV); - rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV); - } - rlEnd(); -} - -// Draw ring -void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) -{ - if (startAngle == endAngle) return; - - // Function expects (outerRadius > innerRadius) - if (outerRadius < innerRadius) + if (pointCount >= 3) { - float tmp = outerRadius; - outerRadius = innerRadius; - innerRadius = tmp; - - if (outerRadius <= 0.0f) outerRadius = 0.1f; - } - - // Function expects (endAngle > startAngle) - if (endAngle < startAngle) - { - // Swap values - float tmp = startAngle; - startAngle = endAngle; - endAngle = tmp; - } - - int minSegments = (int)ceilf((endAngle - startAngle)/90); - - if (segments < minSegments) - { - // Calculate the maximum angle between segments based on the error rate (usually 0.5f) - float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); - segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); - - if (segments <= 0) segments = minSegments; - } - - // Not a ring - if (innerRadius <= 0.0f) - { - DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, color); - return; - } - - float stepLength = (endAngle - startAngle)/(float)segments; - float angle = startAngle; - -#if SUPPORT_QUADS_DRAW_MODE - rlSetTexture(GetShapesTexture().id); - Rectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - for (int i = 0; i < segments; i++) - { + rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); - - angle += stepLength; - } - rlEnd(); - - rlSetTexture(0); -#else - rlBegin(RL_TRIANGLES); - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - - angle += stepLength; - } - rlEnd(); -#endif -} - -// Draw ring outline -void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) -{ - if (startAngle == endAngle) return; - - // Function expects (outerRadius > innerRadius) - if (outerRadius < innerRadius) - { - float tmp = outerRadius; - outerRadius = innerRadius; - innerRadius = tmp; - - if (outerRadius <= 0.0f) outerRadius = 0.1f; + for (int i = 2; i < pointCount; i++) + { + if ((i%2) == 0) + { + rlVertex2f(points[i].x, points[i].y); + rlVertex2f(points[i - 2].x, points[i - 2].y); + rlVertex2f(points[i - 1].x, points[i - 1].y); + } + else + { + rlVertex2f(points[i].x, points[i].y); + rlVertex2f(points[i - 1].x, points[i - 1].y); + rlVertex2f(points[i - 2].x, points[i - 2].y); + } + } + rlEnd(); } - - // Function expects (endAngle > startAngle) - if (endAngle < startAngle) - { - // Swap values - float tmp = startAngle; - startAngle = endAngle; - endAngle = tmp; - } - - int minSegments = (int)ceilf((endAngle - startAngle)/90); - - if (segments < minSegments) - { - // Calculate the maximum angle between segments based on the error rate (usually 0.5f) - float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); - segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); - - if (segments <= 0) segments = minSegments; - } - - if (innerRadius <= 0.0f) - { - DrawCircleSectorLines(center, outerRadius, startAngle, endAngle, segments, color); - return; - } - - float stepLength = (endAngle - startAngle)/(float)segments; - float angle = startAngle; - bool showCapLines = true; - - rlBegin(RL_LINES); - if (showCapLines) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - } - - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); - - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - - angle += stepLength; - } - - if (showCapLines) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - } - rlEnd(); } // Draw a color-filled rectangle @@ -1423,130 +1138,6 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f } } -// Draw a triangle -// NOTE: Vertex must be provided in counter-clockwise order -void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) -{ - DrawTriangleGradient(v1, v2, v3, color, color, color); -} - -// Draw triangle with interpolated colors (vertex in counter-clockwise order!) -void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3) -{ -#if SUPPORT_QUADS_DRAW_MODE - rlSetTexture(GetShapesTexture().id); - Rectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - rlNormal3f(0.0f, 0.0f, 1.0f); - - rlColor4ub(c1.r, c1.g, c1.b, c1.a); - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(v1.x, v1.y); - - rlColor4ub(c2.r, c2.g, c2.b, c2.a); - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(v2.x, v2.y); - - rlColor4ub(c3.r, c3.g, c3.b, c3.a); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(v3.x, v3.y); - - rlColor4ub(c3.r, c3.g, c3.b, c3.a); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(v3.x, v3.y); - rlEnd(); - - rlSetTexture(0); -#else - rlBegin(RL_TRIANGLES); - rlColor4ub(c1.r, c1.g, c1.b, c1.a); - rlVertex2f(v1.x, v1.y); - rlColor4ub(c2.r, c2.g, c2.b, c2.a); - rlVertex2f(v2.x, v2.y); - rlColor4ub(c3.r, c3.g, c3.b, c3.a); - rlVertex2f(v3.x, v3.y); - rlEnd(); -#endif -} - -// Draw a triangle using lines -// NOTE: Vertex must be provided in counter-clockwise order -void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color) -{ - rlBegin(RL_LINES); - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(v1.x, v1.y); - rlVertex2f(v2.x, v2.y); - - rlVertex2f(v2.x, v2.y); - rlVertex2f(v3.x, v3.y); - - rlVertex2f(v3.x, v3.y); - rlVertex2f(v1.x, v1.y); - rlEnd(); -} - -// 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(const Vector2 *points, int pointCount, Color color) -{ - if (pointCount >= 3) - { - rlSetTexture(GetShapesTexture().id); - Rectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - rlColor4ub(color.r, color.g, color.b, color.a); - - for (int i = 1; i < pointCount - 1; i++) - { - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(points[0].x, points[0].y); - - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(points[i].x, points[i].y); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(points[i + 1].x, points[i + 1].y); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(points[i + 1].x, points[i + 1].y); - } - rlEnd(); - rlSetTexture(0); - } -} - -// Draw a triangle strip defined by points -// NOTE: Every new vertex connects with previous two -void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color) -{ - if (pointCount >= 3) - { - rlBegin(RL_TRIANGLES); - rlColor4ub(color.r, color.g, color.b, color.a); - - for (int i = 2; i < pointCount; i++) - { - if ((i%2) == 0) - { - rlVertex2f(points[i].x, points[i].y); - rlVertex2f(points[i - 2].x, points[i - 2].y); - rlVertex2f(points[i - 1].x, points[i - 1].y); - } - else - { - rlVertex2f(points[i].x, points[i].y); - rlVertex2f(points[i - 1].x, points[i - 1].y); - rlVertex2f(points[i - 2].x, points[i - 2].y); - } - } - rlEnd(); - } -} - // Draw a polygon of n sides void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color) { @@ -1670,6 +1261,415 @@ void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, fl #endif } +// Draw a color-filled circle +void DrawCircle(int centerX, int centerY, float radius, Color color) +{ + DrawCircleV((Vector2){ (float)centerX, (float)centerY }, radius, color); +} + +// Draw a color-filled circle (Vector version) +// NOTE: On OpenGL 3.3 and ES2 using QUADS to avoid drawing order issues +void DrawCircleV(Vector2 center, float radius, Color color) +{ + DrawCircleSector(center, radius, 0, 360, 36, color); +} + +// Draw a gradient-filled circle +void DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer) +{ + rlBegin(RL_TRIANGLES); + for (int i = 0; i < 360; i += 10) + { + rlColor4ub(inner.r, inner.g, inner.b, inner.a); + rlVertex2f(center.x, center.y); + rlColor4ub(outer.r, outer.g, outer.b, outer.a); + rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radius, center.y + sinf(DEG2RAD*(i + 10))*radius); + rlColor4ub(outer.r, outer.g, outer.b, outer.a); + rlVertex2f(center.x + cosf(DEG2RAD*i)*radius, center.y + sinf(DEG2RAD*i)*radius); + } + rlEnd(); +} + +// Draw a piece of a circle +void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) +{ + if (startAngle == endAngle) return; + if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero + + // Function expects (endAngle > startAngle) + if (endAngle < startAngle) + { + // Swap values + float tmp = startAngle; + startAngle = endAngle; + endAngle = tmp; + } + + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) + { + // Calculate the maximum angle between segments based on the error rate (usually 0.5f) + float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); + + if (segments <= 0) segments = minSegments; + } + + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; + +#if SUPPORT_QUADS_DRAW_MODE + rlSetTexture(GetShapesTexture().id); + Rectangle shapeRect = GetShapesTextureRectangle(); + + rlBegin(RL_QUADS); + + // NOTE: Every QUAD actually represents two segments + for (int i = 0; i < segments/2; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x, center.y); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength*2.0f))*radius, center.y + sinf(DEG2RAD*(angle + stepLength*2.0f))*radius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + + angle += (stepLength*2.0f); + } + + // NOTE: In case number of segments is odd, adding one last piece to the cake + if ((((unsigned int)segments)%2) == 1) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x, center.y); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x, center.y); + } + + rlEnd(); + + rlSetTexture(0); +#else + rlBegin(RL_TRIANGLES); + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2f(center.x, center.y); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + + angle += stepLength; + } + rlEnd(); +#endif +} + +// Draw a piece of a circle outlines +void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) +{ + if (startAngle == endAngle) return; + if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero issue + + // Function expects (endAngle > startAngle) + if (endAngle < startAngle) + { + // Swap values + float tmp = startAngle; + startAngle = endAngle; + endAngle = tmp; + } + + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) + { + // Calculate the maximum angle between segments based on the error rate (usually 0.5f) + float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); + + if (segments <= 0) segments = minSegments; + } + + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; + bool showCapLines = true; + + rlBegin(RL_LINES); + if (showCapLines) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x, center.y); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + } + + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + + angle += stepLength; + } + + if (showCapLines) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x, center.y); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + } + rlEnd(); +} + +// Draw circle outline +void DrawCircleLines(int centerX, int centerY, float radius, Color color) +{ + DrawCircleLinesV((Vector2){ (float)centerX, (float)centerY }, radius, color); +} + +// Draw circle outline (Vector version) +void DrawCircleLinesV(Vector2 center, float radius, Color color) +{ + rlBegin(RL_LINES); + rlColor4ub(color.r, color.g, color.b, color.a); + + // NOTE: Circle outline is drawn pixel by pixel every degree (0 to 360) + for (int i = 0; i < 360; i += 10) + { + rlVertex2f(center.x + cosf(DEG2RAD*i)*radius, center.y + sinf(DEG2RAD*i)*radius); + rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radius, center.y + sinf(DEG2RAD*(i + 10))*radius); + } + rlEnd(); +} + +void DrawCircleLinesEx(Vector2 center, float radius, float thick, Color color) +{ + DrawRing(center, radius - thick, radius, 0.0f, 360.0f, 36, color); +} + +// Draw ellipse +void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color) +{ + DrawEllipseV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color); +} + +// Draw ellipse (Vector version) +void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color) +{ + rlBegin(RL_TRIANGLES); + for (int i = 0; i < 360; i += 10) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x, center.y); + rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV); + rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV); + } + rlEnd(); +} + +// Draw ellipse outline +void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color) +{ + DrawEllipseLinesV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color); +} + +// Draw ellipse outline +void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color) +{ + rlBegin(RL_LINES); + for (int i = 0; i < 360; i += 10) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV); + rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV); + } + rlEnd(); +} + +// Draw ring +void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) +{ + if (startAngle == endAngle) return; + + // Function expects (outerRadius > innerRadius) + if (outerRadius < innerRadius) + { + float tmp = outerRadius; + outerRadius = innerRadius; + innerRadius = tmp; + + if (outerRadius <= 0.0f) outerRadius = 0.1f; + } + + // Function expects (endAngle > startAngle) + if (endAngle < startAngle) + { + // Swap values + float tmp = startAngle; + startAngle = endAngle; + endAngle = tmp; + } + + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) + { + // Calculate the maximum angle between segments based on the error rate (usually 0.5f) + float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); + + if (segments <= 0) segments = minSegments; + } + + // Not a ring + if (innerRadius <= 0.0f) + { + DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, color); + return; + } + + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; + +#if SUPPORT_QUADS_DRAW_MODE + rlSetTexture(GetShapesTexture().id); + Rectangle shapeRect = GetShapesTextureRectangle(); + + rlBegin(RL_QUADS); + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); + + angle += stepLength; + } + rlEnd(); + + rlSetTexture(0); +#else + rlBegin(RL_TRIANGLES); + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + + angle += stepLength; + } + rlEnd(); +#endif +} + +// Draw ring outline +void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) +{ + if (startAngle == endAngle) return; + + // Function expects (outerRadius > innerRadius) + if (outerRadius < innerRadius) + { + float tmp = outerRadius; + outerRadius = innerRadius; + innerRadius = tmp; + + if (outerRadius <= 0.0f) outerRadius = 0.1f; + } + + // Function expects (endAngle > startAngle) + if (endAngle < startAngle) + { + // Swap values + float tmp = startAngle; + startAngle = endAngle; + endAngle = tmp; + } + + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) + { + // Calculate the maximum angle between segments based on the error rate (usually 0.5f) + float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); + segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f); + + if (segments <= 0) segments = minSegments; + } + + if (innerRadius <= 0.0f) + { + DrawCircleSectorLines(center, outerRadius, startAngle, endAngle, segments, color); + return; + } + + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; + bool showCapLines = true; + + rlBegin(RL_LINES); + if (showCapLines) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + } + + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); + + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + + angle += stepLength; + } + + if (showCapLines) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + } + rlEnd(); +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Splines functions //---------------------------------------------------------------------------------- diff --git a/src/rtextures.c b/src/rtextures.c index 103309a19..69b743a71 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3618,144 +3618,6 @@ void ImageDrawLineStrip(Image *dst, const Vector2 *points, int pointCount, Color } } -// Draw circle within an image -void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color) -{ - int x = 0; - int y = radius; - int decesionParameter = 3 - 2*radius; - - while (y >= x) - { - ImageDrawRectangle(dst, centerX - x, centerY + y, x*2, 1, color); - ImageDrawRectangle(dst, centerX - x, centerY - y, x*2, 1, color); - ImageDrawRectangle(dst, centerX - y, centerY + x, y*2, 1, color); - ImageDrawRectangle(dst, centerX - y, centerY - x, y*2, 1, color); - x++; - - if (decesionParameter > 0) - { - y--; - decesionParameter = decesionParameter + 4*(x - y) + 10; - } - else decesionParameter = decesionParameter + 4*x + 6; - } -} - -// Draw circle within an image (Vector version) -void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color) -{ - ImageDrawCircle(dst, (int)center.x, (int)center.y, radius, color); -} - -// Draw circle outline within an image -void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color) -{ - int x = 0; - int y = radius; - int decesionParameter = 3 - 2*radius; - - while (y >= x) - { - ImageDrawPixel(dst, centerX + x, centerY + y, color); - ImageDrawPixel(dst, centerX - x, centerY + y, color); - ImageDrawPixel(dst, centerX + x, centerY - y, color); - ImageDrawPixel(dst, centerX - x, centerY - y, color); - ImageDrawPixel(dst, centerX + y, centerY + x, color); - ImageDrawPixel(dst, centerX - y, centerY + x, color); - ImageDrawPixel(dst, centerX + y, centerY - x, color); - ImageDrawPixel(dst, centerX - y, centerY - x, color); - x++; - - if (decesionParameter > 0) - { - y--; - decesionParameter = decesionParameter + 4*(x - y) + 10; - } - else decesionParameter = decesionParameter + 4*x + 6; - } -} - -// Draw circle outline within an image (Vector version) -void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) -{ - ImageDrawCircleLines(dst, (int)center.x, (int)center.y, radius, color); -} - -// Draw rectangle within an image -void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color) -{ - ImageDrawRectangleRec(dst, (Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color); -} - -// Draw rectangle within an image (Vector version) -void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color) -{ - ImageDrawRectangle(dst, (int)position.x, (int)position.y, (int)size.x, (int)size.y, color); -} - -// Draw rectangle within an image -void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) -{ - // Security check to avoid program crash - if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0)) return; - - // Security check to avoid drawing out of bounds in case of bad user data - if (rec.x < 0) { rec.width += rec.x; rec.x = 0; } - if (rec.y < 0) { rec.height += rec.y; rec.y = 0; } - if (rec.width < 0) rec.width = 0; - if (rec.height < 0) rec.height = 0; - - // Clamp the size the the image bounds - if ((rec.x + rec.width) >= dst->width) rec.width = dst->width - rec.x; - if ((rec.y + rec.height) >= dst->height) rec.height = dst->height - rec.y; - - // Check if the rect is even inside the image - if ((rec.x >= dst->width) || (rec.y >= dst->height)) return; - if (((rec.x + rec.width) <= 0) || (rec.y + rec.height <= 0)) return; - - int sy = (int)rec.y; - int sx = (int)rec.x; - - int bytesPerPixel = GetPixelDataSize(1, 1, dst->format); - - // Fill in the first pixel of the first row based on image format - ImageDrawPixel(dst, sx, sy, color); - - int bytesOffset = ((sy*dst->width) + sx)*bytesPerPixel; - unsigned char *pSrcPixel = (unsigned char *)dst->data + bytesOffset; - - // Repeat the first pixel data throughout the row - for (int x = 1; x < (int)rec.width; x *= 2) - { - int pixelsToCopy = MIN(x, (int)rec.width - x); - memcpy(pSrcPixel + x*bytesPerPixel, pSrcPixel, pixelsToCopy*bytesPerPixel); - } - - // Repeat the first row data for all other rows - int bytesPerRow = bytesPerPixel*(int)rec.width; - for (int y = 1; y < (int)rec.height; y++) - { - memcpy(pSrcPixel + (y*dst->width)*bytesPerPixel, pSrcPixel, bytesPerRow); - } -} - -// Draw rectangle lines within an image -void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color) -{ - Rectangle rec = { posX, posY, width, height }; - ImageDrawRectangleLinesEx(dst, rec, 1, color); -} - -// Draw rectangle lines within an image with line thickness -void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color) -{ - ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); - ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color); - ImageDrawRectangle(dst, (int)(rec.x + rec.width - thick), (int)(rec.y + thick), thick, (int)(rec.height - thick*2), 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) { @@ -3941,6 +3803,144 @@ void ImageDrawTriangleStrip(Image *dst, const Vector2 *points, int pointCount, C } } +// Draw rectangle within an image +void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color) +{ + ImageDrawRectangleRec(dst, (Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color); +} + +// Draw rectangle within an image (Vector version) +void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color) +{ + ImageDrawRectangle(dst, (int)position.x, (int)position.y, (int)size.x, (int)size.y, color); +} + +// Draw rectangle within an image +void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) +{ + // Security check to avoid program crash + if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0)) return; + + // Security check to avoid drawing out of bounds in case of bad user data + if (rec.x < 0) { rec.width += rec.x; rec.x = 0; } + if (rec.y < 0) { rec.height += rec.y; rec.y = 0; } + if (rec.width < 0) rec.width = 0; + if (rec.height < 0) rec.height = 0; + + // Clamp the size the the image bounds + if ((rec.x + rec.width) >= dst->width) rec.width = dst->width - rec.x; + if ((rec.y + rec.height) >= dst->height) rec.height = dst->height - rec.y; + + // Check if the rect is even inside the image + if ((rec.x >= dst->width) || (rec.y >= dst->height)) return; + if (((rec.x + rec.width) <= 0) || (rec.y + rec.height <= 0)) return; + + int sy = (int)rec.y; + int sx = (int)rec.x; + + int bytesPerPixel = GetPixelDataSize(1, 1, dst->format); + + // Fill in the first pixel of the first row based on image format + ImageDrawPixel(dst, sx, sy, color); + + int bytesOffset = ((sy*dst->width) + sx)*bytesPerPixel; + unsigned char *pSrcPixel = (unsigned char *)dst->data + bytesOffset; + + // Repeat the first pixel data throughout the row + for (int x = 1; x < (int)rec.width; x *= 2) + { + int pixelsToCopy = MIN(x, (int)rec.width - x); + memcpy(pSrcPixel + x*bytesPerPixel, pSrcPixel, pixelsToCopy*bytesPerPixel); + } + + // Repeat the first row data for all other rows + int bytesPerRow = bytesPerPixel*(int)rec.width; + for (int y = 1; y < (int)rec.height; y++) + { + memcpy(pSrcPixel + (y*dst->width)*bytesPerPixel, pSrcPixel, bytesPerRow); + } +} + +// Draw rectangle lines within an image +void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color) +{ + Rectangle rec = { posX, posY, width, height }; + ImageDrawRectangleLinesEx(dst, rec, 1, color); +} + +// Draw rectangle lines within an image with line thickness +void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color) +{ + ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); + ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color); + ImageDrawRectangle(dst, (int)(rec.x + rec.width - thick), (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color); + ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + rec.height - thick), (int)rec.width, thick, color); +} + +// Draw circle within an image +void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color) +{ + int x = 0; + int y = radius; + int decesionParameter = 3 - 2*radius; + + while (y >= x) + { + ImageDrawRectangle(dst, centerX - x, centerY + y, x*2, 1, color); + ImageDrawRectangle(dst, centerX - x, centerY - y, x*2, 1, color); + ImageDrawRectangle(dst, centerX - y, centerY + x, y*2, 1, color); + ImageDrawRectangle(dst, centerX - y, centerY - x, y*2, 1, color); + x++; + + if (decesionParameter > 0) + { + y--; + decesionParameter = decesionParameter + 4*(x - y) + 10; + } + else decesionParameter = decesionParameter + 4*x + 6; + } +} + +// Draw circle within an image (Vector version) +void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color) +{ + ImageDrawCircle(dst, (int)center.x, (int)center.y, radius, color); +} + +// Draw circle outline within an image +void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color) +{ + int x = 0; + int y = radius; + int decesionParameter = 3 - 2*radius; + + while (y >= x) + { + ImageDrawPixel(dst, centerX + x, centerY + y, color); + ImageDrawPixel(dst, centerX - x, centerY + y, color); + ImageDrawPixel(dst, centerX + x, centerY - y, color); + ImageDrawPixel(dst, centerX - x, centerY - y, color); + ImageDrawPixel(dst, centerX + y, centerY + x, color); + ImageDrawPixel(dst, centerX - y, centerY + x, color); + ImageDrawPixel(dst, centerX + y, centerY - x, color); + ImageDrawPixel(dst, centerX - y, centerY - x, color); + x++; + + if (decesionParameter > 0) + { + y--; + decesionParameter = decesionParameter + 4*(x - y) + 10; + } + else decesionParameter = decesionParameter + 4*x + 6; + } +} + +// Draw circle outline within an image (Vector version) +void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) +{ + ImageDrawCircleLines(dst, (int)center.x, (int)center.y, radius, 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 ca0ba5505079f975b6e079084ded066b954124c4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 21:26:32 +0200 Subject: [PATCH 46/63] Reviewed parameter names, added comment about order --- src/raylib.h | 2 +- src/rshapes.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 857df2217..28b683cef 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1291,7 +1291,7 @@ RLAPI void DrawRectangleRec(Rectangle rec, Color color); RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight); // Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline RLAPI void DrawRectangleLinesEx(Rectangle rec, float thick, Color color); // Draw rectangle outline with line thickness RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges diff --git a/src/rshapes.c b/src/rshapes.c index 51bc15a60..12ae6a164 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -547,8 +547,8 @@ void DrawRectangleGradientH(int posX, int posY, int width, int height, Color lef DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right); } -// Draw a gradient-filled rectangle -void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight) +// Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order +void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4) { rlSetTexture(GetShapesTexture().id); Rectangle shapeRect = GetShapesTextureRectangle(); @@ -557,19 +557,19 @@ void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Col rlNormal3f(0.0f, 0.0f, 1.0f); // NOTE: Default raylib font character 95 is a white square - rlColor4ub(topLeft.r, topLeft.g, topLeft.b, topLeft.a); + rlColor4ub(col1.r, col1.g, col1.b, col1.a); rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); rlVertex2f(rec.x, rec.y); - rlColor4ub(bottomLeft.r, bottomLeft.g, bottomLeft.b, bottomLeft.a); + rlColor4ub(col2.r, col2.g, col2.b, col2.a); rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); rlVertex2f(rec.x, rec.y + rec.height); - rlColor4ub(bottomRight.r, bottomRight.g, bottomRight.b, bottomRight.a); + rlColor4ub(col3.r, col3.g, col3.b, col3.a); rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); rlVertex2f(rec.x + rec.width, rec.y + rec.height); - rlColor4ub(topRight.r, topRight.g, topRight.b, topRight.a); + rlColor4ub(col4.r, col4.g, col4.b, col4.a); rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); rlVertex2f(rec.x + rec.width, rec.y); rlEnd(); From 33b6f0f3a4f1854550660c545baff18990fe55d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:26:49 +0000 Subject: [PATCH 47/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 8 ++++---- tools/rlparser/output/raylib_api.lua | 8 ++++---- tools/rlparser/output/raylib_api.txt | 8 ++++---- tools/rlparser/output/raylib_api.xml | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 136c500b3..ad23d12c1 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -5947,19 +5947,19 @@ }, { "type": "Color", - "name": "topLeft" + "name": "col1" }, { "type": "Color", - "name": "bottomLeft" + "name": "col2" }, { "type": "Color", - "name": "bottomRight" + "name": "col3" }, { "type": "Color", - "name": "topRight" + "name": "col4" } ] }, diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 76b0e12f3..0e47d8c75 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -4979,10 +4979,10 @@ return { returnType = "void", params = { {type = "Rectangle", name = "rec"}, - {type = "Color", name = "topLeft"}, - {type = "Color", name = "bottomLeft"}, - {type = "Color", name = "bottomRight"}, - {type = "Color", name = "topRight"} + {type = "Color", name = "col1"}, + {type = "Color", name = "col2"}, + {type = "Color", name = "col3"}, + {type = "Color", name = "col4"} } }, { diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index c3516f6fd..8a929fbe2 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -2349,10 +2349,10 @@ Function 241: DrawRectangleGradientEx() (5 input parameters) Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order Param[1]: rec (type: Rectangle) - Param[2]: topLeft (type: Color) - Param[3]: bottomLeft (type: Color) - Param[4]: bottomRight (type: Color) - Param[5]: topRight (type: Color) + Param[2]: col1 (type: Color) + Param[3]: col2 (type: Color) + Param[4]: col3 (type: Color) + Param[5]: col4 (type: Color) Function 242: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 0848d94a4..a4253f9ed 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1473,10 +1473,10 @@ - - - - + + + + From 68c4b8a60f9adebe08e8320335acd0e43a7276ae Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 21:26:59 +0200 Subject: [PATCH 48/63] Removed old compatibility hack --- src/raylib.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index 28b683cef..4d95a7d61 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1080,7 +1080,6 @@ RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture) RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions -#define GetMouseRay GetScreenToWorldRay // Compatibility hack for previous raylib versions RLAPI Ray GetScreenToWorldRay(Vector2 position, Camera camera); // Get a ray trace from screen position (i.e mouse) RLAPI Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height); // Get a ray trace from screen position (i.e mouse) in a viewport RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get screen space position for a 3d world space position From 23433fe2dcdbd973a40de3ec0b4a35f9ad780df8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:29:06 +0000 Subject: [PATCH 49/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 6 ------ tools/rlparser/output/raylib_api.lua | 6 ------ tools/rlparser/output/raylib_api.txt | 7 +------ tools/rlparser/output/raylib_api.xml | 3 +-- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index ad23d12c1..aa753cafc 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -335,12 +335,6 @@ "type": "UNKNOWN", "value": "SHADER_LOC_MAP_METALNESS", "description": "" - }, - { - "name": "GetMouseRay", - "type": "UNKNOWN", - "value": "GetScreenToWorldRay", - "description": "Compatibility hack for previous raylib versions" } ], "structs": [ diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 0e47d8c75..2da8802ea 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -335,12 +335,6 @@ return { type = "UNKNOWN", value = "SHADER_LOC_MAP_METALNESS", description = "" - }, - { - name = "GetMouseRay", - type = "UNKNOWN", - value = "GetScreenToWorldRay", - description = "Compatibility hack for previous raylib versions" } }, structs = { diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 8a929fbe2..1414bcdc4 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -1,5 +1,5 @@ -Defines found: 57 +Defines found: 56 Define 001: RAYLIB_H Name: RAYLIB_H @@ -281,11 +281,6 @@ Define 056: SHADER_LOC_MAP_SPECULAR Type: UNKNOWN Value: SHADER_LOC_MAP_METALNESS Description: -Define 057: GetMouseRay - Name: GetMouseRay - Type: UNKNOWN - Value: GetScreenToWorldRay - Description: Compatibility hack for previous raylib versions Structures found: 35 diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index a4253f9ed..780708db4 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -1,6 +1,6 @@ - + @@ -57,7 +57,6 @@ - From e57663c937b9ffa938ea8eb0bf22a8e4d84a86d9 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 21:29:26 +0200 Subject: [PATCH 50/63] Update raylib.h --- src/raylib.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index 4d95a7d61..4ca169655 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1428,7 +1428,6 @@ RLAPI void ImageDrawTriangleGradient(Image *dst, Vector2 v1, Vector2 v2, Vector2 RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image RLAPI void ImageDrawTriangleFan(Image *dst, const 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, const 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 ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image 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 From 0e7cc36567b0f3c2b57d87004328220f4e95d88e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:29:40 +0000 Subject: [PATCH 51/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 27 -- tools/rlparser/output/raylib_api.lua | 12 - tools/rlparser/output/raylib_api.txt | 503 +++++++++++++------------- tools/rlparser/output/raylib_api.xml | 9 +- 4 files changed, 248 insertions(+), 303 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index aa753cafc..b5c16908a 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -8382,33 +8382,6 @@ } ] }, - { - "name": "ImageDraw", - "description": "Draw a source image within a destination image (tint applied to source)", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Image", - "name": "src" - }, - { - "type": "Rectangle", - "name": "srcRec" - }, - { - "type": "Rectangle", - "name": "dstRec" - }, - { - "type": "Color", - "name": "tint" - } - ] - }, { "name": "ImageDrawRectangle", "description": "Draw rectangle within an image", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 2da8802ea..65bd21cca 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -6198,18 +6198,6 @@ return { {type = "Color", name = "color"} } }, - { - name = "ImageDraw", - description = "Draw a source image within a destination image (tint applied to source)", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Image", name = "src"}, - {type = "Rectangle", name = "srcRec"}, - {type = "Rectangle", name = "dstRec"}, - {type = "Color", name = "tint"} - } - }, { name = "ImageDrawRectangle", description = "Draw rectangle within an image", diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 1414bcdc4..a737ccc2b 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -995,7 +995,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 605 +Functions found: 604 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3219,16 +3219,7 @@ Function 358: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 359: ImageDraw() (5 input parameters) - Name: ImageDraw - Return type: void - Description: Draw a source image within a destination image (tint applied to source) - Param[1]: dst (type: Image *) - Param[2]: src (type: Image) - Param[3]: srcRec (type: Rectangle) - Param[4]: dstRec (type: Rectangle) - Param[5]: tint (type: Color) -Function 360: ImageDrawRectangle() (6 input parameters) +Function 359: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3238,7 +3229,7 @@ Function 360: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 361: ImageDrawRectangleV() (4 input parameters) +Function 360: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3246,14 +3237,14 @@ Function 361: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 362: ImageDrawRectangleRec() (3 input parameters) +Function 361: 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 363: ImageDrawRectangleLines() (6 input parameters) +Function 362: ImageDrawRectangleLines() (6 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3263,7 +3254,7 @@ Function 363: ImageDrawRectangleLines() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 364: ImageDrawRectangleLinesEx() (4 input parameters) +Function 363: ImageDrawRectangleLinesEx() (4 input parameters) Name: ImageDrawRectangleLinesEx Return type: void Description: Draw rectangle lines within an image with line thickness @@ -3271,7 +3262,7 @@ Function 364: ImageDrawRectangleLinesEx() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 365: ImageDrawCircle() (5 input parameters) +Function 364: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3280,7 +3271,7 @@ Function 365: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 366: ImageDrawCircleV() (4 input parameters) +Function 365: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3288,7 +3279,7 @@ Function 366: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 367: ImageDrawCircleLines() (5 input parameters) +Function 366: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3297,7 +3288,7 @@ Function 367: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 368: ImageDrawCircleLinesV() (4 input parameters) +Function 367: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3305,7 +3296,7 @@ Function 368: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 369: ImageDraw() (5 input parameters) +Function 368: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image into a destination image (tint applied to source) @@ -3314,7 +3305,7 @@ Function 369: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 370: ImageDrawText() (6 input parameters) +Function 369: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3324,7 +3315,7 @@ Function 370: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 371: ImageDrawTextEx() (7 input parameters) +Function 370: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3335,79 +3326,79 @@ Function 371: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 372: LoadTexture() (1 input parameters) +Function 371: 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 373: LoadTextureFromImage() (1 input parameters) +Function 372: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 374: LoadTextureCubemap() (2 input parameters) +Function 373: 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 375: LoadRenderTexture() (2 input parameters) +Function 374: 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 376: IsTextureValid() (1 input parameters) +Function 375: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 377: UnloadTexture() (1 input parameters) +Function 376: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 378: IsRenderTextureValid() (1 input parameters) +Function 377: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 379: UnloadRenderTexture() (1 input parameters) +Function 378: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 380: UpdateTexture() (2 input parameters) +Function 379: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 381: UpdateTextureRec() (3 input parameters) +Function 380: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 382: GenTextureMipmaps() (1 input parameters) +Function 381: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 383: SetTextureFilter() (2 input parameters) +Function 382: 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 384: SetTextureWrap() (2 input parameters) +Function 383: 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 385: DrawTexture() (4 input parameters) +Function 384: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3415,14 +3406,14 @@ Function 385: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 386: DrawTextureV() (3 input parameters) +Function 385: 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 387: DrawTextureEx() (5 input parameters) +Function 386: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with rotation and scale @@ -3431,7 +3422,7 @@ Function 387: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 388: DrawTextureRec() (4 input parameters) +Function 387: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3439,7 +3430,7 @@ Function 388: DrawTextureRec() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 389: DrawTexturePro() (6 input parameters) +Function 388: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation @@ -3449,7 +3440,7 @@ Function 389: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 390: DrawTextureNPatch() (6 input parameters) +Function 389: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draw a texture (or part of it) that stretches or shrinks nicely @@ -3459,119 +3450,119 @@ Function 390: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 391: ColorIsEqual() (2 input parameters) +Function 390: 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 392: Fade() (2 input parameters) +Function 391: 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 393: ColorToInt() (1 input parameters) +Function 392: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 394: ColorNormalize() (1 input parameters) +Function 393: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 395: ColorFromNormalized() (1 input parameters) +Function 394: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 396: ColorToHSV() (1 input parameters) +Function 395: 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 397: ColorFromHSV() (3 input parameters) +Function 396: 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 398: ColorTint() (2 input parameters) +Function 397: 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 399: ColorBrightness() (2 input parameters) +Function 398: 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 400: ColorContrast() (2 input parameters) +Function 399: 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 401: ColorAlpha() (2 input parameters) +Function 400: 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 402: ColorAlphaBlend() (3 input parameters) +Function 401: 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 403: ColorLerp() (3 input parameters) +Function 402: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 404: GetColor() (1 input parameters) +Function 403: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 405: GetPixelColor() (2 input parameters) +Function 404: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) -Function 406: SetPixelColor() (3 input parameters) +Function 405: 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 407: GetPixelDataSize() (3 input parameters) +Function 406: 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 408: GetFontDefault() (0 input parameters) +Function 407: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 409: LoadFont() (1 input parameters) +Function 408: 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 410: LoadFontEx() (4 input parameters) +Function 409: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3579,14 +3570,14 @@ Function 410: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) Param[4]: codepointCount (type: int) -Function 411: LoadFontFromImage() (3 input parameters) +Function 410: 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 412: LoadFontFromMemory() (6 input parameters) +Function 411: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3596,12 +3587,12 @@ Function 412: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: const int *) Param[6]: codepointCount (type: int) -Function 413: IsFontValid() (1 input parameters) +Function 412: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 414: LoadFontData() (7 input parameters) +Function 413: LoadFontData() (7 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3612,7 +3603,7 @@ Function 414: LoadFontData() (7 input parameters) Param[5]: codepointCount (type: int) Param[6]: type (type: int) Param[7]: glyphCount (type: int *) -Function 415: GenImageFontAtlas() (6 input parameters) +Function 414: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3622,30 +3613,30 @@ Function 415: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 416: UnloadFontData() (2 input parameters) +Function 415: 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 417: UnloadFont() (1 input parameters) +Function 416: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 418: ExportFontAsCode() (2 input parameters) +Function 417: 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 419: DrawFPS() (2 input parameters) +Function 418: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 420: DrawText() (5 input parameters) +Function 419: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3654,7 +3645,7 @@ Function 420: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 421: DrawTextEx() (6 input parameters) +Function 420: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3664,7 +3655,7 @@ Function 421: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 422: DrawTextPro() (8 input parameters) +Function 421: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3676,7 +3667,7 @@ Function 422: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 423: DrawTextCodepoint() (5 input parameters) +Function 422: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3685,7 +3676,7 @@ Function 423: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 424: DrawTextCodepoints() (7 input parameters) +Function 423: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple characters (codepoint) @@ -3696,18 +3687,18 @@ Function 424: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 425: SetTextLineSpacing() (1 input parameters) +Function 424: 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 426: MeasureText() (2 input parameters) +Function 425: 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 427: MeasureTextEx() (4 input parameters) +Function 426: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3715,7 +3706,7 @@ Function 427: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 428: MeasureTextCodepoints() (5 input parameters) +Function 427: MeasureTextCodepoints() (5 input parameters) Name: MeasureTextCodepoints Return type: Vector2 Description: Measure string size for an existing array of codepoints for Font @@ -3724,144 +3715,144 @@ Function 428: MeasureTextCodepoints() (5 input parameters) Param[3]: length (type: int) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) -Function 429: GetGlyphIndex() (2 input parameters) +Function 428: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 430: GetGlyphInfo() (2 input parameters) +Function 429: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 431: GetGlyphAtlasRec() (2 input parameters) +Function 430: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 432: LoadUTF8() (2 input parameters) +Function 431: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 433: UnloadUTF8() (1 input parameters) +Function 432: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 434: LoadCodepoints() (2 input parameters) +Function 433: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 435: UnloadCodepoints() (1 input parameters) +Function 434: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 436: GetCodepointCount() (1 input parameters) +Function 435: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 437: GetCodepoint() (2 input parameters) +Function 436: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 438: GetCodepointNext() (2 input parameters) +Function 437: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 439: GetCodepointPrevious() (2 input parameters) +Function 438: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 440: CodepointToUTF8() (2 input parameters) +Function 439: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 441: LoadTextLines() (2 input parameters) +Function 440: LoadTextLines() (2 input parameters) Name: LoadTextLines Return type: char ** Description: Load text as separate lines ('\n') Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 442: UnloadTextLines() (2 input parameters) +Function 441: UnloadTextLines() (2 input parameters) Name: UnloadTextLines Return type: void Description: Unload text lines Param[1]: text (type: char **) Param[2]: lineCount (type: int) -Function 443: TextCopy() (2 input parameters) +Function 442: 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 444: TextIsEqual() (2 input parameters) +Function 443: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text strings are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 445: TextLength() (1 input parameters) +Function 444: 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 446: TextFormat() (2 input parameters) +Function 445: 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 447: TextSubtext() (3 input parameters) +Function 446: 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 448: TextRemoveSpaces() (1 input parameters) +Function 447: TextRemoveSpaces() (1 input parameters) Name: TextRemoveSpaces Return type: const char * Description: Remove text spaces, concat words Param[1]: text (type: const char *) -Function 449: GetTextBetween() (3 input parameters) +Function 448: GetTextBetween() (3 input parameters) Name: GetTextBetween Return type: char * Description: Get text between two strings Param[1]: text (type: const char *) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) -Function 450: TextReplace() (3 input parameters) +Function 449: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string with new string Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 451: TextReplaceAlloc() (3 input parameters) +Function 450: TextReplaceAlloc() (3 input parameters) Name: TextReplaceAlloc Return type: char * Description: Replace text string with new string, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 452: TextReplaceBetween() (4 input parameters) +Function 451: TextReplaceBetween() (4 input parameters) Name: TextReplaceBetween Return type: char * Description: Replace text between two specific strings @@ -3869,7 +3860,7 @@ Function 452: TextReplaceBetween() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 453: TextReplaceBetweenAlloc() (4 input parameters) +Function 452: TextReplaceBetweenAlloc() (4 input parameters) Name: TextReplaceBetweenAlloc Return type: char * Description: Replace text between two specific strings, memory must be MemFree() @@ -3877,96 +3868,96 @@ Function 453: TextReplaceBetweenAlloc() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 454: TextInsert() (3 input parameters) +Function 453: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a defined byte position Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 455: TextInsertAlloc() (3 input parameters) +Function 454: TextInsertAlloc() (3 input parameters) Name: TextInsertAlloc Return type: char * Description: Insert text in a defined byte position, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 456: TextJoin() (3 input parameters) +Function 455: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 457: TextSplit() (3 input parameters) +Function 456: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 458: TextAppend() (3 input parameters) +Function 457: 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 459: TextFindIndex() (2 input parameters) +Function 458: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string, -1 if not found Param[1]: text (type: const char *) Param[2]: search (type: const char *) -Function 460: TextToUpper() (1 input parameters) +Function 459: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 461: TextToLower() (1 input parameters) +Function 460: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 462: TextToPascal() (1 input parameters) +Function 461: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 463: TextToSnake() (1 input parameters) +Function 462: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 464: TextToCamel() (1 input parameters) +Function 463: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 465: TextToInteger() (1 input parameters) +Function 464: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 466: TextToFloat() (1 input parameters) +Function 465: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 467: DrawLine3D() (3 input parameters) +Function 466: 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 468: DrawPoint3D() (2 input parameters) +Function 467: 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 469: DrawCircle3D() (5 input parameters) +Function 468: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3975,7 +3966,7 @@ Function 469: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 470: DrawTriangle3D() (4 input parameters) +Function 469: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -3983,14 +3974,14 @@ Function 470: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 471: DrawTriangleStrip3D() (3 input parameters) +Function 470: 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 472: DrawCube() (5 input parameters) +Function 471: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3999,14 +3990,14 @@ Function 472: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 473: DrawCubeV() (3 input parameters) +Function 472: 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 474: DrawCubeWires() (5 input parameters) +Function 473: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -4015,21 +4006,21 @@ Function 474: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 475: DrawCubeWiresV() (3 input parameters) +Function 474: 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 476: DrawSphere() (3 input parameters) +Function 475: 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 477: DrawSphereEx() (5 input parameters) +Function 476: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with defined rings and slices @@ -4038,7 +4029,7 @@ Function 477: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 478: DrawSphereWires() (5 input parameters) +Function 477: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -4047,7 +4038,7 @@ Function 478: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 479: DrawCylinder() (6 input parameters) +Function 478: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -4057,7 +4048,7 @@ Function 479: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 480: DrawCylinderEx() (6 input parameters) +Function 479: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -4067,7 +4058,7 @@ Function 480: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 481: DrawCylinderWires() (6 input parameters) +Function 480: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -4077,7 +4068,7 @@ Function 481: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 482: DrawCylinderWiresEx() (6 input parameters) +Function 481: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -4087,7 +4078,7 @@ Function 482: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 483: DrawCapsule() (6 input parameters) +Function 482: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -4097,7 +4088,7 @@ Function 483: DrawCapsule() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 484: DrawCapsuleWires() (6 input parameters) +Function 483: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -4107,51 +4098,51 @@ Function 484: DrawCapsuleWires() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 485: DrawPlane() (3 input parameters) +Function 484: 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 486: DrawRay() (2 input parameters) +Function 485: 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 487: DrawGrid() (2 input parameters) +Function 486: 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 488: LoadModel() (1 input parameters) +Function 487: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 489: LoadModelFromMesh() (1 input parameters) +Function 488: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 490: IsModelValid() (1 input parameters) +Function 489: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 491: UnloadModel() (1 input parameters) +Function 490: 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 492: GetModelBoundingBox() (1 input parameters) +Function 491: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 493: DrawModel() (4 input parameters) +Function 492: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -4159,7 +4150,7 @@ Function 493: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 494: DrawModelEx() (6 input parameters) +Function 493: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with custom transform @@ -4169,7 +4160,7 @@ Function 494: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 495: DrawModelWires() (4 input parameters) +Function 494: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4177,7 +4168,7 @@ Function 495: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 496: DrawModelWiresEx() (6 input parameters) +Function 495: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires with custom transform @@ -4187,13 +4178,13 @@ Function 496: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 497: DrawBoundingBox() (2 input parameters) +Function 496: 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 498: DrawBillboard() (5 input parameters) +Function 497: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4202,7 +4193,7 @@ Function 498: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 499: DrawBillboardRec() (6 input parameters) +Function 498: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by rectangle @@ -4212,7 +4203,7 @@ Function 499: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 500: DrawBillboardPro() (9 input parameters) +Function 499: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source rectangle with scaling and rotation @@ -4225,13 +4216,13 @@ Function 500: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 501: UploadMesh() (2 input parameters) +Function 500: 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 502: UpdateMeshBuffer() (5 input parameters) +Function 501: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4240,19 +4231,19 @@ Function 502: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 503: UnloadMesh() (1 input parameters) +Function 502: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 504: DrawMesh() (3 input parameters) +Function 503: 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 505: DrawMeshInstanced() (4 input parameters) +Function 504: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4260,35 +4251,35 @@ Function 505: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 506: GetMeshBoundingBox() (1 input parameters) +Function 505: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 507: GenMeshTangents() (1 input parameters) +Function 506: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 508: ExportMesh() (2 input parameters) +Function 507: 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 509: ExportMeshAsCode() (2 input parameters) +Function 508: 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 510: GenMeshPoly() (2 input parameters) +Function 509: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 511: GenMeshPlane() (4 input parameters) +Function 510: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4296,42 +4287,42 @@ Function 511: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 512: GenMeshCube() (3 input parameters) +Function 511: 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 513: GenMeshSphere() (3 input parameters) +Function 512: 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 514: GenMeshHemiSphere() (3 input parameters) +Function 513: 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 515: GenMeshCylinder() (3 input parameters) +Function 514: 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 516: GenMeshCone() (3 input parameters) +Function 515: 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 517: GenMeshTorus() (4 input parameters) +Function 516: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4339,7 +4330,7 @@ Function 517: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 518: GenMeshKnot() (4 input parameters) +Function 517: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4347,67 +4338,67 @@ Function 518: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 519: GenMeshHeightmap() (2 input parameters) +Function 518: 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 520: GenMeshCubicmap() (2 input parameters) +Function 519: 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 521: LoadMaterials() (2 input parameters) +Function 520: 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 522: LoadMaterialDefault() (0 input parameters) +Function 521: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 523: IsMaterialValid() (1 input parameters) +Function 522: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 524: UnloadMaterial() (1 input parameters) +Function 523: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 525: SetMaterialTexture() (3 input parameters) +Function 524: 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 526: SetModelMeshMaterial() (3 input parameters) +Function 525: 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 527: LoadModelAnimations() (2 input parameters) +Function 526: 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 528: UpdateModelAnimation() (3 input parameters) +Function 527: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (vertex buffers and bone matrices) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: float) -Function 529: UpdateModelAnimationEx() (6 input parameters) +Function 528: UpdateModelAnimationEx() (6 input parameters) Name: UpdateModelAnimationEx Return type: void Description: Update model animation pose, blending two animations @@ -4417,19 +4408,19 @@ Function 529: UpdateModelAnimationEx() (6 input parameters) Param[4]: animB (type: ModelAnimation) Param[5]: frameB (type: float) Param[6]: blend (type: float) -Function 530: UnloadModelAnimations() (2 input parameters) +Function 529: 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 531: IsModelAnimationValid() (2 input parameters) +Function 530: 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 532: CheckCollisionSpheres() (4 input parameters) +Function 531: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4437,40 +4428,40 @@ Function 532: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 533: CheckCollisionBoxes() (2 input parameters) +Function 532: 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 534: CheckCollisionBoxSphere() (3 input parameters) +Function 533: 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 535: GetRayCollisionSphere() (3 input parameters) +Function 534: 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 536: GetRayCollisionBox() (2 input parameters) +Function 535: 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 537: GetRayCollisionMesh() (3 input parameters) +Function 536: 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 538: GetRayCollisionTriangle() (4 input parameters) +Function 537: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4478,7 +4469,7 @@ Function 538: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 539: GetRayCollisionQuad() (5 input parameters) +Function 538: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4487,158 +4478,158 @@ Function 539: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 540: InitAudioDevice() (0 input parameters) +Function 539: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 541: CloseAudioDevice() (0 input parameters) +Function 540: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 542: IsAudioDeviceReady() (0 input parameters) +Function 541: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 543: SetMasterVolume() (1 input parameters) +Function 542: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 544: GetMasterVolume() (0 input parameters) +Function 543: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 545: LoadWave() (1 input parameters) +Function 544: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 546: LoadWaveFromMemory() (3 input parameters) +Function 545: 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 547: IsWaveValid() (1 input parameters) +Function 546: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Check if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 548: LoadSound() (1 input parameters) +Function 547: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 549: LoadSoundFromWave() (1 input parameters) +Function 548: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 550: LoadSoundAlias() (1 input parameters) +Function 549: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 551: IsSoundValid() (1 input parameters) +Function 550: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 552: UpdateSound() (3 input parameters) +Function 551: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 553: UnloadWave() (1 input parameters) +Function 552: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 554: UnloadSound() (1 input parameters) +Function 553: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 555: UnloadSoundAlias() (1 input parameters) +Function 554: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 556: ExportWave() (2 input parameters) +Function 555: 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 557: ExportWaveAsCode() (2 input parameters) +Function 556: 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 558: PlaySound() (1 input parameters) +Function 557: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 559: StopSound() (1 input parameters) +Function 558: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 560: PauseSound() (1 input parameters) +Function 559: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 561: ResumeSound() (1 input parameters) +Function 560: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 562: IsSoundPlaying() (1 input parameters) +Function 561: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if sound is currently playing Param[1]: sound (type: Sound) -Function 563: SetSoundVolume() (2 input parameters) +Function 562: 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 564: SetSoundPitch() (2 input parameters) +Function 563: 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 565: SetSoundPan() (2 input parameters) +Function 564: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 566: WaveCopy() (1 input parameters) +Function 565: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 567: WaveCrop() (3 input parameters) +Function 566: 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 568: WaveFormat() (4 input parameters) +Function 567: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4646,203 +4637,203 @@ Function 568: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 569: LoadWaveSamples() (1 input parameters) +Function 568: 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 570: UnloadWaveSamples() (1 input parameters) +Function 569: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 571: LoadMusicStream() (1 input parameters) +Function 570: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 572: LoadMusicStreamFromMemory() (3 input parameters) +Function 571: 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 573: IsMusicValid() (1 input parameters) +Function 572: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 574: UnloadMusicStream() (1 input parameters) +Function 573: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 575: PlayMusicStream() (1 input parameters) +Function 574: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 576: IsMusicStreamPlaying() (1 input parameters) +Function 575: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 577: UpdateMusicStream() (1 input parameters) +Function 576: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Update buffers for music streaming Param[1]: music (type: Music) -Function 578: StopMusicStream() (1 input parameters) +Function 577: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 579: PauseMusicStream() (1 input parameters) +Function 578: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 580: ResumeMusicStream() (1 input parameters) +Function 579: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 581: SeekMusicStream() (2 input parameters) +Function 580: 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 582: SetMusicVolume() (2 input parameters) +Function 581: 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 583: SetMusicPitch() (2 input parameters) +Function 582: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 584: SetMusicPan() (2 input parameters) +Function 583: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 585: GetMusicTimeLength() (1 input parameters) +Function 584: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 586: GetMusicTimePlayed() (1 input parameters) +Function 585: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 587: LoadAudioStream() (3 input parameters) +Function 586: 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 588: IsAudioStreamValid() (1 input parameters) +Function 587: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Check if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 589: UnloadAudioStream() (1 input parameters) +Function 588: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 590: UpdateAudioStream() (3 input parameters) +Function 589: 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 591: IsAudioStreamProcessed() (1 input parameters) +Function 590: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 592: PlayAudioStream() (1 input parameters) +Function 591: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 593: PauseAudioStream() (1 input parameters) +Function 592: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 594: ResumeAudioStream() (1 input parameters) +Function 593: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 595: IsAudioStreamPlaying() (1 input parameters) +Function 594: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 596: StopAudioStream() (1 input parameters) +Function 595: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 597: SetAudioStreamVolume() (2 input parameters) +Function 596: 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 598: SetAudioStreamPitch() (2 input parameters) +Function 597: 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 599: SetAudioStreamPan() (2 input parameters) +Function 598: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 600: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 599: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 601: SetAudioStreamCallback() (2 input parameters) +Function 600: 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 602: AttachAudioStreamProcessor() (2 input parameters) +Function 601: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 603: DetachAudioStreamProcessor() (2 input parameters) +Function 602: 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 604: AttachAudioMixedProcessor() (1 input parameters) +Function 603: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 605: DetachAudioMixedProcessor() (1 input parameters) +Function 604: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index 780708db4..ea25d9f00 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -681,7 +681,7 @@ - + @@ -2113,13 +2113,6 @@ - - - - - - - From d9335f6a9533c6f792b58b4eab537fd10a797fcf Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 21:51:02 +0200 Subject: [PATCH 52/63] ADDED: TODO: `ImageDrawCircleGradient()` --- src/raylib.h | 2 ++ src/rtextures.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 4ca169655..ee71ee0ed 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1438,6 +1438,8 @@ RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color) RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image into a destination image (tint applied to source) +RLAPI void ImageDrawCircleGradient(Image *dst, Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-filled circle within an image + 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 69b743a71..cfd1d4019 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3942,6 +3942,12 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) } // Draw an image (source) within an image (destination) +// Draw a gradient-filled circle within an image +void ImageDrawCircleGradient(Image *dst, Vector2 center, float radius, Color inner, Color outer) +{ + // TODO: Implement gradient circle drawing +} + // NOTE: Color tint is applied to source image void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint) { From 26d82cf55da79d110bf7b568da576632c2e54449 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:51:18 +0000 Subject: [PATCH 53/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 27 ++ tools/rlparser/output/raylib_api.lua | 12 + tools/rlparser/output/raylib_api.txt | 483 +++++++++++++------------- tools/rlparser/output/raylib_api.xml | 9 +- 4 files changed, 293 insertions(+), 238 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index b5c16908a..639a8dbbd 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -8636,6 +8636,33 @@ } ] }, + { + "name": "ImageDrawCircleGradient", + "description": "Draw a gradient-filled circle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "inner" + }, + { + "type": "Color", + "name": "outer" + } + ] + }, { "name": "ImageDrawText", "description": "Draw text (using default font) within an image (destination)", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 65bd21cca..788b753c9 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -6314,6 +6314,18 @@ return { {type = "Color", name = "tint"} } }, + { + name = "ImageDrawCircleGradient", + description = "Draw a gradient-filled circle within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "center"}, + {type = "float", name = "radius"}, + {type = "Color", name = "inner"}, + {type = "Color", name = "outer"} + } + }, { name = "ImageDrawText", description = "Draw text (using default font) within an image (destination)", diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index a737ccc2b..d43467bf5 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -995,7 +995,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 604 +Functions found: 605 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3305,7 +3305,16 @@ Function 368: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 369: ImageDrawText() (6 input parameters) +Function 369: ImageDrawCircleGradient() (5 input parameters) + Name: ImageDrawCircleGradient + Return type: void + Description: Draw a gradient-filled circle within an image + Param[1]: dst (type: Image *) + Param[2]: center (type: Vector2) + Param[3]: radius (type: float) + Param[4]: inner (type: Color) + Param[5]: outer (type: Color) +Function 370: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3315,7 +3324,7 @@ Function 369: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 370: ImageDrawTextEx() (7 input parameters) +Function 371: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3326,79 +3335,79 @@ Function 370: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 371: LoadTexture() (1 input parameters) +Function 372: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 372: LoadTextureFromImage() (1 input parameters) +Function 373: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 373: LoadTextureCubemap() (2 input parameters) +Function 374: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 374: LoadRenderTexture() (2 input parameters) +Function 375: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 375: IsTextureValid() (1 input parameters) +Function 376: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 376: UnloadTexture() (1 input parameters) +Function 377: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 377: IsRenderTextureValid() (1 input parameters) +Function 378: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 378: UnloadRenderTexture() (1 input parameters) +Function 379: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 379: UpdateTexture() (2 input parameters) +Function 380: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 380: UpdateTextureRec() (3 input parameters) +Function 381: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 381: GenTextureMipmaps() (1 input parameters) +Function 382: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 382: SetTextureFilter() (2 input parameters) +Function 383: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 383: SetTextureWrap() (2 input parameters) +Function 384: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 384: DrawTexture() (4 input parameters) +Function 385: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3406,14 +3415,14 @@ Function 384: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 385: DrawTextureV() (3 input parameters) +Function 386: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 386: DrawTextureEx() (5 input parameters) +Function 387: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with rotation and scale @@ -3422,7 +3431,7 @@ Function 386: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 387: DrawTextureRec() (4 input parameters) +Function 388: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3430,7 +3439,7 @@ Function 387: DrawTextureRec() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 388: DrawTexturePro() (6 input parameters) +Function 389: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation @@ -3440,7 +3449,7 @@ Function 388: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 389: DrawTextureNPatch() (6 input parameters) +Function 390: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draw a texture (or part of it) that stretches or shrinks nicely @@ -3450,119 +3459,119 @@ Function 389: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 390: ColorIsEqual() (2 input parameters) +Function 391: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 391: Fade() (2 input parameters) +Function 392: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 392: ColorToInt() (1 input parameters) +Function 393: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 393: ColorNormalize() (1 input parameters) +Function 394: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 394: ColorFromNormalized() (1 input parameters) +Function 395: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 395: ColorToHSV() (1 input parameters) +Function 396: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 396: ColorFromHSV() (3 input parameters) +Function 397: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 397: ColorTint() (2 input parameters) +Function 398: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 398: ColorBrightness() (2 input parameters) +Function 399: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 399: ColorContrast() (2 input parameters) +Function 400: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 400: ColorAlpha() (2 input parameters) +Function 401: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 401: ColorAlphaBlend() (3 input parameters) +Function 402: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 402: ColorLerp() (3 input parameters) +Function 403: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 403: GetColor() (1 input parameters) +Function 404: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 404: GetPixelColor() (2 input parameters) +Function 405: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) -Function 405: SetPixelColor() (3 input parameters) +Function 406: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 406: GetPixelDataSize() (3 input parameters) +Function 407: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 407: GetFontDefault() (0 input parameters) +Function 408: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 408: LoadFont() (1 input parameters) +Function 409: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 409: LoadFontEx() (4 input parameters) +Function 410: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3570,14 +3579,14 @@ Function 409: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) Param[4]: codepointCount (type: int) -Function 410: LoadFontFromImage() (3 input parameters) +Function 411: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 411: LoadFontFromMemory() (6 input parameters) +Function 412: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3587,12 +3596,12 @@ Function 411: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: const int *) Param[6]: codepointCount (type: int) -Function 412: IsFontValid() (1 input parameters) +Function 413: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 413: LoadFontData() (7 input parameters) +Function 414: LoadFontData() (7 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3603,7 +3612,7 @@ Function 413: LoadFontData() (7 input parameters) Param[5]: codepointCount (type: int) Param[6]: type (type: int) Param[7]: glyphCount (type: int *) -Function 414: GenImageFontAtlas() (6 input parameters) +Function 415: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3613,30 +3622,30 @@ Function 414: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 415: UnloadFontData() (2 input parameters) +Function 416: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 416: UnloadFont() (1 input parameters) +Function 417: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 417: ExportFontAsCode() (2 input parameters) +Function 418: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 418: DrawFPS() (2 input parameters) +Function 419: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 419: DrawText() (5 input parameters) +Function 420: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3645,7 +3654,7 @@ Function 419: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 420: DrawTextEx() (6 input parameters) +Function 421: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3655,7 +3664,7 @@ Function 420: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 421: DrawTextPro() (8 input parameters) +Function 422: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3667,7 +3676,7 @@ Function 421: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 422: DrawTextCodepoint() (5 input parameters) +Function 423: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3676,7 +3685,7 @@ Function 422: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 423: DrawTextCodepoints() (7 input parameters) +Function 424: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple characters (codepoint) @@ -3687,18 +3696,18 @@ Function 423: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 424: SetTextLineSpacing() (1 input parameters) +Function 425: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 425: MeasureText() (2 input parameters) +Function 426: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 426: MeasureTextEx() (4 input parameters) +Function 427: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3706,7 +3715,7 @@ Function 426: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 427: MeasureTextCodepoints() (5 input parameters) +Function 428: MeasureTextCodepoints() (5 input parameters) Name: MeasureTextCodepoints Return type: Vector2 Description: Measure string size for an existing array of codepoints for Font @@ -3715,144 +3724,144 @@ Function 427: MeasureTextCodepoints() (5 input parameters) Param[3]: length (type: int) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) -Function 428: GetGlyphIndex() (2 input parameters) +Function 429: 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 429: GetGlyphInfo() (2 input parameters) +Function 430: 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 430: GetGlyphAtlasRec() (2 input parameters) +Function 431: 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 431: LoadUTF8() (2 input parameters) +Function 432: 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 432: UnloadUTF8() (1 input parameters) +Function 433: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 433: LoadCodepoints() (2 input parameters) +Function 434: 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 434: UnloadCodepoints() (1 input parameters) +Function 435: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 435: GetCodepointCount() (1 input parameters) +Function 436: 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 436: GetCodepoint() (2 input parameters) +Function 437: 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 437: GetCodepointNext() (2 input parameters) +Function 438: 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 438: GetCodepointPrevious() (2 input parameters) +Function 439: 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 439: CodepointToUTF8() (2 input parameters) +Function 440: 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 440: LoadTextLines() (2 input parameters) +Function 441: LoadTextLines() (2 input parameters) Name: LoadTextLines Return type: char ** Description: Load text as separate lines ('\n') Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 441: UnloadTextLines() (2 input parameters) +Function 442: UnloadTextLines() (2 input parameters) Name: UnloadTextLines Return type: void Description: Unload text lines Param[1]: text (type: char **) Param[2]: lineCount (type: int) -Function 442: TextCopy() (2 input parameters) +Function 443: 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 443: TextIsEqual() (2 input parameters) +Function 444: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text strings are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 444: TextLength() (1 input parameters) +Function 445: 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 445: TextFormat() (2 input parameters) +Function 446: 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 446: TextSubtext() (3 input parameters) +Function 447: 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 447: TextRemoveSpaces() (1 input parameters) +Function 448: TextRemoveSpaces() (1 input parameters) Name: TextRemoveSpaces Return type: const char * Description: Remove text spaces, concat words Param[1]: text (type: const char *) -Function 448: GetTextBetween() (3 input parameters) +Function 449: GetTextBetween() (3 input parameters) Name: GetTextBetween Return type: char * Description: Get text between two strings Param[1]: text (type: const char *) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) -Function 449: TextReplace() (3 input parameters) +Function 450: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string with new string Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 450: TextReplaceAlloc() (3 input parameters) +Function 451: TextReplaceAlloc() (3 input parameters) Name: TextReplaceAlloc Return type: char * Description: Replace text string with new string, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 451: TextReplaceBetween() (4 input parameters) +Function 452: TextReplaceBetween() (4 input parameters) Name: TextReplaceBetween Return type: char * Description: Replace text between two specific strings @@ -3860,7 +3869,7 @@ Function 451: TextReplaceBetween() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 452: TextReplaceBetweenAlloc() (4 input parameters) +Function 453: TextReplaceBetweenAlloc() (4 input parameters) Name: TextReplaceBetweenAlloc Return type: char * Description: Replace text between two specific strings, memory must be MemFree() @@ -3868,96 +3877,96 @@ Function 452: TextReplaceBetweenAlloc() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 453: TextInsert() (3 input parameters) +Function 454: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a defined byte position Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 454: TextInsertAlloc() (3 input parameters) +Function 455: TextInsertAlloc() (3 input parameters) Name: TextInsertAlloc Return type: char * Description: Insert text in a defined byte position, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 455: TextJoin() (3 input parameters) +Function 456: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 456: TextSplit() (3 input parameters) +Function 457: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 457: TextAppend() (3 input parameters) +Function 458: 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 458: TextFindIndex() (2 input parameters) +Function 459: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string, -1 if not found Param[1]: text (type: const char *) Param[2]: search (type: const char *) -Function 459: TextToUpper() (1 input parameters) +Function 460: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 460: TextToLower() (1 input parameters) +Function 461: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 461: TextToPascal() (1 input parameters) +Function 462: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 462: TextToSnake() (1 input parameters) +Function 463: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 463: TextToCamel() (1 input parameters) +Function 464: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 464: TextToInteger() (1 input parameters) +Function 465: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 465: TextToFloat() (1 input parameters) +Function 466: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 466: DrawLine3D() (3 input parameters) +Function 467: 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 467: DrawPoint3D() (2 input parameters) +Function 468: 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 468: DrawCircle3D() (5 input parameters) +Function 469: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3966,7 +3975,7 @@ Function 468: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 469: DrawTriangle3D() (4 input parameters) +Function 470: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -3974,14 +3983,14 @@ Function 469: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 470: DrawTriangleStrip3D() (3 input parameters) +Function 471: 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 471: DrawCube() (5 input parameters) +Function 472: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3990,14 +3999,14 @@ Function 471: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 472: DrawCubeV() (3 input parameters) +Function 473: 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 473: DrawCubeWires() (5 input parameters) +Function 474: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -4006,21 +4015,21 @@ Function 473: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 474: DrawCubeWiresV() (3 input parameters) +Function 475: 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 475: DrawSphere() (3 input parameters) +Function 476: 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 476: DrawSphereEx() (5 input parameters) +Function 477: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with defined rings and slices @@ -4029,7 +4038,7 @@ Function 476: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 477: DrawSphereWires() (5 input parameters) +Function 478: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -4038,7 +4047,7 @@ Function 477: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 478: DrawCylinder() (6 input parameters) +Function 479: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -4048,7 +4057,7 @@ Function 478: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 479: DrawCylinderEx() (6 input parameters) +Function 480: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -4058,7 +4067,7 @@ Function 479: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 480: DrawCylinderWires() (6 input parameters) +Function 481: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -4068,7 +4077,7 @@ Function 480: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 481: DrawCylinderWiresEx() (6 input parameters) +Function 482: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -4078,7 +4087,7 @@ Function 481: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 482: DrawCapsule() (6 input parameters) +Function 483: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -4088,7 +4097,7 @@ Function 482: DrawCapsule() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 483: DrawCapsuleWires() (6 input parameters) +Function 484: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -4098,51 +4107,51 @@ Function 483: DrawCapsuleWires() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 484: DrawPlane() (3 input parameters) +Function 485: 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 485: DrawRay() (2 input parameters) +Function 486: 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 486: DrawGrid() (2 input parameters) +Function 487: 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 487: LoadModel() (1 input parameters) +Function 488: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 488: LoadModelFromMesh() (1 input parameters) +Function 489: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 489: IsModelValid() (1 input parameters) +Function 490: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 490: UnloadModel() (1 input parameters) +Function 491: 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 491: GetModelBoundingBox() (1 input parameters) +Function 492: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 492: DrawModel() (4 input parameters) +Function 493: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -4150,7 +4159,7 @@ Function 492: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 493: DrawModelEx() (6 input parameters) +Function 494: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with custom transform @@ -4160,7 +4169,7 @@ Function 493: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 494: DrawModelWires() (4 input parameters) +Function 495: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4168,7 +4177,7 @@ Function 494: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 495: DrawModelWiresEx() (6 input parameters) +Function 496: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires with custom transform @@ -4178,13 +4187,13 @@ Function 495: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 496: DrawBoundingBox() (2 input parameters) +Function 497: 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 497: DrawBillboard() (5 input parameters) +Function 498: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4193,7 +4202,7 @@ Function 497: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 498: DrawBillboardRec() (6 input parameters) +Function 499: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by rectangle @@ -4203,7 +4212,7 @@ Function 498: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 499: DrawBillboardPro() (9 input parameters) +Function 500: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source rectangle with scaling and rotation @@ -4216,13 +4225,13 @@ Function 499: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 500: UploadMesh() (2 input parameters) +Function 501: 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 501: UpdateMeshBuffer() (5 input parameters) +Function 502: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4231,19 +4240,19 @@ Function 501: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 502: UnloadMesh() (1 input parameters) +Function 503: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 503: DrawMesh() (3 input parameters) +Function 504: 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 504: DrawMeshInstanced() (4 input parameters) +Function 505: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4251,35 +4260,35 @@ Function 504: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 505: GetMeshBoundingBox() (1 input parameters) +Function 506: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 506: GenMeshTangents() (1 input parameters) +Function 507: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 507: ExportMesh() (2 input parameters) +Function 508: 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 508: ExportMeshAsCode() (2 input parameters) +Function 509: 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 509: GenMeshPoly() (2 input parameters) +Function 510: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 510: GenMeshPlane() (4 input parameters) +Function 511: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4287,42 +4296,42 @@ Function 510: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 511: GenMeshCube() (3 input parameters) +Function 512: 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 512: GenMeshSphere() (3 input parameters) +Function 513: 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 513: GenMeshHemiSphere() (3 input parameters) +Function 514: 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 514: GenMeshCylinder() (3 input parameters) +Function 515: 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 515: GenMeshCone() (3 input parameters) +Function 516: 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 516: GenMeshTorus() (4 input parameters) +Function 517: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4330,7 +4339,7 @@ Function 516: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 517: GenMeshKnot() (4 input parameters) +Function 518: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4338,67 +4347,67 @@ Function 517: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 518: GenMeshHeightmap() (2 input parameters) +Function 519: 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 519: GenMeshCubicmap() (2 input parameters) +Function 520: 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 520: LoadMaterials() (2 input parameters) +Function 521: 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 521: LoadMaterialDefault() (0 input parameters) +Function 522: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 522: IsMaterialValid() (1 input parameters) +Function 523: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 523: UnloadMaterial() (1 input parameters) +Function 524: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 524: SetMaterialTexture() (3 input parameters) +Function 525: 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 525: SetModelMeshMaterial() (3 input parameters) +Function 526: 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 526: LoadModelAnimations() (2 input parameters) +Function 527: 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 527: UpdateModelAnimation() (3 input parameters) +Function 528: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (vertex buffers and bone matrices) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: float) -Function 528: UpdateModelAnimationEx() (6 input parameters) +Function 529: UpdateModelAnimationEx() (6 input parameters) Name: UpdateModelAnimationEx Return type: void Description: Update model animation pose, blending two animations @@ -4408,19 +4417,19 @@ Function 528: UpdateModelAnimationEx() (6 input parameters) Param[4]: animB (type: ModelAnimation) Param[5]: frameB (type: float) Param[6]: blend (type: float) -Function 529: UnloadModelAnimations() (2 input parameters) +Function 530: 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 530: IsModelAnimationValid() (2 input parameters) +Function 531: 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 531: CheckCollisionSpheres() (4 input parameters) +Function 532: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4428,40 +4437,40 @@ Function 531: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 532: CheckCollisionBoxes() (2 input parameters) +Function 533: 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 533: CheckCollisionBoxSphere() (3 input parameters) +Function 534: 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 534: GetRayCollisionSphere() (3 input parameters) +Function 535: 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 535: GetRayCollisionBox() (2 input parameters) +Function 536: 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 536: GetRayCollisionMesh() (3 input parameters) +Function 537: 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 537: GetRayCollisionTriangle() (4 input parameters) +Function 538: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4469,7 +4478,7 @@ Function 537: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 538: GetRayCollisionQuad() (5 input parameters) +Function 539: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4478,158 +4487,158 @@ Function 538: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 539: InitAudioDevice() (0 input parameters) +Function 540: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 540: CloseAudioDevice() (0 input parameters) +Function 541: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 541: IsAudioDeviceReady() (0 input parameters) +Function 542: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 542: SetMasterVolume() (1 input parameters) +Function 543: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 543: GetMasterVolume() (0 input parameters) +Function 544: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 544: LoadWave() (1 input parameters) +Function 545: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 545: LoadWaveFromMemory() (3 input parameters) +Function 546: 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 546: IsWaveValid() (1 input parameters) +Function 547: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Check if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 547: LoadSound() (1 input parameters) +Function 548: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 548: LoadSoundFromWave() (1 input parameters) +Function 549: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 549: LoadSoundAlias() (1 input parameters) +Function 550: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 550: IsSoundValid() (1 input parameters) +Function 551: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 551: UpdateSound() (3 input parameters) +Function 552: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 552: UnloadWave() (1 input parameters) +Function 553: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 553: UnloadSound() (1 input parameters) +Function 554: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 554: UnloadSoundAlias() (1 input parameters) +Function 555: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 555: ExportWave() (2 input parameters) +Function 556: 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 556: ExportWaveAsCode() (2 input parameters) +Function 557: 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 557: PlaySound() (1 input parameters) +Function 558: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 558: StopSound() (1 input parameters) +Function 559: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 559: PauseSound() (1 input parameters) +Function 560: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 560: ResumeSound() (1 input parameters) +Function 561: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 561: IsSoundPlaying() (1 input parameters) +Function 562: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if sound is currently playing Param[1]: sound (type: Sound) -Function 562: SetSoundVolume() (2 input parameters) +Function 563: 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 563: SetSoundPitch() (2 input parameters) +Function 564: 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 564: SetSoundPan() (2 input parameters) +Function 565: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 565: WaveCopy() (1 input parameters) +Function 566: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 566: WaveCrop() (3 input parameters) +Function 567: 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 567: WaveFormat() (4 input parameters) +Function 568: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4637,203 +4646,203 @@ Function 567: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 568: LoadWaveSamples() (1 input parameters) +Function 569: 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 569: UnloadWaveSamples() (1 input parameters) +Function 570: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 570: LoadMusicStream() (1 input parameters) +Function 571: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 571: LoadMusicStreamFromMemory() (3 input parameters) +Function 572: 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 572: IsMusicValid() (1 input parameters) +Function 573: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 573: UnloadMusicStream() (1 input parameters) +Function 574: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 574: PlayMusicStream() (1 input parameters) +Function 575: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 575: IsMusicStreamPlaying() (1 input parameters) +Function 576: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 576: UpdateMusicStream() (1 input parameters) +Function 577: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Update buffers for music streaming Param[1]: music (type: Music) -Function 577: StopMusicStream() (1 input parameters) +Function 578: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 578: PauseMusicStream() (1 input parameters) +Function 579: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 579: ResumeMusicStream() (1 input parameters) +Function 580: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 580: SeekMusicStream() (2 input parameters) +Function 581: 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 581: SetMusicVolume() (2 input parameters) +Function 582: 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 582: SetMusicPitch() (2 input parameters) +Function 583: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 583: SetMusicPan() (2 input parameters) +Function 584: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 584: GetMusicTimeLength() (1 input parameters) +Function 585: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 585: GetMusicTimePlayed() (1 input parameters) +Function 586: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 586: LoadAudioStream() (3 input parameters) +Function 587: 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 587: IsAudioStreamValid() (1 input parameters) +Function 588: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Check if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 588: UnloadAudioStream() (1 input parameters) +Function 589: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 589: UpdateAudioStream() (3 input parameters) +Function 590: 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 590: IsAudioStreamProcessed() (1 input parameters) +Function 591: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 591: PlayAudioStream() (1 input parameters) +Function 592: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 592: PauseAudioStream() (1 input parameters) +Function 593: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 593: ResumeAudioStream() (1 input parameters) +Function 594: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 594: IsAudioStreamPlaying() (1 input parameters) +Function 595: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 595: StopAudioStream() (1 input parameters) +Function 596: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 596: SetAudioStreamVolume() (2 input parameters) +Function 597: 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 597: SetAudioStreamPitch() (2 input parameters) +Function 598: 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 598: SetAudioStreamPan() (2 input parameters) +Function 599: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 599: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 600: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 600: SetAudioStreamCallback() (2 input parameters) +Function 601: 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 601: AttachAudioStreamProcessor() (2 input parameters) +Function 602: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 602: DetachAudioStreamProcessor() (2 input parameters) +Function 603: 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 603: AttachAudioMixedProcessor() (1 input parameters) +Function 604: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 604: DetachAudioMixedProcessor() (1 input parameters) +Function 605: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index ea25d9f00..f9525269b 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -681,7 +681,7 @@ - + @@ -2179,6 +2179,13 @@ + + + + + + + From aebfd788c7b343242ba6bb3f745a9277d57ff1b3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 21:53:07 +0200 Subject: [PATCH 54/63] WARNING: BREAKING: REDESIGNED: `ImageDraw()` API, align with `DrawTexture()` --- src/raylib.h | 4 +++- src/rtext.c | 2 +- src/rtextures.c | 31 ++++++++++++++++++++++++------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index ee71ee0ed..e49d6b2f7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1437,9 +1437,11 @@ RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Col 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 RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) -RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image into a destination image (tint applied to source) RLAPI void ImageDrawCircleGradient(Image *dst, Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-filled circle within an image +RLAPI void ImageDrawImage(Image *dst, Image src, int posX, int posY, Color tint); // Draw an image within an image +RLAPI void ImageDrawImageRec(Image *dst, Image src, Rectangle srcRec, Vector2 position, Color tint); // Draw a part of an image defined by a rectangle within an image +RLAPI void ImageDrawImagePro(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Vector2 origin, float rotation, Color tint); // Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image 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/rtext.c b/src/rtext.c index 79baa85e1..a7f715ba3 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2673,7 +2673,7 @@ static Font LoadBMFont(const char *fileName) { Rectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; Rectangle dstRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; - ImageDraw(&fullFont, imFonts[i], srcRec, dstRec, WHITE); + ImageDrawImagePro(&fullFont, imFonts[i], srcRec, dstRec, (Vector2){ 0 }, 0.0f, WHITE); } } diff --git a/src/rtextures.c b/src/rtextures.c index cfd1d4019..5b85401ee 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -1500,7 +1500,8 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co if ((codepoint != ' ') && (codepoint != '\t')) { Rectangle rec = { (float)(textOffsetX + font.glyphs[index].offsetX), (float)(textOffsetY + font.glyphs[index].offsetY), (float)font.recs[index].width, (float)font.recs[index].height }; - ImageDraw(&imText, font.glyphs[index].image, (Rectangle){ 0, 0, (float)font.glyphs[index].image.width, (float)font.glyphs[index].image.height }, rec, tint); + ImageDrawImagePro(&imText, font.glyphs[index].image, (Rectangle){ 0, 0, (float)font.glyphs[index].image.width, (float)font.glyphs[index].image.height }, + rec, (Vector2){ 0 }, 0.0f, tint); } if (font.glyphs[index].advanceX == 0) textOffsetX += (int)(font.recs[index].width + spacing); @@ -3941,15 +3942,31 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) ImageDrawCircleLines(dst, (int)center.x, (int)center.y, radius, color); } -// Draw an image (source) within an image (destination) // Draw a gradient-filled circle within an image void ImageDrawCircleGradient(Image *dst, Vector2 center, float radius, Color inner, Color outer) { // TODO: Implement gradient circle drawing } +// Draw an image within an image +void ImageDrawImage(Image *dst, Image src, int posX, int posY, Color tint) +{ + Rectangle srcRec = { 0, 0, src.width, src.height }; + Rectangle dstRec = { posX, posY, srcRec.width, srcRec.height }; + ImageDrawImagePro(dst, src, srcRec, dstRec, (Vector2){ 0 }, 0.0f, tint); +} + +// Draw a part of an image defined by a rectangle within an image +void ImageDrawImageRec(Image *dst, Image src, Rectangle srcRec, Vector2 position, Color tint) +{ + Rectangle dstRec = { position.x, position.y, srcRec.width, srcRec.height }; + ImageDrawImagePro(dst, src, srcRec, dstRec, (Vector2){ 0 }, 0.0f, tint); +} + +// Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image // NOTE: Color tint is applied to source image -void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint) +// TODO: WARNING: origin and rotation are not implemented +void ImageDrawImagePro(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Vector2 origin, float rotation, Color tint) { // Security check to avoid program crash if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0) || @@ -4010,7 +4027,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color // [x] Consider fast path: no alpha blending required cases (src has no alpha) // [x] Consider fast path: same src/dst format with no alpha -> direct line copy // [-] GetPixelColor(): Get Vector4 instead of Color, easier for ColorAlphaBlend() - // [ ] TODO: Support 16bit and 32bit (float) channels drawing + // [-] Support 16bit and 32bit (float) channels drawing Color colSrc = { 0 }; Color colDst = { 0 }; @@ -4094,7 +4111,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color mipmapDstRec.x /= 2; mipmapDstRec.y /= 2; - ImageDraw(&mipmapDst, mipmapSrc, mipmapSrcRec, mipmapDstRec, tint); + ImageDrawImagePro(&mipmapDst, mipmapSrc, mipmapSrcRec, mipmapDstRec, (Vector2){ 0 }, 0.0f, tint); } } } @@ -4121,7 +4138,7 @@ void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, Rectangle srcRec = { 0.0f, 0.0f, (float)imText.width, (float)imText.height }; Rectangle dstRec = { position.x, position.y, (float)imText.width, (float)imText.height }; - ImageDraw(dst, imText, srcRec, dstRec, WHITE); + ImageDrawImagePro(dst, imText, srcRec, dstRec, (Vector2){ 0 }, 0.0f, WHITE); UnloadImage(imText); } @@ -4247,7 +4264,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) ImageMipmaps(&faces); } - for (int i = 0; i < 6; i++) ImageDraw(&faces, mipmapped, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); + for (int i = 0; i < 6; i++) ImageDrawImagePro(&faces, mipmapped, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, (Vector2){ 0 }, 0.0f, WHITE); UnloadImage(mipmapped); } From 02869da279320aac5eb9eee517dc32da2aa67086 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:53:22 +0000 Subject: [PATCH 55/63] rlparser: update raylib_api.* by CI --- tools/rlparser/output/raylib_api.json | 116 ++++-- tools/rlparser/output/raylib_api.lua | 50 ++- tools/rlparser/output/raylib_api.txt | 514 +++++++++++++------------- tools/rlparser/output/raylib_api.xml | 32 +- 4 files changed, 418 insertions(+), 294 deletions(-) diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index 639a8dbbd..f26dac263 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -8609,33 +8609,6 @@ } ] }, - { - "name": "ImageDraw", - "description": "Draw a source image into a destination image (tint applied to source)", - "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Image", - "name": "src" - }, - { - "type": "Rectangle", - "name": "srcRec" - }, - { - "type": "Rectangle", - "name": "dstRec" - }, - { - "type": "Color", - "name": "tint" - } - ] - }, { "name": "ImageDrawCircleGradient", "description": "Draw a gradient-filled circle within an image", @@ -8663,6 +8636,95 @@ } ] }, + { + "name": "ImageDrawImage", + "description": "Draw an image within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Image", + "name": "src" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "ImageDrawImageRec", + "description": "Draw a part of an image defined by a rectangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Image", + "name": "src" + }, + { + "type": "Rectangle", + "name": "srcRec" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "ImageDrawImagePro", + "description": "Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Image", + "name": "src" + }, + { + "type": "Rectangle", + "name": "srcRec" + }, + { + "type": "Rectangle", + "name": "dstRec" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, { "name": "ImageDrawText", "description": "Draw text (using default font) within an image (destination)", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 788b753c9..8c26fcac6 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -6302,18 +6302,6 @@ return { {type = "Color", name = "color"} } }, - { - name = "ImageDraw", - description = "Draw a source image into a destination image (tint applied to source)", - returnType = "void", - params = { - {type = "Image *", name = "dst"}, - {type = "Image", name = "src"}, - {type = "Rectangle", name = "srcRec"}, - {type = "Rectangle", name = "dstRec"}, - {type = "Color", name = "tint"} - } - }, { name = "ImageDrawCircleGradient", description = "Draw a gradient-filled circle within an image", @@ -6326,6 +6314,44 @@ return { {type = "Color", name = "outer"} } }, + { + name = "ImageDrawImage", + description = "Draw an image within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Image", name = "src"}, + {type = "int", name = "posX"}, + {type = "int", name = "posY"}, + {type = "Color", name = "tint"} + } + }, + { + name = "ImageDrawImageRec", + description = "Draw a part of an image defined by a rectangle within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Image", name = "src"}, + {type = "Rectangle", name = "srcRec"}, + {type = "Vector2", name = "position"}, + {type = "Color", name = "tint"} + } + }, + { + name = "ImageDrawImagePro", + description = "Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Image", name = "src"}, + {type = "Rectangle", name = "srcRec"}, + {type = "Rectangle", name = "dstRec"}, + {type = "Vector2", name = "origin"}, + {type = "float", name = "rotation"}, + {type = "Color", name = "tint"} + } + }, { name = "ImageDrawText", description = "Draw text (using default font) within an image (destination)", diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index d43467bf5..52fd63710 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -995,7 +995,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 605 +Functions found: 607 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3296,16 +3296,7 @@ Function 367: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 368: ImageDraw() (5 input parameters) - Name: ImageDraw - Return type: void - Description: Draw a source image into a destination image (tint applied to source) - Param[1]: dst (type: Image *) - Param[2]: src (type: Image) - Param[3]: srcRec (type: Rectangle) - Param[4]: dstRec (type: Rectangle) - Param[5]: tint (type: Color) -Function 369: ImageDrawCircleGradient() (5 input parameters) +Function 368: ImageDrawCircleGradient() (5 input parameters) Name: ImageDrawCircleGradient Return type: void Description: Draw a gradient-filled circle within an image @@ -3314,7 +3305,36 @@ Function 369: ImageDrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 370: ImageDrawText() (6 input parameters) +Function 369: ImageDrawImage() (5 input parameters) + Name: ImageDrawImage + Return type: void + Description: Draw an image within an image + Param[1]: dst (type: Image *) + Param[2]: src (type: Image) + Param[3]: posX (type: int) + Param[4]: posY (type: int) + Param[5]: tint (type: Color) +Function 370: ImageDrawImageRec() (5 input parameters) + Name: ImageDrawImageRec + Return type: void + Description: Draw a part of an image defined by a rectangle within an image + Param[1]: dst (type: Image *) + Param[2]: src (type: Image) + Param[3]: srcRec (type: Rectangle) + Param[4]: position (type: Vector2) + Param[5]: tint (type: Color) +Function 371: ImageDrawImagePro() (7 input parameters) + Name: ImageDrawImagePro + Return type: void + Description: Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image + Param[1]: dst (type: Image *) + Param[2]: src (type: Image) + Param[3]: srcRec (type: Rectangle) + Param[4]: dstRec (type: Rectangle) + Param[5]: origin (type: Vector2) + Param[6]: rotation (type: float) + Param[7]: tint (type: Color) +Function 372: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3324,7 +3344,7 @@ Function 370: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 371: ImageDrawTextEx() (7 input parameters) +Function 373: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3335,79 +3355,79 @@ Function 371: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 372: LoadTexture() (1 input parameters) +Function 374: 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 373: LoadTextureFromImage() (1 input parameters) +Function 375: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 374: LoadTextureCubemap() (2 input parameters) +Function 376: 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 375: LoadRenderTexture() (2 input parameters) +Function 377: 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 376: IsTextureValid() (1 input parameters) +Function 378: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 377: UnloadTexture() (1 input parameters) +Function 379: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 378: IsRenderTextureValid() (1 input parameters) +Function 380: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 379: UnloadRenderTexture() (1 input parameters) +Function 381: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 380: UpdateTexture() (2 input parameters) +Function 382: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 381: UpdateTextureRec() (3 input parameters) +Function 383: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 382: GenTextureMipmaps() (1 input parameters) +Function 384: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 383: SetTextureFilter() (2 input parameters) +Function 385: 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 384: SetTextureWrap() (2 input parameters) +Function 386: 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 385: DrawTexture() (4 input parameters) +Function 387: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3415,14 +3435,14 @@ Function 385: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 386: DrawTextureV() (3 input parameters) +Function 388: 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 387: DrawTextureEx() (5 input parameters) +Function 389: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with rotation and scale @@ -3431,7 +3451,7 @@ Function 387: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 388: DrawTextureRec() (4 input parameters) +Function 390: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3439,7 +3459,7 @@ Function 388: DrawTextureRec() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 389: DrawTexturePro() (6 input parameters) +Function 391: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation @@ -3449,7 +3469,7 @@ Function 389: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 390: DrawTextureNPatch() (6 input parameters) +Function 392: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draw a texture (or part of it) that stretches or shrinks nicely @@ -3459,119 +3479,119 @@ Function 390: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 391: ColorIsEqual() (2 input parameters) +Function 393: 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 392: Fade() (2 input parameters) +Function 394: 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 393: ColorToInt() (1 input parameters) +Function 395: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 394: ColorNormalize() (1 input parameters) +Function 396: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 395: ColorFromNormalized() (1 input parameters) +Function 397: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 396: ColorToHSV() (1 input parameters) +Function 398: 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 397: ColorFromHSV() (3 input parameters) +Function 399: 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 398: ColorTint() (2 input parameters) +Function 400: 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 399: ColorBrightness() (2 input parameters) +Function 401: 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 400: ColorContrast() (2 input parameters) +Function 402: 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 401: ColorAlpha() (2 input parameters) +Function 403: 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 402: ColorAlphaBlend() (3 input parameters) +Function 404: 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 403: ColorLerp() (3 input parameters) +Function 405: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 404: GetColor() (1 input parameters) +Function 406: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 405: GetPixelColor() (2 input parameters) +Function 407: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) -Function 406: SetPixelColor() (3 input parameters) +Function 408: 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 407: GetPixelDataSize() (3 input parameters) +Function 409: 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 408: GetFontDefault() (0 input parameters) +Function 410: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 409: LoadFont() (1 input parameters) +Function 411: 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 410: LoadFontEx() (4 input parameters) +Function 412: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3579,14 +3599,14 @@ Function 410: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) Param[4]: codepointCount (type: int) -Function 411: LoadFontFromImage() (3 input parameters) +Function 413: 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 412: LoadFontFromMemory() (6 input parameters) +Function 414: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3596,12 +3616,12 @@ Function 412: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: const int *) Param[6]: codepointCount (type: int) -Function 413: IsFontValid() (1 input parameters) +Function 415: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 414: LoadFontData() (7 input parameters) +Function 416: LoadFontData() (7 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3612,7 +3632,7 @@ Function 414: LoadFontData() (7 input parameters) Param[5]: codepointCount (type: int) Param[6]: type (type: int) Param[7]: glyphCount (type: int *) -Function 415: GenImageFontAtlas() (6 input parameters) +Function 417: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3622,30 +3642,30 @@ Function 415: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 416: UnloadFontData() (2 input parameters) +Function 418: 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 417: UnloadFont() (1 input parameters) +Function 419: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 418: ExportFontAsCode() (2 input parameters) +Function 420: 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 419: DrawFPS() (2 input parameters) +Function 421: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 420: DrawText() (5 input parameters) +Function 422: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3654,7 +3674,7 @@ Function 420: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 421: DrawTextEx() (6 input parameters) +Function 423: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3664,7 +3684,7 @@ Function 421: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 422: DrawTextPro() (8 input parameters) +Function 424: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3676,7 +3696,7 @@ Function 422: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 423: DrawTextCodepoint() (5 input parameters) +Function 425: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3685,7 +3705,7 @@ Function 423: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 424: DrawTextCodepoints() (7 input parameters) +Function 426: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple characters (codepoint) @@ -3696,18 +3716,18 @@ Function 424: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 425: SetTextLineSpacing() (1 input parameters) +Function 427: 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 426: MeasureText() (2 input parameters) +Function 428: 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 427: MeasureTextEx() (4 input parameters) +Function 429: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3715,7 +3735,7 @@ Function 427: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 428: MeasureTextCodepoints() (5 input parameters) +Function 430: MeasureTextCodepoints() (5 input parameters) Name: MeasureTextCodepoints Return type: Vector2 Description: Measure string size for an existing array of codepoints for Font @@ -3724,144 +3744,144 @@ Function 428: MeasureTextCodepoints() (5 input parameters) Param[3]: length (type: int) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) -Function 429: GetGlyphIndex() (2 input parameters) +Function 431: 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 430: GetGlyphInfo() (2 input parameters) +Function 432: 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 431: GetGlyphAtlasRec() (2 input parameters) +Function 433: 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 432: LoadUTF8() (2 input parameters) +Function 434: 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 433: UnloadUTF8() (1 input parameters) +Function 435: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 434: LoadCodepoints() (2 input parameters) +Function 436: 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 435: UnloadCodepoints() (1 input parameters) +Function 437: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 436: GetCodepointCount() (1 input parameters) +Function 438: 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 437: GetCodepoint() (2 input parameters) +Function 439: 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 438: GetCodepointNext() (2 input parameters) +Function 440: 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 439: GetCodepointPrevious() (2 input parameters) +Function 441: 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 440: CodepointToUTF8() (2 input parameters) +Function 442: 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 441: LoadTextLines() (2 input parameters) +Function 443: LoadTextLines() (2 input parameters) Name: LoadTextLines Return type: char ** Description: Load text as separate lines ('\n') Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 442: UnloadTextLines() (2 input parameters) +Function 444: UnloadTextLines() (2 input parameters) Name: UnloadTextLines Return type: void Description: Unload text lines Param[1]: text (type: char **) Param[2]: lineCount (type: int) -Function 443: TextCopy() (2 input parameters) +Function 445: 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 444: TextIsEqual() (2 input parameters) +Function 446: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text strings are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 445: TextLength() (1 input parameters) +Function 447: 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 446: TextFormat() (2 input parameters) +Function 448: 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 447: TextSubtext() (3 input parameters) +Function 449: 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 448: TextRemoveSpaces() (1 input parameters) +Function 450: TextRemoveSpaces() (1 input parameters) Name: TextRemoveSpaces Return type: const char * Description: Remove text spaces, concat words Param[1]: text (type: const char *) -Function 449: GetTextBetween() (3 input parameters) +Function 451: GetTextBetween() (3 input parameters) Name: GetTextBetween Return type: char * Description: Get text between two strings Param[1]: text (type: const char *) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) -Function 450: TextReplace() (3 input parameters) +Function 452: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string with new string Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 451: TextReplaceAlloc() (3 input parameters) +Function 453: TextReplaceAlloc() (3 input parameters) Name: TextReplaceAlloc Return type: char * Description: Replace text string with new string, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 452: TextReplaceBetween() (4 input parameters) +Function 454: TextReplaceBetween() (4 input parameters) Name: TextReplaceBetween Return type: char * Description: Replace text between two specific strings @@ -3869,7 +3889,7 @@ Function 452: TextReplaceBetween() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 453: TextReplaceBetweenAlloc() (4 input parameters) +Function 455: TextReplaceBetweenAlloc() (4 input parameters) Name: TextReplaceBetweenAlloc Return type: char * Description: Replace text between two specific strings, memory must be MemFree() @@ -3877,96 +3897,96 @@ Function 453: TextReplaceBetweenAlloc() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 454: TextInsert() (3 input parameters) +Function 456: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a defined byte position Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 455: TextInsertAlloc() (3 input parameters) +Function 457: TextInsertAlloc() (3 input parameters) Name: TextInsertAlloc Return type: char * Description: Insert text in a defined byte position, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 456: TextJoin() (3 input parameters) +Function 458: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 457: TextSplit() (3 input parameters) +Function 459: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 458: TextAppend() (3 input parameters) +Function 460: 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 459: TextFindIndex() (2 input parameters) +Function 461: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string, -1 if not found Param[1]: text (type: const char *) Param[2]: search (type: const char *) -Function 460: TextToUpper() (1 input parameters) +Function 462: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 461: TextToLower() (1 input parameters) +Function 463: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 462: TextToPascal() (1 input parameters) +Function 464: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 463: TextToSnake() (1 input parameters) +Function 465: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 464: TextToCamel() (1 input parameters) +Function 466: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 465: TextToInteger() (1 input parameters) +Function 467: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 466: TextToFloat() (1 input parameters) +Function 468: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 467: DrawLine3D() (3 input parameters) +Function 469: 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 468: DrawPoint3D() (2 input parameters) +Function 470: 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 469: DrawCircle3D() (5 input parameters) +Function 471: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3975,7 +3995,7 @@ Function 469: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 470: DrawTriangle3D() (4 input parameters) +Function 472: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -3983,14 +4003,14 @@ Function 470: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 471: DrawTriangleStrip3D() (3 input parameters) +Function 473: 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 472: DrawCube() (5 input parameters) +Function 474: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3999,14 +4019,14 @@ Function 472: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 473: DrawCubeV() (3 input parameters) +Function 475: 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 474: DrawCubeWires() (5 input parameters) +Function 476: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -4015,21 +4035,21 @@ Function 474: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 475: DrawCubeWiresV() (3 input parameters) +Function 477: 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 476: DrawSphere() (3 input parameters) +Function 478: 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 477: DrawSphereEx() (5 input parameters) +Function 479: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with defined rings and slices @@ -4038,7 +4058,7 @@ Function 477: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 478: DrawSphereWires() (5 input parameters) +Function 480: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -4047,7 +4067,7 @@ Function 478: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 479: DrawCylinder() (6 input parameters) +Function 481: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -4057,7 +4077,7 @@ Function 479: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 480: DrawCylinderEx() (6 input parameters) +Function 482: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -4067,7 +4087,7 @@ Function 480: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 481: DrawCylinderWires() (6 input parameters) +Function 483: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -4077,7 +4097,7 @@ Function 481: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 482: DrawCylinderWiresEx() (6 input parameters) +Function 484: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -4087,7 +4107,7 @@ Function 482: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 483: DrawCapsule() (6 input parameters) +Function 485: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -4097,7 +4117,7 @@ Function 483: DrawCapsule() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 484: DrawCapsuleWires() (6 input parameters) +Function 486: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -4107,51 +4127,51 @@ Function 484: DrawCapsuleWires() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 485: DrawPlane() (3 input parameters) +Function 487: 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 486: DrawRay() (2 input parameters) +Function 488: 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 487: DrawGrid() (2 input parameters) +Function 489: 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 488: LoadModel() (1 input parameters) +Function 490: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 489: LoadModelFromMesh() (1 input parameters) +Function 491: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 490: IsModelValid() (1 input parameters) +Function 492: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 491: UnloadModel() (1 input parameters) +Function 493: 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 492: GetModelBoundingBox() (1 input parameters) +Function 494: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 493: DrawModel() (4 input parameters) +Function 495: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -4159,7 +4179,7 @@ Function 493: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 494: DrawModelEx() (6 input parameters) +Function 496: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with custom transform @@ -4169,7 +4189,7 @@ Function 494: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 495: DrawModelWires() (4 input parameters) +Function 497: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4177,7 +4197,7 @@ Function 495: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 496: DrawModelWiresEx() (6 input parameters) +Function 498: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires with custom transform @@ -4187,13 +4207,13 @@ Function 496: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 497: DrawBoundingBox() (2 input parameters) +Function 499: 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 498: DrawBillboard() (5 input parameters) +Function 500: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4202,7 +4222,7 @@ Function 498: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 499: DrawBillboardRec() (6 input parameters) +Function 501: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by rectangle @@ -4212,7 +4232,7 @@ Function 499: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 500: DrawBillboardPro() (9 input parameters) +Function 502: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source rectangle with scaling and rotation @@ -4225,13 +4245,13 @@ Function 500: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 501: UploadMesh() (2 input parameters) +Function 503: 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 502: UpdateMeshBuffer() (5 input parameters) +Function 504: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4240,19 +4260,19 @@ Function 502: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 503: UnloadMesh() (1 input parameters) +Function 505: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 504: DrawMesh() (3 input parameters) +Function 506: 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 505: DrawMeshInstanced() (4 input parameters) +Function 507: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4260,35 +4280,35 @@ Function 505: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 506: GetMeshBoundingBox() (1 input parameters) +Function 508: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 507: GenMeshTangents() (1 input parameters) +Function 509: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 508: ExportMesh() (2 input parameters) +Function 510: 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 509: ExportMeshAsCode() (2 input parameters) +Function 511: 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 510: GenMeshPoly() (2 input parameters) +Function 512: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 511: GenMeshPlane() (4 input parameters) +Function 513: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4296,42 +4316,42 @@ Function 511: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 512: GenMeshCube() (3 input parameters) +Function 514: 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 513: GenMeshSphere() (3 input parameters) +Function 515: 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 514: GenMeshHemiSphere() (3 input parameters) +Function 516: 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 515: GenMeshCylinder() (3 input parameters) +Function 517: 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 516: GenMeshCone() (3 input parameters) +Function 518: 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 517: GenMeshTorus() (4 input parameters) +Function 519: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4339,7 +4359,7 @@ Function 517: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 518: GenMeshKnot() (4 input parameters) +Function 520: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4347,67 +4367,67 @@ Function 518: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 519: GenMeshHeightmap() (2 input parameters) +Function 521: 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 520: GenMeshCubicmap() (2 input parameters) +Function 522: 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 521: LoadMaterials() (2 input parameters) +Function 523: 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 522: LoadMaterialDefault() (0 input parameters) +Function 524: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 523: IsMaterialValid() (1 input parameters) +Function 525: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 524: UnloadMaterial() (1 input parameters) +Function 526: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 525: SetMaterialTexture() (3 input parameters) +Function 527: 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 526: SetModelMeshMaterial() (3 input parameters) +Function 528: 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 527: LoadModelAnimations() (2 input parameters) +Function 529: 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 528: UpdateModelAnimation() (3 input parameters) +Function 530: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (vertex buffers and bone matrices) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: float) -Function 529: UpdateModelAnimationEx() (6 input parameters) +Function 531: UpdateModelAnimationEx() (6 input parameters) Name: UpdateModelAnimationEx Return type: void Description: Update model animation pose, blending two animations @@ -4417,19 +4437,19 @@ Function 529: UpdateModelAnimationEx() (6 input parameters) Param[4]: animB (type: ModelAnimation) Param[5]: frameB (type: float) Param[6]: blend (type: float) -Function 530: UnloadModelAnimations() (2 input parameters) +Function 532: 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 531: IsModelAnimationValid() (2 input parameters) +Function 533: 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 532: CheckCollisionSpheres() (4 input parameters) +Function 534: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4437,40 +4457,40 @@ Function 532: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 533: CheckCollisionBoxes() (2 input parameters) +Function 535: 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 534: CheckCollisionBoxSphere() (3 input parameters) +Function 536: 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 535: GetRayCollisionSphere() (3 input parameters) +Function 537: 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 536: GetRayCollisionBox() (2 input parameters) +Function 538: 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 537: GetRayCollisionMesh() (3 input parameters) +Function 539: 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 538: GetRayCollisionTriangle() (4 input parameters) +Function 540: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4478,7 +4498,7 @@ Function 538: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 539: GetRayCollisionQuad() (5 input parameters) +Function 541: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4487,158 +4507,158 @@ Function 539: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 540: InitAudioDevice() (0 input parameters) +Function 542: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 541: CloseAudioDevice() (0 input parameters) +Function 543: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 542: IsAudioDeviceReady() (0 input parameters) +Function 544: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 543: SetMasterVolume() (1 input parameters) +Function 545: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 544: GetMasterVolume() (0 input parameters) +Function 546: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 545: LoadWave() (1 input parameters) +Function 547: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 546: LoadWaveFromMemory() (3 input parameters) +Function 548: 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 547: IsWaveValid() (1 input parameters) +Function 549: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Check if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 548: LoadSound() (1 input parameters) +Function 550: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 549: LoadSoundFromWave() (1 input parameters) +Function 551: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 550: LoadSoundAlias() (1 input parameters) +Function 552: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 551: IsSoundValid() (1 input parameters) +Function 553: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 552: UpdateSound() (3 input parameters) +Function 554: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 553: UnloadWave() (1 input parameters) +Function 555: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 554: UnloadSound() (1 input parameters) +Function 556: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 555: UnloadSoundAlias() (1 input parameters) +Function 557: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 556: ExportWave() (2 input parameters) +Function 558: 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 557: ExportWaveAsCode() (2 input parameters) +Function 559: 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 558: PlaySound() (1 input parameters) +Function 560: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 559: StopSound() (1 input parameters) +Function 561: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 560: PauseSound() (1 input parameters) +Function 562: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 561: ResumeSound() (1 input parameters) +Function 563: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 562: IsSoundPlaying() (1 input parameters) +Function 564: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if sound is currently playing Param[1]: sound (type: Sound) -Function 563: SetSoundVolume() (2 input parameters) +Function 565: 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 564: SetSoundPitch() (2 input parameters) +Function 566: 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 565: SetSoundPan() (2 input parameters) +Function 567: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 566: WaveCopy() (1 input parameters) +Function 568: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 567: WaveCrop() (3 input parameters) +Function 569: 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 568: WaveFormat() (4 input parameters) +Function 570: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4646,203 +4666,203 @@ Function 568: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 569: LoadWaveSamples() (1 input parameters) +Function 571: 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 570: UnloadWaveSamples() (1 input parameters) +Function 572: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 571: LoadMusicStream() (1 input parameters) +Function 573: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 572: LoadMusicStreamFromMemory() (3 input parameters) +Function 574: 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 573: IsMusicValid() (1 input parameters) +Function 575: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 574: UnloadMusicStream() (1 input parameters) +Function 576: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 575: PlayMusicStream() (1 input parameters) +Function 577: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 576: IsMusicStreamPlaying() (1 input parameters) +Function 578: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 577: UpdateMusicStream() (1 input parameters) +Function 579: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Update buffers for music streaming Param[1]: music (type: Music) -Function 578: StopMusicStream() (1 input parameters) +Function 580: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 579: PauseMusicStream() (1 input parameters) +Function 581: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 580: ResumeMusicStream() (1 input parameters) +Function 582: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 581: SeekMusicStream() (2 input parameters) +Function 583: 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 582: SetMusicVolume() (2 input parameters) +Function 584: 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 583: SetMusicPitch() (2 input parameters) +Function 585: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 584: SetMusicPan() (2 input parameters) +Function 586: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 585: GetMusicTimeLength() (1 input parameters) +Function 587: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 586: GetMusicTimePlayed() (1 input parameters) +Function 588: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 587: LoadAudioStream() (3 input parameters) +Function 589: 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 588: IsAudioStreamValid() (1 input parameters) +Function 590: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Check if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 589: UnloadAudioStream() (1 input parameters) +Function 591: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 590: UpdateAudioStream() (3 input parameters) +Function 592: 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 591: IsAudioStreamProcessed() (1 input parameters) +Function 593: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 592: PlayAudioStream() (1 input parameters) +Function 594: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 593: PauseAudioStream() (1 input parameters) +Function 595: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 594: ResumeAudioStream() (1 input parameters) +Function 596: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 595: IsAudioStreamPlaying() (1 input parameters) +Function 597: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 596: StopAudioStream() (1 input parameters) +Function 598: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 597: SetAudioStreamVolume() (2 input parameters) +Function 599: 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 598: SetAudioStreamPitch() (2 input parameters) +Function 600: 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 599: SetAudioStreamPan() (2 input parameters) +Function 601: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 600: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 602: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 601: SetAudioStreamCallback() (2 input parameters) +Function 603: 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 602: AttachAudioStreamProcessor() (2 input parameters) +Function 604: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 603: DetachAudioStreamProcessor() (2 input parameters) +Function 605: 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 604: AttachAudioMixedProcessor() (1 input parameters) +Function 606: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 605: DetachAudioMixedProcessor() (1 input parameters) +Function 607: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index f9525269b..ec7711ee7 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -681,7 +681,7 @@ - + @@ -2172,13 +2172,6 @@ - - - - - - - @@ -2186,6 +2179,29 @@ + + + + + + + + + + + + + + + + + + + + + + + From 7c1b9d0a32a9ee9547e0d5a4e27219ab9ab3ccf8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 22:53:36 +0200 Subject: [PATCH 56/63] Update textures_image_drawing.c --- examples/textures/textures_image_drawing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/textures/textures_image_drawing.c b/examples/textures/textures_image_drawing.c index ea41b7baf..640a9c45c 100644 --- a/examples/textures/textures_image_drawing.c +++ b/examples/textures/textures_image_drawing.c @@ -39,7 +39,8 @@ int main(void) Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM) // Draw one image over the other with a scaling of 1.5f - ImageDraw(&parrots, cat, (Rectangle){ 0, 0, (float)cat.width, (float)cat.height }, (Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f }, WHITE); + ImageDrawImagePro(&parrots, cat, (Rectangle){ 0, 0, (float)cat.width, (float)cat.height }, + (Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f }, (Vector2){ 0 }, 0.0f, WHITE); ImageCrop(&parrots, (Rectangle){ 0, 50, (float)parrots.width, (float)parrots.height - 100 }); // Crop resulting image // Draw on the image with a few image draw methods From 9bd3d84f3db7a78b6f7fe915a6696d8de70fa383 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 22:59:20 +0200 Subject: [PATCH 57/63] Update models_basic_voxel.c --- examples/models/models_basic_voxel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/models/models_basic_voxel.c b/examples/models/models_basic_voxel.c index 127a7e989..8d8b6b0c7 100644 --- a/examples/models/models_basic_voxel.c +++ b/examples/models/models_basic_voxel.c @@ -77,7 +77,7 @@ int main(void) { // Cast a ray from the screen center (where crosshair would be) Vector2 screenCenter = { GetScreenWidth()/2.0f, GetScreenHeight()/2.0f }; - Ray ray = GetMouseRay(screenCenter, camera); + Ray ray = GetScreenToWorldRay(screenCenter, camera); // Check ray collision with all voxels float closestDistance = 99999.0f; From 8d31d0c3cc661c8116fcc3be5101a0a5b59c909d Mon Sep 17 00:00:00 2001 From: Thomas Anderson <5776225+CrackedPixel@users.noreply.github.com> Date: Tue, 9 Jun 2026 06:16:41 -0500 Subject: [PATCH 58/63] remove extra drflac_free (#5916) --- src/raudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raudio.c b/src/raudio.c index 3ae2fba0f..bc7955733 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1784,7 +1784,7 @@ void UnloadMusicStream(Music music) else if (music.ctxType == MUSIC_AUDIO_QOA) qoaplay_close((qoaplay_desc *)music.ctxData); #endif #if SUPPORT_FILEFORMAT_FLAC - else if (music.ctxType == MUSIC_AUDIO_FLAC) { drflac_close((drflac *)music.ctxData); drflac_free((drflac *)music.ctxData, NULL); } + else if (music.ctxType == MUSIC_AUDIO_FLAC) { drflac_close((drflac *)music.ctxData); } #endif #if SUPPORT_FILEFORMAT_XM else if (music.ctxType == MUSIC_MODULE_XM) jar_xm_free_context((jar_xm_context_t *)music.ctxData); From aeea213873c9fca0838f91fbfbc4c07959564ab0 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 9 Jun 2026 13:19:19 +0200 Subject: [PATCH 59/63] Update raudio.c --- src/raudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raudio.c b/src/raudio.c index bc7955733..7963eb33d 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1784,7 +1784,7 @@ void UnloadMusicStream(Music music) else if (music.ctxType == MUSIC_AUDIO_QOA) qoaplay_close((qoaplay_desc *)music.ctxData); #endif #if SUPPORT_FILEFORMAT_FLAC - else if (music.ctxType == MUSIC_AUDIO_FLAC) { drflac_close((drflac *)music.ctxData); } + else if (music.ctxType == MUSIC_AUDIO_FLAC) drflac_close((drflac *)music.ctxData); #endif #if SUPPORT_FILEFORMAT_XM else if (music.ctxType == MUSIC_MODULE_XM) jar_xm_free_context((jar_xm_context_t *)music.ctxData); From 444cc22633d9e65ae36775d89b6db6351b085ec6 Mon Sep 17 00:00:00 2001 From: Dz Date: Tue, 9 Jun 2026 20:57:52 +0800 Subject: [PATCH 60/63] update BINDINGS.md (#5917) Dart binding for Raylib: support hooks --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index 10c8d2ee3..7c393593c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -26,6 +26,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 | | [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT | | [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT | +| [raylib_dart](https://pub.dev/packages/raylib_dart) | 6.0 | [Dart](https://dart.dev) | MIT | | [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 | | [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 | | [raylib-d](https://github.com/schveiguy/raylib-d) | **6.0** | [D](https://dlang.org) | Zlib | From 94897c4eca842673bad16ab03ad776a0a2255b14 Mon Sep 17 00:00:00 2001 From: Thomas Anderson <5776225+CrackedPixel@users.noreply.github.com> Date: Wed, 10 Jun 2026 01:56:07 -0500 Subject: [PATCH 61/63] [platform/RGFW] update rgfw (#5919) * update rgfw + platform v1 * added drop events * updates --- src/external/RGFW/RGFW.h | 4340 +++++++++++++++------------- src/platforms/rcore_desktop_rgfw.c | 856 +++--- 2 files changed, 2729 insertions(+), 2467 deletions(-) diff --git a/src/external/RGFW/RGFW.h b/src/external/RGFW/RGFW.h index 427db0168..e114334e0 100644 --- a/src/external/RGFW/RGFW.h +++ b/src/external/RGFW/RGFW.h @@ -41,6 +41,7 @@ #define RGFW_X11 (optional) (unix only) if X11 should be used. This option is turned on by default by unix systems except for MacOS #define RGFW_WAYLAND (optional) (unix only) use Wayland. (This can be used with X11) + #define RGFW_NO_STATIC_CONTEXT - do not initalizize with a static variable, use the heap if RGFW is not manually initalized #define RGFW_NO_X11 (optional) (unix only) don't fallback to X11 when using Wayland #define RGFW_NO_LOAD_WGL (optional) (windows only) if WGL should be loaded dynamically during runtime #define RGFW_NO_X11_CURSOR (optional) (unix only) don't use XCursor @@ -55,10 +56,11 @@ #define RGFW_COCOA_GRAPHICS_SWITCHING - (optional) (cocoa) use automatic graphics switching (allow the system to choose to use GPU or iGPU) #define RGFW_COCOA_FRAME_NAME (optional) (cocoa) set frame name #define RGFW_NO_DPI - do not calculate DPI and don't use libShcore (win32) - #define RGFW_NO_XRANDR - do use XRandr (X11) #define RGFW_ADVANCED_SMOOTH_RESIZE - use advanced methods for smooth resizing (may result in a spike in memory usage or worse performance) (eg. WM_TIMER and XSyncValue) #define RGFW_NO_INFO - do not define the RGFW_info struct (without RGFW_IMPLEMENTATION) #define RGFW_NO_GLXWINDOW - do not use GLXWindow + #define RGFW_NO_ALLOCATE_MONITORS - do not allocate monitors on the heap at all (when there's no pre-allocated space left) + #define RGFW_NO_INCLUDE_VULKAN - do not include the Vulkan.h header, you have to include it yourself #define RGFW_ALLOC x - choose the default allocation function (defaults to standard malloc) #define RGFW_FREE x - choose the default deallocation function (defaults to standard free) @@ -69,32 +71,25 @@ #define RGFW_USE_INT - force the use c-types rather than stdint.h (for systems that might not have stdint.h (msvc)) #define RGFW_bool x - choose what type to use for bool, by default u32 is used + + #define RGFW_PREALLOCATED_MONITORS x - choose the default amount of pre-allocated monitors (can be zero) */ /* Example to get you started : -linux : gcc main.c -lX11 -lXrandr -lGL -windows : gcc main.c -lopengl32 -lgdi32 -macos : gcc main.c -framework Cocoa -framework CoreVideo -framework OpenGL -framework IOKit +linux : gcc main.c -lX11 -lXrandr -lm +windows : gcc main.c -lgdi32 +macos : gcc main.c -framework Cocoa -framework CoreVideo -framework IOKit #define RGFW_IMPLEMENTATION #include "RGFW.h" -u8 icon[4 * 3 * 3] = {0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF}; - int main() { - RGFW_window* win = RGFW_createWindow("name", 100, 100, 500, 500, (u64)0); - RGFW_event event; - - RGFW_window_setExitKey(win, RGFW_escape); - RGFW_window_setIcon(win, icon, 3, 3, RGFW_formatRGBA8); + RGFW_window* win = RGFW_createWindow("name", 100, 100, 500, 500, 0); while (RGFW_window_shouldClose(win) == RGFW_FALSE) { - while (RGFW_window_checkEvent(win, &event)) { - if (event.type == RGFW_quit) - break; - } + RGFW_pollEvents(); } RGFW_window_close(win); @@ -137,10 +132,6 @@ int main() { Credits : EimaMei/Sacode : Code review, helped with X11, MacOS and Windows support, Silicon, siliapp.h -> referencing - stb : This project is heavily inspired by the stb single header files - - SDL, GLFW and other online resources : reference implementations - contributors : (feel free to put yourself here if you contribute) krisvers (@krisvers) -> code review EimaMei (@SaCode) -> code review @@ -225,6 +216,18 @@ int main() { #define RGFW_MACOS #endif +#if defined(RGFW_X11) || defined(RGFW_WASM) || defined(RGFW_WAYLAND) + #ifndef _POSIX_C_SOURCE + #define _POSIX_C_SOURCE 199309L + #endif + + /* __USE_POSIX199309 is part of glibc internals, and isn't intended to be used outside. */ + /* However, existing RGFW code may depend on it implicitly. */ + #ifndef __USE_POSIX199309 + #define __USE_POSIX199309 + #endif +#endif + #ifndef RGFW_ASSERT #include #define RGFW_ASSERT assert @@ -235,25 +238,9 @@ int main() { #endif #if !defined(RGFW_SNPRINTF) && (defined(RGFW_X11) || defined(RGFW_WAYLAND)) - /* required for X11 errors */ #include - - #ifdef RGFW_C89 - #include - static int RGFW_c89_snprintf(char *dst, size_t size, const char *format, ...) { - va_list args; - size_t count = 0; - va_start(args, format); - count = (size_t)vsprintf(dst, format, args); - RGFW_ASSERT(count + 1 < size && "Buffer overflow"); - va_end(args); - return (int)count; - } - #define RGFW_SNPRINTF RGFW_c89_snprintf - #else - #define RGFW_SNPRINTF snprintf - #endif /*RGFW_C89*/ + #define RGFW_SNPRINTF snprintf #endif #ifndef RGFW_USERPTR @@ -282,12 +269,12 @@ int main() { #define RGFW_FREE free #endif -#if !defined(RGFW_MEMCPY) || !defined(RGFW_STRNCMP) || !defined(RGFW_STRNCPY) || !defined(RGFW_MEMSET) +#if !defined(RGFW_MEMCPY) || !defined(RGFW_STRNCMP) || !defined(RGFW_STRNCPY) || !defined(RGFW_MEMZERO) #include #endif -#ifndef RGFW_MEMSET - #define RGFW_MEMSET(ptr, value, num) memset(ptr, value, num) +#ifndef RGFW_MEMZERO + #define RGFW_MEMZERO(ptr, num) memset(ptr, 0, num) #endif #ifndef RGFW_MEMCPY @@ -319,19 +306,13 @@ int main() { #define RGFW_PRINTF printf #endif -#ifndef RGFW_MAX_PATH - #define RGFW_MAX_PATH 260 /* max length of a path (for drag andn drop) */ -#endif -#ifndef RGFW_MAX_DROPS - #define RGFW_MAX_DROPS 260 /* max items you can drop at once */ -#endif - #ifndef RGFW_MAX_EVENTS #define RGFW_MAX_EVENTS 32 #endif - -#ifndef RGFW_MAX_MONITORS - #define RGFW_MAX_MONITORS 6 +#ifndef RGFW_PREALLOCATED_MONITORS + #define RGFW_PREALLOCATED_MONITORS 6 /* the number of preallocated monitors */ +#elif defined(RGFW_NO_ALLOCATE_MONITORS) && (RGFW_PREALLOCATED_MONITORS == 0) + #warning RGFW monitors have no place to be allocated #endif #ifndef RGFW_COCOA_FRAME_NAME @@ -524,129 +505,129 @@ typedef void RGFW_mouse; /*! @brief RGFW's abstract keycodes */ typedef RGFW_ENUM(u8, RGFW_key) { RGFW_keyNULL = 0, - RGFW_escape = '\033', - RGFW_backtick = '`', - RGFW_0 = '0', - RGFW_1 = '1', - RGFW_2 = '2', - RGFW_3 = '3', - RGFW_4 = '4', - RGFW_5 = '5', - RGFW_6 = '6', - RGFW_7 = '7', - RGFW_8 = '8', - RGFW_9 = '9', - RGFW_minus = '-', - RGFW_equal = '=', - RGFW_equals = RGFW_equal, - RGFW_backSpace = '\b', - RGFW_tab = '\t', - RGFW_space = ' ', - RGFW_a = 'a', - RGFW_b = 'b', - RGFW_c = 'c', - RGFW_d = 'd', - RGFW_e = 'e', - RGFW_f = 'f', - RGFW_g = 'g', - RGFW_h = 'h', - RGFW_i = 'i', - RGFW_j = 'j', - RGFW_k = 'k', - RGFW_l = 'l', - RGFW_m = 'm', - RGFW_n = 'n', - RGFW_o = 'o', - RGFW_p = 'p', - RGFW_q = 'q', - RGFW_r = 'r', - RGFW_s = 's', - RGFW_t = 't', - RGFW_u = 'u', - RGFW_v = 'v', - RGFW_w = 'w', - RGFW_x = 'x', - RGFW_y = 'y', - RGFW_z = 'z', - RGFW_period = '.', - RGFW_comma = ',', - RGFW_slash = '/', - RGFW_bracket = '[', - RGFW_closeBracket = ']', - RGFW_semicolon = ';', - RGFW_apostrophe = '\'', - RGFW_backSlash = '\\', - RGFW_return = '\n', - RGFW_enter = RGFW_return, - RGFW_delete = '\177', /* 127 */ - RGFW_F1, - RGFW_F2, - RGFW_F3, - RGFW_F4, - RGFW_F5, - RGFW_F6, - RGFW_F7, - RGFW_F8, - RGFW_F9, - RGFW_F10, - RGFW_F11, - RGFW_F12, - RGFW_F13, - RGFW_F14, - RGFW_F15, - RGFW_F16, - RGFW_F17, - RGFW_F18, - RGFW_F19, - RGFW_F20, - RGFW_F21, - RGFW_F22, - RGFW_F23, - RGFW_F24, - RGFW_F25, - RGFW_capsLock, - RGFW_shiftL, - RGFW_controlL, - RGFW_altL, - RGFW_superL, - RGFW_shiftR, - RGFW_controlR, - RGFW_altR, - RGFW_superR, - RGFW_up, - RGFW_down, - RGFW_left, - RGFW_right, - RGFW_insert, - RGFW_menu, - RGFW_end, - RGFW_home, - RGFW_pageUp, - RGFW_pageDown, - RGFW_numLock, - RGFW_kpSlash, - RGFW_kpMultiply, - RGFW_kpPlus, - RGFW_kpMinus, - RGFW_kpEqual, - RGFW_kpEquals = RGFW_kpEqual, - RGFW_kp1, - RGFW_kp2, - RGFW_kp3, - RGFW_kp4, - RGFW_kp5, - RGFW_kp6, - RGFW_kp7, - RGFW_kp8, - RGFW_kp9, - RGFW_kp0, - RGFW_kpPeriod, - RGFW_kpReturn, - RGFW_scrollLock, - RGFW_printScreen, - RGFW_pause, - RGFW_world1, - RGFW_world2, + RGFW_keyEscape = '\033', + RGFW_keyBacktick = '`', + RGFW_key0 = '0', + RGFW_key1 = '1', + RGFW_key2 = '2', + RGFW_key3 = '3', + RGFW_key4 = '4', + RGFW_key5 = '5', + RGFW_key6 = '6', + RGFW_key7 = '7', + RGFW_key8 = '8', + RGFW_key9 = '9', + RGFW_keyMinus = '-', + RGFW_keyEqual = '=', + RGFW_keyEquals = RGFW_keyEqual, + RGFW_keyBackSpace = '\b', + RGFW_keyTab = '\t', + RGFW_keySpace = ' ', + RGFW_keyA = 'a', + RGFW_keyB = 'b', + RGFW_keyC = 'c', + RGFW_keyD = 'd', + RGFW_keyE = 'e', + RGFW_keyF = 'f', + RGFW_keyG = 'g', + RGFW_keyH = 'h', + RGFW_keyI = 'i', + RGFW_keyJ = 'j', + RGFW_keyK = 'k', + RGFW_keyL = 'l', + RGFW_keyM = 'm', + RGFW_keyN = 'n', + RGFW_keyO = 'o', + RGFW_keyP = 'p', + RGFW_keyQ = 'q', + RGFW_keyR = 'r', + RGFW_keyS = 's', + RGFW_keyT = 't', + RGFW_keyU = 'u', + RGFW_keyV = 'v', + RGFW_keyW = 'w', + RGFW_keyX = 'x', + RGFW_keyY = 'y', + RGFW_keyZ = 'z', + RGFW_keyPeriod = '.', + RGFW_keyComma = ',', + RGFW_keySlash = '/', + RGFW_keyBracket = '[', + RGFW_keyCloseBracket = ']', + RGFW_keySemicolon = ';', + RGFW_keyApostrophe = '\'', + RGFW_keyBackSlash = '\\', + RGFW_keyReturn = '\n', + RGFW_keyEnter = RGFW_keyReturn, + RGFW_keyDelete = '\177', /* 127 */ + RGFW_keyF1, + RGFW_keyF2, + RGFW_keyF3, + RGFW_keyF4, + RGFW_keyF5, + RGFW_keyF6, + RGFW_keyF7, + RGFW_keyF8, + RGFW_keyF9, + RGFW_keyF10, + RGFW_keyF11, + RGFW_keyF12, + RGFW_keyF13, + RGFW_keyF14, + RGFW_keyF15, + RGFW_keyF16, + RGFW_keyF17, + RGFW_keyF18, + RGFW_keyF19, + RGFW_keyF20, + RGFW_keyF21, + RGFW_keyF22, + RGFW_keyF23, + RGFW_keyF24, + RGFW_keyF25, + RGFW_keyCapsLock, + RGFW_keyShiftL, + RGFW_keyControlL, + RGFW_keyAltL, + RGFW_keySuperL, + RGFW_keyShiftR, + RGFW_keyControlR, + RGFW_keyAltR, + RGFW_keySuperR, + RGFW_keyUp, + RGFW_keyDown, + RGFW_keyLeft, + RGFW_keyRight, + RGFW_keyInsert, + RGFW_keyMenu, + RGFW_keyEnd, + RGFW_keyHome, + RGFW_keyPageUp, + RGFW_keyPageDown, + RGFW_keyNumLock, + RGFW_keyPadSlash, + RGFW_keyPadMultiply, + RGFW_keyPadPlus, + RGFW_keyPadMinus, + RGFW_keyPadEqual, + RGFW_keyPadEquals = RGFW_keyPadEqual, + RGFW_keyPad1, + RGFW_keyPad2, + RGFW_keyPad3, + RGFW_keyPad4, + RGFW_keyPad5, + RGFW_keyPad6, + RGFW_keyPad7, + RGFW_keyPad8, + RGFW_keyPad9, + RGFW_keyPad0, + RGFW_keyPadPeriod, + RGFW_keyPadReturn, + RGFW_keyScrollLock, + RGFW_keyPrintScreen, + RGFW_keyPause, + RGFW_keyWorld1, + RGFW_keyWorld2, RGFW_keyLast = 256 /* padding for alignment ~(175 by default) */ }; @@ -670,6 +651,32 @@ typedef RGFW_ENUM(u8, RGFW_keymod) { RGFW_modScrollLock = RGFW_BIT(6) }; +/*! types of dnd drag actions */ +typedef RGFW_ENUM(u8, RGFW_dndActionType) { + RGFW_dndActionNone = 0, + RGFW_dndActionEnter, /*!< data has been dragged into the window area */ + RGFW_dndActionMove, /*!< the data that was dragged into the window area has moved inside the window */ + RGFW_dndActionExit, /*!< the data that was dragged into the window area has left the window */ +}; + +/*! types of transfered data (clipboard, dnd) */ +typedef RGFW_ENUM(u8, RGFW_dataTransferType) { + RGFW_dataNone = 0, + RGFW_dataText, /*!< plain text string */ + RGFW_dataFile, /*!< file string */ + RGFW_dataURL, /*!< URL string */ + RGFW_dataImage, /*!< raw image data */ + RGFW_dataUnknown /*!< unknown raw data */ +}; + +/*! internal node for a individual data drop */ +typedef struct RGFW_dataDropNode { + const char* data; /*!< dropped data */ + size_t size; /*!< the size of the data in bytes */ + RGFW_dataTransferType type; /*!< the type of data being dropped */ + struct RGFW_dataDropNode* next; /*!< the next drop data node if any [when handling callbacks, this will always be NULL because the linked list is built as events are processed] */ +} RGFW_dataDropNode; + /*! @brief codes for the event types that can be sent */ typedef RGFW_ENUM(u8, RGFW_eventType) { RGFW_eventNone = 0, /*!< no event has been sent */ @@ -679,44 +686,29 @@ typedef RGFW_ENUM(u8, RGFW_eventType) { RGFW_mouseButtonPressed, /*!< a mouse button has been pressed (left,middle,right) */ RGFW_mouseButtonReleased, /*!< a mouse button has been released (left,middle,right) */ RGFW_mouseScroll, /*!< a mouse scroll event */ - RGFW_mousePosChanged, /*!< the position of the mouse has been changed */ - /*! mouse event note - the x and y of the mouse can be found in the vector, RGFW_x, y - - RGFW_event.button.value holds which mouse button was pressed - */ + RGFW_mouseMotion, /*!< the position of the mouse has been changed / the mouse has moved */ + RGFW_mouseRawMotion, /*!< raw mouse motion */ + RGFW_mouseEnter, /*!< mouse entered the window */ + RGFW_mouseLeave, /*!< mouse left the window */ RGFW_windowMoved, /*!< the window was moved (by the user) */ RGFW_windowResized, /*!< the window was resized (by the user), [on WASM this means the browser was resized] */ - RGFW_focusIn, /*!< window is in focus now */ - RGFW_focusOut, /*!< window is out of focus now */ - RGFW_mouseEnter, /* mouse entered the window */ - RGFW_mouseLeave, /* mouse left the window */ - RGFW_windowRefresh, /* The window content needs to be refreshed */ - - /* attribs change event note - The event data is sent straight to the window structure - with win->x, win->y, win->w and win->h - */ - RGFW_quit, /*!< the user clicked the quit button */ - RGFW_dataDrop, /*!< a file has been dropped into the window */ - RGFW_dataDrag, /*!< the start of a drag and drop event, when the file is being dragged */ - /* drop data note - The x and y coords of the drop are stored in the vector RGFW_x, y - - RGFW_event.drop.count holds how many files were dropped - - This is also the size of the array which stores all the dropped file string, - RGFW_event.drop.files - */ + RGFW_windowFocusIn, /*!< window is in focus now */ + RGFW_windowFocusOut, /*!< window is out of focus now */ + RGFW_windowRefresh, /*!< The window content needs to be refreshed */ + RGFW_windowClose, /*!< the user attempts to close the window */ RGFW_windowMaximized, /*!< the window was maximized */ RGFW_windowMinimized, /*!< the window was minimized */ RGFW_windowRestored, /*!< the window was restored */ + RGFW_dataDrop, /*!< data has been dropped into the window */ + RGFW_dataDrag, /*!< the start of a drag and drop event, when data is being dragged */ RGFW_scaleUpdated, /*!< content scale factor changed */ RGFW_monitorConnected, /*!< a monitor has been connected */ - RGFW_monitorDisconnected /*!< a monitor has been disconnected */ + RGFW_monitorDisconnected, /*!< a monitor has been disconnected */ + RGFW_eventCount, /*!< the number of event types there are */ + RGFW_mousePosChanged = RGFW_mouseMotion, /*!< alias for RGFW_mouseMotion (may be deleted at some point) */ }; -/*! @brief flags for toggling wether or not an event should be processed */ +/*! @brief flags for toggling whether or not an event should be processed */ typedef RGFW_ENUM(u32, RGFW_eventFlag) { RGFW_keyPressedFlag = RGFW_BIT(RGFW_keyPressed), RGFW_keyReleasedFlag = RGFW_BIT(RGFW_keyReleased), @@ -724,31 +716,33 @@ typedef RGFW_ENUM(u32, RGFW_eventFlag) { RGFW_mouseScrollFlag = RGFW_BIT(RGFW_mouseScroll), RGFW_mouseButtonPressedFlag = RGFW_BIT(RGFW_mouseButtonPressed), RGFW_mouseButtonReleasedFlag = RGFW_BIT(RGFW_mouseButtonReleased), - RGFW_mousePosChangedFlag = RGFW_BIT(RGFW_mousePosChanged), + RGFW_mouseMotionFlag = RGFW_BIT(RGFW_mouseMotion), + RGFW_mouseRawMotionFlag = RGFW_BIT(RGFW_mouseRawMotion), RGFW_mouseEnterFlag = RGFW_BIT(RGFW_mouseEnter), RGFW_mouseLeaveFlag = RGFW_BIT(RGFW_mouseLeave), RGFW_windowMovedFlag = RGFW_BIT(RGFW_windowMoved), RGFW_windowResizedFlag = RGFW_BIT(RGFW_windowResized), - RGFW_focusInFlag = RGFW_BIT(RGFW_focusIn), - RGFW_focusOutFlag = RGFW_BIT(RGFW_focusOut), + RGFW_windowFocusInFlag = RGFW_BIT(RGFW_windowFocusIn), + RGFW_windowFocusOutFlag = RGFW_BIT(RGFW_windowFocusOut), RGFW_windowRefreshFlag = RGFW_BIT(RGFW_windowRefresh), RGFW_windowMaximizedFlag = RGFW_BIT(RGFW_windowMaximized), RGFW_windowMinimizedFlag = RGFW_BIT(RGFW_windowMinimized), RGFW_windowRestoredFlag = RGFW_BIT(RGFW_windowRestored), RGFW_scaleUpdatedFlag = RGFW_BIT(RGFW_scaleUpdated), - RGFW_quitFlag = RGFW_BIT(RGFW_quit), + RGFW_windowCloseFlag = RGFW_BIT(RGFW_windowClose), RGFW_dataDropFlag = RGFW_BIT(RGFW_dataDrop), RGFW_dataDragFlag = RGFW_BIT(RGFW_dataDrag), RGFW_monitorConnectedFlag = RGFW_BIT(RGFW_monitorConnected), RGFW_monitorDisconnectedFlag = RGFW_BIT(RGFW_monitorDisconnected), + RGFW_mousePosChangedFlag = RGFW_mouseMotionFlag, /* alias for RGFW_mouseMotionFlag (may be deleted at some point) */ RGFW_keyEventsFlag = RGFW_keyPressedFlag | RGFW_keyReleasedFlag | RGFW_keyCharFlag, - RGFW_mouseEventsFlag = RGFW_mouseButtonPressedFlag | RGFW_mouseButtonReleasedFlag | RGFW_mousePosChangedFlag | RGFW_mouseEnterFlag | RGFW_mouseLeaveFlag | RGFW_mouseScrollFlag , + RGFW_mouseEventsFlag = RGFW_mouseButtonPressedFlag | RGFW_mouseButtonReleasedFlag | RGFW_mouseMotionFlag | RGFW_mouseEnterFlag | RGFW_mouseLeaveFlag | RGFW_mouseScrollFlag | RGFW_mouseRawMotionFlag, RGFW_windowEventsFlag = RGFW_windowMovedFlag | RGFW_windowResizedFlag | RGFW_windowRefreshFlag | RGFW_windowMaximizedFlag | RGFW_windowMinimizedFlag | RGFW_windowRestoredFlag | RGFW_scaleUpdatedFlag, - RGFW_focusEventsFlag = RGFW_focusInFlag | RGFW_focusOutFlag, - RGFW_dataDropEventsFlag = RGFW_dataDropFlag | RGFW_dataDragFlag, + RGFW_windowFocusEventsFlag = RGFW_windowFocusInFlag | RGFW_windowFocusOutFlag, + RGFW_dataDragDropEventsFlag = RGFW_dataDropFlag | RGFW_dataDragFlag, RGFW_monitorEventsFlag = RGFW_monitorConnectedFlag | RGFW_monitorDisconnectedFlag, - RGFW_allEventFlags = RGFW_keyEventsFlag | RGFW_mouseEventsFlag | RGFW_windowEventsFlag | RGFW_focusEventsFlag | RGFW_dataDropEventsFlag | RGFW_quitFlag | RGFW_monitorEventsFlag + RGFW_allEventFlags = RGFW_keyEventsFlag | RGFW_mouseEventsFlag | RGFW_windowEventsFlag | RGFW_windowFocusEventsFlag | RGFW_dataDragDropEventsFlag | RGFW_windowCloseFlag | RGFW_monitorEventsFlag }; /*! Event structure(s) and union for checking/getting events */ @@ -759,27 +753,35 @@ typedef struct RGFW_commonEvent { RGFW_window* win; /*!< the window this event applies to (for event queue events) */ } RGFW_commonEvent; +/*! @brief event data for all focus events */ +typedef struct RGFW_windowFocusEvent { + RGFW_eventType type; /*!< which event has been sent?*/ + RGFW_window* win; /*!< the window this event applies to (for event queue events) */ + RGFW_bool state; /*!< wether or not the window is in focus or not */ +} RGFW_windowFocusEvent; + /*! @brief event data for any mouse button event (press/release) */ typedef struct RGFW_mouseButtonEvent { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_window* win; /*!< the window this event applies to (for event queue events) */ RGFW_mouseButton value; /* !< which mouse button was pressed */ + RGFW_bool state; /*!< if the button was pressed or released */ } RGFW_mouseButtonEvent; -/*! @brief event data for any mouse scroll event */ -typedef struct RGFW_mouseScrollEvent { +/*! @brief event data for any mouse scroll or raw motion event */ +typedef struct RGFW_mouseDeltaEvent { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_window* win; /*!< the window this event applies to (for event queue events) */ - float x, y; /*!< the raw mouse scroll value */ -} RGFW_mouseScrollEvent; + float x, y; /*!< the raw mouse scroll or motion delta value */ +} RGFW_mouseDeltaEvent; -/*! @brief event data for any mouse position event (RGFW_mousePosChanged) */ -typedef struct RGFW_mousePosEvent { +/*! @brief event data for a mouse position event (RGFW_mouseMotion) */ +typedef struct RGFW_mouseMotionEvent { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_window* win; /*!< the window this event applies to (for event queue events) */ i32 x, y; /*!< mouse x, y of event (or drop point) */ - float vecX, vecY; /*!< raw mouse movement */ -} RGFW_mousePosEvent; + RGFW_bool inWindow; /*!< if the mouse is in the window or not */ +} RGFW_mouseMotionEvent; /*! @brief event data for a key press/release event */ typedef struct RGFW_keyEvent { @@ -787,7 +789,8 @@ typedef struct RGFW_keyEvent { RGFW_window* win; /*!< the window this event applies to (for event queue events) */ RGFW_key value; /*!< the physical key of the event, refers to where key is physically */ RGFW_bool repeat; /*!< key press event repeated (the key is being held) */ - RGFW_keymod mod; + RGFW_keymod mod; /*!< state of the key modifier state */ + RGFW_bool state; /*!< if the key was pressed or released */ } RGFW_keyEvent; /*! @brief event data for a key character event */ @@ -801,9 +804,7 @@ typedef struct RGFW_keyCharEvent { typedef struct RGFW_dataDropEvent { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_window* win; /*!< the window this event applies to (for event queue events) */ - /* 260 max paths with a max length of 260 */ - char** files; /*!< dropped files */ - size_t count; /*!< how many files were dropped */ + const RGFW_dataDropNode* value; } RGFW_dataDropEvent; /*! @brief event data for any data drag event */ @@ -811,6 +812,8 @@ typedef struct RGFW_dataDragEvent { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_window* win; /*!< the window this event applies to (for event queue events) */ i32 x, y; /*!< mouse x, y of event (or drop point) */ + RGFW_dndActionType action; /*!< the type of drag action, e.g. enter, leave, move */ + RGFW_dataTransferType dataType; /*!< the type of data being dragged*/ } RGFW_dataDragEvent; /*! @brief event data for when the window scale (DPI) is updated */ @@ -825,19 +828,32 @@ typedef struct RGFW_monitorEvent { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_window* win; /*!< the window this event applies to (for event queue events) */ const RGFW_monitor* monitor; /*!< the monitor that this event applies to */ + RGFW_bool state; /*!< if the monitor is connected or disconnected */ } RGFW_monitorEvent; +/*! @breif event data for when the window is updated, moved, resized or refreshed */ +typedef struct RGFW_windowUpdateEvent { + RGFW_eventType type; /*!< the specific event type */ + RGFW_window* win; /*!< the window that was updated */ + i32 x; /*!< the new window x OR the x of the rectanglular refresh area */ + i32 y; /*!< the new window y OR the y of the rectanglular refresh area */ + i32 w; /*!< the new window width OR the width of the rectanglular refresh area */ + i32 h; /*!< the new window height OR the height of the rectanglular refresh area */ +} RGFW_windowUpdateEvent; + /*! @brief union for all of the event stucture types */ typedef union RGFW_event { RGFW_eventType type; /*!< which event has been sent?*/ RGFW_commonEvent common; /*!< common event data (e.g.) type and win */ + RGFW_windowFocusEvent focus; /*!< event data for focus in/out events */ + RGFW_windowUpdateEvent update; /*!< data for window update/move/resize/refresh events */ RGFW_mouseButtonEvent button; /*!< data for a button press/release */ - RGFW_mouseScrollEvent scroll; /*!< data for a mouse scroll */ - RGFW_mousePosEvent mouse; /*!< data for mouse motion events */ + RGFW_mouseDeltaEvent delta; /*!< data for a mouse scroll or raw motion */ + RGFW_mouseMotionEvent mouse; /*!< data for mouse motion events */ RGFW_keyEvent key; /*!< data for key press/release/hold events */ RGFW_keyCharEvent keyChar; /*!< data for key character events */ - RGFW_dataDropEvent drop; /*!< dropping a file events */ - RGFW_dataDragEvent drag; /*!< data for dragging a file events */ + RGFW_dataDropEvent drop; /*!< data dropping events */ + RGFW_dataDragEvent drag; /*!< data for data dragging events */ RGFW_scaleUpdatedEvent scale; /*!< data for dpi scaling update events */ RGFW_monitorEvent monitor; /*!< data for monitor events */ } RGFW_event; @@ -854,14 +870,23 @@ typedef RGFW_ENUM(i32, RGFW_eventWait) { RGFW_eventWaitNext = -1 }; +/*! @brief generic event callback function type */ +typedef void (*RGFW_genericFunc)(const RGFW_event* e); + +/*! brief structure that holds an array to callback data*/ +typedef struct RGFW_callbacks { + RGFW_genericFunc arr[RGFW_eventCount]; /*!< an array of all the callbacks */ +} RGFW_callbacks; + /*! @brief optional bitwise arguments for making a windows, these can be OR'd together */ typedef RGFW_ENUM(u32, RGFW_windowFlags) { - RGFW_windowNoBorder = RGFW_BIT(0), /*!< the window doesn't have a border */ + RGFW_windowNoBorder = RGFW_BIT(0), /*!< the window doesn't have a border / frame / decor */ RGFW_windowNoResize = RGFW_BIT(1), /*!< the window cannot be resized by the user */ RGFW_windowAllowDND = RGFW_BIT(2), /*!< the window supports drag and drop */ RGFW_windowHideMouse = RGFW_BIT(3), /*! the window should hide the mouse (can be toggled later on using `RGFW_window_showMouse`) */ RGFW_windowFullscreen = RGFW_BIT(4), /*!< the window is fullscreen by default */ - RGFW_windowTransparent = RGFW_BIT(5), /*!< the window is transparent (only properly works on X11 and MacOS, although it's meant for for windows) */ + RGFW_windowTranslucent = RGFW_BIT(5), /*!< the window is translucent (only properly works on X11 and MacOS, although it's meant for for windows) */ + RGFW_windowTransparent = RGFW_windowTranslucent, /*!< the window is translucent (only properly works on X11 and MacOS, although it's meant for for windows) */ RGFW_windowCenter = RGFW_BIT(6), /*! center the window on the screen */ RGFW_windowRawMouse = RGFW_BIT(7), /*!< use raw mouse mouse on window creation */ RGFW_windowScaleToMonitor = RGFW_BIT(8), /*! scale the window to the screen */ @@ -888,7 +913,7 @@ typedef RGFW_ENUM(u8, RGFW_icon) { }; /*! @brief standard mouse icons */ -typedef RGFW_ENUM(u8, RGFW_mouseIcons) { +typedef RGFW_ENUM(u8, RGFW_mouseIcon) { RGFW_mouseNormal = 0, RGFW_mouseArrow, RGFW_mouseIbeam, @@ -945,47 +970,15 @@ typedef RGFW_ENUM(u8, RGFW_errorCode) { RGFW_warningWayland, RGFW_warningOpenGL }; +/*! @brief data for debug messages */ +typedef struct RGFW_debugInfo { + RGFW_debugType type; /*!< the type of message */ + RGFW_errorCode code; /*!< the code for the specific type of debug message */ + const char* msg; /*!< string message */ +} RGFW_debugInfo; + /*! @brief callback function type for debug messags */ -typedef void (* RGFW_debugfunc)(RGFW_debugType type, RGFW_errorCode err, const char* msg); - -/*! @brief RGFW_windowMoved, the window and its new rect value */ -typedef void (* RGFW_windowMovedfunc)(RGFW_window* win, i32 x, i32 y); -/*! @brief RGFW_windowResized, the window and its new rect value */ -typedef void (* RGFW_windowResizedfunc)(RGFW_window* win, i32 w, i32 h); -/*! @brief RGFW_windowRestored, the window and its new rect value */ -typedef void (* RGFW_windowRestoredfunc)(RGFW_window* win, i32 x, i32 y, i32 w, i32 h); -/*! @brief RGFW_windowMaximized, the window and its new rect value */ -typedef void (* RGFW_windowMaximizedfunc)(RGFW_window* win, i32 x, i32 y, i32 w, i32 h); -/*! @brief RGFW_windowMinimized, the window and its new rect value */ -typedef void (* RGFW_windowMinimizedfunc)(RGFW_window* win); -/*! @brief RGFW_quit, the window that was closed */ -typedef void (* RGFW_windowQuitfunc)(RGFW_window* win); -/*! @brief RGFW_focusIn / RGFW_focusOut, the window who's focus has changed and if its in focus */ -typedef void (* RGFW_focusfunc)(RGFW_window* win, RGFW_bool inFocus); -/*! @brief RGFW_mouseEnter / RGFW_mouseLeave, the window that changed, the point of the mouse (enter only) and if the mouse has entered */ -typedef void (* RGFW_mouseNotifyfunc)(RGFW_window* win, i32 x, i32 y, RGFW_bool status); -/*! @brief RGFW_mousePosChanged, the window that the move happened on, and the new point of the mouse */ -typedef void (* RGFW_mousePosfunc)(RGFW_window* win, i32 x, i32 y, float vecX, float vecY); -/*! @brief RGFW_dataDrag, the window, the point of the drop on the windows */ -typedef void (* RGFW_dataDragfunc)(RGFW_window* win, i32 x, i32 y); -/*! @brief RGFW_windowRefresh, the window that needs to be refreshed */ -typedef void (* RGFW_windowRefreshfunc)(RGFW_window* win); -/*! @brief RGFW_keyChar, the window that got the event, the unicode key value */ -typedef void (* RGFW_keyCharfunc)(RGFW_window* win, u32 codepoint); -/*! @brief RGFW_mouseButtonPressed / RGFW_mouseButtonReleased, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ - -/*! @brief RGFW_keyPressed / RGFW_keyReleased, the window that got the event, the mapped key, the physical key, the string version, the state of the mod keys, if it was a press (else it's a release) */ -typedef void (* RGFW_keyfunc)(RGFW_window* win, u8 key, RGFW_keymod mod, RGFW_bool repeat, RGFW_bool pressed); -/*! @brief RGFW_mouseButtonPressed / RGFW_mouseButtonReleased, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ -typedef void (* RGFW_mouseButtonfunc)(RGFW_window* win, RGFW_mouseButton button, RGFW_bool pressed); -/*! @brief RGFW_mouseScroll, the window that got the event, the x scroll value, the y scroll value */ -typedef void (* RGFW_mouseScrollfunc)(RGFW_window* win, float x, float y); -/*! @brief RGFW_dataDrop the window that had the drop, the drop data and the number of files dropped */ -typedef void (* RGFW_dataDropfunc)(RGFW_window* win, char** files, size_t count); -/*! @brief RGFW_scaleUpdated, the window the event was sent to, content scaleX, content scaleY */ -typedef void (* RGFW_scaleUpdatedfunc)(RGFW_window* win, float scaleX, float scaleY); -/*! @brief RGFW_monitorConnected / RGFW_monitorDisconnected, there was a monitor connected/disconnected */ -typedef void (* RGFW_monitorfunc)(RGFW_window* win, const RGFW_monitor* monitor, RGFW_bool connected); +typedef void (* RGFW_debugFunc)(const RGFW_debugInfo* info); /*! @brief function pointer equivalent of void* */ typedef void (*RGFW_proc)(void); @@ -1009,7 +1002,8 @@ typedef RGFW_ENUM(i32, RGFW_glProfile) { RGFW_glCore = 0, /*!< the core OpenGL version, e.g. just support for that version */ RGFW_glForwardCompatibility, /*!< only compatibility for newer versions of OpenGL as well as the requested version */ RGFW_glCompatibility, /*!< allow compatibility for older versions of OpenGL as well as the requested version */ - RGFW_glES /*!< use OpenGL ES */ + RGFW_glES, /*!< use OpenGL ES */ + RGFW_glWeb /*!< use WebGL version (otherwise the version is changed to match it's GLES equivalent) */ }; /*! values for the renderer hint */ @@ -1188,7 +1182,7 @@ RGFWDEF void RGFW_surface_freePtr(RGFW_surface* surface); /**! - * @brief Loads a mouse icon from bitmap data (similar to RGFW_window_setIcon). + * @brief create a mouse icon from bitmap data (similar to RGFW_window_setIcon). * @param data A pointer to the bitmap pixel data. * @param w The width of the mouse icon in pixels. * @param h The height of the mouse icon in pixels. @@ -1197,7 +1191,14 @@ RGFWDEF void RGFW_surface_freePtr(RGFW_surface* surface); * * @note The icon is not resized by default. */ -RGFWDEF RGFW_mouse* RGFW_loadMouse(u8* data, i32 w, i32 h, RGFW_format format); +RGFWDEF RGFW_mouse* RGFW_createMouse(u8* data, i32 w, i32 h, RGFW_format format); + +/**! + * @brief create a standard mouse icon + * @param mouse The standard cursor type (see RGFW_MOUSE enum). + * @return A pointer to the newly loaded RGFW_mouse structure. +*/ +RGFWDEF RGFW_mouse* RGFW_createMouseStandard(RGFW_mouseIcon mouse); /**! * @brief Frees the data associated with an RGFW_mouse structure. @@ -1355,12 +1356,21 @@ RGFWDEF RGFW_bool RGFW_monitor_getMode(RGFW_monitor* monitor, RGFW_monitorMode* RGFWDEF void RGFW_pollMonitors(void); /**! - * @brief Retrieves an array of all available monitors. - * @param len [OUTPUT] A pointer to store the number of monitors found (maximum of RGFW_MAX_MONITORS [6 by default]). - * @return An array of pointers to RGFW_monitor structures. + * @brief Allocates and returns an array of all available monitors. + * @param len [OUTPUT] A pointer to store the number of monitors found. + * @return An allocated array of pointers to RGFW_monitor structures that must be freed. */ RGFWDEF RGFW_monitor** RGFW_getMonitors(size_t* len); +/**! + * @brief fills a pre-allocated array with available monitors. + * @param maximum number of monitors that the passed [monitors] buffer supports, can be zero to get the length alone + * @param pre-allocated buffer of monitors, can be NULL to get the length alone + * @param len [OUTPUT] A pointer to store the number of monitors found, if max is not zero and monitors is not NULL, length will be set to max. + * @return An array of pointers to RGFW_monitor structures or NULL if the function failed. +*/ +RGFWDEF RGFW_bool RGFW_getMonitorsPtr(size_t max, RGFW_monitor** monitors, size_t* len); + /**! * @brief Retrieves the primary monitor. * @return A pointer to the RGFW_monitor structure representing the primary monitor. @@ -1409,6 +1419,13 @@ RGFWDEF RGFW_bool RGFW_monitor_scaleToWindow(RGFW_monitor* mon, struct RGFW_wind */ RGFWDEF void RGFW_setRawMouseMode(RGFW_bool state); +/**! + * @brief toggles building the drag-and-drop (DND) linked list + * @param allow RGFW_TRUE to allow DND building, RGFW_FALSE to disable + * @note this is for state checking, the list is created by default if you are using the event queue +*/ +RGFWDEF void RGFW_setBuildDND(RGFW_bool allow); + /**! * @brief sleep until RGFW gets an event or the timer ends (defined by OS) * @param waitMS how long to wait for the next event (in miliseconds) @@ -1421,6 +1438,29 @@ RGFWDEF void RGFW_waitForEvent(i32 waitMS); */ RGFWDEF void RGFW_setQueueEvents(RGFW_bool queue); +/**! + * @brief Sets the callback function for the event. + * @param the event type for the callback + * @param func The function to be called when the event is triggered. + * @return The previously set callback function, if any. +*/ +RGFWDEF RGFW_genericFunc RGFW_setEventCallback(RGFW_eventType type, RGFW_genericFunc func); + +/**! + * @brief Sets the callback function for two continuous events. + * @param func The function to be called when the event is triggered. + * @param [OUTPUT] The previously set callback function for the first event, if any. + * @param [OUTPUT] The previously set callback function for the second event, if any. +*/ +RGFWDEF void RGFW_setDualEventCallback(RGFW_eventType type, RGFW_genericFunc func, RGFW_genericFunc* first, RGFW_genericFunc* second); + +/**! + * @brief Sets the callback function for all events. + * @param func The function to be called when the event is triggered. + * @param [OUTPUT] a structure that holds an array of all the event callbacks +*/ +RGFWDEF void RGFW_setAllEventCallbacks(RGFW_genericFunc func, RGFW_callbacks* callbacks); + /**! * @brief check all the events until there are none left and updates window structure attributes */ @@ -1853,13 +1893,11 @@ RGFWDEF RGFW_bool RGFW_window_getDataDrag(RGFW_window* win, i32* x, i32* y); RGFWDEF RGFW_bool RGFW_window_didDataDrop(RGFW_window* win); /**! - * @brief retrieves files from a data drop (drag and drop) + * @brief retrieves data from a data drop (drag and drop) * @param win a pointer to the target window - * @param files [OUTPUT] a pointer to the array of file paths - * @param count [OUTPUT] the number of dropped files - * @return RGFW_TRUE if a data drop occurred, RGFW_FALSE otherwise + * @return a valid pointer to the root drag node if a data drop occurred, NULL otherwise */ -RGFWDEF RGFW_bool RGFW_window_getDataDrop(RGFW_window* win, const char*** files, size_t* count); +RGFWDEF RGFW_dataDropNode* RGFW_window_getDataDrop(RGFW_window* win); /**! * @brief closes the window and frees its associated structure @@ -1873,6 +1911,15 @@ RGFWDEF void RGFW_window_close(RGFW_window* win); */ RGFWDEF void RGFW_window_closePtr(RGFW_window* win); +/**! + * @brief fetches the size of the window through the OS (and updates the internal values) + * @param win a pointer to the window + * @param w [OUTPUT] the width of the window + * @param h [OUTPUT] the height of the window + * @return a bool if the function was successful +*/ +RGFWDEF RGFW_bool RGFW_window_fetchSize(RGFW_window* win, i32* w, i32* h); + /**! * @brief moves the window to a new position on the screen * @param win a pointer to the target window @@ -1985,14 +2032,14 @@ RGFWDEF void RGFW_window_setFloating(RGFW_window* win, RGFW_bool floating); RGFWDEF void RGFW_window_setOpacity(RGFW_window* win, u8 opacity); /**! - * @brief toggles window borders + * @brief toggles window borders / frame / decor * @param win a pointer to the target window * @param border RGFW_TRUE for bordered, RGFW_FALSE for borderless */ RGFWDEF void RGFW_window_setBorder(RGFW_window* win, RGFW_bool border); /**! - * @brief checks if the window is borderless + * @brief checks if the window is borderless (has a border, frame or decor) * @param win a pointer to the target window * @return RGFW_TRUE if borderless, RGFW_FALSE otherwise */ @@ -2055,19 +2102,19 @@ RGFWDEF RGFW_bool RGFW_window_setIcon(RGFW_window* win, u8* data, i32 w, i32 h, RGFWDEF RGFW_bool RGFW_window_setIconEx(RGFW_window* win, u8* data, i32 w, i32 h, RGFW_format format, RGFW_icon type); /**! - * @brief sets the mouse icon for the window using a loaded bitmap + * @brief sets the mouse icon for the window using a loaded mouse icon * @param win a pointer to the target window * @param mouse a pointer to the RGFW_mouse struct containing the icon */ -RGFWDEF void RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse); +RGFWDEF RGFW_bool RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse); /**! - * @brief Sets the mouse to a standard system cursor. + * @brief Sets the mouse to a preloaded [by RGFW] standard system cursor. * @param win The target window. - * @param mouse The standard cursor type (see RGFW_MOUSE enum). + * @param mouse The standardmouse icon (see RGFW_mouseIcon enum). * @return True if the standard cursor was successfully applied. */ -RGFWDEF RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, RGFW_mouseIcons mouse); +RGFWDEF RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, RGFW_mouseIcon icon); /**! * @brief Sets the mouse to the default cursor icon. @@ -2281,7 +2328,7 @@ RGFWDEF void RGFW_writeClipboard(const char* text, u32 textLen); * @param func The function pointer to be used as the debug callback. * @return The previously set debug callback function. */ -RGFWDEF RGFW_debugfunc RGFW_setDebugCallback(RGFW_debugfunc func); +RGFWDEF RGFW_debugFunc RGFW_setDebugCallback(RGFW_debugFunc func); /**! * @brief Sends a debug message manually through the currently set debug callback. @@ -2289,146 +2336,7 @@ RGFWDEF RGFW_debugfunc RGFW_setDebugCallback(RGFW_debugfunc func); * @param err The associated error code. * @param msg The debug message text. */ -RGFWDEF void RGFW_sendDebugInfo(RGFW_debugType type, RGFW_errorCode err, const char* msg); -/** @} */ - -/** - - - event callbacks. - These are completely optional, so you can use the normal - RGFW_checkEvent() method if you prefer that - -* @defgroup Callbacks -* @{ -*/ - -/**! - * @brief Sets the callback function for window move events. - * @param func The function to be called when the window is moved. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowMovedfunc RGFW_setWindowMovedCallback(RGFW_windowMovedfunc func); - -/**! - * @brief Sets the callback function for window resize events. - * @param func The function to be called when the window is resized. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowResizedfunc RGFW_setWindowResizedCallback(RGFW_windowResizedfunc func); - -/**! - * @brief Sets the callback function for window quit events. - * @param func The function to be called when the window receives a quit signal. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowQuitfunc RGFW_setWindowQuitCallback(RGFW_windowQuitfunc func); - -/**! - * @brief Sets the callback function for mouse move events. - * @param func The function to be called when the mouse moves within the window. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_mousePosfunc RGFW_setMousePosCallback(RGFW_mousePosfunc func); - -/**! - * @brief Sets the callback function for window refresh events. - * @param func The function to be called when the window needs to be refreshed. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowRefreshfunc RGFW_setWindowRefreshCallback(RGFW_windowRefreshfunc func); - -/**! - * @brief Sets the callback function for focus change events. - * @param func The function to be called when the window gains or loses focus. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_focusfunc RGFW_setFocusCallback(RGFW_focusfunc func); - -/**! - * @brief Sets the callback function for mouse notification events. - * @param func The function to be called when a mouse notification event occurs. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_mouseNotifyfunc RGFW_setMouseNotifyCallback(RGFW_mouseNotifyfunc func); - -/**! - * @brief Sets the callback function for data drop events. - * @param func The function to be called when data is dropped into the window. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_dataDropfunc RGFW_setDataDropCallback(RGFW_dataDropfunc func); - -/**! - * @brief Sets the callback function for the start of a data drag event. - * @param func The function to be called when data dragging begins. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_dataDragfunc RGFW_setDataDragCallback(RGFW_dataDragfunc func); - -/**! - * @brief Sets the callback function for key press and release events. - * @param func The function to be called when a key is pressed or released. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_keyfunc RGFW_setKeyCallback(RGFW_keyfunc func); - -/**! - * @brief Sets the callback function for key character events. - * @param func The function to be called when a key is pressed or released. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_keyCharfunc RGFW_setKeyCharCallback(RGFW_keyCharfunc func); - -/**! - * @brief Sets the callback function for mouse button press and release events. - * @param func The function to be called when a mouse button is pressed or released. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_mouseButtonfunc RGFW_setMouseButtonCallback(RGFW_mouseButtonfunc func); - -/**! - * @brief Sets the callback function for mouse scroll events. - * @param func The function to be called when the mouse wheel is scrolled. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_mouseScrollfunc RGFW_setMouseScrollCallback(RGFW_mouseScrollfunc func); - -/**! - * @brief Sets the callback function for window maximize events. - * @param func The function to be called when the window is maximized. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowMaximizedfunc RGFW_setWindowMaximizedCallback(RGFW_windowMaximizedfunc func); - -/**! - * @brief Sets the callback function for window minimize events. - * @param func The function to be called when the window is minimized. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowMinimizedfunc RGFW_setWindowMinimizedCallback(RGFW_windowMinimizedfunc func); - -/**! - * @brief Sets the callback function for window restore events. - * @param func The function to be called when the window is restored from a minimized or maximized state. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_windowRestoredfunc RGFW_setWindowRestoredCallback(RGFW_windowRestoredfunc func); - -/**! - * @brief Sets the callback function for DPI (scale) update events. - * @param func The function to be called when the window’s DPI or scale changes. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_scaleUpdatedfunc RGFW_setScaleUpdatedCallback(RGFW_scaleUpdatedfunc func); - -/**! - * @brief Sets the callback function for monitor connected and disconnect events. - * @param func The function to be called when a monitor is connected or disconnected. - * @return The previously set callback function, if any. -*/ -RGFWDEF RGFW_monitorfunc RGFW_setMonitorCallback(RGFW_monitorfunc func); - +RGFWDEF void RGFW_debugCallback(RGFW_debugType type, RGFW_errorCode code, const char* msg); /** @} */ /** * @defgroup graphics_API @@ -2718,7 +2626,9 @@ RGFWDEF RGFW_bool RGFW_extensionSupportedPlatform_EGL(const char* extension, siz #endif #ifdef RGFW_VULKAN -#include +#ifndef RGFW_NO_INCLUDE_VULKAN + #include +#endif /* if you don't want to use the above macros */ @@ -2804,6 +2714,12 @@ RGFWDEF RGFW_window* RGFW_getRootWindow(void); */ RGFWDEF void RGFW_eventQueuePush(const RGFW_event* event); +/**! + * @brief Pushes an event into the standard RGFW event queue and call the callback. + * @param event A pointer to the RGFW_event to be added to the queue. +*/ +RGFWDEF void RGFW_eventQueuePushAndCall(const RGFW_event* event); + /**! * @brief Clears all events from the RGFW event queue without processing them. */ @@ -2850,14 +2766,14 @@ RGFWDEF RGFW_key RGFW_physicalToMappedKey(RGFW_key keycode); RGFWDEF size_t RGFW_sizeofInfo(void); /**! - * @brief Initializes the RGFW library. - * @return 0 on success, or a negative error code on failure. + * @brief Initializes the RGFW library internally. + * @return 0 on success, a negative number error error on failure. * @note This is automatically called when the first window is created. */ RGFWDEF i32 RGFW_init(void); /**! - * @brief Deinitializes the RGFW library. + * @brief Deinitializes the current instance of the RGFW library. * @note This is automatically called when the last open window is closed. */ RGFWDEF void RGFW_deinit(void); @@ -2865,7 +2781,7 @@ RGFWDEF void RGFW_deinit(void); /**! * @brief Initializes RGFW using a user-provided RGFW_info structure. * @param info A pointer to an RGFW_info structure to be used for initialization. - * @return 0 on success, or a negative error code on failure. + * @return 0 on success, a negative number error error on failure and a positive number for a warning. */ RGFWDEF i32 RGFW_init_ptr(RGFW_info* info); @@ -2956,9 +2872,11 @@ RGFWDEF RGFW_info* RGFW_getInfo(void); #include #include - #ifndef RGFW_NO_XRANDR - #include - #include + #include + #include + + #ifndef RGFW_XDND_VERSION + #define RGFW_XDND_VERSION 5 #endif #endif @@ -3118,6 +3036,8 @@ typedef struct RGFW_windowInternal { RGFW_eventFlag enabledEvents; u32 flags; /*!< windows flags (for RGFW to check and modify) */ i32 oldX, oldY, oldW, oldH; + RGFW_monitorMode oldMode; + RGFW_mouse* mouse; } RGFW_windowInternal; struct RGFW_window { @@ -3131,7 +3051,7 @@ typedef struct RGFW_windowState { RGFW_bool mouseEnter; RGFW_bool dataDragging; RGFW_bool dataDrop; - size_t filesCount; + size_t dataSize; i32 dropX, dropY; RGFW_window* win; /*!< it's not possible for one of these events to happen in the frame that the other event happened */ @@ -3155,7 +3075,7 @@ struct RGFW_monitorNode { RGFW_monitorMode* modes; size_t modeCount; #endif -#if defined(RGFW_X11) && !defined(RGFW_NO_XRANDR) +#if defined(RGFW_X11) i32 screen; RROutput rrOutput; RRCrtc crtc; @@ -3179,22 +3099,24 @@ typedef struct RGFW_monitorList { typedef struct RGFW_monitors { RGFW_monitorList list; - RGFW_monitorList freeList; size_t count; RGFW_monitorNode* primary; - RGFW_monitorNode data[RGFW_MAX_MONITORS]; + #if (RGFW_PREALLOCATED_MONITORS) + RGFW_monitorList freeList; + RGFW_monitorNode data[RGFW_PREALLOCATED_MONITORS]; + #endif } RGFW_monitors; -RGFWDEF RGFW_monitorNode* RGFW_monitors_add(const RGFW_monitor* mon); -RGFWDEF void RGFW_monitors_remove(RGFW_monitorNode* node, RGFW_monitorNode* prev); - struct RGFW_info { RGFW_window* root; i32 windowCount; RGFW_mouse* hiddenMouse; + RGFW_mouse* standardMice[RGFW_mouseIconCount]; + RGFW_debugFunc debugCallbackSrc; + RGFW_genericFunc callbacks[RGFW_eventCount]; RGFW_event events[RGFW_MAX_EVENTS]; /* A circular buffer (FIFO), using eventBottom/Len */ i32 eventBottom; @@ -3221,8 +3143,11 @@ struct RGFW_info { char* clipboard_data; char* clipboard; /* for writing to the clipboard selection */ size_t clipboard_len; - char filesSrc[RGFW_MAX_PATH * RGFW_MAX_DROPS]; - char** files; + + RGFW_bool dndBuild; + RGFW_dataDropNode* dndRoot; + RGFW_dataDropNode* dndCur; + #ifdef RGFW_X11 Display* display; XContext context; @@ -3231,6 +3156,10 @@ struct RGFW_info { XErrorEvent* x11Error; i32 xrandrEventBase; XIM im; + Window x11Source; + long x11Version; + i32 x11Format; + RGFW_dataTransferType x11TransferType; #endif #ifdef RGFW_WAYLAND struct wl_display* wl_display; @@ -3264,6 +3193,9 @@ struct RGFW_info { RGFW_window* kbOwner; RGFW_window* mouseOwner; /* what window has access to the mouse */ + u32 last_key; /* wayland key repeat data */ + i32 wl_repeat_info_rate, wl_repeat_info_delay; + u32 last_key_time; #endif RGFW_monitors monitors; @@ -3312,6 +3244,7 @@ struct RGFW_info { /* for C++ / C89 */ RGFWDEF RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, RGFW_window* win); RGFWDEF void RGFW_window_closePlatform(RGFW_window* win); +RGFWDEF RGFW_bool RGFW_window_setMousePlatform(RGFW_window* win, RGFW_mouse* mouse); RGFWDEF void RGFW_window_setFlagsInternal(RGFW_window* win, RGFW_windowFlags flags, RGFW_windowFlags cmpFlags); @@ -3320,24 +3253,28 @@ RGFWDEF void RGFW_initKeycodesPlatform(void); RGFWDEF void RGFW_resetPrevState(void); RGFWDEF void RGFW_resetKey(void); RGFWDEF void RGFW_unloadEGL(void); -RGFWDEF void RGFW_updateKeyModsEx(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool control, RGFW_bool alt, RGFW_bool shift, RGFW_bool super, RGFW_bool scroll); -RGFWDEF void RGFW_updateKeyMods(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool scroll); +RGFWDEF void RGFW_keyUpdateKeyModsEx(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool control, RGFW_bool alt, RGFW_bool shift, RGFW_bool super, RGFW_bool scroll); +RGFWDEF void RGFW_keyUpdateKeyMods(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool scroll); RGFWDEF void RGFW_window_showMouseFlags(RGFW_window* win, RGFW_bool show); -RGFWDEF void RGFW_updateKeyMod(RGFW_window* win, RGFW_keymod mod, RGFW_bool value); +RGFWDEF void RGFW_keyUpdateKeyMod(RGFW_window* win, RGFW_keymod mod, RGFW_bool value); + RGFWDEF void RGFW_monitors_refresh(void); +RGFWDEF RGFW_monitorNode* RGFW_monitors_add(const RGFW_monitor* mon); +RGFWDEF void RGFW_monitors_remove(RGFW_monitorNode* node, RGFW_monitorNode* prev); RGFWDEF void RGFW_windowMaximizedCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h); RGFWDEF void RGFW_windowMinimizedCallback(RGFW_window* win); RGFWDEF void RGFW_windowRestoredCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h); RGFWDEF void RGFW_windowMovedCallback(RGFW_window* win, i32 x, i32 y); RGFWDEF void RGFW_windowResizedCallback(RGFW_window* win, i32 w, i32 h); -RGFWDEF void RGFW_windowQuitCallback(RGFW_window* win); -RGFWDEF void RGFW_mousePosCallback(RGFW_window* win, i32 x, i32 y, float vecX, float vecY); -RGFWDEF void RGFW_windowRefreshCallback(RGFW_window* win); -RGFWDEF void RGFW_focusCallback(RGFW_window* win, RGFW_bool inFocus); +RGFWDEF void RGFW_windowCloseCallback(RGFW_window* win); +RGFWDEF void RGFW_mouseMotionCallback(RGFW_window* win, i32 x, i32 y); +RGFWDEF void RGFW_rawMotionCallback(RGFW_window* win, float x, float y); +RGFWDEF void RGFW_windowRefreshCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h); +RGFWDEF void RGFW_windowFocusCallback(RGFW_window* win, RGFW_bool inFocus); RGFWDEF void RGFW_mouseNotifyCallback(RGFW_window* win, i32 x, i32 y, RGFW_bool status); -RGFWDEF void RGFW_dataDropCallback(RGFW_window* win, char** files, size_t count); -RGFWDEF void RGFW_dataDragCallback(RGFW_window* win, i32 x, i32 y); +RGFWDEF void RGFW_dataDropCallback(RGFW_window* win, const char* data, size_t count, RGFW_dataTransferType dataType); +RGFWDEF void RGFW_dataDragCallback(RGFW_window* win, RGFW_dataTransferType dataType, RGFW_dndActionType action, i32 x, i32 y); RGFWDEF void RGFW_keyCharCallback(RGFW_window* win, u32 codepoint); RGFWDEF void RGFW_keyCallback(RGFW_window* win, RGFW_key key, RGFW_keymod mod, RGFW_bool repeat, RGFW_bool press); RGFWDEF void RGFW_mouseButtonCallback(RGFW_window* win, RGFW_mouseButton button, RGFW_bool press); @@ -3423,16 +3360,10 @@ const char* RGFW_readClipboard(size_t* len) { return (const char*)str; } -/* -RGFW_IMPLEMENTATION starts with generic RGFW defines - -This is the start of keycode data -*/ - - +/* generic RGFW defines */ void RGFW_initKeycodes(void) { - RGFW_MEMSET(_RGFW->keycodes, 0, sizeof(_RGFW->keycodes)); + RGFW_MEMZERO(_RGFW->keycodes, sizeof(_RGFW->keycodes)); RGFW_initKeycodesPlatform(); size_t i, y; for (i = 0; i < RGFW_keyLast; i++) { @@ -3461,64 +3392,66 @@ u32 RGFW_rgfwToApiKey(RGFW_key keycode) { return _RGFW->apiKeycodes[keycode]; } -void RGFW_resetKey(void) { RGFW_MEMSET(_RGFW->keyboard, 0, sizeof(_RGFW->keyboard)); } +void RGFW_resetKey(void) { RGFW_MEMZERO(_RGFW->keyboard, sizeof(_RGFW->keyboard)); } /* this is the end of keycode data */ -/* - event callback defines start here -*/ +RGFW_genericFunc RGFW_setEventCallback(RGFW_eventType type, RGFW_genericFunc func) { + RGFW_ASSERT(type > RGFW_eventNone && type < RGFW_eventCount); + RGFW_init(); + RGFW_genericFunc old = _RGFW->callbacks[type]; + _RGFW->callbacks[type] = func; -/* - These exist to avoid the - if (func == NULL) check - for (allegedly) better performance - - RGFW_EMPTY_DEF exists to prevent the missing-prototypes warning -*/ -#define RGFW_CALLBACK_DEFINE(x, x2) \ -RGFW_##x##func RGFW_##x##CallbackSrc = NULL; \ -RGFW_##x##func RGFW_set##x2##Callback(RGFW_##x##func func) { \ - RGFW_##x##func prev = RGFW_##x##CallbackSrc; \ - RGFW_##x##CallbackSrc = func; \ - return prev; \ + return old; } -RGFW_CALLBACK_DEFINE(windowMaximized, WindowMaximized) -RGFW_CALLBACK_DEFINE(windowMinimized, WindowMinimized) -RGFW_CALLBACK_DEFINE(windowRestored, WindowRestored) -RGFW_CALLBACK_DEFINE(windowMoved, WindowMoved) -RGFW_CALLBACK_DEFINE(windowResized, WindowResized) -RGFW_CALLBACK_DEFINE(windowQuit, WindowQuit) -RGFW_CALLBACK_DEFINE(mousePos, MousePos) -RGFW_CALLBACK_DEFINE(windowRefresh, WindowRefresh) -RGFW_CALLBACK_DEFINE(focus, Focus) -RGFW_CALLBACK_DEFINE(mouseNotify, MouseNotify) -RGFW_CALLBACK_DEFINE(dataDrop, DataDrop) -RGFW_CALLBACK_DEFINE(dataDrag, DataDrag) -RGFW_CALLBACK_DEFINE(key, Key) -RGFW_CALLBACK_DEFINE(keyChar, KeyChar) -RGFW_CALLBACK_DEFINE(mouseButton, MouseButton) -RGFW_CALLBACK_DEFINE(mouseScroll, MouseScroll) -RGFW_CALLBACK_DEFINE(scaleUpdated, ScaleUpdated) -RGFW_CALLBACK_DEFINE(monitor, Monitor) -RGFW_CALLBACK_DEFINE(debug, Debug) -#define RGFW_debugCallback(type, err, msg) if (RGFW_debugCallbackSrc) RGFW_debugCallbackSrc(type, err, msg); -#undef RGFW_CALLBACK_DEFINE +void RGFW_setDualEventCallback(RGFW_eventType type, RGFW_genericFunc func, RGFW_genericFunc* first, RGFW_genericFunc* second) { + RGFW_genericFunc func1 = RGFW_setEventCallback(type, func); + RGFW_genericFunc func2 = RGFW_setEventCallback(type + 1, func); + + if (first) *first = func1; + if (second) *second = func2; +} + +void RGFW_setAllEventCallbacks(RGFW_genericFunc func, RGFW_callbacks* callbacks) { + for (RGFW_eventType i = RGFW_eventNone + 1; i < RGFW_eventCount; i++) { + if (callbacks) callbacks->arr[i] = _RGFW->callbacks[i]; + RGFW_setEventCallback(i, func); + } +} + +RGFW_debugFunc RGFW_setDebugCallback(RGFW_debugFunc func) { + RGFW_init(); + RGFW_debugFunc prev = _RGFW->debugCallbackSrc; + _RGFW->debugCallbackSrc = func; + return prev; +} + +void RGFW_eventQueuePushAndCall(const RGFW_event* event) { + RGFW_ASSERT(event->type > RGFW_eventNone && event->type < RGFW_eventCount); + if (_RGFW->callbacks[event->type]) (_RGFW->callbacks[event->type])(event); + RGFW_eventQueuePush(event); +} void RGFW_windowMaximizedCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h) { win->internal.flags |= RGFW_windowMaximize; + win->x = x; + win->y = y; + win->w = w; + win->h = h; if (!(win->internal.enabledEvents & RGFW_windowMaximizedFlag)) return; RGFW_event event; event.type = RGFW_windowMaximized; + event.update.x = x; + event.update.y = y; + event.update.w = w; + event.update.h = h; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowMaximizedCallbackSrc) RGFW_windowMaximizedCallbackSrc(win, x, y, w, h); + RGFW_eventQueuePushAndCall(&event); } void RGFW_windowMinimizedCallback(RGFW_window* win) { @@ -3528,24 +3461,33 @@ void RGFW_windowMinimizedCallback(RGFW_window* win) { RGFW_event event; event.type = RGFW_windowMinimized; + event.update.x = win->x; + event.update.y = win->y; + event.update.w = win->w; + event.update.h = win->h; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowMinimizedCallbackSrc) RGFW_windowMinimizedCallbackSrc(win); + RGFW_eventQueuePushAndCall(&event); } void RGFW_windowRestoredCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h) { win->internal.flags &= ~(u32)RGFW_windowMinimize; + win->x = x; + win->y = y; + win->w = w; + win->h = h; + if (RGFW_window_isMaximized(win) == RGFW_FALSE) win->internal.flags &= ~(u32)RGFW_windowMaximize; if (!(win->internal.enabledEvents & RGFW_windowRestoredFlag)) return; RGFW_event event; event.type = RGFW_windowRestored; + event.update.x = x; + event.update.y = y; + event.update.w = w; + event.update.h = h; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowRestoredCallbackSrc) RGFW_windowRestoredCallbackSrc(win, x, y, w, h); + RGFW_eventQueuePushAndCall(&event); } void RGFW_windowMovedCallback(RGFW_window* win, i32 x, i32 y) { @@ -3555,10 +3497,12 @@ void RGFW_windowMovedCallback(RGFW_window* win, i32 x, i32 y) { RGFW_event event; event.type = RGFW_windowMoved; + event.update.x = x; + event.update.y = y; + event.update.w = win->w; + event.update.h = win->h; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowMovedCallbackSrc) RGFW_windowMovedCallbackSrc(win, x, y); + RGFW_eventQueuePushAndCall(&event); } void RGFW_windowResizedCallback(RGFW_window* win, i32 w, i32 h) { @@ -3568,55 +3512,64 @@ void RGFW_windowResizedCallback(RGFW_window* win, i32 w, i32 h) { if (!(win->internal.enabledEvents & RGFW_windowResizedFlag)) return; RGFW_event event; event.type = RGFW_windowResized; + event.update.x = win->x; + event.update.y = win->y; + event.update.w = w; + event.update.h = h; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowResizedCallbackSrc) RGFW_windowResizedCallbackSrc(win, w, h); + RGFW_eventQueuePushAndCall(&event); } -void RGFW_windowQuitCallback(RGFW_window* win) { +void RGFW_windowCloseCallback(RGFW_window* win) { win->internal.shouldClose = RGFW_TRUE; RGFW_event event; - event.type = RGFW_quit; + event.type = RGFW_windowClose; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowQuitCallbackSrc) RGFW_windowQuitCallbackSrc(win); + RGFW_eventQueuePushAndCall(&event); } -void RGFW_mousePosCallback(RGFW_window* win, i32 x, i32 y, float vecX, float vecY) { +void RGFW_mouseMotionCallback(RGFW_window* win, i32 x, i32 y) { win->internal.lastMouseX = x; win->internal.lastMouseY = y; - _RGFW->vectorX = vecX; - _RGFW->vectorY = vecY; - if (!(win->internal.enabledEvents & RGFW_mousePosChangedFlag)) return; + if (!(win->internal.enabledEvents & RGFW_mouseMotionFlag)) return; RGFW_event event; - event.type = RGFW_mousePosChanged; + event.type = RGFW_mouseMotion; event.mouse.x = x; event.mouse.y = y; - event.mouse.vecX = vecX; - event.mouse.vecY = vecY; + event.mouse.inWindow = win->internal.mouseInside; event.common.win = win; - - RGFW_eventQueuePush(&event); - - if (RGFW_mousePosCallbackSrc) RGFW_mousePosCallbackSrc(win, x, y, vecX, vecY); + RGFW_eventQueuePushAndCall(&event); } -void RGFW_windowRefreshCallback(RGFW_window* win) { +void RGFW_rawMotionCallback(RGFW_window* win, float x, float y) { + _RGFW->vectorX = x; + _RGFW->vectorY = y; + if (!(win->internal.enabledEvents & RGFW_mouseRawMotionFlag)) return; + + RGFW_event event; + event.type = RGFW_mouseRawMotion; + event.delta.x = x; + event.delta.y = y; + event.common.win = win; + RGFW_eventQueuePushAndCall(&event); +} + +void RGFW_windowRefreshCallback(RGFW_window* win, i32 x, i32 y, i32 w, i32 h) { if (!(win->internal.enabledEvents & RGFW_windowRefreshFlag)) return; RGFW_event event; event.type = RGFW_windowRefresh; + event.update.x = x; + event.update.y = y; + event.update.w = w; + event.update.h = h; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_windowRefreshCallbackSrc) RGFW_windowRefreshCallbackSrc(win); + RGFW_eventQueuePushAndCall(&event); } -void RGFW_focusCallback(RGFW_window* win, RGFW_bool inFocus) { +void RGFW_windowFocusCallback(RGFW_window* win, RGFW_bool inFocus) { win->internal.inFocus = inFocus; if (win->internal.captureMouse) { @@ -3625,12 +3578,13 @@ void RGFW_focusCallback(RGFW_window* win, RGFW_bool inFocus) { RGFW_event event; event.common.win = win; + event.focus.state = inFocus; if (inFocus == RGFW_TRUE) { if ((win->internal.flags & RGFW_windowFullscreen)) RGFW_window_raise(win); - event.type = RGFW_focusIn; + event.type = RGFW_windowFocusIn; } else if (inFocus == RGFW_FALSE) { if ((win->internal.flags & RGFW_windowFullscreen)) RGFW_window_minimize(win); @@ -3646,14 +3600,12 @@ void RGFW_focusCallback(RGFW_window* win, RGFW_bool inFocus) { } RGFW_resetKey(); - event.type = RGFW_focusOut; + event.type = RGFW_windowFocusOut; } event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_focusCallbackSrc) RGFW_focusCallbackSrc(win, inFocus); + RGFW_eventQueuePushAndCall(&event); } void RGFW_mouseNotifyCallback(RGFW_window* win, i32 x, i32 y, RGFW_bool status) { @@ -3667,6 +3619,7 @@ void RGFW_mouseNotifyCallback(RGFW_window* win, i32 x, i32 y, RGFW_bool status) event.common.win = win; event.mouse.x = x; event.mouse.y = y; + event.mouse.inWindow = win->internal.mouseInside; if (status) { if (!(win->internal.enabledEvents & RGFW_mouseEnterFlag)) return; @@ -3680,45 +3633,68 @@ void RGFW_mouseNotifyCallback(RGFW_window* win, i32 x, i32 y, RGFW_bool status) event.type = RGFW_mouseLeave; } - RGFW_eventQueuePush(&event); - - if (RGFW_mouseNotifyCallbackSrc) RGFW_mouseNotifyCallbackSrc(win, x, y, status); + RGFW_eventQueuePushAndCall(&event); } -void RGFW_dataDropCallback(RGFW_window* win, char** files, size_t count) { +void RGFW_dataDropCallback(RGFW_window* win, const char* data, size_t size, RGFW_dataTransferType dataType) { if (!(win->internal.enabledEvents & RGFW_dataDropFlag) || !(win->internal.flags & RGFW_windowAllowDND)) return; _RGFW->windowState.win = win; _RGFW->windowState.dataDrop = RGFW_TRUE; - _RGFW->windowState.filesCount = count; + _RGFW->windowState.dataSize = size; + + RGFW_dataDropNode node; + RGFW_MEMZERO(&node, sizeof(node)); + node.data = data; + node.size = size; + node.type = dataType; + node.next = NULL; RGFW_event event; event.type = RGFW_dataDrop; - event.drop.files = files; - event.drop.count = count; - event.common.win = win; - RGFW_eventQueuePush(&event); + event.drop.value = &node; + event.drop.win = win; - if (RGFW_dataDropCallbackSrc) RGFW_dataDropCallbackSrc(win, files, count); + if (_RGFW->callbacks[event.type]) (_RGFW->callbacks[event.type])(&event); + + if (_RGFW->queueEvents == RGFW_TRUE || _RGFW->dndBuild) { + if (_RGFW->dndRoot == NULL) { + _RGFW->dndRoot = (RGFW_dataDropNode*)RGFW_ALLOC(sizeof(RGFW_dataDropNode)); + _RGFW->dndCur = _RGFW->dndRoot; + } else if (_RGFW->dndCur) { + _RGFW->dndCur->next = (RGFW_dataDropNode*)RGFW_ALLOC(sizeof(RGFW_dataDropNode)); + _RGFW->dndCur = _RGFW->dndCur->next; + } else { RGFW_ASSERT(0); } + + char* dataCopy = (char*)RGFW_ALLOC(size); + RGFW_MEMCPY(dataCopy, data, size); + node.data = dataCopy; + + RGFW_MEMCPY(_RGFW->dndCur, &node, sizeof(node)); + + event.drop.value = _RGFW->dndCur; + RGFW_eventQueuePush(&event); + } } -void RGFW_dataDragCallback(RGFW_window* win, i32 x, i32 y) { +void RGFW_dataDragCallback(RGFW_window* win, RGFW_dataTransferType dataType, RGFW_dndActionType action, i32 x, i32 y) { + if (!(win->internal.enabledEvents & RGFW_dataDragFlag) || !(win->internal.flags & RGFW_windowAllowDND)) return; + _RGFW->windowState.win = win; _RGFW->windowState.dataDragging = RGFW_TRUE; _RGFW->windowState.dropX = x; _RGFW->windowState.dropY = y; - if (win->internal.enabledEvents & RGFW_dataDragFlag) return; - RGFW_event event; event.type = RGFW_dataDrag; event.drag.x = x; event.drag.y = y; + event.drag.action = action; + event.drag.dataType = dataType; event.common.win = win; - RGFW_eventQueuePush(&event); - if (RGFW_dataDragCallbackSrc) RGFW_dataDragCallbackSrc(win, x, y); + RGFW_eventQueuePushAndCall(&event); } void RGFW_keyCharCallback(RGFW_window* win, u32 codepoint) { @@ -3728,9 +3704,7 @@ void RGFW_keyCharCallback(RGFW_window* win, u32 codepoint) { event.type = RGFW_keyChar; event.keyChar.value = codepoint; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_keyCharCallbackSrc) RGFW_keyCharCallbackSrc(win, codepoint); + RGFW_eventQueuePushAndCall(&event); } void RGFW_keyCallback(RGFW_window* win, RGFW_key key, RGFW_keymod mod, RGFW_bool repeat, RGFW_bool press) { @@ -3748,16 +3722,16 @@ void RGFW_keyCallback(RGFW_window* win, RGFW_key key, RGFW_keymod mod, RGFW_bool _RGFW->keyboard[key].current = press; event.key.value = key; - event.key.mod = repeat; + event.key.repeat = repeat; event.key.mod = mod; + event.key.state = press; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_keyCallbackSrc) RGFW_keyCallbackSrc(win, key, mod, repeat, press); + RGFW_eventQueuePushAndCall(&event); } void RGFW_mouseButtonCallback(RGFW_window* win, RGFW_mouseButton button, RGFW_bool press) { RGFW_event event; + if (press) { if (!(win->internal.enabledEvents & RGFW_mouseButtonPressedFlag)) return; event.type = RGFW_mouseButtonPressed; @@ -3770,10 +3744,9 @@ void RGFW_mouseButtonCallback(RGFW_window* win, RGFW_mouseButton button, RGFW_bo _RGFW->mouseButtons[button].current = press; event.button.value = button; + event.button.state = press; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_mouseButtonCallbackSrc) RGFW_mouseButtonCallbackSrc(win, button, press); + RGFW_eventQueuePushAndCall(&event); } void RGFW_mouseScrollCallback(RGFW_window* win, float x, float y) { @@ -3783,16 +3756,13 @@ void RGFW_mouseScrollCallback(RGFW_window* win, float x, float y) { RGFW_event event; event.type = RGFW_mouseScroll; - event.scroll.x = x; - event.scroll.y = y; + event.delta.x = x; + event.delta.y = y; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_mouseScrollCallbackSrc) RGFW_mouseScrollCallbackSrc(win, x, y); + RGFW_eventQueuePushAndCall(&event); } void RGFW_scaleUpdatedCallback(RGFW_window* win, float scaleX, float scaleY) { - if (win->internal.flags & RGFW_windowScaleToMonitor) RGFW_window_scaleToMonitor(win); if (!(win->internal.enabledEvents & RGFW_scaleUpdatedFlag)) return; RGFW_event event; @@ -3800,9 +3770,7 @@ void RGFW_scaleUpdatedCallback(RGFW_window* win, float scaleX, float scaleY) { event.scale.x = scaleX; event.scale.y = scaleY; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_scaleUpdatedCallbackSrc) RGFW_scaleUpdatedCallbackSrc(win, scaleX, scaleY); + RGFW_eventQueuePushAndCall(&event); } void RGFW_monitorCallback(RGFW_window* win, const RGFW_monitor* monitor, RGFW_bool connected) { @@ -3812,26 +3780,30 @@ void RGFW_monitorCallback(RGFW_window* win, const RGFW_monitor* monitor, RGFW_bo } RGFW_event event; - event.type = (connected) ? (RGFW_monitorConnected) : (RGFW_monitorDisconnected); + event.type = (connected) ? (RGFW_eventType)(RGFW_monitorConnected) : (RGFW_eventType)(RGFW_monitorDisconnected); event.monitor.monitor = monitor; + event.monitor.state = connected; event.common.win = win; - RGFW_eventQueuePush(&event); - - if (RGFW_monitorCallbackSrc) RGFW_monitorCallbackSrc(win, monitor, connected); + RGFW_eventQueuePushAndCall(&event); } #ifdef RGFW_DEBUG #include #endif -void RGFW_sendDebugInfo(RGFW_debugType type, RGFW_errorCode err, const char* msg) { - RGFW_debugCallback(type, err, msg); +void RGFW_debugCallback(RGFW_debugType type, RGFW_errorCode code, const char* msg) { + RGFW_debugInfo info; + info.type = type; + info.code = code; + info.msg = msg; + + if (_RGFW && _RGFW->debugCallbackSrc) _RGFW->debugCallbackSrc(&info); #ifdef RGFW_DEBUG switch (type) { - case RGFW_typeInfo: RGFW_PRINTF("RGFW INFO (%i %i): %s", type, err, msg); break; - case RGFW_typeError: RGFW_PRINTF("RGFW DEBUG (%i %i): %s", type, err, msg); break; - case RGFW_typeWarning: RGFW_PRINTF("RGFW WARNING (%i %i): %s", type, err, msg); break; + case RGFW_typeInfo: RGFW_PRINTF("RGFW INFO (%i %i): %s", type, code, msg); break; + case RGFW_typeError: RGFW_PRINTF("RGFW DEBUG (%i %i): %s", type, code, msg); break; + case RGFW_typeWarning: RGFW_PRINTF("RGFW WARNING (%i %i): %s", type, code, msg); break; default: break; } @@ -3890,12 +3862,39 @@ RGFW_bool RGFW_window_getSizeInPixels(RGFW_window* win, i32* w, i32* h) { #include "XDL.h" #endif -#ifndef RGFW_FORCE_INIT -RGFW_info _rgfwGlobal; -#endif +#ifndef RGFW_NO_STATIC_CONTEXT -i32 RGFW_init(void) { return RGFW_init_ptr(&_rgfwGlobal); } -void RGFW_deinit(void) { RGFW_deinit_ptr(&_rgfwGlobal); } +i32 RGFW_init(void) { + static RGFW_info _rgfwGlobal; + return RGFW_init_ptr(&_rgfwGlobal); +} + + +void RGFW_deinit(void) { RGFW_deinit_ptr(_RGFW); } + +#else + +RGFW_info* _rgfwGlobal; + +i32 RGFW_init(void) { + if (_rgfwGlobal != NULL) { + RGFW_FREE(_rgfwGlobal); + } + + _rgfwGlobal = (RGFW_info*)RGFW_ALLOC(sizeof(RGFW_info)); + + return RGFW_init_ptr(&_rgfwGlobal); +} + +void RGFW_deinit(void) { + if (_RGFW == _rgfwGlobal) { + RGFW_FREE(_rgfwGlobal); + _rgfwGlobal = NULL; + } + RGFW_deinit_ptr(_RGFW); +} + +#endif i32 RGFW_initPlatform(void); void RGFW_deinitPlatform(void); @@ -3904,35 +3903,36 @@ i32 RGFW_init_ptr(RGFW_info* info) { if (info == _RGFW || info == NULL) return 1; RGFW_setInfo(info); - RGFW_MEMSET(_RGFW, 0, sizeof(RGFW_info)); + RGFW_MEMZERO(_RGFW, sizeof(RGFW_info)); _RGFW->queueEvents = RGFW_FALSE; _RGFW->polledEvents = RGFW_FALSE; #ifdef RGFW_WAYLAND _RGFW->useWaylandBool = RGFW_TRUE; #endif - _RGFW->files = (char**)(void*)_RGFW->filesSrc; - u32 i; - for (i = 0; i < RGFW_MAX_DROPS; i++) - _RGFW->files[i] = (char*)(_RGFW->filesSrc + RGFW_MAX_DROPS + (i * RGFW_MAX_PATH)); + #if (RGFW_PREALLOCATED_MONITORS) + _RGFW->monitors.freeList.head = &_RGFW->monitors.data[0]; + _RGFW->monitors.freeList.cur = _RGFW->monitors.freeList.head; - _RGFW->monitors.freeList.head = &_RGFW->monitors.data[0]; - _RGFW->monitors.freeList.cur = _RGFW->monitors.freeList.head; - - for (i = 1; i < RGFW_MAX_MONITORS; i++) { - RGFW_monitorNode* newNode = &_RGFW->monitors.data[i]; - _RGFW->monitors.freeList.cur->next = newNode; - _RGFW->monitors.freeList.cur = _RGFW->monitors.freeList.cur->next; - } + for (size_t i = 1; i < RGFW_PREALLOCATED_MONITORS; i++) { + RGFW_monitorNode* newNode = &_RGFW->monitors.data[i]; + _RGFW->monitors.freeList.cur->next = newNode; + _RGFW->monitors.freeList.cur = _RGFW->monitors.freeList.cur->next; + } + #endif _RGFW->monitors.list.head = NULL; _RGFW->monitors.list.head = NULL; RGFW_initKeycodes(); i32 out = RGFW_initPlatform(); + for (size_t i = 0; i < RGFW_mouseIconCount; i++) { + _RGFW->standardMice[i] = RGFW_createMouseStandard((RGFW_mouseIcon)i); + } + RGFW_pollMonitors(); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoGlobal, "global context initialized"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoGlobal, "global context initialized"); return out; } @@ -3946,12 +3946,17 @@ void RGFW_deinit_ptr(RGFW_info* info) { RGFW_setInfo(info); RGFW_unloadEGL(); + + for (RGFW_mouseIcon i = 0; i < RGFW_mouseIconCount; i++) { + if (_RGFW->standardMice[i]) RGFW_freeMouse(_RGFW->standardMice[i]); + } + + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoGlobal, "global context deinitialized"); RGFW_deinitPlatform(); _RGFW->root = NULL; _RGFW->windowCount = 0; RGFW_setInfo(NULL); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoGlobal, "global context deinitialized"); } RGFW_window* RGFW_createWindow(const char* name, i32 x, i32 y, i32 w, i32 h, RGFW_windowFlags flags) { @@ -3970,7 +3975,7 @@ RGFW_window* RGFW_createWindowPtr(const char* name, i32 x, i32 y, i32 w, i32 h, RGFW_ASSERT(win != NULL); if (name == NULL) name = "\0"; - RGFW_MEMSET(win, 0, sizeof(RGFW_window)); + RGFW_MEMZERO(win, sizeof(RGFW_window)); if (_RGFW == NULL) RGFW_init(); _RGFW->windowCount++; @@ -3985,11 +3990,17 @@ RGFW_window* RGFW_createWindowPtr(const char* name, i32 x, i32 y, i32 w, i32 h, win->y = y; win->w = w; win->h = h; + win->internal.mouse = _RGFW->standardMice[RGFW_mouseNormal]; win->internal.flags = flags; win->internal.enabledEvents = RGFW_allEventFlags; + RGFW_windowFlags reservedFlags = flags & (RGFW_windowScaleToMonitor); + flags &= ~reservedFlags; + RGFW_window* ret = RGFW_createWindowPlatform(name, flags, win); + flags |= reservedFlags; + #ifndef RGFW_X11 RGFW_window_setFlagsInternal(win, flags, 0); #endif @@ -4027,7 +4038,7 @@ RGFW_window* RGFW_createWindowPtr(const char* name, i32 x, i32 y, i32 w, i32 h, /* NOTE: this is a hack so that way wayland spawns a window, even if nothing is drawn */ if (!(flags & RGFW_windowOpenGL) && !(flags & RGFW_windowEGL)) { u8* data = (u8*)RGFW_ALLOC((u32)(win->w * win->h * 3)); - RGFW_MEMSET(data, 0, (u32)(win->w * win->h * 3) * sizeof(u8)); + RGFW_MEMZERO(data, (u32)(win->w * win->h * 3) * sizeof(u8)); RGFW_surface* surface = RGFW_createSurface(data, win->w, win->h, RGFW_formatBGR8); RGFW_window_blitSurface(win, surface); RGFW_FREE(data); @@ -4046,7 +4057,7 @@ RGFW_window* RGFW_createWindowPtr(const char* name, i32 x, i32 y, i32 w, i32 h, RGFW_window_show(win); } - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoWindow, "a new window was created"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoWindow, "a new window was created"); return ret; } @@ -4077,7 +4088,7 @@ void RGFW_window_closePtr(RGFW_window* win) { RGFW_clipboard_switch(NULL); _RGFW->windowCount--; - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoWindow, "a window was freed"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoWindow, "a window was freed"); if (_RGFW->windowCount == 0 && !(win->internal.flags & RGFW_noDeinitOnClose)) RGFW_deinit(); } @@ -4091,7 +4102,7 @@ void RGFW_eventQueuePush(const RGFW_event* event) { RGFW_ASSERT(_RGFW->eventLen >= 0); if (_RGFW->eventLen >= RGFW_MAX_EVENTS) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errEventQueue, "Event queue limit 'RGFW_MAX_EVENTS' has been reached automatically flushing queue."); + RGFW_debugCallback(RGFW_typeError, RGFW_errEventQueue, "Event queue limit 'RGFW_MAX_EVENTS' has been reached automatically flushing queue."); RGFW_eventQueueFlush(); return; } @@ -4152,7 +4163,16 @@ void RGFW_resetPrevState(void) { _RGFW->scrollY = 0.0f; _RGFW->vectorX = (float)0.0f; _RGFW->vectorY = (float)0.0f; - RGFW_MEMSET(&_RGFW->windowState, 0, sizeof(_RGFW->windowState)); + RGFW_MEMZERO(&_RGFW->windowState, sizeof(_RGFW->windowState)); + + for (RGFW_dataDropNode* node = _RGFW->dndRoot; node; ) { + RGFW_dataDropNode* next = node->next; + RGFW_FREE(node); + node = next; + } + + _RGFW->dndRoot = NULL; + _RGFW->dndCur = NULL; } RGFW_bool RGFW_isKeyPressed(RGFW_key key) { @@ -4199,7 +4219,7 @@ RGFW_bool RGFW_window_didMouseEnter(RGFW_window* win) { return _RGFW->windowStat RGFW_bool RGFW_window_isMouseInside(RGFW_window* win) { return win->internal.mouseInside; } RGFW_bool RGFW_window_isDataDragging(RGFW_window* win) { return RGFW_window_getDataDrag(win, (i32*)NULL, (i32*)NULL); } -RGFW_bool RGFW_window_didDataDrop(RGFW_window* win) { return RGFW_window_getDataDrop(win, (const char***)NULL, (size_t*)NULL);} +RGFW_bool RGFW_window_didDataDrop(RGFW_window* win) { return RGFW_window_getDataDrop(win) != NULL;} RGFW_bool RGFW_window_getDataDrag(RGFW_window* win, i32* x, i32* y) { @@ -4208,11 +4228,9 @@ RGFW_bool RGFW_window_getDataDrag(RGFW_window* win, i32* x, i32* y) { if (y) *y = _RGFW->windowState.dropY; return RGFW_TRUE; } -RGFW_bool RGFW_window_getDataDrop(RGFW_window* win, const char*** files, size_t* count) { - if (_RGFW->windowState.win != win || _RGFW->windowState.dataDrop == RGFW_FALSE) return RGFW_FALSE; - if (files) *files = (const char**)_RGFW->files; - if (count) *count = _RGFW->windowState.filesCount; - return RGFW_TRUE; +RGFW_dataDropNode* RGFW_window_getDataDrop(RGFW_window* win) { + if (_RGFW->windowState.win != win || _RGFW->windowState.dataDrop == RGFW_FALSE) return NULL; + return _RGFW->dndRoot; } RGFW_bool RGFW_window_checkEvent(RGFW_window* win, RGFW_event* event) { @@ -4268,7 +4286,6 @@ RGFW_bool RGFW_loadEGL(void) { return RGFW_FALSE; } void RGFW_window_setFlagsInternal(RGFW_window* win, RGFW_windowFlags flags, RGFW_windowFlags cmpFlags) { if (flags & RGFW_windowNoBorder) RGFW_window_setBorder(win, 0); else if (cmpFlags & RGFW_windowNoBorder) RGFW_window_setBorder(win, 1); - if (flags & RGFW_windowScaleToMonitor) RGFW_window_scaleToMonitor(win); if (flags & RGFW_windowMaximize) RGFW_window_maximize(win); else if (cmpFlags & RGFW_windowMaximize) RGFW_window_restore(win); if (flags & RGFW_windowMinimize) RGFW_window_minimize(win); @@ -4288,6 +4305,7 @@ void RGFW_window_setFlagsInternal(RGFW_window* win, RGFW_windowFlags flags, RGFW if (flags & RGFW_windowCaptureMouse) RGFW_window_captureRawMouse(win, RGFW_TRUE); else if (cmpFlags & RGFW_windowCaptureMouse) RGFW_window_captureMouse(win, RGFW_FALSE); if (flags & RGFW_windowFocus) RGFW_window_focus(win); + if (flags & RGFW_windowScaleToMonitor) RGFW_window_scaleToMonitor(win); if (flags & RGFW_windowNoResize) { RGFW_window_setMaxSize(win, win->w, win->h); @@ -4312,6 +4330,7 @@ RGFW_bool RGFW_window_isInFocus(RGFW_window* win) { } void RGFW_setClassName(const char* name) { RGFW_init(); _RGFW->className = name; } +void RGFW_setBuildDND(RGFW_bool state) { _RGFW->dndBuild = state; } #ifndef RGFW_X11 void RGFW_setXInstName(const char* name) { RGFW_UNUSED(name); } @@ -4366,7 +4385,7 @@ void RGFW_window_center(RGFW_window* win) { RGFW_monitor* mon = RGFW_window_getMonitor(win); if (mon == NULL) return; - RGFW_window_move(win, (i32)(mon->mode.w - win->w) / 2, (mon->mode.h - win->h) / 2); + RGFW_window_move(win, mon->x + ((i32)(mon->mode.w - win->w) / 2), mon->y + ((mon->mode.h - win->h) / 2)); } RGFW_bool RGFW_monitor_scaleToWindow(RGFW_monitor* mon, RGFW_window* win) { @@ -4377,7 +4396,6 @@ RGFW_bool RGFW_monitor_scaleToWindow(RGFW_monitor* mon, RGFW_window* win) { mode.h = win->h; RGFW_bool ret = RGFW_monitor_requestMode(mon, &mode, RGFW_monitorScale); - /* move window to monitor origin so it doesn't move to the next monitor */ RGFW_window_move(win, mon->x, mon->y); @@ -4403,12 +4421,12 @@ RGFW_bool RGFW_monitorModeCompare(RGFW_monitorMode* mon, RGFW_monitorMode* mon2, } RGFW_bool RGFW_window_shouldClose(RGFW_window* win) { - return (win == NULL || win->internal.shouldClose || (win->internal.exitKey && RGFW_window_isKeyDown(win, win->internal.exitKey))); + return (win == NULL || win->internal.shouldClose || (win->internal.exitKey && RGFW_isKeyDown(win->internal.exitKey))); } void RGFW_window_setShouldClose(RGFW_window* win, RGFW_bool shouldClose) { if (shouldClose) { - RGFW_windowQuitCallback(win); + RGFW_windowCloseCallback(win); } else { win->internal.shouldClose = RGFW_FALSE; } @@ -4428,7 +4446,7 @@ void RGFW_window_moveToMonitor(RGFW_window* win, RGFW_monitor* m) { RGFW_surface* RGFW_createSurface(u8* data, i32 w, i32 h, RGFW_format format) { RGFW_surface* surface = (RGFW_surface*)RGFW_ALLOC(sizeof(RGFW_surface)); - RGFW_MEMSET(surface, 0, sizeof(RGFW_surface)); + RGFW_MEMZERO(surface, sizeof(RGFW_surface)); RGFW_createSurfacePtr(data, w, h, format, surface); return surface; } @@ -4448,7 +4466,7 @@ RGFW_nativeImage* RGFW_surface_getNativeImage(RGFW_surface* surface) { RGFW_surface* RGFW_window_createSurface(RGFW_window* win, u8* data, i32 w, i32 h, RGFW_format format) { RGFW_surface* surface = (RGFW_surface*)RGFW_ALLOC(sizeof(RGFW_surface)); - RGFW_MEMSET(surface, 0, sizeof(RGFW_surface)); + RGFW_MEMZERO(surface, sizeof(RGFW_surface)); RGFW_window_createSurfacePtr(win, data, w, h, format, surface); return surface; } @@ -4520,14 +4538,22 @@ void RGFW_copyImageData64(u8* dest_data, i32 dest_w, i32 dest_h, RGFW_format des RGFW_monitorNode* RGFW_monitors_add(const RGFW_monitor* mon) { RGFW_monitorNode* node = NULL; - if (_RGFW->monitors.freeList.head == NULL) return node; - node = _RGFW->monitors.freeList.head; - - _RGFW->monitors.freeList.head = node->next; - if (_RGFW->monitors.freeList.head == NULL) { - _RGFW->monitors.freeList.cur = NULL; + #if (RGFW_PREALLOCATED_MONITORS) + node = _RGFW->monitors.freeList.head; + if (node) { + _RGFW->monitors.freeList.head = node->next; + if (_RGFW->monitors.freeList.head == NULL) { + _RGFW->monitors.freeList.cur = NULL; + } + } else + #elif !defined(RGFW_NO_ALLOCATE_MONITORS) + { + node = (RGFW_monitorNode*)RGFW_ALLOC(sizeof(RGFW_monitorNode)); } + #endif + + if (node == NULL) return NULL; node->next = NULL; @@ -4559,14 +4585,23 @@ void RGFW_monitors_remove(RGFW_monitorNode* node, RGFW_monitorNode* prev) { node->next = NULL; - /* move node to the free list */ - if (_RGFW->monitors.freeList.head == NULL) { - _RGFW->monitors.freeList.head = node; - } else { - _RGFW->monitors.freeList.cur->next = node; - } + #if (RGFW_PREALLOCATED_MONITORS) + /* check if the monitor was allocated in the heap or not */ + if (node >= _RGFW->monitors.data && node <= &_RGFW->monitors.data[RGFW_PREALLOCATED_MONITORS - 1]) { + /* move node to the free list */ + if (_RGFW->monitors.freeList.head == NULL) { + _RGFW->monitors.freeList.head = node; + } else { + _RGFW->monitors.freeList.cur->next = node; + } - _RGFW->monitors.freeList.cur = node; + _RGFW->monitors.freeList.cur = node; + } else + { + #elif !defined(RGFW_NO_ALLOCATE_MONITORS) + RGFW_FREE(node); + #endif + } } void RGFW_monitors_refresh(void) { @@ -4711,23 +4746,49 @@ RGFW_bool RGFW_monitor_setGamma(RGFW_monitor* monitor, float gamma) { } RGFW_monitor** RGFW_getMonitors(size_t* len) { - static RGFW_monitor* monitors[RGFW_MAX_MONITORS]; + if (len != NULL) *len = 0; + + size_t count = 0; + if (RGFW_getMonitorsPtr(0, NULL, &count) == RGFW_FALSE || count == 0) return NULL; + + RGFW_monitor** monitors = (RGFW_monitor**)RGFW_ALLOC(sizeof(RGFW_monitor*) * count); + + if (RGFW_getMonitorsPtr(count, monitors, &count) == RGFW_FALSE) { + RGFW_FREE(monitors); + return NULL; + } + + if (len != NULL) *len = count; + + return monitors; +} + +RGFW_bool RGFW_getMonitorsPtr(size_t max, RGFW_monitor** monitors, size_t* len) { RGFW_init(); if (len != NULL) { *len = _RGFW->monitors.count; } - u8 i = 0; + if (monitors == NULL || max == 0) return RGFW_TRUE; + + + if (len != NULL) { + *len = max; + } + + size_t i = 0; RGFW_monitorNode* cur_node = _RGFW->monitors.list.head; - while (cur_node != NULL) { + while (cur_node != NULL && i < max) { monitors[i] = &cur_node->mon; i++; cur_node = cur_node->next; } - return monitors; + + return RGFW_TRUE; } RGFW_monitor* RGFW_getPrimaryMonitor(void) { + RGFW_init(); if (_RGFW->monitors.primary == NULL) { _RGFW->monitors.primary = _RGFW->monitors.list.head; } @@ -4757,27 +4818,27 @@ void RGFW_window_captureRawMouse(RGFW_window* win, RGFW_bool state) { RGFW_bool RGFW_window_isRawMouseMode(RGFW_window* win) { return RGFW_BOOL(win->internal.rawMouse); } RGFW_bool RGFW_window_isCaptured(RGFW_window* win) { return RGFW_BOOL(win->internal.captureMouse); } -void RGFW_updateKeyMod(RGFW_window* win, RGFW_keymod mod, RGFW_bool value) { +void RGFW_keyUpdateKeyMod(RGFW_window* win, RGFW_keymod mod, RGFW_bool value) { if (value) win->internal.mod |= mod; else win->internal.mod &= ~mod; } -void RGFW_updateKeyModsEx(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool control, RGFW_bool alt, RGFW_bool shift, RGFW_bool super, RGFW_bool scroll) { - RGFW_updateKeyMod(win, RGFW_modCapsLock, capital); - RGFW_updateKeyMod(win, RGFW_modNumLock, numlock); - RGFW_updateKeyMod(win, RGFW_modControl, control); - RGFW_updateKeyMod(win, RGFW_modAlt, alt); - RGFW_updateKeyMod(win, RGFW_modShift, shift); - RGFW_updateKeyMod(win, RGFW_modSuper, super); - RGFW_updateKeyMod(win, RGFW_modScrollLock, scroll); +void RGFW_keyUpdateKeyModsEx(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool control, RGFW_bool alt, RGFW_bool shift, RGFW_bool super, RGFW_bool scroll) { + RGFW_keyUpdateKeyMod(win, RGFW_modCapsLock, capital); + RGFW_keyUpdateKeyMod(win, RGFW_modNumLock, numlock); + RGFW_keyUpdateKeyMod(win, RGFW_modControl, control); + RGFW_keyUpdateKeyMod(win, RGFW_modAlt, alt); + RGFW_keyUpdateKeyMod(win, RGFW_modShift, shift); + RGFW_keyUpdateKeyMod(win, RGFW_modSuper, super); + RGFW_keyUpdateKeyMod(win, RGFW_modScrollLock, scroll); } -void RGFW_updateKeyMods(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool scroll) { - RGFW_updateKeyModsEx(win, capital, numlock, - RGFW_window_isKeyDown(win, RGFW_controlL) || RGFW_window_isKeyDown(win, RGFW_controlR), - RGFW_window_isKeyDown(win, RGFW_altL) || RGFW_window_isKeyDown(win, RGFW_altR), - RGFW_window_isKeyDown(win, RGFW_shiftL) || RGFW_window_isKeyDown(win, RGFW_shiftR), - RGFW_window_isKeyDown(win, RGFW_superL) || RGFW_window_isKeyDown(win, RGFW_superR), +void RGFW_keyUpdateKeyMods(RGFW_window* win, RGFW_bool capital, RGFW_bool numlock, RGFW_bool scroll) { + RGFW_keyUpdateKeyModsEx(win, capital, numlock, + RGFW_isKeyDown(RGFW_keyControlL) || RGFW_isKeyDown(RGFW_keyControlR), + RGFW_isKeyDown(RGFW_keyAltL) || RGFW_isKeyDown(RGFW_keyAltR), + RGFW_isKeyDown(RGFW_keyShiftL) || RGFW_isKeyDown(RGFW_keyShiftR), + RGFW_isKeyDown(RGFW_keySuperL) || RGFW_isKeyDown(RGFW_keySuperR), scroll); } @@ -4799,27 +4860,39 @@ RGFW_bool RGFW_window_borderless(RGFW_window* win) { RGFW_bool RGFW_window_isFullscreen(RGFW_window* win){ return RGFW_BOOL(win->internal.flags & RGFW_windowFullscreen); } RGFW_bool RGFW_window_allowsDND(RGFW_window* win) { return RGFW_BOOL(win->internal.flags & RGFW_windowAllowDND); } +RGFW_bool RGFW_window_setMouseDefault(RGFW_window* win) { + return RGFW_window_setMouseStandard(win, RGFW_mouseNormal); +} + +RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, RGFW_mouseIcon icon) { + RGFW_ASSERT(win); + RGFW_ASSERT(icon < RGFW_mouseIconCount); + return RGFW_window_setMouse(win, _RGFW->standardMice[icon]); +} + +RGFW_bool RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse) { + RGFW_ASSERT(win && mouse); + if (mouse != _RGFW->hiddenMouse) { + win->internal.mouse = mouse; + } + + return RGFW_window_setMousePlatform(win, mouse); +} + #ifndef RGFW_WINDOWS void RGFW_window_setDND(RGFW_window* win, RGFW_bool allow) { RGFW_setBit(&win->internal.flags, RGFW_windowAllowDND, allow); } #endif -#if defined(RGFW_X11) || defined(RGFW_MACOS) || defined(RGFW_WASM) || defined(RGFW_WAYLAND) -#ifndef __USE_POSIX199309 - #define __USE_POSIX199309 -#endif -#include -struct timespec; -#endif - #if defined(RGFW_WAYLAND) || defined(RGFW_X11) || defined(RGFW_WINDOWS) void RGFW_window_showMouse(RGFW_window* win, RGFW_bool show) { RGFW_window_showMouseFlags(win, show); - if (show == RGFW_FALSE) + if (show == RGFW_FALSE) { RGFW_window_setMouse(win, _RGFW->hiddenMouse); - else - RGFW_window_setMouseDefault(win); + } else { + RGFW_window_setMouse(win, win->internal.mouse); + } } #endif @@ -5038,7 +5111,6 @@ void RGFW_attribStack_pushAttribs(RGFW_attribStack* stack, i32 attrib1, i32 attr /* EGL */ #ifdef RGFW_EGL -#include #include PFNEGLINITIALIZEPROC RGFW_eglInitialize; @@ -5322,7 +5394,7 @@ RGFW_bool RGFW_window_createContextPtr_EGL(RGFW_window* win, RGFW_eglContext* ct if (visualID) { desired.visualid = (VisualID)visualID; result = XGetVisualInfo(_RGFW->display, VisualIDMask, &desired, &count); - } else RGFW_sendDebugInfo(RGFW_typeError, RGFW_errEGLContext, "Failed to fetch a valid EGL VisualID"); + } else RGFW_debugCallback(RGFW_typeError, RGFW_errEGLContext, "Failed to fetch a valid EGL VisualID"); if (result == NULL || count == 0) { if (win->src.window == 0) { @@ -5330,7 +5402,7 @@ RGFW_bool RGFW_window_createContextPtr_EGL(RGFW_window* win, RGFW_eglContext* ct win->internal.flags &= ~(u32)RGFW_windowEGL; RGFW_createWindowPlatform("", win->internal.flags, win); } - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errEGLContext, "Failed to find a valid visual for the EGL config"); + RGFW_debugCallback(RGFW_typeError, RGFW_errEGLContext, "Failed to find a valid visual for the EGL config"); } else { RGFW_bool showWindow = RGFW_FALSE; if (win->src.window) { @@ -5407,7 +5479,7 @@ RGFW_bool RGFW_window_createContextPtr_EGL(RGFW_window* win, RGFW_eglContext* ct #endif if (win->src.ctx.egl->surface == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errEGLContext, "Failed to create an EGL surface."); + RGFW_debugCallback(RGFW_typeError, RGFW_errEGLContext, "Failed to create an EGL surface."); return RGFW_FALSE; } @@ -5458,13 +5530,13 @@ RGFW_bool RGFW_window_createContextPtr_EGL(RGFW_window* win, RGFW_eglContext* ct win->src.ctx.egl->ctx = RGFW_eglCreateContext(_RGFW->EGL_display, config, hints->shareEGL, attribs); if (win->src.ctx.egl->ctx == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errEGLContext, "Failed to create an EGL context."); + RGFW_debugCallback(RGFW_typeError, RGFW_errEGLContext, "Failed to create an EGL context."); return RGFW_FALSE; } RGFW_eglMakeCurrent(_RGFW->EGL_display, win->src.ctx.egl->surface, win->src.ctx.egl->surface, win->src.ctx.egl->ctx); RGFW_eglSwapBuffers(_RGFW->EGL_display, win->src.ctx.egl->surface); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "EGL context initalized."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "EGL context initalized."); return RGFW_TRUE; } @@ -5478,11 +5550,11 @@ void RGFW_window_deleteContextPtr_EGL(RGFW_window* win, RGFW_eglContext* ctx) { RGFW_eglDestroySurface(_RGFW->EGL_display, ctx->surface); RGFW_eglDestroyContext(_RGFW->EGL_display, ctx->ctx); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "EGL context freed"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "EGL context freed"); #ifdef RGFW_WAYLAND if (_RGFW->useWaylandBool == RGFW_FALSE) return; wl_egl_window_destroy(win->src.ctx.egl->eglWindow); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "EGL window context freed"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "EGL window context freed"); #endif win->src.ctx.egl = NULL; } @@ -5632,9 +5704,11 @@ This is where OS specific stuff starts /* start of unix (wayland or X11 (unix) ) defines */ #ifdef RGFW_UNIX + #include #include #include +#include void RGFW_stopCheckEvents(void) { @@ -5746,7 +5820,7 @@ void RGFW_waitForEvent(i32 waitMS) { /* drain any data in the stop request */ if (_RGFW->eventWait_forceStop[2]) { char data[64]; - RGFW_MEMSET(data, 0, sizeof(data)); + RGFW_MEMZERO(data, sizeof(data)); (void)!read(_RGFW->eventWait_forceStop[0], data, sizeof(data)); _RGFW->eventWait_forceStop[2] = 0; @@ -5826,129 +5900,129 @@ void RGFW_load_Wayland(void) { } * We can't use linux enums, because the headers don't exist on BSD */ void RGFW_initKeycodesPlatform(void) { - _RGFW->keycodes[49] = RGFW_backtick; - _RGFW->keycodes[19] = RGFW_0; - _RGFW->keycodes[10] = RGFW_1; - _RGFW->keycodes[11] = RGFW_2; - _RGFW->keycodes[12] = RGFW_3; - _RGFW->keycodes[13] = RGFW_4; - _RGFW->keycodes[14] = RGFW_5; - _RGFW->keycodes[15] = RGFW_6; - _RGFW->keycodes[16] = RGFW_7; - _RGFW->keycodes[17] = RGFW_8; - _RGFW->keycodes[18] = RGFW_9; - _RGFW->keycodes[65] = RGFW_space; - _RGFW->keycodes[38] = RGFW_a; - _RGFW->keycodes[56] = RGFW_b; - _RGFW->keycodes[54] = RGFW_c; - _RGFW->keycodes[40] = RGFW_d; - _RGFW->keycodes[26] = RGFW_e; - _RGFW->keycodes[41] = RGFW_f; - _RGFW->keycodes[42] = RGFW_g; - _RGFW->keycodes[43] = RGFW_h; - _RGFW->keycodes[31] = RGFW_i; - _RGFW->keycodes[44] = RGFW_j; - _RGFW->keycodes[45] = RGFW_k; - _RGFW->keycodes[46] = RGFW_l; - _RGFW->keycodes[58] = RGFW_m; - _RGFW->keycodes[57] = RGFW_n; - _RGFW->keycodes[32] = RGFW_o; - _RGFW->keycodes[33] = RGFW_p; - _RGFW->keycodes[24] = RGFW_q; - _RGFW->keycodes[27] = RGFW_r; - _RGFW->keycodes[39] = RGFW_s; - _RGFW->keycodes[28] = RGFW_t; - _RGFW->keycodes[30] = RGFW_u; - _RGFW->keycodes[55] = RGFW_v; - _RGFW->keycodes[25] = RGFW_w; - _RGFW->keycodes[53] = RGFW_x; - _RGFW->keycodes[29] = RGFW_y; - _RGFW->keycodes[52] = RGFW_z; - _RGFW->keycodes[60] = RGFW_period; - _RGFW->keycodes[59] = RGFW_comma; - _RGFW->keycodes[61] = RGFW_slash; - _RGFW->keycodes[34] = RGFW_bracket; - _RGFW->keycodes[35] = RGFW_closeBracket; - _RGFW->keycodes[47] = RGFW_semicolon; - _RGFW->keycodes[48] = RGFW_apostrophe; - _RGFW->keycodes[51] = RGFW_backSlash; - _RGFW->keycodes[36] = RGFW_return; - _RGFW->keycodes[119] = RGFW_delete; - _RGFW->keycodes[77] = RGFW_numLock; - _RGFW->keycodes[106] = RGFW_kpSlash; - _RGFW->keycodes[63] = RGFW_kpMultiply; - _RGFW->keycodes[86] = RGFW_kpPlus; - _RGFW->keycodes[82] = RGFW_kpMinus; - _RGFW->keycodes[87] = RGFW_kp1; - _RGFW->keycodes[88] = RGFW_kp2; - _RGFW->keycodes[89] = RGFW_kp3; - _RGFW->keycodes[83] = RGFW_kp4; - _RGFW->keycodes[84] = RGFW_kp5; - _RGFW->keycodes[85] = RGFW_kp6; - _RGFW->keycodes[81] = RGFW_kp9; - _RGFW->keycodes[90] = RGFW_kp0; - _RGFW->keycodes[91] = RGFW_kpPeriod; - _RGFW->keycodes[104] = RGFW_kpReturn; - _RGFW->keycodes[20] = RGFW_minus; - _RGFW->keycodes[21] = RGFW_equals; - _RGFW->keycodes[22] = RGFW_backSpace; - _RGFW->keycodes[23] = RGFW_tab; - _RGFW->keycodes[66] = RGFW_capsLock; - _RGFW->keycodes[50] = RGFW_shiftL; - _RGFW->keycodes[37] = RGFW_controlL; - _RGFW->keycodes[64] = RGFW_altL; - _RGFW->keycodes[133] = RGFW_superL; - _RGFW->keycodes[105] = RGFW_controlR; - _RGFW->keycodes[134] = RGFW_superR; - _RGFW->keycodes[62] = RGFW_shiftR; - _RGFW->keycodes[108] = RGFW_altR; - _RGFW->keycodes[67] = RGFW_F1; - _RGFW->keycodes[68] = RGFW_F2; - _RGFW->keycodes[69] = RGFW_F3; - _RGFW->keycodes[70] = RGFW_F4; - _RGFW->keycodes[71] = RGFW_F5; - _RGFW->keycodes[72] = RGFW_F6; - _RGFW->keycodes[73] = RGFW_F7; - _RGFW->keycodes[74] = RGFW_F8; - _RGFW->keycodes[75] = RGFW_F9; - _RGFW->keycodes[76] = RGFW_F10; - _RGFW->keycodes[95] = RGFW_F11; - _RGFW->keycodes[96] = RGFW_F12; - _RGFW->keycodes[111] = RGFW_up; - _RGFW->keycodes[116] = RGFW_down; - _RGFW->keycodes[113] = RGFW_left; - _RGFW->keycodes[114] = RGFW_right; - _RGFW->keycodes[118] = RGFW_insert; - _RGFW->keycodes[115] = RGFW_end; - _RGFW->keycodes[112] = RGFW_pageUp; - _RGFW->keycodes[117] = RGFW_pageDown; - _RGFW->keycodes[9] = RGFW_escape; - _RGFW->keycodes[110] = RGFW_home; - _RGFW->keycodes[78] = RGFW_scrollLock; - _RGFW->keycodes[107] = RGFW_printScreen; - _RGFW->keycodes[128] = RGFW_pause; - _RGFW->keycodes[191] = RGFW_F13; - _RGFW->keycodes[192] = RGFW_F14; - _RGFW->keycodes[193] = RGFW_F15; - _RGFW->keycodes[194] = RGFW_F16; - _RGFW->keycodes[195] = RGFW_F17; - _RGFW->keycodes[196] = RGFW_F18; - _RGFW->keycodes[197] = RGFW_F19; - _RGFW->keycodes[198] = RGFW_F20; - _RGFW->keycodes[199] = RGFW_F21; - _RGFW->keycodes[200] = RGFW_F22; - _RGFW->keycodes[201] = RGFW_F23; - _RGFW->keycodes[202] = RGFW_F24; - _RGFW->keycodes[203] = RGFW_F25; - _RGFW->keycodes[142] = RGFW_kpEqual; - _RGFW->keycodes[161] = RGFW_world1; /* non-US key #1 */ - _RGFW->keycodes[162] = RGFW_world2; /* non-US key #2 */ + _RGFW->keycodes[49] = RGFW_keyBacktick; + _RGFW->keycodes[19] = RGFW_key0; + _RGFW->keycodes[10] = RGFW_key1; + _RGFW->keycodes[11] = RGFW_key2; + _RGFW->keycodes[12] = RGFW_key3; + _RGFW->keycodes[13] = RGFW_key4; + _RGFW->keycodes[14] = RGFW_key5; + _RGFW->keycodes[15] = RGFW_key6; + _RGFW->keycodes[16] = RGFW_key7; + _RGFW->keycodes[17] = RGFW_key8; + _RGFW->keycodes[18] = RGFW_key9; + _RGFW->keycodes[65] = RGFW_keySpace; + _RGFW->keycodes[38] = RGFW_keyA; + _RGFW->keycodes[56] = RGFW_keyB; + _RGFW->keycodes[54] = RGFW_keyC; + _RGFW->keycodes[40] = RGFW_keyD; + _RGFW->keycodes[26] = RGFW_keyE; + _RGFW->keycodes[41] = RGFW_keyF; + _RGFW->keycodes[42] = RGFW_keyG; + _RGFW->keycodes[43] = RGFW_keyH; + _RGFW->keycodes[31] = RGFW_keyI; + _RGFW->keycodes[44] = RGFW_keyJ; + _RGFW->keycodes[45] = RGFW_keyK; + _RGFW->keycodes[46] = RGFW_keyL; + _RGFW->keycodes[58] = RGFW_keyM; + _RGFW->keycodes[57] = RGFW_keyN; + _RGFW->keycodes[32] = RGFW_keyO; + _RGFW->keycodes[33] = RGFW_keyP; + _RGFW->keycodes[24] = RGFW_keyQ; + _RGFW->keycodes[27] = RGFW_keyR; + _RGFW->keycodes[39] = RGFW_keyS; + _RGFW->keycodes[28] = RGFW_keyT; + _RGFW->keycodes[30] = RGFW_keyU; + _RGFW->keycodes[55] = RGFW_keyV; + _RGFW->keycodes[25] = RGFW_keyW; + _RGFW->keycodes[53] = RGFW_keyX; + _RGFW->keycodes[29] = RGFW_keyY; + _RGFW->keycodes[52] = RGFW_keyZ; + _RGFW->keycodes[60] = RGFW_keyPeriod; + _RGFW->keycodes[59] = RGFW_keyComma; + _RGFW->keycodes[61] = RGFW_keySlash; + _RGFW->keycodes[34] = RGFW_keyBracket; + _RGFW->keycodes[35] = RGFW_keyCloseBracket; + _RGFW->keycodes[47] = RGFW_keySemicolon; + _RGFW->keycodes[48] = RGFW_keyApostrophe; + _RGFW->keycodes[51] = RGFW_keyBackSlash; + _RGFW->keycodes[36] = RGFW_keyReturn; + _RGFW->keycodes[119] = RGFW_keyDelete; + _RGFW->keycodes[77] = RGFW_keyNumLock; + _RGFW->keycodes[106] = RGFW_keyPadSlash; + _RGFW->keycodes[63] = RGFW_keyPadMultiply; + _RGFW->keycodes[86] = RGFW_keyPadPlus; + _RGFW->keycodes[82] = RGFW_keyPadMinus; + _RGFW->keycodes[87] = RGFW_keyPad1; + _RGFW->keycodes[88] = RGFW_keyPad2; + _RGFW->keycodes[89] = RGFW_keyPad3; + _RGFW->keycodes[83] = RGFW_keyPad4; + _RGFW->keycodes[84] = RGFW_keyPad5; + _RGFW->keycodes[85] = RGFW_keyPad6; + _RGFW->keycodes[81] = RGFW_keyPad9; + _RGFW->keycodes[90] = RGFW_keyPad0; + _RGFW->keycodes[91] = RGFW_keyPadPeriod; + _RGFW->keycodes[104] = RGFW_keyPadReturn; + _RGFW->keycodes[20] = RGFW_keyMinus; + _RGFW->keycodes[21] = RGFW_keyEquals; + _RGFW->keycodes[22] = RGFW_keyBackSpace; + _RGFW->keycodes[23] = RGFW_keyTab; + _RGFW->keycodes[66] = RGFW_keyCapsLock; + _RGFW->keycodes[50] = RGFW_keyShiftL; + _RGFW->keycodes[37] = RGFW_keyControlL; + _RGFW->keycodes[64] = RGFW_keyAltL; + _RGFW->keycodes[133] = RGFW_keySuperL; + _RGFW->keycodes[105] = RGFW_keyControlR; + _RGFW->keycodes[134] = RGFW_keySuperR; + _RGFW->keycodes[62] = RGFW_keyShiftR; + _RGFW->keycodes[108] = RGFW_keyAltR; + _RGFW->keycodes[67] = RGFW_keyF1; + _RGFW->keycodes[68] = RGFW_keyF2; + _RGFW->keycodes[69] = RGFW_keyF3; + _RGFW->keycodes[70] = RGFW_keyF4; + _RGFW->keycodes[71] = RGFW_keyF5; + _RGFW->keycodes[72] = RGFW_keyF6; + _RGFW->keycodes[73] = RGFW_keyF7; + _RGFW->keycodes[74] = RGFW_keyF8; + _RGFW->keycodes[75] = RGFW_keyF9; + _RGFW->keycodes[76] = RGFW_keyF10; + _RGFW->keycodes[95] = RGFW_keyF11; + _RGFW->keycodes[96] = RGFW_keyF12; + _RGFW->keycodes[111] = RGFW_keyUp; + _RGFW->keycodes[116] = RGFW_keyDown; + _RGFW->keycodes[113] = RGFW_keyLeft; + _RGFW->keycodes[114] = RGFW_keyRight; + _RGFW->keycodes[118] = RGFW_keyInsert; + _RGFW->keycodes[115] = RGFW_keyEnd; + _RGFW->keycodes[112] = RGFW_keyPageUp; + _RGFW->keycodes[117] = RGFW_keyPageDown; + _RGFW->keycodes[9] = RGFW_keyEscape; + _RGFW->keycodes[110] = RGFW_keyHome; + _RGFW->keycodes[78] = RGFW_keyScrollLock; + _RGFW->keycodes[107] = RGFW_keyPrintScreen; + _RGFW->keycodes[128] = RGFW_keyPause; + _RGFW->keycodes[191] = RGFW_keyF13; + _RGFW->keycodes[192] = RGFW_keyF14; + _RGFW->keycodes[193] = RGFW_keyF15; + _RGFW->keycodes[194] = RGFW_keyF16; + _RGFW->keycodes[195] = RGFW_keyF17; + _RGFW->keycodes[196] = RGFW_keyF18; + _RGFW->keycodes[197] = RGFW_keyF19; + _RGFW->keycodes[198] = RGFW_keyF20; + _RGFW->keycodes[199] = RGFW_keyF21; + _RGFW->keycodes[200] = RGFW_keyF22; + _RGFW->keycodes[201] = RGFW_keyF23; + _RGFW->keycodes[202] = RGFW_keyF24; + _RGFW->keycodes[203] = RGFW_keyF25; + _RGFW->keycodes[142] = RGFW_keyPadEqual; + _RGFW->keycodes[161] = RGFW_keyWorld1; /* non-US key #1 */ + _RGFW->keycodes[162] = RGFW_keyWorld2; /* non-US key #2 */ } i32 RGFW_initPlatform(void) { #if defined(_POSIX_MONOTONIC_CLOCK) struct timespec ts; - RGFW_MEMSET(&ts, 0, sizeof(struct timespec)); + RGFW_MEMZERO(&ts, sizeof(struct timespec)); if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) _RGFW->clock = CLOCK_MONOTONIC; @@ -5963,7 +6037,7 @@ i32 RGFW_initPlatform(void) { return 0; } else { #ifdef RGFW_X11 - RGFW_sendDebugInfo(RGFW_typeWarning, RGFW_warningWayland, "Falling back to X11"); + RGFW_debugCallback(RGFW_typeWarning, RGFW_warningWayland, "Falling back to X11"); RGFW_useWayland(0); #else return ret; @@ -6002,6 +6076,62 @@ size_t RGFW_unix_stringlen(const char* name) { return i; } +RGFWDEF void RGFW_unix_parseURI(RGFW_window* win, char* data); +void RGFW_unix_parseURI(RGFW_window* win, char* data) { + const char* prefix = (const char*)"file://"; + char* line; + while ((line = (char*)RGFW_strtok(data, "\r\n"))) { + data = NULL; + + if (line[0] == '#') + continue; + + char* l; + for (l = line; 1; l++) { + if ((l - line) > 7) + break; + else if (*l != prefix[(l - line)]) + break; + else if (*l == '\0' && prefix[(l - line)] == '\0') { + line += 7; + while (*line != '/') + line++; + break; + } else if (*l == '\0') + break; + } + + size_t len = RGFW_unix_stringlen(line); + char* path = (char*)RGFW_ALLOC(len + 1); + + size_t index = 0; + while (*line) { + if (line[0] == '%' && line[1] && line[2]) { + char digits[3] = {0}; + digits[0] = line[1]; + digits[1] = line[2]; + digits[2] = '\0'; + path[index] = (char) RGFW_STRTOL(digits, NULL, 16); + line += 2; + } else { + if (index >= len) { + break; + } + + path[index] = *line; + } + + index++; + line++; + } + + path[len] = '\0'; + RGFW_dataDropCallback(win, (const char*)path, len + 1, RGFW_dataFile); + RGFW_FREE(path); + } +} + + #endif /* end of wayland or X11 defines */ @@ -6229,7 +6359,7 @@ RGFW_bool RGFW_window_createSurfacePtr(RGFW_window* win, u8* data, i32 w, i32 h, XWindowAttributes attrs; if (XGetWindowAttributes(_RGFW->display, win->src.window, &attrs) == 0) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errBuffer, "Failed to get window attributes."); + RGFW_debugCallback(RGFW_typeError, RGFW_errBuffer, "Failed to get window attributes."); return RGFW_FALSE; } @@ -6240,7 +6370,7 @@ RGFW_bool RGFW_window_createSurfacePtr(RGFW_window* win, u8* data, i32 w, i32 h, surface->native.format = RGFW_XImage_getFormat(surface->native.bitmap); if (surface->native.bitmap == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errBuffer, "Failed to create XImage."); + RGFW_debugCallback(RGFW_typeError, RGFW_errBuffer, "Failed to create XImage."); return RGFW_FALSE; } @@ -6295,7 +6425,17 @@ void RGFW_FUNC(RGFW_window_setBorder) (RGFW_window* win, RGFW_bool border) { } void RGFW_FUNC(RGFW_window_setRawMouseModePlatform) (RGFW_window* win, RGFW_bool state) { - RGFW_UNUSED(win); RGFW_UNUSED(state); + RGFW_UNUSED(win); + unsigned char mask[XIMaskLen(XI_RawMotion)]; + RGFW_MEMZERO(mask, sizeof(mask)); + if (state) XISetMask(mask, XI_RawMotion); + + XIEventMask em; + em.deviceid = XIAllMasterDevices; + em.mask_len = sizeof(mask); + em.mask = mask; + + XISelectEvents(_RGFW->display, XDefaultRootWindow(_RGFW->display), &em, 1); } void RGFW_FUNC(RGFW_window_captureMousePlatform) (RGFW_window* win, RGFW_bool state) { @@ -6320,7 +6460,7 @@ void RGFW_window_getVisual(XVisualInfo* visual, RGFW_bool transparent) { if (transparent) { XMatchVisualInfo(_RGFW->display, DefaultScreen(_RGFW->display), 32, TrueColor, visual); /*!< for RGBA backgrounds */ if (visual->depth != 32) - RGFW_sendDebugInfo(RGFW_typeWarning, RGFW_warningOpenGL, "Failed to load a 32-bit depth."); + RGFW_debugCallback(RGFW_typeWarning, RGFW_warningOpenGL, "Failed to load a 32-bit depth."); } } @@ -6334,7 +6474,7 @@ int RGFW_XErrorHandler(Display* display, XErrorEvent* ev) { errorText, ev->error_code, ev->request_code, ev->minor_code, ev->serial); - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errX11, buf); + RGFW_debugCallback(RGFW_typeError, RGFW_errX11, buf); _RGFW->x11Error = ev; return 0; } @@ -6345,7 +6485,7 @@ void RGFW_XCreateWindow (XVisualInfo visual, const char* name, RGFW_windowFlags /* make X window attrubutes */ XSetWindowAttributes swa; - RGFW_MEMSET(&swa, 0, sizeof(swa)); + RGFW_MEMZERO(&swa, sizeof(swa)); win->src.parent = DefaultRootWindow(_RGFW->display); @@ -6398,9 +6538,6 @@ void RGFW_XCreateWindow (XVisualInfo visual, const char* name, RGFW_windowFlags XSetWMHints(_RGFW->display, win->src.window, &hints); - if (flags & RGFW_windowScaleToMonitor) - RGFW_window_scaleToMonitor(win); - XSelectInput(_RGFW->display, (Drawable) win->src.window, event_mask); /*!< tell X11 what events we want */ /* make it so the user can't close the window until the program does */ @@ -6553,71 +6690,71 @@ RGFW_key RGFW_FUNC(RGFW_physicalToMappedKey) (RGFW_key key) { } switch (sym) { - case XK_F1: return RGFW_F1; - case XK_F2: return RGFW_F2; - case XK_F3: return RGFW_F3; - case XK_F4: return RGFW_F4; - case XK_F5: return RGFW_F5; - case XK_F6: return RGFW_F6; - case XK_F7: return RGFW_F7; - case XK_F8: return RGFW_F8; - case XK_F9: return RGFW_F9; - case XK_F10: return RGFW_F10; - case XK_F11: return RGFW_F11; - case XK_F12: return RGFW_F12; - case XK_F13: return RGFW_F13; - case XK_F14: return RGFW_F14; - case XK_F15: return RGFW_F15; - case XK_F16: return RGFW_F16; - case XK_F17: return RGFW_F17; - case XK_F18: return RGFW_F18; - case XK_F19: return RGFW_F19; - case XK_F20: return RGFW_F20; - case XK_F21: return RGFW_F21; - case XK_F22: return RGFW_F22; - case XK_F23: return RGFW_F23; - case XK_F24: return RGFW_F24; - case XK_F25: return RGFW_F25; - case XK_Shift_L: return RGFW_shiftL; - case XK_Shift_R: return RGFW_shiftR; - case XK_Control_L: return RGFW_controlL; - case XK_Control_R: return RGFW_controlR; - case XK_Alt_L: return RGFW_altL; - case XK_Alt_R: return RGFW_altR; - case XK_Super_L: return RGFW_superL; - case XK_Super_R: return RGFW_superR; - case XK_Caps_Lock: return RGFW_capsLock; - case XK_Num_Lock: return RGFW_numLock; - case XK_Scroll_Lock:return RGFW_scrollLock; - case XK_Up: return RGFW_up; - case XK_Down: return RGFW_down; - case XK_Left: return RGFW_left; - case XK_Right: return RGFW_right; - case XK_Home: return RGFW_home; - case XK_End: return RGFW_end; - case XK_Page_Up: return RGFW_pageUp; - case XK_Page_Down: return RGFW_pageDown; - case XK_Insert: return RGFW_insert; - case XK_Menu: return RGFW_menu; - case XK_KP_Add: return RGFW_kpPlus; - case XK_KP_Subtract: return RGFW_kpMinus; - case XK_KP_Multiply: return RGFW_kpMultiply; - case XK_KP_Divide: return RGFW_kpSlash; - case XK_KP_Equal: return RGFW_kpEqual; - case XK_KP_Enter: return RGFW_kpReturn; - case XK_KP_Decimal: return RGFW_kpPeriod; - case XK_KP_0: return RGFW_kp0; - case XK_KP_1: return RGFW_kp1; - case XK_KP_2: return RGFW_kp2; - case XK_KP_3: return RGFW_kp3; - case XK_KP_4: return RGFW_kp4; - case XK_KP_5: return RGFW_kp5; - case XK_KP_6: return RGFW_kp6; - case XK_KP_7: return RGFW_kp7; - case XK_KP_8: return RGFW_kp8; - case XK_KP_9: return RGFW_kp9; - case XK_Print: return RGFW_printScreen; - case XK_Pause: return RGFW_pause; + case XK_F1: return RGFW_keyF1; + case XK_F2: return RGFW_keyF2; + case XK_F3: return RGFW_keyF3; + case XK_F4: return RGFW_keyF4; + case XK_F5: return RGFW_keyF5; + case XK_F6: return RGFW_keyF6; + case XK_F7: return RGFW_keyF7; + case XK_F8: return RGFW_keyF8; + case XK_F9: return RGFW_keyF9; + case XK_F10: return RGFW_keyF10; + case XK_F11: return RGFW_keyF11; + case XK_F12: return RGFW_keyF12; + case XK_F13: return RGFW_keyF13; + case XK_F14: return RGFW_keyF14; + case XK_F15: return RGFW_keyF15; + case XK_F16: return RGFW_keyF16; + case XK_F17: return RGFW_keyF17; + case XK_F18: return RGFW_keyF18; + case XK_F19: return RGFW_keyF19; + case XK_F20: return RGFW_keyF20; + case XK_F21: return RGFW_keyF21; + case XK_F22: return RGFW_keyF22; + case XK_F23: return RGFW_keyF23; + case XK_F24: return RGFW_keyF24; + case XK_F25: return RGFW_keyF25; + case XK_Shift_L: return RGFW_keyShiftL; + case XK_Shift_R: return RGFW_keyShiftR; + case XK_Control_L: return RGFW_keyControlL; + case XK_Control_R: return RGFW_keyControlR; + case XK_Alt_L: return RGFW_keyAltL; + case XK_Alt_R: return RGFW_keyAltR; + case XK_Super_L: return RGFW_keySuperL; + case XK_Super_R: return RGFW_keySuperR; + case XK_Caps_Lock: return RGFW_keyCapsLock; + case XK_Num_Lock: return RGFW_keyNumLock; + case XK_Scroll_Lock:return RGFW_keyScrollLock; + case XK_Up: return RGFW_keyUp; + case XK_Down: return RGFW_keyDown; + case XK_Left: return RGFW_keyLeft; + case XK_Right: return RGFW_keyRight; + case XK_Home: return RGFW_keyHome; + case XK_End: return RGFW_keyEnd; + case XK_Page_Up: return RGFW_keyPageUp; + case XK_Page_Down: return RGFW_keyPageDown; + case XK_Insert: return RGFW_keyInsert; + case XK_Menu: return RGFW_keyMenu; + case XK_KP_Add: return RGFW_keyPadPlus; + case XK_KP_Subtract: return RGFW_keyPadMinus; + case XK_KP_Multiply: return RGFW_keyPadMultiply; + case XK_KP_Divide: return RGFW_keyPadSlash; + case XK_KP_Equal: return RGFW_keyPadEqual; + case XK_KP_Enter: return RGFW_keyPadReturn; + case XK_KP_Decimal: return RGFW_keyPadPeriod; + case XK_KP_0: return RGFW_keyPad0; + case XK_KP_1: return RGFW_keyPad1; + case XK_KP_2: return RGFW_keyPad2; + case XK_KP_3: return RGFW_keyPad3; + case XK_KP_4: return RGFW_keyPad4; + case XK_KP_5: return RGFW_keyPad5; + case XK_KP_6: return RGFW_keyPad6; + case XK_KP_7: return RGFW_keyPad7; + case XK_KP_8: return RGFW_keyPad8; + case XK_KP_9: return RGFW_keyPad9; + case XK_Print: return RGFW_keyPrintScreen; + case XK_Pause: return RGFW_keyPause; default: break; } @@ -6640,15 +6777,9 @@ void RGFW_XHandleEvent(void) { RGFW_LOAD_ATOM(WM_STATE); RGFW_LOAD_ATOM(_NET_WM_STATE); - /* xdnd data */ - static Window source = 0; - static long version = 0; - static i32 format = 0; - static float deltaX = 0.0f; static float deltaY = 0.0f; - XEvent reply = { ClientMessage }; XEvent E; XNextEvent(_RGFW->display, &E); @@ -6658,12 +6789,10 @@ void RGFW_XHandleEvent(void) { deltaY = 0.0f; } -#ifndef RGFW_NO_XRANDR if (E.type == _RGFW->xrandrEventBase + RRNotify) { RGFW_pollMonitors(); return; } -#endif switch (E.type) { case SelectionRequest: @@ -6690,6 +6819,7 @@ void RGFW_XHandleEvent(void) { _RGFW->vectorX = (float)deltaX; _RGFW->vectorY = (float)deltaY; + RGFW_rawMotionCallback(_RGFW->root, _RGFW->vectorX, _RGFW->vectorY); } default: break; } @@ -6735,7 +6865,7 @@ void RGFW_XHandleEvent(void) { XkbStateRec state; XkbGetState(_RGFW->display, XkbUseCoreKbd, &state); - RGFW_updateKeyMods(win, (state.locked_mods & LockMask), (state.locked_mods & Mod2Mask), (state.locked_mods & Mod3Mask)); + RGFW_keyUpdateKeyMods(win, (state.locked_mods & LockMask), (state.locked_mods & Mod2Mask), (state.locked_mods & Mod3Mask)); if (win->src.ic && XFilterEvent(&E, None) == False) { char buffer[100]; @@ -6784,9 +6914,9 @@ void RGFW_XHandleEvent(void) { XkbStateRec state; XkbGetState(_RGFW->display, XkbUseCoreKbd, &state); - RGFW_updateKeyMods(win, (state.locked_mods & LockMask), (state.locked_mods & Mod2Mask), (state.locked_mods & Mod3Mask)); + RGFW_keyUpdateKeyMods(win, (state.locked_mods & LockMask), (state.locked_mods & Mod2Mask), (state.locked_mods & Mod3Mask)); - RGFW_keyCallback(win, value, win->internal.mod, keyRepeat, RGFW_FALSE); + RGFW_keyCallback(win, value, win->internal.mod, RGFW_FALSE, RGFW_FALSE); break; } case ButtonPress: { @@ -6837,11 +6967,11 @@ void RGFW_XHandleEvent(void) { break; } case MotionNotify: - RGFW_mousePosCallback(win, E.xmotion.x, E.xmotion.y, _RGFW->vectorX, _RGFW->vectorY); + RGFW_mouseMotionCallback(win, E.xmotion.x, E.xmotion.y); break; case Expose: { - RGFW_windowRefreshCallback(win); + RGFW_windowRefreshCallback(win, E.xexpose.x, E.xexpose.y, E.xexpose.width, E.xexpose.height); #ifdef RGFW_ADVANCED_SMOOTH_RESIZE XSyncValue value; @@ -6873,12 +7003,12 @@ void RGFW_XHandleEvent(void) { RGFW_LOAD_ATOM(WM_DELETE_WINDOW); /* if the client closed the window */ if (E.xclient.data.l[0] == (long)WM_DELETE_WINDOW) { - RGFW_windowQuitCallback(win); + RGFW_windowCloseCallback(win); break; } #ifdef RGFW_ADVANCED_SMOOTH_RESIZE if (E.xclient.message_type == WM_PROTOCOLS && (Atom)E.xclient.data.l[0] == _NET_WM_SYNC_REQUEST) { - RGFW_windowRefreshCallback(win); + RGFW_windowRefreshCallback(win, 0, 0, win->w, win->h); win->src.counter_value = 0; win->src.counter_value |= E.xclient.data.l[2]; win->src.counter_value |= (E.xclient.data.l[3] << 32); @@ -6889,37 +7019,29 @@ void RGFW_XHandleEvent(void) { break; } #endif - if ((win->internal.flags & RGFW_windowAllowDND) == 0) + if ((win->internal.flags & RGFW_windowAllowDND) == 0 || _RGFW->x11Version > RGFW_XDND_VERSION) { return; + } i32 dragX = 0; i32 dragY = 0; - reply.xclient.window = source; - reply.xclient.format = 32; - reply.xclient.data.l[0] = (long)win->src.window; - reply.xclient.data.l[1] = 0; - reply.xclient.data.l[2] = None; - if (E.xclient.message_type == XdndEnter) { - if (version > 5) - break; - unsigned long count; Atom* formats; - Atom real_formats[6]; + Atom real_formats[3]; Bool list = E.xclient.data.l[1] & 1; - source = (unsigned long int)E.xclient.data.l[0]; - version = E.xclient.data.l[1] >> 24; - format = None; + _RGFW->x11Source = (Window)E.xclient.data.l[0]; + _RGFW->x11Version = E.xclient.data.l[1] >> 24; + _RGFW->x11Format = None; if (list) { Atom actualType; i32 actualFormat; unsigned long bytesAfter; XGetWindowProperty( - _RGFW->display, source, XdndTypeList, + _RGFW->display, _RGFW->x11Source, XdndTypeList, 0, LONG_MAX, False, 4, &actualType, &actualFormat, &count, &bytesAfter, (u8**)&formats ); @@ -6927,7 +7049,7 @@ void RGFW_XHandleEvent(void) { count = 0; size_t i; - for (i = 2; i < 5; i++) { + for (i = 2; i < (2 + 3); i++) { if (E.xclient.data.l[i] != None) { real_formats[count] = (unsigned long int)E.xclient.data.l[i]; count += 1; @@ -6942,28 +7064,26 @@ void RGFW_XHandleEvent(void) { size_t i; for (i = 0; i < count; i++) { - if (formats[i] == XtextUriList || formats[i] == XtextPlain) { - format = (int)formats[i]; - break; - } + if (formats[i] == XtextUriList) _RGFW->x11TransferType = RGFW_dataFile; + else if (formats[i] == XtextPlain) _RGFW->x11TransferType = RGFW_dataText; + else continue; + + _RGFW->x11Format = (int)formats[i]; + break; } - if (list) { + if (list && formats) { XFree(formats); } - break; - } - if (E.xclient.message_type == XdndPosition) { + RGFW_dataDragCallback(win, _RGFW->x11TransferType , RGFW_dndActionEnter, dragX, dragY); + } else if (E.xclient.message_type == XdndPosition) { const i32 xabs = (E.xclient.data.l[2] >> 16) & 0xffff; const i32 yabs = (E.xclient.data.l[2]) & 0xffff; Window dummy; i32 xpos, ypos; - if (version > 5) - break; - XTranslateCoordinates( _RGFW->display, XDefaultRootWindow(_RGFW->display), win->src.window, xabs, yabs, &xpos, &ypos, &dummy @@ -6972,42 +7092,50 @@ void RGFW_XHandleEvent(void) { dragX = xpos; dragY = ypos; - reply.xclient.window = source; - reply.xclient.message_type = XdndStatus; + RGFW_mouseMotionCallback(win, xpos, ypos); + XEvent reply = { ClientMessage }; + reply.xclient.window = _RGFW->x11Source; + reply.xclient.message_type = XdndStatus; + reply.xclient.format = 32; + reply.xclient.data.l[0] = (long)win->src.window; + reply.xclient.data.l[2] = 0; + reply.xclient.data.l[3] = 0; - if (format) { + if (_RGFW->x11Format) { reply.xclient.data.l[1] = 1; - if (version >= 2) + if (_RGFW->x11Version >= 2) reply.xclient.data.l[4] = (long)XdndActionCopy; } - XSendEvent(_RGFW->display, source, False, NoEventMask, &reply); + XSendEvent(_RGFW->display, _RGFW->x11Source, False, NoEventMask, &reply); XFlush(_RGFW->display); - break; + + + RGFW_dataDragCallback(win, _RGFW->x11TransferType, RGFW_dndActionMove, dragX, dragY); + } else if (E.xclient.message_type == XdndLeave) { + RGFW_dataDragCallback(win, _RGFW->x11TransferType, RGFW_dndActionExit, dragX, dragY); + } else if (E.xclient.message_type == XdndDrop) { + if (_RGFW->x11Format) { + Time time = (_RGFW->x11Version >= 1) + ? (Time)E.xclient.data.l[2] + : CurrentTime; + XConvertSelection( + _RGFW->display, XdndSelection, (Atom)_RGFW->x11Format, + XdndSelection, win->src.window, time + ); + } else if (_RGFW->x11Version >= 2) { + XEvent reply = { ClientMessage }; + reply.xclient.window = _RGFW->x11Source; + reply.xclient.message_type = XdndFinished; + reply.xclient.format = 32; + reply.xclient.data.l[0] = (long)win->src.window; + reply.xclient.data.l[1] = 0; + reply.xclient.data.l[2] = None; + + XSendEvent(_RGFW->display, _RGFW->x11Source, False, NoEventMask, &reply); + XFlush(_RGFW->display); + } } - if (E.xclient.message_type != XdndDrop) - break; - - if (version > 5) - break; - - if (format) { - Time time = (version >= 1) - ? (Time)E.xclient.data.l[2] - : CurrentTime; - - XConvertSelection( - _RGFW->display, XdndSelection, (Atom)format, - XdndSelection, win->src.window, time - ); - } else if (version >= 2) { - XEvent new_reply = { ClientMessage }; - - XSendEvent(_RGFW->display, source, False, NoEventMask, &new_reply); - XFlush(_RGFW->display); - } - - RGFW_dataDragCallback(win, dragX, dragY); } break; case SelectionNotify: { /* this is only for checking for xdnd drops */ @@ -7022,96 +7150,33 @@ void RGFW_XHandleEvent(void) { XGetWindowProperty(_RGFW->display, E.xselection.requestor, E.xselection.property, 0, LONG_MAX, False, E.xselection.target, &actualType, &actualFormat, &result, &bytesAfter, (u8**) &data); - if (result == 0) - break; + if (result != 0) { + RGFW_unix_parseURI(win, data); - const char* prefix = (const char*)"file://"; - - char* line; - - size_t count = 0; - char** files = _RGFW->files; - - while ((line = (char*)RGFW_strtok(data, "\r\n"))) { - data = NULL; - - if (line[0] == '#') - continue; - - char* l; - for (l = line; 1; l++) { - if ((l - line) > 7) - break; - else if (*l != prefix[(l - line)]) - break; - else if (*l == '\0' && prefix[(l - line)] == '\0') { - line += 7; - while (*line != '/') - line++; - break; - } else if (*l == '\0') - break; - } - - count++; - - size_t len = RGFW_unix_stringlen(line); - char* path = (char*)RGFW_ALLOC(len + 1); - - size_t index = 0; - while (*line) { - if (line[0] == '%' && line[1] && line[2]) { - char digits[3] = {0}; - digits[0] = line[1]; - digits[1] = line[2]; - digits[2] = '\0'; - path[index] = (char) RGFW_STRTOL(digits, NULL, 16); - line += 2; - } else { - if (index >= len) { - break; - } - - path[index] = *line; - } - - index++; - line++; - } - - path[len] = '\0'; - size_t cnt = RGFW_MIN(len + 1, RGFW_MAX_PATH); - if (cnt == RGFW_MAX_PATH) { - path[cnt] = '\0'; - } - - RGFW_MEMCPY(files[count - 1], path, cnt); - RGFW_FREE(path); + if (data) + XFree(data); } - RGFW_dataDropCallback(win, files, count); - if (data) - XFree(data); - - if (version >= 2) { - XEvent new_reply = { ClientMessage }; - new_reply.xclient.window = source; - new_reply.xclient.message_type = XdndFinished; - new_reply.xclient.format = 32; - new_reply.xclient.data.l[1] = (long int)result; - new_reply.xclient.data.l[2] = (long int)XdndActionCopy; - XSendEvent(_RGFW->display, source, False, NoEventMask, &new_reply); + if (_RGFW->x11Version >= 2) { + XEvent reply = { ClientMessage }; + reply.xclient.window = _RGFW->x11Source; + reply.xclient.message_type = XdndFinished; + reply.xclient.format = 32; + reply.xclient.data.l[0] = (long)win->src.window; + reply.xclient.data.l[1] = (long int)result; + reply.xclient.data.l[2] = (long int)XdndActionCopy; + XSendEvent(_RGFW->display, _RGFW->x11Source, False, NoEventMask, &reply); XFlush(_RGFW->display); } break; } case FocusIn: if (win->src.ic) XSetICFocus(win->src.ic); - RGFW_focusCallback(win, 1); + RGFW_windowFocusCallback(win, 1); break; case FocusOut: if (win->src.ic) XUnsetICFocus(win->src.ic); - RGFW_focusCallback(win, 0); + RGFW_windowFocusCallback(win, 0); break; case EnterNotify: { RGFW_mouseNotifyCallback(win, E.xcrossing.x, E.xcrossing.y, RGFW_TRUE); @@ -7162,6 +7227,16 @@ void RGFW_XHandleEvent(void) { XFlush(_RGFW->display); } +RGFW_bool RGFW_FUNC(RGFW_window_fetchSize) (RGFW_window* win, i32* w, i32* h) { + XWindowAttributes attribs; + XGetWindowAttributes(_RGFW->display, win->src.window, &attribs); + + win->w = attribs.width; + win->h = attribs.height; + + return RGFW_window_getSize(win, w, h); +} + void RGFW_FUNC(RGFW_pollEvents) (void) { RGFW_resetPrevState(); @@ -7225,7 +7300,7 @@ void RGFW_FUNC(RGFW_window_setMinSize) (RGFW_window* win, i32 w, i32 h) { long flags; XSizeHints hints; - RGFW_MEMSET(&hints, 0, sizeof(XSizeHints)); + RGFW_MEMZERO(&hints, sizeof(XSizeHints)); XGetWMNormalHints(_RGFW->display, win->src.window, &hints, &flags); @@ -7243,7 +7318,7 @@ void RGFW_FUNC(RGFW_window_setMaxSize) (RGFW_window* win, i32 w, i32 h) { long flags; XSizeHints hints; - RGFW_MEMSET(&hints, 0, sizeof(XSizeHints)); + RGFW_MEMZERO(&hints, sizeof(XSizeHints)); XGetWMNormalHints(_RGFW->display, win->src.window, &hints, &flags); @@ -7284,6 +7359,7 @@ void RGFW_FUNC(RGFW_window_maximize) (RGFW_window* win) { win->internal.oldH = win->h; RGFW_toggleXMaximized(win, 1); + RGFW_window_fetchSize(win, NULL, NULL); return; } @@ -7458,7 +7534,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_setIconEx) (RGFW_window* win, u8* data_src, i32 unsigned long* data = (unsigned long*) RGFW_ALLOC((u32)count * sizeof(unsigned long)); RGFW_ASSERT(data != NULL); - RGFW_MEMSET(data, 0, (u32)count * sizeof(unsigned long)); + RGFW_MEMZERO(data, (u32)count * sizeof(unsigned long)); data[0] = (unsigned long)w; data[1] = (unsigned long)h; @@ -7494,61 +7570,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_setIconEx) (RGFW_window* win, u8* data_src, i32 return RGFW_BOOL(res); } -RGFW_mouse* RGFW_FUNC(RGFW_loadMouse) (u8* data, i32 w, i32 h, RGFW_format format) { - RGFW_ASSERT(data); -#ifndef RGFW_NO_X11_CURSOR - RGFW_init(); - XcursorImage* native = XcursorImageCreate((i32)w, (i32)h); - native->xhot = 0; - native->yhot = 0; - RGFW_MEMSET(native->pixels, 0, (u32)(w * h * 4)); - RGFW_copyImageData((u8*)native->pixels, w, h, RGFW_formatBGRA8, data, format, NULL); - - Cursor cursor = XcursorImageLoadCursor(_RGFW->display, native); - XcursorImageDestroy(native); - - return (void*)cursor; -#else - RGFW_UNUSED(data); RGFW_UNUSED(w); RGFW_UNUSED(h); RGFW_UNUSED(format); - return NULL; -#endif -} - -void RGFW_FUNC(RGFW_window_setMouse)(RGFW_window* win, RGFW_mouse* mouse) { - RGFW_ASSERT(win && mouse); - XDefineCursor(_RGFW->display, win->src.window, (Cursor)mouse); -} - -void RGFW_FUNC(RGFW_freeMouse)(RGFW_mouse* mouse) { - RGFW_ASSERT(mouse); - XFreeCursor(_RGFW->display, (Cursor)mouse); -} - -void RGFW_FUNC(RGFW_window_moveMouse)(RGFW_window* win, i32 x, i32 y) { - RGFW_ASSERT(win != NULL); - - XEvent event; - XQueryPointer(_RGFW->display, DefaultRootWindow(_RGFW->display), - &event.xbutton.root, &event.xbutton.window, - &event.xbutton.x_root, &event.xbutton.y_root, - &event.xbutton.x, &event.xbutton.y, - &event.xbutton.state); - - win->internal.lastMouseX = x - win->x; - win->internal.lastMouseY = y - win->y; - if (event.xbutton.x == x && event.xbutton.y == y) - return; - - XWarpPointer(_RGFW->display, None, win->src.window, 0, 0, 0, 0, (int) x - win->x, (int) y - win->y); -} - -RGFW_bool RGFW_FUNC(RGFW_window_setMouseDefault) (RGFW_window* win) { - return RGFW_window_setMouseStandard(win, RGFW_mouseArrow); -} - -RGFW_bool RGFW_FUNC(RGFW_window_setMouseStandard) (RGFW_window* win, u8 mouse) { - RGFW_ASSERT(win != NULL); - +RGFW_mouse* RGFW_FUNC(RGFW_createMouseStandard) (RGFW_mouseIcon mouse) { u32 mouseIcon = 0; switch (mouse) { @@ -7573,15 +7595,62 @@ RGFW_bool RGFW_FUNC(RGFW_window_setMouseStandard) (RGFW_window* win, u8 mouse) { case RGFW_mouseResizeAll: mouseIcon = XC_fleur; break; case RGFW_mouseNotAllowed: mouseIcon = XC_pirate; break; case RGFW_mousePointingHand: mouseIcon = XC_hand2; break; - default: return RGFW_FALSE; + default: return NULL; } Cursor cursor = XCreateFontCursor(_RGFW->display, mouseIcon); - XDefineCursor(_RGFW->display, win->src.window, (Cursor) cursor); - XFreeCursor(_RGFW->display, (Cursor) cursor); + return (RGFW_mouse*)cursor; +} + +RGFW_mouse* RGFW_FUNC(RGFW_createMouse) (u8* data, i32 w, i32 h, RGFW_format format) { + RGFW_ASSERT(data); +#ifndef RGFW_NO_X11_CURSOR + RGFW_init(); + XcursorImage* native = XcursorImageCreate((i32)w, (i32)h); + native->xhot = 0; + native->yhot = 0; + RGFW_MEMZERO(native->pixels, (u32)(w * h * 4)); + RGFW_copyImageData((u8*)native->pixels, w, h, RGFW_formatBGRA8, data, format, NULL); + + Cursor cursor = XcursorImageLoadCursor(_RGFW->display, native); + XcursorImageDestroy(native); + + return (void*)cursor; +#else + RGFW_UNUSED(data); RGFW_UNUSED(w); RGFW_UNUSED(h); RGFW_UNUSED(format); + return NULL; +#endif +} + +RGFW_bool RGFW_FUNC(RGFW_window_setMousePlatform)(RGFW_window* win, RGFW_mouse* mouse) { + RGFW_ASSERT(win && mouse); + XDefineCursor(_RGFW->display, win->src.window, (Cursor)mouse); return RGFW_TRUE; } +void RGFW_FUNC(RGFW_freeMouse)(RGFW_mouse* mouse) { + RGFW_ASSERT(mouse); + XFreeCursor(_RGFW->display, (Cursor)mouse); +} + +void RGFW_FUNC(RGFW_window_moveMouse)(RGFW_window* win, i32 x, i32 y) { + RGFW_ASSERT(win != NULL); + + XEvent event; + XQueryPointer(_RGFW->display, DefaultRootWindow(_RGFW->display), + &event.xbutton.root, &event.xbutton.window, + &event.xbutton.x_root, &event.xbutton.y_root, + &event.xbutton.x, &event.xbutton.y, + &event.xbutton.state); + + win->internal.lastMouseX = x - win->x; + win->internal.lastMouseY = y - win->y; + if (event.xbutton.x == x && event.xbutton.y == y) + return; + + XWarpPointer(_RGFW->display, None, win->src.window, 0, 0, 0, 0, (int) x - win->x, (int) y - win->y); +} + void RGFW_FUNC(RGFW_window_hide)(RGFW_window* win) { win->internal.flags |= (u32)RGFW_windowHide; XUnmapWindow(_RGFW->display, win->src.window); @@ -7707,7 +7776,7 @@ void RGFW_FUNC(RGFW_writeClipboard)(const char* text, u32 textLen) { /* request ownership of the clipboard section and request to convert it, this means its our job to convert it */ XSetSelectionOwner(_RGFW->display, CLIPBOARD, _RGFW->helperWindow, CurrentTime); if (XGetSelectionOwner(_RGFW->display, CLIPBOARD) != _RGFW->helperWindow) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errClipboard, "X11 failed to become owner of clipboard selection"); + RGFW_debugCallback(RGFW_typeError, RGFW_errClipboard, "X11 failed to become owner of clipboard selection"); return; } @@ -7799,20 +7868,18 @@ void RGFW_XGetSystemContentDPI(float* dpi) { if (dpi == NULL) return; float dpiOutput = 96.0f; - #ifndef RGFW_NO_XRANDR - char* rms = XResourceManagerString(_RGFW->display); - if (rms == NULL) return; + char* rms = XResourceManagerString(_RGFW->display); + if (rms == NULL) return; - XrmDatabase db = XrmGetStringDatabase(rms); - if (db == NULL) return; + XrmDatabase db = XrmGetStringDatabase(rms); + if (db == NULL) return; - XrmValue value; - char* type = NULL; + XrmValue value; + char* type = NULL; - if (XrmGetResource(db, "Xft.dpi", "Xft.Dpi", &type, &value) && type && RGFW_STRNCMP(type, "String", 7) == 0) - dpiOutput = (float)RGFW_ATOF(value.addr); - XrmDestroyDatabase(db); - #endif + if (XrmGetResource(db, "Xft.dpi", "Xft.Dpi", &type, &value) && type && RGFW_STRNCMP(type, "String", 7) == 0) + dpiOutput = (float)RGFW_ATOF(value.addr); + XrmDestroyDatabase(db); if (dpi) *dpi = dpiOutput; } @@ -7905,7 +7972,9 @@ void RGFW_FUNC(RGFW_pollMonitors) (void) { RGFW_monitor monitor; XRROutputInfo* info = XRRGetOutputInfo(_RGFW->display, res, res->outputs[i]); - if (info == NULL || info->connection != RR_Connected || info->crtc == None) { + if (info == NULL) continue; + if (info->connection != RR_Connected || info->crtc == None) { + XRRFreeOutputInfo(info); continue; } @@ -8055,7 +8124,6 @@ size_t RGFW_FUNC(RGFW_monitor_getModesPtr) (RGFW_monitor* monitor, RGFW_monitorM size_t RGFW_FUNC(RGFW_monitor_getGammaRampPtr) (RGFW_monitor* monitor, RGFW_gammaRamp* ramp) { RGFW_UNUSED(monitor); RGFW_UNUSED(ramp); -#ifndef RGFW_NO_XRANDR size_t size = (size_t)XRRGetCrtcGammaSize(_RGFW->display, monitor->node->crtc); XRRCrtcGamma* gamma = XRRGetCrtcGamma(_RGFW->display, monitor->node->crtc); @@ -8067,18 +8135,14 @@ size_t RGFW_FUNC(RGFW_monitor_getGammaRampPtr) (RGFW_monitor* monitor, RGFW_gamm XRRFreeGamma(gamma); return size; -#endif - - return 0; } RGFW_bool RGFW_FUNC(RGFW_monitor_setGammaRamp) (RGFW_monitor* monitor, RGFW_gammaRamp* ramp) { RGFW_UNUSED(monitor); RGFW_UNUSED(ramp); -#ifndef RGFW_NO_XRANDR size_t size = (size_t)XRRGetCrtcGammaSize(_RGFW->display, monitor->node->crtc); if (size != ramp->count) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errX11, "X11: Gamma ramp size must match current ramp size"); + RGFW_debugCallback(RGFW_typeError, RGFW_errX11, "X11: Gamma ramp size must match current ramp size"); return RGFW_FALSE; } @@ -8092,8 +8156,6 @@ RGFW_bool RGFW_FUNC(RGFW_monitor_setGammaRamp) (RGFW_monitor* monitor, RGFW_gamm XRRFreeGamma(gamma); return RGFW_TRUE; -#endif - return RGFW_FALSE; } RGFW_bool RGFW_FUNC(RGFW_monitor_setMode)(RGFW_monitor* mon, RGFW_monitorMode* mode) { @@ -8112,7 +8174,6 @@ RGFW_bool RGFW_FUNC(RGFW_monitor_setMode)(RGFW_monitor* mon, RGFW_monitorMode* m } RGFW_bool RGFW_FUNC(RGFW_monitor_requestMode)(RGFW_monitor* mon, RGFW_monitorMode* mode, RGFW_modeRequest request) { - #ifndef RGFW_NO_XRANDR RGFW_init(); RGFW_bool output = RGFW_FALSE; @@ -8149,8 +8210,6 @@ RGFW_bool RGFW_FUNC(RGFW_monitor_requestMode)(RGFW_monitor* mon, RGFW_monitorMod XRRFreeCrtcInfo(ci); XRRFreeScreenResources(res); return output; -#endif - return RGFW_FALSE; } RGFW_monitor* RGFW_FUNC(RGFW_window_getMonitor) (RGFW_window* win) { @@ -8235,7 +8294,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_createContextPtr_OpenGL) (RGFW_window* win, RGFW i32 best_samples = 0; if (fbcount == 0) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to find any valid GLX visual configs."); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to find any valid GLX visual configs."); return 0; } @@ -8264,7 +8323,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_createContextPtr_OpenGL) (RGFW_window* win, RGFW } if (best_fbc == -1) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to get a valid GLX visual."); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to get a valid GLX visual."); return 0; } @@ -8272,10 +8331,10 @@ RGFW_bool RGFW_FUNC(RGFW_window_createContextPtr_OpenGL) (RGFW_window* win, RGFW bestFbc = fbc[best_fbc]; XVisualInfo* vi = glXGetVisualFromFBConfig(_RGFW->display, bestFbc); if (vi->depth != 32 && transparent) - RGFW_sendDebugInfo(RGFW_typeWarning, RGFW_warningOpenGL, "Failed to to find a matching visual with a 32-bit depth."); + RGFW_debugCallback(RGFW_typeWarning, RGFW_warningOpenGL, "Failed to to find a matching visual with a 32-bit depth."); if (best_samples < hints->samples) - RGFW_sendDebugInfo(RGFW_typeWarning, RGFW_warningOpenGL, "Failed to load a matching sample count."); + RGFW_debugCallback(RGFW_typeWarning, RGFW_warningOpenGL, "Failed to load a matching sample count."); XFree(fbc); visual = *vi; @@ -8341,13 +8400,13 @@ RGFW_bool RGFW_FUNC(RGFW_window_createContextPtr_OpenGL) (RGFW_window* win, RGFW } if (glXCreateContextAttribsARB == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load proc address 'glXCreateContextAttribsARB', loading a generic OpenGL context."); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load proc address 'glXCreateContextAttribsARB', loading a generic OpenGL context."); win->src.ctx.native->ctx = glXCreateContext(_RGFW->display, &visual, ctx, True); } else { _RGFW->x11Error = NULL; win->src.ctx.native->ctx = glXCreateContextAttribsARB(_RGFW->display, bestFbc, ctx, True, context_attribs); if (_RGFW->x11Error || win->src.ctx.native->ctx == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create an OpenGL context with AttribsARB, loading a generic OpenGL context."); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create an OpenGL context with AttribsARB, loading a generic OpenGL context."); win->src.ctx.native->ctx = glXCreateContext(_RGFW->display, &visual, ctx, True); } } @@ -8359,7 +8418,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_createContextPtr_OpenGL) (RGFW_window* win, RGFW #endif glXMakeCurrent(_RGFW->display, (Drawable)win->src.ctx.native->window, (GLXContext)win->src.ctx.native->ctx); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); RGFW_window_swapInterval_OpenGL(win, 0); @@ -8375,7 +8434,7 @@ void RGFW_FUNC(RGFW_window_deleteContextPtr_OpenGL) (RGFW_window* win, RGFW_glCo glXDestroyContext(_RGFW->display, ctx->ctx); win->src.ctx.native = NULL; - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); } RGFW_bool RGFW_FUNC(RGFW_extensionSupportedPlatform_OpenGL)(const char * extension, size_t len) { @@ -8415,9 +8474,9 @@ void RGFW_FUNC(RGFW_window_swapInterval_OpenGL) (RGFW_window* win, i32 swapInter } if (pfn2 != NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load swap interval function, fallingback to the native swapinterval function"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load swap interval function, fallingback to the native swapinterval function"); } else { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load swap interval function"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load swap interval function"); } } } @@ -8480,13 +8539,14 @@ i32 RGFW_initPlatform_X11(void) { _RGFW->context = XUniqueContext(); XSetWindowAttributes wa; - RGFW_MEMSET(&wa, 0, sizeof(wa)); + RGFW_MEMZERO(&wa, sizeof(wa)); wa.event_mask = PropertyChangeMask; _RGFW->helperWindow = XCreateWindow(_RGFW->display, XDefaultRootWindow(_RGFW->display), 0, 0, 1, 1, 0, 0, InputOnly, DefaultVisual(_RGFW->display, DefaultScreen(_RGFW->display)), CWEventMask, &wa); u8 RGFW_blk[] = { 0, 0, 0, 0 }; - _RGFW->hiddenMouse = RGFW_loadMouse(RGFW_blk, 1, 1, RGFW_formatRGBA8); + _RGFW->hiddenMouse = RGFW_createMouse(RGFW_blk, 1, 1, RGFW_formatRGBA8); + _RGFW->clipboard = NULL; XkbComponentNamesRec rec; @@ -8497,7 +8557,7 @@ i32 RGFW_initPlatform_X11(void) { XkbGetNames(_RGFW->display, XkbKeyNamesMask, desc); - RGFW_MEMSET(&rec, 0, sizeof(rec)); + RGFW_MEMZERO(&rec, sizeof(rec)); char evdev[] = "evdev"; rec.keycodes = evdev; evdesc = XkbGetKeyboardByName(_RGFW->display, XkbUseCoreKbd, &rec, XkbGBN_KeyNamesMask, XkbGBN_KeyNamesMask, False); @@ -8523,23 +8583,10 @@ i32 RGFW_initPlatform_X11(void) { XSetLocaleModifiers(""); XRegisterIMInstantiateCallback(_RGFW->display, NULL, NULL, NULL, RGFW_x11_imInitCallback, NULL); - unsigned char mask[XIMaskLen(XI_RawMotion)]; - RGFW_MEMSET(mask, 0, sizeof(mask)); - XISetMask(mask, XI_RawMotion); - - XIEventMask em; - em.deviceid = XIAllMasterDevices; - em.mask_len = sizeof(mask); - em.mask = mask; - - XISelectEvents(_RGFW->display, XDefaultRootWindow(_RGFW->display), &em, 1); - -#ifndef RGFW_NO_XRANDR i32 errorBase; if (XRRQueryExtension(_RGFW->display, &_RGFW->xrandrEventBase, &errorBase)) { XRRSelectInput(_RGFW->display, RootWindow(_RGFW->display, DefaultScreen(_RGFW->display)), RROutputChangeNotifyMask); } -#endif return 0; } @@ -8667,13 +8714,13 @@ struct wl_surface* RGFW_window_getWindow_Wayland(RGFW_window* win) { return win- /* wayland global garbage (wayland bad, X11 is fine (ish) (not really)) */ -#include "xdg-shell-client-protocol.h" -#include "xdg-toplevel-icon-v1-client-protocol.h" -#include "xdg-decoration-unstable-v1-client-protocol.h" -#include "relative-pointer-unstable-v1-client-protocol.h" -#include "pointer-constraints-unstable-v1-client-protocol.h" -#include "xdg-output-unstable-v1-client-protocol.h" -#include "pointer-warp-v1-client-protocol.h" +#include "xdg-shell.h" +#include "xdg-toplevel-icon-v1.h" +#include "xdg-decoration-unstable-v1.h" +#include "relative-pointer-unstable-v1.h" +#include "pointer-constraints-unstable-v1.h" +#include "xdg-output-unstable-v1.h" +#include "pointer-warp-v1.h" void RGFW_toggleWaylandMaximized(RGFW_window* win, RGFW_bool maximized); @@ -8770,7 +8817,7 @@ static void RGFW_wl_xdg_toplevel_close_handler(void* data, struct xdg_toplevel * RGFW_window* win = (RGFW_window*)data; if (!win->internal.shouldClose) { - RGFW_windowQuitCallback(win); + RGFW_windowCloseCallback(win); } } @@ -8804,7 +8851,7 @@ static void RGFW_wl_relative_pointer_motion(void *data, struct zwp_relative_poin float vecX = (float)wl_fixed_to_double(dx); float vecY = (float)wl_fixed_to_double(dy); - RGFW_mousePosCallback(win, win->internal.lastMouseX, win->internal.lastMouseY, vecX, vecY); + RGFW_rawMotionCallback(win, vecX, vecY); } static void RGFW_wl_pointer_locked(void *data, struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1) { @@ -8850,7 +8897,6 @@ static void RGFW_wl_pointer_leave(void* data, struct wl_pointer *pointer, u32 se static void RGFW_wl_pointer_motion(void* data, struct wl_pointer *pointer, u32 time, wl_fixed_t x, wl_fixed_t y) { RGFW_UNUSED(pointer); RGFW_UNUSED(time); - RGFW_info* RGFW = (RGFW_info*)data; RGFW_ASSERT(RGFW->mouseOwner != NULL); @@ -8858,10 +8904,8 @@ static void RGFW_wl_pointer_motion(void* data, struct wl_pointer *pointer, u32 t i32 convertedX = (i32)wl_fixed_to_double(x); i32 convertedY = (i32)wl_fixed_to_double(y); - float newVecX = (float)(convertedX - win->internal.lastMouseX); - float newVecY = (float)(convertedY - win->internal.lastMouseY); - RGFW_mousePosCallback(win, convertedX, convertedY, newVecX, newVecY); + RGFW_mouseMotionCallback(win, convertedX, convertedY); } static void RGFW_wl_pointer_button(void* data, struct wl_pointer *pointer, u32 serial, u32 time, u32 button, u32 state) { @@ -8947,7 +8991,7 @@ static void RGFW_wl_keyboard_enter(void* data, struct wl_keyboard *keyboard, u32 /* pressed this flag is not set since there is no event to listen for */ if (win->src.minimized == RGFW_TRUE) win->src.minimized = RGFW_FALSE; - RGFW_focusCallback(win, RGFW_TRUE); + RGFW_windowFocusCallback(win, RGFW_TRUE); } static void RGFW_wl_keyboard_leave(void* data, struct wl_keyboard *keyboard, u32 serial, struct wl_surface *surface) { @@ -8958,7 +9002,7 @@ static void RGFW_wl_keyboard_leave(void* data, struct wl_keyboard *keyboard, u32 if (RGFW->kbOwner == win) RGFW->kbOwner = NULL; - RGFW_focusCallback(win, RGFW_FALSE); + RGFW_windowFocusCallback(win, RGFW_FALSE); } static xkb_keysym_t RGFW_wl_composeSymbol(RGFW_info* RGFW, xkb_keysym_t sym) { @@ -8978,8 +9022,19 @@ static xkb_keysym_t RGFW_wl_composeSymbol(RGFW_info* RGFW, xkb_keysym_t sym) { } } +static void RGFW_wl_send_key_event(u32 key) { + const xkb_keysym_t* keysyms; + if (xkb_state_key_get_syms(_RGFW->xkb_state, key + 8, &keysyms) == 1) { + xkb_keysym_t keysym = RGFW_wl_composeSymbol(_RGFW, keysyms[0]); + u32 codepoint = xkb_keysym_to_utf32(keysym); + if (codepoint != 0) { + RGFW_keyCharCallback(_RGFW->kbOwner, codepoint); + } + } +} + static void RGFW_wl_keyboard_key(void* data, struct wl_keyboard *keyboard, u32 serial, u32 time, u32 key, u32 state) { - RGFW_UNUSED(keyboard); RGFW_UNUSED(serial); RGFW_UNUSED(time); + RGFW_UNUSED(keyboard); RGFW_UNUSED(serial); RGFW_info* RGFW = (RGFW_info*)data; if (RGFW->kbOwner == NULL) return; @@ -8987,17 +9042,22 @@ static void RGFW_wl_keyboard_key(void* data, struct wl_keyboard *keyboard, u32 s RGFW_window *RGFW_key_win = RGFW->kbOwner; RGFW_key RGFWkey = RGFW_apiKeyToRGFW(key + 8); - RGFW_updateKeyMods(RGFW_key_win, RGFW_BOOL(xkb_keymap_mod_get_index(RGFW->keymap, "Lock")), RGFW_BOOL(xkb_keymap_mod_get_index(RGFW->keymap, "Mod2")), RGFW_BOOL(xkb_keymap_mod_get_index(RGFW->keymap, "ScrollLock"))); - RGFW_keyCallback(RGFW_key_win, (u8)RGFWkey, RGFW_key_win->internal.mod, RGFW_window_isKeyDown(RGFW_key_win, (u8)RGFWkey), RGFW_BOOL(state)); + RGFW_keyUpdateKeyMods(RGFW_key_win, RGFW_BOOL(xkb_keymap_mod_get_index(RGFW->keymap, "Lock")), RGFW_BOOL(xkb_keymap_mod_get_index(RGFW->keymap, "Mod2")), RGFW_BOOL(xkb_keymap_mod_get_index(RGFW->keymap, "ScrollLock"))); + RGFW_keyCallback(RGFW_key_win, (u8)RGFWkey, RGFW_key_win->internal.mod, RGFW_isKeyDown((u8)RGFWkey) && RGFW_BOOL(state), RGFW_BOOL(state)); - const xkb_keysym_t* keysyms; - if (xkb_state_key_get_syms(RGFW->xkb_state, key + 8, &keysyms) == 1) { - xkb_keysym_t keysym = RGFW_wl_composeSymbol(RGFW, keysyms[0]); - u32 codepoint = xkb_keysym_to_utf32(keysym); - if (codepoint != 0) { - RGFW_keyCharCallback(RGFW_key_win, codepoint); - } - } + /* [comment by Kala Telo (@kala-telo) and edited by Riley Mabb (@ColleagueRiley)] + we send the event at the moment we receive it, and + repeated key presses will be handled by RGFW_pollEvents + if the compositor doesn't support proxy (seat?) version + of at least 4, it won't initialize wl_repeat_info_rate, + and by spec, rate of 0 means disabled, thus repeating + keys are disabled by being zero-initialized + */ + RGFW->last_key = state ? key : 0; + RGFW->last_key_time = time + (u32)_RGFW->wl_repeat_info_delay; + if (state) { + RGFW_wl_send_key_event(_RGFW->last_key); + } } static void RGFW_wl_keyboard_modifiers(void* data, struct wl_keyboard *keyboard, u32 serial, u32 mods_depressed, u32 mods_latched, u32 mods_locked, u32 group) { @@ -9006,10 +9066,17 @@ static void RGFW_wl_keyboard_modifiers(void* data, struct wl_keyboard *keyboard, xkb_state_update_mask(RGFW->xkb_state, mods_depressed, mods_latched, mods_locked, 0, 0, group); } +static void RGFW_wl_keyboard_repeat_info(void* data, struct wl_keyboard *keyboard, i32 rate, i32 delay) { + RGFW_UNUSED(data); + RGFW_UNUSED(keyboard); + _RGFW->wl_repeat_info_rate = rate; + _RGFW->wl_repeat_info_delay = delay; +} + static void RGFW_wl_seat_capabilities(void* data, struct wl_seat *seat, u32 capabilities) { RGFW_info* RGFW = (RGFW_info*)data; static struct wl_pointer_listener pointer_listener; - RGFW_MEMSET(&pointer_listener, 0, sizeof(pointer_listener)); + RGFW_MEMZERO(&pointer_listener, sizeof(pointer_listener)); pointer_listener.enter = &RGFW_wl_pointer_enter; pointer_listener.leave = &RGFW_wl_pointer_leave; pointer_listener.motion = &RGFW_wl_pointer_motion; @@ -9017,12 +9084,13 @@ static void RGFW_wl_seat_capabilities(void* data, struct wl_seat *seat, u32 capa pointer_listener.axis = &RGFW_wl_pointer_axis; static struct wl_keyboard_listener keyboard_listener; - RGFW_MEMSET(&keyboard_listener, 0, sizeof(keyboard_listener)); + RGFW_MEMZERO(&keyboard_listener, sizeof(keyboard_listener)); keyboard_listener.keymap = &RGFW_wl_keyboard_keymap; keyboard_listener.enter = &RGFW_wl_keyboard_enter; keyboard_listener.leave = &RGFW_wl_keyboard_leave; keyboard_listener.key = &RGFW_wl_keyboard_key; keyboard_listener.modifiers = &RGFW_wl_keyboard_modifiers; + keyboard_listener.repeat_info = &RGFW_wl_keyboard_repeat_info; if ((capabilities & WL_SEAT_CAPABILITY_POINTER) && !RGFW->wl_pointer) { RGFW->wl_pointer = wl_seat_get_pointer(seat); @@ -9154,7 +9222,7 @@ static void RGFW_wl_output_handle_done(void* data, struct wl_output* output) { } static void RGFW_wl_create_outputs(struct wl_registry *const registry, u32 id) { - struct wl_output *output = wl_registry_bind(registry, id, &wl_output_interface, wl_display_get_version(_RGFW->wl_display) < 4 ? 3 : 4); + struct wl_output *output = wl_registry_bind(registry, id, &wl_output_interface, wl_proxy_get_version((struct wl_proxy*)_RGFW->seat)); RGFW_monitorNode* node; RGFW_monitor mon; @@ -9162,7 +9230,7 @@ static void RGFW_wl_create_outputs(struct wl_registry *const registry, u32 id) { char RGFW_mon_default_name[10]; - RGFW_SNPRINTF(RGFW_mon_default_name, sizeof(RGFW_mon_default_name), "monitor-%li", _RGFW->monitors.count); + RGFW_SNPRINTF(RGFW_mon_default_name, sizeof(RGFW_mon_default_name), "monitor-%zu", _RGFW->monitors.count); RGFW_STRNCPY(mon.name, RGFW_mon_default_name, sizeof(mon.name) - 1); mon.name[sizeof(mon.name) - 1] = '\0'; @@ -9216,9 +9284,6 @@ static void RGFW_wl_surface_enter(void *data, struct wl_surface *wl_surface, str if (node == NULL) return; win->src.active_monitor = node; - - if (win->internal.flags & RGFW_windowScaleToMonitor) - RGFW_window_scaleToMonitor(win); } static void RGFW_wl_data_source_send(void *data, struct wl_data_source *wl_data_source, const char *mime_type, i32 fd) { @@ -9275,6 +9340,9 @@ static void RGFW_wl_data_device_selection(void *data, struct wl_data_device *wl_ ssize_t n = read(pfds[0], buf, sizeof(buf)); + if (_RGFW->clipboard) { + RGFW_FREE(_RGFW->clipboard); + } _RGFW->clipboard = (char*)RGFW_ALLOC((size_t)n); RGFW_ASSERT(_RGFW->clipboard != NULL); RGFW_STRNCPY(_RGFW->clipboard, buf, (size_t)n); @@ -9311,7 +9379,7 @@ static void RGFW_wl_global_registry_handler(void* data, struct wl_registry *regi RGFW->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(RGFW->shm, &shm_listener, RGFW); } else if (RGFW_STRNCMP(interface,"wl_seat", 8) == 0) { - RGFW->seat = wl_registry_bind(registry, id, &wl_seat_interface, 1); + RGFW->seat = wl_registry_bind(registry, id, &wl_seat_interface, version < 4 ? 3 : 4); wl_seat_add_listener(RGFW->seat, &seat_listener, RGFW); } else if (RGFW_STRNCMP(interface, zxdg_output_manager_v1_interface.name, 255) == 0) { RGFW->xdg_output_manager = wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); @@ -9408,7 +9476,7 @@ static int RGFW_wl_create_shm_file(off_t size) { i32 RGFW_initPlatform_Wayland(void) { _RGFW->wl_display = wl_display_connect(NULL); if (_RGFW->wl_display == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errWayland, "Failed to load Wayland display"); + RGFW_debugCallback(RGFW_typeError, RGFW_errWayland, "Failed to load Wayland display"); return -1; } @@ -9424,8 +9492,8 @@ i32 RGFW_initPlatform_Wayland(void) { wl_display_roundtrip(_RGFW->wl_display); /* bind to globals */ if (_RGFW->compositor == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errWayland, "Can't find compositor."); - return 1; + RGFW_debugCallback(RGFW_typeError, RGFW_errWayland, "Can't find compositor."); + return -1; } if (_RGFW->wl_cursor_theme == NULL) { @@ -9434,7 +9502,7 @@ i32 RGFW_initPlatform_Wayland(void) { } u8 RGFW_blk[] = { 0, 0, 0, 0 }; - _RGFW->hiddenMouse = RGFW_loadMouse(RGFW_blk, 1, 1, RGFW_formatRGBA8); + _RGFW->hiddenMouse = RGFW_createMouse(RGFW_blk, 1, 1, RGFW_formatRGBA8); static const struct xdg_wm_base_listener xdg_wm_base_listener = { .ping = RGFW_wl_xdg_wm_base_ping_handler, @@ -9548,12 +9616,12 @@ RGFW_bool RGFW_FUNC(RGFW_createSurfacePtr) (u8* data, i32 w, i32 h, RGFW_format surface->w = w; surface->h = h; surface->format = format; - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoBuffer, "Creating a 4 channel buffer"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoBuffer, "Creating a 4 channel buffer"); u32 size = (u32)(surface->w * surface->h * 4); int fd = RGFW_wl_create_shm_file(size); if (fd < 0) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errBuffer, "Failed to create a buffer."); + RGFW_debugCallback(RGFW_typeError, RGFW_errBuffer, "Failed to create a buffer."); return RGFW_FALSE; } @@ -9561,7 +9629,7 @@ RGFW_bool RGFW_FUNC(RGFW_createSurfacePtr) (u8* data, i32 w, i32 h, RGFW_format surface->native.buffer = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (surface->native.buffer == MAP_FAILED) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errBuffer, "mmap failed."); + RGFW_debugCallback(RGFW_typeError, RGFW_errBuffer, "mmap failed."); return RGFW_FALSE; } @@ -9581,15 +9649,16 @@ void RGFW_FUNC(RGFW_window_blitSurface) (RGFW_window* win, RGFW_surface* surface wl_surface_commit(win->src.surface); wl_buffer_destroy(surface->native.wl_buffer); + + surface->native.wl_buffer = NULL; } void RGFW_FUNC(RGFW_surface_freePtr) (RGFW_surface* surface) { RGFW_ASSERT(surface != NULL); - wl_shm_pool_destroy(surface->native.pool); - close(surface->native.fd); - - munmap(surface->native.buffer, (size_t)(surface->w * surface->h * 4)); + if (surface->native.pool) wl_shm_pool_destroy(surface->native.pool); + if (surface->native.fd) close(surface->native.fd); + if (surface->native.buffer) munmap(surface->native.buffer, (size_t)(surface->w * surface->h * 4)); } void RGFW_FUNC(RGFW_window_setBorder) (RGFW_window* win, RGFW_bool border) { @@ -9649,7 +9718,7 @@ void RGFW_FUNC(RGFW_window_captureMousePlatform) (RGFW_window* win, RGFW_bool st } RGFW_window* RGFW_FUNC(RGFW_createWindowPlatform) (const char* name, RGFW_windowFlags flags, RGFW_window* win) { - RGFW_sendDebugInfo(RGFW_typeWarning, RGFW_warningWayland, "RGFW Wayland support is experimental"); + RGFW_debugCallback(RGFW_typeWarning, RGFW_warningWayland, "RGFW Wayland support is experimental"); static const struct xdg_surface_listener xdg_surface_listener = { .configure = RGFW_wl_xdg_surface_configure_handler, @@ -9775,77 +9844,81 @@ RGFW_key RGFW_FUNC(RGFW_physicalToMappedKey)(RGFW_key key) { } switch (sym) { - case XKB_KEY_F1: return RGFW_F1; - case XKB_KEY_F2: return RGFW_F2; - case XKB_KEY_F3: return RGFW_F3; - case XKB_KEY_F4: return RGFW_F4; - case XKB_KEY_F5: return RGFW_F5; - case XKB_KEY_F6: return RGFW_F6; - case XKB_KEY_F7: return RGFW_F7; - case XKB_KEY_F8: return RGFW_F8; - case XKB_KEY_F9: return RGFW_F9; - case XKB_KEY_F10: return RGFW_F10; - case XKB_KEY_F11: return RGFW_F11; - case XKB_KEY_F12: return RGFW_F12; - case XKB_KEY_F13: return RGFW_F13; - case XKB_KEY_F14: return RGFW_F14; - case XKB_KEY_F15: return RGFW_F15; - case XKB_KEY_F16: return RGFW_F16; - case XKB_KEY_F17: return RGFW_F17; - case XKB_KEY_F18: return RGFW_F18; - case XKB_KEY_F19: return RGFW_F19; - case XKB_KEY_F20: return RGFW_F20; - case XKB_KEY_F21: return RGFW_F21; - case XKB_KEY_F22: return RGFW_F22; - case XKB_KEY_F23: return RGFW_F23; - case XKB_KEY_F24: return RGFW_F24; - case XKB_KEY_F25: return RGFW_F25; - case XKB_KEY_Shift_L: return RGFW_shiftL; - case XKB_KEY_Shift_R: return RGFW_shiftR; - case XKB_KEY_Control_L: return RGFW_controlL; - case XKB_KEY_Control_R: return RGFW_controlR; - case XKB_KEY_Alt_L: return RGFW_altL; - case XKB_KEY_Alt_R: return RGFW_altR; - case XKB_KEY_Super_L: return RGFW_superL; - case XKB_KEY_Super_R: return RGFW_superR; - case XKB_KEY_Caps_Lock: return RGFW_capsLock; - case XKB_KEY_Num_Lock: return RGFW_numLock; - case XKB_KEY_Scroll_Lock:return RGFW_scrollLock; - case XKB_KEY_Up: return RGFW_up; - case XKB_KEY_Down: return RGFW_down; - case XKB_KEY_Left: return RGFW_left; - case XKB_KEY_Right: return RGFW_right; - case XKB_KEY_Home: return RGFW_home; - case XKB_KEY_End: return RGFW_end; - case XKB_KEY_Page_Up: return RGFW_pageUp; - case XKB_KEY_Page_Down: return RGFW_pageDown; - case XKB_KEY_Insert: return RGFW_insert; - case XKB_KEY_Menu: return RGFW_menu; - case XKB_KEY_KP_Add: return RGFW_kpPlus; - case XKB_KEY_KP_Subtract: return RGFW_kpMinus; - case XKB_KEY_KP_Multiply: return RGFW_kpMultiply; - case XKB_KEY_KP_Divide: return RGFW_kpSlash; - case XKB_KEY_KP_Equal: return RGFW_kpEqual; - case XKB_KEY_KP_Enter: return RGFW_kpReturn; - case XKB_KEY_KP_Decimal: return RGFW_kpPeriod; - case XKB_KEY_KP_0: return RGFW_kp0; - case XKB_KEY_KP_1: return RGFW_kp1; - case XKB_KEY_KP_2: return RGFW_kp2; - case XKB_KEY_KP_3: return RGFW_kp3; - case XKB_KEY_KP_4: return RGFW_kp4; - case XKB_KEY_KP_5: return RGFW_kp5; - case XKB_KEY_KP_6: return RGFW_kp6; - case XKB_KEY_KP_7: return RGFW_kp7; - case XKB_KEY_KP_8: return RGFW_kp8; - case XKB_KEY_KP_9: return RGFW_kp9; - case XKB_KEY_Print: return RGFW_printScreen; - case XKB_KEY_Pause: return RGFW_pause; + case XKB_KEY_F1: return RGFW_keyF1; + case XKB_KEY_F2: return RGFW_keyF2; + case XKB_KEY_F3: return RGFW_keyF3; + case XKB_KEY_F4: return RGFW_keyF4; + case XKB_KEY_F5: return RGFW_keyF5; + case XKB_KEY_F6: return RGFW_keyF6; + case XKB_KEY_F7: return RGFW_keyF7; + case XKB_KEY_F8: return RGFW_keyF8; + case XKB_KEY_F9: return RGFW_keyF9; + case XKB_KEY_F10: return RGFW_keyF10; + case XKB_KEY_F11: return RGFW_keyF11; + case XKB_KEY_F12: return RGFW_keyF12; + case XKB_KEY_F13: return RGFW_keyF13; + case XKB_KEY_F14: return RGFW_keyF14; + case XKB_KEY_F15: return RGFW_keyF15; + case XKB_KEY_F16: return RGFW_keyF16; + case XKB_KEY_F17: return RGFW_keyF17; + case XKB_KEY_F18: return RGFW_keyF18; + case XKB_KEY_F19: return RGFW_keyF19; + case XKB_KEY_F20: return RGFW_keyF20; + case XKB_KEY_F21: return RGFW_keyF21; + case XKB_KEY_F22: return RGFW_keyF22; + case XKB_KEY_F23: return RGFW_keyF23; + case XKB_KEY_F24: return RGFW_keyF24; + case XKB_KEY_F25: return RGFW_keyF25; + case XKB_KEY_Shift_L: return RGFW_keyShiftL; + case XKB_KEY_Shift_R: return RGFW_keyShiftR; + case XKB_KEY_Control_L: return RGFW_keyControlL; + case XKB_KEY_Control_R: return RGFW_keyControlR; + case XKB_KEY_Alt_L: return RGFW_keyAltL; + case XKB_KEY_Alt_R: return RGFW_keyAltR; + case XKB_KEY_Super_L: return RGFW_keySuperL; + case XKB_KEY_Super_R: return RGFW_keySuperR; + case XKB_KEY_Caps_Lock: return RGFW_keyCapsLock; + case XKB_KEY_Num_Lock: return RGFW_keyNumLock; + case XKB_KEY_Scroll_Lock:return RGFW_keyScrollLock; + case XKB_KEY_Up: return RGFW_keyUp; + case XKB_KEY_Down: return RGFW_keyDown; + case XKB_KEY_Left: return RGFW_keyLeft; + case XKB_KEY_Right: return RGFW_keyRight; + case XKB_KEY_Home: return RGFW_keyHome; + case XKB_KEY_End: return RGFW_keyEnd; + case XKB_KEY_Page_Up: return RGFW_keyPageUp; + case XKB_KEY_Page_Down: return RGFW_keyPageDown; + case XKB_KEY_Insert: return RGFW_keyInsert; + case XKB_KEY_Menu: return RGFW_keyMenu; + case XKB_KEY_KP_Add: return RGFW_keyPadPlus; + case XKB_KEY_KP_Subtract: return RGFW_keyPadMinus; + case XKB_KEY_KP_Multiply: return RGFW_keyPadMultiply; + case XKB_KEY_KP_Divide: return RGFW_keyPadSlash; + case XKB_KEY_KP_Equal: return RGFW_keyPadEqual; + case XKB_KEY_KP_Enter: return RGFW_keyPadReturn; + case XKB_KEY_KP_Decimal: return RGFW_keyPadPeriod; + case XKB_KEY_KP_0: return RGFW_keyPad0; + case XKB_KEY_KP_1: return RGFW_keyPad1; + case XKB_KEY_KP_2: return RGFW_keyPad2; + case XKB_KEY_KP_3: return RGFW_keyPad3; + case XKB_KEY_KP_4: return RGFW_keyPad4; + case XKB_KEY_KP_5: return RGFW_keyPad5; + case XKB_KEY_KP_6: return RGFW_keyPad6; + case XKB_KEY_KP_7: return RGFW_keyPad7; + case XKB_KEY_KP_8: return RGFW_keyPad8; + case XKB_KEY_KP_9: return RGFW_keyPad9; + case XKB_KEY_Print: return RGFW_keyPrintScreen; + case XKB_KEY_Pause: return RGFW_keyPause; default: break; } return RGFW_keyNULL; } +RGFW_bool RGFW_FUNC(RGFW_window_fetchSize) (RGFW_window* win, i32* w, i32* h) { + return RGFW_window_getSize(win, w, h); +} + void RGFW_FUNC(RGFW_pollEvents) (void) { RGFW_resetPrevState(); @@ -9861,13 +9934,42 @@ void RGFW_FUNC(RGFW_pollEvents) (void) { return; } } + if (_RGFW->wl_repeat_info_rate != 0 && _RGFW->last_key) { + u32 now = (u32)(RGFW_linux_getTimeNS() / 1000000); + if (now > _RGFW->last_key_time) { + RGFW_wl_send_key_event(_RGFW->last_key); + _RGFW->last_key_time = now + 1000 / (u32)_RGFW->wl_repeat_info_rate; + } + } /* read the events; if empty this reads from the */ /* wayland file descriptor */ - if (wl_display_dispatch(_RGFW->wl_display) == -1) { - return; - } + struct pollfd fds; + memset(&fds, 0, sizeof(fds)); + fds.fd = wl_display_get_fd(_RGFW->wl_display); + fds.events = POLLIN; + fds.revents = 0; + while (1) { + while (wl_display_prepare_read(_RGFW->wl_display) != 0) { + if (wl_display_dispatch_pending(_RGFW->wl_display) > 0) + return; + } + + if (poll(&fds, 1, 0) == 0) { + wl_display_cancel_read(_RGFW->wl_display); + return; + } + + if (fds.revents & POLLIN) { + wl_display_read_events(_RGFW->wl_display); + if (wl_display_dispatch_pending(_RGFW->wl_display) > 0) { + return; + } + } else { + wl_display_cancel_read(_RGFW->wl_display); + } + } } void RGFW_FUNC(RGFW_window_move) (RGFW_window* win, i32 x, i32 y) { @@ -9923,6 +10025,7 @@ void RGFW_FUNC(RGFW_window_maximize) (RGFW_window* win) { win->internal.oldW = win->w; win->internal.oldH = win->h; RGFW_toggleWaylandMaximized(win, 1); + RGFW_window_fetchSize(win, NULL, NULL); return; } @@ -10030,50 +10133,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_setIconEx) (RGFW_window* win, u8* data, i32 w, i return RGFW_TRUE; } -RGFW_mouse* RGFW_FUNC(RGFW_loadMouse)(u8* data, i32 w, i32 h, RGFW_format format) { - - RGFW_surface *mouse_surface = RGFW_createSurface(data, w, h, format); - - if (mouse_surface == NULL) return NULL; - - RGFW_copyImageData(mouse_surface->native.buffer, RGFW_MIN(w, mouse_surface->w), RGFW_MIN(h, mouse_surface->h), mouse_surface->native.format, mouse_surface->data, mouse_surface->format, NULL); - - return (void*) mouse_surface; -} - -void RGFW_FUNC(RGFW_window_setMouse)(RGFW_window* win, RGFW_mouse* mouse) { - RGFW_ASSERT(win); RGFW_ASSERT(mouse); - RGFW_surface *mouse_surface = (RGFW_surface*)mouse; - - win->src.using_custom_cursor = RGFW_TRUE; - - struct wl_buffer *mouse_buffer = mouse_surface->native.wl_buffer; - - wl_surface_attach(win->src.custom_cursor_surface, mouse_buffer, 0, 0); - wl_surface_damage(win->src.custom_cursor_surface, 0, 0, mouse_surface->w, mouse_surface->h); - wl_surface_commit(win->src.custom_cursor_surface); - -} - -void RGFW_FUNC(RGFW_freeMouse)(RGFW_mouse* mouse) { - if (mouse != NULL) { - RGFW_surface_free((RGFW_surface*)mouse); - } -} - -void RGFW_FUNC(RGFW_window_moveMouse)(RGFW_window* win, i32 x, i32 y) { - if (_RGFW->wp_pointer_warp != NULL) { - wp_pointer_warp_v1_warp_pointer(_RGFW->wp_pointer_warp, win->src.surface, _RGFW->wl_pointer, wl_fixed_from_int(x), wl_fixed_from_int(y), _RGFW->mouse_enter_serial); - } -} - -RGFW_bool RGFW_FUNC(RGFW_window_setMouseDefault)(RGFW_window* win) { - return RGFW_window_setMouseStandard(win, RGFW_mouseArrow); -} - -RGFW_bool RGFW_FUNC(RGFW_window_setMouseStandard)(RGFW_window* win, u8 mouse) { - RGFW_ASSERT(win != NULL); - +RGFW_mouse* RGFW_FUNC(RGFW_createMouseStandard) (RGFW_mouseIcon mouse) { char* cursorName = NULL; switch (mouse) { case RGFW_mouseNormal: cursorName = (char*)"left_ptr"; break; @@ -10097,23 +10157,66 @@ RGFW_bool RGFW_FUNC(RGFW_window_setMouseStandard)(RGFW_window* win, u8 mouse) { case RGFW_mouseNotAllowed: cursorName = (char*)"not-allowed"; break; case RGFW_mouseWait: cursorName = (char*)"watch"; break; case RGFW_mouseProgress: cursorName = (char*)"watch"; break; - default: return RGFW_FALSE; + default: return NULL; } - win->src.using_custom_cursor = RGFW_FALSE; - struct wl_cursor* wlcursor = wl_cursor_theme_get_cursor(_RGFW->wl_cursor_theme, cursorName); if (wlcursor == NULL) - return RGFW_FALSE; + return NULL; struct wl_cursor_image* cursor_image = wlcursor->images[0]; struct wl_buffer* cursor_buffer = wl_cursor_image_get_buffer(cursor_image); - wl_pointer_set_cursor(_RGFW->wl_pointer, _RGFW->mouse_enter_serial, _RGFW->cursor_surface, (i32)cursor_image->hotspot_x, (i32)cursor_image->hotspot_y); - wl_surface_attach(_RGFW->cursor_surface, cursor_buffer, 0, 0); - wl_surface_damage(_RGFW->cursor_surface, 0, 0, (i32)cursor_image->width, (i32)cursor_image->height); - wl_surface_commit(_RGFW->cursor_surface); + + RGFW_surface* surface = RGFW_ALLOC(sizeof(RGFW_surface)); + RGFW_MEMZERO(surface, sizeof(RGFW_surface)); + surface->w = (i32)cursor_image->width; + surface->h = (i32)cursor_image->height; + surface->native.wl_buffer = cursor_buffer; + + return (RGFW_mouse*)surface; +} + +RGFW_mouse* RGFW_FUNC(RGFW_createMouse)(u8* data, i32 w, i32 h, RGFW_format format) { + RGFW_surface* surface = RGFW_createSurface(data, w, h, format); + if (surface == NULL) return NULL; + + surface->native.wl_buffer = wl_shm_pool_create_buffer(surface->native.pool, 0, surface->w, surface->h, (i32)surface->w * 4, WL_SHM_FORMAT_ARGB8888); + + RGFW_copyImageData(surface->native.buffer, RGFW_MIN(w, surface->w), RGFW_MIN(h, surface->h), surface->native.format, surface->data, surface->format, NULL); + + return (RGFW_mouse*)surface; +} + +RGFW_bool RGFW_FUNC(RGFW_window_setMousePlatform)(RGFW_window* win, RGFW_mouse* mouse) { + RGFW_ASSERT(win); RGFW_ASSERT(mouse); + RGFW_surface* surface = (RGFW_surface*)mouse; + + win->src.using_custom_cursor = RGFW_TRUE; + + wl_surface_attach(win->src.custom_cursor_surface, surface->native.wl_buffer, 0, 0); + wl_surface_damage(win->src.custom_cursor_surface, 0, 0, surface->w, surface->h); + wl_surface_commit(win->src.custom_cursor_surface); + return RGFW_TRUE; } +void RGFW_FUNC(RGFW_freeMouse)(RGFW_mouse* mouse) { + if (mouse != NULL) { + RGFW_surface* surface = (RGFW_surface*)mouse; + + if (surface->native.buffer && surface->native.wl_buffer) { + wl_buffer_destroy(surface->native.wl_buffer); + } + + RGFW_surface_free(surface); + } +} + +void RGFW_FUNC(RGFW_window_moveMouse)(RGFW_window* win, i32 x, i32 y) { + if (_RGFW->wp_pointer_warp != NULL) { + wp_pointer_warp_v1_warp_pointer(_RGFW->wp_pointer_warp, win->src.surface, _RGFW->wl_pointer, wl_fixed_from_int(x), wl_fixed_from_int(y), _RGFW->mouse_enter_serial); + } +} + void RGFW_FUNC(RGFW_window_hide) (RGFW_window* win) { wl_surface_attach(win->src.surface, NULL, 0, 0); wl_surface_commit(win->src.surface); @@ -10134,6 +10237,7 @@ void RGFW_FUNC(RGFW_window_flash) (RGFW_window* win, RGFW_flashRequest request) } RGFW_ssize_t RGFW_FUNC(RGFW_readClipboardPtr) (char* str, size_t strCapacity) { + RGFW_UNUSED(strCapacity); if (str != NULL) @@ -10172,7 +10276,7 @@ void RGFW_FUNC(RGFW_writeClipboard) (const char* text, u32 textLen) { // basic error checking if (win->src.data_source == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errClipboard, "Could not create clipboard data source"); + RGFW_debugCallback(RGFW_typeError, RGFW_errClipboard, "Could not create clipboard data source"); return; } wl_data_source_offer(win->src.data_source , "text/plain;charset=utf-8"); @@ -10289,7 +10393,7 @@ void RGFW_FUNC(RGFW_window_swapInterval_OpenGL) (RGFW_window* win, i32 swapInter void RGFW_FUNC(RGFW_window_closePlatform)(RGFW_window* win) { RGFW_ASSERT(win != NULL); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoWindow, "a window was freed"); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoWindow, "a window was freed"); #ifdef RGFW_LIBDECOR if (win->src.decorContext) libdecor_unref(win->src.decorContext); @@ -10505,6 +10609,7 @@ void RGFW_win32_makeWindowTransparent(RGFW_window* win) { RGFWDEF RGFW_bool RGFW_win32_getDarkModeState(void); RGFW_bool RGFW_win32_getDarkModeState(void) { u32 lightMode = 1; +#if (_WIN32_WINNT >= 0x0600) DWORD len = sizeof(lightMode); RegGetValueW( @@ -10512,6 +10617,7 @@ RGFW_bool RGFW_win32_getDarkModeState(void) { L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", L"AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &lightMode, &len ); +#endif return (lightMode == 0); } @@ -10542,11 +10648,11 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_CLOSE: case WM_QUIT: - RGFW_windowQuitCallback(win); + RGFW_windowCloseCallback(win); return 0; case WM_ACTIVATE: { RGFW_bool inFocus = RGFW_BOOL(LOWORD(wParam) != WA_INACTIVE); - RGFW_focusCallback(win, inFocus); + RGFW_windowFocusCallback(win, inFocus); return DefWindowProcW(hWnd, message, wParam, lParam); } @@ -10626,10 +10732,15 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) return DefWindowProcW(hWnd, message, wParam, lParam); } case WM_PAINT: { - PAINTSTRUCT ps; - BeginPaint(hWnd, &ps); - RGFW_windowRefreshCallback(win); - EndPaint(hWnd, &ps); + RECT rect; + if (GetUpdateRect(hWnd, &rect, FALSE)) { + RGFW_windowRefreshCallback(win, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); + } else { + PAINTSTRUCT ps; + BeginPaint(hWnd, &ps); + RGFW_windowRefreshCallback(win, 0, 0, win->w, win->h); + EndPaint(hWnd, &ps); + } return DefWindowProcW(hWnd, message, wParam, lParam); } @@ -10659,7 +10770,7 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; } case WM_TIMER: - RGFW_windowRefreshCallback(win); + RGFW_windowRefreshCallback(win, 0, 0, win->w, win->h); break; case WM_NCLBUTTONDOWN: { @@ -10727,14 +10838,12 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (wParam == VK_CONTROL) { if (HIWORD(lParam) & KF_EXTENDED) - value = RGFW_controlR; - else value = RGFW_controlL; + value = RGFW_keyControlR; + else value = RGFW_keyControlL; } - RGFW_bool repeat = ((lParam & 0x40000000) != 0) || RGFW_window_isKeyDown(win, value); - - RGFW_updateKeyMods(win, (GetKeyState(VK_CAPITAL) & 0x0001), (GetKeyState(VK_NUMLOCK) & 0x0001), (GetKeyState(VK_SCROLL) & 0x0001)); - RGFW_keyCallback(win, value, win->internal.mod, repeat, RGFW_FALSE); + RGFW_keyUpdateKeyMods(win, (GetKeyState(VK_CAPITAL) & 0x0001), (GetKeyState(VK_NUMLOCK) & 0x0001), (GetKeyState(VK_SCROLL) & 0x0001)); + RGFW_keyCallback(win, value, win->internal.mod, RGFW_FALSE, RGFW_FALSE); break; } case WM_SYSKEYDOWN: case WM_KEYDOWN: { @@ -10753,13 +10862,13 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) RGFW_key value = (u8)RGFW_apiKeyToRGFW((u32) scancode); if (wParam == VK_CONTROL) { if (HIWORD(lParam) & KF_EXTENDED) - value = RGFW_controlR; - else value = RGFW_controlL; + value = RGFW_keyControlR; + else value = RGFW_keyControlL; } - RGFW_bool repeat = ((lParam & 0x40000000) != 0) || RGFW_window_isKeyDown(win, value); + RGFW_bool repeat = RGFW_isKeyDown(value); - RGFW_updateKeyMods(win, (GetKeyState(VK_CAPITAL) & 0x0001), (GetKeyState(VK_NUMLOCK) & 0x0001), (GetKeyState(VK_SCROLL) & 0x0001)); + RGFW_keyUpdateKeyMods(win, (GetKeyState(VK_CAPITAL) & 0x0001), (GetKeyState(VK_NUMLOCK) & 0x0001), (GetKeyState(VK_SCROLL) & 0x0001)); RGFW_keyCallback(win, value, win->internal.mod, repeat, 1); break; } @@ -10768,11 +10877,7 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) RGFW_mouseNotifyCallback(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), RGFW_TRUE); } - if ((win->internal.rawMouse) || _RGFW->rawMouse) { - return DefWindowProcW(hWnd, message, wParam, lParam); - } - - RGFW_mousePosCallback(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), _RGFW->vectorX, _RGFW->vectorY); + RGFW_mouseMotionCallback(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); break; } case WM_INPUT: { @@ -10814,7 +10919,7 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) vecY = (float)(raw.data.mouse.lLastY); } - RGFW_mousePosCallback(win, win->internal.lastMouseX, win->internal.lastMouseY, vecX, vecY); + RGFW_rawMotionCallback(win, vecX, vecY); break; } case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_MBUTTONDOWN: case WM_XBUTTONDOWN: { @@ -10853,10 +10958,9 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* Move the mouse to the position of the drop */ DragQueryPoint(drop, &pt); - RGFW_dataDragCallback(win, pt.x, pt.y); + RGFW_dataDragCallback(win, RGFW_dataFile, RGFW_dndActionMove, pt.x, pt.y); if (!(win->internal.enabledEvents & RGFW_dataDrop)) return DefWindowProcW(hWnd, message, wParam, lParam); - char** files = _RGFW->files; size_t count = DragQueryFileW(drop, 0xffffffff, NULL, 0); u32 i; @@ -10865,20 +10969,20 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (length == 0) continue; - WCHAR buffer[RGFW_MAX_PATH * 2]; - if (length > (RGFW_MAX_PATH * 2) - 1) - length = RGFW_MAX_PATH * 2; + WCHAR* buffer = (WCHAR*)RGFW_ALLOC(sizeof(WCHAR) * (length + 1)); + char* cbuffer = (char*)RGFW_ALLOC(length + 1); DragQueryFileW(drop, i, buffer, length + 1); - RGFW_createUTF8FromWideStringWin32(buffer, files[i], RGFW_MAX_PATH); + RGFW_createUTF8FromWideStringWin32(buffer, cbuffer, length); - files[i][RGFW_MAX_PATH - 1] = '\0'; + RGFW_dataDropCallback(win, cbuffer, length + 1, RGFW_dataFile); + RGFW_FREE(buffer); + RGFW_FREE(cbuffer); } DragFinish(drop); - RGFW_dataDropCallback(win, files, count); break; } default: break; @@ -10933,10 +11037,10 @@ RGFW_bool RGFW_createSurfacePtr(u8* data, i32 w, i32 h, RGFW_format format, RGFW (void**) &surface->native.bitmapBits, NULL, (DWORD) 0); - surface->native.format = (format >= RGFW_formatRGBA8) ? RGFW_formatBGRA8 : RGFW_formatBGR8; + surface->native.format = (format >= RGFW_formatRGBA8) ? (RGFW_format) RGFW_formatBGRA8 : (RGFW_format) RGFW_formatBGR8; if (surface->native.bitmap == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errBuffer, "Failed to create DIB section."); + RGFW_debugCallback(RGFW_typeError, RGFW_errBuffer, "Failed to create DIB section."); return RGFW_FALSE; } @@ -10986,7 +11090,7 @@ int RGFW_window_createSwapChain_DirectX(RGFW_window* win, IDXGIFactory* pFactory RGFW_ASSERT(win && pFactory && pDevice && swapchain); static DXGI_SWAP_CHAIN_DESC swapChainDesc; - RGFW_MEMSET(&swapChainDesc, 0, sizeof(swapChainDesc)); + RGFW_MEMZERO(&swapChainDesc, sizeof(swapChainDesc)); swapChainDesc.BufferCount = 2; swapChainDesc.BufferDesc.Width = win->w; swapChainDesc.BufferDesc.Height = win->h; @@ -11000,7 +11104,7 @@ int RGFW_window_createSwapChain_DirectX(RGFW_window* win, IDXGIFactory* pFactory HRESULT hr = pFactory->lpVtbl->CreateSwapChain(pFactory, (IUnknown*)pDevice, &swapChainDesc, swapchain); if (FAILED(hr)) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errDirectXContext, "Failed to create DirectX swap chain!"); + RGFW_debugCallback(RGFW_typeError, RGFW_errDirectXContext, "Failed to create DirectX swap chain!"); return -2; } @@ -11010,124 +11114,124 @@ int RGFW_window_createSwapChain_DirectX(RGFW_window* win, IDXGIFactory* pFactory /* we're doing it with magic numbers because some keys are missing */ void RGFW_initKeycodesPlatform(void) { - _RGFW->keycodes[0x00B] = RGFW_0; - _RGFW->keycodes[0x002] = RGFW_1; - _RGFW->keycodes[0x003] = RGFW_2; - _RGFW->keycodes[0x004] = RGFW_3; - _RGFW->keycodes[0x005] = RGFW_4; - _RGFW->keycodes[0x006] = RGFW_5; - _RGFW->keycodes[0x007] = RGFW_6; - _RGFW->keycodes[0x008] = RGFW_7; - _RGFW->keycodes[0x009] = RGFW_8; - _RGFW->keycodes[0x00A] = RGFW_9; - _RGFW->keycodes[0x01E] = RGFW_a; - _RGFW->keycodes[0x030] = RGFW_b; - _RGFW->keycodes[0x02E] = RGFW_c; - _RGFW->keycodes[0x020] = RGFW_d; - _RGFW->keycodes[0x012] = RGFW_e; - _RGFW->keycodes[0x021] = RGFW_f; - _RGFW->keycodes[0x022] = RGFW_g; - _RGFW->keycodes[0x023] = RGFW_h; - _RGFW->keycodes[0x017] = RGFW_i; - _RGFW->keycodes[0x024] = RGFW_j; - _RGFW->keycodes[0x025] = RGFW_k; - _RGFW->keycodes[0x026] = RGFW_l; - _RGFW->keycodes[0x032] = RGFW_m; - _RGFW->keycodes[0x031] = RGFW_n; - _RGFW->keycodes[0x018] = RGFW_o; - _RGFW->keycodes[0x019] = RGFW_p; - _RGFW->keycodes[0x010] = RGFW_q; - _RGFW->keycodes[0x013] = RGFW_r; - _RGFW->keycodes[0x01F] = RGFW_s; - _RGFW->keycodes[0x014] = RGFW_t; - _RGFW->keycodes[0x016] = RGFW_u; - _RGFW->keycodes[0x02F] = RGFW_v; - _RGFW->keycodes[0x011] = RGFW_w; - _RGFW->keycodes[0x02D] = RGFW_x; - _RGFW->keycodes[0x015] = RGFW_y; - _RGFW->keycodes[0x02C] = RGFW_z; - _RGFW->keycodes[0x028] = RGFW_apostrophe; - _RGFW->keycodes[0x02B] = RGFW_backSlash; - _RGFW->keycodes[0x033] = RGFW_comma; - _RGFW->keycodes[0x00D] = RGFW_equals; - _RGFW->keycodes[0x029] = RGFW_backtick; - _RGFW->keycodes[0x01A] = RGFW_bracket; - _RGFW->keycodes[0x00C] = RGFW_minus; - _RGFW->keycodes[0x034] = RGFW_period; - _RGFW->keycodes[0x01B] = RGFW_closeBracket; - _RGFW->keycodes[0x027] = RGFW_semicolon; - _RGFW->keycodes[0x035] = RGFW_slash; - _RGFW->keycodes[0x056] = RGFW_world2; - _RGFW->keycodes[0x00E] = RGFW_backSpace; - _RGFW->keycodes[0x153] = RGFW_delete; - _RGFW->keycodes[0x14F] = RGFW_end; - _RGFW->keycodes[0x01C] = RGFW_enter; - _RGFW->keycodes[0x001] = RGFW_escape; - _RGFW->keycodes[0x147] = RGFW_home; - _RGFW->keycodes[0x152] = RGFW_insert; - _RGFW->keycodes[0x15D] = RGFW_menu; - _RGFW->keycodes[0x151] = RGFW_pageDown; - _RGFW->keycodes[0x149] = RGFW_pageUp; - _RGFW->keycodes[0x045] = RGFW_pause; - _RGFW->keycodes[0x039] = RGFW_space; - _RGFW->keycodes[0x00F] = RGFW_tab; - _RGFW->keycodes[0x03A] = RGFW_capsLock; - _RGFW->keycodes[0x145] = RGFW_numLock; - _RGFW->keycodes[0x046] = RGFW_scrollLock; - _RGFW->keycodes[0x03B] = RGFW_F1; - _RGFW->keycodes[0x03C] = RGFW_F2; - _RGFW->keycodes[0x03D] = RGFW_F3; - _RGFW->keycodes[0x03E] = RGFW_F4; - _RGFW->keycodes[0x03F] = RGFW_F5; - _RGFW->keycodes[0x040] = RGFW_F6; - _RGFW->keycodes[0x041] = RGFW_F7; - _RGFW->keycodes[0x042] = RGFW_F8; - _RGFW->keycodes[0x043] = RGFW_F9; - _RGFW->keycodes[0x044] = RGFW_F10; - _RGFW->keycodes[0x057] = RGFW_F11; - _RGFW->keycodes[0x058] = RGFW_F12; - _RGFW->keycodes[0x064] = RGFW_F13; - _RGFW->keycodes[0x065] = RGFW_F14; - _RGFW->keycodes[0x066] = RGFW_F15; - _RGFW->keycodes[0x067] = RGFW_F16; - _RGFW->keycodes[0x068] = RGFW_F17; - _RGFW->keycodes[0x069] = RGFW_F18; - _RGFW->keycodes[0x06A] = RGFW_F19; - _RGFW->keycodes[0x06B] = RGFW_F20; - _RGFW->keycodes[0x06C] = RGFW_F21; - _RGFW->keycodes[0x06D] = RGFW_F22; - _RGFW->keycodes[0x06E] = RGFW_F23; - _RGFW->keycodes[0x076] = RGFW_F24; - _RGFW->keycodes[0x038] = RGFW_altL; - _RGFW->keycodes[0x01D] = RGFW_controlL; - _RGFW->keycodes[0x02A] = RGFW_shiftL; - _RGFW->keycodes[0x15B] = RGFW_superL; - _RGFW->keycodes[0x137] = RGFW_printScreen; - _RGFW->keycodes[0x138] = RGFW_altR; - _RGFW->keycodes[0x11D] = RGFW_controlR; - _RGFW->keycodes[0x036] = RGFW_shiftR; - _RGFW->keycodes[0x15C] = RGFW_superR; - _RGFW->keycodes[0x150] = RGFW_down; - _RGFW->keycodes[0x14B] = RGFW_left; - _RGFW->keycodes[0x14D] = RGFW_right; - _RGFW->keycodes[0x148] = RGFW_up; - _RGFW->keycodes[0x052] = RGFW_kp0; - _RGFW->keycodes[0x04F] = RGFW_kp1; - _RGFW->keycodes[0x050] = RGFW_kp2; - _RGFW->keycodes[0x051] = RGFW_kp3; - _RGFW->keycodes[0x04B] = RGFW_kp4; - _RGFW->keycodes[0x04C] = RGFW_kp5; - _RGFW->keycodes[0x04D] = RGFW_kp6; - _RGFW->keycodes[0x047] = RGFW_kp7; - _RGFW->keycodes[0x048] = RGFW_kp8; - _RGFW->keycodes[0x049] = RGFW_kp9; - _RGFW->keycodes[0x04E] = RGFW_kpPlus; - _RGFW->keycodes[0x053] = RGFW_kpPeriod; - _RGFW->keycodes[0x135] = RGFW_kpSlash; - _RGFW->keycodes[0x11C] = RGFW_kpReturn; - _RGFW->keycodes[0x059] = RGFW_kpEqual; - _RGFW->keycodes[0x037] = RGFW_kpMultiply; - _RGFW->keycodes[0x04A] = RGFW_kpMinus; + _RGFW->keycodes[0x00B] = RGFW_key0; + _RGFW->keycodes[0x002] = RGFW_key1; + _RGFW->keycodes[0x003] = RGFW_key2; + _RGFW->keycodes[0x004] = RGFW_key3; + _RGFW->keycodes[0x005] = RGFW_key4; + _RGFW->keycodes[0x006] = RGFW_key5; + _RGFW->keycodes[0x007] = RGFW_key6; + _RGFW->keycodes[0x008] = RGFW_key7; + _RGFW->keycodes[0x009] = RGFW_key8; + _RGFW->keycodes[0x00A] = RGFW_key9; + _RGFW->keycodes[0x01E] = RGFW_keyA; + _RGFW->keycodes[0x030] = RGFW_keyB; + _RGFW->keycodes[0x02E] = RGFW_keyC; + _RGFW->keycodes[0x020] = RGFW_keyD; + _RGFW->keycodes[0x012] = RGFW_keyE; + _RGFW->keycodes[0x021] = RGFW_keyF; + _RGFW->keycodes[0x022] = RGFW_keyG; + _RGFW->keycodes[0x023] = RGFW_keyH; + _RGFW->keycodes[0x017] = RGFW_keyI; + _RGFW->keycodes[0x024] = RGFW_keyJ; + _RGFW->keycodes[0x025] = RGFW_keyK; + _RGFW->keycodes[0x026] = RGFW_keyL; + _RGFW->keycodes[0x032] = RGFW_keyM; + _RGFW->keycodes[0x031] = RGFW_keyN; + _RGFW->keycodes[0x018] = RGFW_keyO; + _RGFW->keycodes[0x019] = RGFW_keyP; + _RGFW->keycodes[0x010] = RGFW_keyQ; + _RGFW->keycodes[0x013] = RGFW_keyR; + _RGFW->keycodes[0x01F] = RGFW_keyS; + _RGFW->keycodes[0x014] = RGFW_keyT; + _RGFW->keycodes[0x016] = RGFW_keyU; + _RGFW->keycodes[0x02F] = RGFW_keyV; + _RGFW->keycodes[0x011] = RGFW_keyW; + _RGFW->keycodes[0x02D] = RGFW_keyX; + _RGFW->keycodes[0x015] = RGFW_keyY; + _RGFW->keycodes[0x02C] = RGFW_keyZ; + _RGFW->keycodes[0x028] = RGFW_keyApostrophe; + _RGFW->keycodes[0x02B] = RGFW_keyBackSlash; + _RGFW->keycodes[0x033] = RGFW_keyComma; + _RGFW->keycodes[0x00D] = RGFW_keyEquals; + _RGFW->keycodes[0x029] = RGFW_keyBacktick; + _RGFW->keycodes[0x01A] = RGFW_keyBracket; + _RGFW->keycodes[0x00C] = RGFW_keyMinus; + _RGFW->keycodes[0x034] = RGFW_keyPeriod; + _RGFW->keycodes[0x01B] = RGFW_keyCloseBracket; + _RGFW->keycodes[0x027] = RGFW_keySemicolon; + _RGFW->keycodes[0x035] = RGFW_keySlash; + _RGFW->keycodes[0x056] = RGFW_keyWorld2; + _RGFW->keycodes[0x00E] = RGFW_keyBackSpace; + _RGFW->keycodes[0x153] = RGFW_keyDelete; + _RGFW->keycodes[0x14F] = RGFW_keyEnd; + _RGFW->keycodes[0x01C] = RGFW_keyEnter; + _RGFW->keycodes[0x001] = RGFW_keyEscape; + _RGFW->keycodes[0x147] = RGFW_keyHome; + _RGFW->keycodes[0x152] = RGFW_keyInsert; + _RGFW->keycodes[0x15D] = RGFW_keyMenu; + _RGFW->keycodes[0x151] = RGFW_keyPageDown; + _RGFW->keycodes[0x149] = RGFW_keyPageUp; + _RGFW->keycodes[0x045] = RGFW_keyPause; + _RGFW->keycodes[0x039] = RGFW_keySpace; + _RGFW->keycodes[0x00F] = RGFW_keyTab; + _RGFW->keycodes[0x03A] = RGFW_keyCapsLock; + _RGFW->keycodes[0x145] = RGFW_keyNumLock; + _RGFW->keycodes[0x046] = RGFW_keyScrollLock; + _RGFW->keycodes[0x03B] = RGFW_keyF1; + _RGFW->keycodes[0x03C] = RGFW_keyF2; + _RGFW->keycodes[0x03D] = RGFW_keyF3; + _RGFW->keycodes[0x03E] = RGFW_keyF4; + _RGFW->keycodes[0x03F] = RGFW_keyF5; + _RGFW->keycodes[0x040] = RGFW_keyF6; + _RGFW->keycodes[0x041] = RGFW_keyF7; + _RGFW->keycodes[0x042] = RGFW_keyF8; + _RGFW->keycodes[0x043] = RGFW_keyF9; + _RGFW->keycodes[0x044] = RGFW_keyF10; + _RGFW->keycodes[0x057] = RGFW_keyF11; + _RGFW->keycodes[0x058] = RGFW_keyF12; + _RGFW->keycodes[0x064] = RGFW_keyF13; + _RGFW->keycodes[0x065] = RGFW_keyF14; + _RGFW->keycodes[0x066] = RGFW_keyF15; + _RGFW->keycodes[0x067] = RGFW_keyF16; + _RGFW->keycodes[0x068] = RGFW_keyF17; + _RGFW->keycodes[0x069] = RGFW_keyF18; + _RGFW->keycodes[0x06A] = RGFW_keyF19; + _RGFW->keycodes[0x06B] = RGFW_keyF20; + _RGFW->keycodes[0x06C] = RGFW_keyF21; + _RGFW->keycodes[0x06D] = RGFW_keyF22; + _RGFW->keycodes[0x06E] = RGFW_keyF23; + _RGFW->keycodes[0x076] = RGFW_keyF24; + _RGFW->keycodes[0x038] = RGFW_keyAltL; + _RGFW->keycodes[0x01D] = RGFW_keyControlL; + _RGFW->keycodes[0x02A] = RGFW_keyShiftL; + _RGFW->keycodes[0x15B] = RGFW_keySuperL; + _RGFW->keycodes[0x137] = RGFW_keyPrintScreen; + _RGFW->keycodes[0x138] = RGFW_keyAltR; + _RGFW->keycodes[0x11D] = RGFW_keyControlR; + _RGFW->keycodes[0x036] = RGFW_keyShiftR; + _RGFW->keycodes[0x15C] = RGFW_keySuperR; + _RGFW->keycodes[0x150] = RGFW_keyDown; + _RGFW->keycodes[0x14B] = RGFW_keyLeft; + _RGFW->keycodes[0x14D] = RGFW_keyRight; + _RGFW->keycodes[0x148] = RGFW_keyUp; + _RGFW->keycodes[0x052] = RGFW_keyPad0; + _RGFW->keycodes[0x04F] = RGFW_keyPad1; + _RGFW->keycodes[0x050] = RGFW_keyPad2; + _RGFW->keycodes[0x051] = RGFW_keyPad3; + _RGFW->keycodes[0x04B] = RGFW_keyPad4; + _RGFW->keycodes[0x04C] = RGFW_keyPad5; + _RGFW->keycodes[0x04D] = RGFW_keyPad6; + _RGFW->keycodes[0x047] = RGFW_keyPad7; + _RGFW->keycodes[0x048] = RGFW_keyPad8; + _RGFW->keycodes[0x049] = RGFW_keyPad9; + _RGFW->keycodes[0x04E] = RGFW_keyPadPlus; + _RGFW->keycodes[0x053] = RGFW_keyPadPeriod; + _RGFW->keycodes[0x135] = RGFW_keyPadSlash; + _RGFW->keycodes[0x11C] = RGFW_keyPadReturn; + _RGFW->keycodes[0x059] = RGFW_keyPadEqual; + _RGFW->keycodes[0x037] = RGFW_keyPadMultiply; + _RGFW->keycodes[0x04A] = RGFW_keyPadMinus; } @@ -11165,8 +11269,8 @@ i32 RGFW_initPlatform(void) { #endif u8 RGFW_blk[] = { 0, 0, 0, 0 }; - _RGFW->hiddenMouse = RGFW_loadMouse(RGFW_blk, 1, 1, RGFW_formatRGBA8); - return 1; + _RGFW->hiddenMouse = RGFW_createMouse(RGFW_blk, 1, 1, RGFW_formatRGBA8); + return 0; } RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, RGFW_window* win) { @@ -11207,8 +11311,6 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, DWORD window_style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; - RECT windowRect, clientRect; - if (!(flags & RGFW_windowNoBorder)) { window_style |= WS_CAPTION | WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX; @@ -11221,9 +11323,6 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, MultiByteToWideChar(CP_UTF8, 0, name, -1, wide_name, 255); HWND dummyWin = CreateWindowW(Class.lpszClassName, (wchar_t*)wide_name, window_style, win->x, win->y, win->w, win->h, 0, 0, inh, 0); - GetWindowRect(dummyWin, &windowRect); - GetClientRect(dummyWin, &clientRect); - #ifdef RGFW_OPENGL RGFW_win32_loadOpenGLFuncs(dummyWin); #endif @@ -11252,23 +11351,29 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, void RGFW_window_setBorder(RGFW_window* win, RGFW_bool border) { RGFW_setBit(&win->internal.flags, RGFW_windowNoBorder, !border); + + RECT rect; + GetClientRect(win->src.window, &rect); + LONG style = GetWindowLong(win->src.window, GWL_STYLE); + style |= (LONG)RGFW_winapi_window_getStyle(win, win->internal.flags); if (border == 0) { - SetWindowLong(win->src.window, GWL_STYLE, style & ~WS_OVERLAPPEDWINDOW); - SetWindowPos( - win->src.window, HWND_TOP, 0, 0, 0, 0, - SWP_NOZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE - ); - } - else { + style &= ~WS_OVERLAPPEDWINDOW; + } else { if (win->internal.flags & RGFW_windowNoResize) style &= ~WS_MAXIMIZEBOX; - SetWindowLong(win->src.window, GWL_STYLE, style | WS_OVERLAPPEDWINDOW); - SetWindowPos( - win->src.window, HWND_TOP, 0, 0, 0, 0, - SWP_NOZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE - ); + style |= WS_OVERLAPPEDWINDOW; } + + DWORD exStyle = RGFW_winapi_window_getExStyle(win, win->internal.flags); + ClientToScreen(win->src.window, (POINT*) &rect.left); + ClientToScreen(win->src.window, (POINT*) &rect.right); + + AdjustWindowRectEx(&rect, (DWORD)style, FALSE, exStyle); + SetWindowLong(win->src.window, GWL_STYLE, style); + + SetWindowLongW(win->src.window, GWL_STYLE, style); + SetWindowPos(win->src.window, HWND_TOP, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER); } void RGFW_window_setDND(RGFW_window* win, RGFW_bool allow) { @@ -11317,15 +11422,18 @@ void RGFW_window_raise(RGFW_window* win) { void RGFW_window_setFullscreen(RGFW_window* win, RGFW_bool fullscreen) { RGFW_ASSERT(win != NULL); + RGFW_monitor* mon = RGFW_window_getMonitor(win); + if (fullscreen == RGFW_FALSE) { + RGFW_monitor_setMode(mon, &win->internal.oldMode); + RGFW_window_setBorder(win, 1); RECT rect = { 0, 0, win->internal.oldW, win->internal.oldH}; DWORD style = RGFW_winapi_window_getStyle(win, win->internal.flags); DWORD exStyle = RGFW_winapi_window_getExStyle(win, win->internal.flags); AdjustWindowRectEx(&rect, style, FALSE, exStyle); - SetWindowPos(win->src.window, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER); - + SetWindowPos(win->src.window, HWND_TOP, win->internal.oldX, win->internal.oldY, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); win->internal.flags &= ~(u32)RGFW_windowFullscreen; win->x = win->internal.oldX; @@ -11339,17 +11447,17 @@ void RGFW_window_setFullscreen(RGFW_window* win, RGFW_bool fullscreen) { win->internal.oldY = win->y; win->internal.oldW = win->w; win->internal.oldH = win->h; + win->internal.oldMode = mon->mode; win->internal.flags |= RGFW_windowFullscreen; - RGFW_monitor* mon = RGFW_window_getMonitor(win); - RGFW_window_setBorder(win, 0); - RGFW_monitor_scaleToWindow(mon, win); - - SetWindowPos(win->src.window, HWND_TOPMOST, (i32)mon->x, (i32)mon->y, (i32)mon->mode.w, (i32)mon->mode.h, SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW); + SetWindowPos(win->src.window, HWND_TOPMOST, (i32)mon->x, (i32)mon->y, 0, 0, SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOSIZE); win->x = mon->x; win->y = mon->y; + + RGFW_monitor_scaleToWindow(mon, win); + SetWindowPos(win->src.window, HWND_TOPMOST, 0, 0, (i32)mon->mode.w, (i32)mon->mode.h, SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE); win->w = mon->mode.w; win->h = mon->mode.h; } @@ -11358,6 +11466,7 @@ void RGFW_window_maximize(RGFW_window* win) { RGFW_ASSERT(win != NULL); RGFW_window_hide(win); ShowWindow(win->src.window, SW_MAXIMIZE); + RGFW_window_fetchSize(win, NULL, NULL); } void RGFW_window_minimize(RGFW_window* win) { @@ -11408,75 +11517,85 @@ RGFW_key RGFW_physicalToMappedKey(RGFW_key key) { } switch (vk) { - case VK_F1: return RGFW_F1; - case VK_F2: return RGFW_F2; - case VK_F3: return RGFW_F3; - case VK_F4: return RGFW_F4; - case VK_F5: return RGFW_F5; - case VK_F6: return RGFW_F6; - case VK_F7: return RGFW_F7; - case VK_F8: return RGFW_F8; - case VK_F9: return RGFW_F9; - case VK_F10: return RGFW_F10; - case VK_F11: return RGFW_F11; - case VK_F12: return RGFW_F12; - case VK_F13: return RGFW_F13; - case VK_F14: return RGFW_F14; - case VK_F15: return RGFW_F15; - case VK_F16: return RGFW_F16; - case VK_F17: return RGFW_F17; - case VK_F18: return RGFW_F18; - case VK_F19: return RGFW_F19; - case VK_F20: return RGFW_F20; - case VK_F21: return RGFW_F21; - case VK_F22: return RGFW_F22; - case VK_F23: return RGFW_F23; - case VK_F24: return RGFW_F24; - case VK_LSHIFT: return RGFW_shiftL; - case VK_RSHIFT: return RGFW_shiftR; - case VK_LCONTROL: return RGFW_controlL; - case VK_RCONTROL: return RGFW_controlR; - case VK_LMENU: return RGFW_altL; - case VK_RMENU: return RGFW_altR; - case VK_LWIN: return RGFW_superL; - case VK_RWIN: return RGFW_superR; - case VK_CAPITAL: return RGFW_capsLock; - case VK_NUMLOCK: return RGFW_numLock; - case VK_SCROLL: return RGFW_scrollLock; - case VK_UP: return RGFW_up; - case VK_DOWN: return RGFW_down; - case VK_LEFT: return RGFW_left; - case VK_RIGHT: return RGFW_right; - case VK_HOME: return RGFW_home; - case VK_END: return RGFW_end; - case VK_PRIOR: return RGFW_pageUp; - case VK_NEXT: return RGFW_pageDown; - case VK_INSERT: return RGFW_insert; - case VK_APPS: return RGFW_menu; - case VK_ADD: return RGFW_kpPlus; - case VK_SUBTRACT: return RGFW_kpMinus; - case VK_MULTIPLY: return RGFW_kpMultiply; - case VK_DIVIDE: return RGFW_kpSlash; - case VK_RETURN: return RGFW_kpReturn; - case VK_DECIMAL: return RGFW_kpPeriod; - case VK_NUMPAD0: return RGFW_kp0; - case VK_NUMPAD1: return RGFW_kp1; - case VK_NUMPAD2: return RGFW_kp2; - case VK_NUMPAD3: return RGFW_kp3; - case VK_NUMPAD4: return RGFW_kp4; - case VK_NUMPAD5: return RGFW_kp5; - case VK_NUMPAD6: return RGFW_kp6; - case VK_NUMPAD7: return RGFW_kp7; - case VK_NUMPAD8: return RGFW_kp8; - case VK_NUMPAD9: return RGFW_kp9; - case VK_SNAPSHOT: return RGFW_printScreen; - case VK_PAUSE: return RGFW_pause; + case VK_F1: return RGFW_keyF1; + case VK_F2: return RGFW_keyF2; + case VK_F3: return RGFW_keyF3; + case VK_F4: return RGFW_keyF4; + case VK_F5: return RGFW_keyF5; + case VK_F6: return RGFW_keyF6; + case VK_F7: return RGFW_keyF7; + case VK_F8: return RGFW_keyF8; + case VK_F9: return RGFW_keyF9; + case VK_F10: return RGFW_keyF10; + case VK_F11: return RGFW_keyF11; + case VK_F12: return RGFW_keyF12; + case VK_F13: return RGFW_keyF13; + case VK_F14: return RGFW_keyF14; + case VK_F15: return RGFW_keyF15; + case VK_F16: return RGFW_keyF16; + case VK_F17: return RGFW_keyF17; + case VK_F18: return RGFW_keyF18; + case VK_F19: return RGFW_keyF19; + case VK_F20: return RGFW_keyF20; + case VK_F21: return RGFW_keyF21; + case VK_F22: return RGFW_keyF22; + case VK_F23: return RGFW_keyF23; + case VK_F24: return RGFW_keyF24; + case VK_LSHIFT: return RGFW_keyShiftL; + case VK_RSHIFT: return RGFW_keyShiftR; + case VK_LCONTROL: return RGFW_keyControlL; + case VK_RCONTROL: return RGFW_keyControlR; + case VK_LMENU: return RGFW_keyAltL; + case VK_RMENU: return RGFW_keyAltR; + case VK_LWIN: return RGFW_keySuperL; + case VK_RWIN: return RGFW_keySuperR; + case VK_CAPITAL: return RGFW_keyCapsLock; + case VK_NUMLOCK: return RGFW_keyNumLock; + case VK_SCROLL: return RGFW_keyScrollLock; + case VK_UP: return RGFW_keyUp; + case VK_DOWN: return RGFW_keyDown; + case VK_LEFT: return RGFW_keyLeft; + case VK_RIGHT: return RGFW_keyRight; + case VK_HOME: return RGFW_keyHome; + case VK_END: return RGFW_keyEnd; + case VK_PRIOR: return RGFW_keyPageUp; + case VK_NEXT: return RGFW_keyPageDown; + case VK_INSERT: return RGFW_keyInsert; + case VK_APPS: return RGFW_keyMenu; + case VK_ADD: return RGFW_keyPadPlus; + case VK_SUBTRACT: return RGFW_keyPadMinus; + case VK_MULTIPLY: return RGFW_keyPadMultiply; + case VK_DIVIDE: return RGFW_keyPadSlash; + case VK_RETURN: return RGFW_keyPadReturn; + case VK_DECIMAL: return RGFW_keyPadPeriod; + case VK_NUMPAD0: return RGFW_keyPad0; + case VK_NUMPAD1: return RGFW_keyPad1; + case VK_NUMPAD2: return RGFW_keyPad2; + case VK_NUMPAD3: return RGFW_keyPad3; + case VK_NUMPAD4: return RGFW_keyPad4; + case VK_NUMPAD5: return RGFW_keyPad5; + case VK_NUMPAD6: return RGFW_keyPad6; + case VK_NUMPAD7: return RGFW_keyPad7; + case VK_NUMPAD8: return RGFW_keyPad8; + case VK_NUMPAD9: return RGFW_keyPad9; + case VK_SNAPSHOT: return RGFW_keyPrintScreen; + case VK_PAUSE: return RGFW_keyPause; default: return RGFW_keyNULL; } return RGFW_keyNULL; } +RGFW_bool RGFW_window_fetchSize(RGFW_window* win, i32* w, i32* h) { + RECT area; + GetClientRect(win->src.window, &area); + + win->w = area.right; + win->h = area.bottom; + + return RGFW_window_getSize(win, w, h); +} + void RGFW_pollEvents(void) { RGFW_resetPrevState(); MSG msg; @@ -11547,7 +11666,7 @@ size_t RGFW_monitor_getGammaRampPtr(RGFW_monitor* monitor, RGFW_gammaRamp* ramp) RGFW_bool RGFW_monitor_setGammaRamp(RGFW_monitor* monitor, RGFW_gammaRamp* ramp) { WORD values[3][256]; if (ramp->count != 256) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errX11, "Win32: Gamma ramp size must be 256"); + RGFW_debugCallback(RGFW_typeError, RGFW_errX11, "Win32: Gamma ramp size must be 256"); return RGFW_FALSE; } @@ -11612,6 +11731,10 @@ size_t RGFW_monitor_getModesPtr(RGFW_monitor* monitor, RGFW_monitorMode** modes) if (!EnumDisplaySettingsW(monitor->node->adapterName, modeIndex, &dm)) break; + if (ChangeDisplaySettingsExW(monitor->node->adapterName, &dm, NULL, CDS_TEST, NULL) != DISP_CHANGE_SUCCESSFUL) { + continue; + } + modeIndex++; if (dm.dmBitsPerPel < 15) @@ -11676,9 +11799,9 @@ void RGFW_win32_createMonitor(DISPLAY_DEVICEW* adapter, DISPLAY_DEVICEW* dd) { node->mon.y = monitorInfo.rcMonitor.top; HDC hdc = CreateDCW(monitorInfo.szDevice, NULL, NULL, NULL); - /* get pixels per inch */ + float dpiX = (float)GetDeviceCaps(hdc, LOGPIXELSX); - float dpiY = (float)GetDeviceCaps(hdc, LOGPIXELSX); + float dpiY = (float)GetDeviceCaps(hdc, LOGPIXELSY); node->mon.scaleX = dpiX / 96.0f; node->mon.scaleY = dpiY / 96.0f; @@ -11807,14 +11930,16 @@ RGFW_bool RGFW_monitor_setMode(RGFW_monitor* mon, RGFW_monitorMode* mode) { dm.dmBitsPerPel = (DWORD)(mode->red + mode->green + mode->blue); if (ChangeDisplaySettingsExW(mon->node->adapterName, &dm, NULL, CDS_TEST, NULL) == DISP_CHANGE_SUCCESSFUL) { - if (ChangeDisplaySettingsExW(mon->node->adapterName, &dm, NULL, CDS_UPDATEREGISTRY, NULL) == DISP_CHANGE_SUCCESSFUL) + if (ChangeDisplaySettingsExW(mon->node->adapterName, &dm, NULL, CDS_UPDATEREGISTRY, NULL) == DISP_CHANGE_SUCCESSFUL) { + RGFW_win32_getMode(&dm, &mon->mode); return RGFW_TRUE; + } return RGFW_FALSE; } else return RGFW_FALSE; } RGFW_bool RGFW_monitor_requestMode(RGFW_monitor* mon, RGFW_monitorMode* mode, RGFW_modeRequest request) { - HMONITOR src = mon->node->hMonitor; +HMONITOR src = mon->node->hMonitor; MONITORINFOEX monitorInfo; monitorInfo.cbSize = sizeof(MONITORINFOEX); @@ -11824,7 +11949,15 @@ RGFW_bool RGFW_monitor_requestMode(RGFW_monitor* mon, RGFW_monitorMode* mode, RG ZeroMemory(&dm, sizeof(dm)); dm.dmSize = sizeof(dm); - if (EnumDisplaySettingsW(mon->node->adapterName, ENUM_CURRENT_SETTINGS, &dm)) { + DWORD index = 0; + + for (;;) { + if (EnumDisplaySettingsW(mon->node->adapterName, index, &dm) == 0) { + break; + } + + index += 1; + if (request & RGFW_monitorScale) { dm.dmFields |= DM_PELSWIDTH | DM_PELSHEIGHT; dm.dmPelsWidth = (u32)mode->w; @@ -11847,7 +11980,7 @@ RGFW_bool RGFW_monitor_requestMode(RGFW_monitor* mon, RGFW_monitorMode* mode, RG return RGFW_TRUE; } return RGFW_FALSE; - } else return RGFW_FALSE; + } } return RGFW_FALSE; @@ -11890,29 +12023,8 @@ HICON RGFW_loadHandleImage(u8* data, i32 w, i32 h, RGFW_format format, BOOL icon return handle; } -RGFW_mouse* RGFW_loadMouse(u8* data, i32 w, i32 h, RGFW_format format) { - HCURSOR cursor = (HCURSOR) RGFW_loadHandleImage(data, w, h, format, FALSE); - return cursor; -} - -void RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse) { - RGFW_ASSERT(win && mouse); - SetClassLongPtrA(win->src.window, GCLP_HCURSOR, (LPARAM) mouse); - SetCursor((HCURSOR)mouse); -} - -void RGFW_freeMouse(RGFW_mouse* mouse) { - RGFW_ASSERT(mouse); - DestroyCursor((HCURSOR)mouse); -} - -RGFW_bool RGFW_window_setMouseDefault(RGFW_window* win) { - return RGFW_window_setMouseStandard(win, RGFW_mouseArrow); -} - -RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, u8 mouse) { - RGFW_ASSERT(win != NULL); +RGFW_mouse* RGFW_createMouseStandard(RGFW_mouseIcon mouse) { u32 mouseIcon = 0; switch (mouse) { @@ -11937,14 +12049,29 @@ RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, u8 mouse) { case RGFW_mouseResizeS: mouseIcon = OCR_SIZENS; break; case RGFW_mouseResizeSW: mouseIcon = OCR_SIZENESW; break; case RGFW_mouseResizeW: mouseIcon = OCR_SIZEWE; break; - default: return RGFW_FALSE; + default: return NULL; } char* icon = MAKEINTRESOURCEA(mouseIcon); + return LoadCursorA(NULL, icon); +} - SetClassLongPtrA(win->src.window, GCLP_HCURSOR, (LPARAM) LoadCursorA(NULL, icon)); - SetCursor(LoadCursorA(NULL, icon)); - return RGFW_TRUE; +RGFW_mouse* RGFW_createMouse(u8* data, i32 w, i32 h, RGFW_format format) { + HCURSOR cursor = (HCURSOR) RGFW_loadHandleImage(data, w, h, format, FALSE); + return cursor; +} + +RGFW_bool RGFW_window_setMousePlatform(RGFW_window* win, RGFW_mouse* mouse) { + RGFW_ASSERT(win && mouse); + SetClassLongPtrA(win->src.window, GCLP_HCURSOR, (LPARAM) mouse); + SetCursor((HCURSOR)mouse); + + return RGFW_FALSE; +} + +void RGFW_freeMouse(RGFW_mouse* mouse) { + RGFW_ASSERT(mouse); + DestroyCursor((HCURSOR)mouse); } void RGFW_window_hide(RGFW_window* win) { @@ -11962,7 +12089,7 @@ void RGFW_window_flash(RGFW_window* win, RGFW_flashRequest request) { } FLASHWINFO desc; - RGFW_MEMSET(&desc, 0, sizeof(desc)); + RGFW_MEMZERO(&desc, sizeof(desc)); desc.cbSize = sizeof(desc); desc.hwnd = win->src.window; @@ -12025,12 +12152,10 @@ void RGFW_window_resize(RGFW_window* win, i32 w, i32 h) { win->w = w; win->h = h; - RECT rect = { 0, 0, w, h}; DWORD style = RGFW_winapi_window_getStyle(win, win->internal.flags); DWORD exStyle = RGFW_winapi_window_getExStyle(win, win->internal.flags); AdjustWindowRectEx(&rect, style, FALSE, exStyle); - SetWindowPos(win->src.window, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER); } @@ -12216,7 +12341,7 @@ void RGFW_win32_loadOpenGLFuncs(HWND dummyWin) { wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)(RGFW_proc)wglGetProcAddress("wglSwapIntervalEXT"); if (wglSwapIntervalEXT == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load swap interval function"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load swap interval function"); } wglMakeCurrent(dummy_dc, cur); @@ -12330,14 +12455,14 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* UINT num_formats; wglChoosePixelFormatARB(win->src.hdc, pixel_format_attribs, 0, 1, &new_pixel_format, &num_formats); if (!num_formats) - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create a pixel format for WGL"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create a pixel format for WGL"); else pixel_format = new_pixel_format; } PIXELFORMATDESCRIPTOR suggested; if (!DescribePixelFormat(win->src.hdc, pixel_format, sizeof(suggested), &suggested) || !SetPixelFormat(win->src.hdc, pixel_format, &pfd)) - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to set the WGL pixel format"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to set the WGL pixel format"); if (wglCreateContextAttribsARB != NULL) { /* create OpenGL/WGL context for the specified version */ @@ -12387,7 +12512,7 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* } if (wglCreateContextAttribsARB == NULL || win->src.ctx.native->ctx == NULL) { /* fall back to a default context (probably OpenGL 2 or something) */ - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create an accelerated OpenGL Context."); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create an accelerated OpenGL Context."); win->src.ctx.native->ctx = wglCreateContext(win->src.hdc); } @@ -12399,14 +12524,14 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* } wglMakeCurrent(win->src.hdc, win->src.ctx.native->ctx); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); return RGFW_TRUE; } void RGFW_window_deleteContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* ctx) { wglDeleteContext((HGLRC) ctx->ctx); /*!< delete OpenGL context */ win->src.ctx.native->ctx = NULL; - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); } void RGFW_window_makeCurrentContext_OpenGL(RGFW_window* win) { @@ -12426,7 +12551,7 @@ void RGFW_window_swapBuffers_OpenGL(RGFW_window* win) { void RGFW_window_swapInterval_OpenGL(RGFW_window* win, i32 swapInterval) { RGFW_ASSERT(win != NULL); if (wglSwapIntervalEXT == NULL || wglSwapIntervalEXT(swapInterval) == FALSE) - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to set swap interval"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to set swap interval"); } #endif @@ -12807,7 +12932,16 @@ NSInteger NSPasteBoard_declareTypes(id pasteboard, NSPasteboardType* newTypes, s static id RGFW__osxCustomInitWithRGFWWindow(id self, SEL _cmd, RGFW_window* win) { RGFW_UNUSED(_cmd); struct objc_super s = { self, class_getSuperclass(object_getClass(self)) }; - self = ((id (*)(struct objc_super*, SEL))objc_msgSendSuper)(&s, sel_registerName("init")); + + CGRect rect; + rect.origin.x = 0; + rect.origin.y = 0; + rect.size.width = (double)win->w; + rect.size.height = (double)win->h; + + self = ((id (*)(struct objc_super*, SEL, CGRect))objc_msgSendSuper)( + &s, sel_registerName("initWithFrame:"), rect + ); if (self != nil) { object_setInstanceVariable(self, "RGFW_window", win); @@ -12845,7 +12979,7 @@ static u32 RGFW_OnClose(id self) { object_getInstanceVariable(self, (const char*)"RGFW_window", (void**)&win); if (win == NULL) return true; - RGFW_windowQuitCallback(win); + RGFW_windowCloseCallback(win); return false; } @@ -12854,22 +12988,28 @@ static bool RGFW__osxAcceptsFirstResponder(void) { return true; } static bool RGFW__osxPerformKeyEquivalent(id event) { RGFW_UNUSED(event); return true; } static NSDragOperation RGFW__osxDraggingEntered(id self, SEL sel, id sender) { - RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + RGFW_UNUSED(sel); + RGFW_window* win = NULL; + object_getInstanceVariable(self, "RGFW_window", (void**)&win); + if (win == NULL) + return 0; + + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(sender, sel_registerName("draggingLocation")); + RGFW_dataDragCallback(win, RGFW_dataFile, RGFW_dndActionEnter, (i32) p.x, (i32) (win->h - p.y)); return NSDragOperationCopy; } static NSDragOperation RGFW__osxDraggingUpdated(id self, SEL sel, id sender) { RGFW_UNUSED(sel); RGFW_window* win = NULL; - object_getInstanceVariable(self, "RGFW_window", (void**)&win); if (win == NULL) return 0; if (!(win->internal.enabledEvents & RGFW_dataDragFlag)) return NSDragOperationCopy; NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(sender, sel_registerName("draggingLocation")); - RGFW_dataDragCallback(win, (i32) p.x, (i32) (win->h - p.y)); + RGFW_dataDragCallback(win, RGFW_dataFile, RGFW_dndActionMove, (i32) p.x, (i32) (win->h - p.y)); return NSDragOperationCopy; } static bool RGFW__osxPrepareForDragOperation(id self) { @@ -12885,12 +13025,22 @@ static bool RGFW__osxPrepareForDragOperation(id self) { return true; } -void RGFW__osxDraggingEnded(id self, SEL sel, id sender); -void RGFW__osxDraggingEnded(id self, SEL sel, id sender) { RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); return; } +static void RGFW__osxDraggingEnded(id self, SEL sel, id sender) { + RGFW_UNUSED(sel); + + RGFW_window* win = NULL; + object_getInstanceVariable(self, "RGFW_window", (void**)&win); + if (win == NULL) + return; + if (!(win->internal.enabledEvents & RGFW_dataDragFlag)) return; + + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(sender, sel_registerName("draggingLocation")); + RGFW_dataDragCallback(win, RGFW_dataFile, RGFW_dndActionExit, (i32) p.x, (i32) (win->h - p.y)); + return; +} static bool RGFW__osxPerformDragOperation(id self, SEL sel, id sender) { RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); - RGFW_window* win = NULL; object_getInstanceVariable(self, "RGFW_window", (void**)&win); if (win == NULL || (!(win->internal.enabledEvents & RGFW_dataDropFlag))) @@ -12908,7 +13058,7 @@ static bool RGFW__osxPerformDragOperation(id self, SEL sel, id sender) { /* Check if the pasteboard contains file URLs */ if (objc_msgSend_id_bool(types, sel_registerName("containsObject:"), fileURLsType) == 0) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errClipboard, "No files found on the pasteboard."); + RGFW_debugCallback(RGFW_typeError, RGFW_errClipboard, "No files found on the pasteboard."); return 0; } @@ -12918,17 +13068,14 @@ static bool RGFW__osxPerformDragOperation(id self, SEL sel, id sender) { if (count == 0) return 0; - char** files = (char**)(void*)_RGFW->files; - u32 i; for (i = 0; i < (u32)count; i++) { id fileURL = objc_msgSend_arr(fileURLs, sel_registerName("objectAtIndex:"), i); const char *filePath = ((const char* (*)(id, SEL))objc_msgSend)(fileURL, sel_registerName("UTF8String")); - RGFW_STRNCPY(files[i], filePath, RGFW_MAX_PATH - 1); - files[i][RGFW_MAX_PATH - 1] = '\0'; - } + int string_count = ((int (*)(id, SEL))objc_msgSend)(fileURL, sel_registerName("count")); - RGFW_dataDropCallback(win, files, (size_t)count); + RGFW_dataDropCallback(win, filePath, (size_t)string_count + 1, RGFW_dataFile); + } return false; } @@ -13038,7 +13185,7 @@ static void RGFW__osxWindowBecameKey(id self, SEL sel) { object_getInstanceVariable(self, "RGFW_window", (void**)&win); if (win == NULL) return; - RGFW_focusCallback(win, RGFW_TRUE); + RGFW_windowFocusCallback(win, RGFW_TRUE); } static void RGFW__osxWindowResignKey(id self, SEL sel) { @@ -13047,7 +13194,7 @@ static void RGFW__osxWindowResignKey(id self, SEL sel) { object_getInstanceVariable(self, "RGFW_window", (void**)&win); if (win == NULL) return; - RGFW_focusCallback(win, RGFW_FALSE); + RGFW_windowFocusCallback(win, RGFW_FALSE); } static void RGFW__osxDidWindowResize(id self, SEL _cmd, id notification) { @@ -13109,7 +13256,7 @@ static void RGFW__osxUpdateLayer(id self, SEL _cmd) { RGFW_window* win = NULL; object_getInstanceVariable(self, "RGFW_window", (void**)&win); if (win == NULL) return; - RGFW_windowRefreshCallback(win); + RGFW_windowRefreshCallback(win, 0, 0, win->w, win->h); } static void RGFW__osxDrawRect(id self, SEL _cmd, CGRect rect) { @@ -13118,7 +13265,9 @@ static void RGFW__osxDrawRect(id self, SEL _cmd, CGRect rect) { object_getInstanceVariable(self, "RGFW_window", (void**)&win); if (win == NULL) return; - RGFW_windowRefreshCallback(win); + float y = RGFW_cocoaYTransform((float)(rect.size.height - 1)); + + RGFW_windowRefreshCallback(win, (i32)rect.origin.x, (i32)y, (i32)rect.size.width, (i32)rect.size.height); } static void RGFW__osxMouseEntered(id self, SEL _cmd, id event) { @@ -13149,7 +13298,7 @@ static void RGFW__osxKeyDown(id self, SEL _cmd, id event) { u32 key = (u16)((u32(*)(id, SEL))objc_msgSend)(event, sel_registerName("keyCode")); RGFW_key value = (u8)RGFW_apiKeyToRGFW(key); - RGFW_bool repeat = RGFW_window_isKeyPressed(win, value); + RGFW_bool repeat = RGFW_isKeyDown(value); RGFW_keyCallback(win, value, win->internal.mod, repeat, 1); @@ -13171,9 +13320,8 @@ static void RGFW__osxKeyUp(id self, SEL _cmd, id event) { u32 key = (u16)((u32(*)(id, SEL))objc_msgSend)(event, sel_registerName("keyCode")); RGFW_key value = (u8)RGFW_apiKeyToRGFW(key); - RGFW_bool repeat = RGFW_window_isKeyDown(win, (u8)value); - RGFW_keyCallback(win, value, win->internal.mod, repeat, 0); + RGFW_keyCallback(win, value, win->internal.mod, RGFW_FALSE, 0); } static void RGFW__osxFlagsChanged(id self, SEL _cmd, id event) { @@ -13186,7 +13334,7 @@ static void RGFW__osxFlagsChanged(id self, SEL _cmd, id event) { RGFW_bool pressed = RGFW_FALSE; u32 flags = (u32)((u32(*)(id, SEL))objc_msgSend)(event, sel_registerName("modifierFlags")); - RGFW_updateKeyModsEx(win, + RGFW_keyUpdateKeyModsEx(win, ((u32)(flags & NSEventModifierFlagCapsLock) % 255), ((flags & NSEventModifierFlagNumericPad) % 255), ((flags & NSEventModifierFlagControl) % 255), @@ -13195,28 +13343,27 @@ static void RGFW__osxFlagsChanged(id self, SEL _cmd, id event) { ((flags & NSEventModifierFlagCommand) % 255), 0); u8 i; for (i = 0; i < 9; i++) - _RGFW->keyboard[i + RGFW_capsLock].prev = _RGFW->keyboard[i + RGFW_capsLock].current; + _RGFW->keyboard[i + RGFW_keyCapsLock].prev = _RGFW->keyboard[i + RGFW_keyCapsLock].current; for (i = 0; i < 5; i++) { u32 shift = (1 << (i + 16)); - RGFW_key key = i + RGFW_capsLock; - if ((flags & shift) && !RGFW_window_isKeyDown(win, (u8)key)) { + RGFW_key key = i + RGFW_keyCapsLock; + if ((flags & shift) && !RGFW_isKeyDown((u8)key)) { pressed = RGFW_TRUE; value = (u8)key; break; } - if (!(flags & shift) && RGFW_window_isKeyDown(win, (u8)key)) { + if (!(flags & shift) && RGFW_isKeyDown((u8)key)) { pressed = RGFW_FALSE; value = (u8)key; break; } } - RGFW_bool repeat = RGFW_window_isKeyDown(win, (u8)value); - RGFW_keyCallback(win, value, win->internal.mod, repeat, pressed); + RGFW_keyCallback(win, value, win->internal.mod, RGFW_isKeyDown(value) && pressed, pressed); - if (value != RGFW_capsLock) { - RGFW_keyCallback(win, value + 4, win->internal.mod, repeat, pressed); + if (value != RGFW_keyCapsLock) { + RGFW_keyCallback(win, value + 4, win->internal.mod, RGFW_isKeyDown(value + 4) && pressed, pressed); } } @@ -13232,7 +13379,8 @@ static void RGFW__osxMouseMoved(id self, SEL _cmd, id event) { CGFloat vecX = ((CGFloat(*)(id, SEL))abi_objc_msgSend_fpret)(event, sel_registerName("deltaX")); CGFloat vecY = ((CGFloat(*)(id, SEL))abi_objc_msgSend_fpret)(event, sel_registerName("deltaY")); - RGFW_mousePosCallback(win, (i32)p.x, (i32)(win->h - p.y), (float)vecX, (float)vecY); + RGFW_mouseMotionCallback(win, (i32)p.x, (i32)(win->h - p.y)); + RGFW_rawMotionCallback(win, (float)vecX, (float)vecY); } static void RGFW__osxMouseDown(id self, SEL _cmd, id event) { @@ -13345,117 +13493,117 @@ void* RGFW_getLayer_OSX(void) { void* RGFW_window_getWindow_OSX(RGFW_window* win) { return win->src.window; } void RGFW_initKeycodesPlatform(void) { - _RGFW->keycodes[0x1D] = RGFW_0; - _RGFW->keycodes[0x12] = RGFW_1; - _RGFW->keycodes[0x13] = RGFW_2; - _RGFW->keycodes[0x14] = RGFW_3; - _RGFW->keycodes[0x15] = RGFW_4; - _RGFW->keycodes[0x17] = RGFW_5; - _RGFW->keycodes[0x16] = RGFW_6; - _RGFW->keycodes[0x1A] = RGFW_7; - _RGFW->keycodes[0x1C] = RGFW_8; - _RGFW->keycodes[0x19] = RGFW_9; - _RGFW->keycodes[0x00] = RGFW_a; - _RGFW->keycodes[0x0B] = RGFW_b; - _RGFW->keycodes[0x08] = RGFW_c; - _RGFW->keycodes[0x02] = RGFW_d; - _RGFW->keycodes[0x0E] = RGFW_e; - _RGFW->keycodes[0x03] = RGFW_f; - _RGFW->keycodes[0x05] = RGFW_g; - _RGFW->keycodes[0x04] = RGFW_h; - _RGFW->keycodes[0x22] = RGFW_i; - _RGFW->keycodes[0x26] = RGFW_j; - _RGFW->keycodes[0x28] = RGFW_k; - _RGFW->keycodes[0x25] = RGFW_l; - _RGFW->keycodes[0x2E] = RGFW_m; - _RGFW->keycodes[0x2D] = RGFW_n; - _RGFW->keycodes[0x1F] = RGFW_o; - _RGFW->keycodes[0x23] = RGFW_p; - _RGFW->keycodes[0x0C] = RGFW_q; - _RGFW->keycodes[0x0F] = RGFW_r; - _RGFW->keycodes[0x01] = RGFW_s; - _RGFW->keycodes[0x11] = RGFW_t; - _RGFW->keycodes[0x20] = RGFW_u; - _RGFW->keycodes[0x09] = RGFW_v; - _RGFW->keycodes[0x0D] = RGFW_w; - _RGFW->keycodes[0x07] = RGFW_x; - _RGFW->keycodes[0x10] = RGFW_y; - _RGFW->keycodes[0x06] = RGFW_z; - _RGFW->keycodes[0x27] = RGFW_apostrophe; - _RGFW->keycodes[0x2A] = RGFW_backSlash; - _RGFW->keycodes[0x2B] = RGFW_comma; - _RGFW->keycodes[0x18] = RGFW_equals; - _RGFW->keycodes[0x32] = RGFW_backtick; - _RGFW->keycodes[0x21] = RGFW_bracket; - _RGFW->keycodes[0x1B] = RGFW_minus; - _RGFW->keycodes[0x2F] = RGFW_period; - _RGFW->keycodes[0x1E] = RGFW_closeBracket; - _RGFW->keycodes[0x29] = RGFW_semicolon; - _RGFW->keycodes[0x2C] = RGFW_slash; - _RGFW->keycodes[0x0A] = RGFW_world1; - _RGFW->keycodes[0x33] = RGFW_backSpace; - _RGFW->keycodes[0x39] = RGFW_capsLock; - _RGFW->keycodes[0x75] = RGFW_delete; - _RGFW->keycodes[0x7D] = RGFW_down; - _RGFW->keycodes[0x77] = RGFW_end; - _RGFW->keycodes[0x24] = RGFW_enter; - _RGFW->keycodes[0x35] = RGFW_escape; - _RGFW->keycodes[0x7A] = RGFW_F1; - _RGFW->keycodes[0x78] = RGFW_F2; - _RGFW->keycodes[0x63] = RGFW_F3; - _RGFW->keycodes[0x76] = RGFW_F4; - _RGFW->keycodes[0x60] = RGFW_F5; - _RGFW->keycodes[0x61] = RGFW_F6; - _RGFW->keycodes[0x62] = RGFW_F7; - _RGFW->keycodes[0x64] = RGFW_F8; - _RGFW->keycodes[0x65] = RGFW_F9; - _RGFW->keycodes[0x6D] = RGFW_F10; - _RGFW->keycodes[0x67] = RGFW_F11; - _RGFW->keycodes[0x6F] = RGFW_F12; - _RGFW->keycodes[0x69] = RGFW_printScreen; - _RGFW->keycodes[0x6B] = RGFW_F14; - _RGFW->keycodes[0x71] = RGFW_F15; - _RGFW->keycodes[0x6A] = RGFW_F16; - _RGFW->keycodes[0x40] = RGFW_F17; - _RGFW->keycodes[0x4F] = RGFW_F18; - _RGFW->keycodes[0x50] = RGFW_F19; - _RGFW->keycodes[0x5A] = RGFW_F20; - _RGFW->keycodes[0x73] = RGFW_home; - _RGFW->keycodes[0x72] = RGFW_insert; - _RGFW->keycodes[0x7B] = RGFW_left; - _RGFW->keycodes[0x3A] = RGFW_altL; - _RGFW->keycodes[0x3B] = RGFW_controlL; - _RGFW->keycodes[0x38] = RGFW_shiftL; - _RGFW->keycodes[0x37] = RGFW_superL; - _RGFW->keycodes[0x6E] = RGFW_menu; - _RGFW->keycodes[0x47] = RGFW_numLock; - _RGFW->keycodes[0x79] = RGFW_pageDown; - _RGFW->keycodes[0x74] = RGFW_pageUp; - _RGFW->keycodes[0x7C] = RGFW_right; - _RGFW->keycodes[0x3D] = RGFW_altR; - _RGFW->keycodes[0x3E] = RGFW_controlR; - _RGFW->keycodes[0x3C] = RGFW_shiftR; - _RGFW->keycodes[0x36] = RGFW_superR; - _RGFW->keycodes[0x31] = RGFW_space; - _RGFW->keycodes[0x30] = RGFW_tab; - _RGFW->keycodes[0x7E] = RGFW_up; - _RGFW->keycodes[0x52] = RGFW_kp0; - _RGFW->keycodes[0x53] = RGFW_kp1; - _RGFW->keycodes[0x54] = RGFW_kp2; - _RGFW->keycodes[0x55] = RGFW_kp3; - _RGFW->keycodes[0x56] = RGFW_kp4; - _RGFW->keycodes[0x57] = RGFW_kp5; - _RGFW->keycodes[0x58] = RGFW_kp6; - _RGFW->keycodes[0x59] = RGFW_kp7; - _RGFW->keycodes[0x5B] = RGFW_kp8; - _RGFW->keycodes[0x5C] = RGFW_kp9; - _RGFW->keycodes[0x45] = RGFW_kpSlash; - _RGFW->keycodes[0x41] = RGFW_kpPeriod; - _RGFW->keycodes[0x4B] = RGFW_kpSlash; - _RGFW->keycodes[0x4C] = RGFW_kpReturn; - _RGFW->keycodes[0x51] = RGFW_kpEqual; - _RGFW->keycodes[0x43] = RGFW_kpMultiply; - _RGFW->keycodes[0x4E] = RGFW_kpMinus; + _RGFW->keycodes[0x1D] = RGFW_key0; + _RGFW->keycodes[0x12] = RGFW_key1; + _RGFW->keycodes[0x13] = RGFW_key2; + _RGFW->keycodes[0x14] = RGFW_key3; + _RGFW->keycodes[0x15] = RGFW_key4; + _RGFW->keycodes[0x17] = RGFW_key5; + _RGFW->keycodes[0x16] = RGFW_key6; + _RGFW->keycodes[0x1A] = RGFW_key7; + _RGFW->keycodes[0x1C] = RGFW_key8; + _RGFW->keycodes[0x19] = RGFW_key9; + _RGFW->keycodes[0x00] = RGFW_keyA; + _RGFW->keycodes[0x0B] = RGFW_keyB; + _RGFW->keycodes[0x08] = RGFW_keyC; + _RGFW->keycodes[0x02] = RGFW_keyD; + _RGFW->keycodes[0x0E] = RGFW_keyE; + _RGFW->keycodes[0x03] = RGFW_keyF; + _RGFW->keycodes[0x05] = RGFW_keyG; + _RGFW->keycodes[0x04] = RGFW_keyH; + _RGFW->keycodes[0x22] = RGFW_keyI; + _RGFW->keycodes[0x26] = RGFW_keyJ; + _RGFW->keycodes[0x28] = RGFW_keyK; + _RGFW->keycodes[0x25] = RGFW_keyL; + _RGFW->keycodes[0x2E] = RGFW_keyM; + _RGFW->keycodes[0x2D] = RGFW_keyN; + _RGFW->keycodes[0x1F] = RGFW_keyO; + _RGFW->keycodes[0x23] = RGFW_keyP; + _RGFW->keycodes[0x0C] = RGFW_keyQ; + _RGFW->keycodes[0x0F] = RGFW_keyR; + _RGFW->keycodes[0x01] = RGFW_keyS; + _RGFW->keycodes[0x11] = RGFW_keyT; + _RGFW->keycodes[0x20] = RGFW_keyU; + _RGFW->keycodes[0x09] = RGFW_keyV; + _RGFW->keycodes[0x0D] = RGFW_keyW; + _RGFW->keycodes[0x07] = RGFW_keyX; + _RGFW->keycodes[0x10] = RGFW_keyY; + _RGFW->keycodes[0x06] = RGFW_keyZ; + _RGFW->keycodes[0x27] = RGFW_keyApostrophe; + _RGFW->keycodes[0x2A] = RGFW_keyBackSlash; + _RGFW->keycodes[0x2B] = RGFW_keyComma; + _RGFW->keycodes[0x18] = RGFW_keyEquals; + _RGFW->keycodes[0x32] = RGFW_keyBacktick; + _RGFW->keycodes[0x21] = RGFW_keyBracket; + _RGFW->keycodes[0x1B] = RGFW_keyMinus; + _RGFW->keycodes[0x2F] = RGFW_keyPeriod; + _RGFW->keycodes[0x1E] = RGFW_keyCloseBracket; + _RGFW->keycodes[0x29] = RGFW_keySemicolon; + _RGFW->keycodes[0x2C] = RGFW_keySlash; + _RGFW->keycodes[0x0A] = RGFW_keyWorld1; + _RGFW->keycodes[0x33] = RGFW_keyBackSpace; + _RGFW->keycodes[0x39] = RGFW_keyCapsLock; + _RGFW->keycodes[0x75] = RGFW_keyDelete; + _RGFW->keycodes[0x7D] = RGFW_keyDown; + _RGFW->keycodes[0x77] = RGFW_keyEnd; + _RGFW->keycodes[0x24] = RGFW_keyEnter; + _RGFW->keycodes[0x35] = RGFW_keyEscape; + _RGFW->keycodes[0x7A] = RGFW_keyF1; + _RGFW->keycodes[0x78] = RGFW_keyF2; + _RGFW->keycodes[0x63] = RGFW_keyF3; + _RGFW->keycodes[0x76] = RGFW_keyF4; + _RGFW->keycodes[0x60] = RGFW_keyF5; + _RGFW->keycodes[0x61] = RGFW_keyF6; + _RGFW->keycodes[0x62] = RGFW_keyF7; + _RGFW->keycodes[0x64] = RGFW_keyF8; + _RGFW->keycodes[0x65] = RGFW_keyF9; + _RGFW->keycodes[0x6D] = RGFW_keyF10; + _RGFW->keycodes[0x67] = RGFW_keyF11; + _RGFW->keycodes[0x6F] = RGFW_keyF12; + _RGFW->keycodes[0x69] = RGFW_keyPrintScreen; + _RGFW->keycodes[0x6B] = RGFW_keyF14; + _RGFW->keycodes[0x71] = RGFW_keyF15; + _RGFW->keycodes[0x6A] = RGFW_keyF16; + _RGFW->keycodes[0x40] = RGFW_keyF17; + _RGFW->keycodes[0x4F] = RGFW_keyF18; + _RGFW->keycodes[0x50] = RGFW_keyF19; + _RGFW->keycodes[0x5A] = RGFW_keyF20; + _RGFW->keycodes[0x73] = RGFW_keyHome; + _RGFW->keycodes[0x72] = RGFW_keyInsert; + _RGFW->keycodes[0x7B] = RGFW_keyLeft; + _RGFW->keycodes[0x3A] = RGFW_keyAltL; + _RGFW->keycodes[0x3B] = RGFW_keyControlL; + _RGFW->keycodes[0x38] = RGFW_keyShiftL; + _RGFW->keycodes[0x37] = RGFW_keySuperL; + _RGFW->keycodes[0x6E] = RGFW_keyMenu; + _RGFW->keycodes[0x47] = RGFW_keyNumLock; + _RGFW->keycodes[0x79] = RGFW_keyPageDown; + _RGFW->keycodes[0x74] = RGFW_keyPageUp; + _RGFW->keycodes[0x7C] = RGFW_keyRight; + _RGFW->keycodes[0x3D] = RGFW_keyAltR; + _RGFW->keycodes[0x3E] = RGFW_keyControlR; + _RGFW->keycodes[0x3C] = RGFW_keyShiftR; + _RGFW->keycodes[0x36] = RGFW_keySuperR; + _RGFW->keycodes[0x31] = RGFW_keySpace; + _RGFW->keycodes[0x30] = RGFW_keyTab; + _RGFW->keycodes[0x7E] = RGFW_keyUp; + _RGFW->keycodes[0x52] = RGFW_keyPad0; + _RGFW->keycodes[0x53] = RGFW_keyPad1; + _RGFW->keycodes[0x54] = RGFW_keyPad2; + _RGFW->keycodes[0x55] = RGFW_keyPad3; + _RGFW->keycodes[0x56] = RGFW_keyPad4; + _RGFW->keycodes[0x57] = RGFW_keyPad5; + _RGFW->keycodes[0x58] = RGFW_keyPad6; + _RGFW->keycodes[0x59] = RGFW_keyPad7; + _RGFW->keycodes[0x5B] = RGFW_keyPad8; + _RGFW->keycodes[0x5C] = RGFW_keyPad9; + _RGFW->keycodes[0x45] = RGFW_keyPadSlash; + _RGFW->keycodes[0x41] = RGFW_keyPadPeriod; + _RGFW->keycodes[0x4B] = RGFW_keyPadSlash; + _RGFW->keycodes[0x4C] = RGFW_keyPadReturn; + _RGFW->keycodes[0x51] = RGFW_keyPadEqual; + _RGFW->keycodes[0x43] = RGFW_keyPadMultiply; + _RGFW->keycodes[0x4E] = RGFW_keyPadMinus; } i32 RGFW_initPlatform(void) { @@ -13733,6 +13881,15 @@ RGFW_key RGFW_physicalToMappedKey(RGFW_key key) { return key; } +RGFW_bool RGFW_window_fetchSize(RGFW_window* win, i32* w, i32* h) { + NSRect content = ((NSRect(*)(id, SEL))abi_objc_msgSend_stret)((id)win->src.view, sel_registerName("frame")); + + win->w = (i32)content.size.width; + win->h = (i32)content.size.height; + + return RGFW_window_getSize(win, w, h); +} + void RGFW_pollEvents(void) { RGFW_resetPrevState(); @@ -13846,6 +14003,7 @@ void RGFW_window_maximize(RGFW_window* win) { win->internal.flags |= RGFW_windowMaximize; objc_msgSend_void_SEL(win->src.window, sel_registerName("zoom:"), NULL); + RGFW_window_fetchSize(win, NULL, NULL); } void RGFW_window_minimize(RGFW_window* win) { @@ -13956,10 +14114,40 @@ id NSCursor_arrowStr(const char* str); id NSCursor_arrowStr(const char* str) { void* nclass = objc_getClass("NSCursor"); SEL func = sel_registerName(str); - return (id) objc_msgSend_id(nclass, func); + id mouse = (id) objc_msgSend_id(nclass, func); + NSRetain(mouse); + return mouse; } -RGFW_mouse* RGFW_loadMouse(u8* data, i32 w, i32 h, RGFW_format format) { +RGFW_mouse* RGFW_createMouseStandard(RGFW_mouseIcon mouse) { + switch (mouse) { + case RGFW_mouseNormal: return NSCursor_arrowStr("arrowCursor"); + case RGFW_mouseArrow: return NSCursor_arrowStr("arrowCursor"); + case RGFW_mouseIbeam: return NSCursor_arrowStr("IBeamCursor"); + case RGFW_mouseCrosshair: return NSCursor_arrowStr("crosshairCursor"); + case RGFW_mousePointingHand: return NSCursor_arrowStr("pointingHandCursor"); + case RGFW_mouseResizeEW: return NSCursor_arrowStr("resizeLeftRightCursor"); + case RGFW_mouseResizeE: return NSCursor_arrowStr("resizeLeftRightCursor"); + case RGFW_mouseResizeW: return NSCursor_arrowStr("resizeLeftRightCursor"); + case RGFW_mouseResizeNS: return NSCursor_arrowStr("resizeUpDownCursor"); + case RGFW_mouseResizeN: return NSCursor_arrowStr("resizeUpDownCursor"); + case RGFW_mouseResizeS: return NSCursor_arrowStr("resizeUpDownCursor"); + case RGFW_mouseResizeNWSE: return NSCursor_arrowStr("_windowResizeNorthWestSouthEastCursor"); + case RGFW_mouseResizeNW: return NSCursor_arrowStr("_windowResizeNorthWestSouthEastCursor"); + case RGFW_mouseResizeSE: return NSCursor_arrowStr("_windowResizeNorthWestSouthEastCursor"); + case RGFW_mouseResizeNESW: return NSCursor_arrowStr("_windowResizeNorthEastSouthWestCursor"); + case RGFW_mouseResizeNE: return NSCursor_arrowStr("_windowResizeNorthEastSouthWestCursor"); + case RGFW_mouseResizeSW: return NSCursor_arrowStr("_windowResizeNorthEastSouthWestCursor"); + case RGFW_mouseResizeAll: return NSCursor_arrowStr("openHandCursor"); + case RGFW_mouseNotAllowed: return NSCursor_arrowStr("operationNotAllowedCursor"); + case RGFW_mouseWait: return NSCursor_arrowStr("arrowCursor"); + case RGFW_mouseProgress: return NSCursor_arrowStr("arrowCursor"); + default: return NULL; + } + return NULL; +} + +RGFW_mouse* RGFW_createMouse(u8* data, i32 w, i32 h, RGFW_format format) { id pool = objc_msgSend_class(objc_getClass("NSAutoreleasePool"), sel_registerName("alloc")); pool = objc_msgSend_id(pool, sel_registerName("init")); @@ -13988,11 +14176,12 @@ RGFW_mouse* RGFW_loadMouse(u8* data, i32 w, i32 h, RGFW_format format) { return (void*)cursor; } -void RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse) { +RGFW_bool RGFW_window_setMousePlatform(RGFW_window* win, RGFW_mouse* mouse) { RGFW_ASSERT(win != NULL); RGFW_ASSERT(mouse); CGDisplayShowCursor(kCGDirectMainDisplay); objc_msgSend_void((id)mouse, sel_registerName("set")); win->src.mouse = mouse; + return RGFW_TRUE; } void RGFW_freeMouse(RGFW_mouse* mouse) { @@ -14000,57 +14189,12 @@ void RGFW_freeMouse(RGFW_mouse* mouse) { NSRelease((id)mouse); } -RGFW_bool RGFW_window_setMouseDefault(RGFW_window* win) { - return RGFW_window_setMouseStandard(win, RGFW_mouseArrow); -} - void RGFW_window_showMouse(RGFW_window* win, RGFW_bool show) { RGFW_window_showMouseFlags(win, show); if (show) CGDisplayShowCursor(kCGDirectMainDisplay); else CGDisplayHideCursor(kCGDirectMainDisplay); } -RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, u8 stdMouse) { - const char* cursorSelectorStr; - switch (stdMouse) { - case RGFW_mouseNormal: cursorSelectorStr = "arrowCursor"; break; - case RGFW_mouseArrow: cursorSelectorStr = "arrowCursor"; break; - case RGFW_mouseIbeam: cursorSelectorStr = "IBeamCursor"; break; - case RGFW_mouseCrosshair: cursorSelectorStr = "crosshairCursor"; break; - case RGFW_mousePointingHand: cursorSelectorStr = "pointingHandCursor"; break; - case RGFW_mouseResizeEW: cursorSelectorStr = "resizeLeftRightCursor"; break; - case RGFW_mouseResizeE: cursorSelectorStr = "resizeLeftRightCursor"; break; - case RGFW_mouseResizeW: cursorSelectorStr = "resizeLeftRightCursor"; break; - case RGFW_mouseResizeNS: cursorSelectorStr = "resizeUpDownCursor"; break; - case RGFW_mouseResizeN: cursorSelectorStr = "resizeUpDownCursor"; break; - case RGFW_mouseResizeS: cursorSelectorStr = "resizeUpDownCursor"; break; - case RGFW_mouseResizeNWSE: cursorSelectorStr = "_windowResizeNorthWestSouthEastCursor"; break; - case RGFW_mouseResizeNW: cursorSelectorStr = "_windowResizeNorthWestSouthEastCursor"; break; - case RGFW_mouseResizeSE: cursorSelectorStr = "_windowResizeNorthWestSouthEastCursor"; break; - case RGFW_mouseResizeNESW: cursorSelectorStr = "_windowResizeNorthEastSouthWestCursor"; break; - case RGFW_mouseResizeNE: cursorSelectorStr = "_windowResizeNorthEastSouthWestCursor"; break; - case RGFW_mouseResizeSW: cursorSelectorStr = "_windowResizeNorthEastSouthWestCursor"; break; - case RGFW_mouseResizeAll: cursorSelectorStr = "openHandCursor"; break; - case RGFW_mouseNotAllowed: cursorSelectorStr = "operationNotAllowedCursor"; break; - case RGFW_mouseWait: cursorSelectorStr = "arrowCursor"; break; - case RGFW_mouseProgress: cursorSelectorStr = "arrowCursor"; break; - default: - return RGFW_FALSE; - } - - id mouse = NSCursor_arrowStr(cursorSelectorStr); - - if (mouse == NULL) - return RGFW_FALSE; - - RGFW_UNUSED(win); - CGDisplayShowCursor(kCGDirectMainDisplay); - objc_msgSend_void(mouse, sel_registerName("set")); - win->src.mouse = mouse; - - return RGFW_TRUE; -} - void RGFW_window_setRawMouseModePlatform(RGFW_window* win, RGFW_bool state) { RGFW_UNUSED(win); RGFW_UNUSED(state); } @@ -14164,14 +14308,17 @@ float RGFW_osx_getRefreshRate(CGDirectDisplayID display, CGDisplayModeRef mode) } void RGFW_pollMonitors(void) { - static CGDirectDisplayID displays[RGFW_MAX_MONITORS]; u32 count; - if (CGGetActiveDisplayList(RGFW_MAX_MONITORS, displays, &count) != kCGErrorSuccess) { + if (CGGetActiveDisplayList(0, NULL, &count) != kCGErrorSuccess) { + return; + } + + CGDirectDisplayID* displays = (CGDirectDisplayID*)RGFW_ALLOC(sizeof(CGDirectDisplayID) * count); + if (CGGetActiveDisplayList(count, displays, &count) != kCGErrorSuccess) { return; } - if (count > RGFW_MAX_MONITORS) count = RGFW_MAX_MONITORS; for (RGFW_monitorNode* node = _RGFW->monitors.list.head; node; node = node->next) { node->disconnected = RGFW_TRUE; @@ -14243,6 +14390,8 @@ void RGFW_pollMonitors(void) { RGFW_monitorCallback(_RGFW->root, &node->mon, RGFW_TRUE); } + RGFW_FREE(displays); + RGFW_monitors_refresh(); } @@ -14388,6 +14537,11 @@ RGFW_monitor* RGFW_window_getMonitor(RGFW_window* win) { } } + if (node == NULL) { + node = _RGFW->monitors.primary ? _RGFW->monitors.primary : _RGFW->monitors.list.head; + } + + if (node == NULL) return NULL; return &node->mon; } @@ -14499,7 +14653,7 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* void* format = (void*) ((id(*)(id, SEL, const u32*))objc_msgSend) (NSAlloc((id)objc_getClass("NSOpenGLPixelFormat")), sel_registerName("initWithAttributes:"), (u32*)attribs); if (format == NULL) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load pixel format for OpenGL"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to load pixel format for OpenGL"); assert(render_type_index + 3 < (sizeof(attribs) / sizeof(attribs[0]))); attribs[render_type_index] = NSOpenGLPFARendererID; @@ -14508,9 +14662,9 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* format = (void*) ((id(*)(id, SEL, const u32*))objc_msgSend) (NSAlloc((id)objc_getClass("NSOpenGLPixelFormat")), sel_registerName("initWithAttributes:"), (u32*)attribs); if (format == NULL) - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errOpenGLContext, "and loading software rendering OpenGL failed"); + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "and loading software rendering OpenGL failed"); else - RGFW_sendDebugInfo(RGFW_typeWarning, RGFW_warningOpenGL, "Switching to software rendering"); + RGFW_debugCallback(RGFW_typeWarning, RGFW_warningOpenGL, "Switching to software rendering"); } /* the pixel format can be passed directly to OpenGL context creation to create a context @@ -14548,7 +14702,7 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* RGFW_window_swapInterval_OpenGL(win, 0); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); return RGFW_TRUE; } @@ -14558,7 +14712,7 @@ void RGFW_window_deleteContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* ctx) objc_msgSend_void(ctx->ctx, sel_registerName("release")); win->src.ctx.native->ctx = NULL; - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); } void RGFW_window_makeCurrentContext_OpenGL(RGFW_window* win) { @@ -14619,7 +14773,7 @@ VkResult RGFW_window_createSurface_Vulkan(RGFW_window* win, VkInstance instance, id nsView = (id)win->src.view; if (!nsView) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errMetal, "NSView is NULL for macOS window"); + RGFW_debugCallback(RGFW_typeError, RGFW_errMetal, "NSView is NULL for macOS window"); return -1; } @@ -14638,12 +14792,12 @@ VkResult RGFW_window_createSurface_Vulkan(RGFW_window* win, VkInstance instance, VkMetalSurfaceCreateInfoEXT macos; macos.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; macos.slayer = metalLayer; - RGFW_MEMSET(&macos, 0, sizeof(macos)); + RGFW_MEMZERO(&macos, sizeof(macos)); result = vkCreateMacOSSurfaceMVK(instance, &macos, NULL, surface); */ VkMacOSSurfaceCreateInfoMVK macos; - RGFW_MEMSET(&macos, 0, sizeof(macos)); + RGFW_MEMZERO(&macos, sizeof(macos)); macos.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; macos.pView = nsView; @@ -14660,7 +14814,7 @@ WGPUSurface RGFW_window_createSurface_WebGPU(RGFW_window* window, WGPUInstance i WGPUSurfaceDescriptor surfaceDesc = {0}; id* nsView = (id*)window->src.view; if (!nsView) { - RGFW_sendDebugInfo(RGFW_typeError, RGFW_errMetal, "NSView is NULL for macOS window"); + RGFW_debugCallback(RGFW_typeError, RGFW_errMetal, "NSView is NULL for macOS window"); return NULL; } @@ -14746,20 +14900,21 @@ EM_BOOL Emscripten_on_fullscreenchange(int eventType, const EmscriptenFullscreen EM_BOOL Emscripten_on_focusin(int eventType, const EmscriptenFocusEvent* E, void* userData) { RGFW_UNUSED(eventType); RGFW_UNUSED(userData); RGFW_UNUSED(E); - RGFW_focusCallback(_RGFW->root, 1); + RGFW_windowFocusCallback(_RGFW->root, 1); return EM_TRUE; } EM_BOOL Emscripten_on_focusout(int eventType, const EmscriptenFocusEvent* E, void* userData) { RGFW_UNUSED(eventType); RGFW_UNUSED(userData); RGFW_UNUSED(E); - RGFW_focusCallback(_RGFW->root, 0); + RGFW_windowFocusCallback(_RGFW->root, 0); return EM_TRUE; } EM_BOOL Emscripten_on_mousemove(int eventType, const EmscriptenMouseEvent* E, void* userData) { RGFW_UNUSED(eventType); RGFW_UNUSED(userData); - RGFW_mousePosCallback(_RGFW->root, E->targetX, E->targetY, E->movementX, E->movementY); + RGFW_mouseMotionCallback(_RGFW->root, E->targetX, E->targetY); + RGFW_rawMotionCallback(_RGFW->root, E->movementX, E->movementY); return EM_TRUE; } @@ -14800,7 +14955,8 @@ EM_BOOL Emscripten_on_touchstart(int eventType, const EmscriptenTouchEvent* E, v size_t i; for (i = 0; i < (size_t)E->numTouches; i++) { - RGFW_mousePosCallback(_RGFW->root, E->touches[i].targetX, E->touches[i].targetY, 0, 0); + RGFW_mouseMotionCallback(_RGFW->root, E->touches[i].targetX, E->touches[i].targetY); + RGFW_rawMotionCallback(_RGFW->root, 0, 0); RGFW_mouseButtonCallback(_RGFW->root, RGFW_mouseLeft, 1); } @@ -14810,11 +14966,12 @@ EM_BOOL Emscripten_on_touchstart(int eventType, const EmscriptenTouchEvent* E, v EM_BOOL Emscripten_on_touchmove(int eventType, const EmscriptenTouchEvent* E, void* userData) { RGFW_UNUSED(eventType); RGFW_UNUSED(userData); - if (!(_RGFW->root->internal.enabledEvents & RGFW_mousePosChangedFlag)) return EM_TRUE; + if (!(_RGFW->root->internal.enabledEvents & RGFW_mouseMotionFlag)) return EM_TRUE; size_t i; for (i = 0; i < (size_t)E->numTouches; i++) { - RGFW_mousePosCallback(_RGFW->root, E->touches[i].targetX, E->touches[i].targetY, 0, 0); + RGFW_mouseMotionCallback(_RGFW->root, E->touches[i].targetX, E->touches[i].targetY); + RGFW_rawMotionCallback(_RGFW->root, 0, 0); } return EM_TRUE; } @@ -14826,7 +14983,8 @@ EM_BOOL Emscripten_on_touchend(int eventType, const EmscriptenTouchEvent* E, voi size_t i; for (i = 0; i < (size_t)E->numTouches; i++) { - RGFW_mousePosCallback(_RGFW->root, E->touches[i].targetX, E->touches[i].targetY, 0, 0); + RGFW_mouseMotionCallback(_RGFW->root, E->touches[i].targetX, E->touches[i].targetY); + RGFW_rawMotionCallback(_RGFW->root, 0, 0); RGFW_mouseButtonCallback(_RGFW->root, RGFW_mouseLeft, 0); } return EM_TRUE; @@ -14844,20 +15002,22 @@ void EMSCRIPTEN_KEEPALIVE RGFW_handleKeyEvent(char* code, u32 codepoint, RGFW_bo u32 physicalKey = RGFW_WASMPhysicalToRGFW(hash); - RGFW_keyCallback(_RGFW->root, physicalKey, _RGFW->root->internal.mod, RGFW_window_isKeyDown(_RGFW->root, (u8)physicalKey), press); + RGFW_keyCallback(_RGFW->root, physicalKey, _RGFW->root->internal.mod, RGFW_isKeyDown((u8)physicalKey) && press, press); if (press) { ; RGFW_keyCharCallback(_RGFW->root, codepoint); } } void EMSCRIPTEN_KEEPALIVE RGFW_handleKeyMods(RGFW_bool capital, RGFW_bool numlock, RGFW_bool control, RGFW_bool alt, RGFW_bool shift, RGFW_bool super, RGFW_bool scroll) { - RGFW_updateKeyModsEx(_RGFW->root, capital, numlock, control, alt, shift, super, scroll); + RGFW_keyUpdateKeyModsEx(_RGFW->root, capital, numlock, control, alt, shift, super, scroll); } -void EMSCRIPTEN_KEEPALIVE Emscripten_onDrop(size_t count) { - RGFW_dataDropCallback(_RGFW->root, _RGFW->files, count); +void EMSCRIPTEN_KEEPALIVE Emscripten_onDrop(char* file, size_t size) { + RGFW_dataDropCallback(_RGFW->root, file, size, RGFW_dataFile); } +void EMSCRIPTEN_KEEPALIVE RGFW_webFree(void* ptr) { free(ptr); } + void RGFW_stopCheckEvents(void) { _RGFW->stopCheckEvents_bool = RGFW_TRUE; } @@ -14884,14 +15044,6 @@ void RGFW_window_blitSurface(RGFW_window* win, RGFW_surface* surface) { void RGFW_surface_freePtr(RGFW_surface* surface) { } -void EMSCRIPTEN_KEEPALIVE RGFW_makeSetValue(size_t index, char* file) { - /* This seems like a terrible idea, don't replicate this unless you hate yourself or the OS */ - /* TODO: find a better way to do this - */ - RGFW_STRNCPY((char*)_RGFW->files[index], file, RGFW_MAX_PATH - 1); - _RGFW->files[index][RGFW_MAX_PATH - 1] = '\0'; -} - #include #include #include @@ -14909,117 +15061,148 @@ void EMSCRIPTEN_KEEPALIVE RGFW_writeFile(const char *path, const char *data, siz } void RGFW_initKeycodesPlatform(void) { - _RGFW->keycodes[DOM_VK_BACK_QUOTE] = RGFW_backtick; - _RGFW->keycodes[DOM_VK_0] = RGFW_0; - _RGFW->keycodes[DOM_VK_1] = RGFW_1; - _RGFW->keycodes[DOM_VK_2] = RGFW_2; - _RGFW->keycodes[DOM_VK_3] = RGFW_3; - _RGFW->keycodes[DOM_VK_4] = RGFW_4; - _RGFW->keycodes[DOM_VK_5] = RGFW_5; - _RGFW->keycodes[DOM_VK_6] = RGFW_6; - _RGFW->keycodes[DOM_VK_7] = RGFW_7; - _RGFW->keycodes[DOM_VK_8] = RGFW_8; - _RGFW->keycodes[DOM_VK_9] = RGFW_9; - _RGFW->keycodes[DOM_VK_SPACE] = RGFW_space; - _RGFW->keycodes[DOM_VK_A] = RGFW_a; - _RGFW->keycodes[DOM_VK_B] = RGFW_b; - _RGFW->keycodes[DOM_VK_C] = RGFW_c; - _RGFW->keycodes[DOM_VK_D] = RGFW_d; - _RGFW->keycodes[DOM_VK_E] = RGFW_e; - _RGFW->keycodes[DOM_VK_F] = RGFW_f; - _RGFW->keycodes[DOM_VK_G] = RGFW_g; - _RGFW->keycodes[DOM_VK_H] = RGFW_h; - _RGFW->keycodes[DOM_VK_I] = RGFW_i; - _RGFW->keycodes[DOM_VK_J] = RGFW_j; - _RGFW->keycodes[DOM_VK_K] = RGFW_k; - _RGFW->keycodes[DOM_VK_L] = RGFW_l; - _RGFW->keycodes[DOM_VK_M] = RGFW_m; - _RGFW->keycodes[DOM_VK_N] = RGFW_n; - _RGFW->keycodes[DOM_VK_O] = RGFW_o; - _RGFW->keycodes[DOM_VK_P] = RGFW_p; - _RGFW->keycodes[DOM_VK_Q] = RGFW_q; - _RGFW->keycodes[DOM_VK_R] = RGFW_r; - _RGFW->keycodes[DOM_VK_S] = RGFW_s; - _RGFW->keycodes[DOM_VK_T] = RGFW_t; - _RGFW->keycodes[DOM_VK_U] = RGFW_u; - _RGFW->keycodes[DOM_VK_V] = RGFW_v; - _RGFW->keycodes[DOM_VK_W] = RGFW_w; - _RGFW->keycodes[DOM_VK_X] = RGFW_x; - _RGFW->keycodes[DOM_VK_Y] = RGFW_y; - _RGFW->keycodes[DOM_VK_Z] = RGFW_z; - _RGFW->keycodes[DOM_VK_PERIOD] = RGFW_period; - _RGFW->keycodes[DOM_VK_COMMA] = RGFW_comma; - _RGFW->keycodes[DOM_VK_SLASH] = RGFW_slash; - _RGFW->keycodes[DOM_VK_OPEN_BRACKET] = RGFW_bracket; - _RGFW->keycodes[DOM_VK_CLOSE_BRACKET] = RGFW_closeBracket; - _RGFW->keycodes[DOM_VK_SEMICOLON] = RGFW_semicolon; - _RGFW->keycodes[DOM_VK_QUOTE] = RGFW_apostrophe; - _RGFW->keycodes[DOM_VK_BACK_SLASH] = RGFW_backSlash; - _RGFW->keycodes[DOM_VK_RETURN] = RGFW_return; - _RGFW->keycodes[DOM_VK_DELETE] = RGFW_delete; - _RGFW->keycodes[DOM_VK_NUM_LOCK] = RGFW_numLock; - _RGFW->keycodes[DOM_VK_DIVIDE] = RGFW_kpSlash; - _RGFW->keycodes[DOM_VK_MULTIPLY] = RGFW_kpMultiply; - _RGFW->keycodes[DOM_VK_SUBTRACT] = RGFW_kpMinus; - _RGFW->keycodes[DOM_VK_NUMPAD1] = RGFW_kp1; - _RGFW->keycodes[DOM_VK_NUMPAD2] = RGFW_kp2; - _RGFW->keycodes[DOM_VK_NUMPAD3] = RGFW_kp3; - _RGFW->keycodes[DOM_VK_NUMPAD4] = RGFW_kp4; - _RGFW->keycodes[DOM_VK_NUMPAD5] = RGFW_kp5; - _RGFW->keycodes[DOM_VK_NUMPAD6] = RGFW_kp6; - _RGFW->keycodes[DOM_VK_NUMPAD9] = RGFW_kp9; - _RGFW->keycodes[DOM_VK_NUMPAD0] = RGFW_kp0; - _RGFW->keycodes[DOM_VK_DECIMAL] = RGFW_kpPeriod; - _RGFW->keycodes[DOM_VK_RETURN] = RGFW_kpReturn; - _RGFW->keycodes[DOM_VK_HYPHEN_MINUS] = RGFW_minus; - _RGFW->keycodes[DOM_VK_EQUALS] = RGFW_equals; - _RGFW->keycodes[DOM_VK_BACK_SPACE] = RGFW_backSpace; - _RGFW->keycodes[DOM_VK_TAB] = RGFW_tab; - _RGFW->keycodes[DOM_VK_CAPS_LOCK] = RGFW_capsLock; - _RGFW->keycodes[DOM_VK_SHIFT] = RGFW_shiftL; - _RGFW->keycodes[DOM_VK_CONTROL] = RGFW_controlL; - _RGFW->keycodes[DOM_VK_ALT] = RGFW_altL; - _RGFW->keycodes[DOM_VK_META] = RGFW_superL; - _RGFW->keycodes[DOM_VK_F1] = RGFW_F1; - _RGFW->keycodes[DOM_VK_F2] = RGFW_F2; - _RGFW->keycodes[DOM_VK_F3] = RGFW_F3; - _RGFW->keycodes[DOM_VK_F4] = RGFW_F4; - _RGFW->keycodes[DOM_VK_F5] = RGFW_F5; - _RGFW->keycodes[DOM_VK_F6] = RGFW_F6; - _RGFW->keycodes[DOM_VK_F7] = RGFW_F7; - _RGFW->keycodes[DOM_VK_F8] = RGFW_F8; - _RGFW->keycodes[DOM_VK_F9] = RGFW_F9; - _RGFW->keycodes[DOM_VK_F10] = RGFW_F10; - _RGFW->keycodes[DOM_VK_F11] = RGFW_F11; - _RGFW->keycodes[DOM_VK_F12] = RGFW_F12; - _RGFW->keycodes[DOM_VK_UP] = RGFW_up; - _RGFW->keycodes[DOM_VK_DOWN] = RGFW_down; - _RGFW->keycodes[DOM_VK_LEFT] = RGFW_left; - _RGFW->keycodes[DOM_VK_RIGHT] = RGFW_right; - _RGFW->keycodes[DOM_VK_INSERT] = RGFW_insert; - _RGFW->keycodes[DOM_VK_END] = RGFW_end; - _RGFW->keycodes[DOM_VK_PAGE_UP] = RGFW_pageUp; - _RGFW->keycodes[DOM_VK_PAGE_DOWN] = RGFW_pageDown; - _RGFW->keycodes[DOM_VK_ESCAPE] = RGFW_escape; - _RGFW->keycodes[DOM_VK_HOME] = RGFW_home; - _RGFW->keycodes[DOM_VK_SCROLL_LOCK] = RGFW_scrollLock; - _RGFW->keycodes[DOM_VK_PRINTSCREEN] = RGFW_printScreen; - _RGFW->keycodes[DOM_VK_PAUSE] = RGFW_pause; - _RGFW->keycodes[DOM_VK_F13] = RGFW_F13; - _RGFW->keycodes[DOM_VK_F14] = RGFW_F14; - _RGFW->keycodes[DOM_VK_F15] = RGFW_F15; - _RGFW->keycodes[DOM_VK_F16] = RGFW_F16; - _RGFW->keycodes[DOM_VK_F17] = RGFW_F17; - _RGFW->keycodes[DOM_VK_F18] = RGFW_F18; - _RGFW->keycodes[DOM_VK_F19] = RGFW_F19; - _RGFW->keycodes[DOM_VK_F20] = RGFW_F20; - _RGFW->keycodes[DOM_VK_F21] = RGFW_F21; - _RGFW->keycodes[DOM_VK_F22] = RGFW_F22; - _RGFW->keycodes[DOM_VK_F23] = RGFW_F23; - _RGFW->keycodes[DOM_VK_F24] = RGFW_F24; + _RGFW->keycodes[DOM_VK_BACK_QUOTE] = RGFW_keyBacktick; + _RGFW->keycodes[DOM_VK_0] = RGFW_key0; + _RGFW->keycodes[DOM_VK_1] = RGFW_key1; + _RGFW->keycodes[DOM_VK_2] = RGFW_key2; + _RGFW->keycodes[DOM_VK_3] = RGFW_key3; + _RGFW->keycodes[DOM_VK_4] = RGFW_key4; + _RGFW->keycodes[DOM_VK_5] = RGFW_key5; + _RGFW->keycodes[DOM_VK_6] = RGFW_key6; + _RGFW->keycodes[DOM_VK_7] = RGFW_key7; + _RGFW->keycodes[DOM_VK_8] = RGFW_key8; + _RGFW->keycodes[DOM_VK_9] = RGFW_key9; + _RGFW->keycodes[DOM_VK_SPACE] = RGFW_keySpace; + _RGFW->keycodes[DOM_VK_A] = RGFW_keyA; + _RGFW->keycodes[DOM_VK_B] = RGFW_keyB; + _RGFW->keycodes[DOM_VK_C] = RGFW_keyC; + _RGFW->keycodes[DOM_VK_D] = RGFW_keyD; + _RGFW->keycodes[DOM_VK_E] = RGFW_keyE; + _RGFW->keycodes[DOM_VK_F] = RGFW_keyF; + _RGFW->keycodes[DOM_VK_G] = RGFW_keyG; + _RGFW->keycodes[DOM_VK_H] = RGFW_keyH; + _RGFW->keycodes[DOM_VK_I] = RGFW_keyI; + _RGFW->keycodes[DOM_VK_J] = RGFW_keyJ; + _RGFW->keycodes[DOM_VK_K] = RGFW_keyK; + _RGFW->keycodes[DOM_VK_L] = RGFW_keyL; + _RGFW->keycodes[DOM_VK_M] = RGFW_keyM; + _RGFW->keycodes[DOM_VK_N] = RGFW_keyN; + _RGFW->keycodes[DOM_VK_O] = RGFW_keyO; + _RGFW->keycodes[DOM_VK_P] = RGFW_keyP; + _RGFW->keycodes[DOM_VK_Q] = RGFW_keyQ; + _RGFW->keycodes[DOM_VK_R] = RGFW_keyR; + _RGFW->keycodes[DOM_VK_S] = RGFW_keyS; + _RGFW->keycodes[DOM_VK_T] = RGFW_keyT; + _RGFW->keycodes[DOM_VK_U] = RGFW_keyU; + _RGFW->keycodes[DOM_VK_V] = RGFW_keyV; + _RGFW->keycodes[DOM_VK_W] = RGFW_keyW; + _RGFW->keycodes[DOM_VK_X] = RGFW_keyX; + _RGFW->keycodes[DOM_VK_Y] = RGFW_keyY; + _RGFW->keycodes[DOM_VK_Z] = RGFW_keyZ; + _RGFW->keycodes[DOM_VK_PERIOD] = RGFW_keyPeriod; + _RGFW->keycodes[DOM_VK_COMMA] = RGFW_keyComma; + _RGFW->keycodes[DOM_VK_SLASH] = RGFW_keySlash; + _RGFW->keycodes[DOM_VK_OPEN_BRACKET] = RGFW_keyBracket; + _RGFW->keycodes[DOM_VK_CLOSE_BRACKET] = RGFW_keyCloseBracket; + _RGFW->keycodes[DOM_VK_SEMICOLON] = RGFW_keySemicolon; + _RGFW->keycodes[DOM_VK_QUOTE] = RGFW_keyApostrophe; + _RGFW->keycodes[DOM_VK_BACK_SLASH] = RGFW_keyBackSlash; + _RGFW->keycodes[DOM_VK_RETURN] = RGFW_keyReturn; + _RGFW->keycodes[DOM_VK_DELETE] = RGFW_keyDelete; + _RGFW->keycodes[DOM_VK_NUM_LOCK] = RGFW_keyNumLock; + _RGFW->keycodes[DOM_VK_DIVIDE] = RGFW_keyPadSlash; + _RGFW->keycodes[DOM_VK_MULTIPLY] = RGFW_keyPadMultiply; + _RGFW->keycodes[DOM_VK_SUBTRACT] = RGFW_keyPadMinus; + _RGFW->keycodes[DOM_VK_NUMPAD1] = RGFW_keyPad1; + _RGFW->keycodes[DOM_VK_NUMPAD2] = RGFW_keyPad2; + _RGFW->keycodes[DOM_VK_NUMPAD3] = RGFW_keyPad3; + _RGFW->keycodes[DOM_VK_NUMPAD4] = RGFW_keyPad4; + _RGFW->keycodes[DOM_VK_NUMPAD5] = RGFW_keyPad5; + _RGFW->keycodes[DOM_VK_NUMPAD6] = RGFW_keyPad6; + _RGFW->keycodes[DOM_VK_NUMPAD9] = RGFW_keyPad9; + _RGFW->keycodes[DOM_VK_NUMPAD0] = RGFW_keyPad0; + _RGFW->keycodes[DOM_VK_DECIMAL] = RGFW_keyPadPeriod; + _RGFW->keycodes[DOM_VK_RETURN] = RGFW_keyPadReturn; + _RGFW->keycodes[DOM_VK_HYPHEN_MINUS] = RGFW_keyMinus; + _RGFW->keycodes[DOM_VK_EQUALS] = RGFW_keyEquals; + _RGFW->keycodes[DOM_VK_BACK_SPACE] = RGFW_keyBackSpace; + _RGFW->keycodes[DOM_VK_TAB] = RGFW_keyTab; + _RGFW->keycodes[DOM_VK_CAPS_LOCK] = RGFW_keyCapsLock; + _RGFW->keycodes[DOM_VK_SHIFT] = RGFW_keyShiftL; + _RGFW->keycodes[DOM_VK_CONTROL] = RGFW_keyControlL; + _RGFW->keycodes[DOM_VK_ALT] = RGFW_keyAltL; + _RGFW->keycodes[DOM_VK_META] = RGFW_keySuperL; + _RGFW->keycodes[DOM_VK_F1] = RGFW_keyF1; + _RGFW->keycodes[DOM_VK_F2] = RGFW_keyF2; + _RGFW->keycodes[DOM_VK_F3] = RGFW_keyF3; + _RGFW->keycodes[DOM_VK_F4] = RGFW_keyF4; + _RGFW->keycodes[DOM_VK_F5] = RGFW_keyF5; + _RGFW->keycodes[DOM_VK_F6] = RGFW_keyF6; + _RGFW->keycodes[DOM_VK_F7] = RGFW_keyF7; + _RGFW->keycodes[DOM_VK_F8] = RGFW_keyF8; + _RGFW->keycodes[DOM_VK_F9] = RGFW_keyF9; + _RGFW->keycodes[DOM_VK_F10] = RGFW_keyF10; + _RGFW->keycodes[DOM_VK_F11] = RGFW_keyF11; + _RGFW->keycodes[DOM_VK_F12] = RGFW_keyF12; + _RGFW->keycodes[DOM_VK_UP] = RGFW_keyUp; + _RGFW->keycodes[DOM_VK_DOWN] = RGFW_keyDown; + _RGFW->keycodes[DOM_VK_LEFT] = RGFW_keyLeft; + _RGFW->keycodes[DOM_VK_RIGHT] = RGFW_keyRight; + _RGFW->keycodes[DOM_VK_INSERT] = RGFW_keyInsert; + _RGFW->keycodes[DOM_VK_END] = RGFW_keyEnd; + _RGFW->keycodes[DOM_VK_PAGE_UP] = RGFW_keyPageUp; + _RGFW->keycodes[DOM_VK_PAGE_DOWN] = RGFW_keyPageDown; + _RGFW->keycodes[DOM_VK_ESCAPE] = RGFW_keyEscape; + _RGFW->keycodes[DOM_VK_HOME] = RGFW_keyHome; + _RGFW->keycodes[DOM_VK_SCROLL_LOCK] = RGFW_keyScrollLock; + _RGFW->keycodes[DOM_VK_PRINTSCREEN] = RGFW_keyPrintScreen; + _RGFW->keycodes[DOM_VK_PAUSE] = RGFW_keyPause; + _RGFW->keycodes[DOM_VK_F13] = RGFW_keyF13; + _RGFW->keycodes[DOM_VK_F14] = RGFW_keyF14; + _RGFW->keycodes[DOM_VK_F15] = RGFW_keyF15; + _RGFW->keycodes[DOM_VK_F16] = RGFW_keyF16; + _RGFW->keycodes[DOM_VK_F17] = RGFW_keyF17; + _RGFW->keycodes[DOM_VK_F18] = RGFW_keyF18; + _RGFW->keycodes[DOM_VK_F19] = RGFW_keyF19; + _RGFW->keycodes[DOM_VK_F20] = RGFW_keyF20; + _RGFW->keycodes[DOM_VK_F21] = RGFW_keyF21; + _RGFW->keycodes[DOM_VK_F22] = RGFW_keyF22; + _RGFW->keycodes[DOM_VK_F23] = RGFW_keyF23; + _RGFW->keycodes[DOM_VK_F24] = RGFW_keyF24; } -i32 RGFW_initPlatform(void) { return 0; } +i32 RGFW_initPlatform(void) { + RGFW_monitorNode* node = NULL; + RGFW_monitor monitor; + + monitor.name[0] = '\0'; + + monitor.x = 0; + monitor.y = 0; + + monitor.pixelRatio = EM_ASM_DOUBLE({return window.devicePixelRatio || 1;}); + monitor.mode.w = EM_ASM_INT({return window.innerWidth || 0;}); + monitor.mode.h = EM_ASM_INT({return window.innerHeight || 0;}); + + monitor.physW = (float)RGFW_ROUND((float)monitor.mode.w * monitor.pixelRatio); + monitor.physH = (float)RGFW_ROUND((float)monitor.mode.h * monitor.pixelRatio); + + float dpi = 96.0f * monitor.pixelRatio; + monitor.scaleX = dpi / 96.0f; + monitor.scaleY = dpi / 96.0f; + + RGFW_splitBPP(32, &monitor.mode); + + monitor.mode.refreshRate = 0; + + node = RGFW_monitors_add(&monitor); + if (node != NULL) { + _RGFW->monitors.primary = node; + RGFW_monitorCallback(_RGFW->root, &node->mon, RGFW_TRUE); + } + + return 0; +} RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, RGFW_window* win) { emscripten_set_canvas_element_size("#canvas", win->w, win->h); @@ -15055,7 +15238,7 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, } Module._RGFW_handleKeyEvent(code, codepoint, 1); - _free(code); + Module._RGFW_webFree(code); }, true); window.addEventListener("keyup", @@ -15063,7 +15246,7 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, var code = stringToNewUTF8(event.code); Module._RGFW_handleKeyMods(event.getModifierState("CapsLock"), event.getModifierState("NumLock"), event.getModifierState("Control"), event.getModifierState("Alt"), event.getModifierState("Shift"), event.getModifierState("Meta"), event.getModifierState("ScrollLock")); Module._RGFW_handleKeyEvent(code, 0, 0); - _free(code); + Module._RGFW_webFree(code); }, true); }); @@ -15075,7 +15258,6 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, if (e.dataTransfer.file < 0) return; - var filenamesArray = []; var count = e.dataTransfer.files.length; /* Read and save the files to emscripten's files */ @@ -15100,19 +15282,12 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, }; reader.readAsArrayBuffer(file); - /* This works weird on modern OpenGL */ var filename = stringToNewUTF8(path); - filenamesArray.push(filename); - - Module._RGFW_makeSetValue(i, filename); + Module._Emscripten_onDrop(filename, path.length + 1); + free(filename); } - Module._Emscripten_onDrop(count); - - for (var i = 0; i < count; i++) { - _free(filenamesArray[i]); - } }, true); canvas.addEventListener('dragover', function(e) { e.preventDefault(); return false; }, true); @@ -15125,9 +15300,18 @@ RGFW_key RGFW_physicalToMappedKey(RGFW_key key) { return key; } +RGFW_bool RGFW_window_fetchSize(RGFW_window* win, i32* w, i32* h) { + return RGFW_window_getSize(win, w, h); +} + void RGFW_pollEvents(void) { + static int using_asyncify = -1; + if (using_asyncify == -1) using_asyncify = EM_ASM_INT({ return 'Asyncify' in Module; }); + RGFW_resetPrevState(); - emscripten_sleep(0); + if (using_asyncify) { + emscripten_sleep(0); + } } void RGFW_window_resize(RGFW_window* win, i32 w, i32 h) { @@ -15135,16 +15319,7 @@ void RGFW_window_resize(RGFW_window* win, i32 w, i32 h) { emscripten_set_canvas_element_size("#canvas", w, h); } -/* NOTE: I don't know if this is possible */ -void RGFW_window_moveMouse(RGFW_window* win, i32 x, i32 y) { RGFW_UNUSED(win); RGFW_UNUSED(x); RGFW_UNUSED(y); } -/* this one might be possible but it looks iffy */ -RGFW_mouse* RGFW_loadMouse(u8* data, i32 w, i32 h, RGFW_format format) { RGFW_UNUSED(data); RGFW_UNUSED(w); RGFW_UNUSED(h); RGFW_UNUSED(format); return NULL; } - -void RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse) { RGFW_UNUSED(win); RGFW_UNUSED(mouse); } -void RGFW_freeMouse(RGFW_mouse* mouse) { RGFW_UNUSED(mouse); } - -RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, u8 mouse) { - RGFW_UNUSED(win); +RGFW_mouse* RGFW_createMouseStandard(RGFW_mouseIcon mouse) { char* cursorName = NULL; switch (mouse) { @@ -15169,16 +15344,25 @@ RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, u8 mouse) { case RGFW_mouseNotAllowed: cursorName = (char*)"not-allowed"; break; case RGFW_mouseWait: cursorName = (char*)"wait"; break; case RGFW_mouseProgress: cursorName = (char*)"progress"; break; - default: return RGFW_FALSE; + default: return NULL; } - EM_ASM( { document.getElementById("canvas").style.cursor = UTF8ToString($0); }, cursorName); - return RGFW_TRUE; + return (RGFW_mouse*)cursorName; } -RGFW_bool RGFW_window_setMouseDefault(RGFW_window* win) { - return RGFW_window_setMouseStandard(win, RGFW_mouseNormal); +/* NOTE: I don't know if this is possible */ +void RGFW_window_moveMouse(RGFW_window* win, i32 x, i32 y) { RGFW_UNUSED(win); RGFW_UNUSED(x); RGFW_UNUSED(y); } +/* this one might be possible but it looks iffy */ +RGFW_mouse* RGFW_createMouse(u8* data, i32 w, i32 h, RGFW_format format) { RGFW_UNUSED(data); RGFW_UNUSED(w); RGFW_UNUSED(h); RGFW_UNUSED(format); return NULL; } + +RGFW_bool RGFW_window_setMousePlatform(RGFW_window* win, RGFW_mouse* mouse) { + RGFW_ASSERT(win != NULL); + RGFW_ASSERT(mouse != NULL); + + EM_ASM( { document.getElementById("canvas").style.cursor = UTF8ToString($0); }, (char*)mouse); + return RGFW_TRUE; } +void RGFW_freeMouse(RGFW_mouse* mouse) { RGFW_UNUSED(mouse); } void RGFW_window_showMouse(RGFW_window* win, RGFW_bool show) { RGFW_window_showMouseFlags(win, show); @@ -15232,6 +15416,7 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* win->src.gfxType = RGFW_gfxNativeOpenGL; EmscriptenWebGLContextAttributes attrs; + emscripten_webgl_init_context_attributes(&attrs); attrs.alpha = hints->alpha; attrs.depth = hints->depth; attrs.stencil = hints->stencil; @@ -15245,19 +15430,41 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* attrs.renderViaOffscreenBackBuffer = hints->auxBuffers; attrs.failIfMajorPerformanceCaveat = EM_FALSE; - attrs.majorVersion = (hints->major == 0) ? 1 : hints->major; - attrs.minorVersion = hints->minor; attrs.enableExtensionsByDefault = EM_TRUE; - attrs.explicitSwapControl = EM_TRUE; - emscripten_webgl_init_context_attributes(&attrs); + if (hints->profile == RGFW_glWeb) { + attrs.majorVersion = (hints->major == 0) ? 1 : hints->major; + attrs.minorVersion = hints->minor; + } else { + attrs.majorVersion = (hints->major == 0) ? 1 : ( (hints->major > 1) ? hints->major - 1 : hints->major ); + attrs.minorVersion = hints->minor; + } + + attrs.explicitSwapControl = EM_TRUE; win->src.ctx.native->ctx = emscripten_webgl_create_context("#canvas", &attrs); + + if (win->src.ctx.native->ctx == 0) { + RGFW_debugCallback(RGFW_typeError, RGFW_warningOpenGL, "WebGL: Failed to create an OpenGL Context with explicit swap control."); + attrs.explicitSwapControl = EM_FALSE; + win->src.ctx.native->ctx = emscripten_webgl_create_context("#canvas", &attrs); + } + + if (win->src.ctx.native->ctx == 0) { + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create an OpenGL Context with the requested attributes, falling back to defaults."); + win->src.ctx.native->ctx = emscripten_webgl_create_context("#canvas", &attrs); + } + + if (win->src.ctx.native->ctx == 0) { + RGFW_debugCallback(RGFW_typeError, RGFW_errOpenGLContext, "Failed to create an OpenGL Context."); + return RGFW_FALSE; + } + emscripten_webgl_make_context_current(win->src.ctx.native->ctx); #ifdef LEGACY_GL_EMULATION EM_ASM("Module.useWebGL = true; GLImmediate.init();"); - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context initalized."); #endif RGFW_window_swapInterval_OpenGL(win, 0); @@ -15268,7 +15475,7 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* void RGFW_window_deleteContextPtr_OpenGL(RGFW_window* win, RGFW_glContext* ctx) { emscripten_webgl_destroy_context(ctx->ctx); win->src.ctx.native->ctx = 0; - RGFW_sendDebugInfo(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); + RGFW_debugCallback(RGFW_typeInfo, RGFW_infoOpenGL, "OpenGL context freed."); } void RGFW_window_makeCurrentContext_OpenGL(RGFW_window* win) { @@ -15343,6 +15550,7 @@ void RGFW_window_maximize(RGFW_window* win) { } RGFW_window_move(win, 0, 0); + RGFW_window_fetchSize(win, NULL, NULL); } void RGFW_window_setFullscreen(RGFW_window* win, RGFW_bool fullscreen) { @@ -15379,87 +15587,87 @@ WGPUSurface RGFW_window_createSurface_WebGPU(RGFW_window* window, WGPUInstance i RGFW_key RGFW_WASMPhysicalToRGFW(u32 hash) { switch(hash) { /* 0x0000 */ - case 0x67243A2DU /* Escape */: return RGFW_escape; /* 0x0001 */ - case 0x67251058U /* Digit0 */: return RGFW_0; /* 0x0002 */ - case 0x67251059U /* Digit1 */: return RGFW_1; /* 0x0003 */ - case 0x6725105AU /* Digit2 */: return RGFW_2; /* 0x0004 */ - case 0x6725105BU /* Digit3 */: return RGFW_3; /* 0x0005 */ - case 0x6725105CU /* Digit4 */: return RGFW_4; /* 0x0006 */ - case 0x6725105DU /* Digit5 */: return RGFW_5; /* 0x0007 */ - case 0x6725105EU /* Digit6 */: return RGFW_6; /* 0x0008 */ - case 0x6725105FU /* Digit7 */: return RGFW_7; /* 0x0009 */ - case 0x67251050U /* Digit8 */: return RGFW_8; /* 0x000A */ - case 0x67251051U /* Digit9 */: return RGFW_9; /* 0x000B */ - case 0x92E14DD3U /* Minus */: return RGFW_minus; /* 0x000C */ - case 0x92E1FBACU /* Equal */: return RGFW_equals; /* 0x000D */ - case 0x36BF1CB5U /* Backspace */: return RGFW_backSpace; /* 0x000E */ - case 0x7B8E51E2U /* Tab */: return RGFW_tab; /* 0x000F */ - case 0x2C595B51U /* KeyQ */: return RGFW_q; /* 0x0010 */ - case 0x2C595B57U /* KeyW */: return RGFW_w; /* 0x0011 */ - case 0x2C595B45U /* KeyE */: return RGFW_e; /* 0x0012 */ - case 0x2C595B52U /* KeyR */: return RGFW_r; /* 0x0013 */ - case 0x2C595B54U /* KeyT */: return RGFW_t; /* 0x0014 */ - case 0x2C595B59U /* KeyY */: return RGFW_y; /* 0x0015 */ - case 0x2C595B55U /* KeyU */: return RGFW_u; /* 0x0016 */ - case 0x2C595B4FU /* KeyO */: return RGFW_o; /* 0x0018 */ - case 0x2C595B50U /* KeyP */: return RGFW_p; /* 0x0019 */ - case 0x45D8158CU /* BracketLeft */: return RGFW_closeBracket; /* 0x001A */ - case 0xDEEABF7CU /* BracketRight */: return RGFW_bracket; /* 0x001B */ - case 0x92E1C5D2U /* Enter */: return RGFW_return; /* 0x001C */ - case 0xE058958CU /* ControlLeft */: return RGFW_controlL; /* 0x001D */ - case 0x2C595B41U /* KeyA */: return RGFW_a; /* 0x001E */ - case 0x2C595B53U /* KeyS */: return RGFW_s; /* 0x001F */ - case 0x2C595B44U /* KeyD */: return RGFW_d; /* 0x0020 */ - case 0x2C595B46U /* KeyF */: return RGFW_f; /* 0x0021 */ - case 0x2C595B47U /* KeyG */: return RGFW_g; /* 0x0022 */ - case 0x2C595B48U /* KeyH */: return RGFW_h; /* 0x0023 */ - case 0x2C595B4AU /* KeyJ */: return RGFW_j; /* 0x0024 */ - case 0x2C595B4BU /* KeyK */: return RGFW_k; /* 0x0025 */ - case 0x2C595B4CU /* KeyL */: return RGFW_l; /* 0x0026 */ - case 0x2707219EU /* Semicolon */: return RGFW_semicolon; /* 0x0027 */ - case 0x92E0B58DU /* Quote */: return RGFW_apostrophe; /* 0x0028 */ - case 0x36BF358DU /* Backquote */: return RGFW_backtick; /* 0x0029 */ - case 0x26B1958CU /* ShiftLeft */: return RGFW_shiftL; /* 0x002A */ - case 0x36BF2438U /* Backslash */: return RGFW_backSlash; /* 0x002B */ - case 0x2C595B5AU /* KeyZ */: return RGFW_z; /* 0x002C */ - case 0x2C595B58U /* KeyX */: return RGFW_x; /* 0x002D */ - case 0x2C595B43U /* KeyC */: return RGFW_c; /* 0x002E */ - case 0x2C595B56U /* KeyV */: return RGFW_v; /* 0x002F */ - case 0x2C595B42U /* KeyB */: return RGFW_b; /* 0x0030 */ - case 0x2C595B4EU /* KeyN */: return RGFW_n; /* 0x0031 */ - case 0x2C595B4DU /* KeyM */: return RGFW_m; /* 0x0032 */ - case 0x92E1A1C1U /* Comma */: return RGFW_comma; /* 0x0033 */ - case 0x672FFAD4U /* Period */: return RGFW_period; /* 0x0034 */ - case 0x92E0A438U /* Slash */: return RGFW_slash; /* 0x0035 */ - case 0xC5A6BF7CU /* ShiftRight */: return RGFW_shiftR; - case 0x5D64DA91U /* NumpadMultiply */: return RGFW_kpMultiply; - case 0xC914958CU /* AltLeft */: return RGFW_altL; /* 0x0038 */ - case 0x92E09CB5U /* Space */: return RGFW_space; /* 0x0039 */ - case 0xB8FAE73BU /* CapsLock */: return RGFW_capsLock; /* 0x003A */ - case 0x7174B789U /* F1 */: return RGFW_F1; /* 0x003B */ - case 0x7174B78AU /* F2 */: return RGFW_F2; /* 0x003C */ - case 0x7174B78BU /* F3 */: return RGFW_F3; /* 0x003D */ - case 0x7174B78CU /* F4 */: return RGFW_F4; /* 0x003E */ - case 0x7174B78DU /* F5 */: return RGFW_F5; /* 0x003F */ - case 0x7174B78EU /* F6 */: return RGFW_F6; /* 0x0040 */ - case 0x7174B78FU /* F7 */: return RGFW_F7; /* 0x0041 */ - case 0x7174B780U /* F8 */: return RGFW_F8; /* 0x0042 */ - case 0x7174B781U /* F9 */: return RGFW_F9; /* 0x0043 */ - case 0x7B8E57B0U /* F10 */: return RGFW_F10; /* 0x0044 */ - case 0xC925FCDFU /* Numpad7 */: return RGFW_kpMultiply; /* 0x0047 */ - case 0xC925FCD0U /* Numpad8 */: return RGFW_kp8; /* 0x0048 */ - case 0xC925FCD1U /* Numpad9 */: return RGFW_kp9; /* 0x0049 */ - case 0x5EA3E8A4U /* NumpadSubtract */: return RGFW_minus; /* 0x004A */ - case 0xC925FCDCU /* Numpad4 */: return RGFW_kp4; /* 0x004B */ - case 0xC925FCDDU /* Numpad5 */: return RGFW_kp5; /* 0x004C */ - case 0xC925FCDEU /* Numpad6 */: return RGFW_kp6; /* 0x004D */ - case 0xC925FCD9U /* Numpad1 */: return RGFW_kp1; /* 0x004F */ - case 0xC925FCDAU /* Numpad2 */: return RGFW_kp2; /* 0x0050 */ - case 0xC925FCDBU /* Numpad3 */: return RGFW_kp3; /* 0x0051 */ - case 0xC925FCD8U /* Numpad0 */: return RGFW_kp0; /* 0x0052 */ - case 0x95852DACU /* NumpadDecimal */: return RGFW_period; /* 0x0053 */ - case 0x7B8E57B1U /* F11 */: return RGFW_F11; /* 0x0057 */ - case 0x7B8E57B2U /* F12 */: return RGFW_F12; /* 0x0058 */ + case 0x67243A2DU /* Escape */: return RGFW_keyEscape; /* 0x0001 */ + case 0x67251058U /* Digit0 */: return RGFW_key0; /* 0x0002 */ + case 0x67251059U /* Digit1 */: return RGFW_key1; /* 0x0003 */ + case 0x6725105AU /* Digit2 */: return RGFW_key2; /* 0x0004 */ + case 0x6725105BU /* Digit3 */: return RGFW_key3; /* 0x0005 */ + case 0x6725105CU /* Digit4 */: return RGFW_key4; /* 0x0006 */ + case 0x6725105DU /* Digit5 */: return RGFW_key5; /* 0x0007 */ + case 0x6725105EU /* Digit6 */: return RGFW_key6; /* 0x0008 */ + case 0x6725105FU /* Digit7 */: return RGFW_key7; /* 0x0009 */ + case 0x67251050U /* Digit8 */: return RGFW_key8; /* 0x000A */ + case 0x67251051U /* Digit9 */: return RGFW_key9; /* 0x000B */ + case 0x92E14DD3U /* Minus */: return RGFW_keyMinus; /* 0x000C */ + case 0x92E1FBACU /* Equal */: return RGFW_keyEquals; /* 0x000D */ + case 0x36BF1CB5U /* Backspace */: return RGFW_keyBackSpace; /* 0x000E */ + case 0x7B8E51E2U /* Tab */: return RGFW_keyTab; /* 0x000F */ + case 0x2C595B51U /* KeyQ */: return RGFW_keyQ; /* 0x0010 */ + case 0x2C595B57U /* KeyW */: return RGFW_keyW; /* 0x0011 */ + case 0x2C595B45U /* KeyE */: return RGFW_keyE; /* 0x0012 */ + case 0x2C595B52U /* KeyR */: return RGFW_keyR; /* 0x0013 */ + case 0x2C595B54U /* KeyT */: return RGFW_keyT; /* 0x0014 */ + case 0x2C595B59U /* KeyY */: return RGFW_keyY; /* 0x0015 */ + case 0x2C595B55U /* KeyU */: return RGFW_keyU; /* 0x0016 */ + case 0x2C595B4FU /* KeyO */: return RGFW_keyO; /* 0x0018 */ + case 0x2C595B50U /* KeyP */: return RGFW_keyP; /* 0x0019 */ + case 0x45D8158CU /* BracketLeft */: return RGFW_keyCloseBracket; /* 0x001A */ + case 0xDEEABF7CU /* BracketRight */: return RGFW_keyBracket; /* 0x001B */ + case 0x92E1C5D2U /* Enter */: return RGFW_keyReturn; /* 0x001C */ + case 0xE058958CU /* ControlLeft */: return RGFW_keyControlL; /* 0x001D */ + case 0x2C595B41U /* KeyA */: return RGFW_keyA; /* 0x001E */ + case 0x2C595B53U /* KeyS */: return RGFW_keyS; /* 0x001F */ + case 0x2C595B44U /* KeyD */: return RGFW_keyD; /* 0x0020 */ + case 0x2C595B46U /* KeyF */: return RGFW_keyF; /* 0x0021 */ + case 0x2C595B47U /* KeyG */: return RGFW_keyG; /* 0x0022 */ + case 0x2C595B48U /* KeyH */: return RGFW_keyH; /* 0x0023 */ + case 0x2C595B4AU /* KeyJ */: return RGFW_keyJ; /* 0x0024 */ + case 0x2C595B4BU /* KeyK */: return RGFW_keyK; /* 0x0025 */ + case 0x2C595B4CU /* KeyL */: return RGFW_keyL; /* 0x0026 */ + case 0x2707219EU /* Semicolon */: return RGFW_keySemicolon; /* 0x0027 */ + case 0x92E0B58DU /* Quote */: return RGFW_keyApostrophe; /* 0x0028 */ + case 0x36BF358DU /* Backquote */: return RGFW_keyBacktick; /* 0x0029 */ + case 0x26B1958CU /* ShiftLeft */: return RGFW_keyShiftL; /* 0x002A */ + case 0x36BF2438U /* Backslash */: return RGFW_keyBackSlash; /* 0x002B */ + case 0x2C595B5AU /* KeyZ */: return RGFW_keyZ; /* 0x002C */ + case 0x2C595B58U /* KeyX */: return RGFW_keyX; /* 0x002D */ + case 0x2C595B43U /* KeyC */: return RGFW_keyC; /* 0x002E */ + case 0x2C595B56U /* KeyV */: return RGFW_keyV; /* 0x002F */ + case 0x2C595B42U /* KeyB */: return RGFW_keyB; /* 0x0030 */ + case 0x2C595B4EU /* KeyN */: return RGFW_keyN; /* 0x0031 */ + case 0x2C595B4DU /* KeyM */: return RGFW_keyM; /* 0x0032 */ + case 0x92E1A1C1U /* Comma */: return RGFW_keyComma; /* 0x0033 */ + case 0x672FFAD4U /* Period */: return RGFW_keyPeriod; /* 0x0034 */ + case 0x92E0A438U /* Slash */: return RGFW_keySlash; /* 0x0035 */ + case 0xC5A6BF7CU /* ShiftRight */: return RGFW_keyShiftR; + case 0x5D64DA91U /* NumpadMultiply */: return RGFW_keyPadMultiply; + case 0xC914958CU /* AltLeft */: return RGFW_keyAltL; /* 0x0038 */ + case 0x92E09CB5U /* Space */: return RGFW_keySpace; /* 0x0039 */ + case 0xB8FAE73BU /* CapsLock */: return RGFW_keyCapsLock; /* 0x003A */ + case 0x7174B789U /* F1 */: return RGFW_keyF1; /* 0x003B */ + case 0x7174B78AU /* F2 */: return RGFW_keyF2; /* 0x003C */ + case 0x7174B78BU /* F3 */: return RGFW_keyF3; /* 0x003D */ + case 0x7174B78CU /* F4 */: return RGFW_keyF4; /* 0x003E */ + case 0x7174B78DU /* F5 */: return RGFW_keyF5; /* 0x003F */ + case 0x7174B78EU /* F6 */: return RGFW_keyF6; /* 0x0040 */ + case 0x7174B78FU /* F7 */: return RGFW_keyF7; /* 0x0041 */ + case 0x7174B780U /* F8 */: return RGFW_keyF8; /* 0x0042 */ + case 0x7174B781U /* F9 */: return RGFW_keyF9; /* 0x0043 */ + case 0x7B8E57B0U /* F10 */: return RGFW_keyF10; /* 0x0044 */ + case 0xC925FCDFU /* Numpad7 */: return RGFW_keyPadMultiply; /* 0x0047 */ + case 0xC925FCD0U /* Numpad8 */: return RGFW_keyPad8; /* 0x0048 */ + case 0xC925FCD1U /* Numpad9 */: return RGFW_keyPad9; /* 0x0049 */ + case 0x5EA3E8A4U /* NumpadSubtract */: return RGFW_keyMinus; /* 0x004A */ + case 0xC925FCDCU /* Numpad4 */: return RGFW_keyPad4; /* 0x004B */ + case 0xC925FCDDU /* Numpad5 */: return RGFW_keyPad5; /* 0x004C */ + case 0xC925FCDEU /* Numpad6 */: return RGFW_keyPad6; /* 0x004D */ + case 0xC925FCD9U /* Numpad1 */: return RGFW_keyPad1; /* 0x004F */ + case 0xC925FCDAU /* Numpad2 */: return RGFW_keyPad2; /* 0x0050 */ + case 0xC925FCDBU /* Numpad3 */: return RGFW_keyPad3; /* 0x0051 */ + case 0xC925FCD8U /* Numpad0 */: return RGFW_keyPad0; /* 0x0052 */ + case 0x95852DACU /* NumpadDecimal */: return RGFW_keyPeriod; /* 0x0053 */ + case 0x7B8E57B1U /* F11 */: return RGFW_keyF11; /* 0x0057 */ + case 0x7B8E57B2U /* F12 */: return RGFW_keyF12; /* 0x0058 */ case 0x7B8E57B3U /* F13 */: return DOM_PK_F13; /* 0x0064 */ case 0x7B8E57B4U /* F14 */: return DOM_PK_F14; /* 0x0065 */ case 0x7B8E57B5U /* F15 */: return DOM_PK_F15; /* 0x0066 */ @@ -15471,21 +15679,21 @@ RGFW_key RGFW_WASMPhysicalToRGFW(u32 hash) { case 0x7B8E57A9U /* F21 */: return DOM_PK_F21; /* 0x006C */ case 0x7B8E57AAU /* F22 */: return DOM_PK_F22; /* 0x006D */ case 0x7B8E57ABU /* F23 */: return DOM_PK_F23; /* 0x006E */ - case 0x7393FBACU /* NumpadEqual */: return RGFW_kpReturn; - case 0xB88EBF7CU /* AltRight */: return RGFW_altR; /* 0xE038 */ - case 0xC925873BU /* NumLock */: return RGFW_numLock; /* 0xE045 */ - case 0x2C595F45U /* Home */: return RGFW_home; /* 0xE047 */ - case 0xC91BB690U /* ArrowUp */: return RGFW_up; /* 0xE048 */ - case 0x672F9210U /* PageUp */: return RGFW_pageUp; /* 0xE049 */ - case 0x3799258CU /* ArrowLeft */: return RGFW_left; /* 0xE04B */ - case 0x4CE33F7CU /* ArrowRight */: return RGFW_right; /* 0xE04D */ - case 0x7B8E55DCU /* End */: return RGFW_end; /* 0xE04F */ - case 0x3799379EU /* ArrowDown */: return RGFW_down; /* 0xE050 */ - case 0xBA90179EU /* PageDown */: return RGFW_pageDown; /* 0xE051 */ - case 0x6723CB2CU /* Insert */: return RGFW_insert; /* 0xE052 */ - case 0x6725C50DU /* Delete */: return RGFW_delete; /* 0xE053 */ - case 0x6723658CU /* OSLeft */: return RGFW_superL; /* 0xE05B */ - case 0x39643F7CU /* MetaRight */: return RGFW_superR; /* 0xE05C */ + case 0x7393FBACU /* NumpadEqual */: return RGFW_keyPadReturn; + case 0xB88EBF7CU /* AltRight */: return RGFW_keyAltR; /* 0xE038 */ + case 0xC925873BU /* NumLock */: return RGFW_keyNumLock; /* 0xE045 */ + case 0x2C595F45U /* Home */: return RGFW_keyHome; /* 0xE047 */ + case 0xC91BB690U /* ArrowUp */: return RGFW_keyUp; /* 0xE048 */ + case 0x672F9210U /* PageUp */: return RGFW_keyPageUp; /* 0xE049 */ + case 0x3799258CU /* ArrowLeft */: return RGFW_keyLeft; /* 0xE04B */ + case 0x4CE33F7CU /* ArrowRight */: return RGFW_keyRight; /* 0xE04D */ + case 0x7B8E55DCU /* End */: return RGFW_keyEnd; /* 0xE04F */ + case 0x3799379EU /* ArrowDown */: return RGFW_keyDown; /* 0xE050 */ + case 0xBA90179EU /* PageDown */: return RGFW_keyPageDown; /* 0xE051 */ + case 0x6723CB2CU /* Insert */: return RGFW_keyInsert; /* 0xE052 */ + case 0x6725C50DU /* Delete */: return RGFW_keyDelete; /* 0xE053 */ + case 0x6723658CU /* OSLeft */: return RGFW_keySuperL; /* 0xE05B */ + case 0x39643F7CU /* MetaRight */: return RGFW_keySuperR; /* 0xE05C */ case 0x380B9C8CU /* NumpadAdd */: return DOM_PK_NUMPAD_ADD; /* 0x004E */ default: return DOM_PK_UNKNOWN; } @@ -15493,7 +15701,13 @@ RGFW_key RGFW_WASMPhysicalToRGFW(u32 hash) { return 0; } +RGFW_monitor* RGFW_window_getMonitor(RGFW_window* win) { + RGFW_UNUSED(win); + return RGFW_getPrimaryMonitor(); +} + /* unsupported functions */ +void RGFW_pollMonitors(void) { } void RGFW_window_focus(RGFW_window* win) { RGFW_UNUSED(win); } void RGFW_window_raise(RGFW_window* win) { RGFW_UNUSED(win); } RGFW_bool RGFW_monitor_requestMode(RGFW_monitor* mon, RGFW_monitorMode* mode, RGFW_modeRequest request) { RGFW_UNUSED(mon); RGFW_UNUSED(mode); RGFW_UNUSED(request); return RGFW_FALSE; } @@ -15502,7 +15716,6 @@ size_t RGFW_monitor_getGammaRampPtr(RGFW_monitor* monitor, RGFW_gammaRamp* ramp) RGFW_bool RGFW_monitor_setGammaRamp(RGFW_monitor* monitor, RGFW_gammaRamp* ramp) { RGFW_UNUSED(monitor); RGFW_UNUSED(ramp); return RGFW_FALSE; } size_t RGFW_monitor_getModesPtr(RGFW_monitor* mon, RGFW_monitorMode** modes) { RGFW_UNUSED(mon); RGFW_UNUSED(modes); return 0; } RGFW_bool RGFW_monitor_setMode(RGFW_monitor* mon, RGFW_monitorMode* mode) { RGFW_UNUSED(mon); RGFW_UNUSED(mode); return RGFW_FALSE; } -void RGFW_pollMonitors(void) { } void RGFW_window_move(RGFW_window* win, i32 x, i32 y) { RGFW_UNUSED(win); RGFW_UNUSED(x); RGFW_UNUSED(y); } void RGFW_window_setAspectRatio(RGFW_window* win, i32 w, i32 h) { RGFW_UNUSED(win); RGFW_UNUSED(w); RGFW_UNUSED(h); } void RGFW_window_setMinSize(RGFW_window* win, i32 w, i32 h) { RGFW_UNUSED(win); RGFW_UNUSED(w); RGFW_UNUSED(h); } @@ -15519,7 +15732,6 @@ RGFW_bool RGFW_window_isHidden(RGFW_window* win) { RGFW_UNUSED(win); return RGFW RGFW_bool RGFW_window_isMinimized(RGFW_window* win) { RGFW_UNUSED(win); return RGFW_FALSE; } RGFW_bool RGFW_window_isMaximized(RGFW_window* win) { RGFW_UNUSED(win); return RGFW_FALSE; } RGFW_bool RGFW_window_isFloating(RGFW_window* win) { RGFW_UNUSED(win); return RGFW_FALSE; } -RGFW_monitor* RGFW_window_getMonitor(RGFW_window* win) { RGFW_UNUSED(win); return NULL; } void RGFW_waitForEvent(i32 waitMS) { RGFW_UNUSED(waitMS); } #endif @@ -15533,6 +15745,7 @@ typedef RGFW_window* (*RGFW_createWindowPlatform_ptr)(const char* name, RGFW_win typedef RGFW_bool (*RGFW_getMouse_ptr)(i32* x, i32* y); typedef RGFW_key (*RGFW_physicalToMappedKey_ptr)(RGFW_key key); typedef void (*RGFW_pollEvents_ptr)(void); +typedef RGFW_bool (*RGFW_window_fetchSize_ptr)(RGFW_window* win, i32* w, i32* h); typedef void (*RGFW_pollMonitors_ptr)(void); typedef void (*RGFW_window_move_ptr)(RGFW_window* win, i32 x, i32 y); typedef void (*RGFW_window_resize_ptr)(RGFW_window* win, i32 w, i32 h); @@ -15551,11 +15764,10 @@ typedef RGFW_bool (*RGFW_window_isFloating_ptr)(RGFW_window* win); typedef void (*RGFW_window_setName_ptr)(RGFW_window* win, const char* name); typedef void (*RGFW_window_setMousePassthrough_ptr)(RGFW_window* win, RGFW_bool passthrough); typedef RGFW_bool (*RGFW_window_setIconEx_ptr)(RGFW_window* win, u8* data, i32 w, i32 h, RGFW_format format, u8 type); -typedef RGFW_mouse* (*RGFW_loadMouse_ptr)(u8* data, i32 w, i32 h, RGFW_format format); -typedef void (*RGFW_window_setMouse_ptr)(RGFW_window* win, RGFW_mouse* mouse); +typedef RGFW_mouse* (*RGFW_createMouse_ptr)(u8* data, i32 w, i32 h, RGFW_format format); +typedef RGFW_mouse* (*RGFW_createMouseStandard_ptr)(RGFW_mouseIcon icons); +typedef RGFW_bool (*RGFW_window_setMousePlatform_ptr)(RGFW_window* win, RGFW_mouse* mouse); typedef void (*RGFW_window_moveMouse_ptr)(RGFW_window* win, i32 x, i32 y); -typedef RGFW_bool (*RGFW_window_setMouseDefault_ptr)(RGFW_window* win); -typedef RGFW_bool (*RGFW_window_setMouseStandard_ptr)(RGFW_window* win, u8 mouse); typedef void (*RGFW_window_hide_ptr)(RGFW_window* win); typedef void (*RGFW_window_show_ptr)(RGFW_window* win); typedef void (*RGFW_window_flash_ptr)(RGFW_window* win, RGFW_flashRequest request); @@ -15607,7 +15819,8 @@ typedef struct RGFW_FunctionPointers { RGFW_createWindowPlatform_ptr createWindowPlatform; RGFW_getMouse_ptr getGlobalMouse; RGFW_physicalToMappedKey_ptr physicalToMappedKey; - RGFW_pollEvents_ptr pollEvents; + RGFW_window_fetchSize_ptr window_fetchSize; + RGFW_pollEvents_ptr pollEvents; RGFW_pollMonitors_ptr pollMonitors; RGFW_window_move_ptr window_move; RGFW_window_resize_ptr window_resize; @@ -15626,11 +15839,10 @@ typedef struct RGFW_FunctionPointers { RGFW_window_setName_ptr window_setName; RGFW_window_setMousePassthrough_ptr window_setMousePassthrough; RGFW_window_setIconEx_ptr window_setIconEx; - RGFW_loadMouse_ptr loadMouse; - RGFW_window_setMouse_ptr window_setMouse; + RGFW_createMouse_ptr createMouse; + RGFW_createMouseStandard_ptr createMouseStandard; + RGFW_window_setMousePlatform_ptr window_setMousePlatform; RGFW_window_moveMouse_ptr window_moveMouse; - RGFW_window_setMouseDefault_ptr window_setMouseDefault; - RGFW_window_setMouseStandard_ptr window_setMouseStandard; RGFW_window_hide_ptr window_hide; RGFW_window_show_ptr window_show; RGFW_window_flash_ptr window_flash; @@ -15676,6 +15888,7 @@ RGFW_window* RGFW_createWindowPlatform(const char* name, RGFW_windowFlags flags, RGFW_bool RGFW_getGlobalMouse(i32* x, i32* y) { return RGFW_api.getGlobalMouse(x, y); } RGFW_key RGFW_physicalToMappedKey(RGFW_key key) { return RGFW_api.physicalToMappedKey(key); } void RGFW_pollEvents(void) { RGFW_api.pollEvents(); } +RGFW_bool RGFW_window_fetchSize(RGFW_window* win, i32* w, i32* h) { return RGFW_api.window_fetchSize(win, w, h); } void RGFW_pollMonitors(void) { RGFW_api.pollMonitors(); } void RGFW_window_move(RGFW_window* win, i32 x, i32 y) { RGFW_api.window_move(win, x, y); } void RGFW_window_resize(RGFW_window* win, i32 w, i32 h) { RGFW_api.window_resize(win, w, h); } @@ -15698,11 +15911,10 @@ void RGFW_window_setMousePassthrough(RGFW_window* win, RGFW_bool passthrough) { #endif RGFW_bool RGFW_window_setIconEx(RGFW_window* win, u8* data, i32 w, i32 h, RGFW_format format, u8 type) { return RGFW_api.window_setIconEx(win, data, w, h, format, type); } -RGFW_mouse* RGFW_loadMouse(u8* data, i32 w, i32 h, RGFW_format format) { return RGFW_api.loadMouse(data, w, h, format); } -void RGFW_window_setMouse(RGFW_window* win, RGFW_mouse* mouse) { RGFW_api.window_setMouse(win, mouse); } +RGFW_mouse* RGFW_createMouse(u8* data, i32 w, i32 h, RGFW_format format) { return RGFW_api.createMouse(data, w, h, format); } +RGFW_mouse* RGFW_createMouseStandard(RGFW_mouseIcon icon) { return RGFW_api.createMouseStandard(icon); } +RGFW_bool RGFW_window_setMousePlatform(RGFW_window* win, RGFW_mouse* mouse) { return RGFW_api.window_setMousePlatform(win, mouse); } void RGFW_window_moveMouse(RGFW_window* win, i32 x, i32 y) { RGFW_api.window_moveMouse(win, x, y); } -RGFW_bool RGFW_window_setMouseDefault(RGFW_window* win) { return RGFW_api.window_setMouseDefault(win); } -RGFW_bool RGFW_window_setMouseStandard(RGFW_window* win, u8 mouse) { return RGFW_api.window_setMouseStandard(win, mouse); } void RGFW_window_hide(RGFW_window* win) { RGFW_api.window_hide(win); } void RGFW_window_show(RGFW_window* win) { RGFW_api.window_show(win); } void RGFW_window_flash(RGFW_window* win, RGFW_flashRequest request) { RGFW_api.window_flash(win, request); } @@ -15755,6 +15967,7 @@ void RGFW_load_X11(void) { RGFW_api.getGlobalMouse = RGFW_getGlobalMouse_X11; RGFW_api.physicalToMappedKey = RGFW_physicalToMappedKey_X11; RGFW_api.pollEvents = RGFW_pollEvents_X11; + RGFW_api.window_fetchSize = RGFW_window_fetchSize_X11; RGFW_api.pollMonitors = RGFW_pollMonitors_X11; RGFW_api.window_move = RGFW_window_move_X11; RGFW_api.window_resize = RGFW_window_resize_X11; @@ -15775,11 +15988,10 @@ void RGFW_load_X11(void) { RGFW_api.window_setMousePassthrough = RGFW_window_setMousePassthrough_X11; #endif RGFW_api.window_setIconEx = RGFW_window_setIconEx_X11; - RGFW_api.loadMouse = RGFW_loadMouse_X11; - RGFW_api.window_setMouse = RGFW_window_setMouse_X11; + RGFW_api.createMouse = RGFW_createMouse_X11; + RGFW_api.createMouseStandard = RGFW_createMouseStandard_X11; + RGFW_api.window_setMousePlatform = RGFW_window_setMousePlatform_X11; RGFW_api.window_moveMouse = RGFW_window_moveMouse_X11; - RGFW_api.window_setMouseDefault = RGFW_window_setMouseDefault_X11; - RGFW_api.window_setMouseStandard = RGFW_window_setMouseStandard_X11; RGFW_api.window_hide = RGFW_window_hide_X11; RGFW_api.window_show = RGFW_window_show_X11; RGFW_api.window_flash = RGFW_window_flash_X11; @@ -15823,6 +16035,7 @@ void RGFW_load_Wayland(void) { RGFW_api.getGlobalMouse = RGFW_getGlobalMouse_Wayland; RGFW_api.physicalToMappedKey = RGFW_physicalToMappedKey_Wayland; RGFW_api.pollEvents = RGFW_pollEvents_Wayland; + RGFW_api.window_fetchSize = RGFW_window_fetchSize_Wayland; RGFW_api.pollMonitors = RGFW_pollMonitors_Wayland; RGFW_api.window_move = RGFW_window_move_Wayland; RGFW_api.window_resize = RGFW_window_resize_Wayland; @@ -15843,11 +16056,10 @@ void RGFW_load_Wayland(void) { RGFW_api.window_setMousePassthrough = RGFW_window_setMousePassthrough_Wayland; #endif RGFW_api.window_setIconEx = RGFW_window_setIconEx_Wayland; - RGFW_api.loadMouse = RGFW_loadMouse_Wayland; - RGFW_api.window_setMouse = RGFW_window_setMouse_Wayland; + RGFW_api.createMouse = RGFW_createMouse_Wayland; + RGFW_api.createMouseStandard = RGFW_createMouseStandard_Wayland; + RGFW_api.window_setMousePlatform = RGFW_window_setMousePlatform_Wayland; RGFW_api.window_moveMouse = RGFW_window_moveMouse_Wayland; - RGFW_api.window_setMouseDefault = RGFW_window_setMouseDefault_Wayland; - RGFW_api.window_setMouseStandard = RGFW_window_setMouseStandard_Wayland; RGFW_api.window_hide = RGFW_window_hide_Wayland; RGFW_api.window_show = RGFW_window_show_Wayland; RGFW_api.window_flash = RGFW_window_flash_X11; diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 4f54e1708..a2c005662 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -76,7 +76,7 @@ void ShowCursor(void); void CloseWindow(void); -double get_time_seconds(void); +double GetTimeSeconds(void); #if defined(__unix__) || defined(__linux__) #define _XTYPEDEF_FONT @@ -310,113 +310,113 @@ static PlatformData platform = { 0 }; // Platform specific static const unsigned short RGFW_keyConvertTable[] = { [RGFW_keyNULL] = KEY_NULL, - [RGFW_apostrophe] = KEY_APOSTROPHE, - [RGFW_comma] = KEY_COMMA, - [RGFW_minus] = KEY_MINUS, - [RGFW_period] = KEY_PERIOD, - [RGFW_slash] = KEY_SLASH, - [RGFW_0] = KEY_ZERO, - [RGFW_1] = KEY_ONE, - [RGFW_2] = KEY_TWO, - [RGFW_3] = KEY_THREE, - [RGFW_4] = KEY_FOUR, - [RGFW_5] = KEY_FIVE, - [RGFW_6] = KEY_SIX, - [RGFW_7] = KEY_SEVEN, - [RGFW_8] = KEY_EIGHT, - [RGFW_9] = KEY_NINE, - [RGFW_semicolon] = KEY_SEMICOLON, - [RGFW_equals] = KEY_EQUAL, - [RGFW_a] = KEY_A, - [RGFW_b] = KEY_B, - [RGFW_c] = KEY_C, - [RGFW_d] = KEY_D, - [RGFW_e] = KEY_E, - [RGFW_f] = KEY_F, - [RGFW_g] = KEY_G, - [RGFW_h] = KEY_H, - [RGFW_i] = KEY_I, - [RGFW_j] = KEY_J, - [RGFW_k] = KEY_K, - [RGFW_l] = KEY_L, - [RGFW_m] = KEY_M, - [RGFW_n] = KEY_N, - [RGFW_o] = KEY_O, - [RGFW_p] = KEY_P, - [RGFW_q] = KEY_Q, - [RGFW_r] = KEY_R, - [RGFW_s] = KEY_S, - [RGFW_t] = KEY_T, - [RGFW_u] = KEY_U, - [RGFW_v] = KEY_V, - [RGFW_w] = KEY_W, - [RGFW_x] = KEY_X, - [RGFW_y] = KEY_Y, - [RGFW_z] = KEY_Z, - [RGFW_bracket] = KEY_LEFT_BRACKET, - [RGFW_backSlash] = KEY_BACKSLASH, - [RGFW_closeBracket] = KEY_RIGHT_BRACKET, - [RGFW_backtick] = KEY_GRAVE, - [RGFW_space] = KEY_SPACE, - [RGFW_escape] = KEY_ESCAPE, - [RGFW_return] = KEY_ENTER, - [RGFW_tab] = KEY_TAB, - [RGFW_backSpace] = KEY_BACKSPACE, - [RGFW_insert] = KEY_INSERT, - [RGFW_delete] = KEY_DELETE, - [RGFW_right] = KEY_RIGHT, - [RGFW_left] = KEY_LEFT, - [RGFW_down] = KEY_DOWN, - [RGFW_up] = KEY_UP, - [RGFW_pageUp] = KEY_PAGE_UP, - [RGFW_pageDown] = KEY_PAGE_DOWN, - [RGFW_home] = KEY_HOME, - [RGFW_end] = KEY_END, - [RGFW_capsLock] = KEY_CAPS_LOCK, - [RGFW_scrollLock] = KEY_SCROLL_LOCK, - [RGFW_numLock] = KEY_NUM_LOCK, - [RGFW_printScreen] = KEY_PRINT_SCREEN, - [RGFW_pause] = KEY_PAUSE, - [RGFW_F1] = KEY_F1, - [RGFW_F2] = KEY_F2, - [RGFW_F3] = KEY_F3, - [RGFW_F4] = KEY_F4, - [RGFW_F5] = KEY_F5, - [RGFW_F6] = KEY_F6, - [RGFW_F7] = KEY_F7, - [RGFW_F8] = KEY_F8, - [RGFW_F9] = KEY_F9, - [RGFW_F10] = KEY_F10, - [RGFW_F11] = KEY_F11, - [RGFW_F12] = KEY_F12, - [RGFW_shiftL] = KEY_LEFT_SHIFT, - [RGFW_controlL] = KEY_LEFT_CONTROL, - [RGFW_altL] = KEY_LEFT_ALT, - [RGFW_superL] = KEY_LEFT_SUPER, + [RGFW_keyApostrophe] = KEY_APOSTROPHE, + [RGFW_keyComma] = KEY_COMMA, + [RGFW_keyMinus] = KEY_MINUS, + [RGFW_keyPeriod] = KEY_PERIOD, + [RGFW_keySlash] = KEY_SLASH, + [RGFW_key0] = KEY_ZERO, + [RGFW_key1] = KEY_ONE, + [RGFW_key2] = KEY_TWO, + [RGFW_key3] = KEY_THREE, + [RGFW_key4] = KEY_FOUR, + [RGFW_key5] = KEY_FIVE, + [RGFW_key6] = KEY_SIX, + [RGFW_key7] = KEY_SEVEN, + [RGFW_key8] = KEY_EIGHT, + [RGFW_key9] = KEY_NINE, + [RGFW_keySemicolon] = KEY_SEMICOLON, + [RGFW_keyEquals] = KEY_EQUAL, + [RGFW_keyA] = KEY_A, + [RGFW_keyB] = KEY_B, + [RGFW_keyC] = KEY_C, + [RGFW_keyD] = KEY_D, + [RGFW_keyE] = KEY_E, + [RGFW_keyF] = KEY_F, + [RGFW_keyG] = KEY_G, + [RGFW_keyH] = KEY_H, + [RGFW_keyI] = KEY_I, + [RGFW_keyJ] = KEY_J, + [RGFW_keyK] = KEY_K, + [RGFW_keyL] = KEY_L, + [RGFW_keyM] = KEY_M, + [RGFW_keyN] = KEY_N, + [RGFW_keyO] = KEY_O, + [RGFW_keyP] = KEY_P, + [RGFW_keyQ] = KEY_Q, + [RGFW_keyR] = KEY_R, + [RGFW_keyS] = KEY_S, + [RGFW_keyT] = KEY_T, + [RGFW_keyU] = KEY_U, + [RGFW_keyV] = KEY_V, + [RGFW_keyW] = KEY_W, + [RGFW_keyX] = KEY_X, + [RGFW_keyY] = KEY_Y, + [RGFW_keyZ] = KEY_Z, + [RGFW_keyBracket] = KEY_LEFT_BRACKET, + [RGFW_keyBackSlash] = KEY_BACKSLASH, + [RGFW_keyCloseBracket] = KEY_RIGHT_BRACKET, + [RGFW_keyBacktick] = KEY_GRAVE, + [RGFW_keySpace] = KEY_SPACE, + [RGFW_keyEscape] = KEY_ESCAPE, + [RGFW_keyReturn] = KEY_ENTER, + [RGFW_keyTab] = KEY_TAB, + [RGFW_keyBackSpace] = KEY_BACKSPACE, + [RGFW_keyInsert] = KEY_INSERT, + [RGFW_keyDelete] = KEY_DELETE, + [RGFW_keyRight] = KEY_RIGHT, + [RGFW_keyLeft] = KEY_LEFT, + [RGFW_keyDown] = KEY_DOWN, + [RGFW_keyUp] = KEY_UP, + [RGFW_keyPageUp] = KEY_PAGE_UP, + [RGFW_keyPageDown] = KEY_PAGE_DOWN, + [RGFW_keyHome] = KEY_HOME, + [RGFW_keyEnd] = KEY_END, + [RGFW_keyCapsLock] = KEY_CAPS_LOCK, + [RGFW_keyScrollLock] = KEY_SCROLL_LOCK, + [RGFW_keyNumLock] = KEY_NUM_LOCK, + [RGFW_keyPrintScreen] = KEY_PRINT_SCREEN, + [RGFW_keyPause] = KEY_PAUSE, + [RGFW_keyF1] = KEY_F1, + [RGFW_keyF2] = KEY_F2, + [RGFW_keyF3] = KEY_F3, + [RGFW_keyF4] = KEY_F4, + [RGFW_keyF5] = KEY_F5, + [RGFW_keyF6] = KEY_F6, + [RGFW_keyF7] = KEY_F7, + [RGFW_keyF8] = KEY_F8, + [RGFW_keyF9] = KEY_F9, + [RGFW_keyF10] = KEY_F10, + [RGFW_keyF11] = KEY_F11, + [RGFW_keyF12] = KEY_F12, + [RGFW_keyShiftL] = KEY_LEFT_SHIFT, + [RGFW_keyControlL] = KEY_LEFT_CONTROL, + [RGFW_keyAltL] = KEY_LEFT_ALT, + [RGFW_keySuperL] = KEY_LEFT_SUPER, // #ifndef RGFW_MACOS - [RGFW_shiftR] = KEY_RIGHT_SHIFT, - [RGFW_controlR] = KEY_RIGHT_CONTROL, - [RGFW_altR] = KEY_RIGHT_ALT, - [RGFW_superR] = KEY_RIGHT_SUPER, + [RGFW_keyShiftR] = KEY_RIGHT_SHIFT, + [RGFW_keyControlR] = KEY_RIGHT_CONTROL, + [RGFW_keyAltR] = KEY_RIGHT_ALT, + [RGFW_keySuperR] = KEY_RIGHT_SUPER, // #endif - [RGFW_menu] = KEY_KB_MENU, - [RGFW_kp0] = KEY_KP_0, - [RGFW_kp1] = KEY_KP_1, - [RGFW_kp2] = KEY_KP_2, - [RGFW_kp3] = KEY_KP_3, - [RGFW_kp4] = KEY_KP_4, - [RGFW_kp5] = KEY_KP_5, - [RGFW_kp6] = KEY_KP_6, - [RGFW_kp7] = KEY_KP_7, - [RGFW_kp8] = KEY_KP_8, - [RGFW_kp9] = KEY_KP_9, - [RGFW_kpPeriod] = KEY_KP_DECIMAL, - [RGFW_kpSlash] = KEY_KP_DIVIDE, - [RGFW_kpMultiply] = KEY_KP_MULTIPLY, - [RGFW_kpMinus] = KEY_KP_SUBTRACT, - [RGFW_kpPlus] = KEY_KP_ADD, - [RGFW_kpReturn] = KEY_KP_ENTER, - [RGFW_kpEqual] = KEY_KP_EQUAL, + [RGFW_keyMenu] = KEY_KB_MENU, + [RGFW_keyPad0] = KEY_KP_0, + [RGFW_keyPad1] = KEY_KP_1, + [RGFW_keyPad2] = KEY_KP_2, + [RGFW_keyPad3] = KEY_KP_3, + [RGFW_keyPad4] = KEY_KP_4, + [RGFW_keyPad5] = KEY_KP_5, + [RGFW_keyPad6] = KEY_KP_6, + [RGFW_keyPad7] = KEY_KP_7, + [RGFW_keyPad8] = KEY_KP_8, + [RGFW_keyPad9] = KEY_KP_9, + [RGFW_keyPadPeriod] = KEY_KP_DECIMAL, + [RGFW_keyPadSlash] = KEY_KP_DIVIDE, + [RGFW_keyPadMultiply] = KEY_KP_MULTIPLY, + [RGFW_keyPadMinus] = KEY_KP_SUBTRACT, + [RGFW_keyPadPlus] = KEY_KP_ADD, + [RGFW_keyPadReturn] = KEY_KP_ENTER, + [RGFW_keyPadEqual] = KEY_KP_EQUAL, }; static int mg_buttonConvertTable[] = { @@ -456,14 +456,297 @@ static int mg_axisConvertTable[] = { [MG_AXIS_HAT_DPAD_DOWN] = -1, }; +static KeyboardKey ConvertScancodeToKey(u32 keycode); +void RemapMouseToTouch(int touchAction); + +// --------------------------------------------------------------------------------- +// RGFW Callbacks (instead of the older polling) +// --------------------------------------------------------------------------------- +static void RGFW_cb_mousenotifyfunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + CORE.Input.Mouse.cursorOnScreen = e->mouse.inWindow; +} +// static void RGFW_cb_windowclosefunc(const RGFW_event* e) +// { +// if (e->common.win != platform.window) return; + +// // we don't want to close here. raylib handles it +// // RGFW_window_setShouldClose(platform.window, true); +// } +static void RGFW_cb_dropfunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + if (CORE.Window.dropFileCount == 0) + { + CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); + + CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); + strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], e->drop.value->data); + + CORE.Window.dropFileCount++; + } + else if (CORE.Window.dropFileCount < 1024) + { + CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); + strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], e->drop.value->data); + + CORE.Window.dropFileCount++; + } + else TRACELOG(LOG_WARNING, "FILE: Maximum drag and drop files at once is limited to 1024 files!"); +} +static void RGFW_cb_windowresizefunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + CORE.Window.resizedLastFrame = true; + + #if defined(__APPLE__) + if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) + { + RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); + SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio); + CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); + + CORE.Window.screen.width = platform.window->w; + CORE.Window.screen.height = platform.window->h; + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; + } + else + { + SetupViewport(platform.window->w, platform.window->h); + CORE.Window.screen.width = platform.window->w; + CORE.Window.screen.height = platform.window->h; + CORE.Window.render.width = CORE.Window.screen.width; + CORE.Window.render.height = CORE.Window.screen.height; + } + + CORE.Window.currentFbo.width = CORE.Window.render.width; + CORE.Window.currentFbo.height = CORE.Window.render.height; + #elif defined(PLATFORM_WEB_RGFW) + // do nothing but prevent other behavior + #else + SetupViewport(platform.window->w, platform.window->h); + + // Consider content scaling if required + if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) + { + Vector2 scaleDpi = GetWindowScaleDPI(); + CORE.Window.screen.width = (int)(platform.window->w/scaleDpi.x); + CORE.Window.screen.height = (int)(platform.window->h/scaleDpi.y); + CORE.Window.screenScale = MatrixScale(scaleDpi.x, scaleDpi.y, 1.0f); + } + else + { + CORE.Window.screen.width = platform.window->w; + CORE.Window.screen.height = platform.window->h; + } + + CORE.Window.currentFbo.width = CORE.Window.screen.width; + CORE.Window.currentFbo.height = CORE.Window.screen.height; + #endif + + #if defined(GRAPHICS_API_OPENGL_SOFTWARE) + #if defined(__APPLE__) + RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); + CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); + SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio); + + CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; + CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; + CORE.Window.currentFbo.width = CORE.Window.render.width; + CORE.Window.currentFbo.height = CORE.Window.render.height; + #endif + platform.surfaceWidth = CORE.Window.currentFbo.width; + platform.surfaceHeight = CORE.Window.currentFbo.height; + + // in software mode we dont have the viewport so we need to reverse the highdpi changes + if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) + { + Vector2 scaleDpi = GetWindowScaleDPI(); + platform.surfaceWidth *= scaleDpi.x; + platform.surfaceHeight *= scaleDpi.y; + } + + if (platform.surfacePixels != NULL) + { + RL_FREE(platform.surfacePixels); + platform.surfacePixels = RL_MALLOC(platform.surfaceWidth*platform.surfaceHeight*4); + } + + if (platform.surface != NULL) + { + RGFW_surface_free(platform.surface); + platform.surface = RGFW_window_createSurface(platform.window, platform.surfacePixels, platform.surfaceWidth, platform.surfaceHeight, RGFW_formatBGRA8); + swResize(platform.surfaceWidth, platform.surfaceHeight); + } + #endif +} +static void RGFW_cb_windowmaximizefunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was maximized +} +static void RGFW_cb_windowminimizefunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED); // The window was iconified +} +static void RGFW_cb_windowrestorefunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + if (RGFW_window_isMaximized(platform.window)) + FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was restored + if (RGFW_window_isMinimized(platform.window)) + FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MINIMIZED); // The window was restored +} +static void RGFW_cb_windowmovefunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + CORE.Window.position.x = platform.window->x; + CORE.Window.position.y = platform.window->x; +} +static void RGFW_cb_keycharfunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + // NOTE: event.text.text data comes an UTF-8 text sequence but registering codepoints (int) + // Check if there is space available in the queue + if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE) + { + // Add character (codepoint) to the queue + CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = e->keyChar.value; + CORE.Input.Keyboard.charPressedQueueCount++; + } +} +static void RGFW_cb_scrollfunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + CORE.Input.Mouse.currentWheelMove.x += e->delta.x; + CORE.Input.Mouse.currentWheelMove.y += e->delta.y; +} +static void RGFW_cb_mousebuttonfunc(const RGFW_event* e) +{ + if (e->common.win != platform.window) return; + + int btn = e->button.value; + if (btn == RGFW_mouseLeft) btn = 1; + else if (btn == RGFW_mouseRight) btn = 2; + else if (btn == RGFW_mouseMiddle) btn = 3; + + // pressed or released + if (e->button.state){ + CORE.Input.Mouse.currentButtonState[btn - 1] = 1; + CORE.Input.Touch.currentTouchState[btn - 1] = 1; + + // simulate touch with the mouse + RemapMouseToTouch(1); + } else + { + CORE.Input.Mouse.currentButtonState[btn - 1] = 0; + CORE.Input.Touch.currentTouchState[btn - 1] = 0; + + // simulate touch with the mouse + RemapMouseToTouch(0); + } +} +static void RGFW_cb_mouserawmotionfunc(const RGFW_event* e) +{ + if (!RGFW_window_isRawMouseMode(platform.window)) + { + // if not raw, use non-raw motion. this prevents the doubled events + return; + } + + float mouseX = 0.0f; + float mouseY = 0.0f; + mouseX = e->delta.x; + mouseY = e->delta.y; + + #if defined(__EMSCRIPTEN__) + double canvasWidth = 0.0; + double canvasHeight = 0.0; + emscripten_get_element_css_size("#canvas", &canvasWidth, &canvasHeight); + mouseX *= ((float)GetScreenWidth()/(float)canvasWidth); + mouseY *= ((float)GetScreenHeight()/(float)canvasHeight); + #endif + + CORE.Input.Mouse.currentPosition.x += mouseX; + CORE.Input.Mouse.currentPosition.y += mouseY; + + // simulate touch with the mouse + CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; + RemapMouseToTouch(2); +} +static void RGFW_cb_mousemotionfunc(const RGFW_event* e) +{ + if (RGFW_window_isRawMouseMode(platform.window)) + { + // if raw, use raw motion. this prevents the doubled events + return; + } + + float mouseX = 0.0f; + float mouseY = 0.0f; + mouseX = e->mouse.x; + mouseY = e->mouse.y; + + #if defined(__EMSCRIPTEN__) + double canvasWidth = 0.0; + double canvasHeight = 0.0; + emscripten_get_element_css_size("#canvas", &canvasWidth, &canvasHeight); + mouseX *= ((float)GetScreenWidth()/(float)canvasWidth); + mouseY *= ((float)GetScreenHeight()/(float)canvasHeight); + #endif + + CORE.Input.Mouse.currentPosition.x = mouseX; + CORE.Input.Mouse.currentPosition.y = mouseY; + + // simulate touch with the mouse + CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; + RemapMouseToTouch(2); +} +static void RGFW_cb_keyfunc(const RGFW_keyEvent* e) +{ + if (e->win != platform.window) return; + + KeyboardKey key = ConvertScancodeToKey(e->value); + if (key == KEY_NULL) return; + + // pressed or released + if (e->state) + { + // If key was up, add it to the key pressed queue + if ((CORE.Input.Keyboard.currentKeyState[key] == 0) && (CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE)) + { + CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount] = key; + CORE.Input.Keyboard.keyPressedQueueCount++; + } + + CORE.Input.Keyboard.currentKeyState[key] = 1; + + if (CORE.Input.Keyboard.currentKeyState[CORE.Input.Keyboard.exitKey]) RGFW_window_setShouldClose(platform.window, true); + } + else + { + CORE.Input.Keyboard.currentKeyState[key] = 0; + } +} + //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- int InitPlatform(void); // Initialize platform (graphics, inputs and more) bool InitGraphicsDevice(void); // Initialize graphics device -static KeyboardKey ConvertScancodeToKey(u32 keycode); - //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- @@ -476,10 +759,9 @@ static KeyboardKey ConvertScancodeToKey(u32 keycode); // Check if application should close bool WindowShouldClose(void) { - if (CORE.Window.shouldClose == false) - CORE.Window.shouldClose = RGFW_window_shouldClose(platform.window); + if (CORE.Window.shouldClose == false) CORE.Window.shouldClose = RGFW_window_shouldClose(platform.window); if (CORE.Window.ready) return CORE.Window.shouldClose; - else return true; + return true; } // Toggle fullscreen mode @@ -1181,7 +1463,7 @@ double GetTime(void) { // CORE.Time.base is nanoseconds as integer double baseTime = (double)CORE.Time.base*1e-9; - double time = get_time_seconds() - baseTime; + double time = GetTimeSeconds() - baseTime; return time; } @@ -1288,9 +1570,6 @@ void PollInputEvents(void) // Map touch position to mouse position for convenience CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; - int touchAction = -1; // 0-TOUCH_ACTION_UP, 1-TOUCH_ACTION_DOWN, 2-TOUCH_ACTION_MOVE - bool realTouch = false; // Flag to differentiate real touch gestures from mouse ones - // Register previous keys states // NOTE: Android supports up to 260 keys for (int i = 0; i < MAX_KEYBOARD_KEYS; i++) @@ -1322,291 +1601,9 @@ void PollInputEvents(void) CORE.Time.previous = GetTime(); } - RGFW_event rgfw_event; - while (RGFW_window_checkEvent(platform.window, &rgfw_event)) - { - // All input events can be processed after polling - switch (rgfw_event.type) - { - case RGFW_mouseEnter: CORE.Input.Mouse.cursorOnScreen = true; break; - case RGFW_mouseLeave: CORE.Input.Mouse.cursorOnScreen = false; break; - case RGFW_quit: - RGFW_window_setShouldClose(platform.window, true); - return; - case RGFW_dataDrop: // Dropped file - { - for (int i = 0; i < rgfw_event.drop.count; i++) - { - if (CORE.Window.dropFileCount == 0) - { - // When a new file is dropped, reserve a fixed number of slots for all possible dropped files - // at the moment limiting the number of drops at once to 1024 files but this behaviour should probably be reviewed - // TODO: Pointers should probably be reallocated for any new file added... - CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); - - CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], rgfw_event.drop.files[i]); - - CORE.Window.dropFileCount++; - } - else if (CORE.Window.dropFileCount < 1024) - { - CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], rgfw_event.drop.files[i]); - - CORE.Window.dropFileCount++; - } - else TRACELOG(LOG_WARNING, "FILE: Maximum drag and drop files at once is limited to 1024 files!"); - } - } break; - - // Window events are also polled (Minimized, maximized, close...) - case RGFW_windowResized: - { - // set flag that the window was resized - CORE.Window.resizedLastFrame = true; - - #if defined(__APPLE__) - if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) - { - RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); - SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio); - CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); - - CORE.Window.screen.width = platform.window->w; - CORE.Window.screen.height = platform.window->h; - CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; - } - else - { - SetupViewport(platform.window->w, platform.window->h); - CORE.Window.screen.width = platform.window->w; - CORE.Window.screen.height = platform.window->h; - CORE.Window.render.width = CORE.Window.screen.width; - CORE.Window.render.height = CORE.Window.screen.height; - } - - CORE.Window.currentFbo.width = CORE.Window.render.width; - CORE.Window.currentFbo.height = CORE.Window.render.height; - #elif defined(PLATFORM_WEB_RGFW) - // do nothing but prevent other behavior - #else - SetupViewport(platform.window->w, platform.window->h); - - // Consider content scaling if required - if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) - { - Vector2 scaleDpi = GetWindowScaleDPI(); - CORE.Window.screen.width = (int)(platform.window->w/scaleDpi.x); - CORE.Window.screen.height = (int)(platform.window->h/scaleDpi.y); - CORE.Window.screenScale = MatrixScale(scaleDpi.x, scaleDpi.y, 1.0f); - - // Mouse scale does not seem to be needed - //SetMouseScale(1.0f/scaleDpi.x, 1.0f/scaleDpi.y); - } - else - { - CORE.Window.screen.width = platform.window->w; - CORE.Window.screen.height = platform.window->h; - } - - CORE.Window.currentFbo.width = CORE.Window.screen.width; - CORE.Window.currentFbo.height = CORE.Window.screen.height; - #endif - - #if defined(GRAPHICS_API_OPENGL_SOFTWARE) - #if defined(__APPLE__) - RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); - CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); - SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio); - - CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio; - CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio; - CORE.Window.currentFbo.width = CORE.Window.render.width; - CORE.Window.currentFbo.height = CORE.Window.render.height; - #endif - platform.surfaceWidth = CORE.Window.currentFbo.width; - platform.surfaceHeight = CORE.Window.currentFbo.height; - - // in software mode we dont have the viewport so we need to reverse the highdpi changes - if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) - { - Vector2 scaleDpi = GetWindowScaleDPI(); - platform.surfaceWidth *= scaleDpi.x; - platform.surfaceHeight *= scaleDpi.y; - } - - if (platform.surfacePixels != NULL) - { - RL_FREE(platform.surfacePixels); - platform.surfacePixels = RL_MALLOC(platform.surfaceWidth*platform.surfaceHeight*4); - } - - if (platform.surface != NULL) - { - RGFW_surface_free(platform.surface); - platform.surface = RGFW_window_createSurface(platform.window, platform.surfacePixels, platform.surfaceWidth, platform.surfaceHeight, RGFW_formatBGRA8); - swResize(platform.surfaceWidth, platform.surfaceHeight); - } - #endif - } break; - case RGFW_windowMaximized: - { - FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was maximized - } break; - case RGFW_windowMinimized: - { - FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED); // The window was iconified - } break; - case RGFW_windowRestored: - { - if (RGFW_window_isMaximized(platform.window)) - FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was restored - if (RGFW_window_isMinimized(platform.window)) - FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MINIMIZED); // The window was restored - } break; - case RGFW_windowMoved: - { - CORE.Window.position.x = platform.window->x; - CORE.Window.position.y = platform.window->x; - } break; - - // Keyboard events - case RGFW_keyPressed: - { - KeyboardKey key = ConvertScancodeToKey(rgfw_event.key.value); - if (key != KEY_NULL) - { - // If key was up, add it to the key pressed queue - if ((CORE.Input.Keyboard.currentKeyState[key] == 0) && (CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE)) - { - CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount] = key; - CORE.Input.Keyboard.keyPressedQueueCount++; - } - - CORE.Input.Keyboard.currentKeyState[key] = 1; - - if (CORE.Input.Keyboard.currentKeyState[CORE.Input.Keyboard.exitKey]) RGFW_window_setShouldClose(platform.window, true); - } - } break; - case RGFW_keyReleased: - { - KeyboardKey key = ConvertScancodeToKey(rgfw_event.key.value); - if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 0; - } break; - - case RGFW_keyChar: - { - // NOTE: event.text.text data comes an UTF-8 text sequence but registering codepoints (int) - // Check if there is space available in the queue - if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE) - { - // Add character (codepoint) to the queue - CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = rgfw_event.keyChar.value; - CORE.Input.Keyboard.charPressedQueueCount++; - } - } break; - - // Check mouse events - case RGFW_mouseScroll: - { - CORE.Input.Mouse.currentWheelMove.x += rgfw_event.scroll.x; - CORE.Input.Mouse.currentWheelMove.y += rgfw_event.scroll.y; - } break; - case RGFW_mouseButtonPressed: - { - int btn = rgfw_event.button.value; - if (btn == RGFW_mouseLeft) btn = 1; - else if (btn == RGFW_mouseRight) btn = 2; - else if (btn == RGFW_mouseMiddle) btn = 3; - - CORE.Input.Mouse.currentButtonState[btn - 1] = 1; - CORE.Input.Touch.currentTouchState[btn - 1] = 1; - - touchAction = 1; - } break; - case RGFW_mouseButtonReleased: - { - int btn = rgfw_event.button.value; - if (btn == RGFW_mouseLeft) btn = 1; - else if (btn == RGFW_mouseRight) btn = 2; - else if (btn == RGFW_mouseMiddle) btn = 3; - - CORE.Input.Mouse.currentButtonState[btn - 1] = 0; - CORE.Input.Touch.currentTouchState[btn - 1] = 0; - - touchAction = 0; - } break; - case RGFW_mousePosChanged: - { - float mouseX = 0.0f; - float mouseY = 0.0f; - if (RGFW_window_isCaptured(platform.window)) - { - mouseX = (float)rgfw_event.mouse.vecX; - mouseY = (float)rgfw_event.mouse.vecY; - } - else - { - mouseX = (float)rgfw_event.mouse.x; - mouseY = (float)rgfw_event.mouse.y; - } - -#if defined(__EMSCRIPTEN__) - double canvasWidth = 0.0; - double canvasHeight = 0.0; - emscripten_get_element_css_size("#canvas", &canvasWidth, &canvasHeight); - mouseX *= ((float)GetScreenWidth()/(float)canvasWidth); - mouseY *= ((float)GetScreenHeight()/(float)canvasHeight); -#endif - if (RGFW_window_isCaptured(platform.window)) - { - CORE.Input.Mouse.currentPosition.x += mouseX; - CORE.Input.Mouse.currentPosition.y += mouseY; - } - else - { - CORE.Input.Mouse.currentPosition.x = mouseX; - CORE.Input.Mouse.currentPosition.y = mouseY; - } - - CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; - touchAction = 2; - } break; - default: break; - } - -#if SUPPORT_GESTURES_SYSTEM - if (touchAction > -1) - { - // Process mouse events as touches to be able to use mouse-gestures - GestureEvent gestureEvent = { 0 }; - - // Register touch actions - gestureEvent.touchAction = touchAction; - - // Assign a pointer ID - gestureEvent.pointId[0] = 0; - - // Register touch points count - gestureEvent.pointCount = 1; - - // Register touch points position, only one point registered - if (touchAction == 2 || realTouch) gestureEvent.position[0] = CORE.Input.Touch.position[0]; - else gestureEvent.position[0] = GetMousePosition(); - - // Normalize gestureEvent.position[0] for CORE.Window.screen.width and CORE.Window.screen.height - gestureEvent.position[0].x /= (float)GetScreenWidth(); - gestureEvent.position[0].y /= (float)GetScreenHeight(); - - // Gesture data is sent to gestures-system for processing - ProcessGestureEvent(gestureEvent); - - touchAction = -1; - } -#endif - } + //----------------------------------------------------------------------------- + // using RGFW callbacks instead of polling + RGFW_pollEvents(); //----------------------------------------------------------------------------- mg_event gamepad_event; @@ -1663,9 +1660,12 @@ void PollInputEvents(void) int axisCount = 0; for (int i = 0; i < MG_AXIS_COUNT; i += 1) { - if (platform.minigamepad.gamepads[gamepadIndex].axes[i].supported) { + if (platform.minigamepad.gamepads[gamepadIndex].axes[i].supported) + { axisCount += 1; - } else { + } + else + { break; } } @@ -1886,6 +1886,25 @@ int InitPlatform(void) } #endif + // Set callbacks + RGFW_setEventCallback(RGFW_mouseEnter, RGFW_cb_mousenotifyfunc); + RGFW_setEventCallback(RGFW_mouseLeave, RGFW_cb_mousenotifyfunc); + // RGFW_setEventCallback(RGFW_windowClose, RGFW_cb_windowclosefunc); // do not close here. let raylib handle it + RGFW_setEventCallback(RGFW_dataDrop, RGFW_cb_dropfunc); + RGFW_setEventCallback(RGFW_windowResized, RGFW_cb_windowresizefunc); + RGFW_setEventCallback(RGFW_windowMaximized, RGFW_cb_windowmaximizefunc); + RGFW_setEventCallback(RGFW_windowMinimized, RGFW_cb_windowminimizefunc); + RGFW_setEventCallback(RGFW_windowRestored, RGFW_cb_windowrestorefunc); + RGFW_setEventCallback(RGFW_windowMoved, RGFW_cb_windowmovefunc); + RGFW_setEventCallback(RGFW_keyChar, RGFW_cb_keycharfunc); + RGFW_setEventCallback(RGFW_mouseScroll, RGFW_cb_scrollfunc); + RGFW_setEventCallback(RGFW_mouseButtonPressed, RGFW_cb_mousebuttonfunc); + RGFW_setEventCallback(RGFW_mouseButtonReleased, RGFW_cb_mousebuttonfunc); + RGFW_setEventCallback(RGFW_mouseRawMotion, RGFW_cb_mouserawmotionfunc); + RGFW_setEventCallback(RGFW_mouseMotion, RGFW_cb_mousemotionfunc); + RGFW_setEventCallback(RGFW_keyPressed, (RGFW_genericFunc)RGFW_cb_keyfunc); + RGFW_setEventCallback(RGFW_keyReleased, (RGFW_genericFunc)RGFW_cb_keyfunc); + TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully %s", FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : ""); TRACELOG(LOG_INFO, " > Display size: %i x %i", CORE.Window.display.width, CORE.Window.display.height); @@ -2007,8 +2026,39 @@ static KeyboardKey ConvertScancodeToKey(u32 keycode) return (KeyboardKey)RGFW_keyConvertTable[keycode]; } +// assign mouse to touches +// 0-TOUCH_ACTION_UP, 1-TOUCH_ACTION_DOWN, 2-TOUCH_ACTION_MOVE +void RemapMouseToTouch(int touchAction) +{ + #if SUPPORT_GESTURES_SYSTEM + if (touchAction < 0) return; + + GestureEvent gestureEvent = { 0 }; + + // Register touch actions + gestureEvent.touchAction = touchAction; + + // Assign a pointer ID + gestureEvent.pointId[0] = 0; + + // Register touch points count + gestureEvent.pointCount = 1; + + // Register touch points position, only one point registered + if (touchAction == 2 /* || realTouch */) gestureEvent.position[0] = CORE.Input.Touch.position[0]; + else gestureEvent.position[0] = GetMousePosition(); + + // Normalize gestureEvent.position[0] for CORE.Window.screen.width and CORE.Window.screen.height + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + + // Gesture data is sent to gestures-system for processing + ProcessGestureEvent(gestureEvent); + #endif +} + // Helper functions for Time -double get_time_seconds(void) +double GetTimeSeconds(void) { double currentTime = 0.0; From ac6526b7314157a6b0a21c554139413c03b44337 Mon Sep 17 00:00:00 2001 From: InviseDivine <92590086+InviseDivine@users.noreply.github.com> Date: Sat, 13 Jun 2026 09:18:41 +0200 Subject: [PATCH 62/63] [rcore] Fix ``FileCopy`` doesn't copy file when directory exists (#5920) * Fix FileCopy result * fix code style --- src/rcore.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index 137dd99ce..fde64229d 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2237,8 +2237,14 @@ int FileCopy(const char *srcPath, const char *dstPath) unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize); // Create required paths if they do not exist - if (!DirectoryExists(GetDirectoryPath(dstPath))) + if (DirectoryExists(GetDirectoryPath(dstPath))) + { + result = 0; + } + else + { result = MakeDirectory(GetDirectoryPath(dstPath)); + } if (result == 0) // Directory created successfully (or already exists) { From 8713741782abfbeba7551a607c109b9fbd764cfa Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 13 Jun 2026 09:21:39 +0200 Subject: [PATCH 63/63] Update rcore.c --- src/rcore.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index fde64229d..a37400cf1 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2237,16 +2237,10 @@ int FileCopy(const char *srcPath, const char *dstPath) unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize); // Create required paths if they do not exist - if (DirectoryExists(GetDirectoryPath(dstPath))) - { - result = 0; - } - else - { - result = MakeDirectory(GetDirectoryPath(dstPath)); - } + if (DirectoryExists(GetDirectoryPath(dstPath))) result = 0; // Already exists + else result = MakeDirectory(GetDirectoryPath(dstPath)); - if (result == 0) // Directory created successfully (or already exists) + if (result == 0) // Directory created successfully or already exists { if ((srcFileData != NULL) && (srcDataSize > 0)) {