From 7a1cad3e615428d3b7f7dac41f3438e46e061e09 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 12 May 2024 13:31:38 +0200 Subject: [PATCH 01/56] Reviewed input params #3974 --- src/rlgl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 513dd3ed7..bef7eaf18 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -591,8 +591,8 @@ RLAPI void rlFrustum(double left, double right, double bottom, double top, doubl RLAPI void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar); RLAPI void rlViewport(int x, int y, int width, int height); // Set the viewport area RLAPI void rlSetClipPlanes(double near, double far); // Set clip planes distances -RLAPI double rlGetCullDistanceNear(); // Get cull plane distance near -RLAPI double rlGetCullDistanceFar(); // Get cull plane distance far +RLAPI double rlGetCullDistanceNear(void); // Get cull plane distance near +RLAPI double rlGetCullDistanceFar(void); // Get cull plane distance far //------------------------------------------------------------------------------------ // Functions Declaration - Vertex level operations @@ -2038,7 +2038,7 @@ void rlClearScreenBuffers(void) } // Check and log OpenGL error codes -void rlCheckErrors() +void rlCheckErrors(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) int check = 1; From f4b5622ba3a89bf1044ab7ba72384fb27c4837fe Mon Sep 17 00:00:00 2001 From: Alexei Mozaidze Date: Mon, 13 May 2024 02:27:02 +0400 Subject: [PATCH 02/56] feat(zig): add `opengl_version` option (#3979) Added `opengl_version` option to `src/build.zig`. --- src/build.zig | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/build.zig b/src/build.zig index 9fa1c57cd..e111d6388 100644 --- a/src/build.zig +++ b/src/build.zig @@ -88,6 +88,10 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. try c_source_files.append("rtextures.c"); } + if (options.opengl_version != .auto) { + raylib.defineCMacro(options.opengl_version.toCMacroStr(), null); + } + switch (target.result.os.tag) { .windows => { try c_source_files.append("rglfw.c"); @@ -134,7 +138,11 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. raylib.defineCMacro("PLATFORM_DESKTOP", null); } else { - raylib.linkSystemLibrary("GLESv2"); + if (options.opengl_version == .auto) { + raylib.linkSystemLibrary("GLESv2"); + raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); + } + raylib.linkSystemLibrary("EGL"); raylib.linkSystemLibrary("drm"); raylib.linkSystemLibrary("gbm"); @@ -145,7 +153,6 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. raylib.addIncludePath(.{ .cwd_relative = "/usr/include/libdrm" }); raylib.defineCMacro("PLATFORM_DRM", null); - raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); raylib.defineCMacro("EGL_NO_X11", null); raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048"); } @@ -183,7 +190,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. }, .emscripten => { raylib.defineCMacro("PLATFORM_WEB", null); - raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); + if (options.opengl_version == .auto) { + raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); + } if (b.sysroot == null) { @panic("Pass '--sysroot \"$EMSDK/upstream/emscripten\"'"); @@ -239,11 +248,34 @@ pub const Options = struct { platform_drm: bool = false, shared: bool = false, linux_display_backend: LinuxDisplayBackend = .X11, + opengl_version: OpenglVersion = .auto, raylib_dependency_name: []const u8 = "raylib", raygui_dependency_name: []const u8 = "raygui", }; +pub const OpenglVersion = enum { + auto, + gl_1_1, + gl_2_1, + gl_3_3, + gl_4_3, + gles_2, + gles_3, + + pub fn toCMacroStr(self: @This()) []const u8 { + switch (self) { + .auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"), + .gl_1_1 => return "GRAPHICS_API_OPENGL_11", + .gl_2_1 => return "GRAPHICS_API_OPENGL_21", + .gl_3_3 => return "GRAPHICS_API_OPENGL_33", + .gl_4_3 => return "GRAPHICS_API_OPENGL_43", + .gles_2 => return "GRAPHICS_API_OPENGL_ES2", + .gles_3 => return "GRAPHICS_API_OPENGL_ES3", + } + } +}; + pub const LinuxDisplayBackend = enum { X11, Wayland, @@ -270,6 +302,7 @@ pub fn build(b: *std.Build) !void { .rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes, .shared = b.option(bool, "shared", "Compile as shared library") orelse defaults.shared, .linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend, + .opengl_version = b.option(OpenglVersion, "opengl_version", "OpenGL version to use") orelse defaults.opengl_version, }; const lib = try compileRaylib(b, target, optimize, options); From 3f13f7921dc9eed92e450d0cc25e43241213db92 Mon Sep 17 00:00:00 2001 From: Filyus Date: Mon, 13 May 2024 03:33:09 +0500 Subject: [PATCH 03/56] Fix parsing of empty parentheses (#3974) Co-authored-by: Filyus --- parser/raylib_parser.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 9b8fd8b13..ec1d490e8 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -1006,8 +1006,14 @@ int main(int argc, char* argv[]) { funcEnd = c + 2; - // Check if previous word is void - if ((linePtr[c - 4] == 'v') && (linePtr[c - 3] == 'o') && (linePtr[c - 2] == 'i') && (linePtr[c - 1] == 'd')) break; + // Check if there are no parameters + if ((funcEnd - funcParamsStart == 2) || + ((linePtr[c - 4] == 'v') && + (linePtr[c - 3] == 'o') && + (linePtr[c - 2] == 'i') && + (linePtr[c - 1] == 'd'))) { + break; + } // Get parameter type + name, extract info char funcParamTypeName[128] = { 0 }; From 3d885ef9195825b03c9657f136293077e61ee503 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sun, 12 May 2024 15:36:23 -0700 Subject: [PATCH 04/56] [raymath] Add extern "C" to raymath header for C++ (#3978) * Update raylib_api.* by CI * Add an extern C to raymath to prevent warnings in C++ --------- Co-authored-by: github-actions[bot] --- src/raymath.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index 19625f10a..7a2f09296 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -77,6 +77,11 @@ #endif #endif + +#if defined(__cplusplus) +extern "C" { // Prevents name mangling of functions +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -2523,5 +2528,8 @@ RMAPI int QuaternionEquals(Quaternion p, Quaternion q) return result; } +#if defined(__cplusplus) +} +#endif #endif // RAYMATH_H From bf5eecc71f63d1bca76fdb377a1d231066f9258d Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Wed, 15 May 2024 07:16:45 -0700 Subject: [PATCH 05/56] [parser] Don't crash for files that don't end in newlines (#3981) The parser assumes all lines end in newlines, but sometimes this isn't true. Check for a null terminator along with '\n' when stripping leading spaces. --- parser/raylib_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index ec1d490e8..3e36f41f1 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -1243,7 +1243,7 @@ static char **GetTextLines(const char *buffer, int length, int *linesCount) while ((bufferPtr[index] == ' ') || (bufferPtr[index] == '\t')) index++; int j = 0; - while (bufferPtr[index + j] != '\n') + while (bufferPtr[index + j] != '\n' && bufferPtr[index + j] != '\0') { lines[i][j] = bufferPtr[index + j]; j++; From 46f98063597648227cfa6fbe96c189ed970faea8 Mon Sep 17 00:00:00 2001 From: Mike Will Date: Wed, 15 May 2024 10:19:22 -0400 Subject: [PATCH 06/56] Use logarithmic scaling for a 2d example with zoom functionality (#3977) --- examples/core/core_2d_camera_mouse_zoom.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/core/core_2d_camera_mouse_zoom.c b/examples/core/core_2d_camera_mouse_zoom.c index abc6a6d14..b96a3db43 100644 --- a/examples/core/core_2d_camera_mouse_zoom.c +++ b/examples/core/core_2d_camera_mouse_zoom.c @@ -63,10 +63,9 @@ int main () camera.target = mouseWorldPos; // Zoom increment - const float zoomIncrement = 0.125f; - - camera.zoom += (wheel*zoomIncrement); - if (camera.zoom < zoomIncrement) camera.zoom = zoomIncrement; + float scaleFactor = 1.0f + (0.25f * fabsf(wheel)); + if (wheel < 0) scaleFactor = 1.0f / scaleFactor; + camera.zoom = Clamp(camera.zoom * scaleFactor, 0.125, 64); } //---------------------------------------------------------------------------------- From 479bd84400d2da4af4f1c902db2f579611d36b99 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 15 May 2024 16:19:53 +0200 Subject: [PATCH 07/56] Update shaders_palette_switch.c --- examples/shaders/shaders_palette_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shaders/shaders_palette_switch.c b/examples/shaders/shaders_palette_switch.c index 3d7d409db..9ff86d83d 100644 --- a/examples/shaders/shaders_palette_switch.c +++ b/examples/shaders/shaders_palette_switch.c @@ -109,7 +109,7 @@ int main(void) if (currentPalette >= MAX_PALETTES) currentPalette = 0; else if (currentPalette < 0) currentPalette = MAX_PALETTES - 1; - // Send new value to the shader to be used on drawing. + // Send palette data to the shader to be used on drawing // NOTE: We are sending RGB triplets w/o the alpha channel SetShaderValueV(shader, paletteLoc, palettes[currentPalette], SHADER_UNIFORM_IVEC3, COLORS_PER_PALETTE); //---------------------------------------------------------------------------------- From 02d98a3e44b13584c98a7aaee0ca6fc5fb55a975 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 15 May 2024 16:33:06 +0200 Subject: [PATCH 08/56] REVIEWED: 2d camera zoom, add alternative method #3977 --- examples/core/core_2d_camera_mouse_zoom.c | 70 +++++++++++++++++------ 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/examples/core/core_2d_camera_mouse_zoom.c b/examples/core/core_2d_camera_mouse_zoom.c index b96a3db43..8af94440d 100644 --- a/examples/core/core_2d_camera_mouse_zoom.c +++ b/examples/core/core_2d_camera_mouse_zoom.c @@ -31,6 +31,8 @@ int main () Camera2D camera = { 0 }; camera.zoom = 1.0f; + int zoomMode = 0; // 0-Mouse Wheel, 1-Mouse Move + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -39,41 +41,69 @@ int main () { // Update //---------------------------------------------------------------------------------- + if (IsKeyPressed(KEY_ONE)) zoomMode = 0; + else if (IsKeyPressed(KEY_TWO)) zoomMode = 1; + // Translate based on mouse right click if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { Vector2 delta = GetMouseDelta(); delta = Vector2Scale(delta, -1.0f/camera.zoom); - camera.target = Vector2Add(camera.target, delta); } - // Zoom based on mouse wheel - float wheel = GetMouseWheelMove(); - if (wheel != 0) + if (zoomMode == 0) { - // Get the world point that is under the mouse - Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera); - - // Set the offset to where the mouse is - camera.offset = GetMousePosition(); + // Zoom based on mouse wheel + float wheel = GetMouseWheelMove(); + if (wheel != 0) + { + // Get the world point that is under the mouse + Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera); - // Set the target to match, so that the camera maps the world space point - // under the cursor to the screen space point under the cursor at any zoom - camera.target = mouseWorldPos; + // Set the offset to where the mouse is + camera.offset = GetMousePosition(); - // Zoom increment - float scaleFactor = 1.0f + (0.25f * fabsf(wheel)); - if (wheel < 0) scaleFactor = 1.0f / scaleFactor; - camera.zoom = Clamp(camera.zoom * scaleFactor, 0.125, 64); + // Set the target to match, so that the camera maps the world space point + // under the cursor to the screen space point under the cursor at any zoom + camera.target = mouseWorldPos; + + // Zoom increment + float scaleFactor = 1.0f + (0.25f*fabsf(wheel)); + if (wheel < 0) scaleFactor = 1.0f/scaleFactor; + camera.zoom = Clamp(camera.zoom*scaleFactor, 0.125f, 64.0f); + } } + else + { + // Zoom based on mouse left click + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) + { + // Get the world point that is under the mouse + Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera); + // Set the offset to where the mouse is + camera.offset = GetMousePosition(); + + // Set the target to match, so that the camera maps the world space point + // under the cursor to the screen space point under the cursor at any zoom + camera.target = mouseWorldPos; + } + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) + { + // Zoom increment + float deltaX = GetMouseDelta().x; + float scaleFactor = 1.0f + (0.01f*fabsf(deltaX)); + if (deltaX < 0) scaleFactor = 1.0f/scaleFactor; + camera.zoom = Clamp(camera.zoom*scaleFactor, 0.125f, 64.0f); + } + } //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(BLACK); + ClearBackground(RAYWHITE); BeginMode2D(camera); @@ -86,11 +116,13 @@ int main () rlPopMatrix(); // Draw a reference circle - DrawCircle(100, 100, 50, YELLOW); + DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON); EndMode2D(); - DrawText("Mouse right button drag to move, mouse wheel to zoom", 10, 10, 20, WHITE); + DrawText("[1][2] Select mouse zoom mode (Wheel or Move)", 20, 20, 20, DARKGRAY); + if (zoomMode == 0) DrawText("Mouse right button drag to move, mouse wheel to zoom", 20, 50, 20, DARKGRAY); + else DrawText("Mouse right button drag to move, mouse press and move to zoom", 20, 50, 20, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- From d6b22b17aecd2346d4fd1fc8ebaea8212e40008f Mon Sep 17 00:00:00 2001 From: CosmicBagel <854116+CosmicBagel@users.noreply.github.com> Date: Wed, 15 May 2024 15:20:34 -0600 Subject: [PATCH 09/56] LazyPath.path has been deprecated, using b.path() (#3983) This works in zig 0.12, LazyPath.path has been removed in zig 0.13 Co-authored-by: CosmicBagel <> --- src/build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.zig b/src/build.zig index e111d6388..d172b3c2a 100644 --- a/src/build.zig +++ b/src/build.zig @@ -204,7 +204,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); dir.close(); - raylib.addIncludePath(.{ .path = cache_include }); + raylib.addIncludePath(b.path(cache_include)); }, else => { @panic("Unsupported OS"); From f26bfa0c8efcf81559c2ba225e79778b1542d60f Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Wed, 15 May 2024 22:42:52 -0700 Subject: [PATCH 10/56] [RAYMATH] Revert Extern 'C' in raymath (#3985) * Update raylib_api.* by CI * Remove Extern C for raymath, it breaks some cases in mingw-w64 and does not fix any warning issues. --------- Co-authored-by: github-actions[bot] --- src/raymath.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 7a2f09296..d036721a2 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -78,10 +78,6 @@ #endif -#if defined(__cplusplus) -extern "C" { // Prevents name mangling of functions -#endif - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -2528,8 +2524,5 @@ RMAPI int QuaternionEquals(Quaternion p, Quaternion q) return result; } -#if defined(__cplusplus) -} -#endif #endif // RAYMATH_H From 1d52985943d102b321c631bc4d24cca8ad0f651e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cemal=20G=C3=B6n=C3=BClta=C5=9F?= <45357531+cemalgnlts@users.noreply.github.com> Date: Thu, 16 May 2024 13:01:27 +0300 Subject: [PATCH 11/56] [rcore_web] Relative mouse mode issues. (#3940) * [rcore_web] Relative mouse mode issues. * Review formatting. --- .gitignore | 3 +++ src/platforms/rcore_web.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6ff0e2346..eeb1ed09d 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,9 @@ packages/ *.so.* *.dll +# Emscripten +emsdk + # Ignore wasm data in examples/ examples/**/*.wasm examples/**/*.data diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 9328b8c9b..afe8adfb1 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -100,6 +100,8 @@ static const char cursorLUT[11][12] = { "not-allowed" // 10 MOUSE_CURSOR_NOT_ALLOWED }; +Vector2 lockedMousePos = { 0 }; + //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- @@ -131,6 +133,7 @@ static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUi static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData); // Emscripten input callback events +static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData); static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData); static EM_BOOL EmscriptenPointerlockCallback(int eventType, const EmscriptenPointerlockChangeEvent *pointerlockChangeEvent, void *userData); static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData); @@ -862,6 +865,8 @@ void SetMousePosition(int x, int y) CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; + if (CORE.Input.Mouse.cursorHidden) lockedMousePos = CORE.Input.Mouse.currentPosition; + // NOTE: emscripten not implemented glfwSetCursorPos(platform.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y); } @@ -1270,6 +1275,9 @@ int InitPlatform(void) emscripten_set_click_callback("#canvas", NULL, 1, EmscriptenMouseCallback); emscripten_set_pointerlockchange_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, 1, EmscriptenPointerlockCallback); + // Following the mouse delta when the mouse is locked + emscripten_set_mousemove_callback("#canvas", NULL, 1, EmscriptenMouseMoveCallback); + // Support touch events emscripten_set_touchstart_callback("#canvas", NULL, 1, EmscriptenTouchCallback); emscripten_set_touchend_callback("#canvas", NULL, 1, EmscriptenTouchCallback); @@ -1477,9 +1485,13 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int // GLFW3 Cursor Position Callback, runs on mouse move static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) { - CORE.Input.Mouse.currentPosition.x = (float)x; - CORE.Input.Mouse.currentPosition.y = (float)y; - CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; + // If the pointer is not locked, follow the position + if (!CORE.Input.Mouse.cursorHidden) + { + CORE.Input.Mouse.currentPosition.x = (float)x; + CORE.Input.Mouse.currentPosition.y = (float)y; + CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; + } #if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES) // Process mouse events as touches to be able to use mouse-gestures @@ -1505,6 +1517,18 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) #endif } +static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) +{ + // To emulate the GLFW_RAW_MOUSE_MOTION property. + if (CORE.Input.Mouse.cursorHidden) + { + CORE.Input.Mouse.previousPosition.x = lockedMousePos.x - mouseEvent->movementX; + CORE.Input.Mouse.previousPosition.y = lockedMousePos.y - mouseEvent->movementY; + } + + return 1; // The event was consumed by the callback handler +} + // GLFW3 Scrolling Callback, runs on mouse wheel static void MouseScrollCallback(GLFWwindow *window, double xoffset, double yoffset) { @@ -1598,6 +1622,12 @@ static EM_BOOL EmscriptenPointerlockCallback(int eventType, const EmscriptenPoin { CORE.Input.Mouse.cursorHidden = EM_ASM_INT( { if (document.pointerLockElement) return 1; }, 0); + if (CORE.Input.Mouse.cursorHidden) + { + lockedMousePos = CORE.Input.Mouse.currentPosition; + CORE.Input.Mouse.previousPosition = lockedMousePos; + } + return 1; // The event was consumed by the callback handler } From 3d70d6179c4809d8b7e92215358394e3584bca79 Mon Sep 17 00:00:00 2001 From: FishingHacks Date: Thu, 16 May 2024 19:47:39 +0200 Subject: [PATCH 12/56] [raudio] Removed drwav_uninit in LoadMusicStream to fix a crash (#3986) --- src/raudio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/raudio.c b/src/raudio.c index 9d7c39a5b..8f4bf7a51 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1348,7 +1348,6 @@ Music LoadMusicStream(const char *fileName) } else { - drwav_uninit(ctxWav); RL_FREE(ctxWav); } } From 00ac9b6c533e964ae2d5c5726e5d6c1f00964d0f Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 18 May 2024 07:40:59 +0200 Subject: [PATCH 13/56] Update config.h --- src/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.h b/src/config.h index 1fe21454f..3c92de72d 100644 --- a/src/config.h +++ b/src/config.h @@ -189,7 +189,7 @@ #define SUPPORT_DEFAULT_FONT 1 // Selected desired font fileformats to be supported for loading #define SUPPORT_FILEFORMAT_TTF 1 -//#define SUPPORT_FILEFORMAT_FNT 1 +#define SUPPORT_FILEFORMAT_FNT 1 //#define SUPPORT_FILEFORMAT_BDF 1 // Support text management functions From 9d67f4734b59244b5b10d45ce7c8eed76323c3b5 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 18 May 2024 07:41:37 +0200 Subject: [PATCH 14/56] REVIEWED: LoadBMFont(), issue on not glyph data initialized --- src/rtext.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index b5ba17e3a..1ddb62509 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2240,7 +2240,11 @@ static Font LoadBMFont(const char *fileName) // Fill character image data from full font data font.glyphs[i].image = ImageFromImage(fullFont, font.recs[i]); } - else TRACELOG(LOG_WARNING, "FONT: [%s] Some characters data not correctly provided", fileName); + else + { + font.glyphs[i].image = GenImageColor(font.recs[i].width, font.recs[i].height, BLACK); + TRACELOG(LOG_WARNING, "FONT: [%s] Some characters data not correctly provided", fileName); + } } UnloadImage(fullFont); From bb9bd73f435892b6f6f17d7068a7fe56dfca235d Mon Sep 17 00:00:00 2001 From: listeria <56203103+ListeriaM@users.noreply.github.com> Date: Tue, 21 May 2024 03:13:46 -0300 Subject: [PATCH 15/56] fix WaveCrop() and use frames instead of samples (#3994) Co-authored-by: Listeria monocytogenes --- src/raudio.c | 12 ++++++------ src/raylib.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/raudio.c b/src/raudio.c index 8f4bf7a51..e74f8590e 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1274,17 +1274,17 @@ Wave WaveCopy(Wave wave) return newWave; } -// Crop a wave to defined samples range +// Crop a wave to defined frames range // NOTE: Security check in case of out-of-range -void WaveCrop(Wave *wave, int initSample, int finalSample) +void WaveCrop(Wave *wave, int initFrame, int finalFrame) { - if ((initSample >= 0) && (initSample < finalSample) && ((unsigned int)finalSample < (wave->frameCount*wave->channels))) + if ((initFrame >= 0) && (initFrame < finalFrame) && ((unsigned int)finalFrame < wave->frameCount)) { - int sampleCount = finalSample - initSample; + int frameCount = finalFrame - initFrame; - void *data = RL_MALLOC(sampleCount*wave->sampleSize/8); + void *data = RL_MALLOC(frameCount*wave->channels*wave->sampleSize/8); - memcpy(data, (unsigned char *)wave->data + (initSample*wave->channels*wave->sampleSize/8), sampleCount*wave->sampleSize/8); + memcpy(data, (unsigned char *)wave->data + (initFrame*wave->channels*wave->sampleSize/8), frameCount*wave->channels*wave->sampleSize/8); RL_FREE(wave->data); wave->data = data; diff --git a/src/raylib.h b/src/raylib.h index 035f6f2bf..c53ea555b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1624,7 +1624,7 @@ RLAPI void SetSoundVolume(Sound sound, float volume); // Set vol 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 (0.5 is center) RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave -RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +RLAPI void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() From 272a142ee5b830ff6742c2df6a7b3abe7399cfde Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 21 May 2024 06:14:05 +0000 Subject: [PATCH 16/56] Update raylib_api.* by CI --- parser/output/raylib_api.json | 6 +++--- parser/output/raylib_api.lua | 6 +++--- parser/output/raylib_api.txt | 6 +++--- parser/output/raylib_api.xml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index d50085a4a..5a9f4fc5d 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -11231,7 +11231,7 @@ }, { "name": "WaveCrop", - "description": "Crop a wave to defined samples range", + "description": "Crop a wave to defined frames range", "returnType": "void", "params": [ { @@ -11240,11 +11240,11 @@ }, { "type": "int", - "name": "initSample" + "name": "initFrame" }, { "type": "int", - "name": "finalSample" + "name": "finalFrame" } ] }, diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index ef8e1c51e..d60ea191c 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -7733,12 +7733,12 @@ return { }, { name = "WaveCrop", - description = "Crop a wave to defined samples range", + description = "Crop a wave to defined frames range", returnType = "void", params = { {type = "Wave *", name = "wave"}, - {type = "int", name = "initSample"}, - {type = "int", name = "finalSample"} + {type = "int", name = "initFrame"}, + {type = "int", name = "finalFrame"} } }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 631be9a8b..f4973dae6 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -4314,10 +4314,10 @@ Function 523: WaveCopy() (1 input parameters) Function 524: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void - Description: Crop a wave to defined samples range + Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) - Param[2]: initSample (type: int) - Param[3]: finalSample (type: int) + Param[2]: initFrame (type: int) + Param[3]: finalFrame (type: int) Function 525: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index e17c59d09..e079a198e 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2870,10 +2870,10 @@ - + - - + + From 74d7e78b702a66c3ee6e9cc711e19f283e1324c0 Mon Sep 17 00:00:00 2001 From: IoIxD <30945097+IoIxD@users.noreply.github.com> Date: Tue, 21 May 2024 03:53:05 -0700 Subject: [PATCH 17/56] BINDINGS.md: raylib-rs now at 5.0 (#3991) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 93ae18792..3457f2b16 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -62,7 +62,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to | raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp | | raylibr | 4.0 | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr | | raylib-ffi | 4.5 | [Rust](https://www.rust-lang.org/) | GPLv3 | https://github.com/ewpratten/raylib-ffi | -| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs | +| raylib-rs | 5.0 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/raylib-rs/raylib-rs | | Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib | | racket-raylib | 4.0 | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib | | raylib-swift | 4.0 | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib | From fc9634a4de732448abf04de3217be698a6560c51 Mon Sep 17 00:00:00 2001 From: Carmine Pietroluongo <72702101+Odex64@users.noreply.github.com> Date: Tue, 21 May 2024 13:07:31 +0200 Subject: [PATCH 18/56] Update BINDINGS.md (#3995) --- BINDINGS.md | 290 ++++++++++++++++++++++++++-------------------------- 1 file changed, 146 insertions(+), 144 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 3457f2b16..3996105d9 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -4,156 +4,158 @@ Some people ported raylib to other languages in form of bindings or wrappers to ### Language Bindings -| name | raylib version | language | license | repo | -|:------------------:|:---------------:|:---------:|:----------:|-----------------------------------------------------------| -| raylib | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | https://github.com/raysan5/raylib | -| raylib-beef | **5.0** | [Beef](https://www.beeflang.org/) | MIT | https://github.com/Starpelly/raylib-beef | -| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo | -| Raylib-cs | 5.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | https://github.com/ChrisDill/Raylib-cs | -| Raylib-CsLo | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/NotNotTech/Raylib-CsLo | -| cl-raylib | 4.0 | [Common Lisp](https://common-lisp.net/) | MIT | https://github.com/longlene/cl-raylib | -| claylib/wrap | 4.5 | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib | -| claw-raylib | **auto** | [Common Lisp](https://common-lisp.net/) | Apache-2.0 | https://github.com/bohonghuang/claw-raylib | -| chez-raylib | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme/) | GPLv3 | https://github.com/Yunoinsky/chez-raylib | -| raylib-cr | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org/) | Apache-2.0 | https://github.com/sol-vin/raylib-cr | -| ray-cyber | 5.0 | [Cyber](https://cyberscript.dev) | MIT | https://github.com/fubark/ray-cyber | -| dart-raylib | 4.0 | [Dart](https://dart.dev/) | MIT | https://gitlab.com/wolfenrain/dart-raylib | -| bindbc-raylib3 | **5.0** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 | -| dray | 4.2 | [D](https://dlang.org/) | Apache-2.0 | https://github.com/redthing1/dray | -| raylib-d | **5.0** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d | -| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex | -| raylib-factor | 4.5 | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor | -| raylib-freebasic | **5.0** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic | -| fortran-raylib | 4.5 | [Fortran](https://fortran-lang.org/) | ISC | https://github.com/interkosmos/fortran-raylib | -| raylib-go | **5.0** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go | -| raylib-guile | **auto** | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile | -| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | **???** | https://github.com/ArnautDaniel/gforth-raylib | -| h-raylib | **5.1-dev** | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib | -| raylib-hx | 4.2 | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx | -| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib | -| jaylib | 5.0 | [Janet](https://janet-lang.org/) | MIT | https://github.com/janet-lang/jaylib | -| jaylib | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ | -| raylib-j | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J | -| raylib.jl | 4.2 | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl | -| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | ? | https://github.com/electronstudio/kaylib | -| KaylibKit | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | https://codeberg.org/Kenta/KaylibKit | -| raylib-lua | 4.5 | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua | -| raylua | 4.0 | [Lua](http://www.lua.org/) | MIT | https://github.com/Rabios/raylua | -| raylib-matte | 4.6-dev | [Matte](https://github.com/jcorks/matte/) | MIT | https://github.com/jcorks/raylib-matte | -| Raylib.nelua | **5.0** | [nelua](https://nelua.io/) | Zlib | https://github.com/AuzFox/Raylib.nelua | -| NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now | -| raylib-bindings | 4.5 | [Ruby](https://www.ruby-lang.org/en/) | Zlib | https://github.com/vaiorabbit/raylib-bindings | -| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever | -| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib | -| node-raylib | 4.5 | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib | -| raylib-odin | 5.0 | [Odin](https://odin-lang.org/) | BSD-3Clause | https://github.com/odin-lang/Odin/tree/master/vendor/raylib | -| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | MIT | https://github.com/Deathbat2190/raylib_odin_bindings | -| raylib-ocaml | **5.0** | [OCaml](https://ocaml.org/) | MIT | https://github.com/tjammer/raylib-ocaml | -| TurboRaylib | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | https://github.com/turborium/TurboRaylib | -| Ray4Laz | **5.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/GuvaCode/Ray4Laz | -| Raylib.4.0.Pascal | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/sysrpl/Raylib.4.0.Pascal | -| pyraylib | 3.7 | [Python](https://www.python.org/) | Zlib | https://github.com/Ho011/pyraylib | -| raylib-python-cffi | 4.2 | [Python](https://www.python.org/) | EPL-2.0 | https://github.com/electronstudio/raylib-python-cffi | -| raylibpyctbg | 4.5 | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg | -| raylib-py | **5.0b1** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py | -| raylib-python-ctypes | 4.6-dev | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes | -| raylib-pkpy-bindings | 4.6-dev | [pocketpy](https://pocketpy.dev/) | MIT | https://github.com/blueloveTH/pkpy-bindings | -| raylib-php | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php | -| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp | -| raylibr | 4.0 | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr | -| raylib-ffi | 4.5 | [Rust](https://www.rust-lang.org/) | GPLv3 | https://github.com/ewpratten/raylib-ffi | -| raylib-rs | 5.0 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/raylib-rs/raylib-rs | -| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib | -| racket-raylib | 4.0 | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib | -| raylib-swift | 4.0 | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib | -| raylib-scopes | auto | [Scopes](http://scopes.rocks) | MIT | https://github.com/salotz/raylib-scopes | -| raylib-SmallBASIC | 5.0 | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib | -| raylib-umka | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | https://github.com/robloach/raylib-umka | -| raylib.v | 4.2 | [V](https://vlang.io/) | Zlib | https://github.com/irishgreencitrus/raylib.v | -| raylib-vapi | 5.0 | [Vala](https://vala.dev/) | Zlib | https://github.com/lxmcf/raylib-vapi | -| raylib-wren | 4.0 | [Wren](http://wren.io/) | ISC | https://github.com/TSnake41/raylib-wren | -| raylib-zig | 5.0 | [Zig](https://ziglang.org/) | MIT | https://github.com/Not-Nik/raylib-zig | -| raylib.zig | 5.1-dev | [Zig](https://ziglang.org/) | MIT | https://github.com/ryupold/raylib.zig | -| hare-raylib | **auto** | [Hare](https://harelang.org/) | Zlib | https://git.sr.ht/~evantj/hare-raylib | -| raylib-sunder | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | https://github.com/ashn-dot-dev/raylib-sunder | -| rayed-bqn | **auto** | [BQN](https://mlochbaum.github.io/BQN/) | MIT | https://github.com/Brian-ED/rayed-bqn | -| rayjs | 4.6-dev | [QuickJS](https://bellard.org/quickjs/) | MIT | https://github.com/mode777/rayjs | -| raylib-raku | **auto** | [Raku](https://www.raku.org/) | Artistic License 2.0 | https://github.com/vushu/raylib-raku | -| Raylib.lean | 4.5 | [Lean4](https://lean-lang.org/) | BSD-3-Clause | https://github.com/KislyjKisel/Raylib.lean | -| Raylib-CSharp-Vinculum | 5.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/ZeroElectric/Raylib-CSharp-Vinculum | -| raylib-cobol | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain | https://codeberg.org/glowiak/raylib-cobol | -| Raylib-CSharp | 5.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | https://github.com/MrScautHD/Raylib-CSharp | +| Name | raylib Version | Language | License | +| ---------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------- | -------------------- | +| [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | +| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.0** | [Beef](https://www.beeflang.org) | MIT | +| [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | +| [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | +| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | +| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | +| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | +| [Raylib.NET](https://github.com/Odex64/Raylib.NET) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | +| [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT | +| [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | +| [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 | +| [chez-raylib](https://github.com/Yunoinsky/chez-raylib) | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme) | GPLv3 | +| [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 | +| [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 | +| [dray](https://github.com/redthing1/dray) | 4.2 | [D](https://dlang.org) | Apache-2.0 | +| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.0** | [D](https://dlang.org) | Zlib | +| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 | +| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD | +| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT | +| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | 4.5 | [Fortran](https://fortran-lang.org) | ISC | +| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.0** | [Go](https://golang.org) | Zlib | +| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib | +| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** | +| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.1-dev** | [Haskell](https://haskell.org) | Apache-2.0 | +| [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib | +| [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT | +| [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT | +| [jaylib](https://github.com/electronstudio/jaylib/) | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | +| [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | +| [raylib.jl](https://github.com/irishgreencitrus/raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | +| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | +| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | +| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 4.5 | [Lua](http://www.lua.org) | ISC | +| [raylua](https://github.com/Rabios/raylua) | 4.0 | [Lua](http://www.lua.org) | MIT | +| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT | +| [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | +| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 4.5 | [Ruby](https://www.ruby-lang.org/en) | Zlib | +| [NimraylibNow!](https://github.com/greenfork/nimraylib_now) | 4.2 | [Nim](https://nim-lang.org) | MIT | +| [raylib-Forever](https://github.com/Guevara-chan/Raylib-Forever) | auto | [Nim](https://nim-lang.org) | **???** | +| [naylib](https://github.com/planetis-m/naylib) | auto | [Nim](https://nim-lang.org) | MIT | +| [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.0** | [Odin](https://odin-lang.org) | BSD-3Clause | +| [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 | +| [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | +| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | 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 | +| [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | +| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 4.2 | [Python](https://www.python.org) | EPL-2.0 | +| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT | +| [raylib-py](https://github.com/overdev/raylib-py) | **5.0b1** | [Python](https://www.python.org) | MIT | +| [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT | +| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 4.6-dev | [pocketpy](https://pocketpy.dev) | MIT | +| [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | +| [raylib-phpcpp](https://github.com/oraoto/raylib-phpcpp) | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | +| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT | +| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 4.5 | [Rust](https://www.rust-lang.org) | GPLv3 | +| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.0** | [Rust](https://www.rust-lang.org) | Zlib | +| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** | +| [racket-raylib](https://github.com/eutro/racket-raylib) | 4.0 | [Racket](https://racket-lang.org) | MIT/Apache-2.0 | +| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT | +| [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT | +| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.0** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | +| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | +| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib | +| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib | +| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.0 | [Wren](http://wren.io) | ISC | +| [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.0** | [Zig](https://ziglang.org) | MIT | +| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT | +| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib | +| [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | +| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **auto** | [BQN](https://mlochbaum.github.io/BQN) | MIT | +| [rayjs](https://github.com/mode777/rayjs) | 4.6-dev | [QuickJS](https://bellard.org/quickjs) | MIT | +| [raylib-raku](https://github.com/vushu/raylib-raku) | **auto** | [Raku](https://www.raku.org) | Artistic License 2.0 | +| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | 4.5 | [Lean4](https://lean-lang.org) | BSD-3-Clause | +| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain | ### Utility Wrapers + These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm. -| name | raylib version | language | license | repo | -|:------------------:|:-------------: | :--------:|:-------:|:-------------------------------------------------------------| -| raylib-cpp | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | https://github.com/robloach/raylib-cpp | -| claylib | **4.5** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib | +| Name | raylib Version | Language | License | +| ---------------------------------------------------- | -------------- | -------------------------------------------- | ------- | +| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | +| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | ### Older or Unmaintained Language Bindings -These are older raylib bindings that are more than 2 versions old or have not been maintained. -| name | raylib version | language | repo | -|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------| -| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp | -| RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS | -| raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d | -| bindbc-raylib | 3.0 | [D](https://dlang.org/) | https://github.com/o3o/bindbc-raylib | -| go-raylib | 3.5 | [Go](https://golang.org/) | https://github.com/chunqian/go-raylib | -| raylib-goplus | 2.6-dev | [Go](https://golang.org/) | https://github.com/Lachee/raylib-goplus | -| ray-go | 2.6-dev | [Go](https://golang.org/) | https://github.com/hecate-tech/ray-go | -| raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore | -| LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib | -| raylib-lua-sol | 2.5 | [Lua](http://www.lua.org/) | https://github.com/RobLoach/raylib-lua-sol | -| raylib-lua-ffi | 2.0 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib/issues/693 | -| raylib-lua | 1.7 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib-lua | -| raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua | -| raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim | -| raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim | -| nim-raylib | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/tomc1998/nim-raylib | -| raylib-haskell | 2.0 | [Haskell](https://www.haskell.org/) | https://github.com/DevJac/raylib-haskell | -| raylib-cr | 2.5-dev | [Crystal](https://crystal-lang.org/) | https://github.com/AregevDev/raylib-cr | -| raylib.cr | 2.0 | [Crystal](https://crystal-lang.org/) | https://github.com/sam0x17/raylib.cr | -| cray | 1.8 | [Crystal](https://crystal-lang.org/) | https://gitlab.com/Zatherz/cray | -| raylib-pas | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/tazdij/raylib-pas | -| raylib-pascal | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/drezgames/raylib-pascal | -| Graphics-Raylib | 1.4 | [Perl](https://www.perl.org/) | https://github.com/athreef/Graphics-Raylib | -| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby | -| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi | -| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby | -| raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java | -| clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib | -| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib | -| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape | -| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 | -| raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript | -| raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel | -| racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d | -| raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi | -| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe | -| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib | -| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm | -| raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi | -| raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme | -| Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib | -| raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin | -| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib | -| raylib-vala | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | https://code.guddler.uk/mart/raylibVapi | -| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/raylib-jai | -| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments | -| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada | -| raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit | -| ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod | -| raylib-mosaic | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | https://github.com/pluckyporcupine/raylib-mosaic | -| raylib-xdpw | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | https://github.com/vtereshkov/raylib-xdpw | -| raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp | -| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb | -| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic | -| raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 | -| raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef | -| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never | -| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* | +These are older raylib bindings that are more than 2 versions old or have not been maintained. +| Name | raylib Version | Language | +| ---------------------------------------------------------------------------------- | -------------- | ----------------------------------------------------------------------- | +| [raylib-cppsharp](https://github.com/phxvyper/raylib-cppsharp) | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | +| [RaylibFS](https://github.com/dallinbeutler/RaylibFS) | 2.5 | [F#](https://fsharp.org) | +| [raylib\*d](https://github.com/Sepheus/raylib_d) | 2.5 | [D](https://dlang.org) | +| [bindbc-raylib](https://github.com/o3o/bindbc-raylib) | 3.0 | [D](https://dlang.org) | +| [go-raylib](https://github.com/chunqian/go-raylib) | 3.5 | [Go](https://golang.org) | +| [raylib-goplus](https://github.com/Lachee/raylib-goplus) | 2.6-dev | [Go](https://golang.org) | +| [ray-go](https://github.com/hecate-tech/ray-go) | 2.6-dev | [Go](https://golang.org) | +| [raylib-luamore](https://github.com/HDPLocust/raylib-luamore) | 3.0 | [Lua](http://www.lua.org) | +| [LuaJIT-Raylib](https://github.com/Bambofy/LuaJIT-Raylib) | 2.6 | [Lua](http://www.lua.org) | +| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 2.5 | [Lua](http://www.lua.org) | +| [raylib-lua-ffi](https://github.com/raysan5/raylib/issues/693) | 2.0 | [Lua](http://www.lua.org) | +| [raylib-lua](https://github.com/raysan5/raylib-lua) | 1.7 | [Lua](http://www.lua.org) | +| [raylib-nelua](https://github.com/Andre-LA/raylib-nelua) | 3.0 | [Nelua](https://nelua.io) | +| [raylib-nim](https://github.com/Skrylar/raylib-nim) | 2.0 | [Nim](https://nim-lang.org) | +| [raylib-Nim](https://gitlab.com/define-private-public/raylib-Nim) | 1.7 | [Nim](https://nim-lang.org) | +| [nim-raylib](https://github.com/tomc1998/nim-raylib) | 3.1-dev | [Nim](https://nim-lang.org) | +| [raylib-haskell](https://github.com/DevJac/raylib-haskell) | 2.0 | [Haskell](https://www.haskell.org) | +| [raylib-cr](https://github.com/AregevDev/raylib-cr) | 2.5-dev | [Crystal](https://crystal-lang.org) | +| [raylib.cr](https://github.com/sam0x17/raylib.cr) | 2.0 | [Crystal](https://crystal-lang.org) | +| [cray](https://gitlab.com/Zatherz/cray) | 1.8 | [Crystal](https://crystal-lang.org) | +| [raylib-pas](https://github.com/tazdij/raylib-pas) | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal*(programming*language)) | +| [raylib-pascal](https://github.com/drezgames/raylib-pascal) | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal*(programming*language)) | +| [Graphics-Raylib](https://github.com/athreef/Graphics-Raylib) | 1.4 | [Perl](https://www.perl.org) | +| [raylib-ruby](https://github.com/a0/raylib-ruby) | 2.6 | [Ruby](https://www.ruby-lang.org/en) | +| [raylib-ruby-ffi](https://github.com/D3nX/raylib-ruby-ffi) | 2.0 | [Ruby](https://www.ruby-lang.org/en) | +| [raylib-mruby](https://github.com/lihaochen910/raylib-mruby) | 2.5-dev | [mruby](https://github.com/mruby/mruby) | +| [raylib-java](https://github.com/XoanaIO/raylib-java) | 2.0 | [Java](https://en.wikipedia.org/wiki/Java*(programming_language)) | +| [clj-raylib](https://github.com/lsevero/clj-raylib) | 3.0 | [Clojure](https://clojure.org) | +| [QuickJS-raylib](https://github.com/sntg-p/QuickJS-raylib) | 3.0 | [QuickJS](https://bellard.org/quickjs) | +| [raylib-duktape](https://github.com/RobLoach/raylib-duktape) | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | +| [raylib-v7](https://github.com/Rabios/raylib-v7) | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | +| [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) | 2.6 | [ChaiScript](http://chaiscript.com) | +| [raylib-squirrel](https://github.com/RobLoach/raylib-squirrel) | 2.5 | [Squirrel](http://www.squirrel-lang.org) | +| [racket-raylib-2d](https://github.com/arvyy/racket-raylib-2d) | 2.5 | [Racket](https://racket-lang.org) | +| [raylib-php-ffi](https://github.com/oraoto/raylib-php-ffi) | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | +| [raylib-haxe](https://github.com/ibilon/raylib-haxe) | 2.4 | [Haxe](https://haxe.org) | +| [ringraylib](https://github.com/ringpackages/ringraylib) | 2.6 | [Ring](http://ring-lang.sourceforge.net) | +| [raylib-scm](https://github.com/yashrk/raylib-scm) | 2.5 | [Chicken Scheme](https://www.call-cc.org) | +| [raylib-chibi](https://github.com/VincentToups/raylib-chibi) | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | +| [raylib-gambit-scheme](https://github.com/georgjz/raylib-gambit-scheme) | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | +| [Euraylib](https://github.com/gAndy50/Euraylib) | 3.0 | [Euphoria](https://openeuphoria.org) | +| [raylib-odin](https://github.com/kevinw/raylib-odin) | 3.0 | [Odin](https://odin-lang.org) | +| [vraylib](https://github.com/waotzi/vraylib) | 3.5 | [V](https://vlang.io) | +| [raylib-vala](https://code.guddler.uk/mart/raylibVapi) | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | +| [raylib-jai](https://github.com/kujukuju/raylib-jai) | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | +| [ray.zig](https://github.com/BitPuffin/zig-raylib-experiments) | 2.5 | [Zig](https://ziglang.org) | +| [raylib-Ada](https://github.com/mimo/raylib-Ada) | 3.0 | [Ada](https://www.adacore.com/about-ada) | +| [raykit](https://github.com/Gamerfiend/raykit) | **???** | [Kit](https://www.kitlang.org) | +| [ray.mod](https://github.com/bmx-ng/ray.mod) | 3.0 | [BlitzMax](https://blitzmax.org) | +| [raylib-mosaic](https://github.com/pluckyporcupine/raylib-mosaic) | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | +| [raylib-xdpw](https://github.com/vtereshkov/raylib-xdpw) | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | +| [raylib-carp](https://github.com/pluckyporcupine/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) | +| [raylib-fb](https://github.com/IchMagBier/raylib-fb) | 3.0 | [FreeBasic](https://www.freebasic.net) | +| [raylib-purebasic](https://github.com/D-a-n-i-l-o/raylib-purebasic) | 3.0 | [PureBasic](https://www.purebasic.com) | +| [raylib-ats2](https://github.com/mephistopheles-8/raylib-ats2) | 3.0 | [ATS2](http://www.ats-lang.org) | +| [raylib-beef](https://github.com/M0n7y5/raylib-beef) | 3.0 | [Beef](https://www.beeflang.org) | +| [raylib-never](https://github.com/never-lang/raylib-never) | 3.0 | [Never](https://github.com/never-lang/never) | +| [raylib.cbl](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib) | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | Missing some language or wrapper? Feel free to create a new one! :) From b2f4f4d8fd3f780ec6f711ede668d8de17abb792 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 May 2024 13:10:38 +0200 Subject: [PATCH 19/56] Update BINDINGS.md --- BINDINGS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 3996105d9..04102f707 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -5,7 +5,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to ### Language Bindings | Name | raylib Version | Language | License | -| ---------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------- | -------------------- | +| :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: | | [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.0** | [Beef](https://www.beeflang.org) | MIT | | [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | @@ -89,7 +89,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm. | Name | raylib Version | Language | License | -| ---------------------------------------------------- | -------------- | -------------------------------------------- | ------- | +| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: | | [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | | [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | @@ -97,7 +97,7 @@ These are utility wrappers for specific languages, they are not required to use These are older raylib bindings that are more than 2 versions old or have not been maintained. | Name | raylib Version | Language | -| ---------------------------------------------------------------------------------- | -------------- | ----------------------------------------------------------------------- | +| ---------------------------------------------------------------------------------- | :------------: | :---------------------------------------------------------------------: | | [raylib-cppsharp](https://github.com/phxvyper/raylib-cppsharp) | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | | [RaylibFS](https://github.com/dallinbeutler/RaylibFS) | 2.5 | [F#](https://fsharp.org) | | [raylib\*d](https://github.com/Sepheus/raylib_d) | 2.5 | [D](https://dlang.org) | From c4a51a3ebdaa3a5bd1414d0b293e1a5100f578f6 Mon Sep 17 00:00:00 2001 From: Salvador Galindo Date: Tue, 21 May 2024 04:47:26 -0700 Subject: [PATCH 20/56] fixed out of bounds error in GenMeshTangents (#3990) --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 27c19a3c7..2ef030186 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3431,7 +3431,7 @@ void GenMeshTangents(Mesh *mesh) Vector3 *tan1 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3)); Vector3 *tan2 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3)); - for (int i = 0; i < mesh->vertexCount; i += 3) + for (int i = 0; i < mesh->vertexCount - 3; i += 3) { // Get triangle vertices Vector3 v1 = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] }; From 9ef29aff9aa08e64ac2d25048829de7459ee7d25 Mon Sep 17 00:00:00 2001 From: OetkenPurveyorOfCode Date: Tue, 21 May 2024 15:44:02 +0200 Subject: [PATCH 21/56] [rtextures] Fix Undefined behaviour in ColorToInt (#3996) --- src/rtextures.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 47ff83f5c..ca4c60d16 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4510,9 +4510,7 @@ Color Fade(Color color, float alpha) // Get hexadecimal value for a Color int ColorToInt(Color color) { - int result = (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); - - return result; + return (int)(((unsigned)color.r << 24) | ((unsigned)color.g << 16) | ((unsigned)color.b << 8) | color.a); } // Get color normalized as float [0..1] From c7f098f4d26753367c33743557c0db016eac25eb Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Tue, 21 May 2024 20:48:48 +0200 Subject: [PATCH 22/56] Call SDL_GL_SetSwapInterval() after GL context creation (#3997) --- src/platforms/rcore_desktop_sdl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 9dfdd53ab..78fb39f76 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1499,11 +1499,6 @@ int InitPlatform(void) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); } - if (CORE.Window.flags & FLAG_VSYNC_HINT) - { - SDL_GL_SetSwapInterval(1); - } - if (CORE.Window.flags & FLAG_MSAA_4X_HINT) { SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); @@ -1537,6 +1532,15 @@ int InitPlatform(void) TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height); TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height); TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y); + + if (CORE.Window.flags & FLAG_VSYNC_HINT) + { + SDL_GL_SetSwapInterval(1); + } + else + { + SDL_GL_SetSwapInterval(0); + } } else { From 3abb6d9eaf9565cc3ae47687d85bfd392c982fb4 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 May 2024 20:52:48 +0200 Subject: [PATCH 23/56] REVIEWED: `ColorToInt()` PR --- src/rtextures.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rtextures.c b/src/rtextures.c index ca4c60d16..571387f23 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4510,7 +4510,14 @@ Color Fade(Color color, float alpha) // Get hexadecimal value for a Color int ColorToInt(Color color) { - return (int)(((unsigned)color.r << 24) | ((unsigned)color.g << 16) | ((unsigned)color.b << 8) | color.a); + int result = 0; + + result = (int)(((unsigned int)color.r << 24) | + ((unsigned int)color.g << 16) | + ((unsigned int)color.b << 8) | + (unsigned int)color.a); + + return result; } // Get color normalized as float [0..1] From b212750b8589a5677972d41c3f0449ef1c8cc34f Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 May 2024 20:53:51 +0200 Subject: [PATCH 24/56] Update rcore_desktop_sdl.c --- src/platforms/rcore_desktop_sdl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 78fb39f76..c22150efb 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1533,14 +1533,8 @@ int InitPlatform(void) TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height); TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y); - if (CORE.Window.flags & FLAG_VSYNC_HINT) - { - SDL_GL_SetSwapInterval(1); - } - else - { - SDL_GL_SetSwapInterval(0); - } + if (CORE.Window.flags & FLAG_VSYNC_HINT) SDL_GL_SetSwapInterval(1); + else SDL_GL_SetSwapInterval(0); } else { From d9c5066382615644137b4f65479c65c44820027a Mon Sep 17 00:00:00 2001 From: Antonis Geralis <43617260+planetis-m@users.noreply.github.com> Date: Tue, 21 May 2024 22:51:19 +0300 Subject: [PATCH 25/56] nim bindings are in 5.1-dev, remove umaintained repos (#3999) * nim bindings are in 5.1-dev, remove umaintained repos * Update BINDINGS.md * move to umaintained * Update BINDINGS.md * github editor is pranking me --- BINDINGS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 04102f707..e5cae30d6 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -45,9 +45,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | | [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 4.5 | [Ruby](https://www.ruby-lang.org/en) | Zlib | -| [NimraylibNow!](https://github.com/greenfork/nimraylib_now) | 4.2 | [Nim](https://nim-lang.org) | MIT | -| [raylib-Forever](https://github.com/Guevara-chan/Raylib-Forever) | auto | [Nim](https://nim-lang.org) | **???** | -| [naylib](https://github.com/planetis-m/naylib) | auto | [Nim](https://nim-lang.org) | MIT | +| [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT | | [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.0** | [Odin](https://odin-lang.org) | BSD-3Clause | | [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT | @@ -114,6 +112,8 @@ These are older raylib bindings that are more than 2 versions old or have not be | [raylib-nim](https://github.com/Skrylar/raylib-nim) | 2.0 | [Nim](https://nim-lang.org) | | [raylib-Nim](https://gitlab.com/define-private-public/raylib-Nim) | 1.7 | [Nim](https://nim-lang.org) | | [nim-raylib](https://github.com/tomc1998/nim-raylib) | 3.1-dev | [Nim](https://nim-lang.org) | +| [raylib-Forever](https://github.com/Guevara-chan/Raylib-Forever) | auto | [Nim](https://nim-lang.org) | +| [NimraylibNow!](https://github.com/greenfork/nimraylib_now) | 4.2 | [Nim](https://nim-lang.org) | | [raylib-haskell](https://github.com/DevJac/raylib-haskell) | 2.0 | [Haskell](https://www.haskell.org) | | [raylib-cr](https://github.com/AregevDev/raylib-cr) | 2.5-dev | [Crystal](https://crystal-lang.org) | | [raylib.cr](https://github.com/sam0x17/raylib.cr) | 2.0 | [Crystal](https://crystal-lang.org) | From b429dbdc4b41d57ff00456c73646bb1f6f14d8b5 Mon Sep 17 00:00:00 2001 From: listeria <56203103+ListeriaM@users.noreply.github.com> Date: Fri, 24 May 2024 13:24:40 -0300 Subject: [PATCH 26/56] fix WaveCrop(): update wave->frameCount (#4003) also allow `finalFrame = wave->frameCount' as the range of frames does not include it. Co-authored-by: Listeria monocytogenes --- src/raudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/raudio.c b/src/raudio.c index e74f8590e..c6bd00165 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1278,7 +1278,7 @@ Wave WaveCopy(Wave wave) // NOTE: Security check in case of out-of-range void WaveCrop(Wave *wave, int initFrame, int finalFrame) { - if ((initFrame >= 0) && (initFrame < finalFrame) && ((unsigned int)finalFrame < wave->frameCount)) + if ((initFrame >= 0) && (initFrame < finalFrame) && ((unsigned int)finalFrame <= wave->frameCount)) { int frameCount = finalFrame - initFrame; @@ -1288,6 +1288,7 @@ void WaveCrop(Wave *wave, int initFrame, int finalFrame) RL_FREE(wave->data); wave->data = data; + wave->frameCount = (unsigned int)frameCount; } else TRACELOG(LOG_WARNING, "WAVE: Crop range out of bounds"); } From 785ec74b92da4f91181ff7b1c89c8ae5ee19f1b6 Mon Sep 17 00:00:00 2001 From: Lionel Briand Date: Fri, 24 May 2024 18:26:17 +0200 Subject: [PATCH 27/56] Update BINDINGS.md (#4004) Add L-Briand/raylib-zig-bindings to the Language Bindings table --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index e5cae30d6..118794d52 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -75,6 +75,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to | [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.0 | [Wren](http://wren.io) | ISC | | [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.0** | [Zig](https://ziglang.org) | MIT | | [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT | +| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib | | [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib | | [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | | [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **auto** | [BQN](https://mlochbaum.github.io/BQN) | MIT | From 9cc7e3528f37dd17c85334c16dffb9392b8a6ad2 Mon Sep 17 00:00:00 2001 From: avx0 Date: Wed, 29 May 2024 15:00:28 +0530 Subject: [PATCH 28/56] [parser] MemoryCopy() calls: Prevent buffer overflow by replacing hard-coded arguments (#4011) In future, if a dev edits the second arg and miscalulates the corresponding 3rd arg, there will be a buffer overflow or the string (2nd arg) will be cut short. This commit prevents that. --- parser/raylib_parser.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 3e36f41f1..63f957284 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -202,9 +202,12 @@ int main(int argc, char* argv[]) { if (argc > 1) ProcessCommandLine(argc, argv); - if (inFileName[0] == '\0') MemoryCopy(inFileName, "../src/raylib.h\0", 16); - if (outFileName[0] == '\0') MemoryCopy(outFileName, "raylib_api.txt\0", 15); - if (apiDefine[0] == '\0') MemoryCopy(apiDefine, "RLAPI\0", 6); + const char *raylibhPath = "../src/raylib.h\0"; + const char *raylibapiPath = "raylib_api.txt\0"; + const char *rlapiPath = "RLAPI\0"; + if (inFileName[0] == '\0') MemoryCopy(inFileName, raylibhPath, TextLength(raylibhPath) + 1); + if (outFileName[0] == '\0') MemoryCopy(outFileName, raylibapiPath, TextLength(raylibapiPath) + 1); + if (apiDefine[0] == '\0') MemoryCopy(apiDefine, rlapiPath, TextLength(rlapiPath) + 1); int length = 0; char *buffer = LoadFileText(inFileName, &length); @@ -1277,8 +1280,10 @@ static void GetDataTypeAndName(const char *typeName, int typeNameLen, char *type } else if ((typeName[k] == '.') && (typeNameLen == 3)) // Handle varargs ...); { - MemoryCopy(type, "...", 3); - MemoryCopy(name, "args", 4); + const char *varargsDots = "..."; + const char *varargsArg = "args"; + MemoryCopy(type, varargsDots, TextLength(varargsDots)); + MemoryCopy(name, varargsArg, TextLength(varargsArg)); break; } } From 797de0f9ad6f69f78131591f9393e9e0ef9486a2 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Wed, 29 May 2024 13:16:19 +0200 Subject: [PATCH 29/56] [rmodels] Multiplication of colors in `DrawModelEx` which can be simplified (#4002) * simplifies color multiplication `DrawModelEx` * add explicit casts --- src/rmodels.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 2ef030186..4bf042d5c 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3546,10 +3546,10 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota Color color = model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color; Color colorTint = WHITE; - colorTint.r = (unsigned char)((((float)color.r/255.0f)*((float)tint.r/255.0f))*255.0f); - colorTint.g = (unsigned char)((((float)color.g/255.0f)*((float)tint.g/255.0f))*255.0f); - colorTint.b = (unsigned char)((((float)color.b/255.0f)*((float)tint.b/255.0f))*255.0f); - colorTint.a = (unsigned char)((((float)color.a/255.0f)*((float)tint.a/255.0f))*255.0f); + colorTint.r = (unsigned char)(((int)color.r*(int)tint.r)/255); + colorTint.g = (unsigned char)(((int)color.g*(int)tint.g)/255); + colorTint.b = (unsigned char)(((int)color.b*(int)tint.b)/255); + colorTint.a = (unsigned char)(((int)color.a*(int)tint.a)/255); model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = colorTint; DrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform); From c335c3c52c27ee68765ab3c3dde65190dbebe55c Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 May 2024 17:01:42 +0200 Subject: [PATCH 30/56] ADDED: `IsFileNameValid()` --- src/raylib.h | 1 + src/rcore.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index c53ea555b..e810dcdca 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1124,6 +1124,7 @@ RLAPI const char *GetWorkingDirectory(void); // Get current RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory +RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths diff --git a/src/rcore.c b/src/rcore.c index 1db865187..3aa5a7a65 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2244,6 +2244,64 @@ bool IsPathFile(const char *path) return S_ISREG(result.st_mode); } +// Check if fileName is valid for the platform/OS +bool IsFileNameValid(const char *fileName) +{ + bool valid = true; + + if ((fileName != NULL) && (fileName[0] != '\0')) + { + int length = strlen(fileName); + bool allPeriods = true; + + for (int i = 0; i < length; i++) + { + // Check invalid characters + if ((fileName[i] == '<') || + (fileName[i] == '>') || + (fileName[i] == ':') || + (fileName[i] == '\"') || + (fileName[i] == '/') || + (fileName[i] == '\\') || + (fileName[i] == '|') || + (fileName[i] == '?') || + (fileName[i] == '*')) { valid = false; break; } + + // Check non-glyph characters + if ((unsigned char)fileName[i] < 32) { valid = false; break; } + + // TODO: Check trailing periods/spaces? + + // Check if filename is not all periods + if (fileName[i] != '.') allPeriods = false; + } + + if (allPeriods) valid = false; + +/* + if (valid) + { + // Check invalid DOS names + if (length >= 3) + { + if (((fileName[0] == 'C') && (fileName[1] == 'O') && (fileName[2] == 'N')) || // CON + ((fileName[0] == 'P') && (fileName[1] == 'R') && (fileName[2] == 'N')) || // PRN + ((fileName[0] == 'A') && (fileName[1] == 'U') && (fileName[2] == 'X')) || // AUX + ((fileName[0] == 'N') && (fileName[1] == 'U') && (fileName[2] == 'L'))) valid = false; // NUL + } + + if (length >= 4) + { + if (((fileName[0] == 'C') && (fileName[1] == 'O') && (fileName[2] == 'M') && ((fileName[3] >= '0') && (fileName[3] <= '9'))) || // COM0-9 + ((fileName[0] == 'L') && (fileName[1] == 'P') && (fileName[2] == 'T') && ((fileName[3] >= '0') && (fileName[3] <= '9')))) valid = false; // LPT0-9 + } + } +*/ + } + + return valid; +} + // Check if a file has been dropped into window bool IsFileDropped(void) { From a942a3bc70d994183fdd94b0346ba34211c50b20 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 29 May 2024 15:02:00 +0000 Subject: [PATCH 31/56] Update raylib_api.* by CI --- parser/output/raylib_api.json | 11 + parser/output/raylib_api.lua | 8 + parser/output/raylib_api.txt | 861 +++++++++++++++++----------------- parser/output/raylib_api.xml | 5 +- 4 files changed, 456 insertions(+), 429 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 5a9f4fc5d..f2a9cc61e 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -4499,6 +4499,17 @@ } ] }, + { + "name": "IsFileNameValid", + "description": "Check if fileName is valid for the platform/OS", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, { "name": "LoadDirectoryFiles", "description": "Load directory filepaths", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d60ea191c..68fef97bb 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4058,6 +4058,14 @@ return { {type = "const char *", name = "path"} } }, + { + name = "IsFileNameValid", + description = "Check if fileName is valid for the platform/OS", + returnType = "bool", + params = { + {type = "const char *", name = "fileName"} + } + }, { name = "LoadDirectoryFiles", description = "Load directory filepaths", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index f4973dae6..d6576dee5 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 562 +Functions found: 563 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -1709,358 +1709,363 @@ Function 135: IsPathFile() (1 input parameters) Return type: bool Description: Check if a given path is a file or a directory Param[1]: path (type: const char *) -Function 136: LoadDirectoryFiles() (1 input parameters) +Function 136: IsFileNameValid() (1 input parameters) + Name: IsFileNameValid + Return type: bool + Description: Check if fileName is valid for the platform/OS + Param[1]: fileName (type: const char *) +Function 137: LoadDirectoryFiles() (1 input parameters) Name: LoadDirectoryFiles Return type: FilePathList Description: Load directory filepaths Param[1]: dirPath (type: const char *) -Function 137: LoadDirectoryFilesEx() (3 input parameters) +Function 138: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList Description: Load directory filepaths with extension filtering and recursive directory scan Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) -Function 138: UnloadDirectoryFiles() (1 input parameters) +Function 139: UnloadDirectoryFiles() (1 input parameters) Name: UnloadDirectoryFiles Return type: void Description: Unload filepaths Param[1]: files (type: FilePathList) -Function 139: IsFileDropped() (0 input parameters) +Function 140: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool Description: Check if a file has been dropped into window No input parameters -Function 140: LoadDroppedFiles() (0 input parameters) +Function 141: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles Return type: FilePathList Description: Load dropped filepaths No input parameters -Function 141: UnloadDroppedFiles() (1 input parameters) +Function 142: UnloadDroppedFiles() (1 input parameters) Name: UnloadDroppedFiles Return type: void Description: Unload dropped filepaths Param[1]: files (type: FilePathList) -Function 142: GetFileModTime() (1 input parameters) +Function 143: GetFileModTime() (1 input parameters) Name: GetFileModTime Return type: long Description: Get file modification time (last write time) Param[1]: fileName (type: const char *) -Function 143: CompressData() (3 input parameters) +Function 144: CompressData() (3 input parameters) Name: CompressData Return type: unsigned char * Description: Compress data (DEFLATE algorithm), memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: compDataSize (type: int *) -Function 144: DecompressData() (3 input parameters) +Function 145: DecompressData() (3 input parameters) Name: DecompressData Return type: unsigned char * Description: Decompress data (DEFLATE algorithm), memory must be MemFree() Param[1]: compData (type: const unsigned char *) Param[2]: compDataSize (type: int) Param[3]: dataSize (type: int *) -Function 145: EncodeDataBase64() (3 input parameters) +Function 146: EncodeDataBase64() (3 input parameters) Name: EncodeDataBase64 Return type: char * Description: Encode data to Base64 string, memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: outputSize (type: int *) -Function 146: DecodeDataBase64() (2 input parameters) +Function 147: DecodeDataBase64() (2 input parameters) Name: DecodeDataBase64 Return type: unsigned char * Description: Decode Base64 string data, memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: outputSize (type: int *) -Function 147: LoadAutomationEventList() (1 input parameters) +Function 148: LoadAutomationEventList() (1 input parameters) Name: LoadAutomationEventList Return type: AutomationEventList Description: Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS Param[1]: fileName (type: const char *) -Function 148: UnloadAutomationEventList() (1 input parameters) +Function 149: UnloadAutomationEventList() (1 input parameters) Name: UnloadAutomationEventList Return type: void Description: Unload automation events list from file Param[1]: list (type: AutomationEventList) -Function 149: ExportAutomationEventList() (2 input parameters) +Function 150: ExportAutomationEventList() (2 input parameters) Name: ExportAutomationEventList Return type: bool Description: Export automation events list as text file Param[1]: list (type: AutomationEventList) Param[2]: fileName (type: const char *) -Function 150: SetAutomationEventList() (1 input parameters) +Function 151: SetAutomationEventList() (1 input parameters) Name: SetAutomationEventList Return type: void Description: Set automation event list to record to Param[1]: list (type: AutomationEventList *) -Function 151: SetAutomationEventBaseFrame() (1 input parameters) +Function 152: SetAutomationEventBaseFrame() (1 input parameters) Name: SetAutomationEventBaseFrame Return type: void Description: Set automation event internal base frame to start recording Param[1]: frame (type: int) -Function 152: StartAutomationEventRecording() (0 input parameters) +Function 153: StartAutomationEventRecording() (0 input parameters) Name: StartAutomationEventRecording Return type: void Description: Start recording automation events (AutomationEventList must be set) No input parameters -Function 153: StopAutomationEventRecording() (0 input parameters) +Function 154: StopAutomationEventRecording() (0 input parameters) Name: StopAutomationEventRecording Return type: void Description: Stop recording automation events No input parameters -Function 154: PlayAutomationEvent() (1 input parameters) +Function 155: PlayAutomationEvent() (1 input parameters) Name: PlayAutomationEvent Return type: void Description: Play a recorded automation event Param[1]: event (type: AutomationEvent) -Function 155: IsKeyPressed() (1 input parameters) +Function 156: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool Description: Check if a key has been pressed once Param[1]: key (type: int) -Function 156: IsKeyPressedRepeat() (1 input parameters) +Function 157: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool Description: Check if a key has been pressed again (Only PLATFORM_DESKTOP) Param[1]: key (type: int) -Function 157: IsKeyDown() (1 input parameters) +Function 158: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool Description: Check if a key is being pressed Param[1]: key (type: int) -Function 158: IsKeyReleased() (1 input parameters) +Function 159: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool Description: Check if a key has been released once Param[1]: key (type: int) -Function 159: IsKeyUp() (1 input parameters) +Function 160: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool Description: Check if a key is NOT being pressed Param[1]: key (type: int) -Function 160: GetKeyPressed() (0 input parameters) +Function 161: GetKeyPressed() (0 input parameters) Name: GetKeyPressed Return type: int Description: Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty No input parameters -Function 161: GetCharPressed() (0 input parameters) +Function 162: GetCharPressed() (0 input parameters) Name: GetCharPressed Return type: int Description: Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty No input parameters -Function 162: SetExitKey() (1 input parameters) +Function 163: SetExitKey() (1 input parameters) Name: SetExitKey Return type: void Description: Set a custom key to exit program (default is ESC) Param[1]: key (type: int) -Function 163: IsGamepadAvailable() (1 input parameters) +Function 164: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool Description: Check if a gamepad is available Param[1]: gamepad (type: int) -Function 164: GetGamepadName() (1 input parameters) +Function 165: GetGamepadName() (1 input parameters) Name: GetGamepadName Return type: const char * Description: Get gamepad internal name id Param[1]: gamepad (type: int) -Function 165: IsGamepadButtonPressed() (2 input parameters) +Function 166: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool Description: Check if a gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 166: IsGamepadButtonDown() (2 input parameters) +Function 167: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool Description: Check if a gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 167: IsGamepadButtonReleased() (2 input parameters) +Function 168: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool Description: Check if a gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 168: IsGamepadButtonUp() (2 input parameters) +Function 169: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool Description: Check if a gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 169: GetGamepadButtonPressed() (0 input parameters) +Function 170: GetGamepadButtonPressed() (0 input parameters) Name: GetGamepadButtonPressed Return type: int Description: Get the last gamepad button pressed No input parameters -Function 170: GetGamepadAxisCount() (1 input parameters) +Function 171: GetGamepadAxisCount() (1 input parameters) Name: GetGamepadAxisCount Return type: int Description: Get gamepad axis count for a gamepad Param[1]: gamepad (type: int) -Function 171: GetGamepadAxisMovement() (2 input parameters) +Function 172: GetGamepadAxisMovement() (2 input parameters) Name: GetGamepadAxisMovement Return type: float Description: Get axis movement value for a gamepad axis Param[1]: gamepad (type: int) Param[2]: axis (type: int) -Function 172: SetGamepadMappings() (1 input parameters) +Function 173: SetGamepadMappings() (1 input parameters) Name: SetGamepadMappings Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 173: SetGamepadVibration() (3 input parameters) +Function 174: SetGamepadVibration() (3 input parameters) Name: SetGamepadVibration Return type: void Description: Set gamepad vibration for both motors Param[1]: gamepad (type: int) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) -Function 174: IsMouseButtonPressed() (1 input parameters) +Function 175: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool Description: Check if a mouse button has been pressed once Param[1]: button (type: int) -Function 175: IsMouseButtonDown() (1 input parameters) +Function 176: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool Description: Check if a mouse button is being pressed Param[1]: button (type: int) -Function 176: IsMouseButtonReleased() (1 input parameters) +Function 177: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool Description: Check if a mouse button has been released once Param[1]: button (type: int) -Function 177: IsMouseButtonUp() (1 input parameters) +Function 178: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool Description: Check if a mouse button is NOT being pressed Param[1]: button (type: int) -Function 178: GetMouseX() (0 input parameters) +Function 179: GetMouseX() (0 input parameters) Name: GetMouseX Return type: int Description: Get mouse position X No input parameters -Function 179: GetMouseY() (0 input parameters) +Function 180: GetMouseY() (0 input parameters) Name: GetMouseY Return type: int Description: Get mouse position Y No input parameters -Function 180: GetMousePosition() (0 input parameters) +Function 181: GetMousePosition() (0 input parameters) Name: GetMousePosition Return type: Vector2 Description: Get mouse position XY No input parameters -Function 181: GetMouseDelta() (0 input parameters) +Function 182: GetMouseDelta() (0 input parameters) Name: GetMouseDelta Return type: Vector2 Description: Get mouse delta between frames No input parameters -Function 182: SetMousePosition() (2 input parameters) +Function 183: SetMousePosition() (2 input parameters) Name: SetMousePosition Return type: void Description: Set mouse position XY Param[1]: x (type: int) Param[2]: y (type: int) -Function 183: SetMouseOffset() (2 input parameters) +Function 184: SetMouseOffset() (2 input parameters) Name: SetMouseOffset Return type: void Description: Set mouse offset Param[1]: offsetX (type: int) Param[2]: offsetY (type: int) -Function 184: SetMouseScale() (2 input parameters) +Function 185: SetMouseScale() (2 input parameters) Name: SetMouseScale Return type: void Description: Set mouse scaling Param[1]: scaleX (type: float) Param[2]: scaleY (type: float) -Function 185: GetMouseWheelMove() (0 input parameters) +Function 186: GetMouseWheelMove() (0 input parameters) Name: GetMouseWheelMove Return type: float Description: Get mouse wheel movement for X or Y, whichever is larger No input parameters -Function 186: GetMouseWheelMoveV() (0 input parameters) +Function 187: GetMouseWheelMoveV() (0 input parameters) Name: GetMouseWheelMoveV Return type: Vector2 Description: Get mouse wheel movement for both X and Y No input parameters -Function 187: SetMouseCursor() (1 input parameters) +Function 188: SetMouseCursor() (1 input parameters) Name: SetMouseCursor Return type: void Description: Set mouse cursor Param[1]: cursor (type: int) -Function 188: GetTouchX() (0 input parameters) +Function 189: GetTouchX() (0 input parameters) Name: GetTouchX Return type: int Description: Get touch position X for touch point 0 (relative to screen size) No input parameters -Function 189: GetTouchY() (0 input parameters) +Function 190: GetTouchY() (0 input parameters) Name: GetTouchY Return type: int Description: Get touch position Y for touch point 0 (relative to screen size) No input parameters -Function 190: GetTouchPosition() (1 input parameters) +Function 191: GetTouchPosition() (1 input parameters) Name: GetTouchPosition Return type: Vector2 Description: Get touch position XY for a touch point index (relative to screen size) Param[1]: index (type: int) -Function 191: GetTouchPointId() (1 input parameters) +Function 192: GetTouchPointId() (1 input parameters) Name: GetTouchPointId Return type: int Description: Get touch point identifier for given index Param[1]: index (type: int) -Function 192: GetTouchPointCount() (0 input parameters) +Function 193: GetTouchPointCount() (0 input parameters) Name: GetTouchPointCount Return type: int Description: Get number of touch points No input parameters -Function 193: SetGesturesEnabled() (1 input parameters) +Function 194: SetGesturesEnabled() (1 input parameters) Name: SetGesturesEnabled Return type: void Description: Enable a set of gestures using flags Param[1]: flags (type: unsigned int) -Function 194: IsGestureDetected() (1 input parameters) +Function 195: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool Description: Check if a gesture have been detected Param[1]: gesture (type: unsigned int) -Function 195: GetGestureDetected() (0 input parameters) +Function 196: GetGestureDetected() (0 input parameters) Name: GetGestureDetected Return type: int Description: Get latest detected gesture No input parameters -Function 196: GetGestureHoldDuration() (0 input parameters) +Function 197: GetGestureHoldDuration() (0 input parameters) Name: GetGestureHoldDuration Return type: float Description: Get gesture hold time in milliseconds No input parameters -Function 197: GetGestureDragVector() (0 input parameters) +Function 198: GetGestureDragVector() (0 input parameters) Name: GetGestureDragVector Return type: Vector2 Description: Get gesture drag vector No input parameters -Function 198: GetGestureDragAngle() (0 input parameters) +Function 199: GetGestureDragAngle() (0 input parameters) Name: GetGestureDragAngle Return type: float Description: Get gesture drag angle No input parameters -Function 199: GetGesturePinchVector() (0 input parameters) +Function 200: GetGesturePinchVector() (0 input parameters) Name: GetGesturePinchVector Return type: Vector2 Description: Get gesture pinch delta No input parameters -Function 200: GetGesturePinchAngle() (0 input parameters) +Function 201: GetGesturePinchAngle() (0 input parameters) Name: GetGesturePinchAngle Return type: float Description: Get gesture pinch angle No input parameters -Function 201: UpdateCamera() (2 input parameters) +Function 202: UpdateCamera() (2 input parameters) Name: UpdateCamera Return type: void Description: Update camera position for selected mode Param[1]: camera (type: Camera *) Param[2]: mode (type: int) -Function 202: UpdateCameraPro() (4 input parameters) +Function 203: UpdateCameraPro() (4 input parameters) Name: UpdateCameraPro Return type: void Description: Update camera movement/rotation @@ -2068,36 +2073,36 @@ Function 202: UpdateCameraPro() (4 input parameters) Param[2]: movement (type: Vector3) Param[3]: rotation (type: Vector3) Param[4]: zoom (type: float) -Function 203: SetShapesTexture() (2 input parameters) +Function 204: SetShapesTexture() (2 input parameters) Name: SetShapesTexture Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) Param[2]: source (type: Rectangle) -Function 204: GetShapesTexture() (0 input parameters) +Function 205: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D Description: Get texture that is used for shapes drawing No input parameters -Function 205: GetShapesTextureRectangle() (0 input parameters) +Function 206: GetShapesTextureRectangle() (0 input parameters) Name: GetShapesTextureRectangle Return type: Rectangle Description: Get texture source rectangle that is used for shapes drawing No input parameters -Function 206: DrawPixel() (3 input parameters) +Function 207: DrawPixel() (3 input parameters) Name: DrawPixel Return type: void Description: Draw a pixel Param[1]: posX (type: int) Param[2]: posY (type: int) Param[3]: color (type: Color) -Function 207: DrawPixelV() (2 input parameters) +Function 208: DrawPixelV() (2 input parameters) Name: DrawPixelV Return type: void Description: Draw a pixel (Vector version) Param[1]: position (type: Vector2) Param[2]: color (type: Color) -Function 208: DrawLine() (5 input parameters) +Function 209: DrawLine() (5 input parameters) Name: DrawLine Return type: void Description: Draw a line @@ -2106,14 +2111,14 @@ Function 208: DrawLine() (5 input parameters) Param[3]: endPosX (type: int) Param[4]: endPosY (type: int) Param[5]: color (type: Color) -Function 209: DrawLineV() (3 input parameters) +Function 210: DrawLineV() (3 input parameters) Name: DrawLineV Return type: void Description: Draw a line (using gl lines) Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: color (type: Color) -Function 210: DrawLineEx() (4 input parameters) +Function 211: DrawLineEx() (4 input parameters) Name: DrawLineEx Return type: void Description: Draw a line (using triangles/quads) @@ -2121,14 +2126,14 @@ Function 210: DrawLineEx() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 211: DrawLineStrip() (3 input parameters) +Function 212: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) Param[1]: points (type: Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 212: DrawLineBezier() (4 input parameters) +Function 213: DrawLineBezier() (4 input parameters) Name: DrawLineBezier Return type: void Description: Draw line segment cubic-bezier in-out interpolation @@ -2136,7 +2141,7 @@ Function 212: DrawLineBezier() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 213: DrawCircle() (4 input parameters) +Function 214: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2144,7 +2149,7 @@ Function 213: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 214: DrawCircleSector() (6 input parameters) +Function 215: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2154,7 +2159,7 @@ Function 214: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 215: DrawCircleSectorLines() (6 input parameters) +Function 216: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2164,7 +2169,7 @@ Function 215: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 216: DrawCircleGradient() (5 input parameters) +Function 217: DrawCircleGradient() (5 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2173,14 +2178,14 @@ Function 216: DrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: color1 (type: Color) Param[5]: color2 (type: Color) -Function 217: DrawCircleV() (3 input parameters) +Function 218: DrawCircleV() (3 input parameters) Name: DrawCircleV Return type: void Description: Draw a color-filled circle (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 218: DrawCircleLines() (4 input parameters) +Function 219: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2188,14 +2193,14 @@ Function 218: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 219: DrawCircleLinesV() (3 input parameters) +Function 220: DrawCircleLinesV() (3 input parameters) Name: DrawCircleLinesV Return type: void Description: Draw circle outline (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 220: DrawEllipse() (5 input parameters) +Function 221: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2204,7 +2209,7 @@ Function 220: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 221: DrawEllipseLines() (5 input parameters) +Function 222: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2213,7 +2218,7 @@ Function 221: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 222: DrawRing() (7 input parameters) +Function 223: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2224,7 +2229,7 @@ Function 222: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 223: DrawRingLines() (7 input parameters) +Function 224: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2235,7 +2240,7 @@ Function 223: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 224: DrawRectangle() (5 input parameters) +Function 225: DrawRectangle() (5 input parameters) Name: DrawRectangle Return type: void Description: Draw a color-filled rectangle @@ -2244,20 +2249,20 @@ Function 224: DrawRectangle() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 225: DrawRectangleV() (3 input parameters) +Function 226: DrawRectangleV() (3 input parameters) Name: DrawRectangleV Return type: void Description: Draw a color-filled rectangle (Vector version) Param[1]: position (type: Vector2) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 226: DrawRectangleRec() (2 input parameters) +Function 227: DrawRectangleRec() (2 input parameters) Name: DrawRectangleRec Return type: void Description: Draw a color-filled rectangle Param[1]: rec (type: Rectangle) Param[2]: color (type: Color) -Function 227: DrawRectanglePro() (4 input parameters) +Function 228: DrawRectanglePro() (4 input parameters) Name: DrawRectanglePro Return type: void Description: Draw a color-filled rectangle with pro parameters @@ -2265,7 +2270,7 @@ Function 227: DrawRectanglePro() (4 input parameters) Param[2]: origin (type: Vector2) Param[3]: rotation (type: float) Param[4]: color (type: Color) -Function 228: DrawRectangleGradientV() (6 input parameters) +Function 229: DrawRectangleGradientV() (6 input parameters) Name: DrawRectangleGradientV Return type: void Description: Draw a vertical-gradient-filled rectangle @@ -2275,7 +2280,7 @@ Function 228: DrawRectangleGradientV() (6 input parameters) Param[4]: height (type: int) Param[5]: color1 (type: Color) Param[6]: color2 (type: Color) -Function 229: DrawRectangleGradientH() (6 input parameters) +Function 230: DrawRectangleGradientH() (6 input parameters) Name: DrawRectangleGradientH Return type: void Description: Draw a horizontal-gradient-filled rectangle @@ -2285,7 +2290,7 @@ Function 229: DrawRectangleGradientH() (6 input parameters) Param[4]: height (type: int) Param[5]: color1 (type: Color) Param[6]: color2 (type: Color) -Function 230: DrawRectangleGradientEx() (5 input parameters) +Function 231: DrawRectangleGradientEx() (5 input parameters) Name: DrawRectangleGradientEx Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors @@ -2294,7 +2299,7 @@ Function 230: DrawRectangleGradientEx() (5 input parameters) Param[3]: col2 (type: Color) Param[4]: col3 (type: Color) Param[5]: col4 (type: Color) -Function 231: DrawRectangleLines() (5 input parameters) +Function 232: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void Description: Draw rectangle outline @@ -2303,14 +2308,14 @@ Function 231: DrawRectangleLines() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 232: DrawRectangleLinesEx() (3 input parameters) +Function 233: DrawRectangleLinesEx() (3 input parameters) Name: DrawRectangleLinesEx Return type: void Description: Draw rectangle outline with extended parameters Param[1]: rec (type: Rectangle) Param[2]: lineThick (type: float) Param[3]: color (type: Color) -Function 233: DrawRectangleRounded() (4 input parameters) +Function 234: DrawRectangleRounded() (4 input parameters) Name: DrawRectangleRounded Return type: void Description: Draw rectangle with rounded edges @@ -2318,7 +2323,7 @@ Function 233: DrawRectangleRounded() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 234: DrawRectangleRoundedLines() (4 input parameters) +Function 235: DrawRectangleRoundedLines() (4 input parameters) Name: DrawRectangleRoundedLines Return type: void Description: Draw rectangle lines with rounded edges @@ -2326,7 +2331,7 @@ Function 234: DrawRectangleRoundedLines() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 235: DrawRectangleRoundedLinesEx() (5 input parameters) +Function 236: DrawRectangleRoundedLinesEx() (5 input parameters) Name: DrawRectangleRoundedLinesEx Return type: void Description: Draw rectangle with rounded edges outline @@ -2335,7 +2340,7 @@ Function 235: DrawRectangleRoundedLinesEx() (5 input parameters) Param[3]: segments (type: int) Param[4]: lineThick (type: float) Param[5]: color (type: Color) -Function 236: DrawTriangle() (4 input parameters) +Function 237: DrawTriangle() (4 input parameters) Name: DrawTriangle Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -2343,7 +2348,7 @@ Function 236: DrawTriangle() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 237: DrawTriangleLines() (4 input parameters) +Function 238: DrawTriangleLines() (4 input parameters) Name: DrawTriangleLines Return type: void Description: Draw triangle outline (vertex in counter-clockwise order!) @@ -2351,21 +2356,21 @@ Function 237: DrawTriangleLines() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 238: DrawTriangleFan() (3 input parameters) +Function 239: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) Param[1]: points (type: Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 239: DrawTriangleStrip() (3 input parameters) +Function 240: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 240: DrawPoly() (5 input parameters) +Function 241: DrawPoly() (5 input parameters) Name: DrawPoly Return type: void Description: Draw a regular polygon (Vector version) @@ -2374,7 +2379,7 @@ Function 240: DrawPoly() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 241: DrawPolyLines() (5 input parameters) +Function 242: DrawPolyLines() (5 input parameters) Name: DrawPolyLines Return type: void Description: Draw a polygon outline of n sides @@ -2383,7 +2388,7 @@ Function 241: DrawPolyLines() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 242: DrawPolyLinesEx() (6 input parameters) +Function 243: DrawPolyLinesEx() (6 input parameters) Name: DrawPolyLinesEx Return type: void Description: Draw a polygon outline of n sides with extended parameters @@ -2393,7 +2398,7 @@ Function 242: DrawPolyLinesEx() (6 input parameters) Param[4]: rotation (type: float) Param[5]: lineThick (type: float) Param[6]: color (type: Color) -Function 243: DrawSplineLinear() (4 input parameters) +Function 244: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2401,7 +2406,7 @@ Function 243: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 244: DrawSplineBasis() (4 input parameters) +Function 245: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2409,7 +2414,7 @@ Function 244: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 245: DrawSplineCatmullRom() (4 input parameters) +Function 246: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2417,7 +2422,7 @@ Function 245: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 246: DrawSplineBezierQuadratic() (4 input parameters) +Function 247: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2425,7 +2430,7 @@ Function 246: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 247: DrawSplineBezierCubic() (4 input parameters) +Function 248: DrawSplineBezierCubic() (4 input parameters) Name: DrawSplineBezierCubic Return type: void Description: Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] @@ -2433,7 +2438,7 @@ Function 247: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 248: DrawSplineSegmentLinear() (4 input parameters) +Function 249: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2441,7 +2446,7 @@ Function 248: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 249: DrawSplineSegmentBasis() (6 input parameters) +Function 250: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2451,7 +2456,7 @@ Function 249: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 250: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 251: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2461,7 +2466,7 @@ Function 250: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 251: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 252: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2470,7 +2475,7 @@ Function 251: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 252: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 253: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2480,14 +2485,14 @@ Function 252: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 253: GetSplinePointLinear() (3 input parameters) +Function 254: GetSplinePointLinear() (3 input parameters) Name: GetSplinePointLinear Return type: Vector2 Description: Get (evaluate) spline point: Linear Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: t (type: float) -Function 254: GetSplinePointBasis() (5 input parameters) +Function 255: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2496,7 +2501,7 @@ Function 254: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 255: GetSplinePointCatmullRom() (5 input parameters) +Function 256: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2505,7 +2510,7 @@ Function 255: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 256: GetSplinePointBezierQuad() (4 input parameters) +Function 257: GetSplinePointBezierQuad() (4 input parameters) Name: GetSplinePointBezierQuad Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2513,7 +2518,7 @@ Function 256: GetSplinePointBezierQuad() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 257: GetSplinePointBezierCubic() (5 input parameters) +Function 258: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2522,13 +2527,13 @@ Function 257: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 258: CheckCollisionRecs() (2 input parameters) +Function 259: CheckCollisionRecs() (2 input parameters) Name: CheckCollisionRecs Return type: bool Description: Check collision between two rectangles Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 259: CheckCollisionCircles() (4 input parameters) +Function 260: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2536,27 +2541,27 @@ Function 259: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 260: CheckCollisionCircleRec() (3 input parameters) +Function 261: CheckCollisionCircleRec() (3 input parameters) Name: CheckCollisionCircleRec Return type: bool Description: Check collision between circle and rectangle Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: rec (type: Rectangle) -Function 261: CheckCollisionPointRec() (2 input parameters) +Function 262: CheckCollisionPointRec() (2 input parameters) Name: CheckCollisionPointRec Return type: bool Description: Check if point is inside rectangle Param[1]: point (type: Vector2) Param[2]: rec (type: Rectangle) -Function 262: CheckCollisionPointCircle() (3 input parameters) +Function 263: CheckCollisionPointCircle() (3 input parameters) Name: CheckCollisionPointCircle Return type: bool Description: Check if point is inside circle Param[1]: point (type: Vector2) Param[2]: center (type: Vector2) Param[3]: radius (type: float) -Function 263: CheckCollisionPointTriangle() (4 input parameters) +Function 264: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2564,14 +2569,14 @@ Function 263: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 264: CheckCollisionPointPoly() (3 input parameters) +Function 265: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) -Function 265: CheckCollisionLines() (5 input parameters) +Function 266: CheckCollisionLines() (5 input parameters) Name: CheckCollisionLines Return type: bool Description: Check the collision between two lines defined by two points each, returns collision point by reference @@ -2580,7 +2585,7 @@ Function 265: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 266: CheckCollisionPointLine() (4 input parameters) +Function 267: CheckCollisionPointLine() (4 input parameters) Name: CheckCollisionPointLine Return type: bool Description: Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] @@ -2588,18 +2593,18 @@ Function 266: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 267: GetCollisionRec() (2 input parameters) +Function 268: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle Description: Get collision rectangle for two rectangles collision Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 268: LoadImage() (1 input parameters) +Function 269: LoadImage() (1 input parameters) Name: LoadImage Return type: Image Description: Load image from file into CPU memory (RAM) Param[1]: fileName (type: const char *) -Function 269: LoadImageRaw() (5 input parameters) +Function 270: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2608,20 +2613,20 @@ Function 269: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 270: LoadImageSvg() (3 input parameters) +Function 271: LoadImageSvg() (3 input parameters) Name: LoadImageSvg Return type: Image Description: Load image from SVG file data or string with specified size Param[1]: fileNameOrString (type: const char *) Param[2]: width (type: int) Param[3]: height (type: int) -Function 271: LoadImageAnim() (2 input parameters) +Function 272: LoadImageAnim() (2 input parameters) Name: LoadImageAnim Return type: Image Description: Load image sequence from file (frames appended to image.data) Param[1]: fileName (type: const char *) Param[2]: frames (type: int *) -Function 272: LoadImageAnimFromMemory() (4 input parameters) +Function 273: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2629,60 +2634,60 @@ Function 272: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 273: LoadImageFromMemory() (3 input parameters) +Function 274: LoadImageFromMemory() (3 input parameters) Name: LoadImageFromMemory Return type: Image Description: Load image from memory buffer, fileType refers to extension: i.e. '.png' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 274: LoadImageFromTexture() (1 input parameters) +Function 275: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 275: LoadImageFromScreen() (0 input parameters) +Function 276: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 276: IsImageReady() (1 input parameters) +Function 277: IsImageReady() (1 input parameters) Name: IsImageReady Return type: bool Description: Check if an image is ready Param[1]: image (type: Image) -Function 277: UnloadImage() (1 input parameters) +Function 278: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 278: ExportImage() (2 input parameters) +Function 279: ExportImage() (2 input parameters) Name: ExportImage Return type: bool Description: Export image data to file, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 279: ExportImageToMemory() (3 input parameters) +Function 280: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 280: ExportImageAsCode() (2 input parameters) +Function 281: ExportImageAsCode() (2 input parameters) Name: ExportImageAsCode Return type: bool Description: Export image as code file defining an array of bytes, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 281: GenImageColor() (3 input parameters) +Function 282: GenImageColor() (3 input parameters) Name: GenImageColor Return type: Image Description: Generate image: plain color Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 282: GenImageGradientLinear() (5 input parameters) +Function 283: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2691,7 +2696,7 @@ Function 282: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 283: GenImageGradientRadial() (5 input parameters) +Function 284: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2700,7 +2705,7 @@ Function 283: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 284: GenImageGradientSquare() (5 input parameters) +Function 285: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2709,7 +2714,7 @@ Function 284: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 285: GenImageChecked() (6 input parameters) +Function 286: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2719,14 +2724,14 @@ Function 285: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 286: GenImageWhiteNoise() (3 input parameters) +Function 287: GenImageWhiteNoise() (3 input parameters) Name: GenImageWhiteNoise Return type: Image Description: Generate image: white noise Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: factor (type: float) -Function 287: GenImagePerlinNoise() (5 input parameters) +Function 288: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2735,39 +2740,39 @@ Function 287: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 288: GenImageCellular() (3 input parameters) +Function 289: GenImageCellular() (3 input parameters) Name: GenImageCellular Return type: Image Description: Generate image: cellular algorithm, bigger tileSize means bigger cells Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: tileSize (type: int) -Function 289: GenImageText() (3 input parameters) +Function 290: GenImageText() (3 input parameters) Name: GenImageText Return type: Image Description: Generate image: grayscale image from text data Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: text (type: const char *) -Function 290: ImageCopy() (1 input parameters) +Function 291: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 291: ImageFromImage() (2 input parameters) +Function 292: ImageFromImage() (2 input parameters) Name: ImageFromImage Return type: Image Description: Create an image from another image piece Param[1]: image (type: Image) Param[2]: rec (type: Rectangle) -Function 292: ImageText() (3 input parameters) +Function 293: ImageText() (3 input parameters) Name: ImageText Return type: Image Description: Create an image from text (default font) Param[1]: text (type: const char *) Param[2]: fontSize (type: int) Param[3]: color (type: Color) -Function 293: ImageTextEx() (5 input parameters) +Function 294: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2776,76 +2781,76 @@ Function 293: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 294: ImageFormat() (2 input parameters) +Function 295: ImageFormat() (2 input parameters) Name: ImageFormat Return type: void Description: Convert image data to desired format Param[1]: image (type: Image *) Param[2]: newFormat (type: int) -Function 295: ImageToPOT() (2 input parameters) +Function 296: ImageToPOT() (2 input parameters) Name: ImageToPOT Return type: void Description: Convert image to POT (power-of-two) Param[1]: image (type: Image *) Param[2]: fill (type: Color) -Function 296: ImageCrop() (2 input parameters) +Function 297: ImageCrop() (2 input parameters) Name: ImageCrop Return type: void Description: Crop an image to a defined rectangle Param[1]: image (type: Image *) Param[2]: crop (type: Rectangle) -Function 297: ImageAlphaCrop() (2 input parameters) +Function 298: ImageAlphaCrop() (2 input parameters) Name: ImageAlphaCrop Return type: void Description: Crop image depending on alpha value Param[1]: image (type: Image *) Param[2]: threshold (type: float) -Function 298: ImageAlphaClear() (3 input parameters) +Function 299: ImageAlphaClear() (3 input parameters) Name: ImageAlphaClear Return type: void Description: Clear alpha channel to desired color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: threshold (type: float) -Function 299: ImageAlphaMask() (2 input parameters) +Function 300: ImageAlphaMask() (2 input parameters) Name: ImageAlphaMask Return type: void Description: Apply alpha mask to image Param[1]: image (type: Image *) Param[2]: alphaMask (type: Image) -Function 300: ImageAlphaPremultiply() (1 input parameters) +Function 301: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 301: ImageBlurGaussian() (2 input parameters) +Function 302: ImageBlurGaussian() (2 input parameters) Name: ImageBlurGaussian Return type: void Description: Apply Gaussian blur using a box blur approximation Param[1]: image (type: Image *) Param[2]: blurSize (type: int) -Function 302: ImageKernelConvolution() (3 input parameters) +Function 303: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply Custom Square image convolution kernel Param[1]: image (type: Image *) Param[2]: kernel (type: float*) Param[3]: kernelSize (type: int) -Function 303: ImageResize() (3 input parameters) +Function 304: ImageResize() (3 input parameters) Name: ImageResize Return type: void Description: Resize image (Bicubic scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 304: ImageResizeNN() (3 input parameters) +Function 305: ImageResizeNN() (3 input parameters) Name: ImageResizeNN Return type: void Description: Resize image (Nearest-Neighbor scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 305: ImageResizeCanvas() (6 input parameters) +Function 306: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2855,12 +2860,12 @@ Function 305: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 306: ImageMipmaps() (1 input parameters) +Function 307: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 307: ImageDither() (5 input parameters) +Function 308: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2869,109 +2874,109 @@ Function 307: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 308: ImageFlipVertical() (1 input parameters) +Function 309: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 309: ImageFlipHorizontal() (1 input parameters) +Function 310: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 310: ImageRotate() (2 input parameters) +Function 311: ImageRotate() (2 input parameters) Name: ImageRotate Return type: void Description: Rotate image by input angle in degrees (-359 to 359) Param[1]: image (type: Image *) Param[2]: degrees (type: int) -Function 311: ImageRotateCW() (1 input parameters) +Function 312: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 312: ImageRotateCCW() (1 input parameters) +Function 313: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 313: ImageColorTint() (2 input parameters) +Function 314: ImageColorTint() (2 input parameters) Name: ImageColorTint Return type: void Description: Modify image color: tint Param[1]: image (type: Image *) Param[2]: color (type: Color) -Function 314: ImageColorInvert() (1 input parameters) +Function 315: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 315: ImageColorGrayscale() (1 input parameters) +Function 316: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 316: ImageColorContrast() (2 input parameters) +Function 317: ImageColorContrast() (2 input parameters) Name: ImageColorContrast Return type: void Description: Modify image color: contrast (-100 to 100) Param[1]: image (type: Image *) Param[2]: contrast (type: float) -Function 317: ImageColorBrightness() (2 input parameters) +Function 318: ImageColorBrightness() (2 input parameters) Name: ImageColorBrightness Return type: void Description: Modify image color: brightness (-255 to 255) Param[1]: image (type: Image *) Param[2]: brightness (type: int) -Function 318: ImageColorReplace() (3 input parameters) +Function 319: ImageColorReplace() (3 input parameters) Name: ImageColorReplace Return type: void Description: Modify image color: replace color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: replace (type: Color) -Function 319: LoadImageColors() (1 input parameters) +Function 320: LoadImageColors() (1 input parameters) Name: LoadImageColors Return type: Color * Description: Load color data from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) -Function 320: LoadImagePalette() (3 input parameters) +Function 321: LoadImagePalette() (3 input parameters) Name: LoadImagePalette Return type: Color * Description: Load colors palette from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) Param[2]: maxPaletteSize (type: int) Param[3]: colorCount (type: int *) -Function 321: UnloadImageColors() (1 input parameters) +Function 322: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 322: UnloadImagePalette() (1 input parameters) +Function 323: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 323: GetImageAlphaBorder() (2 input parameters) +Function 324: GetImageAlphaBorder() (2 input parameters) Name: GetImageAlphaBorder Return type: Rectangle Description: Get image alpha border rectangle Param[1]: image (type: Image) Param[2]: threshold (type: float) -Function 324: GetImageColor() (3 input parameters) +Function 325: GetImageColor() (3 input parameters) Name: GetImageColor Return type: Color Description: Get image pixel color at (x, y) position Param[1]: image (type: Image) Param[2]: x (type: int) Param[3]: y (type: int) -Function 325: ImageClearBackground() (2 input parameters) +Function 326: ImageClearBackground() (2 input parameters) Name: ImageClearBackground Return type: void Description: Clear image background with given color Param[1]: dst (type: Image *) Param[2]: color (type: Color) -Function 326: ImageDrawPixel() (4 input parameters) +Function 327: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -2979,14 +2984,14 @@ Function 326: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 327: ImageDrawPixelV() (3 input parameters) +Function 328: ImageDrawPixelV() (3 input parameters) Name: ImageDrawPixelV Return type: void Description: Draw pixel within an image (Vector version) Param[1]: dst (type: Image *) Param[2]: position (type: Vector2) Param[3]: color (type: Color) -Function 328: ImageDrawLine() (6 input parameters) +Function 329: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -2996,7 +3001,7 @@ Function 328: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 329: ImageDrawLineV() (4 input parameters) +Function 330: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3004,7 +3009,7 @@ Function 329: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 330: ImageDrawCircle() (5 input parameters) +Function 331: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3013,7 +3018,7 @@ Function 330: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 331: ImageDrawCircleV() (4 input parameters) +Function 332: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3021,7 +3026,7 @@ Function 331: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 332: ImageDrawCircleLines() (5 input parameters) +Function 333: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3030,7 +3035,7 @@ Function 332: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 333: ImageDrawCircleLinesV() (4 input parameters) +Function 334: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3038,7 +3043,7 @@ Function 333: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 334: ImageDrawRectangle() (6 input parameters) +Function 335: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3048,7 +3053,7 @@ Function 334: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 335: ImageDrawRectangleV() (4 input parameters) +Function 336: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3056,14 +3061,14 @@ Function 335: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 336: ImageDrawRectangleRec() (3 input parameters) +Function 337: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 337: ImageDrawRectangleLines() (4 input parameters) +Function 338: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3071,7 +3076,7 @@ Function 337: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 338: ImageDraw() (5 input parameters) +Function 339: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3080,7 +3085,7 @@ Function 338: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 339: ImageDrawText() (6 input parameters) +Function 340: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3090,7 +3095,7 @@ Function 339: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 340: ImageDrawTextEx() (7 input parameters) +Function 341: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3101,79 +3106,79 @@ Function 340: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 341: LoadTexture() (1 input parameters) +Function 342: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 342: LoadTextureFromImage() (1 input parameters) +Function 343: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 343: LoadTextureCubemap() (2 input parameters) +Function 344: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 344: LoadRenderTexture() (2 input parameters) +Function 345: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 345: IsTextureReady() (1 input parameters) +Function 346: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 346: UnloadTexture() (1 input parameters) +Function 347: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 347: IsRenderTextureReady() (1 input parameters) +Function 348: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 348: UnloadRenderTexture() (1 input parameters) +Function 349: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 349: UpdateTexture() (2 input parameters) +Function 350: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 350: UpdateTextureRec() (3 input parameters) +Function 351: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 351: GenTextureMipmaps() (1 input parameters) +Function 352: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 352: SetTextureFilter() (2 input parameters) +Function 353: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 353: SetTextureWrap() (2 input parameters) +Function 354: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 354: DrawTexture() (4 input parameters) +Function 355: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3181,14 +3186,14 @@ Function 354: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 355: DrawTextureV() (3 input parameters) +Function 356: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 356: DrawTextureEx() (5 input parameters) +Function 357: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3197,7 +3202,7 @@ Function 356: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 357: DrawTextureRec() (4 input parameters) +Function 358: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3205,7 +3210,7 @@ Function 357: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 358: DrawTexturePro() (6 input parameters) +Function 359: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3215,7 +3220,7 @@ Function 358: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 359: DrawTextureNPatch() (6 input parameters) +Function 360: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3225,112 +3230,112 @@ Function 359: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 360: ColorIsEqual() (2 input parameters) +Function 361: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 361: Fade() (2 input parameters) +Function 362: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 362: ColorToInt() (1 input parameters) +Function 363: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 363: ColorNormalize() (1 input parameters) +Function 364: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 364: ColorFromNormalized() (1 input parameters) +Function 365: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 365: ColorToHSV() (1 input parameters) +Function 366: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 366: ColorFromHSV() (3 input parameters) +Function 367: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 367: ColorTint() (2 input parameters) +Function 368: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 368: ColorBrightness() (2 input parameters) +Function 369: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 369: ColorContrast() (2 input parameters) +Function 370: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 370: ColorAlpha() (2 input parameters) +Function 371: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 371: ColorAlphaBlend() (3 input parameters) +Function 372: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 372: GetColor() (1 input parameters) +Function 373: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 373: GetPixelColor() (2 input parameters) +Function 374: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: void *) Param[2]: format (type: int) -Function 374: SetPixelColor() (3 input parameters) +Function 375: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 375: GetPixelDataSize() (3 input parameters) +Function 376: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 376: GetFontDefault() (0 input parameters) +Function 377: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 377: LoadFont() (1 input parameters) +Function 378: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 378: LoadFontEx() (4 input parameters) +Function 379: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont @@ -3338,14 +3343,14 @@ Function 378: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 379: LoadFontFromImage() (3 input parameters) +Function 380: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 380: LoadFontFromMemory() (6 input parameters) +Function 381: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3355,12 +3360,12 @@ Function 380: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 381: IsFontReady() (1 input parameters) +Function 382: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 382: LoadFontData() (6 input parameters) +Function 383: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3370,7 +3375,7 @@ Function 382: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 383: GenImageFontAtlas() (6 input parameters) +Function 384: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3380,30 +3385,30 @@ Function 383: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 384: UnloadFontData() (2 input parameters) +Function 385: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 385: UnloadFont() (1 input parameters) +Function 386: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 386: ExportFontAsCode() (2 input parameters) +Function 387: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 387: DrawFPS() (2 input parameters) +Function 388: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 388: DrawText() (5 input parameters) +Function 389: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3412,7 +3417,7 @@ Function 388: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 389: DrawTextEx() (6 input parameters) +Function 390: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3422,7 +3427,7 @@ Function 389: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 390: DrawTextPro() (8 input parameters) +Function 391: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3434,7 +3439,7 @@ Function 390: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 391: DrawTextCodepoint() (5 input parameters) +Function 392: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3443,7 +3448,7 @@ Function 391: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 392: DrawTextCodepoints() (7 input parameters) +Function 393: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3454,18 +3459,18 @@ Function 392: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 393: SetTextLineSpacing() (1 input parameters) +Function 394: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 394: MeasureText() (2 input parameters) +Function 395: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 395: MeasureTextEx() (4 input parameters) +Function 396: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3473,185 +3478,185 @@ Function 395: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 396: GetGlyphIndex() (2 input parameters) +Function 397: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 397: GetGlyphInfo() (2 input parameters) +Function 398: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 398: GetGlyphAtlasRec() (2 input parameters) +Function 399: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 399: LoadUTF8() (2 input parameters) +Function 400: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 400: UnloadUTF8() (1 input parameters) +Function 401: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 401: LoadCodepoints() (2 input parameters) +Function 402: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 402: UnloadCodepoints() (1 input parameters) +Function 403: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 403: GetCodepointCount() (1 input parameters) +Function 404: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 404: GetCodepoint() (2 input parameters) +Function 405: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 405: GetCodepointNext() (2 input parameters) +Function 406: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 406: GetCodepointPrevious() (2 input parameters) +Function 407: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 407: CodepointToUTF8() (2 input parameters) +Function 408: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 408: TextCopy() (2 input parameters) +Function 409: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 409: TextIsEqual() (2 input parameters) +Function 410: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text string are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 410: TextLength() (1 input parameters) +Function 411: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 411: TextFormat() (2 input parameters) +Function 412: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 412: TextSubtext() (3 input parameters) +Function 413: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 413: TextReplace() (3 input parameters) +Function 414: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: replace (type: const char *) Param[3]: by (type: const char *) -Function 414: TextInsert() (3 input parameters) +Function 415: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a position (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 415: TextJoin() (3 input parameters) +Function 416: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 416: TextSplit() (3 input parameters) +Function 417: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 417: TextAppend() (3 input parameters) +Function 418: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor! Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 418: TextFindIndex() (2 input parameters) +Function 419: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string Param[1]: text (type: const char *) Param[2]: find (type: const char *) -Function 419: TextToUpper() (1 input parameters) +Function 420: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 420: TextToLower() (1 input parameters) +Function 421: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 421: TextToPascal() (1 input parameters) +Function 422: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 422: TextToInteger() (1 input parameters) +Function 423: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 423: TextToFloat() (1 input parameters) +Function 424: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 424: DrawLine3D() (3 input parameters) +Function 425: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 425: DrawPoint3D() (2 input parameters) +Function 426: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 426: DrawCircle3D() (5 input parameters) +Function 427: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3660,7 +3665,7 @@ Function 426: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 427: DrawTriangle3D() (4 input parameters) +Function 428: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3668,14 +3673,14 @@ Function 427: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 428: DrawTriangleStrip3D() (3 input parameters) +Function 429: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 429: DrawCube() (5 input parameters) +Function 430: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3684,14 +3689,14 @@ Function 429: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 430: DrawCubeV() (3 input parameters) +Function 431: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 431: DrawCubeWires() (5 input parameters) +Function 432: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3700,21 +3705,21 @@ Function 431: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 432: DrawCubeWiresV() (3 input parameters) +Function 433: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 433: DrawSphere() (3 input parameters) +Function 434: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 434: DrawSphereEx() (5 input parameters) +Function 435: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3723,7 +3728,7 @@ Function 434: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 435: DrawSphereWires() (5 input parameters) +Function 436: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3732,7 +3737,7 @@ Function 435: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 436: DrawCylinder() (6 input parameters) +Function 437: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3742,7 +3747,7 @@ Function 436: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 437: DrawCylinderEx() (6 input parameters) +Function 438: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3752,7 +3757,7 @@ Function 437: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 438: DrawCylinderWires() (6 input parameters) +Function 439: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3762,7 +3767,7 @@ Function 438: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 439: DrawCylinderWiresEx() (6 input parameters) +Function 440: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3772,7 +3777,7 @@ Function 439: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 440: DrawCapsule() (6 input parameters) +Function 441: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3782,7 +3787,7 @@ Function 440: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 441: DrawCapsuleWires() (6 input parameters) +Function 442: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3792,51 +3797,51 @@ Function 441: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 442: DrawPlane() (3 input parameters) +Function 443: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 443: DrawRay() (2 input parameters) +Function 444: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 444: DrawGrid() (2 input parameters) +Function 445: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 445: LoadModel() (1 input parameters) +Function 446: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 446: LoadModelFromMesh() (1 input parameters) +Function 447: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 447: IsModelReady() (1 input parameters) +Function 448: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 448: UnloadModel() (1 input parameters) +Function 449: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 449: GetModelBoundingBox() (1 input parameters) +Function 450: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 450: DrawModel() (4 input parameters) +Function 451: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3844,7 +3849,7 @@ Function 450: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 451: DrawModelEx() (6 input parameters) +Function 452: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3854,7 +3859,7 @@ Function 451: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 452: DrawModelWires() (4 input parameters) +Function 453: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3862,7 +3867,7 @@ Function 452: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 453: DrawModelWiresEx() (6 input parameters) +Function 454: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3872,13 +3877,13 @@ Function 453: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 454: DrawBoundingBox() (2 input parameters) +Function 455: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 455: DrawBillboard() (5 input parameters) +Function 456: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3887,7 +3892,7 @@ Function 455: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 456: DrawBillboardRec() (6 input parameters) +Function 457: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3897,7 +3902,7 @@ Function 456: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 457: DrawBillboardPro() (9 input parameters) +Function 458: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3910,13 +3915,13 @@ Function 457: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 458: UploadMesh() (2 input parameters) +Function 459: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 459: UpdateMeshBuffer() (5 input parameters) +Function 460: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3925,19 +3930,19 @@ Function 459: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 460: UnloadMesh() (1 input parameters) +Function 461: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 461: DrawMesh() (3 input parameters) +Function 462: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 462: DrawMeshInstanced() (4 input parameters) +Function 463: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3945,35 +3950,35 @@ Function 462: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 463: GetMeshBoundingBox() (1 input parameters) +Function 464: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 464: GenMeshTangents() (1 input parameters) +Function 465: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 465: ExportMesh() (2 input parameters) +Function 466: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 466: ExportMeshAsCode() (2 input parameters) +Function 467: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 467: GenMeshPoly() (2 input parameters) +Function 468: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 468: GenMeshPlane() (4 input parameters) +Function 469: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -3981,42 +3986,42 @@ Function 468: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 469: GenMeshCube() (3 input parameters) +Function 470: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 470: GenMeshSphere() (3 input parameters) +Function 471: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 471: GenMeshHemiSphere() (3 input parameters) +Function 472: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 472: GenMeshCylinder() (3 input parameters) +Function 473: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 473: GenMeshCone() (3 input parameters) +Function 474: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 474: GenMeshTorus() (4 input parameters) +Function 475: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4024,7 +4029,7 @@ Function 474: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 475: GenMeshKnot() (4 input parameters) +Function 476: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4032,84 +4037,84 @@ Function 475: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 476: GenMeshHeightmap() (2 input parameters) +Function 477: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 477: GenMeshCubicmap() (2 input parameters) +Function 478: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 478: LoadMaterials() (2 input parameters) +Function 479: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 479: LoadMaterialDefault() (0 input parameters) +Function 480: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 480: IsMaterialReady() (1 input parameters) +Function 481: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 481: UnloadMaterial() (1 input parameters) +Function 482: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 482: SetMaterialTexture() (3 input parameters) +Function 483: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 483: SetModelMeshMaterial() (3 input parameters) +Function 484: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 484: LoadModelAnimations() (2 input parameters) +Function 485: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 485: UpdateModelAnimation() (3 input parameters) +Function 486: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 486: UnloadModelAnimation() (1 input parameters) +Function 487: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 487: UnloadModelAnimations() (2 input parameters) +Function 488: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 488: IsModelAnimationValid() (2 input parameters) +Function 489: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 489: CheckCollisionSpheres() (4 input parameters) +Function 490: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4117,40 +4122,40 @@ Function 489: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 490: CheckCollisionBoxes() (2 input parameters) +Function 491: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 491: CheckCollisionBoxSphere() (3 input parameters) +Function 492: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 492: GetRayCollisionSphere() (3 input parameters) +Function 493: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 493: GetRayCollisionBox() (2 input parameters) +Function 494: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 494: GetRayCollisionMesh() (3 input parameters) +Function 495: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 495: GetRayCollisionTriangle() (4 input parameters) +Function 496: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4158,7 +4163,7 @@ Function 495: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 496: GetRayCollisionQuad() (5 input parameters) +Function 497: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4167,158 +4172,158 @@ Function 496: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 497: InitAudioDevice() (0 input parameters) +Function 498: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 498: CloseAudioDevice() (0 input parameters) +Function 499: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 499: IsAudioDeviceReady() (0 input parameters) +Function 500: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 500: SetMasterVolume() (1 input parameters) +Function 501: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 501: GetMasterVolume() (0 input parameters) +Function 502: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 502: LoadWave() (1 input parameters) +Function 503: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 503: LoadWaveFromMemory() (3 input parameters) +Function 504: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 504: IsWaveReady() (1 input parameters) +Function 505: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 505: LoadSound() (1 input parameters) +Function 506: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 506: LoadSoundFromWave() (1 input parameters) +Function 507: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 507: LoadSoundAlias() (1 input parameters) +Function 508: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 508: IsSoundReady() (1 input parameters) +Function 509: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 509: UpdateSound() (3 input parameters) +Function 510: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 510: UnloadWave() (1 input parameters) +Function 511: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 511: UnloadSound() (1 input parameters) +Function 512: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 512: UnloadSoundAlias() (1 input parameters) +Function 513: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 513: ExportWave() (2 input parameters) +Function 514: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 514: ExportWaveAsCode() (2 input parameters) +Function 515: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 515: PlaySound() (1 input parameters) +Function 516: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 516: StopSound() (1 input parameters) +Function 517: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 517: PauseSound() (1 input parameters) +Function 518: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 518: ResumeSound() (1 input parameters) +Function 519: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 519: IsSoundPlaying() (1 input parameters) +Function 520: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 520: SetSoundVolume() (2 input parameters) +Function 521: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 521: SetSoundPitch() (2 input parameters) +Function 522: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 522: SetSoundPan() (2 input parameters) +Function 523: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 523: WaveCopy() (1 input parameters) +Function 524: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 524: WaveCrop() (3 input parameters) +Function 525: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 525: WaveFormat() (4 input parameters) +Function 526: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4326,203 +4331,203 @@ Function 525: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 526: LoadWaveSamples() (1 input parameters) +Function 527: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 527: UnloadWaveSamples() (1 input parameters) +Function 528: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 528: LoadMusicStream() (1 input parameters) +Function 529: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 529: LoadMusicStreamFromMemory() (3 input parameters) +Function 530: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 530: IsMusicReady() (1 input parameters) +Function 531: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 531: UnloadMusicStream() (1 input parameters) +Function 532: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 532: PlayMusicStream() (1 input parameters) +Function 533: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 533: IsMusicStreamPlaying() (1 input parameters) +Function 534: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 534: UpdateMusicStream() (1 input parameters) +Function 535: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 535: StopMusicStream() (1 input parameters) +Function 536: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 536: PauseMusicStream() (1 input parameters) +Function 537: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 537: ResumeMusicStream() (1 input parameters) +Function 538: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 538: SeekMusicStream() (2 input parameters) +Function 539: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 539: SetMusicVolume() (2 input parameters) +Function 540: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 540: SetMusicPitch() (2 input parameters) +Function 541: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 541: SetMusicPan() (2 input parameters) +Function 542: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 542: GetMusicTimeLength() (1 input parameters) +Function 543: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 543: GetMusicTimePlayed() (1 input parameters) +Function 544: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 544: LoadAudioStream() (3 input parameters) +Function 545: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 545: IsAudioStreamReady() (1 input parameters) +Function 546: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 546: UnloadAudioStream() (1 input parameters) +Function 547: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 547: UpdateAudioStream() (3 input parameters) +Function 548: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 548: IsAudioStreamProcessed() (1 input parameters) +Function 549: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 549: PlayAudioStream() (1 input parameters) +Function 550: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 550: PauseAudioStream() (1 input parameters) +Function 551: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 551: ResumeAudioStream() (1 input parameters) +Function 552: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 552: IsAudioStreamPlaying() (1 input parameters) +Function 553: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 553: StopAudioStream() (1 input parameters) +Function 554: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 554: SetAudioStreamVolume() (2 input parameters) +Function 555: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 555: SetAudioStreamPitch() (2 input parameters) +Function 556: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 556: SetAudioStreamPan() (2 input parameters) +Function 557: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 557: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 558: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 558: SetAudioStreamCallback() (2 input parameters) +Function 559: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 559: AttachAudioStreamProcessor() (2 input parameters) +Function 560: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 560: DetachAudioStreamProcessor() (2 input parameters) +Function 561: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 561: AttachAudioMixedProcessor() (1 input parameters) +Function 562: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 562: DetachAudioMixedProcessor() (1 input parameters) +Function 563: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index e079a198e..e7fa157b2 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -1075,6 +1075,9 @@ + + + From 2e38069475d78c75580e95c23c01216dda185ee4 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 29 May 2024 11:07:28 -0400 Subject: [PATCH 32/56] [build.zig] Fix Zig emscripten build (#4012) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix for issue #4010 Split the code for Zig's master branch and >= 0.12.0 due to changes in https://github.com/ziglang/zig/pull/19623 * Restore the cache_include path which was removed in error Accidently removed a couple lines I didn't mean to 🙈 --- src/build.zig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/build.zig b/src/build.zig index d172b3c2a..51a8ab7b0 100644 --- a/src/build.zig +++ b/src/build.zig @@ -201,10 +201,15 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. const cache_include = std.fs.path.join(b.allocator, &.{ b.sysroot.?, "cache", "sysroot", "include" }) catch @panic("Out of memory"); defer b.allocator.free(cache_include); - var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); - dir.close(); - - raylib.addIncludePath(b.path(cache_include)); + if (comptime builtin.zig_version.minor > 12) { + var dir = std.fs.cwd().openDir(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); + dir.close(); + raylib.addIncludePath(b.path(cache_include)); + } else { + var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); + dir.close(); + raylib.addIncludePath(.{ .path = cache_include }); + } }, else => { @panic("Unsupported OS"); From 2804e758694390d00a0784ebe761531f7021bfc9 Mon Sep 17 00:00:00 2001 From: DarkAssassin23 <15916504+DarkAssassin23@users.noreply.github.com> Date: Wed, 29 May 2024 11:22:59 -0400 Subject: [PATCH 33/56] [rtext] Added cast to ExportFontAsCode output to fix C++ compiler errors (#4013) --- src/rtext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 1ddb62509..5ebabc662 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1093,8 +1093,8 @@ bool ExportFontAsCode(Font font, const char *fileName) #else byteCount += sprintf(txtData + byteCount, " // Assign glyph recs and info data directly\n"); byteCount += sprintf(txtData + byteCount, " // WARNING: This font data must not be unloaded\n"); - byteCount += sprintf(txtData + byteCount, " font.recs = fontRecs_%s;\n", fileNamePascal); - byteCount += sprintf(txtData + byteCount, " font.glyphs = fontGlyphs_%s;\n\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)fontRecs_%s;\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.glyphs = (GlyphInfo *)fontGlyphs_%s;\n\n", fileNamePascal); #endif byteCount += sprintf(txtData + byteCount, " return font;\n"); byteCount += sprintf(txtData + byteCount, "}\n"); From e37d19ab1eae7d4d0e9d3229c7b2ececf3efb61f Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 May 2024 17:28:55 +0200 Subject: [PATCH 34/56] REVIEWED: `ExportFontAsCode()`, avoid `const` #4013 --- src/rtext.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 5ebabc662..5ba4e8b6a 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1035,7 +1035,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // Save font recs data byteCount += sprintf(txtData + byteCount, "// Font characters rectangles data\n"); - byteCount += sprintf(txtData + byteCount, "static const Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %1.0f, %1.0f, %1.0f , %1.0f },\n", font.recs[i].x, font.recs[i].y, font.recs[i].width, font.recs[i].height); @@ -1047,7 +1047,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // it could be generated from image and recs byteCount += sprintf(txtData + byteCount, "// Font glyphs info data\n"); byteCount += sprintf(txtData + byteCount, "// NOTE: No glyphs.image data provided\n"); - byteCount += sprintf(txtData + byteCount, "static const GlyphInfo fontGlyphs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static GlyphInfo fontGlyphs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %i, %i, %i, %i, { 0 }},\n", font.glyphs[i].value, font.glyphs[i].offsetX, font.glyphs[i].offsetY, font.glyphs[i].advanceX); @@ -1093,8 +1093,8 @@ bool ExportFontAsCode(Font font, const char *fileName) #else byteCount += sprintf(txtData + byteCount, " // Assign glyph recs and info data directly\n"); byteCount += sprintf(txtData + byteCount, " // WARNING: This font data must not be unloaded\n"); - byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)fontRecs_%s;\n", fileNamePascal); - byteCount += sprintf(txtData + byteCount, " font.glyphs = (GlyphInfo *)fontGlyphs_%s;\n\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.recs = fontRecs_%s;\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.glyphs = fontGlyphs_%s;\n\n", fileNamePascal); #endif byteCount += sprintf(txtData + byteCount, " return font;\n"); byteCount += sprintf(txtData + byteCount, "}\n"); From c04629f6d46fbea68a69a3b376c02137a325ca53 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 May 2024 17:38:19 +0200 Subject: [PATCH 35/56] Update raylib.h --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index e810dcdca..b870cc6ca 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1124,7 +1124,7 @@ RLAPI const char *GetWorkingDirectory(void); // Get current RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory -RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS +RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths From f2344cd08944a7be63b9e5ebf134daf5ff1cd84f Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Wed, 29 May 2024 23:44:20 +0200 Subject: [PATCH 36/56] review color tint functions (#4015) --- src/rtextures.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 571387f23..2f02afece 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -2667,17 +2667,12 @@ void ImageColorTint(Image *image, Color color) Color *pixels = LoadImageColors(*image); - float cR = (float)color.r/255; - float cG = (float)color.g/255; - float cB = (float)color.b/255; - float cA = (float)color.a/255; - for (int i = 0; i < image->width*image->height; i++) { - unsigned char r = (unsigned char)(((float)pixels[i].r/255*cR)*255.0f); - unsigned char g = (unsigned char)(((float)pixels[i].g/255*cG)*255.0f); - unsigned char b = (unsigned char)(((float)pixels[i].b/255*cB)*255.0f); - unsigned char a = (unsigned char)(((float)pixels[i].a/255*cA)*255.0f); + unsigned char r = (unsigned char)(((int)pixels[i].r*(int)color.r)/255); + unsigned char g = (unsigned char)(((int)pixels[i].g*(int)color.g)/255); + unsigned char b = (unsigned char)(((int)pixels[i].b*(int)color.b)/255); + unsigned char a = (unsigned char)(((int)pixels[i].a*(int)color.a)/255); pixels[i].r = r; pixels[i].g = g; @@ -4639,15 +4634,10 @@ Color ColorTint(Color color, Color tint) { Color result = color; - float cR = (float)tint.r/255; - float cG = (float)tint.g/255; - float cB = (float)tint.b/255; - float cA = (float)tint.a/255; - - unsigned char r = (unsigned char)(((float)color.r/255*cR)*255.0f); - unsigned char g = (unsigned char)(((float)color.g/255*cG)*255.0f); - unsigned char b = (unsigned char)(((float)color.b/255*cB)*255.0f); - unsigned char a = (unsigned char)(((float)color.a/255*cA)*255.0f); + unsigned char r = (unsigned char)(((int)color.r*(int)tint.r)/255); + unsigned char g = (unsigned char)(((int)color.g*(int)tint.g)/255); + unsigned char b = (unsigned char)(((int)color.b*(int)tint.b)/255); + unsigned char a = (unsigned char)(((int)color.a*(int)tint.a)/255); result.r = r; result.g = g; From d7a8af144d066e28e821916ac10e66407e7bfa05 Mon Sep 17 00:00:00 2001 From: vaezim <91099081+vaezim@users.noreply.github.com> Date: Thu, 30 May 2024 02:22:07 -0400 Subject: [PATCH 37/56] Fix typos in markdowns and comments, Fix invalid links in HISTORY.md (#4017) --- BINDINGS.md | 2 +- CHANGELOG | 2 +- CONTRIBUTING.md | 12 +- CONVENTIONS.md | 4 +- FAQ.md | 20 +-- HISTORY.md | 150 +++++++++--------- ROADMAP.md | 4 +- examples/README.md | 2 +- examples/core/core_custom_frame_control.c | 2 +- .../raylib_npp_parser/raylib_npp.xml | 4 +- .../raylib_npp_parser/raylib_to_parse.h | 2 +- src/config.h | 2 +- src/raylib.h | 6 +- 13 files changed, 106 insertions(+), 106 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 118794d52..81bc6abda 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -1,6 +1,6 @@ # raylib bindings and wrappers -Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list. +Some people ported raylib to other languages in the form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list. ### Language Bindings diff --git a/CHANGELOG b/CHANGELOG index 77df794db..2141926ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -642,7 +642,7 @@ Release: raylib 4.0 - 8th Anniversary Edition (05 November 2021) KEY CHANGES: - Naming consistency and coherency: Complete review of the library: syntax, naming, comments, decriptions, logs... - Event Automation System: Support for input events recording and automatic re-playing, useful for automated testing and more! - - Custom game-loop control: Intended for advance users that want to control the events polling and the timming mechanisms + - Custom game-loop control: Intended for advanced users that want to control the events polling and the timming mechanisms - rlgl 4.0: Completely decoupling from platform layer and raylib, intended for standalone usage as single-file header-only - raymath 1.5: Complete review following new conventions, to make it more portable and self-contained - raygui 3.0: Complete review and official new release, more portable and self-contained, intended for tools development diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 644a89bf4..78f953baf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ Do you enjoy raylib and want to contribute? Nice! You can help with the followin - `Testing` - Can you find some bugs in raylib? This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules. -Use your best judgement, and feel free to propose changes to this document in a pull request. +Use your best judgment, and feel free to propose changes to this document in a pull request. ### raylib philosophy @@ -28,14 +28,14 @@ Use your best judgement, and feel free to propose changes to this document in a - [raylib license](LICENSE) - [raylib roadmap](ROADMAP.md) -[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone for edit. +[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone to edit. Feel free to review it if required, just take care not to break something. ### raylib C coding conventions Despite being written in C, raylib does not follow the standard Hungarian notation for C, it [follows Pascal-case/camel-case notation](https://github.com/raysan5/raylib/wiki/raylib-coding-conventions), -more common on C# language. All code formatting decisions have been carefully taken +more common in C# language. All code formatting decisions have been carefully taken to make it easier for students/users to read, write and understand code. Source code is extensively commented for that purpose, raylib primary learning method is: @@ -46,12 +46,12 @@ For detailed information on building raylib and examples, please check [raylib W ### Opening new Issues -To open new issue for raylib (bug, enhancement, discussion...), just try to follow these rules: +To open new issues for raylib (bug, enhancement, discussion...), just try to follow these rules: - Make sure the issue has not already been reported before by searching on GitHub under Issues. - If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample demonstrating the unexpected behavior. - - If applies, attach some screenshot of the issue and a .zip file with the code sample and required resources. + - If applicable, attach some screenshot of the issue and a .zip file with the code sample and required resources. - On issue description, add a brackets tag about the raylib module that relates to this issue. If don't know which module, just report the issue, I will review it. - You can check other issues to see how is being done! @@ -60,7 +60,7 @@ To open new issue for raylib (bug, enhancement, discussion...), just try to foll - Make sure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. - Don't send big pull requests (lots of changelists), they are difficult to review. It's better to send small pull requests, one at a time. - - Verify that changes don't break the build (at least on Windows platform). As many platforms where you can test it, the better, but don't worry + - Verify that changes don't break the build (at least on Windows platform). The more platforms where you can test it, the better, but don't worry if you cannot test all the platforms. ### Contact information diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 37db230e5..b7ace0275 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -1,6 +1,6 @@ ## C Coding Style Conventions -Here it is a list with some of the code conventions used by raylib: +Here is a list with some of the code conventions used by raylib: Code element | Convention | Example --- | :---: | --- @@ -79,7 +79,7 @@ _NOTE: Avoid any space or special character in the files/dir naming!_ - Data files should be organized by context and usage in the game, think about the loading requirements for data and put all the resources that need to be loaded at the same time together. - Use descriptive names for the files, it would be perfect if just reading the name of the file, it was possible to know what is that file and where fits in the game. - - Here it is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font). + - Here is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font). ``` resources/audio/fx/long_jump.wav diff --git a/FAQ.md b/FAQ.md index be06657b9..d2f9308ac 100644 --- a/FAQ.md +++ b/FAQ.md @@ -40,13 +40,13 @@ Yes, raylib can be used to create any kind of application, not just videogames. ### How can I learn to use raylib? Is there some official documentation or tutorials? -raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look to [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching. +raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look at [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching. raylib also provides a big [collection of examples](https://www.raylib.com/examples.html), to showcase the multiple functionality usage (+120 examples). Examples are categorized by the internal module functionality and also define an estimated level of difficulty to guide the users checking them. There is also a [FAQ on the raylib Wiki](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions) with common technical questions. -There are also many tutorials on the internet and YouTube created by the growing raylib community along the years. +There are also many tutorials on the internet and YouTube created by the growing raylib community over the years. [raylib Discord Community](https://discord.gg/raylib) is also a great place to join and ask questions, the community is very friendly and always ready to help. @@ -56,7 +56,7 @@ raylib is [free and open source](https://github.com/raysan5/raylib). Anyone can ### What is the raylib license? -raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details. +raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed-source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details. ### What platforms are supported by raylib? @@ -90,25 +90,25 @@ I personally consider raylib a graphics library with some high-level features ra ### What does raylib provide that other engines or libraries don't? -I would say "simplicity" and "enjoyment" at a really low-level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try. +I would say "simplicity" and "enjoyment" at a really low level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try. ### How does raylib compare to Unity/Unreal/Godot? Those engines are usually big and complex to use, providing lot of functionality. They require some time to learn and test, they usually abstract many parts of the game development process and they usually provide a set of tools to assist users on their creations (like a GUI editor). -raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low-level to create graphics applications in a more handmade way. +raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low level to create graphics applications in a more handmade way. ### What development tools are required for raylib? To develop raylib programs you only need a text editor (with recommended code syntax highlighting) and a compiler. -A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advance configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials. +A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advanced configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials. ### What are raylib's external dependencies? -raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file-formats. +raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file formats. -A detailed list of raylib dependencies could be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies). +A detailed list of raylib dependencies can be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies). ### Can I use raylib with other technologies or libraries? @@ -129,10 +129,10 @@ No, raylib is built on top of OpenGL API, and there are currently no plans to su ### What could I expect to see in raylib in the future? -The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features are regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable. +The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features being regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable. ### Who are the raylib developers? -The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there's 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib. +The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there are 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib. The full list of raylib contributors can be seen [on GitHub](https://github.com/raysan5/raylib/graphs/contributors). diff --git a/HISTORY.md b/HISTORY.md index de14b651c..035054dbe 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,13 +3,13 @@ introduction ------------ -I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profile, most of students had never written a single line of code. +I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profiles, most of students had never written a single line of code. I decided to start with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found [WinBGI](https://winbgim.codecutter.org/); it was great and it worked very well with students, in just a couple of weeks, those students that had never written a single line of code were able to program (and understand) a simple PONG game, some of them even a BREAKOUT! -But WinBGI was not the clearer and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration. +But WinBGI was not the clearest and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration. -So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, the most important, primarily intended to learn videogames programming. +So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, most importantly, primarily intended to learn videogames programming. My previous videogames development experience was mostly in C# and [XNA](https://en.wikipedia.org/wiki/Microsoft_XNA) and I really loved it, so, I decided to use C# language style notation and XNA naming conventions. That way, students were able to move from raylib to XNA, MonoGame or similar libs extremely easily. @@ -20,28 +20,28 @@ Enjoy it. notes on raylib 1.1 ------------------- -On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0. +On April 2014, after 6 months of first raylib release, raylib 1.1 was released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0. - A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define. - [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes a bunch of useful functions for 3d-math with vectors, matrices and quaternions. -Some other big changes of this new version have been the support for OGG files loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support. +Some other big changes of this new version have been the support for OGG file loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support. -Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1. +Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.1. notes on raylib 1.2 ------------------- -On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/). +On September 2014, after 5 months of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/). -It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch. +It's been some months of really hard work to accommodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cycle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch. - - A new display initialization system has been created to support multiple resolutions, adding black bars if required; user only defines desired screen size and it gets properly displayed. + - A new display initialization system has been created to support multiple resolutions, adding black bars if required; the user only defines the desired screen size and it gets properly displayed. - Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode). -Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2. +Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.2. In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/). @@ -50,26 +50,26 @@ notes on raylib 1.3 On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality, improves tremendously textures module and also provides some new modules (camera system, gestures system, immediate-mode gui). - - Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder. + - Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen post-processing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder. - Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files. - - A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_first_person.c). + - A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.h) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_first_person.c). - New [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module simplifies gestures detection on Android and HTML5 programs. - - [raygui](https://github.com/raysan5/raylib/blob/master/src/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional. + - [raygui](https://github.com/raysan5/raylib/blob/master/examples/shapes/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primarily intended for tools development. It's still in an experimental state but already fully functional. Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features. -Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3. +Lots of code changes and a lot of testing have concluded in this amazing new raylib 1.3. notes on raylib 1.4 ------------------- On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added. - - First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage. + - First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1331) that have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now basic image processing can be done before converting the image to texture for usage. - SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file. @@ -77,12 +77,12 @@ On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For - [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline. - - [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code. + - [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module has been redesigned and simplified, now it can process touch events from any source, including the mouse. This way, gestures system can be used on any platform providing a unified way to work with inputs and allowing the user to create multiplatform games with only one source code. - Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental). Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions, -and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/src/easings.h) module has also been added for values animation. +and the addition of two simple functions for persistent data storage. Now raylib users can save and load game data in a file (only some platforms are supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/examples/shapes/reasings.h) module has also been added for values animation. Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris. @@ -94,36 +94,36 @@ notes on raylib 1.5 On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added. - - VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c). + - VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameters, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c). - New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally. - - New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material. + - New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages to render internally for every 3d object using standard material. - Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread. - - Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread. + - Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been significantly improved, now physic objects are managed internally in a second thread. - - Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck. + - Audio chiptunes support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All these features thanks to the amazing work of @kd7tck. -Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms. +Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms. -This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes. +This new version is so massive that is difficult to list all the improvements, most of the raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely redesigned to accommodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes. -Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries. +Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries. Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5. notes on raylib 1.6 ------------------- -On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features: +On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version commemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features: - Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality. - - Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more! + - Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completely self-contained, no external libraries are required anymore! - - [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing! + - [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, the library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing! - Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples. @@ -131,41 +131,41 @@ On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new v - Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support. -Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler. +Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advanced users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/projects/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler. New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games. notes on raylib 1.7 ------------------- -On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are: +On May 2017, around 6 months after raylib 1.6, comes another raylib installment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are: - More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, functions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions! - - Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality. + - Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advanced users can customize raylib just by choosing desired features, and defining some configuration flags on modules compilation. That way users can control library size and available functionality. - - Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags. + - Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compilation flags. - - New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems. + - New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All sample material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to the latest raylib version and tested on multiple platforms. Examples folder structure has been improved and also build systems. - - Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process... + - Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplified, some functions have been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process... Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timing improvements, public log system, rres file format support, automatic GIF recording... -And here it is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it. +And here is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it. notes on raylib 1.8 ------------------- October 2017, around 5 months after latest raylib version, another release is published: raylib 1.8. Again, several modules of the library have been reviewed and some new functionality added. Main changes of this new release are: - - [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses. + - [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning purposes. - [Parametric mesh generation](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing. - - PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference. + - PBR Materials support, a completely redesigned shaders and material system allows advanced materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference. - - Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts. + - Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into the final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts. - [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions. @@ -178,37 +178,37 @@ New installer provided, web updated, examples re-builded, documentation reviewed notes on raylib 2.0 ------------------- -It's been 9 month since last raylib version was published, a lots of things have changed since then... This new raylib version represents an inflexion point in the development of the library and so, we jump to a new major version... Here it is the result of almost **5 years and thousands of hours of hard work**... here it is... **raylib 2.0** +It's been 9 months since last raylib version was published, a lot of things have changed since then... This new raylib version represents an inflection point in the development of the library and so, we jump to a new major version... Here is the result of almost **5 years and thousands of hours of hard work**... here is... **raylib 2.0** In **raylib 2.0** the full API has been carefully reviewed for better consistency, some new functionality has been added and the overall raylib experience has been greatly improved... The key features of new version are: - - **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependant ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library. + - **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependent ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library. - **Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtedly, the perfect low-level companion for raylib audio module! - - **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplyfing the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release! + - **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplifying the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release! - **More platforms supported and tested**, including BSD family (FreeBSD, openBSD, NetBSD, DragonFly) and Linux-based family platforms (openSUSE, Debian, Ubuntu, Arch, NixOS...). raylib has already been added to some package managers! Oh, and last but not less important, **Android 64bit** is already supported by raylib! - - **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provide by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds! + - **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provided by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds! - - Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file-formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired! + - Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired! A part of that, lots of new features, like a brand **new font rendering and packaging system** for TTF fonts with **SDF support** (thanks to the amazing STB headers), new functions for **CPU image data manipulation**, new orthographic 3d camera mode, a complete review of `raymath.h` single-file header-only library for better consistency and performance, new examples and way, [way more](https://github.com/raysan5/raylib/blob/master/CHANGELOG). -Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtedly its development has exceeded any initial objective; raylib has become a simple and easy-to-use trully multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning! +Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtedly its development has exceeded any initial objective; raylib has become a simple and easy-to-use truly multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning! notes on raylib 2.5 ------------------- -After almost one years since latest raylib installment, here it is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here it is a short recap with the highlight improvements. +After almost one years since latest raylib installment, here is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here is a short recap with the highlight improvements. - New **window management and file system functions** to query monitor information, deal with clipboard, check directory files info and even launch a URL with default system web browser. Experimental **High-DPI monitor support** has also been added through a compile flag. - **Redesigned Gamepad mechanism**, now generic for all platforms and gamepads, no more specific gamepad configurations. **Redesigned UWP input system**, now raylib supports UWP seamlessly, previous implementation required a custom input system implemented in user code. - - `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behaviour. + - `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behavior. - **VR simulator** has been reviewed to **allow custom configuration of Head-Mounted-Device parameters and distortion shader**, `core_vr_simulator` has been properly adapted to showcase this new functionality, now the VR simulator is a generic configurable stereo rendering system that allows any VR device simulation with just a few lines of code or even dynamic tweaking of HMD parameters. @@ -220,30 +220,30 @@ After almost one years since latest raylib installment, here it is **raylib 2.5* - Experimental **cubemap support**, to automatically load multiple cubemap layouts (`LoadTextureCubemap()`). It required some internal `rlgl` redesign to allow cubemap textures. - - **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accomodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added. + - **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accommodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added. -This is a just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones. +This is just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones. It has been a long year of hard work to make raylib a solid technology to develop new products over it. notes on raylib 3.0 ------------------- -After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has reveived a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other progamming [language bindings](BINDINGS.md). +After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has received a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other programming [language bindings](BINDINGS.md). - - All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variables naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired. + - All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variable naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired. - - All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easely hook their own memory allocations mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074. + - All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easily hook their own memory allocation mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074. - All **I/O file accesses** from raylib are being moved to **memory data access**, now all I/O file access is centralized into just four functions: `LoadFileData()`, `SaveFileData()`, `LoadFileText()`, `SaveFileText()`. Users can just update those functions to any I/O file system. This change makes it easier to integrate raylib with **Virtual File Systems** or custom I/O file implementations. - All **raylib data structures** have been reviewed and optimized for pass-by-value usage. One of raylib distinctive design decisions is that most of its functions receive and return data by value. This design makes raylib really simple for newcomers, avoiding pointers and allowing complete access to all structures data in a simple way. The downside is that data is copied on stack every function call and that copy could be costly so, all raylib data structures have been optimized to **stay under 64 bytes** for fast copy and retrieve. - - All **raylib tracelog messages** have been reviewd and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages. + - All **raylib tracelog messages** have been reviewed and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages. - - `raudio` module has been internally reviewed to accomodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio). + - `raudio` module has been internally reviewed to accommodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio). - - `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accomodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding. + - `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accommodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding. - **Multiple new examples added** (most of them contributed by raylib users) and all examples reviewed for correct execution on most of the supported platforms, specially Web and Raspberry Pi. A detailed categorized table has been created on github for easy examples navigation and code access. @@ -274,19 +274,19 @@ Here the list with some highlights for `raylib 3.5`. - NEW **configuration options** exposed: For custom raylib builds, `config.h` now exposes **more than 150 flags and defines** to build raylib with only the desired features, for example, it allows to build a minimal raylib library in just some KB removing all external data filetypes supported, very useful to generate **small executables or embedded devices**. - - NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file-accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out! + - NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out! - - NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advance users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently. + - NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advanced users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently. - - NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advance Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API. + - NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advanced Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API. - Improved **software rendering**: raylib `Image*()` API is intended for software rendering, for those cases when **no GPU or no Window is available**. Those functions operate directly with **multi-format** pixel data on RAM and they have been completely redesigned to be way faster, specially for small resolutions and retro-gaming. Low-end embedded devices like **microcontrollers with custom displays** could benefit of this raylib functionality! - File **loading from memory**: Multiple functions have been redesigned to load data from memory buffers **instead of directly accessing the files**, now all raylib file loading/saving goes through a couple of functions that load data into memory. This feature allows **custom virtual-file-systems** and it gives more control to the user to access data already loaded in memory (i.e. images, fonts, sounds...). - - NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hidding, focusing, topmost and more. + - NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hiding, focusing, topmost and more. - - NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the diferent generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed. + - NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the different generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed. A part of those changes, many new functions have been added, some redundant functions removed and many functions have been reviewed for consistency with the full API (function name, parameters name and order, code formatting...). Again, this release represents is a **great improvement for raylib and marks the way forward** for the library. Make sure to check [CHANGELOG](CHANGELOG) for details! Hope you enjoy it! @@ -295,7 +295,7 @@ Happy holidays! :) notes on raylib 3.7 ------------------- -April 2021, it's been about 4 months since last raylib release and here it is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April the 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version: +April 2021, it's been about 4 months since the last raylib release and here is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version: Let's start with some numbers: @@ -315,18 +315,18 @@ Highlights for `raylib 3.7`: - **ADDED: glTF animations support**. glTF is the preferred models file format to be used with raylib and along the addition of a models animation API on latest raylib versions, now animations support for glTF format has come to raylib, thanks for this great contribution to [Hristo Stamenov](@object71) - - **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvÄ“rs" Aldiņš](@nezvers), now raylib supports music streamming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD. + - **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvÄ“rs" Aldiņš](@nezvers), now raylib supports music streaming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD. - **RENAMED: enums values for consistency**. Most raylib enums names and values names have been renamed for consistency, now all value names start with the type of data they represent. It increases clarity and readability when using those values and also **improves overall library consistency**. -Beside those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment! +Besides those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment! Happy **gamedev/tools/graphics** programming! :) notes on raylib 4.0 - 8th Anniversary Edition --------------------------------------------- -It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflexion point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long term version (LTS), stable and complete enough for any new graphic/game/tool application development. +It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflection point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long-term version (LTS), stable and complete enough for any new graphic/game/tool application development. Let's start with some numbers: @@ -339,11 +339,11 @@ Let's start with some numbers: Highlights for `raylib 4.0`: - - **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent. + - **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been written in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent. - - **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental. + - **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assisted game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental. - - **Custom game-loop control**: As requested by some advance users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advance users that want to control the events polling and also the timming mechanisms of their games. + - **Custom game-loop control**: As requested by some advanced users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advanced users that want to control the events polling and also the timing mechanisms of their games. - [**`rlgl 4.0`**](https://github.com/raysan5/raylib/blob/master/src/rlgl.h): This module has been completely **decoupled from platform layer** and raylib, now `rlgl` single-file header-only library only depends on the multiple OpenGL backends supported, even the dependency on `raymath` has been removed. Additionally, **support for OpenGL 4.3** has been added, supporting compute shaders and Shader Storage Buffer Objects (SSBO). Now `rlgl` can be used as a complete standalone portable library to wrap several OpenGL version and providing **a simple and easy-to-use pseudo-OpenGL immediate-mode API**. @@ -361,12 +361,12 @@ Highlights for `raylib 4.0`: Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes! -Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :) +Undoubtedly, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :) notes on raylib 4.2 ------------------- -**New raylib release!** Nine months after latest raylib, here it is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing! +**New raylib release!** Nine months after latest raylib, here is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing! Some numbers to start with: @@ -390,7 +390,7 @@ Highlights for `raylib 4.2`: - **New file system API**: Current API has been redesigned to be more comprehensive and better aligned with raylib naming conventions, two new functions are provided `LoadDirectoryFiles()`/`LoadDirectoryFilesEx()` to load a `FilePathList` for provided path, supporting extension filtering and recursive directory scan. `LoadDroppedFiles()` has been renamed to better reflect its internal functionality. Now, all raylib functions that start with `Load*()` allocate memory internally and a equivalent `Unload*()` function is defined to take care of that memory internally when not required any more! - - **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advance users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib. + - **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advanced users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib. As always, there are more improvements than the key features listed, make sure to check raylib [CHANGELOG](CHANGELOG) for the detailed list of changes; for this release a `WARNING` flag has been added to all the changes that could affect bindings or productivity code. **raylib keeps improving one more version** and a special focus on maintainability has been put on the library for the future. Specific/advance functionality will be provided through **raylib-extras** repos and raylib main repo devlelopment will be focused on what made raylib popular: being a simple and easy-to-use library to **enjoy videogames programming**. @@ -399,7 +399,7 @@ As always, there are more improvements than the key features listed, make sure t notes on raylib 4.5 ------------------- -It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here it is a small summary highlighting this new **rayib 4.5**. +It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here is a small summary highlighting this new **rayib 4.5**. Some numbers for this release: @@ -413,7 +413,7 @@ Highlights for `raylib 4.5`: - **`NEW` Improved ANGLE support on Desktop platforms**: Support for OpenGL ES 2.0 on Desktop platforms (Windows, Linux, macOS) has been reviewed by @wtnbgo GitHub user. Now raylib can be compiled on desktop for OpenGL ES 2.0 and linked against [`ANGLE`](https://github.com/google/angle). This _small_ addition open the door to building raylib for all **ANGLE supported backends: Direct3D 11, Vulkan and Metal**. Please note that this new feature is still experimental and requires further testing! - - **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advance users have **full control over camera inputs and movement/rotation speeds**! + - **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advanced users have **full control over camera inputs and movement/rotation speeds**! - **`NEW` Support for M3D models and M3D/GLTF animations**: 3d models animations support has been a limited aspect of raylib for long time, some versions ago IQM animations were supported but raylib 4.5 also adds support for the brand new [M3D file format](https://bztsrc.gitlab.io/model3d/), including animations and the long expected support for **GLTF animations**! The new M3D file format is **simple, portable, feature complete, extensible and open source**. It also provides a complete set of tools to export/visualize M3D models from/to Blender! Now raylib supports up to **3 model file-formats with animations**: `IQM`, `GLTF` and `M3D`. @@ -425,7 +425,7 @@ Highlights for `raylib 4.5`: - **Reviewed `rshapes` module to minimize the rlgl dependency**: Now `rshapes` 2d shapes drawing functions **only depend on 6 low-level functions**: `rlBegin()`, `rlEnd()`, `rlVertex3f()`, `rlTexCoord2f()`, `rlNormal3f()`, `rlSetTexture()`. With only those pseudo-OpenGl 1.1 minimal functionality, everything can be drawn! This improvement converts `rshapes` module in a **self-contained, portable shapes-drawing library that can be used independently of raylib**, as far as entry points for those 6 functions are provided by the user. It even allows to be used for software rendering, with the proper backend! - - **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselfs. + - **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselves. As usual, those are only some highlights but there is much more! New image generators, new color transformation functionality, improved blending support for color/alpha, etc... Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! Please, note that all breaking changes have been flagged with a `WARNING` in the CHANGELOG, specially useful for binding creators! @@ -436,7 +436,7 @@ Let's keep **enjoying games/tools/graphics programming!** :) notes on raylib 5.0 ------------------- -It's been **7 months** since latest raylib release and **10 years** since raylib 1.0 was officially released... what an adventure! In the last 10 years raylib has improved a lot, new functions have been added, many new features and improvements implemented, up to **500 contributors** have helped to shape the library as it is today. `raylib 5.0` is the final result of all this incredible amount of work and dedication. Here it is the summary with the key features and additions of this NEW major version of raylib. +It's been **7 months** since latest raylib release and **10 years** since raylib 1.0 was officially released... what an adventure! In the last 10 years raylib has improved a lot, new functions have been added, many new features and improvements implemented, up to **500 contributors** have helped to shape the library as it is today. `raylib 5.0` is the final result of all this incredible amount of work and dedication. Here is the summary with the key features and additions of this NEW major version of raylib. Some numbers for this release: @@ -448,9 +448,9 @@ Some numbers for this release: Highlights for `raylib 5.0`: - - **`rcore` module platform-split**: Probably the biggest raylib redesign in the last 10 years. raylib started as a library targeting 3 desktop platforms: `Windows`, `Linux` and `macOS` (thanks to `GLFW` underlying library) but with the years support for several new platforms has been added (`Android`, `Web`, `Rapsberry Pi`, `RPI native`...); lot of the platform code was shared so the logic was all together on `rcore.c` module, separated by compilation flags. This approach was very handy but also made it very difficult to support new platforms and specially painful for contributors not familiar with the module, navigating +8000 lines of code in a single file. A big redesign was really needed but the amount of work required was humungus and quite scary for a solo-developer like me, moreover considering that everything was working and the chances to break things were really high. Fortunately, some contributors were ready for the task (@ubkp, @michaelfiber, @Bigfoot71) and thanks to their initiative and super-hard work, the `rcore` [platform split](https://github.com/raysan5/raylib/blob/master/src/platforms) has been possible! This new raylib architecture greatly improves the platforms maintenance but also greatly simplifies the addition of new platforms. A [`platforms/rcore_template.c`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_template.c) file is provided with the required structure and functions to be filled for the addition of new platforms, actually it has been simplified to mostly filling some pre-defined functions: `InitPlatform()`, `ClosePlatform`, `PollInputEvents`... Undoubtely, **this redesign opens the doors to a new era for raylib**, letting the users to plug new platforms as desired. + - **`rcore` module platform-split**: Probably the biggest raylib redesign in the last 10 years. raylib started as a library targeting 3 desktop platforms: `Windows`, `Linux` and `macOS` (thanks to `GLFW` underlying library) but with the years support for several new platforms has been added (`Android`, `Web`, `Rapsberry Pi`, `RPI native`...); lot of the platform code was shared so the logic was all together on `rcore.c` module, separated by compilation flags. This approach was very handy but also made it very difficult to support new platforms and specially painful for contributors not familiar with the module, navigating +8000 lines of code in a single file. A big redesign was really needed but the amount of work required was humungous and quite scary for a solo-developer like me, moreover considering that everything was working and the chances to break things were really high. Fortunately, some contributors were ready for the task (@ubkp, @michaelfiber, @Bigfoot71) and thanks to their initiative and super-hard work, the `rcore` [platform split](https://github.com/raysan5/raylib/blob/master/src/platforms) has been possible! This new raylib architecture greatly improves the platforms maintenance but also greatly simplifies the addition of new platforms. A [`platforms/rcore_template.c`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_template.c) file is provided with the required structure and functions to be filled for the addition of new platforms, actually it has been simplified to mostly filling some pre-defined functions: `InitPlatform()`, `ClosePlatform`, `PollInputEvents`... Undoubtedly, **this redesign opens the doors to a new era for raylib**, letting the users to plug new platforms as desired. - - **`NEW` Platform backend supported: SDL**: Thanks to the new `rcore` platform-split, the addition of new platforms/backends to raylib has been greatly simplified. As a proof of concept, [`SDL2`](https://libsdl.org/) platform backend has been added to raylib as an aternative for `GLFW` library for desktop builds: [`platforms/rcore_desktop_sdl`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_sdl.c). Lot of work has been put to provide exactly the same features as the other platforms and carefully test the new implementation. Now `SDL2` fans can use this new backend, just providing the required include libraries on compilation and linkage (not included in raylib, like `GLFW`). `SDL` backend support also **eases the process of supporting a wider range of platforms** that already support `SDL`. + - **`NEW` Platform backend supported: SDL**: Thanks to the new `rcore` platform-split, the addition of new platforms/backends to raylib has been greatly simplified. As a proof of concept, [`SDL2`](https://libsdl.org/) platform backend has been added to raylib as an alternative for `GLFW` library for desktop builds: [`platforms/rcore_desktop_sdl`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_sdl.c). Lot of work has been put to provide exactly the same features as the other platforms and carefully test the new implementation. Now `SDL2` fans can use this new backend, just providing the required include libraries on compilation and linkage (not included in raylib, like `GLFW`). `SDL` backend support also **eases the process of supporting a wider range of platforms** that already support `SDL`. - **`NEW` Platform backend supported: Nintendo Switch (closed source)**: The addition of the `SDL` backend was quite a challenge but to really verify the robustness and ease of the new platform plugin system, adding support for a console was a more demanding adventure. Surprisingly, only two days of work were required to add support for `Nintendo Switch` to raylib! Implementation result showed an outstanding level of simplicity, with a **self-contained module** (`rcore_swith.cpp`) supporting graphics and inputs. Unfortunately this module can not be open-sourced due to licensing restrictions. @@ -468,6 +468,6 @@ As always, those are only some highlights of the new `raylib 5.0` but there is m Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! -Undoubtely, this is the **biggest raylib update in 10 years**. Many new features and improvements with a special focus on maintainabiliy and long-term sustainability. **Undoubtely, this is the raylib of the future**. +Undoubtedly, this is the **biggest raylib update in 10 years**. Many new features and improvements with a special focus on maintainability and long-term sustainability. **Undoubtedly, this is the raylib of the future**. **Enjoy programming!** :) diff --git a/ROADMAP.md b/ROADMAP.md index 8755333c8..87ca2e1c8 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,6 +1,6 @@ # raylib roadmap -Here it is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas: +Here is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas: - [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix. - [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve. @@ -73,7 +73,7 @@ _Current version of raylib is complete and functional but there is always room f **raylib 1.5** - [x] Support Oculus Rift CV1 and VR stereo rendering (simulator) - [x] Redesign Shaders/Textures system -> New Materials system - - [x] Support lighting: Omni, Directional and Spot lights + - [x] Support lighting: Omni, Directional and Spotlights - [x] Redesign physics module (physac) - [x] Chiptunes audio modules support diff --git a/examples/README.md b/examples/README.md index 94f5369db..d790f7d84 100644 --- a/examples/README.md +++ b/examples/README.md @@ -202,5 +202,5 @@ Examples showing raylib misc functionality that does not fit in other categories | 125 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | raylib_opengl_interop | â­ï¸â­ï¸â­ï¸â­ï¸ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) | | 126 | [embedded_files_loading](others/embedded_files_loading.c) | embedded_files_loading | â­ï¸â­ï¸â˜†â˜† | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) | -As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with! +As always contributions are welcome, feel free to send new examples! Here is an [examples template](examples_template.c) to start with! diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index 6e494d86e..9793fc359 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -2,7 +2,7 @@ * * raylib [core] example - custom frame control * -* NOTE: WARNING: This is an example for advance users willing to have full control over +* NOTE: WARNING: This is an example for advanced users willing to have full control over * the frame processes. By default, EndDrawing() calls the following processes: * 1. Draw remaining batch data: rlDrawRenderBatchActive() * 2. SwapScreenBuffer() diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index 6c0552974..c869a1a18 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -509,7 +509,7 @@ - + @@ -2822,7 +2822,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 8776d4349..0a3c2417d 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -134,7 +134,7 @@ RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal me RLAPI void MemFree(void *ptr); // Internal memory free // Set custom callbacks -// WARNING: Callbacks setup is intended for advance users +// WARNING: Callbacks setup is intended for advanced users RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver diff --git a/src/config.h b/src/config.h index 3c92de72d..c54583e74 100644 --- a/src/config.h +++ b/src/config.h @@ -66,7 +66,7 @@ #define SUPPORT_COMPRESSION_API 1 // Support automatic generated events, loading and recording of those events when required #define SUPPORT_AUTOMATION_EVENTS 1 -// Support custom frame control, only for advance users +// Support custom frame control, only for advanced users // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() // Enabling this flag allows manual control of the frame processes, use at your own risk //#define SUPPORT_CUSTOM_FRAME_CONTROL 1 diff --git a/src/raylib.h b/src/raylib.h index b870cc6ca..1bf740b9b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -934,7 +934,7 @@ typedef enum { } NPatchLayout; // Callbacks to hook some internal functions -// WARNING: These callbacks are intended for advance users +// WARNING: These callbacks are intended for advanced users typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, int *dataSize); // FileIO: Load binary data typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, int dataSize); // FileIO: Save binary data @@ -1066,7 +1066,7 @@ RLAPI double GetTime(void); // Get elapsed RLAPI int GetFPS(void); // Get current FPS // Custom frame control functions -// NOTE: Those functions are intended for advance users that want full control over the frame processing +// NOTE: Those functions are intended for advanced users that want full control over the frame processing // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) @@ -1093,7 +1093,7 @@ RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal me RLAPI void MemFree(void *ptr); // Internal memory free // Set custom callbacks -// WARNING: Callbacks setup is intended for advance users +// WARNING: Callbacks setup is intended for advanced users RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver From 606cc1d897db0a2df201b1c5f7e98bda29d74c64 Mon Sep 17 00:00:00 2001 From: kai-z99 <147789796+kai-z99@users.noreply.github.com> Date: Wed, 29 May 2024 23:24:44 -0700 Subject: [PATCH 38/56] [rshapes]Circle line collision function (#4018) * inital function * working 1 * optimize * optimized dot product * simplify * cleanup * cleanup * cleanup * comment * var name change * epsilon --- src/raylib.h | 1 + src/rshapes.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 1bf740b9b..dfa98efb8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1295,6 +1295,7 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ diff --git a/src/rshapes.c b/src/rshapes.c index 80df64e2d..cb85c1c54 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -2315,6 +2315,30 @@ bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshol return collision; } +// Check if circle collides with a line created betweeen two points [p1] and [p2] +RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2) +{ + float dx = p1.x - p2.x; + float dy = p1.y - p2.y; + + if ((fabsf(dx) + fabsf(dy)) <= FLT_EPSILON) + { + return CheckCollisionCircles(p1, 0, center, radius); + } + + float lengthSQ = ((dx * dx) + (dy * dy)); + float dotProduct = (((center.x - p1.x) * (p2.x - p1.x)) + ((center.y - p1.y) * (p2.y - p1.y))) / (lengthSQ); + + if (dotProduct > 1.0f) dotProduct = 1.0f; + else if (dotProduct < 0.0f) dotProduct = 0.0f; + + float dx2 = (p1.x - (dotProduct * (dx))) - center.x; + float dy2 = (p1.y - (dotProduct * (dy))) - center.y; + float distanceSQ = ((dx2 * dx2) + (dy2 * dy2)); + + return (distanceSQ <= radius * radius); +} + // Get collision rectangle for two rectangles collision Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) { From 1344979c708bdf5000d8963d26d938ae4db5d771 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 May 2024 06:24:58 +0000 Subject: [PATCH 39/56] Update raylib_api.* by CI --- parser/output/raylib_api.json | 23 ++ parser/output/raylib_api.lua | 11 + parser/output/raylib_api.txt | 602 +++++++++++++++++----------------- parser/output/raylib_api.xml | 8 +- 4 files changed, 346 insertions(+), 298 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index f2a9cc61e..4bfce70d1 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -6703,6 +6703,29 @@ } ] }, + { + "name": "CheckCollisionCircleLine", + "description": "Check if circle collides with a line created betweeen two points [p1] and [p2]", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + } + ] + }, { "name": "GetCollisionRec", "description": "Get collision rectangle for two rectangles collision", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 68fef97bb..4a6998bbd 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5266,6 +5266,17 @@ return { {type = "int", name = "threshold"} } }, + { + name = "CheckCollisionCircleLine", + description = "Check if circle collides with a line created betweeen two points [p1] and [p2]", + returnType = "bool", + params = { + {type = "Vector2", name = "center"}, + {type = "float", name = "radius"}, + {type = "Vector2", name = "p1"}, + {type = "Vector2", name = "p2"} + } + }, { name = "GetCollisionRec", description = "Get collision rectangle for two rectangles collision", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index d6576dee5..979ef0d56 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 563 +Functions found: 564 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -2593,18 +2593,26 @@ Function 267: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 268: GetCollisionRec() (2 input parameters) +Function 268: CheckCollisionCircleLine() (4 input parameters) + Name: CheckCollisionCircleLine + Return type: bool + Description: Check if circle collides with a line created betweeen two points [p1] and [p2] + Param[1]: center (type: Vector2) + Param[2]: radius (type: float) + Param[3]: p1 (type: Vector2) + Param[4]: p2 (type: Vector2) +Function 269: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle Description: Get collision rectangle for two rectangles collision Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 269: LoadImage() (1 input parameters) +Function 270: LoadImage() (1 input parameters) Name: LoadImage Return type: Image Description: Load image from file into CPU memory (RAM) Param[1]: fileName (type: const char *) -Function 270: LoadImageRaw() (5 input parameters) +Function 271: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2613,20 +2621,20 @@ Function 270: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 271: LoadImageSvg() (3 input parameters) +Function 272: LoadImageSvg() (3 input parameters) Name: LoadImageSvg Return type: Image Description: Load image from SVG file data or string with specified size Param[1]: fileNameOrString (type: const char *) Param[2]: width (type: int) Param[3]: height (type: int) -Function 272: LoadImageAnim() (2 input parameters) +Function 273: LoadImageAnim() (2 input parameters) Name: LoadImageAnim Return type: Image Description: Load image sequence from file (frames appended to image.data) Param[1]: fileName (type: const char *) Param[2]: frames (type: int *) -Function 273: LoadImageAnimFromMemory() (4 input parameters) +Function 274: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2634,60 +2642,60 @@ Function 273: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 274: LoadImageFromMemory() (3 input parameters) +Function 275: LoadImageFromMemory() (3 input parameters) Name: LoadImageFromMemory Return type: Image Description: Load image from memory buffer, fileType refers to extension: i.e. '.png' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 275: LoadImageFromTexture() (1 input parameters) +Function 276: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 276: LoadImageFromScreen() (0 input parameters) +Function 277: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 277: IsImageReady() (1 input parameters) +Function 278: IsImageReady() (1 input parameters) Name: IsImageReady Return type: bool Description: Check if an image is ready Param[1]: image (type: Image) -Function 278: UnloadImage() (1 input parameters) +Function 279: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 279: ExportImage() (2 input parameters) +Function 280: ExportImage() (2 input parameters) Name: ExportImage Return type: bool Description: Export image data to file, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 280: ExportImageToMemory() (3 input parameters) +Function 281: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 281: ExportImageAsCode() (2 input parameters) +Function 282: ExportImageAsCode() (2 input parameters) Name: ExportImageAsCode Return type: bool Description: Export image as code file defining an array of bytes, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 282: GenImageColor() (3 input parameters) +Function 283: GenImageColor() (3 input parameters) Name: GenImageColor Return type: Image Description: Generate image: plain color Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 283: GenImageGradientLinear() (5 input parameters) +Function 284: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2696,7 +2704,7 @@ Function 283: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 284: GenImageGradientRadial() (5 input parameters) +Function 285: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2705,7 +2713,7 @@ Function 284: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 285: GenImageGradientSquare() (5 input parameters) +Function 286: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2714,7 +2722,7 @@ Function 285: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 286: GenImageChecked() (6 input parameters) +Function 287: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2724,14 +2732,14 @@ Function 286: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 287: GenImageWhiteNoise() (3 input parameters) +Function 288: GenImageWhiteNoise() (3 input parameters) Name: GenImageWhiteNoise Return type: Image Description: Generate image: white noise Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: factor (type: float) -Function 288: GenImagePerlinNoise() (5 input parameters) +Function 289: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2740,39 +2748,39 @@ Function 288: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 289: GenImageCellular() (3 input parameters) +Function 290: GenImageCellular() (3 input parameters) Name: GenImageCellular Return type: Image Description: Generate image: cellular algorithm, bigger tileSize means bigger cells Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: tileSize (type: int) -Function 290: GenImageText() (3 input parameters) +Function 291: GenImageText() (3 input parameters) Name: GenImageText Return type: Image Description: Generate image: grayscale image from text data Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: text (type: const char *) -Function 291: ImageCopy() (1 input parameters) +Function 292: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 292: ImageFromImage() (2 input parameters) +Function 293: ImageFromImage() (2 input parameters) Name: ImageFromImage Return type: Image Description: Create an image from another image piece Param[1]: image (type: Image) Param[2]: rec (type: Rectangle) -Function 293: ImageText() (3 input parameters) +Function 294: ImageText() (3 input parameters) Name: ImageText Return type: Image Description: Create an image from text (default font) Param[1]: text (type: const char *) Param[2]: fontSize (type: int) Param[3]: color (type: Color) -Function 294: ImageTextEx() (5 input parameters) +Function 295: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2781,76 +2789,76 @@ Function 294: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 295: ImageFormat() (2 input parameters) +Function 296: ImageFormat() (2 input parameters) Name: ImageFormat Return type: void Description: Convert image data to desired format Param[1]: image (type: Image *) Param[2]: newFormat (type: int) -Function 296: ImageToPOT() (2 input parameters) +Function 297: ImageToPOT() (2 input parameters) Name: ImageToPOT Return type: void Description: Convert image to POT (power-of-two) Param[1]: image (type: Image *) Param[2]: fill (type: Color) -Function 297: ImageCrop() (2 input parameters) +Function 298: ImageCrop() (2 input parameters) Name: ImageCrop Return type: void Description: Crop an image to a defined rectangle Param[1]: image (type: Image *) Param[2]: crop (type: Rectangle) -Function 298: ImageAlphaCrop() (2 input parameters) +Function 299: ImageAlphaCrop() (2 input parameters) Name: ImageAlphaCrop Return type: void Description: Crop image depending on alpha value Param[1]: image (type: Image *) Param[2]: threshold (type: float) -Function 299: ImageAlphaClear() (3 input parameters) +Function 300: ImageAlphaClear() (3 input parameters) Name: ImageAlphaClear Return type: void Description: Clear alpha channel to desired color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: threshold (type: float) -Function 300: ImageAlphaMask() (2 input parameters) +Function 301: ImageAlphaMask() (2 input parameters) Name: ImageAlphaMask Return type: void Description: Apply alpha mask to image Param[1]: image (type: Image *) Param[2]: alphaMask (type: Image) -Function 301: ImageAlphaPremultiply() (1 input parameters) +Function 302: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 302: ImageBlurGaussian() (2 input parameters) +Function 303: ImageBlurGaussian() (2 input parameters) Name: ImageBlurGaussian Return type: void Description: Apply Gaussian blur using a box blur approximation Param[1]: image (type: Image *) Param[2]: blurSize (type: int) -Function 303: ImageKernelConvolution() (3 input parameters) +Function 304: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply Custom Square image convolution kernel Param[1]: image (type: Image *) Param[2]: kernel (type: float*) Param[3]: kernelSize (type: int) -Function 304: ImageResize() (3 input parameters) +Function 305: ImageResize() (3 input parameters) Name: ImageResize Return type: void Description: Resize image (Bicubic scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 305: ImageResizeNN() (3 input parameters) +Function 306: ImageResizeNN() (3 input parameters) Name: ImageResizeNN Return type: void Description: Resize image (Nearest-Neighbor scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 306: ImageResizeCanvas() (6 input parameters) +Function 307: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2860,12 +2868,12 @@ Function 306: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 307: ImageMipmaps() (1 input parameters) +Function 308: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 308: ImageDither() (5 input parameters) +Function 309: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2874,109 +2882,109 @@ Function 308: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 309: ImageFlipVertical() (1 input parameters) +Function 310: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 310: ImageFlipHorizontal() (1 input parameters) +Function 311: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 311: ImageRotate() (2 input parameters) +Function 312: ImageRotate() (2 input parameters) Name: ImageRotate Return type: void Description: Rotate image by input angle in degrees (-359 to 359) Param[1]: image (type: Image *) Param[2]: degrees (type: int) -Function 312: ImageRotateCW() (1 input parameters) +Function 313: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 313: ImageRotateCCW() (1 input parameters) +Function 314: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 314: ImageColorTint() (2 input parameters) +Function 315: ImageColorTint() (2 input parameters) Name: ImageColorTint Return type: void Description: Modify image color: tint Param[1]: image (type: Image *) Param[2]: color (type: Color) -Function 315: ImageColorInvert() (1 input parameters) +Function 316: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 316: ImageColorGrayscale() (1 input parameters) +Function 317: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 317: ImageColorContrast() (2 input parameters) +Function 318: ImageColorContrast() (2 input parameters) Name: ImageColorContrast Return type: void Description: Modify image color: contrast (-100 to 100) Param[1]: image (type: Image *) Param[2]: contrast (type: float) -Function 318: ImageColorBrightness() (2 input parameters) +Function 319: ImageColorBrightness() (2 input parameters) Name: ImageColorBrightness Return type: void Description: Modify image color: brightness (-255 to 255) Param[1]: image (type: Image *) Param[2]: brightness (type: int) -Function 319: ImageColorReplace() (3 input parameters) +Function 320: ImageColorReplace() (3 input parameters) Name: ImageColorReplace Return type: void Description: Modify image color: replace color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: replace (type: Color) -Function 320: LoadImageColors() (1 input parameters) +Function 321: LoadImageColors() (1 input parameters) Name: LoadImageColors Return type: Color * Description: Load color data from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) -Function 321: LoadImagePalette() (3 input parameters) +Function 322: LoadImagePalette() (3 input parameters) Name: LoadImagePalette Return type: Color * Description: Load colors palette from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) Param[2]: maxPaletteSize (type: int) Param[3]: colorCount (type: int *) -Function 322: UnloadImageColors() (1 input parameters) +Function 323: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 323: UnloadImagePalette() (1 input parameters) +Function 324: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 324: GetImageAlphaBorder() (2 input parameters) +Function 325: GetImageAlphaBorder() (2 input parameters) Name: GetImageAlphaBorder Return type: Rectangle Description: Get image alpha border rectangle Param[1]: image (type: Image) Param[2]: threshold (type: float) -Function 325: GetImageColor() (3 input parameters) +Function 326: GetImageColor() (3 input parameters) Name: GetImageColor Return type: Color Description: Get image pixel color at (x, y) position Param[1]: image (type: Image) Param[2]: x (type: int) Param[3]: y (type: int) -Function 326: ImageClearBackground() (2 input parameters) +Function 327: ImageClearBackground() (2 input parameters) Name: ImageClearBackground Return type: void Description: Clear image background with given color Param[1]: dst (type: Image *) Param[2]: color (type: Color) -Function 327: ImageDrawPixel() (4 input parameters) +Function 328: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -2984,14 +2992,14 @@ Function 327: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 328: ImageDrawPixelV() (3 input parameters) +Function 329: ImageDrawPixelV() (3 input parameters) Name: ImageDrawPixelV Return type: void Description: Draw pixel within an image (Vector version) Param[1]: dst (type: Image *) Param[2]: position (type: Vector2) Param[3]: color (type: Color) -Function 329: ImageDrawLine() (6 input parameters) +Function 330: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3001,7 +3009,7 @@ Function 329: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 330: ImageDrawLineV() (4 input parameters) +Function 331: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3009,7 +3017,7 @@ Function 330: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 331: ImageDrawCircle() (5 input parameters) +Function 332: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3018,7 +3026,7 @@ Function 331: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 332: ImageDrawCircleV() (4 input parameters) +Function 333: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3026,7 +3034,7 @@ Function 332: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 333: ImageDrawCircleLines() (5 input parameters) +Function 334: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3035,7 +3043,7 @@ Function 333: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 334: ImageDrawCircleLinesV() (4 input parameters) +Function 335: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3043,7 +3051,7 @@ Function 334: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 335: ImageDrawRectangle() (6 input parameters) +Function 336: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3053,7 +3061,7 @@ Function 335: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 336: ImageDrawRectangleV() (4 input parameters) +Function 337: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3061,14 +3069,14 @@ Function 336: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 337: ImageDrawRectangleRec() (3 input parameters) +Function 338: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 338: ImageDrawRectangleLines() (4 input parameters) +Function 339: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3076,7 +3084,7 @@ Function 338: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 339: ImageDraw() (5 input parameters) +Function 340: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3085,7 +3093,7 @@ Function 339: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 340: ImageDrawText() (6 input parameters) +Function 341: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3095,7 +3103,7 @@ Function 340: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 341: ImageDrawTextEx() (7 input parameters) +Function 342: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3106,79 +3114,79 @@ Function 341: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 342: LoadTexture() (1 input parameters) +Function 343: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 343: LoadTextureFromImage() (1 input parameters) +Function 344: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 344: LoadTextureCubemap() (2 input parameters) +Function 345: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 345: LoadRenderTexture() (2 input parameters) +Function 346: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 346: IsTextureReady() (1 input parameters) +Function 347: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 347: UnloadTexture() (1 input parameters) +Function 348: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 348: IsRenderTextureReady() (1 input parameters) +Function 349: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 349: UnloadRenderTexture() (1 input parameters) +Function 350: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 350: UpdateTexture() (2 input parameters) +Function 351: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 351: UpdateTextureRec() (3 input parameters) +Function 352: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 352: GenTextureMipmaps() (1 input parameters) +Function 353: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 353: SetTextureFilter() (2 input parameters) +Function 354: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 354: SetTextureWrap() (2 input parameters) +Function 355: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 355: DrawTexture() (4 input parameters) +Function 356: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3186,14 +3194,14 @@ Function 355: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 356: DrawTextureV() (3 input parameters) +Function 357: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 357: DrawTextureEx() (5 input parameters) +Function 358: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3202,7 +3210,7 @@ Function 357: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 358: DrawTextureRec() (4 input parameters) +Function 359: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3210,7 +3218,7 @@ Function 358: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 359: DrawTexturePro() (6 input parameters) +Function 360: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3220,7 +3228,7 @@ Function 359: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 360: DrawTextureNPatch() (6 input parameters) +Function 361: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3230,112 +3238,112 @@ Function 360: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 361: ColorIsEqual() (2 input parameters) +Function 362: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 362: Fade() (2 input parameters) +Function 363: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 363: ColorToInt() (1 input parameters) +Function 364: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 364: ColorNormalize() (1 input parameters) +Function 365: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 365: ColorFromNormalized() (1 input parameters) +Function 366: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 366: ColorToHSV() (1 input parameters) +Function 367: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 367: ColorFromHSV() (3 input parameters) +Function 368: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 368: ColorTint() (2 input parameters) +Function 369: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 369: ColorBrightness() (2 input parameters) +Function 370: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 370: ColorContrast() (2 input parameters) +Function 371: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 371: ColorAlpha() (2 input parameters) +Function 372: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 372: ColorAlphaBlend() (3 input parameters) +Function 373: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 373: GetColor() (1 input parameters) +Function 374: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 374: GetPixelColor() (2 input parameters) +Function 375: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: void *) Param[2]: format (type: int) -Function 375: SetPixelColor() (3 input parameters) +Function 376: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 376: GetPixelDataSize() (3 input parameters) +Function 377: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 377: GetFontDefault() (0 input parameters) +Function 378: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 378: LoadFont() (1 input parameters) +Function 379: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 379: LoadFontEx() (4 input parameters) +Function 380: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont @@ -3343,14 +3351,14 @@ Function 379: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 380: LoadFontFromImage() (3 input parameters) +Function 381: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 381: LoadFontFromMemory() (6 input parameters) +Function 382: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3360,12 +3368,12 @@ Function 381: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 382: IsFontReady() (1 input parameters) +Function 383: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 383: LoadFontData() (6 input parameters) +Function 384: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3375,7 +3383,7 @@ Function 383: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 384: GenImageFontAtlas() (6 input parameters) +Function 385: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3385,30 +3393,30 @@ Function 384: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 385: UnloadFontData() (2 input parameters) +Function 386: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 386: UnloadFont() (1 input parameters) +Function 387: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 387: ExportFontAsCode() (2 input parameters) +Function 388: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 388: DrawFPS() (2 input parameters) +Function 389: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 389: DrawText() (5 input parameters) +Function 390: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3417,7 +3425,7 @@ Function 389: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 390: DrawTextEx() (6 input parameters) +Function 391: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3427,7 +3435,7 @@ Function 390: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 391: DrawTextPro() (8 input parameters) +Function 392: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3439,7 +3447,7 @@ Function 391: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 392: DrawTextCodepoint() (5 input parameters) +Function 393: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3448,7 +3456,7 @@ Function 392: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 393: DrawTextCodepoints() (7 input parameters) +Function 394: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3459,18 +3467,18 @@ Function 393: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 394: SetTextLineSpacing() (1 input parameters) +Function 395: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 395: MeasureText() (2 input parameters) +Function 396: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 396: MeasureTextEx() (4 input parameters) +Function 397: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3478,185 +3486,185 @@ Function 396: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 397: GetGlyphIndex() (2 input parameters) +Function 398: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 398: GetGlyphInfo() (2 input parameters) +Function 399: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 399: GetGlyphAtlasRec() (2 input parameters) +Function 400: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 400: LoadUTF8() (2 input parameters) +Function 401: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 401: UnloadUTF8() (1 input parameters) +Function 402: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 402: LoadCodepoints() (2 input parameters) +Function 403: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 403: UnloadCodepoints() (1 input parameters) +Function 404: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 404: GetCodepointCount() (1 input parameters) +Function 405: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 405: GetCodepoint() (2 input parameters) +Function 406: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 406: GetCodepointNext() (2 input parameters) +Function 407: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 407: GetCodepointPrevious() (2 input parameters) +Function 408: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 408: CodepointToUTF8() (2 input parameters) +Function 409: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 409: TextCopy() (2 input parameters) +Function 410: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 410: TextIsEqual() (2 input parameters) +Function 411: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text string are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 411: TextLength() (1 input parameters) +Function 412: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 412: TextFormat() (2 input parameters) +Function 413: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 413: TextSubtext() (3 input parameters) +Function 414: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 414: TextReplace() (3 input parameters) +Function 415: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: replace (type: const char *) Param[3]: by (type: const char *) -Function 415: TextInsert() (3 input parameters) +Function 416: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a position (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 416: TextJoin() (3 input parameters) +Function 417: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 417: TextSplit() (3 input parameters) +Function 418: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 418: TextAppend() (3 input parameters) +Function 419: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor! Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 419: TextFindIndex() (2 input parameters) +Function 420: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string Param[1]: text (type: const char *) Param[2]: find (type: const char *) -Function 420: TextToUpper() (1 input parameters) +Function 421: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 421: TextToLower() (1 input parameters) +Function 422: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 422: TextToPascal() (1 input parameters) +Function 423: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 423: TextToInteger() (1 input parameters) +Function 424: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 424: TextToFloat() (1 input parameters) +Function 425: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 425: DrawLine3D() (3 input parameters) +Function 426: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 426: DrawPoint3D() (2 input parameters) +Function 427: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 427: DrawCircle3D() (5 input parameters) +Function 428: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3665,7 +3673,7 @@ Function 427: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 428: DrawTriangle3D() (4 input parameters) +Function 429: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3673,14 +3681,14 @@ Function 428: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 429: DrawTriangleStrip3D() (3 input parameters) +Function 430: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 430: DrawCube() (5 input parameters) +Function 431: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3689,14 +3697,14 @@ Function 430: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 431: DrawCubeV() (3 input parameters) +Function 432: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 432: DrawCubeWires() (5 input parameters) +Function 433: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3705,21 +3713,21 @@ Function 432: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 433: DrawCubeWiresV() (3 input parameters) +Function 434: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 434: DrawSphere() (3 input parameters) +Function 435: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 435: DrawSphereEx() (5 input parameters) +Function 436: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3728,7 +3736,7 @@ Function 435: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 436: DrawSphereWires() (5 input parameters) +Function 437: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3737,7 +3745,7 @@ Function 436: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 437: DrawCylinder() (6 input parameters) +Function 438: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3747,7 +3755,7 @@ Function 437: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 438: DrawCylinderEx() (6 input parameters) +Function 439: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3757,7 +3765,7 @@ Function 438: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 439: DrawCylinderWires() (6 input parameters) +Function 440: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3767,7 +3775,7 @@ Function 439: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 440: DrawCylinderWiresEx() (6 input parameters) +Function 441: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3777,7 +3785,7 @@ Function 440: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 441: DrawCapsule() (6 input parameters) +Function 442: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3787,7 +3795,7 @@ Function 441: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 442: DrawCapsuleWires() (6 input parameters) +Function 443: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3797,51 +3805,51 @@ Function 442: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 443: DrawPlane() (3 input parameters) +Function 444: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 444: DrawRay() (2 input parameters) +Function 445: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 445: DrawGrid() (2 input parameters) +Function 446: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 446: LoadModel() (1 input parameters) +Function 447: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 447: LoadModelFromMesh() (1 input parameters) +Function 448: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 448: IsModelReady() (1 input parameters) +Function 449: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 449: UnloadModel() (1 input parameters) +Function 450: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 450: GetModelBoundingBox() (1 input parameters) +Function 451: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 451: DrawModel() (4 input parameters) +Function 452: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3849,7 +3857,7 @@ Function 451: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 452: DrawModelEx() (6 input parameters) +Function 453: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3859,7 +3867,7 @@ Function 452: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 453: DrawModelWires() (4 input parameters) +Function 454: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3867,7 +3875,7 @@ Function 453: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 454: DrawModelWiresEx() (6 input parameters) +Function 455: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3877,13 +3885,13 @@ Function 454: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 455: DrawBoundingBox() (2 input parameters) +Function 456: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 456: DrawBillboard() (5 input parameters) +Function 457: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3892,7 +3900,7 @@ Function 456: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 457: DrawBillboardRec() (6 input parameters) +Function 458: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3902,7 +3910,7 @@ Function 457: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 458: DrawBillboardPro() (9 input parameters) +Function 459: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3915,13 +3923,13 @@ Function 458: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 459: UploadMesh() (2 input parameters) +Function 460: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 460: UpdateMeshBuffer() (5 input parameters) +Function 461: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3930,19 +3938,19 @@ Function 460: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 461: UnloadMesh() (1 input parameters) +Function 462: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 462: DrawMesh() (3 input parameters) +Function 463: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 463: DrawMeshInstanced() (4 input parameters) +Function 464: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3950,35 +3958,35 @@ Function 463: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 464: GetMeshBoundingBox() (1 input parameters) +Function 465: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 465: GenMeshTangents() (1 input parameters) +Function 466: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 466: ExportMesh() (2 input parameters) +Function 467: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 467: ExportMeshAsCode() (2 input parameters) +Function 468: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 468: GenMeshPoly() (2 input parameters) +Function 469: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 469: GenMeshPlane() (4 input parameters) +Function 470: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -3986,42 +3994,42 @@ Function 469: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 470: GenMeshCube() (3 input parameters) +Function 471: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 471: GenMeshSphere() (3 input parameters) +Function 472: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 472: GenMeshHemiSphere() (3 input parameters) +Function 473: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 473: GenMeshCylinder() (3 input parameters) +Function 474: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 474: GenMeshCone() (3 input parameters) +Function 475: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 475: GenMeshTorus() (4 input parameters) +Function 476: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4029,7 +4037,7 @@ Function 475: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 476: GenMeshKnot() (4 input parameters) +Function 477: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4037,84 +4045,84 @@ Function 476: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 477: GenMeshHeightmap() (2 input parameters) +Function 478: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 478: GenMeshCubicmap() (2 input parameters) +Function 479: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 479: LoadMaterials() (2 input parameters) +Function 480: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 480: LoadMaterialDefault() (0 input parameters) +Function 481: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 481: IsMaterialReady() (1 input parameters) +Function 482: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 482: UnloadMaterial() (1 input parameters) +Function 483: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 483: SetMaterialTexture() (3 input parameters) +Function 484: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 484: SetModelMeshMaterial() (3 input parameters) +Function 485: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 485: LoadModelAnimations() (2 input parameters) +Function 486: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 486: UpdateModelAnimation() (3 input parameters) +Function 487: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 487: UnloadModelAnimation() (1 input parameters) +Function 488: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 488: UnloadModelAnimations() (2 input parameters) +Function 489: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 489: IsModelAnimationValid() (2 input parameters) +Function 490: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 490: CheckCollisionSpheres() (4 input parameters) +Function 491: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4122,40 +4130,40 @@ Function 490: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 491: CheckCollisionBoxes() (2 input parameters) +Function 492: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 492: CheckCollisionBoxSphere() (3 input parameters) +Function 493: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 493: GetRayCollisionSphere() (3 input parameters) +Function 494: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 494: GetRayCollisionBox() (2 input parameters) +Function 495: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 495: GetRayCollisionMesh() (3 input parameters) +Function 496: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 496: GetRayCollisionTriangle() (4 input parameters) +Function 497: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4163,7 +4171,7 @@ Function 496: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 497: GetRayCollisionQuad() (5 input parameters) +Function 498: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4172,158 +4180,158 @@ Function 497: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 498: InitAudioDevice() (0 input parameters) +Function 499: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 499: CloseAudioDevice() (0 input parameters) +Function 500: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 500: IsAudioDeviceReady() (0 input parameters) +Function 501: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 501: SetMasterVolume() (1 input parameters) +Function 502: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 502: GetMasterVolume() (0 input parameters) +Function 503: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 503: LoadWave() (1 input parameters) +Function 504: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 504: LoadWaveFromMemory() (3 input parameters) +Function 505: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 505: IsWaveReady() (1 input parameters) +Function 506: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 506: LoadSound() (1 input parameters) +Function 507: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 507: LoadSoundFromWave() (1 input parameters) +Function 508: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 508: LoadSoundAlias() (1 input parameters) +Function 509: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 509: IsSoundReady() (1 input parameters) +Function 510: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 510: UpdateSound() (3 input parameters) +Function 511: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 511: UnloadWave() (1 input parameters) +Function 512: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 512: UnloadSound() (1 input parameters) +Function 513: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 513: UnloadSoundAlias() (1 input parameters) +Function 514: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 514: ExportWave() (2 input parameters) +Function 515: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 515: ExportWaveAsCode() (2 input parameters) +Function 516: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 516: PlaySound() (1 input parameters) +Function 517: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 517: StopSound() (1 input parameters) +Function 518: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 518: PauseSound() (1 input parameters) +Function 519: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 519: ResumeSound() (1 input parameters) +Function 520: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 520: IsSoundPlaying() (1 input parameters) +Function 521: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 521: SetSoundVolume() (2 input parameters) +Function 522: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 522: SetSoundPitch() (2 input parameters) +Function 523: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 523: SetSoundPan() (2 input parameters) +Function 524: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 524: WaveCopy() (1 input parameters) +Function 525: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 525: WaveCrop() (3 input parameters) +Function 526: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 526: WaveFormat() (4 input parameters) +Function 527: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4331,203 +4339,203 @@ Function 526: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 527: LoadWaveSamples() (1 input parameters) +Function 528: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 528: UnloadWaveSamples() (1 input parameters) +Function 529: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 529: LoadMusicStream() (1 input parameters) +Function 530: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 530: LoadMusicStreamFromMemory() (3 input parameters) +Function 531: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 531: IsMusicReady() (1 input parameters) +Function 532: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 532: UnloadMusicStream() (1 input parameters) +Function 533: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 533: PlayMusicStream() (1 input parameters) +Function 534: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 534: IsMusicStreamPlaying() (1 input parameters) +Function 535: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 535: UpdateMusicStream() (1 input parameters) +Function 536: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 536: StopMusicStream() (1 input parameters) +Function 537: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 537: PauseMusicStream() (1 input parameters) +Function 538: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 538: ResumeMusicStream() (1 input parameters) +Function 539: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 539: SeekMusicStream() (2 input parameters) +Function 540: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 540: SetMusicVolume() (2 input parameters) +Function 541: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 541: SetMusicPitch() (2 input parameters) +Function 542: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 542: SetMusicPan() (2 input parameters) +Function 543: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 543: GetMusicTimeLength() (1 input parameters) +Function 544: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 544: GetMusicTimePlayed() (1 input parameters) +Function 545: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 545: LoadAudioStream() (3 input parameters) +Function 546: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 546: IsAudioStreamReady() (1 input parameters) +Function 547: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 547: UnloadAudioStream() (1 input parameters) +Function 548: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 548: UpdateAudioStream() (3 input parameters) +Function 549: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 549: IsAudioStreamProcessed() (1 input parameters) +Function 550: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 550: PlayAudioStream() (1 input parameters) +Function 551: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 551: PauseAudioStream() (1 input parameters) +Function 552: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 552: ResumeAudioStream() (1 input parameters) +Function 553: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 553: IsAudioStreamPlaying() (1 input parameters) +Function 554: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 554: StopAudioStream() (1 input parameters) +Function 555: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 555: SetAudioStreamVolume() (2 input parameters) +Function 556: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 556: SetAudioStreamPitch() (2 input parameters) +Function 557: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 557: SetAudioStreamPan() (2 input parameters) +Function 558: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 558: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 559: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 559: SetAudioStreamCallback() (2 input parameters) +Function 560: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 560: AttachAudioStreamProcessor() (2 input parameters) +Function 561: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 561: DetachAudioStreamProcessor() (2 input parameters) +Function 562: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 562: AttachAudioMixedProcessor() (1 input parameters) +Function 563: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 563: DetachAudioMixedProcessor() (1 input parameters) +Function 564: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index e7fa157b2..c4a16f97e 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -1671,6 +1671,12 @@ + + + + + + From 2998f8671beaec6d1faed8f40c16a9ec31cab7c0 Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Sun, 2 Jun 2024 05:51:25 -0400 Subject: [PATCH 40/56] LoadModelAnimationsIQM: fix corrupted animation names (#4026) Correctly copies animation names from IQM animation to raylib animation. --- src/rmodels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 4bf042d5c..e1e9418cb 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4621,6 +4621,8 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, int *animCou animations[a].boneCount = iqmHeader->num_poses; animations[a].bones = RL_MALLOC(iqmHeader->num_poses*sizeof(BoneInfo)); animations[a].framePoses = RL_MALLOC(anim[a].num_frames*sizeof(Transform *)); + memcpy(animations[a].name, fileDataPtr + iqmHeader->ofs_text + anim[a].name, 32); // I don't like this 32 here + TraceLog(LOG_INFO, "IQM Anim %s", animations[a].name); // animations[a].framerate = anim.framerate; // TODO: Use animation framerate data? for (unsigned int j = 0; j < iqmHeader->num_poses; j++) From 11202bf299a70a8ef30e28ab99a8184bbb119a99 Mon Sep 17 00:00:00 2001 From: David Holland Date: Sun, 2 Jun 2024 19:52:00 +1000 Subject: [PATCH 41/56] [rmodels] Send full matModel to shader in DrawMesh (#4005) (#4022) --- src/rmodels.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index e1e9418cb..5cf848b68 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1389,14 +1389,14 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform) if (material.shader.locs[SHADER_LOC_MATRIX_VIEW] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_VIEW], matView); if (material.shader.locs[SHADER_LOC_MATRIX_PROJECTION] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_PROJECTION], matProjection); - // Model transformation matrix is sent to shader uniform location: SHADER_LOC_MATRIX_MODEL - if (material.shader.locs[SHADER_LOC_MATRIX_MODEL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_MODEL], transform); - // Accumulate several model transformations: // transform: model transformation provided (includes DrawModel() params combined with model.transform) // rlGetMatrixTransform(): rlgl internal transform matrix due to push/pop matrix stack matModel = MatrixMultiply(transform, rlGetMatrixTransform()); + // Model transformation matrix is sent to shader uniform location: SHADER_LOC_MATRIX_MODEL + if (material.shader.locs[SHADER_LOC_MATRIX_MODEL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_MODEL], matModel); + // Get model-view matrix matModelView = MatrixMultiply(matModel, matView); From 0cad25f79878211783ce550b06e20f13cc9176a1 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Mon, 3 Jun 2024 08:52:51 +0200 Subject: [PATCH 42/56] Update Raylib-CSharp to `5.1-dev`. (#4030) * Update BINDINGS.md * Update BINDINGS.md * Update BINDINGS.md --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 81bc6abda..9ec8c3c3c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -12,7 +12,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | -| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | +| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | | [Raylib.NET](https://github.com/Odex64/Raylib.NET) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | | [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT | | [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | From 06f8c4f73318488e5a4bf1f7bd82fe991a66827e Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Mon, 3 Jun 2024 03:03:33 -0400 Subject: [PATCH 43/56] LoadIQM: attempt to load texture from IQM at loadtime. (#4029) tries to load the texture with the base path of the original IQM file, relative paths should work. --- src/rmodels.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 5cf848b68..249201513 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4268,6 +4268,8 @@ static Model LoadIQM(const char *fileName) // In case file can not be read, return an empty model if (fileDataPtr == NULL) return model; + const char* basePath = GetDirectoryPath(fileName); + // Read IQM header IQMHeader *iqmHeader = (IQMHeader *)fileDataPtr; @@ -4312,6 +4314,7 @@ static Model LoadIQM(const char *fileName) memcpy(material, fileDataPtr + iqmHeader->ofs_text + imesh[i].material, MATERIAL_NAME_LENGTH*sizeof(char)); model.materials[i] = LoadMaterialDefault(); + model.materials[i].maps[MATERIAL_MAP_ALBEDO].texture = LoadTexture(TextFormat("%s/%s", basePath, material)); TRACELOG(LOG_DEBUG, "MODEL: [%s] mesh name (%s), material (%s)", fileName, name, material); From 39f12859dcdf92822c8fefece1135bf6e76a1573 Mon Sep 17 00:00:00 2001 From: IoIxD <30945097+IoIxD@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:13:28 -0700 Subject: [PATCH 44/56] rtext: added functions for camel case and snake case (reopened due to formatting errors) (#4033) * rtext: added functions for camel case and snake case * Update raylib_api.* by CI * rtext: removed always false comparison --------- Co-authored-by: github-actions[bot] --- parser/output/raylib_api.json | 22 +++ parser/output/raylib_api.lua | 16 ++ parser/output/raylib_api.txt | 294 ++++++++++++++++++---------------- parser/output/raylib_api.xml | 8 +- src/raylib.h | 3 + src/rtext.c | 65 ++++++++ 6 files changed, 265 insertions(+), 143 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 4bfce70d1..961578e53 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -9479,6 +9479,28 @@ } ] }, + { + "name": "TextToSnake", + "description": "Get Snake case notation version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToCamel", + "description": "Get Camel case notation version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, { "name": "TextToInteger", "description": "Get integer value from text (negative values not supported)", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 4a6998bbd..eb88daab9 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -6776,6 +6776,22 @@ return { {type = "const char *", name = "text"} } }, + { + name = "TextToSnake", + description = "Get Snake case notation version of provided string", + returnType = "const char *", + params = { + {type = "const char *", name = "text"} + } + }, + { + name = "TextToCamel", + description = "Get Camel case notation version of provided string", + returnType = "const char *", + params = { + {type = "const char *", name = "text"} + } + }, { name = "TextToInteger", description = "Get integer value from text (negative values not supported)", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 979ef0d56..66880130e 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 564 +Functions found: 566 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3641,30 +3641,40 @@ Function 423: TextToPascal() (1 input parameters) Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 424: TextToInteger() (1 input parameters) +Function 424: TextToSnake() (1 input parameters) + Name: TextToSnake + Return type: const char * + Description: Get Snake case notation version of provided string + Param[1]: text (type: const char *) +Function 425: TextToCamel() (1 input parameters) + Name: TextToCamel + Return type: const char * + Description: Get Camel case notation version of provided string + Param[1]: text (type: const char *) +Function 426: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 425: TextToFloat() (1 input parameters) +Function 427: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 426: DrawLine3D() (3 input parameters) +Function 428: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 427: DrawPoint3D() (2 input parameters) +Function 429: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 428: DrawCircle3D() (5 input parameters) +Function 430: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3673,7 +3683,7 @@ Function 428: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 429: DrawTriangle3D() (4 input parameters) +Function 431: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3681,14 +3691,14 @@ Function 429: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 430: DrawTriangleStrip3D() (3 input parameters) +Function 432: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 431: DrawCube() (5 input parameters) +Function 433: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3697,14 +3707,14 @@ Function 431: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 432: DrawCubeV() (3 input parameters) +Function 434: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 433: DrawCubeWires() (5 input parameters) +Function 435: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3713,21 +3723,21 @@ Function 433: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 434: DrawCubeWiresV() (3 input parameters) +Function 436: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 435: DrawSphere() (3 input parameters) +Function 437: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 436: DrawSphereEx() (5 input parameters) +Function 438: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3736,7 +3746,7 @@ Function 436: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 437: DrawSphereWires() (5 input parameters) +Function 439: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3745,7 +3755,7 @@ Function 437: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 438: DrawCylinder() (6 input parameters) +Function 440: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3755,7 +3765,7 @@ Function 438: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 439: DrawCylinderEx() (6 input parameters) +Function 441: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3765,7 +3775,7 @@ Function 439: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 440: DrawCylinderWires() (6 input parameters) +Function 442: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3775,7 +3785,7 @@ Function 440: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 441: DrawCylinderWiresEx() (6 input parameters) +Function 443: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3785,7 +3795,7 @@ Function 441: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 442: DrawCapsule() (6 input parameters) +Function 444: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3795,7 +3805,7 @@ Function 442: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 443: DrawCapsuleWires() (6 input parameters) +Function 445: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3805,51 +3815,51 @@ Function 443: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 444: DrawPlane() (3 input parameters) +Function 446: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 445: DrawRay() (2 input parameters) +Function 447: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 446: DrawGrid() (2 input parameters) +Function 448: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 447: LoadModel() (1 input parameters) +Function 449: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 448: LoadModelFromMesh() (1 input parameters) +Function 450: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 449: IsModelReady() (1 input parameters) +Function 451: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 450: UnloadModel() (1 input parameters) +Function 452: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 451: GetModelBoundingBox() (1 input parameters) +Function 453: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 452: DrawModel() (4 input parameters) +Function 454: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3857,7 +3867,7 @@ Function 452: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 453: DrawModelEx() (6 input parameters) +Function 455: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3867,7 +3877,7 @@ Function 453: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 454: DrawModelWires() (4 input parameters) +Function 456: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3875,7 +3885,7 @@ Function 454: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 455: DrawModelWiresEx() (6 input parameters) +Function 457: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3885,13 +3895,13 @@ Function 455: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 456: DrawBoundingBox() (2 input parameters) +Function 458: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 457: DrawBillboard() (5 input parameters) +Function 459: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3900,7 +3910,7 @@ Function 457: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 458: DrawBillboardRec() (6 input parameters) +Function 460: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3910,7 +3920,7 @@ Function 458: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 459: DrawBillboardPro() (9 input parameters) +Function 461: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3923,13 +3933,13 @@ Function 459: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 460: UploadMesh() (2 input parameters) +Function 462: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 461: UpdateMeshBuffer() (5 input parameters) +Function 463: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3938,19 +3948,19 @@ Function 461: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 462: UnloadMesh() (1 input parameters) +Function 464: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 463: DrawMesh() (3 input parameters) +Function 465: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 464: DrawMeshInstanced() (4 input parameters) +Function 466: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -3958,35 +3968,35 @@ Function 464: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 465: GetMeshBoundingBox() (1 input parameters) +Function 467: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 466: GenMeshTangents() (1 input parameters) +Function 468: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 467: ExportMesh() (2 input parameters) +Function 469: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 468: ExportMeshAsCode() (2 input parameters) +Function 470: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 469: GenMeshPoly() (2 input parameters) +Function 471: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 470: GenMeshPlane() (4 input parameters) +Function 472: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -3994,42 +4004,42 @@ Function 470: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 471: GenMeshCube() (3 input parameters) +Function 473: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 472: GenMeshSphere() (3 input parameters) +Function 474: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 473: GenMeshHemiSphere() (3 input parameters) +Function 475: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 474: GenMeshCylinder() (3 input parameters) +Function 476: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 475: GenMeshCone() (3 input parameters) +Function 477: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 476: GenMeshTorus() (4 input parameters) +Function 478: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4037,7 +4047,7 @@ Function 476: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 477: GenMeshKnot() (4 input parameters) +Function 479: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4045,84 +4055,84 @@ Function 477: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 478: GenMeshHeightmap() (2 input parameters) +Function 480: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 479: GenMeshCubicmap() (2 input parameters) +Function 481: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 480: LoadMaterials() (2 input parameters) +Function 482: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 481: LoadMaterialDefault() (0 input parameters) +Function 483: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 482: IsMaterialReady() (1 input parameters) +Function 484: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 483: UnloadMaterial() (1 input parameters) +Function 485: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 484: SetMaterialTexture() (3 input parameters) +Function 486: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 485: SetModelMeshMaterial() (3 input parameters) +Function 487: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 486: LoadModelAnimations() (2 input parameters) +Function 488: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 487: UpdateModelAnimation() (3 input parameters) +Function 489: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 488: UnloadModelAnimation() (1 input parameters) +Function 490: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 489: UnloadModelAnimations() (2 input parameters) +Function 491: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 490: IsModelAnimationValid() (2 input parameters) +Function 492: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 491: CheckCollisionSpheres() (4 input parameters) +Function 493: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4130,40 +4140,40 @@ Function 491: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 492: CheckCollisionBoxes() (2 input parameters) +Function 494: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 493: CheckCollisionBoxSphere() (3 input parameters) +Function 495: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 494: GetRayCollisionSphere() (3 input parameters) +Function 496: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 495: GetRayCollisionBox() (2 input parameters) +Function 497: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 496: GetRayCollisionMesh() (3 input parameters) +Function 498: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 497: GetRayCollisionTriangle() (4 input parameters) +Function 499: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4171,7 +4181,7 @@ Function 497: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 498: GetRayCollisionQuad() (5 input parameters) +Function 500: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4180,158 +4190,158 @@ Function 498: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 499: InitAudioDevice() (0 input parameters) +Function 501: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 500: CloseAudioDevice() (0 input parameters) +Function 502: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 501: IsAudioDeviceReady() (0 input parameters) +Function 503: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 502: SetMasterVolume() (1 input parameters) +Function 504: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 503: GetMasterVolume() (0 input parameters) +Function 505: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 504: LoadWave() (1 input parameters) +Function 506: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 505: LoadWaveFromMemory() (3 input parameters) +Function 507: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 506: IsWaveReady() (1 input parameters) +Function 508: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 507: LoadSound() (1 input parameters) +Function 509: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 508: LoadSoundFromWave() (1 input parameters) +Function 510: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 509: LoadSoundAlias() (1 input parameters) +Function 511: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 510: IsSoundReady() (1 input parameters) +Function 512: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 511: UpdateSound() (3 input parameters) +Function 513: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 512: UnloadWave() (1 input parameters) +Function 514: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 513: UnloadSound() (1 input parameters) +Function 515: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 514: UnloadSoundAlias() (1 input parameters) +Function 516: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 515: ExportWave() (2 input parameters) +Function 517: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 516: ExportWaveAsCode() (2 input parameters) +Function 518: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 517: PlaySound() (1 input parameters) +Function 519: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 518: StopSound() (1 input parameters) +Function 520: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 519: PauseSound() (1 input parameters) +Function 521: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 520: ResumeSound() (1 input parameters) +Function 522: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 521: IsSoundPlaying() (1 input parameters) +Function 523: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 522: SetSoundVolume() (2 input parameters) +Function 524: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 523: SetSoundPitch() (2 input parameters) +Function 525: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 524: SetSoundPan() (2 input parameters) +Function 526: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 525: WaveCopy() (1 input parameters) +Function 527: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 526: WaveCrop() (3 input parameters) +Function 528: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 527: WaveFormat() (4 input parameters) +Function 529: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4339,203 +4349,203 @@ Function 527: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 528: LoadWaveSamples() (1 input parameters) +Function 530: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 529: UnloadWaveSamples() (1 input parameters) +Function 531: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 530: LoadMusicStream() (1 input parameters) +Function 532: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 531: LoadMusicStreamFromMemory() (3 input parameters) +Function 533: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 532: IsMusicReady() (1 input parameters) +Function 534: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 533: UnloadMusicStream() (1 input parameters) +Function 535: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 534: PlayMusicStream() (1 input parameters) +Function 536: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 535: IsMusicStreamPlaying() (1 input parameters) +Function 537: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 536: UpdateMusicStream() (1 input parameters) +Function 538: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 537: StopMusicStream() (1 input parameters) +Function 539: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 538: PauseMusicStream() (1 input parameters) +Function 540: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 539: ResumeMusicStream() (1 input parameters) +Function 541: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 540: SeekMusicStream() (2 input parameters) +Function 542: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 541: SetMusicVolume() (2 input parameters) +Function 543: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 542: SetMusicPitch() (2 input parameters) +Function 544: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 543: SetMusicPan() (2 input parameters) +Function 545: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 544: GetMusicTimeLength() (1 input parameters) +Function 546: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 545: GetMusicTimePlayed() (1 input parameters) +Function 547: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 546: LoadAudioStream() (3 input parameters) +Function 548: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 547: IsAudioStreamReady() (1 input parameters) +Function 549: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 548: UnloadAudioStream() (1 input parameters) +Function 550: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 549: UpdateAudioStream() (3 input parameters) +Function 551: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 550: IsAudioStreamProcessed() (1 input parameters) +Function 552: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 551: PlayAudioStream() (1 input parameters) +Function 553: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 552: PauseAudioStream() (1 input parameters) +Function 554: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 553: ResumeAudioStream() (1 input parameters) +Function 555: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 554: IsAudioStreamPlaying() (1 input parameters) +Function 556: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 555: StopAudioStream() (1 input parameters) +Function 557: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 556: SetAudioStreamVolume() (2 input parameters) +Function 558: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 557: SetAudioStreamPitch() (2 input parameters) +Function 559: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 558: SetAudioStreamPan() (2 input parameters) +Function 560: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 559: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 561: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 560: SetAudioStreamCallback() (2 input parameters) +Function 562: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 561: AttachAudioStreamProcessor() (2 input parameters) +Function 563: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 562: DetachAudioStreamProcessor() (2 input parameters) +Function 564: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 563: AttachAudioMixedProcessor() (1 input parameters) +Function 565: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 564: DetachAudioMixedProcessor() (1 input parameters) +Function 566: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index c4a16f97e..0e096d5a2 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -2405,6 +2405,12 @@ + + + + + + diff --git a/src/raylib.h b/src/raylib.h index dfa98efb8..c61285641 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1489,6 +1489,9 @@ RLAPI int TextFindIndex(const char *text, const char *find); RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string +RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string + RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) diff --git a/src/rtext.c b/src/rtext.c index 5ba4e8b6a..118a559d6 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1786,6 +1786,71 @@ const char *TextToPascal(const char *text) return buffer; } +// Get snake case notation version of provided string +// WARNING: Limited functionality, only basic characters set +const char *TextToSnake(const char *text) +{ + static char buffer[MAX_TEXT_BUFFER_LENGTH] = {0}; + memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); + + if (text != NULL) + { + // Check for next separator to upper case another character + for (int i = 0, j = 0; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) + { + if ((text[j] >= 'A') && (text[j] <= 'Z')) + { + if (i >= 1) + { + buffer[i] = '_'; + i++; + } + buffer[i] = text[j] + 32; + } + else + { + buffer[i] = text[j]; + } + } + } + + return buffer; +} + +// Get Camel case notation version of provided string +// WARNING: Limited functionality, only basic characters set +const char *TextToCamel(const char *text) +{ + static char buffer[MAX_TEXT_BUFFER_LENGTH] = {0}; + memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); + + if (text != NULL) + { + // Lower case first character + if ((text[0] >= 'A') && (text[0] <= 'Z')) + buffer[0] = text[0] + 32; + else + buffer[0] = text[0]; + + // Check for next separator to upper case another character + for (int i = 1, j = 1; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) + { + if (text[j] != '_') + buffer[i] = text[j]; + else + { + j++; + if ((text[j] >= 'a') && (text[j] <= 'z')) + { + buffer[i] = text[j] - 32; + } + } + } + } + + return buffer; +} + // Encode text codepoint into UTF-8 text // REQUIRES: memcpy() // WARNING: Allocated memory must be manually freed From e1379afb01e5ad758b3928d055e418c2fb511d2a Mon Sep 17 00:00:00 2001 From: Paul Melis Date: Tue, 4 Jun 2024 11:46:57 +0200 Subject: [PATCH 45/56] Fix #4024, cylinder drawing was incorrect due to imprecise angle (#4034) * Fix #4024, cylinder drawing was incorrect due to imprecise angle stepping (mostly noticeable with semi-transparent cylinders) * Fix var name and spacing --- src/rmodels.c | 55 ++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 249201513..57059a017 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -508,6 +508,8 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h { if (sides < 3) sides = 3; + const float angleStep = 360.0f/sides; + rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -517,43 +519,44 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h if (radiusTop > 0) { // Draw Body ------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); //Bottom Right - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); //Bottom Left + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); //Bottom Right + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); //Top Right - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); //Top Left - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); //Top Left + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); //Bottom Left + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); //Top Right } // Draw Cap -------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { rlVertex3f(0, height, 0); - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); } } else { // Draw Cone ------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { rlVertex3f(0, height, 0); - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); } } // Draw Base ----------------------------------------------------------------------------------------- - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { rlVertex3f(0, 0, 0); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); } + rlEnd(); rlPopMatrix(); } @@ -623,25 +626,27 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl { if (sides < 3) sides = 3; + const float angleStep = 360.0f/sides; + rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - for (int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < sides; i++) { - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); - rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusTop, height, cosf(DEG2RAD*(i+1)*angleStep)*radiusTop); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); - rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); - rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusTop, height, cosf(DEG2RAD*i*angleStep)*radiusTop); + rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); } rlEnd(); rlPopMatrix(); From 5767c4cd059e07355ae5588966d0aee97038a86b Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 4 Jun 2024 23:00:12 +0200 Subject: [PATCH 46/56] Update rcore_desktop.c --- src/platforms/rcore_desktop.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index f08774165..6fe054a8a 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -1443,15 +1443,12 @@ int InitPlatform(void) else { // No-fullscreen window creation - bool wantWindowedFullscreen = (CORE.Window.screen.height == 0) && (CORE.Window.screen.width == 0); + bool requestWindowedFullscreen = (CORE.Window.screen.height == 0) && (CORE.Window.screen.width == 0); // If we are windowed fullscreen, ensures that window does not minimize when focus is lost. // This hinting code will not work if the user already specified the correct monitor dimensions; // at this point we don't know the monitor's dimensions. (Though, how did the user then?) - if (wantWindowedFullscreen) - { - glfwWindowHint(GLFW_AUTO_ICONIFY, 0); - } + if (requestWindowedFullscreen) glfwWindowHint(GLFW_AUTO_ICONIFY, 0); // Default to at least one pixel in size, as creation with a zero dimension is not allowed. int creationWidth = CORE.Window.screen.width != 0 ? CORE.Window.screen.width : 1; @@ -1471,11 +1468,7 @@ int InitPlatform(void) monitor = monitors[monitorIndex]; SetDimensionsFromMonitor(monitor); - TRACELOG(LOG_INFO, "wantWindowed: %d, size: %dx%d", wantWindowedFullscreen, CORE.Window.screen.width, CORE.Window.screen.height); - if (wantWindowedFullscreen) - { - glfwSetWindowSize(platform.handle, CORE.Window.screen.width, CORE.Window.screen.height); - } + if (requestWindowedFullscreen) glfwSetWindowSize(platform.handle, CORE.Window.screen.width, CORE.Window.screen.height); } else { From 38018192b8055024c4aa9b041943aa4e85bdd773 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 6 Jun 2024 10:12:23 +0200 Subject: [PATCH 47/56] RENAME: near, far vaiables --- src/raymath.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index d036721a2..8b69cbd53 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -1837,32 +1837,32 @@ RMAPI Matrix MatrixScale(float x, float y, float z) } // Get perspective projection matrix -RMAPI Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far) +RMAPI Matrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane) { Matrix result = { 0 }; float rl = (float)(right - left); float tb = (float)(top - bottom); - float fn = (float)(far - near); + float fn = (float)(farPlane - nearPlane); - result.m0 = ((float)near*2.0f)/rl; + result.m0 = ((float)nearPlane*2.0f)/rl; result.m1 = 0.0f; result.m2 = 0.0f; result.m3 = 0.0f; result.m4 = 0.0f; - result.m5 = ((float)near*2.0f)/tb; + result.m5 = ((float)nearPlane*2.0f)/tb; result.m6 = 0.0f; result.m7 = 0.0f; result.m8 = ((float)right + (float)left)/rl; result.m9 = ((float)top + (float)bottom)/tb; - result.m10 = -((float)far + (float)near)/fn; + result.m10 = -((float)farPlane + (float)nearPlane)/fn; result.m11 = -1.0f; result.m12 = 0.0f; result.m13 = 0.0f; - result.m14 = -((float)far*(float)near*2.0f)/fn; + result.m14 = -((float)farPlane*(float)nearPlane*2.0f)/fn; result.m15 = 0.0f; return result; From e74d13e6dbdd8bbdde8112f396935b8b88349f5f Mon Sep 17 00:00:00 2001 From: Sprix <91488389+Sprixitite@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:47:07 +0100 Subject: [PATCH 48/56] Fix examples not building with gestures system disabled (#4020) Build no longer fails with -DSUPPORT_GESTURES_SYSTEM=OFF and -DBUILD_EXAMPLES=ON --- examples/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 922323674..28550eaec 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -113,6 +113,13 @@ elseif ("${PLATFORM}" STREQUAL "DRM") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c) +elseif (NOT SUPPORT_GESTURES_SYSTEM) + # Items requiring gestures system + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_mouse_painting.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_basic_screen_manager.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_input_gestures_web.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_input_gestures.c) + endif () # The rlgl_standalone example only targets desktop, without shared libraries. From f05316b11d0a1b17088e3e75e4682e2e7ce54b91 Mon Sep 17 00:00:00 2001 From: jgabaut <109908086+jgabaut@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:29:15 +0200 Subject: [PATCH 49/56] [rlgl] Rename near, far variables (#4039) --- src/rlgl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index bef7eaf18..2f6a03b8a 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -590,7 +590,7 @@ RLAPI void rlMultMatrixf(const float *matf); // Multiply the current RLAPI void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar); RLAPI void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar); RLAPI void rlViewport(int x, int y, int width, int height); // Set the viewport area -RLAPI void rlSetClipPlanes(double near, double far); // Set clip planes distances +RLAPI void rlSetClipPlanes(double nearPlane, double farPlane); // Set clip planes distances RLAPI double rlGetCullDistanceNear(void); // Get cull plane distance near RLAPI double rlGetCullDistanceFar(void); // Get cull plane distance far @@ -1371,10 +1371,10 @@ void rlViewport(int x, int y, int width, int height) } // Set clip planes distances -void rlSetClipPlanes(double near, double far) +void rlSetClipPlanes(double nearPlane, double farPlane) { - rlCullDistanceNear = near; - rlCullDistanceFar = far; + rlCullDistanceNear = nearPlane; + rlCullDistanceFar = farPlane; } // Get cull plane distance near From 3948656d84da2e02ba4c2fda80ac813f6c81813e Mon Sep 17 00:00:00 2001 From: Konrad Gutvik Grande Date: Fri, 7 Jun 2024 10:21:02 +0200 Subject: [PATCH 50/56] The example always showed a xbox controller, never a ps3 controller (#4040) --- examples/core/core_input_gamepad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 843d5d90b..656f7c244 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -22,7 +22,7 @@ // NOTE: Gamepad name ID depends on drivers and OS #define XBOX360_LEGACY_NAME_ID "Xbox Controller" #define XBOX360_NAME_ID "Xbox 360 Controller" -#define PS3_NAME_ID "PLAYSTATION(R)3 Controller" +#define PS3_NAME_ID "Sony PLAYSTATION(R)3 Controller" //------------------------------------------------------------------------------------ // Program main entry point @@ -67,7 +67,7 @@ int main(void) { DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK); - if (true) + if (TextIsEqual(GetGamepadName(gamepad), XBOX360_LEGACY_NAME_ID) || TextIsEqual(GetGamepadName(gamepad), XBOX360_NAME_ID)) { DrawTexture(texXboxPad, 0, 0, DARKGRAY); From 7b92b5bde77f857dbf25a2e0aaacb79f592c18b2 Mon Sep 17 00:00:00 2001 From: fruzitent <40008647+fruzitent@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:22:24 +0300 Subject: [PATCH 51/56] fix: infer CMAKE_MODULE_PATH in super-build (#4042) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57719691a..a5e3408c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_policy(SET CMP0063 NEW) # Directory for easier includes # Anywhere you see include(...) you can check /cmake for that file -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # RAYLIB_IS_MAIN determines whether the project is being used from root # or if it is added as a dependency (through add_subdirectory for example). @@ -51,7 +51,7 @@ add_subdirectory(src raylib) # Uninstall target if(NOT TARGET uninstall) configure_file( - "${CMAKE_MODULE_PATH}/Uninstall.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) From 8c712f82d12c08fd4710468d908be765ee54e748 Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Sat, 8 Jun 2024 16:26:46 -0400 Subject: [PATCH 52/56] Update RGFW (#4048) * Fix Makefile issues (RGFW) (linux) (macOS) * Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW) * remove #define RGFWDEF and make the #undefs only happen for their OS * Update RGFW.h * fix to match the RGFW updates * remove line that shows the cursor for no reason --- src/external/RGFW.h | 882 ++++++++++++++++++----------- src/platforms/rcore_desktop_rgfw.c | 8 +- 2 files changed, 561 insertions(+), 329 deletions(-) diff --git a/src/external/RGFW.h b/src/external/RGFW.h index 67c67e91c..a0ca21cec 100644 --- a/src/external/RGFW.h +++ b/src/external/RGFW.h @@ -34,7 +34,9 @@ #define RGFW_BUFFER - (optional) just draw directly to (RGFW) window pixel buffer that is drawn to screen (the buffer is in the RGBA format) #define RGFW_EGL - (optional) use EGL for loading an OpenGL context (instead of the system's opengl api) #define RGFW_OPENGL_ES1 - (optional) use EGL to load and use Opengl ES (version 1) for backend rendering (instead of the system's opengl api) + This version doesn't work for desktops (I'm pretty sure) #define RGFW_OPENGL_ES2 - (optional) use OpenGL ES (version 2) + #define RGFW_OPENGL_ES3 - (optional) use OpenGL ES (version 3) #define RGFW_VULKAN - (optional) use vulkan for the rendering backend (rather than opengl) #define RGFW_DIRECTX - (optional) use directX for the rendering backend (rather than opengl) (windows only, defaults to opengl for unix) #define RGFW_NO_API - (optional) don't use any rendering API (no opengl, no vulkan, no directX) @@ -90,12 +92,16 @@ #ifndef RGFWDEF #ifdef __APPLE__ -#define RGFWDEF extern inline +#define RGFWDEF static inline #else #define RGFWDEF inline #endif #endif +#ifndef RGFW_UNUSED +#define RGFW_UNUSED(x) if (x){} +#endif + #ifdef __cplusplus extern "C" { #endif @@ -106,7 +112,7 @@ extern "C" { #define RGFW_HEADER #if !defined(u8) -#include + #include typedef uint8_t u8; typedef int8_t i8; @@ -130,12 +136,16 @@ extern "C" { #define RGFW_WINDOWS -#if defined(_WIN32) +#if defined(_WIN32) && !defined(WIN32) #define WIN32 #endif #if defined(_WIN64) + +#ifndef WIN64 #define WIN64 +#endif + #define _AMD64_ #undef _X86_ #else @@ -163,7 +173,7 @@ extern "C" { #define RGFW_MACOS #endif -#if (defined(RGFW_OPENGL_ES1) || defined(RGFW_OPENGL_ES2)) && !defined(RGFW_EGL) +#if (defined(RGFW_OPENGL_ES1) || defined(RGFW_OPENGL_ES2) || defined(RGFW_OPENGL_ES3)) && !defined(RGFW_EGL) #define RGFW_EGL #endif #if defined(RGFW_EGL) && defined(__APPLE__) @@ -193,7 +203,7 @@ extern "C" { #include #endif -#if defined(RGFW_X11) && defined(RGFW_OPENGL) +#if defined(RGFW_X11) && (defined(RGFW_OPENGL)) #ifndef GLX_MESA_swap_control #define GLX_MESA_swap_control #endif @@ -384,10 +394,10 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_vector point; /*!< mouse x, y of event (or drop point) */ u32 keyCode; /*!< keycode of event !!Keycodes defined at the bottom of the header file!! */ - u32 inFocus; /*if the window is in focus or not*/ - u32 fps; /*the current fps of the window [the fps is checked when events are checked]*/ - u32 current_ticks, frames; /* this is used for counting the fps */ + u64 frameTime, frameTime2; /* this is used for counting the fps */ + + u8 inFocus; /*if the window is in focus or not*/ u8 lockState; @@ -416,9 +426,10 @@ typedef struct { i32 x, y; } RGFW_vector; u32 display; void* displayLink; void* window; + u8 dndPassed; #endif -#if defined(RGFW_OPENGL) && !defined(RGFW_OSMESA) +#if (defined(RGFW_OPENGL)) && !defined(RGFW_OSMESA) #ifdef RGFW_MACOS void* rSurf; /*!< source graphics context */ #endif @@ -460,6 +471,7 @@ typedef struct { i32 x, y; } RGFW_vector; #ifdef RGFW_EGL EGLSurface EGL_surface; EGLDisplay EGL_display; + EGLContext EGL_context; #endif #if defined(RGFW_OSMESA) || defined(RGFW_BUFFER) @@ -508,7 +520,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_rect r; /* the x, y, w and h of the struct */ - u8 fpsCap; /*!< the fps cap of the window should run at (change this var to change the fps cap, 0 = no limit)*/ + u32 fpsCap; /*!< the fps cap of the window should run at (change this var to change the fps cap, 0 = no limit)*/ /*[the fps is capped when events are checked]*/ } RGFW_window; /*!< Window structure for managing the window */ @@ -627,7 +639,6 @@ typedef struct { i32 x, y; } RGFW_vector; this is run by default if the user uses the arg `RGFW_SCALE_TO_MONITOR` during window creation */ RGFWDEF void RGFW_window_scaleToMonitor(RGFW_window* win); - /* get the struct of the window's monitor */ RGFWDEF RGFW_monitor RGFW_window_getMonitor(RGFW_window* win); @@ -635,11 +646,16 @@ typedef struct { i32 x, y; } RGFW_vector; RGFWDEF void RGFW_window_makeCurrent(RGFW_window* win); /*error handling*/ - RGFWDEF u8 RGFW_Error(); /* returns true if an error has occurred (doesn't print errors itself) */ + RGFWDEF u8 RGFW_Error(void); /* returns true if an error has occurred (doesn't print errors itself) */ /*!< if window == NULL, it checks if the key is pressed globally. Otherwise, it checks only if the key is pressed while the window in focus.*/ RGFWDEF u8 RGFW_isPressedI(RGFW_window* win, u32 key); /*!< if key is pressed (key code)*/ + RGFWDEF u8 RGFW_wasPressedI(RGFW_window* win, u32 key); /*!< if key was pressed (checks prev keymap only) (key code)*/ + + RGFWDEF u8 RGFW_isHeldI(RGFW_window* win, u32 key); /*!< if key is held (key code)*/ + RGFWDEF u8 RGFW_isReleasedI(RGFW_window* win, u32 key); /*!< if key is released (key code)*/ + /* !!Keycodes defined at the bottom of the header file!! */ @@ -676,7 +692,14 @@ typedef struct { i32 x, y; } RGFW_vector; if you're going to use sili which is a good idea generally */ - RGFWDEF RGFW_thread RGFW_createThread(void* (*function_ptr)(void*), void* args); /*!< create a thread*/ + + #if defined(__unix__) || defined(__APPLE__) + typedef void* (* RGFW_threadFunc_ptr)(void*); + #else + typedef DWORD (* RGFW_threadFunc_ptr)(void*); + #endif + + RGFWDEF RGFW_thread RGFW_createThread(RGFW_threadFunc_ptr ptr, void* args); /*!< create a thread*/ RGFWDEF void RGFW_cancelThread(RGFW_thread thread); /*!< cancels a thread*/ RGFWDEF void RGFW_joinThread(RGFW_thread thread); /*!< join thread to current thread */ RGFWDEF void RGFW_setThreadPriority(RGFW_thread thread, u8 priority); /*!< sets the priority priority */ @@ -694,7 +717,7 @@ typedef struct { i32 x, y; } RGFW_vector; /*! native opengl functions */ #ifdef RGFW_OPENGL /*! Get max OpenGL version */ - RGFWDEF u8* RGFW_getMaxGLVersion(); + RGFWDEF u8* RGFW_getMaxGLVersion(void); /* OpenGL init hints */ RGFWDEF void RGFW_setGLStencil(i32 stencil); /* set stencil buffer bit size (8 by default) */ RGFWDEF void RGFW_setGLSamples(i32 samples); /* set number of sampiling buffers (4 by default) */ @@ -754,8 +777,8 @@ typedef struct { i32 x, y; } RGFW_vector; RGFWDEF void RGFW_createSurface(VkInstance instance, RGFW_window* win); int RGFW_deviceInitialization(RGFW_window* win); int RGFW_createSwapchain(RGFW_window* win); - RGFWDEF int RGFW_createRenderPass(); - int RGFW_createCommandPool(); + RGFWDEF int RGFW_createRenderPass(void); + int RGFW_createCommandPool(void); int RGFW_createCommandBuffers(RGFW_window* win); int RGFW_createSyncObjects(RGFW_window* win); RGFWDEF int RGFW_createFramebuffers(RGFW_window* win); @@ -780,8 +803,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFWDEF void RGFW_window_checkFPS(RGFW_window* win); /*!< updates fps / sets fps to cap (ran by RGFW_window_checkEvent)*/ RGFWDEF u64 RGFW_getTime(void); /* get time in seconds */ RGFWDEF u64 RGFW_getTimeNS(void); /* get time in nanoseconds */ - RGFWDEF u32 RGFW_getFPS(void); /* get current FPS (win->event.fps) */ - RGFWDEF void RGFW_sleep(u32 microsecond); /* sleep for a set time */ + RGFWDEF void RGFW_sleep(u64 microsecond); /* sleep for a set time */ #endif /* RGFW_HEADER */ /* @@ -859,20 +881,19 @@ typedef struct { i32 x, y; } RGFW_vector; #ifdef RGFW_WINDOWS -#define WIN32_LEAN_AND_MEAN - #include #endif #ifdef RGFW_MACOS -#include - /* based on silicon.h */ +#ifndef GL_SILENCE_DEPRECATION #define GL_SILENCE_DEPRECATION +#endif + #include #include #include @@ -914,7 +935,7 @@ typedef struct { i32 x, y; } RGFW_vector; #define abi_objc_msgSend_fpret objc_msgSend_fpret #endif -#define NSAlloc(nsclass) objc_msgSend_id(nsclass, sel_registerName("alloc")) +#define NSAlloc(nsclass) objc_msgSend_id((id)nsclass, sel_registerName("alloc")) #define objc_msgSend_bool ((BOOL (*)(id, SEL))objc_msgSend) #define objc_msgSend_void ((void (*)(id, SEL))objc_msgSend) #define objc_msgSend_void_id ((void (*)(id, SEL, id))objc_msgSend) @@ -948,7 +969,7 @@ typedef struct { i32 x, y; } RGFW_vector; loadFunc("stringWithUTF8String:"); return ((id(*)(id, SEL, const char*))objc_msgSend) - (objc_getClass("NSString"), func, str); + ((id)objc_getClass("NSString"), func, str); } const char* NSString_to_char(NSString* str) { @@ -1053,7 +1074,7 @@ typedef struct { i32 x, y; } RGFW_vector; void* func = sel_registerName("initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:"); return (NSBitmapImageRep*) ((id(*)(id, SEL, unsigned char**, NSInteger, NSInteger, NSInteger, NSInteger, bool, bool, const char*, NSBitmapFormat, NSInteger, NSInteger))objc_msgSend) - (NSAlloc(objc_getClass("NSBitmapImageRep")), func, planes, width, height, bps, spp, alpha, isPlanar, NSString_stringWithUTF8String(colorSpaceName), bitmapFormat, rowBytes, pixelBits); + (NSAlloc((id)objc_getClass("NSBitmapImageRep")), func, planes, width, height, bps, spp, alpha, isPlanar, NSString_stringWithUTF8String(colorSpaceName), bitmapFormat, rowBytes, pixelBits); } NSColor* NSColor_colorWithSRGB(CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) { @@ -1079,7 +1100,7 @@ typedef struct { i32 x, y; } RGFW_vector; NSImage* NSImage_initWithSize(NSSize size) { void* func = sel_registerName("initWithSize:"); return ((id(*)(id, SEL, NSSize))objc_msgSend) - (NSAlloc(objc_getClass("NSImage")), func, size); + (NSAlloc((id)objc_getClass("NSImage")), func, size); } #define NS_OPENGL_ENUM_DEPRECATED(minVers, maxVers) API_AVAILABLE(macos(minVers)) typedef NS_ENUM(NSInteger, NSOpenGLContextParameter) { @@ -1111,13 +1132,13 @@ typedef struct { i32 x, y; } RGFW_vector; void* NSOpenGLPixelFormat_initWithAttributes(const uint32_t* attribs) { void* func = sel_registerName("initWithAttributes:"); return (void*) ((id(*)(id, SEL, const uint32_t*))objc_msgSend) - (NSAlloc(objc_getClass("NSOpenGLPixelFormat")), func, attribs); + (NSAlloc((id)objc_getClass("NSOpenGLPixelFormat")), func, attribs); } NSOpenGLView* NSOpenGLView_initWithFrame(NSRect frameRect, uint32_t* format) { void* func = sel_registerName("initWithFrame:pixelFormat:"); return (NSOpenGLView*) ((id(*)(id, SEL, NSRect, uint32_t*))objc_msgSend) - (NSAlloc(objc_getClass("NSOpenGLView")), func, frameRect, format); + (NSAlloc((id)objc_getClass("NSOpenGLView")), func, frameRect, format); } void NSCursor_performSelector(NSCursor* cursor, void* selector) { @@ -1126,7 +1147,7 @@ typedef struct { i32 x, y; } RGFW_vector; } NSPasteboard* NSPasteboard_generalPasteboard(void) { - return (NSPasteboard*) objc_msgSend_id(objc_getClass("NSPasteboard"), sel_registerName("generalPasteboard")); + return (NSPasteboard*) objc_msgSend_id((id)objc_getClass("NSPasteboard"), sel_registerName("generalPasteboard")); } NSString** cstrToNSStringArray(char** strs, size_t len) { @@ -1144,27 +1165,22 @@ typedef struct { i32 x, y; } RGFW_vector; } NSArray* c_array_to_NSArray(void* array, size_t len) { - void* func = sel_registerName("initWithObjects:count:"); + SEL func = sel_registerName("initWithObjects:count:"); void* nsclass = objc_getClass("NSArray"); - - return ((id(*)(id, SEL, void*, NSUInteger))objc_msgSend) - (NSAlloc(nsclass), func, array, len); + return ((id (*)(id, SEL, void*, NSUInteger))objc_msgSend) + (NSAlloc(nsclass), func, array, len); } - + void NSregisterForDraggedTypes(void* view, NSPasteboardType* newTypes, size_t len) { - NSString** ntypes = cstrToNSStringArray(newTypes, len); - - void* func = sel_registerName("registerForDraggedTypes:"); + NSString** ntypes = cstrToNSStringArray((char**)newTypes, len); NSArray* array = c_array_to_NSArray(ntypes, len); - objc_msgSend_void_id(view, sel_registerName("registerForDraggedTypes:"), array); - NSRelease(array); } NSInteger NSPasteBoard_declareTypes(NSPasteboard* pasteboard, NSPasteboardType* newTypes, size_t len, void* owner) { - NSString** ntypes = cstrToNSStringArray(newTypes, len); + NSString** ntypes = cstrToNSStringArray((char**)newTypes, len); void* func = sel_registerName("declareTypes:owner:"); @@ -1252,13 +1268,17 @@ typedef struct { i32 x, y; } RGFW_vector; (pasteboard, func, array, options); NSRelease(array); - NSUInteger count = NSArray_count(output); const char** res = si_array_init_reserve(sizeof(const char*), count); - for (NSUInteger i = 0; i < count; i++) - res[i] = NSString_to_char(NSArray_objectAtIndex(output, i)); + void* path_func = sel_registerName("path"); + + for (NSUInteger i = 0; i < count; i++) { + void* url = NSArray_objectAtIndex(output, i); + NSString* url_str = ((id(*)(id, SEL))objc_msgSend)(url, path_func); + res[i] = NSString_to_char(url_str); + } return res; } @@ -1301,12 +1321,20 @@ typedef struct { i32 x, y; } RGFW_vector; } #endif + #ifdef RGFW_WINDOWS + __declspec(dllimport) u32 __stdcall timeBeginPeriod(u32 uPeriod); + #endif + RGFWDEF RGFW_window* RGFW_window_basic_init(RGFW_rect rect, u16 args); RGFWDEF void RGFW_init_buffer(RGFW_window* win); RGFW_window* RGFW_window_basic_init(RGFW_rect rect, u16 args) { RGFW_window* win = (RGFW_window*) RGFW_MALLOC(sizeof(RGFW_window)); /* make a new RGFW struct */ + #ifdef RGFW_WINDOWS + timeBeginPeriod(1); + #endif + #ifdef RGFW_ALLOC_DROPFILES win->event.droppedFiles = (char**) RGFW_MALLOC(sizeof(char*) * RGFW_MAX_DROPS); u32 i; @@ -1406,6 +1434,8 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.hdcMem = CreateCompatibleDC(win->src.hdc); #endif +#else +RGFW_UNUSED(win); /* if buffer rendering is not being used */ #endif } @@ -1827,9 +1857,18 @@ typedef struct { i32 x, y; } RGFW_vector; #endif #if defined(RGFW_MACOS) - u8 RGFW_keyMap[128] = { 0 }; + u8 RGFW_keyBoard[128] = { 0 }; + u8 RGFW_keyBoard_prev[128]; #endif + u8 RGFW_isHeldI(RGFW_window* win, u32 key) { + return (RGFW_isPressedI(win, key) && RGFW_wasPressedI(win, key)); + } + + u8 RGFW_isReleasedI(RGFW_window* win, u32 key) { + return (!RGFW_isPressedI(win, key) && RGFW_wasPressedI(win, key)); + } + char* RGFW_keyCodeTokeyStr(u64 key) { #if defined(RGFW_MACOS) static char* keyStrs[128] = { "a", "s", "d", "f", "h", "g", "z", "x", "c", "v", "0", "b", "q", "w", "e", "r", "y", "t", "1", "2", "3", "4", "6", "5", "Equals", "9", "7", "Minus", "8", "0", "CloseBracket", "o", "u", "Bracket", "i", "p", "Return", "l", "j", "Apostrophe", "k", "Semicolon", "BackSlash", "Comma", "Slash", "n", "m", "Period", "Tab", "Space", "Backtick", "BackSpace", "0", "Escape", "0", "Super", "Shift", "CapsLock", "Alt", "Control", "0", "0", "0", "0", "0", "KP_Period", "0", "KP_Minus", "0", "0", "0", "0", "Numlock", "0", "0", "0", "KP_Multiply", "KP_Return", "0", "0", "0", "0", "KP_Slash", "KP_0", "KP_1", "KP_2", "KP_3", "KP_4", "KP_5", "KP_6", "KP_7", "0", "KP_8", "KP_9", "0", "0", "0", "F5", "F6", "F7", "F3", "F8", "F9", "0", "F11", "0", "F13", "0", "F14", "0", "F10", "0", "F12", "0", "F15", "Insert", "Home", "PageUp", "Delete", "F4", "End", "F2", "PageDown", "Left", "Right", "Down", "Up", "F1" }; @@ -1998,12 +2037,14 @@ typedef struct { i32 x, y; } RGFW_vector; u32 RGFW_isPressedJS(RGFW_window* win, u16 c, u8 button) { return win->src.jsPressed[c][button]; } #else - typedef DWORD (WINAPI * PFN_XInputGetState)(DWORD,XINPUT_STATE*); + typedef u64 (WINAPI * PFN_XInputGetState)(DWORD,XINPUT_STATE*); PFN_XInputGetState XInputGetStateSRC = NULL; #define XInputGetState XInputGetStateSRC static HMODULE RGFW_XInput_dll = NULL; u32 RGFW_isPressedJS(RGFW_window* win, u16 c, u8 button) { + RGFW_UNUSED(win) + XINPUT_STATE state; if (XInputGetState == NULL || XInputGetState(c, &state) == ERROR_DEVICE_NOT_CONNECTED) return 0; @@ -2027,9 +2068,15 @@ typedef struct { i32 x, y; } RGFW_vector; } #endif -#ifdef RGFW_OPENGL +#if defined(RGFW_OPENGL) || defined(RGFW_EGL) i32 RGFW_majorVersion = 0, RGFW_minorVersion = 0; + + #ifndef RGFW_EGL i32 RGFW_STENCIL = 8, RGFW_SAMPLES = 4, RGFW_STEREO = GL_FALSE, RGFW_AUX_BUFFERS = 0; + #else + i32 RGFW_STENCIL = 0, RGFW_SAMPLES = 0, RGFW_STEREO = GL_FALSE, RGFW_AUX_BUFFERS = 0; + #endif + void RGFW_setGLStencil(i32 stencil) { RGFW_STENCIL = stencil; } void RGFW_setGLSamples(i32 samples) { RGFW_SAMPLES = samples; } @@ -2041,7 +2088,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_minorVersion = minor; } - u8* RGFW_getMaxGLVersion() { + u8* RGFW_getMaxGLVersion(void) { RGFW_window* dummy = RGFW_createWindow("dummy", RGFW_RECT(0, 0, 1, 1), 0); const char* versionStr = (const char*) glGetString(GL_VERSION); @@ -2055,6 +2102,8 @@ typedef struct { i32 x, y; } RGFW_vector; return version; } +#ifndef RGFW_EGL + #define RGFW_GL_RENDER_TYPE RGFW_OS_BASED_VALUE(GLX_X_VISUAL_TYPE, 0x2003, 73) #define RGFW_GL_ALPHA_SIZE RGFW_OS_BASED_VALUE(GLX_ALPHA_SIZE, 0x201b, 11) #define RGFW_GL_DEPTH_SIZE RGFW_OS_BASED_VALUE(GLX_DEPTH_SIZE, 0x2022, 12) @@ -2087,6 +2136,7 @@ typedef struct { i32 x, y; } RGFW_vector; #endif static u32* RGFW_initAttribs(u32 useSoftware) { + RGFW_UNUSED(useSoftware); static u32 attribs[] = { #ifndef RGFW_MACOS RGFW_GL_RENDER_TYPE, @@ -2165,9 +2215,9 @@ typedef struct { i32 x, y; } RGFW_vector; return attribs; } -#endif +#else -#ifdef RGFW_EGL +#include #if defined(RGFW_LINK_EGL) typedef EGLBoolean(EGLAPIENTRY* PFN_eglInitialize)(EGLDisplay, EGLint*, EGLint*); @@ -2202,8 +2252,8 @@ typedef struct { i32 x, y; } RGFW_vector; #endif -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30fb +#define EGL_SURFACE_MAJOR_VERSION_KHR 0x3098 +#define EGL_SURFACE_MINOR_VERSION_KHR 0x30fb #ifndef RGFW_GL_ADD_ATTRIB #define RGFW_GL_ADD_ATTRIB(attrib, attVal) \ @@ -2214,9 +2264,8 @@ typedef struct { i32 x, y; } RGFW_vector; } #endif - void RGFW_createOpenGLContext(RGFW_window* win) { - static EGLContext globalCtx = EGL_NO_CONTEXT; + void RGFW_createOpenGLContext(RGFW_window* win) { #if defined(RGFW_LINK_EGL) eglInitializeSource = (PFNEGLINITIALIZEPROC) eglGetProcAddress("eglInitialize"); eglGetConfigsSource = (PFNEGLGETCONFIGSPROC) eglGetProcAddress("eglGetConfigs"); @@ -2233,69 +2282,101 @@ typedef struct { i32 x, y; } RGFW_vector; eglDestroySurfaceSource = (PFNEGLDESTROYSURFACEPROC) eglGetProcAddress("eglDestroySurface"); #endif /* RGFW_LINK_EGL */ + #ifdef RGFW_WINDOWS + win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.hdc); + #else win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.display); + #endif EGLint major, minor; eglInitialize(win->src.EGL_display, &major, &minor); - EGLint config_attribs[] = { + #ifndef EGL_OPENGL_ES1_BIT + #define EGL_OPENGL_ES1_BIT 0x1 + #endif + + EGLint egl_config[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDERABLE_TYPE, #ifdef RGFW_OPENGL_ES1 EGL_OPENGL_ES1_BIT, - #endif - #ifdef RGFW_OPENGL_ES2 + #elif defined(RGFW_OPENGL_ES3) + EGL_OPENGL_ES3_BIT, + #elif defined(RGFW_OPENGL_ES2) EGL_OPENGL_ES2_BIT, #else EGL_OPENGL_BIT, #endif - EGL_NONE + EGL_NONE, EGL_NONE }; EGLConfig config; - EGLint num_configs; - eglChooseConfig(win->src.EGL_display, config_attribs, &config, 1, &num_configs); + EGLint numConfigs; + eglChooseConfig(win->src.EGL_display, egl_config, &config, 1, &numConfigs); -#if defined(RGFW_OPENGL_ES2) || defined(RGFW_OPENGL_ES1) - eglBindAPI(EGL_OPENGL_ES_API); -#else - eglBindAPI(EGL_OPENGL_API); -#endif - EGLint attribs[]{ - EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT, - 0, 0, 0, 0 - }; - - size_t index = 2; - RGFW_GL_ADD_ATTRIB(EGL_STENCIL_SIZE, RGFW_STENCIL); - RGFW_GL_ADD_ATTRIB(EGL_SAMPLES, RGFW_SAMPLES); - RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MAJOR_VERSION, RGFW_majorVersion); - RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MINOR_VERSION, RGFW_minorVersion); - - win->src.rSurf = eglCreateContext(win->src.EGL_display, config, globalCtx, attribs); win->src.EGL_surface = eglCreateWindowSurface(win->src.EGL_display, config, (EGLNativeWindowType) win->src.window, NULL); - if (globalCtx == EGL_NO_CONTEXT) - RGFW_EGLglobalContext = win->src.rSurf; + EGLint attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, + #ifdef RGFW_OPENGL_ES1 + 1, + #else + 2, + #endif + EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE + }; - eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.rSurf); + size_t index = 4; + RGFW_GL_ADD_ATTRIB(EGL_STENCIL_SIZE, RGFW_STENCIL); + RGFW_GL_ADD_ATTRIB(EGL_SAMPLES, RGFW_SAMPLES); + + if (RGFW_majorVersion) { + attribs[1] = RGFW_majorVersion; + RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT); + RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MAJOR_VERSION, RGFW_majorVersion); + RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MINOR_VERSION, RGFW_minorVersion); + } + + #if defined(RGFW_OPENGL_ES1) || defined(RGFW_OPENGL_ES2) || defined(RGFW_OPENGL_ES3) + eglBindAPI(EGL_OPENGL_ES_API); + #else + eglBindAPI(EGL_OPENGL_API); + #endif + + win->src.EGL_context = eglCreateContext(win->src.EGL_display, config, EGL_NO_CONTEXT, attribs); + + eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.EGL_context); eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); - - eglSwapInterval(win->src.EGL_display, 1); } - void* RGFW_getProcAddress(const char* procname) { return (void*) eglGetProcAddress(procname); } + #ifdef RGFW_APPLE + void* RGFWnsglFramework = NULL; + #elif defined(RGFW_WINDOWS) + static HMODULE wglinstance = NULL; + #endif + + void* RGFW_getProcAddress(const char* procname) { + #if defined(RGFW_WINDOWS) + void* proc = (void*) GetProcAddress(wglinstance, procname); + + if (proc) + return proc; + #endif + + return (void*) eglGetProcAddress(procname); + } void RGFW_closeEGL(RGFW_window* win) { eglDestroySurface(win->src.EGL_display, win->src.EGL_surface); - eglDestroyContext(win->src.EGL_display, win->src.rSurf); + eglDestroyContext(win->src.EGL_display, win->src.EGL_context); eglTerminate(win->src.EGL_display); } #endif /* RGFW_EGL */ +#endif /* RGFW_GL stuff? */ /* This is where OS specific stuff starts @@ -2388,7 +2469,7 @@ typedef struct { i32 x, y; } RGFW_vector; } u32 i; - for (i = 0; i < fbcount; i++) { + for (i = 0; i < (u32)fbcount; i++) { XVisualInfo* vi = glXGetVisualFromFBConfig((Display*) win->src.display, fbc[i]); if (vi == NULL) continue; @@ -2398,8 +2479,9 @@ typedef struct { i32 x, y; } RGFW_vector; i32 samp_buf, samples; glXGetFBConfigAttrib((Display*) win->src.display, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf); glXGetFBConfigAttrib((Display*) win->src.display, fbc[i], GLX_SAMPLES, &samples); - if ((best_fbc < 0 || samp_buf) && (samples == RGFW_SAMPLES)) + if ((best_fbc < 0 || samp_buf) && (samples == RGFW_SAMPLES || best_fbc == -1)) { best_fbc = i; + } } if (best_fbc == -1) { @@ -2471,11 +2553,6 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.rSurf = glXCreateContextAttribsARB((Display*) win->src.display, bestFbc, ctx, True, context_attribs); #endif - -#ifdef RGFW_EGL - RGFW_createOpenGLContext(win); -#endif - if (RGFW_root == NULL) RGFW_root = win; @@ -2558,6 +2635,10 @@ typedef struct { i32 x, y; } RGFW_vector; PropModeReplace, (u8*) &version, 1); /* turns on drag and drop */ } + #ifdef RGFW_EGL + RGFW_createOpenGLContext(win); + #endif + RGFW_window_setMouseDefault(win); RGFW_windowsOpen++; @@ -2593,9 +2674,11 @@ typedef struct { i32 x, y; } RGFW_vector; int xAxis = 0, yAxis = 0; + char RGFW_keyboard[32]; + char RGFW_keyboard_prev[32]; + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { assert(win != NULL); - win->event.type = 0; #ifdef __linux__ @@ -2650,13 +2733,6 @@ typedef struct { i32 x, y; } RGFW_vector; } u32 i; - - if (win->event.droppedFilesCount) { - for (i = 0; i < win->event.droppedFilesCount; i++) - win->event.droppedFiles[i][0] = '\0'; - } - - win->event.droppedFilesCount = 0; win->event.type = 0; @@ -2676,6 +2752,11 @@ typedef struct { i32 x, y; } RGFW_vector; win->event.keyCode = XkbKeycodeToKeysym((Display*) win->src.display, E.xkey.keycode, 0, E.xkey.state & ShiftMask ? 1 : 0); win->event.keyName = XKeysymToString(win->event.keyCode); /* convert to string */ + if (RGFW_isPressedI(win, win->event.keyCode)) + RGFW_keyboard_prev[E.xkey.keycode >> 3] |= (1 << (E.xkey.keycode & 7)); + else + RGFW_keyboard_prev[E.xkey.keycode >> 3] |= 0; + /* get keystate data */ win->event.type = (E.type == KeyPress) ? RGFW_keyPressed : RGFW_keyReleased; @@ -2690,6 +2771,8 @@ typedef struct { i32 x, y; } RGFW_vector; else if (win->event.keyCode == XK_Num_Lock) win->event.lockState |= RGFW_NUMLOCK; } + + XQueryKeymap(win->src.display, RGFW_keyboard); /* query the keymap */ break; case ButtonPress: @@ -2718,6 +2801,14 @@ typedef struct { i32 x, y; } RGFW_vector; win->event.type = RGFW_quit; break; } + + /* reset DND values */ + if (win->event.droppedFilesCount) { + for (i = 0; i < win->event.droppedFilesCount; i++) + win->event.droppedFiles[i][0] = '\0'; + } + + win->event.droppedFilesCount = 0; /* much of this event (drag and drop code) is source from glfw @@ -3002,13 +3093,13 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.winArgs &= ~RGFW_MOUSE_CHANGED; } - if (win->src.winArgs & RGFW_HOLD_MOUSE && win->event.inFocus && win->event.type == RGFW_mousePosChanged) { - RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); - - if (XEventsQueued((Display*) win->src.display, QueuedAfterReading) <= 1) - XSync(win->src.display, True); - } + if (win->src.winArgs & RGFW_HOLD_MOUSE && win->event.inFocus && win->event.type == RGFW_mousePosChanged) { + RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + if (XEventsQueued((Display*) win->src.display, QueuedAfterReading) <= 1) + XSync(win->src.display, True); + } + XFlush((Display*) win->src.display); @@ -3022,7 +3113,7 @@ typedef struct { i32 x, y; } RGFW_vector; assert(win != NULL); #ifdef RGFW_VULKAN - for (int i = 0; i < win->src.image_count; i++) { + for (u32 i = 0; i < win->src.image_count; i++) { vkDestroyImageView(RGFW_vulkan_info.device, win->src.swapchain_image_views[i], NULL); } @@ -3212,7 +3303,7 @@ typedef struct { i32 x, y; } RGFW_vector; #ifndef RGFW_NO_X11_CURSOR /* free the previous cursor */ - if (win->src.cursor && win->src.cursor != -1) + if (win->src.cursor) XFreeCursor((Display*) win->src.display, (Cursor) win->src.cursor); XcursorImage* native = XcursorImageCreate(a.w, a.h); @@ -3235,6 +3326,8 @@ typedef struct { i32 x, y; } RGFW_vector; win->src.cursor = XcursorImageLoadCursor((Display*) win->src.display, native); XcursorImageDestroy(native); +#else + RGFW_UNUSED(image) RGFW_UNUSED(a.w) RGFW_UNUSED(channels) #endif } @@ -3256,7 +3349,7 @@ typedef struct { i32 x, y; } RGFW_vector; } RGFWDEF void RGFW_window_disableMouse(RGFW_window* win) { - + RGFW_UNUSED(win); } void RGFW_window_setMouseDefault(RGFW_window* win) { @@ -3267,7 +3360,7 @@ typedef struct { i32 x, y; } RGFW_vector; assert(win != NULL); /* free the previous cursor */ - if (win->src.cursor && win->src.cursor != -1) + if (win->src.cursor) XFreeCursor((Display*) win->src.display, (Cursor) win->src.cursor); win->src.winArgs |= RGFW_MOUSE_CHANGED; @@ -3615,7 +3708,7 @@ typedef struct { i32 x, y; } RGFW_vector; monitor.physW = (monitor.rect.w * 25.4f / 96.f); monitor.physH = (monitor.rect.h * 25.4f / 96.f); - strncpy(monitor.name, DisplayString(display), 128); + strcpy(monitor.name, DisplayString(display)); XGetSystemContentScale(display, &monitor.scaleX, &monitor.scaleY); @@ -3648,7 +3741,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_monitor RGFW_monitors[6]; RGFW_monitor* RGFW_getMonitors(void) { size_t i; - for (i = 0; i < ScreenCount(RGFW_root->src.display) && i < 6; i++) + for (i = 0; i < (size_t)ScreenCount(RGFW_root->src.display) && i < 6; i++) RGFW_monitors[i] = RGFW_XCreateMonitor(i); return RGFW_monitors; @@ -3684,9 +3777,7 @@ typedef struct { i32 x, y; } RGFW_vector; RGFW_monitor RGFW_window_getMonitor(RGFW_window* win) { return RGFW_XCreateMonitor(DefaultScreen(win->src.display)); } - - char keyboard[32]; - + u8 RGFW_isPressedI(RGFW_window* win, u32 key) { Display* d; if (win == (RGFW_window*) 0) @@ -3695,11 +3786,22 @@ typedef struct { i32 x, y; } RGFW_vector; return 0; else d = (Display*) win->src.display; - - XQueryKeymap(d, keyboard); /* query the keymap */ - + KeyCode kc2 = XKeysymToKeycode(d, key); /* convert the key to a keycode */ - return !!(keyboard[kc2 >> 3] & (1 << (kc2 & 7))); /* check if the key is pressed */ + return (RGFW_keyboard[kc2 >> 3] & (1 << (kc2 & 7))); /* check if the key is pressed */ + } + + u8 RGFW_wasPressedI(RGFW_window* win, u32 key) { + Display* d; + if (win == (RGFW_window*) 0) + d = RGFW_root->src.display; + else if (!win->event.inFocus) + return 0; + else + d = (Display*) win->src.display; + + KeyCode kc2 = XKeysymToKeycode(d, key); /* convert the key to a keycode */ + return !!(RGFW_keyboard_prev[kc2 >> 3] & (1 << (kc2 & 7))); /* check if the key is pressed */ } #endif @@ -3742,8 +3844,8 @@ typedef struct { i32 x, y; } RGFW_vector; void* RGFWjoystickApi = NULL; /* these two wgl functions need to be preloaded */ - typedef HGLRC(WINAPI* wglCreateContextAttribsARB_type)(HDC hdc, HGLRC hShareContext, - const i32* attribList); + typedef long long int (WINAPI* wglCreateContextAttribsARB_type)(HDC hdc, HGLRC hShareContext, + const int* attribList); wglCreateContextAttribsARB_type wglCreateContextAttribsARB = NULL; /* defines for creating ARB attributes */ @@ -3785,7 +3887,9 @@ typedef struct { i32 x, y; } RGFW_vector; #define WGL_SAMPLES_ARB 0x2042 #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20a9 +#ifndef RGFW_EGL static HMODULE wglinstance = NULL; +#endif #ifdef RGFW_WGL_LOAD typedef HGLRC(WINAPI* PFN_wglCreateContext)(HDC); @@ -3802,13 +3906,13 @@ static HMODULE wglinstance = NULL; PFN_wglGetCurrentDC wglGetCurrentDCSRC; PFN_wglGetCurrentContext wglGetCurrentContextSRC; -#define wglCreateContext wglCreateContextSRC -#define wglDeleteContext wglDeleteContextSRC -#define wglGetProcAddress wglGetProcAddressSRC -#define wglMakeCurrent wglMakeCurrentSRC + #define wglCreateContext wglCreateContextSRC + #define wglDeleteContext wglDeleteContextSRC + #define wglGetProcAddress wglGetProcAddressSRC + #define wglMakeCurrent wglMakeCurrentSRC -#define wglGetCurrentDC wglGetCurrentDCSRC -#define wglGetCurrentContext wglGetCurrentContextSRC + #define wglGetCurrentDC wglGetCurrentDCSRC + #define wglGetCurrentContext wglGetCurrentContextSRC #endif #ifdef RGFW_OPENGL @@ -3820,11 +3924,11 @@ static HMODULE wglinstance = NULL; return (void*) GetProcAddress(wglinstance, procname); } - typedef BOOL(APIENTRY* PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats); + typedef u64 (APIENTRY* PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats); static PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = NULL; #endif - RGFW_window RGFW_eventWindow = { {NULL} }; + RGFW_window RGFW_eventWindow; LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -3845,7 +3949,7 @@ static HMODULE wglinstance = NULL; #ifndef RGFW_NO_DPI static HMODULE RGFW_Shcore_dll = NULL; - typedef HRESULT (WINAPI * PFN_GetDpiForMonitor)(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*); + typedef u64 (WINAPI * PFN_GetDpiForMonitor)(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*); PFN_GetDpiForMonitor GetDpiForMonitorSRC = NULL; #define GetDpiForMonitor GetDpiForMonitorSRC #endif @@ -3898,6 +4002,7 @@ static HMODULE wglinstance = NULL; if (name[0] == 0) name = (char*) " "; RGFW_eventWindow.r = RGFW_RECT(-1, -1, -1, -1); + RGFW_eventWindow.src.window = NULL; RGFW_window* win = RGFW_window_basic_init(rect, args); @@ -4036,7 +4141,7 @@ static HMODULE wglinstance = NULL; ReleaseDC(dummyWin, dummy_dc); if (wglCreateContextAttribsARB != NULL) { - PIXELFORMATDESCRIPTOR pfd = { sizeof(pfd), 1, PFD_TYPE_RGBA, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, 32, 8, PFD_MAIN_PLANE, 24, 8 }; + PIXELFORMATDESCRIPTOR pfd = (PIXELFORMATDESCRIPTOR){ sizeof(pfd), 1, PFD_TYPE_RGBA, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, 32, 8, PFD_MAIN_PLANE, 24, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (args & RGFW_OPENGL_SOFTWARE) pfd.dwFlags |= PFD_GENERIC_FORMAT | PFD_GENERIC_ACCELERATED; @@ -4059,15 +4164,15 @@ static HMODULE wglinstance = NULL; u32 index = 0; i32 attribs[40]; -#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 - SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB); + + SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB); if (RGFW_majorVersion || RGFW_minorVersion) { SET_ATTRIB(WGL_CONTEXT_MAJOR_VERSION_ARB, RGFW_majorVersion); SET_ATTRIB(WGL_CONTEXT_MINOR_VERSION_ARB, RGFW_minorVersion); } - SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB); + SET_ATTRIB(WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB); if (RGFW_majorVersion || RGFW_minorVersion) { SET_ATTRIB(WGL_CONTEXT_MAJOR_VERSION_ARB, RGFW_majorVersion); @@ -4076,7 +4181,7 @@ static HMODULE wglinstance = NULL; SET_ATTRIB(0, 0); - win->src.rSurf = wglCreateContextAttribsARB(win->src.hdc, NULL, attribs); + win->src.rSurf = (HGLRC)wglCreateContextAttribsARB(win->src.hdc, NULL, attribs); } else { fprintf(stderr, "Failed to create an accelerated OpenGL Context\n"); @@ -4293,6 +4398,9 @@ static HMODULE wglinstance = NULL; return 0; } + BYTE RGFW_keyBoard[256]; + BYTE RGFW_keyBoard_prev[256]; + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { assert(win != NULL); @@ -4317,14 +4425,6 @@ static HMODULE wglinstance = NULL; return &win->event; } - if (win->event.droppedFilesCount) { - u32 i; - for (i = 0; i < win->event.droppedFilesCount; i++) - win->event.droppedFiles[i][0] = '\0'; - } - - win->event.droppedFilesCount = 0; - win->event.inFocus = (GetForegroundWindow() == win->src.window); if (RGFW_checkXInput(&win->event)) @@ -4334,7 +4434,6 @@ static HMODULE wglinstance = NULL; return NULL; static BYTE keyboardState[256]; - GetKeyboardState(keyboardState); if (PeekMessageA(&msg, win->src.window, 0u, 0u, PM_REMOVE)) { switch (msg.message) { @@ -4345,24 +4444,37 @@ static HMODULE wglinstance = NULL; case WM_KEYUP: win->event.keyCode = (u32) msg.wParam; + if (RGFW_isPressedI(win, win->event.keyCode)) + RGFW_keyBoard_prev[win->event.keyCode] |= 0x80; + else + RGFW_keyBoard_prev[win->event.keyCode] = 0; + strncpy(win->event.keyName, RGFW_keyCodeTokeyStr(msg.lParam), 16); - if (GetKeyState(VK_SHIFT) & 0x8000) { + if (RGFW_isPressedI(win, VK_SHIFT)) { ToAscii((UINT) msg.wParam, MapVirtualKey((UINT) msg.wParam, MAPVK_VK_TO_CHAR), keyboardState, (LPWORD) win->event.keyName, 0); } win->event.type = RGFW_keyReleased; + GetKeyboardState(RGFW_keyBoard); break; case WM_KEYDOWN: win->event.keyCode = (u32) msg.wParam; + + if (RGFW_isPressedI(win, win->event.keyCode)) + RGFW_keyBoard_prev[win->event.keyCode] |= 0x80; + else + RGFW_keyBoard_prev[win->event.keyCode] = 0; + strncpy(win->event.keyName, RGFW_keyCodeTokeyStr(msg.lParam), 16); - if (GetKeyState(VK_SHIFT) & 0x8000) { + if (RGFW_isPressedI(win, VK_SHIFT) & 0x8000) { ToAscii((UINT) msg.wParam, MapVirtualKey((UINT) msg.wParam, MAPVK_VK_TO_CHAR), keyboardState, (LPWORD) win->event.keyName, 0); } win->event.type = RGFW_keyPressed; + GetKeyboardState(RGFW_keyBoard); break; case WM_MOUSEMOVE: @@ -4413,6 +4525,15 @@ static HMODULE wglinstance = NULL; much of this event is source from glfw */ case WM_DROPFILES: { + + if (win->event.droppedFilesCount) { + u32 i; + for (i = 0; i < win->event.droppedFilesCount; i++) + win->event.droppedFiles[i][0] = '\0'; + } + + win->event.droppedFilesCount = 0; + win->event.type = RGFW_dnd; HDROP drop = (HDROP) msg.wParam; @@ -4522,6 +4643,9 @@ static HMODULE wglinstance = NULL; typedef struct { int iIndex; HMONITOR hMonitor; } RGFW_mInfo; BOOL CALLBACK GetMonitorByHandle(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { + RGFW_UNUSED(hdcMonitor) + RGFW_UNUSED(lprcMonitor) + RGFW_mInfo* info = (RGFW_mInfo*) dwData; if (info->hMonitor == hMonitor) return FALSE; @@ -4586,6 +4710,9 @@ static HMODULE wglinstance = NULL; RGFW_monitor RGFW_monitors[6]; BOOL CALLBACK GetMonitorHandle(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { + RGFW_UNUSED(hdcMonitor) + RGFW_UNUSED(lprcMonitor) + RGFW_mInfo* info = (RGFW_mInfo*) dwData; if (info->iIndex >= 6) @@ -4618,9 +4745,20 @@ static HMODULE wglinstance = NULL; if (win != NULL && !win->event.inFocus) return 0; - if (GetAsyncKeyState(key) & 0x8000) + if (RGFW_keyBoard[key] & 0x80) return 1; - else return 0; + + return 0; + } + + u8 RGFW_wasPressedI(RGFW_window* win, u32 key) { + if (win != NULL && !win->event.inFocus) + return 0; + + if (RGFW_keyBoard_prev[key] & 0x80) + return 1; + + return 0; } HICON RGFW_loadHandleImage(RGFW_window* win, u8* src, RGFW_area a, BOOL icon) { @@ -4684,6 +4822,7 @@ static HMODULE wglinstance = NULL; void RGFW_window_setMouse(RGFW_window* win, u8* image, RGFW_area a, i32 channels) { assert(win != NULL); + RGFW_UNUSED(channels) HCURSOR cursor = (HCURSOR) RGFW_loadHandleImage(win, image, a, FALSE); SetClassLongPtrA(win->src.window, GCLP_HCURSOR, (LPARAM) cursor); @@ -4824,6 +4963,7 @@ static HMODULE wglinstance = NULL; /* much of this function is sourced from GLFW */ void RGFW_window_setIcon(RGFW_window* win, u8* src, RGFW_area a, i32 channels) { assert(win != NULL); + RGFW_UNUSED(channels) HICON handle = RGFW_loadHandleImage(win, src, a, TRUE); @@ -4900,12 +5040,14 @@ static HMODULE wglinstance = NULL; u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { assert(win != NULL); + RGFW_UNUSED(jsNumber) + return RGFW_registerJoystickF(win, (char*) ""); } u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { assert(win != NULL); - + RGFW_UNUSED(file) return win->src.joystickCount - 1; } @@ -4936,7 +5078,7 @@ static HMODULE wglinstance = NULL; } #ifndef RGFW_NO_THREADS - RGFW_thread RGFW_createThread(void* (*function_ptr)(void*), void* args) { return CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) *function_ptr, args, 0, NULL); } + RGFW_thread RGFW_createThread(RGFW_threadFunc_ptr ptr, void* args) { return CreateThread(NULL, 0, ptr, args, 0, NULL); } void RGFW_cancelThread(RGFW_thread thread) { CloseHandle((HANDLE) thread); } void RGFW_joinThread(RGFW_thread thread) { WaitForSingleObject((HANDLE) thread, INFINITE); } void RGFW_setThreadPriority(RGFW_thread thread, u8 priority) { SetThreadPriority((HANDLE) thread, priority); } @@ -4962,7 +5104,10 @@ static HMODULE wglinstance = NULL; } #endif - CVReturn displayCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* inNow, const CVTimeStamp* inOutputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { return kCVReturnSuccess; } + CVReturn displayCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* inNow, const CVTimeStamp* inOutputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { + RGFW_UNUSED(displayLink) RGFW_UNUSED(inNow) RGFW_UNUSED(inOutputTime) RGFW_UNUSED(flagsIn) RGFW_UNUSED(flagsOut) RGFW_UNUSED(displayLinkContext) + return kCVReturnSuccess; + } RGFW_window* RGFW_windows[10]; u32 RGFW_windows_size = 0; @@ -4983,17 +5128,25 @@ static HMODULE wglinstance = NULL; } /* NOTE(EimaMei): Fixes the constant clicking when the app is running under a terminal. */ - bool acceptsFirstResponder() { return true; } - bool performKeyEquivalent(NSEvent* event) { return true; } + bool acceptsFirstResponder(void) { return true; } + bool performKeyEquivalent(NSEvent* event) { RGFW_UNUSED(event); return true; } - NSDragOperation draggingEntered(id self, SEL sel, id sender) { return NSDragOperationCopy; } - NSDragOperation draggingUpdated(id self, SEL sel, id sender) { return NSDragOperationCopy; } + NSDragOperation draggingEntered(id self, SEL sel, id sender) { + RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + return NSDragOperationCopy; + } + NSDragOperation draggingUpdated(id self, SEL sel, id sender) { + RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + return NSDragOperationCopy; + } bool prepareForDragOperation(void) { return true; } - void RGFW__osxDraggingEnded(id self, SEL sel, id sender) { return; } + void RGFW__osxDraggingEnded(id self, SEL sel, id sender) { RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); return; } /* NOTE(EimaMei): Usually, you never need 'id self, SEL cmd' for C -> Obj-C methods. This isn't the case. */ bool performDragOperation(id self, SEL sel, id sender) { + RGFW_UNUSED(sender); RGFW_UNUSED(self); RGFW_UNUSED(sel); + NSWindow* window = objc_msgSend_id(sender, sel_registerName("draggingDestinationWindow")); u32 i; bool found = false; @@ -5007,10 +5160,10 @@ static HMODULE wglinstance = NULL; if (!found) i = 0; - Class* array[] = { objc_getClass("NSURL"), NULL }; - char** droppedFiles = (char**) NSPasteboard_readObjectsForClasses( - (NSPasteboard*) objc_msgSend_id(sender, sel_registerName("draggingPasteboard")), - array, 1, NULL); + Class array[] = { objc_getClass("NSURL"), NULL }; + NSPasteboard* pasteBoard = objc_msgSend_id(sender, sel_registerName("draggingPasteboard")); + + char** droppedFiles = (char**) NSPasteboard_readObjectsForClasses(pasteBoard, array, 1, NULL); RGFW_windows[i]->event.droppedFilesCount = si_array_len(droppedFiles); @@ -5020,11 +5173,12 @@ static HMODULE wglinstance = NULL; strcpy(RGFW_windows[i]->event.droppedFiles[y], droppedFiles[y]); RGFW_windows[i]->event.type = RGFW_dnd; + RGFW_windows[i]->src.dndPassed = false; - NSPoint p = *(NSPoint*) objc_msgSend_id(sender, sel_registerName("draggingLocation")); - RGFW_windows[i]->event.point.x = p.x; - RGFW_windows[i]->event.point.x = p.y; + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(sender, sel_registerName("draggingLocation")); + RGFW_windows[i]->event.point.x = (i32)p.x; + RGFW_windows[i]->event.point.x = (i32)p.y; return true; } @@ -5059,6 +5213,8 @@ static HMODULE wglinstance = NULL; NSSize RGFW__osxWindowResize(void* self, SEL sel, NSSize frameSize) { + RGFW_UNUSED(sel); + u32 i; for (i = 0; i < RGFW_windows_size; i++) { if (RGFW_windows[i] && NSWindow_delegate(RGFW_windows[i]) == self) { @@ -5074,6 +5230,8 @@ static HMODULE wglinstance = NULL; } void RGFW__osxWindowMove(void* self, SEL sel) { + RGFW_UNUSED(sel); + u32 i; for (i = 0; i < RGFW_windows_size; i++) { if (RGFW_windows[i] && NSWindow_delegate(RGFW_windows[i]) == self) { @@ -5093,8 +5251,8 @@ static HMODULE wglinstance = NULL; #define APPKIT_EXTERN extern #endif - APPKIT_EXTERN NSPasteboardType const NSPasteboardTypeURL = "public.url"; API_AVAILABLE(macos(10.13)); // Equivalent to kUTTypeURL - APPKIT_EXTERN NSPasteboardType const NSPasteboardTypeFileURL = "public.file-url"; API_AVAILABLE(macos(10.13)); // Equivalent to kUTTypeFileURL + NSPasteboardType const NSPasteboardTypeURL = "public.url"; + NSPasteboardType const NSPasteboardTypeFileURL = "public.file-url"; RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { static u8 RGFW_loaded = 0; @@ -5109,7 +5267,7 @@ static HMODULE wglinstance = NULL; si_func_to_SEL("NSWindow", performKeyEquivalent); if (NSApp == NULL) { - NSApp = objc_msgSend_id(objc_getClass("NSApplication"), sel_registerName("sharedApplication")); + NSApp = objc_msgSend_id((id)objc_getClass("NSApplication"), sel_registerName("sharedApplication")); ((void (*)(id, SEL, NSUInteger))objc_msgSend) (NSApp, sel_registerName("setActivationPolicy:"), NSApplicationActivationPolicyRegular); @@ -5164,7 +5322,7 @@ static HMODULE wglinstance = NULL; #else NSRect contentRect = NSMakeRect(0, 0, win->r.w, win->r.h); win->src.view = ((id(*)(id, SEL, NSRect))objc_msgSend) - (NSAlloc(objc_getClass("NSView")), sel_registerName("initWithFrame:"), + (NSAlloc((id)objc_getClass("NSView")), sel_registerName("initWithFrame:"), contentRect); #endif @@ -5193,7 +5351,7 @@ static HMODULE wglinstance = NULL; } win->src.display = CGMainDisplayID(); - CVDisplayLinkCreateWithCGDisplay(win->src.display, &win->src.displayLink); + CVDisplayLinkCreateWithCGDisplay(win->src.display, (CVDisplayLinkRef*)&win->src.displayLink); CVDisplayLinkSetOutputCallback(win->src.displayLink, displayCallback, win); CVDisplayLinkStart(win->src.displayLink); @@ -5213,35 +5371,17 @@ static HMODULE wglinstance = NULL; NSMoveToResourceDir(); Class delegateClass = objc_allocateClassPair(objc_getClass("NSObject"), "WindowDelegate", 0); + + class_addMethod(delegateClass, sel_registerName("windowWillResize:toSize:"), (IMP) RGFW__osxWindowResize, "{NSSize=ff}@:{NSSize=ff}"); class_addMethod(delegateClass, sel_registerName("windowWillMove:"), (IMP) RGFW__osxWindowMove, ""); class_addMethod(delegateClass, sel_registerName("windowDidMove:"), (IMP) RGFW__osxWindowMove, ""); - - - if (args & RGFW_ALLOW_DND) { - win->src.winArgs |= RGFW_ALLOW_DND; - -/* - NSPasteboardType types[] = {NSPasteboardTypeURL, NSPasteboardTypeFileURL, NSPasteboardTypeString}; - - siArray(NSPasteboardType) array = sic_arrayInit(types, sizeof(id), countof(types)); - NSWindow_registerForDraggedTypes(win->hwnd, array); - - win->dndHead = win->dndPrev = out; -*/ - - NSPasteboardType array[] = {NSPasteboardTypeURL, NSPasteboardTypeFileURL, NSPasteboardTypeString}; - NSregisterForDraggedTypes(win->src.window, array, 3); - - /* NOTE(EimaMei): Drag 'n Drop requires too many damn functions for just a Drag 'n Drop event. */ - class_addMethod(delegateClass, "draggingEntered:", draggingEntered, "l@:@"); - class_addMethod(delegateClass, "draggingUpdated:", draggingUpdated, "l@:@"); - class_addMethod(delegateClass, "draggingExited:", RGFW__osxDraggingEnded, "v@:@"); - class_addMethod(delegateClass, "draggingEnded:", RGFW__osxDraggingEnded, "v@:@"); - class_addMethod(delegateClass, "prepareForDragOperation:", prepareForDragOperation, "B@:@"); - class_addMethod(delegateClass, "performDragOperation:", performDragOperation, "B@:@"); - - } + class_addMethod(delegateClass, sel_registerName("draggingEntered:"), (IMP)draggingEntered, "l@:@"); + class_addMethod(delegateClass, sel_registerName("draggingUpdated:"), (IMP)draggingUpdated, "l@:@"); + class_addMethod(delegateClass, sel_registerName("draggingExited:"), (IMP)RGFW__osxDraggingEnded, "v@:@"); + class_addMethod(delegateClass, sel_registerName("draggingEnded:"), (IMP)RGFW__osxDraggingEnded, "v@:@"); + class_addMethod(delegateClass, sel_registerName("prepareForDragOperation:"), (IMP)prepareForDragOperation, "B@:@"); + class_addMethod(delegateClass, sel_registerName("performDragOperation:"), (IMP)performDragOperation, "B@:@"); id delegate = objc_msgSend_id(NSAlloc(delegateClass), sel_registerName("init")); @@ -5249,6 +5389,13 @@ static HMODULE wglinstance = NULL; objc_msgSend_void_id(win->src.window, sel_registerName("setDelegate:"), delegate); + if (args & RGFW_ALLOW_DND) { + win->src.winArgs |= RGFW_ALLOW_DND; + + NSPasteboardType types[] = {NSPasteboardTypeURL, NSPasteboardTypeFileURL, NSPasteboardTypeString}; + NSregisterForDraggedTypes(win->src.window, types, 3); + } + // Show the window ((id(*)(id, SEL, SEL))objc_msgSend)(win->src.window, sel_registerName("makeKeyAndOrderFront:"), NULL); objc_msgSend_void_bool(win->src.window, sel_registerName("setIsVisible:"), true); @@ -5259,6 +5406,8 @@ static HMODULE wglinstance = NULL; RGFW_loaded = 1; } + objc_msgSend_void(win->src.window, sel_registerName("makeKeyWindow")); + NSApplication_finishLaunching(NSApp); RGFW_windows_size++; @@ -5385,12 +5534,25 @@ static HMODULE wglinstance = NULL; }; + typedef enum NSEventModifierFlags { + NSEventModifierFlagCapsLock = 1 << 16, + NSEventModifierFlagShift = 1 << 17, + NSEventModifierFlagControl = 1 << 18, + NSEventModifierFlagOption = 1 << 19, + NSEventModifierFlagCommand = 1 << 20 + } NSEventModifierFlags; + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { assert(win != NULL); if (win->event.type == RGFW_quit) return &win->event; + if (win->event.type == RGFW_dnd && win->src.dndPassed == 0) { + win->src.dndPassed = 1; + return &win->event; + } + static void* eventFunc = NULL; if (eventFunc == NULL) eventFunc = sel_registerName("nextEventMatchingMask:untilDate:inMode:dequeue:"); @@ -5426,85 +5588,156 @@ static HMODULE wglinstance = NULL; win->event.inFocus = (bool) objc_msgSend_bool(win->src.window, sel_registerName("isKeyWindow")); switch (objc_msgSend_uint(e, sel_registerName("type"))) { - case NSEventTypeKeyDown: - win->event.type = RGFW_keyPressed; - win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - win->event.keyName = (const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); + case NSEventTypeKeyDown: + win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); + RGFW_keyBoard_prev[win->event.keyCode] = RGFW_keyBoard[win->event.keyCode]; - RGFW_keyMap[win->event.keyCode] = 1; - break; + win->event.type = RGFW_keyPressed; + win->event.keyName = (char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); - case NSEventTypeKeyUp: - win->event.type = RGFW_keyReleased; - win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - win->event.keyName = (const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); + RGFW_keyBoard[win->event.keyCode] = 1; + break; - RGFW_keyMap[win->event.keyCode] = 0; - break; + case NSEventTypeKeyUp: + win->event.keyCode = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - case NSEventTypeLeftMouseDragged: - case NSEventTypeOtherMouseDragged: - case NSEventTypeRightMouseDragged: - case NSEventTypeMouseMoved: - win->event.type = RGFW_mousePosChanged; - NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(e, sel_registerName("locationInWindow")); + RGFW_keyBoard_prev[win->event.keyCode] = RGFW_keyBoard[win->event.keyCode]; - win->event.point = RGFW_VECTOR((u32) p.x, (u32) (win->r.h - p.y)); + win->event.type = RGFW_keyReleased; + win->event.keyName = (char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); - if (win->src.winArgs & RGFW_HOLD_MOUSE) { - RGFW_vector mouse = RGFW_getGlobalMousePoint(); - if ((mouse.x != win->r.x + (win->r.w / 2) || mouse.y != win->r.y + (win->r.h / 2))) { - RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + RGFW_keyBoard[win->event.keyCode] = 0; + break; + + case NSEventTypeFlagsChanged: { + u32 flags = objc_msgSend_uint(e, sel_registerName("modifierFlags")); + memcpy(RGFW_keyBoard_prev + 55, RGFW_keyBoard + 55, 5); + + if ((flags & NSEventModifierFlagCapsLock) && !RGFW_wasPressedI(win, 57)) { + RGFW_keyBoard[57] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 57; + break; + } if (!(flags & NSEventModifierFlagCapsLock) && RGFW_wasPressedI(win, 57)) { + RGFW_keyBoard[57] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 57; + break; } + + if ((flags & NSEventModifierFlagOption) && !RGFW_wasPressedI(win, 58)) { + RGFW_keyBoard[58] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 58; + break; + } if (!(flags & NSEventModifierFlagOption) && RGFW_wasPressedI(win, 58)) { + RGFW_keyBoard[58] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 58; + break; + } + + if ((flags & NSEventModifierFlagControl) && !RGFW_wasPressedI(win, 59)) { + RGFW_keyBoard[59] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 59; + break; + } if (!(flags & NSEventModifierFlagControl) && RGFW_wasPressedI(win, 59)) { + RGFW_keyBoard[59] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 59; + break; + } + + if ((flags & NSEventModifierFlagCommand) && !RGFW_wasPressedI(win, 55)) { + RGFW_keyBoard[55] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 55; + break; + } if (!(flags & NSEventModifierFlagCommand) && RGFW_wasPressedI(win, 55)) { + RGFW_keyBoard[55] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 55; + break; + } + + if ((flags & NSEventModifierFlagShift) && !RGFW_wasPressedI(win, 56)) { + RGFW_keyBoard[56] = 1; + win->event.type = RGFW_keyPressed; + win->event.keyCode = 56; + break; + } if (!(flags & NSEventModifierFlagShift) && RGFW_wasPressedI(win, 56)) { + RGFW_keyBoard[56] = 0; + win->event.type = RGFW_keyReleased; + win->event.keyCode = 56; + break; + } + + break; } - break; + case NSEventTypeLeftMouseDragged: + case NSEventTypeOtherMouseDragged: + case NSEventTypeRightMouseDragged: + case NSEventTypeMouseMoved: + win->event.type = RGFW_mousePosChanged; + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(e, sel_registerName("locationInWindow")); - case NSEventTypeLeftMouseDown: - win->event.button = RGFW_mouseLeft; - win->event.type = RGFW_mouseButtonPressed; - break; + win->event.point = RGFW_VECTOR((u32) p.x, (u32) (win->r.h - p.y)); - case NSEventTypeOtherMouseDown: - win->event.button = RGFW_mouseMiddle; - win->event.type = RGFW_mouseButtonPressed; - break; + if (win->src.winArgs & RGFW_HOLD_MOUSE) { + RGFW_vector mouse = RGFW_getGlobalMousePoint(); + if ((mouse.x != win->r.x + (win->r.w / 2) || mouse.y != win->r.y + (win->r.h / 2))) { + RGFW_window_moveMouse(win, RGFW_VECTOR(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + } + } + break; - case NSEventTypeRightMouseDown: - win->event.button = RGFW_mouseRight; - win->event.type = RGFW_mouseButtonPressed; - break; + case NSEventTypeLeftMouseDown: + win->event.button = RGFW_mouseLeft; + win->event.type = RGFW_mouseButtonPressed; + break; - case NSEventTypeLeftMouseUp: - win->event.button = RGFW_mouseLeft; - win->event.type = RGFW_mouseButtonReleased; - break; + case NSEventTypeOtherMouseDown: + win->event.button = RGFW_mouseMiddle; + win->event.type = RGFW_mouseButtonPressed; + break; - case NSEventTypeOtherMouseUp: - win->event.button = RGFW_mouseMiddle; - win->event.type = RGFW_mouseButtonReleased; - break; + case NSEventTypeRightMouseDown: + win->event.button = RGFW_mouseRight; + win->event.type = RGFW_mouseButtonPressed; + break; - case NSEventTypeScrollWheel: { - double deltaY = ((CGFloat(*)(id, SEL))abi_objc_msgSend_fpret)(e, sel_registerName("deltaY")); + case NSEventTypeLeftMouseUp: + win->event.button = RGFW_mouseLeft; + win->event.type = RGFW_mouseButtonReleased; + break; - if (deltaY > 0) - win->event.button = RGFW_mouseScrollUp; + case NSEventTypeOtherMouseUp: + win->event.button = RGFW_mouseMiddle; + win->event.type = RGFW_mouseButtonReleased; + break; - else if (deltaY < 0) - win->event.button = RGFW_mouseScrollDown; + case NSEventTypeScrollWheel: { + double deltaY = ((CGFloat(*)(id, SEL))abi_objc_msgSend_fpret)(e, sel_registerName("deltaY")); - win->event.scroll = deltaY; + if (deltaY > 0) + win->event.button = RGFW_mouseScrollUp; - win->event.type = RGFW_mouseButtonReleased; - break; - } - case NSEventTypeRightMouseUp: - win->event.button = RGFW_mouseRight; - win->event.type = RGFW_mouseButtonReleased; - break; + else if (deltaY < 0) + win->event.button = RGFW_mouseScrollDown; - default: - break; + win->event.scroll = deltaY; + + win->event.type = RGFW_mouseButtonReleased; + break; + } + case NSEventTypeRightMouseUp: + win->event.button = RGFW_mouseRight; + win->event.type = RGFW_mouseButtonReleased; + break; + + default: + break; } objc_msgSend_void_id(NSApp, sel_registerName("sendEvent:"), e); @@ -5617,6 +5850,8 @@ static HMODULE wglinstance = NULL; } void RGFW_window_showMouse(RGFW_window* win, i8 show) { + RGFW_UNUSED(win); + if (show) { CGDisplayShowCursor(kCGDirectMainDisplay); } @@ -5626,11 +5861,13 @@ static HMODULE wglinstance = NULL; } void RGFW_window_setMouseStandard(RGFW_window* win, void* mouse) { + RGFW_UNUSED(win); CGDisplayShowCursor(kCGDirectMainDisplay); objc_msgSend_void(mouse, sel_registerName("set")); } void RGFW_window_moveMouse(RGFW_window* win, RGFW_vector v) { + RGFW_UNUSED(win); assert(win != NULL); CGWarpMouseCursorPosition(CGPointMake(v.x, v.y)); @@ -5716,6 +5953,7 @@ static HMODULE wglinstance = NULL; } u8 RGFW_isPressedI(RGFW_window* win, u32 key) { + RGFW_UNUSED(win); if (key >= 128) { #ifdef RGFW_PRINT_ERRORS fprintf(stderr, "RGFW_isPressedI : invalid keycode\n"); @@ -5723,7 +5961,19 @@ static HMODULE wglinstance = NULL; RGFW_error = 1; } - return RGFW_keyMap[key]; + return RGFW_keyBoard[key]; + } + + u8 RGFW_wasPressedI(RGFW_window* win, u32 key) { + RGFW_UNUSED(win); + if (key >= 128) { +#ifdef RGFW_PRINT_ERRORS + fprintf(stderr, "RGFW_wasPressedI : invalid keycode\n"); +#endif + RGFW_error = 1; + } + + return RGFW_keyBoard_prev[key]; } #ifdef __cplusplus @@ -5740,6 +5990,8 @@ static HMODULE wglinstance = NULL; } void RGFW_writeClipboard(const char* text, u32 textLen) { + RGFW_UNUSED(textLen); + NSPasteboardType array[] = { NSPasteboardTypeString, NULL }; NSPasteBoard_declareTypes(NSPasteboard_generalPasteboard(), array, 1, NULL); @@ -5747,12 +5999,16 @@ static HMODULE wglinstance = NULL; } u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { + RGFW_UNUSED(jsNumber); + assert(win != NULL); return RGFW_registerJoystickF(win, (char*) ""); } u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { + RGFW_UNUSED(file); + assert(win != NULL); return win->src.joystickCount - 1; @@ -5820,9 +6076,11 @@ static HMODULE wglinstance = NULL; #ifndef RGFW_NO_THREADS #include - RGFW_thread RGFW_createThread(void* (*function_ptr)(void*), void* args) { + RGFW_thread RGFW_createThread(RGFW_threadFunc_ptr ptr, void* args) { + RGFW_UNUSED(args); + RGFW_thread t; - pthread_create((pthread_t*) &t, NULL, *function_ptr, NULL); + pthread_create((pthread_t*) &t, NULL, *ptr, NULL); return t; } void RGFW_cancelThread(RGFW_thread thread) { pthread_cancel((pthread_t) thread); } @@ -5848,7 +6106,7 @@ static HMODULE wglinstance = NULL; #endif #else #ifdef RGFW_EGL - eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.rSurf); + eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.EGL_context); #endif #endif @@ -5927,9 +6185,6 @@ static HMODULE wglinstance = NULL; void RGFW_window_swapBuffers(RGFW_window* win) { assert(win != NULL); - win->event.frames++; - RGFW_window_checkFPS(win); - RGFW_window_makeCurrent(win); /* clear the window*/ @@ -5958,10 +6213,10 @@ static HMODULE wglinstance = NULL; RGFW_area area = RGFW_getScreenSize(); #ifndef RGFW_X11_DONT_CONVERT_BGR - win->src.bitmap->data = (const char*) win->buffer; + win->src.bitmap->data = (char*) win->buffer; u32 x, y; - for (y = 0; y < win->r.h; y++) { - for (x = 0; x < win->r.w; x++) { + for (y = 0; y < (u32)win->r.h; y++) { + for (x = 0; x < (u32)win->r.w; x++) { u32 index = (y * 4 * area.w) + x * 4; u8 red = win->src.bitmap->data[index]; @@ -5992,7 +6247,7 @@ static HMODULE wglinstance = NULL; "NSDeviceRGBColorSpace", 0, area.w * 4, 32 ); - id image = NSAlloc(objc_getClass("NSImage")); + id image = NSAlloc((id)objc_getClass("NSImage")); NSImage_addRepresentation(image, rep); objc_msgSend_void_id(layer, sel_registerName("setContents:"), (id) image); @@ -6009,28 +6264,25 @@ static HMODULE wglinstance = NULL; #endif } - if (win->src.winArgs & RGFW_NO_GPU_RENDER) - return; + if (!(win->src.winArgs & RGFW_NO_GPU_RENDER)) { + #ifdef RGFW_EGL + eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); + #elif defined(RGFW_OPENGL) + #if defined(RGFW_X11) && defined(RGFW_OPENGL) + glXSwapBuffers((Display*) win->src.display, (Window) win->src.window); + #elif defined(RGFW_WINDOWS) + SwapBuffers(win->src.hdc); + #elif defined(RGFW_MACOS) + NSOpenGLContext_flushBuffer(win->src.rSurf); + #endif + #endif -#ifdef RGFW_OPENGL -#ifdef RGFW_EGL - eglSwapBuffers(win->src.EGL_display, win->src.EGL_surface); -#else -#if defined(RGFW_X11) && defined(RGFW_OPENGL) - glXSwapBuffers((Display*) win->src.display, (Window) win->src.window); -#endif -#ifdef RGFW_WINDOWS - SwapBuffers(win->src.hdc); -#endif -#if defined(RGFW_MACOS) - NSOpenGLContext_flushBuffer(win->src.rSurf); -#endif -#endif -#endif + #if defined(RGFW_WINDOWS) && defined(RGFW_DIRECTX) + win->src.swapchain->lpVtbl->Present(win->src.swapchain, 0, 0); + #endif + } -#if defined(RGFW_WINDOWS) && defined(RGFW_DIRECTX) - win->src.swapchain->lpVtbl->Present(win->src.swapchain, 0, 0); -#endif + RGFW_window_checkFPS(win); } void RGFW_window_maximize(RGFW_window* win) { @@ -6072,11 +6324,11 @@ static HMODULE wglinstance = NULL; #endif } - void RGFW_sleep(u32 ms) { + void RGFW_sleep(u64 ms) { #ifndef RGFW_WINDOWS struct timespec time; time.tv_sec = 0; - time.tv_nsec = ms * 1000; + time.tv_nsec = ms * 1e+6; nanosleep(&time, NULL); #else @@ -6084,32 +6336,31 @@ static HMODULE wglinstance = NULL; #endif } - static float currentFrameTime = 0; - void RGFW_window_checkFPS(RGFW_window* win) { - assert(win != NULL); + u64 deltaTime = RGFW_getTimeNS() - win->event.frameTime; - win->event.fps = RGFW_getFPS(); + u64 fps = round(1e+9 / deltaTime); + win->event.fps = fps; - if (win->fpsCap == 0) - return; + if (win->fpsCap && fps > win->fpsCap) { + u64 frameTimeNS = 1e+9 / win->fpsCap; + u64 sleepTimeMS = (frameTimeNS - deltaTime) / 1e6; - double targetFrameTime = 1.0 / win->fpsCap; - double elapsedTime = RGFW_getTime() - currentFrameTime; - - if (elapsedTime < targetFrameTime) { - u32 sleepTime = (u32) ((targetFrameTime - elapsedTime) * 1e3); - RGFW_sleep(sleepTime); + if (sleepTimeMS > 0) { + RGFW_sleep(sleepTimeMS); + win->event.frameTime = 0; + } } - currentFrameTime = (float) RGFW_getTime(); + win->event.frameTime = RGFW_getTimeNS(); + + if (win->fpsCap) { + u64 deltaTime = RGFW_getTimeNS() - win->event.frameTime2; - if (elapsedTime < targetFrameTime) { - u32 sleepTime = (u32) ((targetFrameTime - elapsedTime) * 1e3); - RGFW_sleep(sleepTime); + win->event.fps = round(1e+9 / deltaTime); + + win->event.frameTime2 = RGFW_getTimeNS(); } - - currentFrameTime = (float) RGFW_getTime(); } #ifdef __APPLE__ @@ -6127,7 +6378,7 @@ static HMODULE wglinstance = NULL; return (u64) (counter.QuadPart * 1e9 / frequency.QuadPart); #elif defined(__unix__) struct timespec ts = { 0 }; - clock_gettime(CLOCK_MONOTONIC, &ts); + clock_gettime(1, &ts); unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec; return nanoSeconds; @@ -6151,7 +6402,7 @@ static HMODULE wglinstance = NULL; return (u64) (counter.QuadPart / (double) frequency.QuadPart); #elif defined(__unix__) struct timespec ts = { 0 }; - clock_gettime(CLOCK_MONOTONIC, &ts); + clock_gettime(1, &ts); unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec; return (double)(nanoSeconds) * 1e-9; @@ -6165,27 +6416,6 @@ static HMODULE wglinstance = NULL; return 0; } - u32 RGFW_getFPS(void) { - static double previousSeconds = 0.0; - if (previousSeconds == 0.0) - previousSeconds = (double) RGFW_getTime();//glfwGetTime(); - - static i16 frameCount; - double currentSeconds = (double) RGFW_getTime();//glfwGetTime(); - double elapsedSeconds = currentSeconds - previousSeconds; - static double fps = 0; - - if (elapsedSeconds > 0.25) { - previousSeconds = currentSeconds; - fps = (double) frameCount / elapsedSeconds; - frameCount = 0; - } - - frameCount++; - - return (u32) fps; - } - #endif /*RGFW_IMPLEMENTATION*/ #define RGFW_Escape RGFW_OS_BASED_VALUE(0xff1b, 0x1B, 53) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 623dc0e76..f4e317497 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -431,7 +431,11 @@ void SetWindowFocused(void) // Get native window handle void *GetWindowHandle(void) { - return platform.window->src.window; + #ifndef RGFW_WINDOWS + return (void*)platform.window->src.window; + #else + return platform.window->src.hwnd; + #endif } // Get number of monitors @@ -890,8 +894,6 @@ void PollInputEvents(void) CORE.Input.Mouse.currentPosition.x = (event->point.x - (platform.window->r.w / 2)) * 2; CORE.Input.Mouse.currentPosition.y = (event->point.y - (platform.window->r.h / 2)) * 2; - - RGFW_window_showMouse(platform.window, 1); } else { CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; From 6b3c1148bfbcd354dc7e6c825fb1e452c6e0fbfd Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Jun 2024 13:16:18 +0200 Subject: [PATCH 53/56] REVIEWED: Animation name being NULL #4037 --- src/rmodels.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 57059a017..14cfc64aa 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5772,8 +5772,11 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo animDuration = (t > animDuration)? t : animDuration; } - strncpy(animations[i].name, animData.name, sizeof(animations[i].name)); - animations[i].name[sizeof(animations[i].name) - 1] = '\0'; + if (animData.name != NULL) + { + strncpy(animations[i].name, animData.name, sizeof(animations[i].name)); + animations[i].name[sizeof(animations[i].name) - 1] = '\0'; + } animations[i].frameCount = (int)(animDuration*1000.0f/GLTF_ANIMDELAY) + 1; animations[i].framePoses = RL_MALLOC(animations[i].frameCount*sizeof(Transform *)); @@ -5823,7 +5826,7 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo BuildPoseFromParentJoints(animations[i].bones, animations[i].boneCount, animations[i].framePoses[j]); } - TRACELOG(LOG_INFO, "MODEL: [%s] Loaded animation: %s (%d frames, %fs)", fileName, animData.name, animations[i].frameCount, animDuration); + TRACELOG(LOG_INFO, "MODEL: [%s] Loaded animation: %s (%d frames, %fs)", fileName, (animData.name != NULL)? animData.name : "NULL", animations[i].frameCount, animDuration); RL_FREE(boneChannels); } } From 8cbde7f84c345b9c8ae9d226ed9ba315f14658b4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Jun 2024 13:16:29 +0200 Subject: [PATCH 54/56] tweaks --- src/rcore.c | 2 +- src/rtext.c | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 3aa5a7a65..a4fc4d675 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2251,7 +2251,7 @@ bool IsFileNameValid(const char *fileName) if ((fileName != NULL) && (fileName[0] != '\0')) { - int length = strlen(fileName); + int length = (int)strlen(fileName); bool allPeriods = true; for (int i = 0; i < length; i++) diff --git a/src/rtext.c b/src/rtext.c index 118a559d6..6ad0f90a0 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1807,10 +1807,7 @@ const char *TextToSnake(const char *text) } buffer[i] = text[j] + 32; } - else - { - buffer[i] = text[j]; - } + else buffer[i] = text[j]; } } @@ -1827,23 +1824,17 @@ const char *TextToCamel(const char *text) if (text != NULL) { // Lower case first character - if ((text[0] >= 'A') && (text[0] <= 'Z')) - buffer[0] = text[0] + 32; - else - buffer[0] = text[0]; + if ((text[0] >= 'A') && (text[0] <= 'Z')) buffer[0] = text[0] + 32; + else buffer[0] = text[0]; // Check for next separator to upper case another character for (int i = 1, j = 1; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) { - if (text[j] != '_') - buffer[i] = text[j]; + if (text[j] != '_') buffer[i] = text[j]; else { j++; - if ((text[j] >= 'a') && (text[j] <= 'z')) - { - buffer[i] = text[j] - 32; - } + if ((text[j] >= 'a') && (text[j] <= 'z')) buffer[i] = text[j] - 32; } } } From a0a81fddee9365657015b300ed1b892db74acff5 Mon Sep 17 00:00:00 2001 From: carverdamien Date: Sun, 9 Jun 2024 13:29:09 +0200 Subject: [PATCH 55/56] Make addRaylib use options.opengl_version (#4049) --- src/build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build.zig b/src/build.zig index 51a8ab7b0..35622a462 100644 --- a/src/build.zig +++ b/src/build.zig @@ -22,6 +22,7 @@ pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .platform_drm = options.platform_drm, .shared = options.shared, .linux_display_backend = options.linux_display_backend, + .opengl_version = options.opengl_version, }); const raylib = raylib_dep.artifact("raylib"); From 29ac31f40980d48087db36072693e62743c96ce1 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Sun, 9 Jun 2024 18:03:05 +0200 Subject: [PATCH 56/56] Removed Raylib.NET (#4050) --- BINDINGS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 9ec8c3c3c..d24bf67c7 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -13,7 +13,6 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | -| [Raylib.NET](https://github.com/Odex64/Raylib.NET) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | | [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT | | [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | | [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 |