From f8f6aa09075dc1719a8f6063062a3bdba74a7c3e Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Mon, 21 Oct 2024 19:06:37 -0300 Subject: [PATCH 001/155] [rcore] Adds implementation to `SetGamepadVibration()` on `PLATFORM_WEB` and updates it on `PLATFORM_DESKTOP_SDL` to handle duration (#4410) * Updates SetGamepadVibration() * Handle MAX_GAMEPAD_VIBRATION_TIME * Revert low/high parameters back to left/rightMotor * Fix missin semicolon * Convert duration to seconds * Add SetGamepadVibration() implementation to PLATFORM_WEB --- src/platforms/rcore_android.c | 2 +- src/platforms/rcore_desktop_glfw.c | 2 +- src/platforms/rcore_desktop_sdl.c | 18 +++++++++--------- src/platforms/rcore_drm.c | 4 ++-- src/platforms/rcore_web.c | 29 +++++++++++++++++++++++++++-- src/raylib.h | 2 +- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 88438c9b0..85ce82a3a 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -615,7 +615,7 @@ int SetGamepadMappings(const char *mappings) } // Set gamepad vibration -void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor) +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); } diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 0bc52ac9e..41f7fac39 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1060,7 +1060,7 @@ int SetGamepadMappings(const char *mappings) } // Set gamepad vibration -void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor) +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { TRACELOG(LOG_WARNING, "GamepadSetVibration() not available on target platform"); } diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index b4ceb78eb..7cbe0354e 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -953,17 +953,17 @@ int SetGamepadMappings(const char *mappings) } // Set gamepad vibration -void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor) +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - // Limit input values to between 0.0f and 1.0f - leftMotor = (0.0f > leftMotor)? 0.0f : leftMotor; - rightMotor = (0.0f > rightMotor)? 0.0f : rightMotor; - leftMotor = (1.0f < leftMotor)? 1.0f : leftMotor; - rightMotor = (1.0f < rightMotor)? 1.0f : rightMotor; - - if (IsGamepadAvailable(gamepad)) + if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (duration > 0.0f)) { - SDL_GameControllerRumble(platform.gamepad[gamepad], (Uint16)(leftMotor*65535.0f), (Uint16)(rightMotor*65535.0f), (Uint32)(MAX_GAMEPAD_VIBRATION_TIME*1000.0f)); + if (leftMotor < 0.0f) leftMotor = 0.0f; + if (leftMotor > 1.0f) leftMotor = 1.0f; + if (rightMotor < 0.0f) rightMotor = 0.0f; + if (rightMotor > 1.0f) rightMotor = 1.0f; + if (duration > MAX_GAMEPAD_VIBRATION_TIME) duration = MAX_GAMEPAD_VIBRATION_TIME; + + SDL_GameControllerRumble(platform.gamepad[gamepad], (Uint16)(leftMotor*65535.0f), (Uint16)(rightMotor*65535.0f), (Uint32)(duration*1000.0f)); } } diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index e77457b1b..eb8ef0103 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -610,7 +610,7 @@ int SetGamepadMappings(const char *mappings) } // Set gamepad vibration -void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor) +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); } @@ -763,7 +763,7 @@ int InitPlatform(void) drmModeConnector *con = drmModeGetConnector(platform.fd, res->connectors[i]); TRACELOG(LOG_TRACE, "DISPLAY: Connector modes detected: %i", con->count_modes); - + // In certain cases the status of the conneciton is reported as UKNOWN, but it is still connected. // This might be a hardware or software limitation like on Raspberry Pi Zero with composite output. if (((con->connection == DRM_MODE_CONNECTED) || (con->connection == DRM_MODE_UNKNOWNCONNECTION)) && (con->encoder_id)) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 36af66a47..5fddbb371 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -892,9 +892,34 @@ int SetGamepadMappings(const char *mappings) } // Set gamepad vibration -void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor) +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); + if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (duration > 0.0f)) + { + if (leftMotor < 0.0f) leftMotor = 0.0f; + if (leftMotor > 1.0f) leftMotor = 1.0f; + if (rightMotor < 0.0f) rightMotor = 0.0f; + if (rightMotor > 1.0f) rightMotor = 1.0f; + if (duration > MAX_GAMEPAD_VIBRATION_TIME) duration = MAX_GAMEPAD_VIBRATION_TIME; + duration *= 1000.0f; // Convert duration to ms + + // Note: At the moment (2024.10.21) Chrome, Edge, Opera, Safari, Android Chrome, Android Webview only support the vibrationActuator API, + // and Firefox only supports the hapticActuators API + EM_ASM({ + try + { + navigator.getGamepads()[$0].vibrationActuator.playEffect('dual-rumble', { startDelay: 0, duration: $3, weakMagnitude: $1, strongMagnitude: $2 }); + } + catch (e) + { + try + { + navigator.getGamepads()[$0].hapticActuators[0].pulse($2, $3); + } + catch (e) { } + } + }, gamepad, leftMotor, rightMotor, duration); + } } // Set mouse position XY diff --git a/src/raylib.h b/src/raylib.h index 25ee6943f..fc505f787 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1184,7 +1184,7 @@ RLAPI int GetGamepadButtonPressed(void); RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) -RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor); // Set gamepad vibration for both motors +RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once From 2a0963ce0936abe0cd3ec32882638d860e435d16 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 21 Oct 2024 22:06:52 +0000 Subject: [PATCH 002/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 6 +++++- parser/output/raylib_api.lua | 5 +++-- parser/output/raylib_api.txt | 5 +++-- parser/output/raylib_api.xml | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 591fef737..cca7241f2 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -5018,7 +5018,7 @@ }, { "name": "SetGamepadVibration", - "description": "Set gamepad vibration for both motors", + "description": "Set gamepad vibration for both motors (duration in seconds)", "returnType": "void", "params": [ { @@ -5032,6 +5032,10 @@ { "type": "float", "name": "rightMotor" + }, + { + "type": "float", + "name": "duration" } ] }, diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index b84e3c08c..f1ff0aa7b 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4418,12 +4418,13 @@ return { }, { name = "SetGamepadVibration", - description = "Set gamepad vibration for both motors", + description = "Set gamepad vibration for both motors (duration in seconds)", returnType = "void", params = { {type = "int", name = "gamepad"}, {type = "float", name = "leftMotor"}, - {type = "float", name = "rightMotor"} + {type = "float", name = "rightMotor"}, + {type = "float", name = "duration"} } }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index e0d5f36b4..faddc6008 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1942,13 +1942,14 @@ Function 177: SetGamepadMappings() (1 input parameters) Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 178: SetGamepadVibration() (3 input parameters) +Function 178: SetGamepadVibration() (4 input parameters) Name: SetGamepadVibration Return type: void - Description: Set gamepad vibration for both motors + Description: Set gamepad vibration for both motors (duration in seconds) Param[1]: gamepad (type: int) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) + Param[4]: duration (type: float) Function 179: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index f59faf754..20d2b9a47 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1217,10 +1217,11 @@ - + + From fe66bfb7850d3b599af2c6c502176871239487a5 Mon Sep 17 00:00:00 2001 From: Anthony Carbajal <5776225+CrackedPixel@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:31:44 -0500 Subject: [PATCH 003/155] moved update out of draw area (#4413) --- examples/models/models_gpu_skinning.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/models/models_gpu_skinning.c b/examples/models/models_gpu_skinning.c index b6296c96a..6868a62d3 100644 --- a/examples/models/models_gpu_skinning.c +++ b/examples/models/models_gpu_skinning.c @@ -81,6 +81,8 @@ int main(void) // Update model animation ModelAnimation anim = modelAnimations[animIndex]; animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount; + characterModel.transform = MatrixTranslate(position.x, position.y, position.z); + UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame); //---------------------------------------------------------------------------------- // Draw @@ -92,8 +94,6 @@ int main(void) BeginMode3D(camera); // Draw character - characterModel.transform = MatrixTranslate(position.x, position.y, position.z); - UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame); DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform); DrawGrid(10, 1.0f); From b2dca724c7c5a9720dc789cc39529a9341bcbbfb Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 22 Oct 2024 10:41:43 +0200 Subject: [PATCH 004/155] REVIEWED: skinning shader for GLSL 100 #4412 --- .../resources/shaders/glsl100/skinning.fs | 15 +++++---- .../resources/shaders/glsl100/skinning.vs | 33 ++++++++++--------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/examples/models/resources/shaders/glsl100/skinning.fs b/examples/models/resources/shaders/glsl100/skinning.fs index ef6568036..98a9e5bad 100644 --- a/examples/models/resources/shaders/glsl100/skinning.fs +++ b/examples/models/resources/shaders/glsl100/skinning.fs @@ -1,17 +1,20 @@ #version 100 +precision mediump float; + // Input vertex attributes (from vertex shader) -in vec2 fragTexCoord; -in vec4 fragColor; - -// Output fragment color -out vec4 finalColor; +varying vec2 fragTexCoord; +varying vec4 fragColor; +// Input uniform values uniform sampler2D texture0; uniform vec4 colDiffuse; void main() { + // Fetch color from texture sampler vec4 texelColor = texture(texture0, fragTexCoord); - finalColor = texelColor*colDiffuse*fragColor; + + // Calculate final fragment color + gl_FragColor = texelColor*colDiffuse*fragColor; } diff --git a/examples/models/resources/shaders/glsl100/skinning.vs b/examples/models/resources/shaders/glsl100/skinning.vs index 9c92e2a8c..456079102 100644 --- a/examples/models/resources/shaders/glsl100/skinning.vs +++ b/examples/models/resources/shaders/glsl100/skinning.vs @@ -1,18 +1,21 @@ #version 100 -in vec3 vertexPosition; -in vec2 vertexTexCoord; -in vec4 vertexColor; -in vec4 vertexBoneIds; -in vec4 vertexBoneWeights; +#define MAX_BONE_NUM 64 -#define MAX_BONE_NUM 128 +// Input vertex attributes +attribute vec3 vertexPosition; +attribute vec2 vertexTexCoord; +attribute vec4 vertexColor; +attribute vec4 vertexBoneIds; +attribute vec4 vertexBoneWeights; + +// Input uniform values +uniform mat4 mvp; uniform mat4 boneMatrices[MAX_BONE_NUM]; -uniform mat4 mvp; - -out vec2 fragTexCoord; -out vec4 fragColor; +// Output vertex attributes (to fragment shader) +varying vec2 fragTexCoord; +varying vec4 fragColor; void main() { @@ -22,13 +25,13 @@ void main() int boneIndex3 = int(vertexBoneIds.w); vec4 skinnedPosition = - vertexBoneWeights.x * (boneMatrices[boneIndex0] * vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.y * (boneMatrices[boneIndex1] * vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.z * (boneMatrices[boneIndex2] * vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.w * (boneMatrices[boneIndex3] * vec4(vertexPosition, 1.0f)); + vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0f)) + + vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0f)) + + vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0f)) + + vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0f)); fragTexCoord = vertexTexCoord; fragColor = vertexColor; - gl_Position = mvp * skinnedPosition; + gl_Position = mvp*skinnedPosition; } \ No newline at end of file From b89bf0185a2ff4fd86035a2d3abed29b0552dc7b Mon Sep 17 00:00:00 2001 From: Sage Hane Date: Tue, 22 Oct 2024 20:20:09 +0900 Subject: [PATCH 005/155] build.zig: Better specify Linux dependencies (#4406) --- build.zig | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/build.zig b/build.zig index 56e69caf4..1f3c83162 100644 --- a/build.zig +++ b/build.zig @@ -186,16 +186,16 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .linux => { if (options.platform != .drm) { try c_source_files.append("src/rglfw.c"); - raylib.linkSystemLibrary("GL"); - raylib.linkSystemLibrary("rt"); - raylib.linkSystemLibrary("dl"); - raylib.linkSystemLibrary("m"); - - raylib.addLibraryPath(.{ .cwd_relative = "/usr/lib" }); - raylib.addIncludePath(.{ .cwd_relative = "/usr/include" }); if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) { raylib.defineCMacro("_GLFW_X11", null); raylib.linkSystemLibrary("X11"); + raylib.linkSystemLibrary("Xcursor"); + raylib.linkSystemLibrary("Xext"); + raylib.linkSystemLibrary("Xfixes"); + raylib.linkSystemLibrary("Xi"); + raylib.linkSystemLibrary("Xinerama"); + raylib.linkSystemLibrary("Xrandr"); + raylib.linkSystemLibrary("Xrender"); } if (options.linux_display_backend == .Wayland or options.linux_display_backend == .Both) { @@ -208,8 +208,6 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. }; raylib.defineCMacro("_GLFW_WAYLAND", null); raylib.linkSystemLibrary("wayland-client"); - raylib.linkSystemLibrary("wayland-cursor"); - raylib.linkSystemLibrary("wayland-egl"); raylib.linkSystemLibrary("xkbcommon"); waylandGenerate(b, raylib, "wayland.xml", "wayland-client-protocol"); waylandGenerate(b, raylib, "xdg-shell.xml", "xdg-shell-client-protocol"); @@ -228,14 +226,8 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); } - raylib.linkSystemLibrary("EGL"); - raylib.linkSystemLibrary("drm"); raylib.linkSystemLibrary("gbm"); - raylib.linkSystemLibrary("pthread"); - raylib.linkSystemLibrary("rt"); - raylib.linkSystemLibrary("m"); - raylib.linkSystemLibrary("dl"); - raylib.addIncludePath(.{ .cwd_relative = "/usr/include/libdrm" }); + raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force }); raylib.defineCMacro("PLATFORM_DRM", null); raylib.defineCMacro("EGL_NO_X11", null); From 4cd243f0a3a8e9f59e5d5453f88360f5acbc29f7 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Tue, 22 Oct 2024 08:44:53 -0300 Subject: [PATCH 006/155] Simplify EmscriptenResizeCallback() (#4415) --- src/platforms/rcore_web.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 5fddbb371..e15d3f5bf 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -324,8 +324,8 @@ void MaximizeWindow(void) platform.unmaximizedWidth = CORE.Window.screen.width; platform.unmaximizedHeight = CORE.Window.screen.height; - const int tabWidth = EM_ASM_INT( { return window.innerWidth; }, 0); - const int tabHeight = EM_ASM_INT( { return window.innerHeight; }, 0); + const int tabWidth = EM_ASM_INT( return window.innerWidth; ); + const int tabHeight = EM_ASM_INT( return window.innerHeight; ); if (tabWidth && tabHeight) glfwSetWindowSize(platform.handle, tabWidth, tabHeight); @@ -423,8 +423,8 @@ void SetWindowState(unsigned int flags) platform.unmaximizedWidth = CORE.Window.screen.width; platform.unmaximizedHeight = CORE.Window.screen.height; - const int tabWidth = EM_ASM_INT( { return window.innerWidth; }, 0); - const int tabHeight = EM_ASM_INT( { return window.innerHeight; }, 0); + const int tabWidth = EM_ASM_INT( return window.innerWidth; ); + const int tabHeight = EM_ASM_INT( return window.innerHeight; ); if (tabWidth && tabHeight) glfwSetWindowSize(platform.handle, tabWidth, tabHeight); @@ -1639,9 +1639,6 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte // return 1; // The event was consumed by the callback handler // } -EM_JS(int, GetWindowInnerWidth, (), { return window.innerWidth; }); -EM_JS(int, GetWindowInnerHeight, (), { return window.innerHeight; }); - // Register DOM element resize event static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData) { @@ -1650,8 +1647,8 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent * // This event is called whenever the window changes sizes, // so the size of the canvas object is explicitly retrieved below - int width = GetWindowInnerWidth(); - int height = GetWindowInnerHeight(); + int width = EM_ASM_INT( return window.innerWidth; ); + int height = EM_ASM_INT( return window.innerHeight; ); if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width; else if (width > (int)CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width; From 55249faa5861a468f763318edf58ca49e5cae491 Mon Sep 17 00:00:00 2001 From: Sage Hane Date: Wed, 23 Oct 2024 00:35:08 +0900 Subject: [PATCH 007/155] build.zig: Re-add OpenGL to Linux deps (#4417) --- build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.zig b/build.zig index 1f3c83162..054d1644d 100644 --- a/build.zig +++ b/build.zig @@ -186,8 +186,10 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .linux => { if (options.platform != .drm) { try c_source_files.append("src/rglfw.c"); + if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) { raylib.defineCMacro("_GLFW_X11", null); + raylib.linkSystemLibrary("GLX"); raylib.linkSystemLibrary("X11"); raylib.linkSystemLibrary("Xcursor"); raylib.linkSystemLibrary("Xext"); @@ -207,6 +209,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. @panic("`wayland-scanner` not found"); }; raylib.defineCMacro("_GLFW_WAYLAND", null); + raylib.linkSystemLibrary("EGL"); raylib.linkSystemLibrary("wayland-client"); raylib.linkSystemLibrary("xkbcommon"); waylandGenerate(b, raylib, "wayland.xml", "wayland-client-protocol"); @@ -226,6 +229,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); } + raylib.linkSystemLibrary("EGL"); raylib.linkSystemLibrary("gbm"); raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force }); From 53f7da2506329f1a00a4e0ef3e66c5b7d7843f6f Mon Sep 17 00:00:00 2001 From: Sage Hane Date: Wed, 23 Oct 2024 01:31:26 +0900 Subject: [PATCH 008/155] build.zig: Fix a minor issue with `-Dconfig` (#4418) --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 054d1644d..75a77dd51 100644 --- a/build.zig +++ b/build.zig @@ -116,6 +116,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. // `n` corresponds to the number of user-specified flags outer: for (config_h_flags) |flag| { // If a user already specified the flag, skip it + config_iter.reset(); while (config_iter.next()) |config_flag| { // For a user-specified flag to match, it must share the same prefix and have the // same length or be followed by an equals sign From 79e2be68c2ff3eea4f9af2036d02856c86256e57 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 23 Oct 2024 00:20:59 +0200 Subject: [PATCH 009/155] Reviewed skinning shaders #4412 --- .../resources/shaders/glsl100/skinning.vs | 8 ++++---- .../resources/shaders/glsl330/skinning.vs | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/examples/models/resources/shaders/glsl100/skinning.vs b/examples/models/resources/shaders/glsl100/skinning.vs index 456079102..f7b6d8fb2 100644 --- a/examples/models/resources/shaders/glsl100/skinning.vs +++ b/examples/models/resources/shaders/glsl100/skinning.vs @@ -25,10 +25,10 @@ void main() int boneIndex3 = int(vertexBoneIds.w); vec4 skinnedPosition = - vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0f)); + vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; fragColor = vertexColor; diff --git a/examples/models/resources/shaders/glsl330/skinning.vs b/examples/models/resources/shaders/glsl330/skinning.vs index 2dc976c48..73ecca51e 100644 --- a/examples/models/resources/shaders/glsl330/skinning.vs +++ b/examples/models/resources/shaders/glsl330/skinning.vs @@ -1,16 +1,19 @@ #version 330 +#define MAX_BONE_NUM 128 + +// Input vertex attributes in vec3 vertexPosition; in vec2 vertexTexCoord; in vec4 vertexColor; in vec4 vertexBoneIds; in vec4 vertexBoneWeights; -#define MAX_BONE_NUM 128 +// Input uniform values +uniform mat4 mvp; uniform mat4 boneMatrices[MAX_BONE_NUM]; -uniform mat4 mvp; - +// Output vertex attributes (to fragment shader) out vec2 fragTexCoord; out vec4 fragColor; @@ -22,13 +25,13 @@ void main() int boneIndex3 = int(vertexBoneIds.w); vec4 skinnedPosition = - vertexBoneWeights.x * (boneMatrices[boneIndex0] * vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.y * (boneMatrices[boneIndex1] * vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.z * (boneMatrices[boneIndex2] * vec4(vertexPosition, 1.0f)) + - vertexBoneWeights.w * (boneMatrices[boneIndex3] * vec4(vertexPosition, 1.0f)); + vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; fragColor = vertexColor; - gl_Position = mvp * skinnedPosition; + gl_Position = mvp*skinnedPosition; } \ No newline at end of file From 352f4ce2c435251826d9f28467910bd298934b1e Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 23 Oct 2024 00:21:06 +0200 Subject: [PATCH 010/155] Update config.h --- src/config.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/config.h b/src/config.h index 9123a2291..f37a9de3e 100644 --- a/src/config.h +++ b/src/config.h @@ -100,6 +100,8 @@ // Show OpenGL extensions and capabilities detailed logs on init //#define RLGL_SHOW_GL_DETAILS_INFO 1 +#define RL_SUPPORT_MESH_GPU_SKINNING 1 // GPU skinning, comment if your GPU does not support more than 8 VBOs + //#define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 4096 // Default internal render batch elements limits #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering) #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture) @@ -120,16 +122,11 @@ #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4 #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5 #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES 6 - - -#define RL_SUPPORT_MESH_GPU_SKINNING // Remove this if your GPU does not support more than 8 VBOs - -#ifdef RL_SUPPORT_MESH_GPU_SKINNING -#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS 7 -#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8 +#if defined(RL_SUPPORT_MESH_GPU_SKINNING) + #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS 7 + #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8 #endif - // Default shader vertex attribute names to set location points // NOTE: When a new shader is loaded, the following locations are tried to be set for convenience #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION From 4b60ce700f827bbca58eb7e952b8b07f0cc9c121 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 23 Oct 2024 00:21:14 +0200 Subject: [PATCH 011/155] Update raylib.h --- src/raylib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index fc505f787..536b441b4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1299,13 +1299,13 @@ RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vect RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +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 bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle +RLAPI bool 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 CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference -RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] -RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ From ebcfc7f49e925f0ff5ddfa744e44bdc1c50ed2a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 22 Oct 2024 22:21:35 +0000 Subject: [PATCH 012/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 92 +++++++++++++++++------------------ parser/output/raylib_api.lua | 44 ++++++++--------- parser/output/raylib_api.txt | 42 ++++++++-------- parser/output/raylib_api.xml | 24 ++++----- 4 files changed, 101 insertions(+), 101 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index cca7241f2..9db3d7ac0 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -6662,6 +6662,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": "CheckCollisionPointRec", "description": "Check if point is inside rectangle", @@ -6719,6 +6742,29 @@ } ] }, + { + "name": "CheckCollisionPointLine", + "description": "Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "point" + }, + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "int", + "name": "threshold" + } + ] + }, { "name": "CheckCollisionPointPoly", "description": "Check if point is within a polygon described by array of vertices", @@ -6765,52 +6811,6 @@ } ] }, - { - "name": "CheckCollisionPointLine", - "description": "Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]", - "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "point" - }, - { - "type": "Vector2", - "name": "p1" - }, - { - "type": "Vector2", - "name": "p2" - }, - { - "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.lua b/parser/output/raylib_api.lua index f1ff0aa7b..d5492cb9b 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5264,6 +5264,17 @@ return { {type = "Rectangle", name = "rec"} } }, + { + 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 = "CheckCollisionPointRec", description = "Check if point is inside rectangle", @@ -5294,6 +5305,17 @@ return { {type = "Vector2", name = "p3"} } }, + { + name = "CheckCollisionPointLine", + description = "Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]", + returnType = "bool", + params = { + {type = "Vector2", name = "point"}, + {type = "Vector2", name = "p1"}, + {type = "Vector2", name = "p2"}, + {type = "int", name = "threshold"} + } + }, { name = "CheckCollisionPointPoly", description = "Check if point is within a polygon described by array of vertices", @@ -5316,28 +5338,6 @@ return { {type = "Vector2 *", name = "collisionPoint"} } }, - { - name = "CheckCollisionPointLine", - description = "Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]", - returnType = "bool", - params = { - {type = "Vector2", name = "point"}, - {type = "Vector2", name = "p1"}, - {type = "Vector2", name = "p2"}, - {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 faddc6008..f6c79f85e 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -2577,20 +2577,28 @@ Function 265: CheckCollisionCircleRec() (3 input parameters) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: rec (type: Rectangle) -Function 266: CheckCollisionPointRec() (2 input parameters) +Function 266: 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 267: 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 267: CheckCollisionPointCircle() (3 input parameters) +Function 268: 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 268: CheckCollisionPointTriangle() (4 input parameters) +Function 269: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2598,14 +2606,22 @@ Function 268: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 269: CheckCollisionPointPoly() (3 input parameters) +Function 270: 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] + Param[1]: point (type: Vector2) + Param[2]: p1 (type: Vector2) + Param[3]: p2 (type: Vector2) + Param[4]: threshold (type: int) +Function 271: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 270: CheckCollisionLines() (5 input parameters) +Function 272: 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 @@ -2614,22 +2630,6 @@ Function 270: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 271: 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] - Param[1]: point (type: Vector2) - Param[2]: p1 (type: Vector2) - Param[3]: p2 (type: Vector2) - Param[4]: threshold (type: int) -Function 272: 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 273: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 20d2b9a47..6de5933d4 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1659,6 +1659,12 @@ + + + + + + @@ -1674,6 +1680,12 @@ + + + + + + @@ -1686,18 +1698,6 @@ - - - - - - - - - - - - From 75a4c5bf20ff3ef75b64362f007227489d7e08d4 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Tue, 22 Oct 2024 19:28:20 -0300 Subject: [PATCH 013/155] Update core_input_gamepad example (#4416) --- examples/core/core_input_gamepad.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 656f7c244..7a8b7e4bb 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -20,9 +20,9 @@ #include "raylib.h" // 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 "Sony PLAYSTATION(R)3 Controller" +#define XBOX_ALIAS_1 "xbox" +#define XBOX_ALIAS_2 "x-box" +#define PS_ALIAS "playstation" //------------------------------------------------------------------------------------ // Program main entry point @@ -67,7 +67,7 @@ int main(void) { DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK); - if (TextIsEqual(GetGamepadName(gamepad), XBOX360_LEGACY_NAME_ID) || TextIsEqual(GetGamepadName(gamepad), XBOX360_NAME_ID)) + if (TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_1) > -1 || TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_2) > -1) { DrawTexture(texXboxPad, 0, 0, DARKGRAY); @@ -120,7 +120,7 @@ int main(void) //DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK); //DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK); } - else if (TextIsEqual(GetGamepadName(gamepad), PS3_NAME_ID)) + else if (TextFindIndex(TextToLower(GetGamepadName(gamepad)), PS_ALIAS) > -1) { DrawTexture(texPs3Pad, 0, 0, DARKGRAY); From 7a4a84a5619754b8170737726a14b368e8cbc5bf Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Tue, 22 Oct 2024 19:59:50 -0300 Subject: [PATCH 014/155] [rcore] Fix #4405 (#4420) * Fix #4405 at runtime * Add parameter validation * Remove default global deadzone --- src/rcore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index a1771d18e..9734972cf 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3295,8 +3295,7 @@ float GetGamepadAxisMovement(int gamepad, int axis) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXIS)) { float movement = value < 0.0f ? CORE.Input.Gamepad.axisState[gamepad][axis] : fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]); - // 0.1f = GAMEPAD_AXIS_MINIMUM_DRIFT/DELTA - if (movement > value + 0.1f) value = CORE.Input.Gamepad.axisState[gamepad][axis]; + if (movement > value) value = CORE.Input.Gamepad.axisState[gamepad][axis]; } return value; From fe6da67066bcbb6e43e719ce5ef3e9f424e7cbdf Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 23 Oct 2024 11:31:27 -0300 Subject: [PATCH 015/155] [examples] Add deadzone handling to `core_input_gamepad` example (#4422) * Add deadzone handling to core_input_gamepad example * Rename variables --- examples/core/core_input_gamepad.c | 50 ++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 7a8b7e4bb..43dc65499 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -41,6 +41,14 @@ int main(void) Texture2D texPs3Pad = LoadTexture("resources/ps3.png"); Texture2D texXboxPad = LoadTexture("resources/xbox.png"); + // Set axis deadzones + const float leftStickDeadzoneX = 0.1f; + const float leftStickDeadzoneY = 0.1f; + const float rightStickDeadzoneX = 0.1f; + const float rightStickDeadzoneY = 0.1f; + const float leftTriggerDeadzone = -0.9f; + const float rightTriggerDeadzone = -0.9f; + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -67,6 +75,22 @@ int main(void) { DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK); + // Get axis values + float leftStickX = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_X); + float leftStickY = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_Y); + float rightStickX = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_X); + float rightStickY = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_Y); + float leftTrigger = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER); + float rightTrigger = GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER); + + // Calculate deadzones + if (leftStickX > -leftStickDeadzoneX && leftStickX < leftStickDeadzoneX) leftStickX = 0.0f; + if (leftStickY > -leftStickDeadzoneY && leftStickY < leftStickDeadzoneY) leftStickY = 0.0f; + if (rightStickX > -rightStickDeadzoneX && rightStickX < rightStickDeadzoneX) rightStickX = 0.0f; + if (rightStickY > -rightStickDeadzoneY && rightStickY < rightStickDeadzoneY) rightStickY = 0.0f; + if (leftTrigger < leftTriggerDeadzone) leftTrigger = -1.0f; + if (rightTrigger < rightTriggerDeadzone) rightTrigger = -1.0f; + if (TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_1) > -1 || TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_2) > -1) { DrawTexture(texXboxPad, 0, 0, DARKGRAY); @@ -100,22 +124,22 @@ int main(void) if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED; DrawCircle(259, 152, 39, BLACK); DrawCircle(259, 152, 34, LIGHTGRAY); - DrawCircle(259 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_X)*20), - 152 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_Y)*20), 25, leftGamepadColor); + DrawCircle(259 + (int)(leftStickX*20), + 152 + (int)(leftStickY*20), 25, leftGamepadColor); // Draw axis: right joystick Color rightGamepadColor = BLACK; if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_THUMB)) rightGamepadColor = RED; DrawCircle(461, 237, 38, BLACK); DrawCircle(461, 237, 33, LIGHTGRAY); - DrawCircle(461 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_X)*20), - 237 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_Y)*20), 25, rightGamepadColor); + DrawCircle(461 + (int)(rightStickX*20), + 237 + (int)(rightStickY*20), 25, rightGamepadColor); // Draw axis: left-right triggers DrawRectangle(170, 30, 15, 70, GRAY); DrawRectangle(604, 30, 15, 70, GRAY); - DrawRectangle(170, 30, 15, (int)(((1 + GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER))/2)*70), RED); - DrawRectangle(604, 30, 15, (int)(((1 + GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER))/2)*70), RED); + DrawRectangle(170, 30, 15, (int)(((1 + leftTrigger)/2)*70), RED); + DrawRectangle(604, 30, 15, (int)(((1 + rightTrigger)/2)*70), RED); //DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK); //DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK); @@ -150,24 +174,24 @@ int main(void) // Draw axis: left joystick Color leftGamepadColor = BLACK; if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED; - DrawCircle(319, 255, 35, leftGamepadColor); + DrawCircle(319, 255, 35, BLACK); DrawCircle(319, 255, 31, LIGHTGRAY); - DrawCircle(319 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_X) * 20), - 255 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_Y) * 20), 25, leftGamepadColor); + DrawCircle(319 + (int)(leftStickX*20), + 255 + (int)(leftStickY*20), 25, leftGamepadColor); // Draw axis: right joystick Color rightGamepadColor = BLACK; if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_THUMB)) rightGamepadColor = RED; DrawCircle(475, 255, 35, BLACK); DrawCircle(475, 255, 31, LIGHTGRAY); - DrawCircle(475 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_X) * 20), - 255 + (int)(GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_Y) * 20), 25, rightGamepadColor); + DrawCircle(475 + (int)(rightStickX*20), + 255 + (int)(rightStickY*20), 25, rightGamepadColor); // Draw axis: left-right triggers DrawRectangle(169, 48, 15, 70, GRAY); DrawRectangle(611, 48, 15, 70, GRAY); - DrawRectangle(169, 48, 15, (int)(((1 - GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER)) / 2) * 70), RED); - DrawRectangle(611, 48, 15, (int)(((1 - GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER)) / 2) * 70), RED); + DrawRectangle(169, 48, 15, (int)(((1 + leftTrigger)/2)*70), RED); + DrawRectangle(611, 48, 15, (int)(((1 + rightTrigger)/2)*70), RED); } else { From df38564f62de55bff8ba06575e597aef9581fc25 Mon Sep 17 00:00:00 2001 From: Cypress <140924725+cypressru@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:03:50 +0000 Subject: [PATCH 016/155] Grammar fix in CONTRIBUTING.md (#4423) "Can you write some tutorial/example?" "Can you write some tutorials/examples?" --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78f953baf..d70617c13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Hello contributors! Welcome to raylib! Do you enjoy raylib and want to contribute? Nice! You can help with the following points: - `C programming` - Can you write/review/test/improve the code? -- `Documentation/Tutorials/Example` - Can you write some tutorial/example? +- `Documentation/Tutorials/Example` - Can you write some tutorials/examples? - `Porting to other platforms` - Can you port/adapt/compile raylib on other systems? - `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)? - `Testing` - Can you find some bugs in raylib? From 6f4407cb1575f1c7528403c935267a59bd71f5e3 Mon Sep 17 00:00:00 2001 From: Franz Date: Wed, 23 Oct 2024 17:04:15 +0200 Subject: [PATCH 017/155] Fix typo in rshapes.c (#4421) --- src/rshapes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rshapes.c b/src/rshapes.c index e9b5ca87b..1479a6f37 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1650,7 +1650,7 @@ void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color prevNormal = normal; } -#else // !SUPPORT_SPLINE_MITTERS +#else // !SUPPORT_SPLINE_MITERS Vector2 delta = { 0 }; float length = 0.0f; From 157ee79a8ee31f722a5c208d3ec095c8021ebf76 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 23 Oct 2024 15:31:57 -0300 Subject: [PATCH 018/155] Add drawing for generic gamepad on core_input_gamepad example (#4424) --- examples/core/core_input_gamepad.c | 60 ++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 43dc65499..538e1c389 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -119,7 +119,6 @@ int main(void) if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED); // Draw axis: left joystick - Color leftGamepadColor = BLACK; if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED; DrawCircle(259, 152, 39, BLACK); @@ -195,9 +194,64 @@ int main(void) } else { - DrawText("- GENERIC GAMEPAD -", 280, 180, 20, GRAY); - // TODO: Draw generic gamepad + // Draw background: generic + DrawRectangleRounded((Rectangle){ 175, 110, 460, 220}, 0.3f, 0.0f, DARKGRAY); + + // Draw buttons: basic + DrawCircle(365, 170, 12, RAYWHITE); + DrawCircle(405, 170, 12, RAYWHITE); + DrawCircle(445, 170, 12, RAYWHITE); + DrawCircle(516, 191, 17, RAYWHITE); + DrawCircle(551, 227, 17, RAYWHITE); + DrawCircle(587, 191, 17, RAYWHITE); + DrawCircle(551, 155, 17, RAYWHITE); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(365, 170, 10, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(405, 170, 10, GREEN); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(445, 170, 10, BLUE); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(516, 191, 15, GOLD); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(551, 227, 15, BLUE); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(587, 191, 15, GREEN); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(551, 155, 15, RED); + + // Draw buttons: d-pad + DrawRectangle(245, 145, 28, 88, RAYWHITE); + DrawRectangle(215, 174, 88, 29, RAYWHITE); + DrawRectangle(247, 147, 24, 84, BLACK); + DrawRectangle(217, 176, 84, 25, BLACK); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(247, 147, 24, 29, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(247, 147 + 54, 24, 30, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(217, 176, 30, 25, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(217 + 54, 176, 30, 25, RED); + + // Draw buttons: left-right back + DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 0.0f, DARKGRAY); + DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 0.0f, DARKGRAY); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 0.0f, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 0.0f, RED); + + // Draw axis: left joystick + Color leftGamepadColor = BLACK; + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_THUMB)) leftGamepadColor = RED; + DrawCircle(345, 260, 40, BLACK); + DrawCircle(345, 260, 35, LIGHTGRAY); + DrawCircle(345 + (int)(leftStickX*20), + 260 + (int)(leftStickY*20), 25, leftGamepadColor); + + // Draw axis: right joystick + Color rightGamepadColor = BLACK; + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_THUMB)) rightGamepadColor = RED; + DrawCircle(465, 260, 40, BLACK); + DrawCircle(465, 260, 35, LIGHTGRAY); + DrawCircle(465 + (int)(rightStickX*20), + 260 + (int)(rightStickY*20), 25, rightGamepadColor); + + // Draw axis: left-right triggers + DrawRectangle(151, 110, 15, 70, GRAY); + DrawRectangle(644, 110, 15, 70, GRAY); + DrawRectangle(151, 110, 15, (int)(((1 + leftTrigger)/2)*70), RED); + DrawRectangle(644, 110, 15, (int)(((1 + rightTrigger)/2)*70), RED); + } DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(0)), 10, 50, 10, MAROON); From cd845368d8aca27ca99e3b9fbec8eff7904f5d65 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 23 Oct 2024 23:28:01 +0200 Subject: [PATCH 019/155] Update skinning.fs --- examples/models/resources/shaders/glsl100/skinning.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/models/resources/shaders/glsl100/skinning.fs b/examples/models/resources/shaders/glsl100/skinning.fs index 98a9e5bad..96bcabe01 100644 --- a/examples/models/resources/shaders/glsl100/skinning.fs +++ b/examples/models/resources/shaders/glsl100/skinning.fs @@ -13,7 +13,7 @@ uniform vec4 colDiffuse; void main() { // Fetch color from texture sampler - vec4 texelColor = texture(texture0, fragTexCoord); + vec4 texelColor = texture2D(texture0, fragTexCoord); // Calculate final fragment color gl_FragColor = texelColor*colDiffuse*fragColor; From 708089f5602c5134d641a8f16850f31b8fb2798d Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 23 Oct 2024 23:29:05 +0200 Subject: [PATCH 020/155] Reviewed and reverted unneeded module check, `rtextures` should not depend on `rtext` --- src/rtextures.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index a4534a7a2..23b32c1b8 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -1111,8 +1111,7 @@ Image GenImageText(int width, int height, const char *text) { Image image = { 0 }; -#if defined(SUPPORT_MODULE_RTEXT) - int textLength = TextLength(text); + int textLength = (int)strlen(text); int imageViewSize = width*height; image.width = width; @@ -1122,10 +1121,6 @@ Image GenImageText(int width, int height, const char *text) image.mipmaps = 1; memcpy(image.data, text, (textLength > imageViewSize)? imageViewSize : textLength); -#else - TRACELOG(LOG_WARNING, "IMAGE: GenImageText() requires module: rtext"); - image = GenImageColor(width, height, BLACK); // Generating placeholder black image rectangle -#endif return image; } From 6184a2db3d2104a1fa22dda470820f7387bf1007 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 23 Oct 2024 23:29:49 +0200 Subject: [PATCH 021/155] ADDED: CHANGELOG for raylib 5.5 -WIP- --- CHANGELOG | 419 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 415 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b5b50e4d7..d215dcbc4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,12 +7,423 @@ Current Release: raylib 5.0 (18 November 2023) Release: raylib 5.5 - 11th Anniversary Edition? (18 November 2024?) ------------------------------------------------------------------------- KEY CHANGES: - - - - - - + - New rcore backend: RGFW + - New raylib project creator tool + - New platforms supported: Dreamcast, N64, PSP, PSVita, PS4 + - GPU Skinning (all platforms and GPU versions) + - raymath C++ operators Detailed changes: -... +[rcore] ADDED: Working directory info at initialization by @Ray +[rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray +[rcore] ADDED: `ComputeSHA1()` (#4390) by @Anthony Carbajal +[rcore] ADDED: `ComputeCRC32()` and `ComputeMD5()` by @Ray +[rcore] ADDED: `GetKeyName()` (#4161) by @MrScautHD +[rcore] ADDED: `IsFileNameValid()` by @Ray +[rcore] ADDED: `GetViewRay()`, viewport independent raycast (#3709) by @Luís Almeida +[rcore] ADDED: Directory filtering to `LoadDirectoryFilesEx()`/`ScanDirectoryFiles()` (#4302) by @foxblock +[rcore] RENAMED: `GetMouseRay()` to `GetScreenToWorldRay()` (#3830) by @Ray +[rcore] RENAMED: `GetViewRay()` to `GetScreenToWorldRayEx()` (#3830) by @Ray +[rcore] REVIEWED: `GetApplicationDirectory()` for FreeBSD (#4318) by @base +[rcore] REVIEWED: Update comments on fullscreen and boderless window to describe what they do (#4280) by @Jeffery Myers +[rcore] REVIEWED: Automation events mouse wheel #4263 by @Ray +[rcore] REVIEWED: Fix gamepad axis movement and its automation event recording (#4184) by @maxmutant +[rcore] REVIEWED: Do not set RL_TEXTURE_FILTER_LINEAR when high dpi flag is enabled (#4189) by @Dave Green +[rcore] REVIEWED: `GetScreenWidth()`/`GetScreenHeight()` (#4074) by @Anthony Carbajal +[rcore] REVIEWED: Initial window dimensions checks (#3950) by @Christian Haas +[rcore] REVIEWED: Set default init values for random #3954 by @Ray +[rcore] REVIEWED: Window positioning, avoid out-of-screen window-bar by @Ray +[rcore] REVIEWED: Fix framerate recording for .gif (#3894) by @Rob Loach +[rcore] REVIEWED: Screen space related functions consistency (#3830) by @aiafrasinei +[rcore] REVIEWED: `GetFileNameWithoutExt()` (#3771) by @oblerion +[rcore] REVIEWED: `GetWindowScaleDPI()`, simplified (#3701) by @Karl Zylinski +[rcore] REVIEWED: `UnloadAutomationEventList()` (#3658) by @Antonis Geralis +[rcore] REVIEWED: Flip VR screens (#3633) by @Matthew Oros +[rcore] REVIEWED: Remove unused vScreenCenter (#3632) by @Matthew Oros +[rcore] REVIEWED: `LoadRandomSequence()`, issue in sequence generation #3612 by @Ray +[rcore] REVIEWED: `IsMouseButtonUp()` (#3609) by @Kenneth M +[rcore] REVIEWED: Fix typos in src/platforms/rcore_*.c (#3581) by @RadsammyT +[rcore] REVIEWED: `ExportDataAsCode()`, change sanitization check (#3837) by @Laurentino Luna +[rcore] REVIEWED: `ExportDataAsCode()`, add little sanitization to indentifier names (#3832) by @4rk +[rcore][rlgl] REVIEWED: Fix scale issues when ending a view mode (#3746) by @Jeffery Myers +[rcore][GLFW] REVIEWED: Keep CORE.Window.position properly in sync with glfw window position (#4190) by @Dave Green +[rcore][GLFW] REVIEWED: Set AUTO_ICONIFY flag to false per default (#4188) by @Dave Green +[rcore][GLFW] REVIEWED: `InitPlatform()`, add workaround for NetBSD (#4139) by @NishiOwO +[rcore][GLFW] REVIEWED: Fix window not initializing on primary monitor (#3923) by @Rafael Bordoni +[rcore][GLFW] REVIEWED: Set relative mouse mode when the cursor is disabled (#3874) by @Jeffery Myers +[rcore][GLFW] REVIEWED: Remove GLFW mouse passthrough hack and increase GLFW version in CMake (#3852) by @Alexandre Almeida +[rcore][GLFW] REVIEWED: Updated GLFW to 3.4 (#3827) by @Alexandre Almeida +[rcore][GLFW] REVIEWED: Feature test macros before include (#3737) by @John +[rcore][Web] ADDED: `SetWindowOpacity()` implementation (#4403) by @Asdqwe +[rcore][Web] ADDED: `MaximizeWindow()` and `RestoreWindow()` implementations (#4397) by @Asdqwe +[rcore][Web] ADDED: `ToggleFullscreen()` implementation (#3634) by @ubkp +[rcore][Web] ADDED: `GetWindowPosition()` implementation (#3637) by @ubkp +[rcore][Web] ADDED: `ToggleBorderlessWindowed()` implementation (#3622) by @ubkp +[rcore][Web] ADDED: `GetMonitorWidth()` and `GetMonitorHeight()` implementations (#3636) by @ubkp +[rcore][Web] REVIEWED: Update `SetWindowState()` and `ClearWindowState()` to handle `FLAG_WINDOW_MAXIMIZED` (#4402) by @Asdqwe +[rcore][Web] REVIEWED: `WindowSizeCallback()`, do not try to handle DPI, already managed by GLFW (#4143) by @SuperUserNameMan +[rcore][Web] REVIEWED: Relative mouse mode issues (#3940) by @Cemal GönültaÅŸ +[rcore][Web] REVIEWED: `ShowCursor()`, `HideCursor()` and `SetMouseCursor()` (#3647) by @ubkp +[rcore][Web] REVIEWED: Fix CORE.Input.Mouse.cursorHidden with callbacks (#3644) by @ubkp +[rcore][Web] REVIEWED: Fix `IsMouseButtonUp()` (#3611) by @ubkp +[rcore][Web] REVIEWED: HighDPI support #3372 by @Ray +[rcore][SDL] ADDED: `IsCursorOnScreen()` (#3862) by @Peter0x44 +[rcore][SDL] ADDED: Gamepad rumble/vibration support (#3819) by @GideonSerf +[rcore][SDL] REVIEWED: Gamepad support (#3776) by @A +[rcore][SDL] REVIEWED: `GetWorkingDirectory()`, return correct path (#4392) by @Asdqwe +[rcore][SDL] REVIEWED: `GetClipboardText()`, fix memory leak (#4354) by @Asdqwe +[rcore][SDL] REVIEWED: Change SDL_Joystick to SDL_GameController (#4129) by @Frank Kartheuser +[rcore][SDL] REVIEWED: Update storage base path, use provided SDL base path by @Ray +[rcore][SDL] REVIEWED: Call SDL_GL_SetSwapInterval() after GL context creation (#3997) by @JupiterRider +[rcore][SDL] REVIEWED: `GetKeyPressed()` (#3869) by @Arthur +[rcore][SDL] REVIEWED: Fix SDL multitouch tracking (#3810) by @mooff +[rcore][SDL] REVIEWED: Fix `SUPPORT_WINMM_HIGHRES_TIMER` (#3679) by @ubkp +[rcore][SDL] REVIEWED: SDL text input to Unicode codepoints #3650 by @Ray +[rcore][SDL] REVIEWED: `IsMouseButtonUp()` and add touch events (#3610) by @ubkp +[rcore][SDL] REVIEWED: Fix real touch gestures (#3614) by @ubkp +[rcore][SDL] REVIEWED: `IsKeyPressedRepeat()` (#3605) by @ubkp +[rcore][SDL] REVIEWED: `GetKeyPressed()` and `GetCharPressed()` for SDL (#3604) by @ubkp +[rcore][SDL] REVIEWED: `SetMousePosition()` for SDL (#3580) by @ubkp +[rcore][SDL] REVIEWED: `SetWindowIcon()` for SDL (#3578) by @ubkp +[rcore][SDL][rlgl] REVIEWED: Fix for running gles2 with SDL on desktop (#3542) by @_Tradam +[rcore][Android] REVIEWED: Issue with isGpuReady flag (#4340) by @Menno van der Graaf +[rcore][Android] REVIEWED: Allow main() to return it its caller on configuration changes (#4288) by @Hesham Abourgheba +[rcore][Android] REVIEWED: Replace deprecated Android function ALooper_pollAll with ALooper_pollOnce (#4275) by @Menno van der Graaf +[rcore][Android] REVIEWED: `PollInputEvents()`, register previous gamepad events (#3910) by @Aria +[rcore][Android] REVIEWED: Fix Android keycode translation and duplicate key constants (#3733) by @Alexandre Almeida +[rcore][DRM] ADDED: uConsole keys mapping (#4297) by @carverdamien +[rcore][DRM] ADDED: `GetMonitorWidth/Height()` (#3956) by @gabriel-marques +[rcore][DRM] REVIEWED: `IsMouseButtonUp()` (#3611) by @ubkp +[rcore][DRM] REVIEWED: Optimize gesture handling (#3616) by @ubkp +[rcore][DRM] REVIEWED: `IsKeyPressedRepeat()` for PLATFORM_DRM direct input (#3583) by @ubkp +[rcore][DRM] REVIEWED: Fix gamepad buttons not working in drm backend (#3888) by @MrMugame +[rcore][DRM] REVIEWED: DRM backend to only use one api to allow for more devices (#3879) by @MrMugame +[rcore][DRM] REVIEWED: Avoid separate thread when polling for gamepad events (#3641) by @Cinghy Creations +[rcore][DRM] REVIEWED: Connector status reported as UNKNOWN but should be considered as CONNECTED (#4305) by @MichaÅ‚ Jaskólski +[rcore][RGFW] ADDED: RGFW, new rcore backend platform (#3941) by @Colleague Riley +[rcore][RGFW] REVIEWED: RGFW 1.0 (#4144) by @Colleague Riley +[rcore][RGFW] REVIEWED: Fix errors when compiling with mingw (#4282) by @Colleague Riley +[rcore][RGFW] REVIEWED: Replace long switch with a lookup table (#4108) by @Colleague Riley +[rlgl] ADDED: More uniform data type options #4137 by @Ray +[rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang +[rlgl] ADDED: `rlCullDistance*()` variables and getters (#3912) by @KotzaBoss +[rlgl] ADDED: `rlSetClipPlanes()` function (#3912) by @KotzaBoss +[rlgl] ADDED: `isGpuReady` flag, allow font loading with no GPU acceleration by @Ray -WARNING- +[rlgl] REVIEWED: Changed RLGL_VERSION from 4.5 to 5.0 (#3914) by @Mute +[rlgl] REVIEWED: Shader load failing returns 0, instead of fallback by @Ray -WARNING- +[rlgl] REVIEWED: Standalone mode default flags (#4334) by @Asdqwe +[rlgl] REVIEWED: Fix hardcoded index values in vboID array (#4312) by @Jett +[rlgl] REVIEWED: GLint64 did not exist before OpenGL 3.2 (#4284) by @Tchan0 +[rlgl] REVIEWED: Extra warnings in case OpenGL 4.3 is not enabled (#4202) by @Maxim Knyazkin +[rlgl] REVIEWED: Using GLint64 for glGetBufferParameteri64v() (#4197) by @Randy Palamar +[rlgl] REVIEWED: Replace `glGetInteger64v()` with `glGetBufferParameteri64v()` (#4154) by @Kai Kitagawa-Jones +[rlgl] REVIEWED: `rlMultMatrixf()`, fix matrix multiplication order (#3935) by @bohonghuang +[rlgl] REVIEWED: `rlSetVertexAttribute()`, define last parameter as offset #3800 by @Ray +[rlgl] REVIEWED: `rlDisableVertexAttribute()`, remove redundat calls for SHADER_LOC_VERTEX_COLOR (#3871) by @Kacper ZybaÅ‚a +[rlgl] REVIEWED: `rlLoadFramebuffer()`, parameters not required by @Ray +[rlgl] REVIEWED: `rlSetUniformSampler()` (#3759) by @veins1 +[rlgl] REVIEWED: Renamed near/far variables (#4039) by @jgabaut +[rlgl] REVIEWED: Expose OpenGL symbols (#3588) by @Peter0x44 +[rlgl] REVIEWED: Fix OpenGL 1.1 build issues (#3876) by @Ray +[rlgl] REVIEWED: Fixed compilation for OpenGL ES (#4243) by @Maxim Knyazkin +[rlgl] REVIEWED: rlgl function description and comments by @Ray +[rlgl] REVIEWED: Expose glad functions when building raylib as a shared lib (#3572) by @Peter0x44 +[rlgl] REVIEWED: Fix version info in rlgl.h (#3558) by @Steven Schveighoffer +[rcamera] REVIEWED: Make camera movement independant of framerate (#4247) by @hanaxars -WARNING- +[rcamera] REVIEWED: Updated camera speeds with GetFrameTime() (#4362) by @Anthony Carbajal +[rcamera] REVIEWED: `UpdateCamera()`, added CAMERA_CUSTOM check (#3938) by @Tomas Fabrizio Orsi +[rcamera] REVIEWED: Support mouse/keyboard and gamepad coexistence for input (#3579) by @ubkp +[rcamera] REVIEWED: Cleaned away unused macros(#3762) by @Brian E +[rcamera] REVIEWED: Fix for free camera mode (#3603) by @lesleyrs +[rcamera] REVIEWED: `GetCameraRight()` (#3784) by @Danil +[raymath] ADDED: C++ operator overloads for common math function (#4385) by @Jeffery Myers +[raymath] ADDED: Vector4 math functions and Vector2 variants of some Vector3 functions (#3828) by @Bowserinator +[raymath] REVIEWED: Fix MSVC warnings/errors in C++ (#4125) by @Jeffery Myers +[raymath] REVIEWED: Add extern "C" to raymath header for C++ (#3978) by @Jeffery Myers +[raymath] REVIEWED: `QuaternionFromAxisAngle()`, remove redundant axis length calculation (#3900) by @jtainer +[raymath] REVIEWED: `Vector3Perpendicular()`, avoid implicit conversion from float to double (#3799) by @João Foscarini +[raymath] REVIEWED: Small code refactor (#3753) by @Idir Carlos Aliane +[rshapes] ADDED: `CheckCollisionCircleLine()` (#4018) by @kai-z99 +[rshapes] REVIEWED: Multisegment Bezier splines (#3744) by @Santiago Pelufo +[rshapes] REVIEWED: Expose shapes drawing texture and rectangle (#3677) by @Jeffery Myers +[rshapes] REVIEWED: `DrawLine()` #4075 by @Ray +[rshapes] REVIEWED: `DrawPixel()` drawing by @Ray +[rshapes] REVIEWED: `DrawLine()` to avoid pixel rounding issues #3931 by @Ray +[rshapes] REVIEWED: `DrawRectangleLinesEx()`, make sure accounts for square tiles (#4382) by @Jojaby +[rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset when scaling (#3884) by @Ray +[rshapes] REVIEWED: `Draw*Gradient()` color parameter names (#4270) by @Paperdomo101 +[rshapes] REVIEWED: `DrawGrid()`, remove duplicate color calls (#4148) by @Jeffery Myers +[rshapes] REVIEWED: `DrawSplineLinear()` to `SUPPORT_SPLINE_MITERS` by @Ray +[rshapes] REVIEWED: `DrawSplineLinear()`, implement miters (#3585) by @Toctave +[rshapes] REVIEWED: `CheckCollisionPointRec()` by @Ray +[rshapes] REVIEWED: `CheckCollisionPointCircle()`, new implementation (#4135) by @kai-z99 +[rshapes] REVIEWED: `CheckCollisionCircles()`, optimized (#4065) by @kai-z99 +[rshapes] REVIEWED: `CheckCollisionPointPoly()` (#3750) by @Antonio Raúl +[rshapes] REVIEWED: `CheckCollisionCircleRec()` (#3584) by @ubkp +[rshapes] REVIEWED: Add more detail to function comment (#4344) by @Jeffery Myers +[rshapes] REVIEWED: Functions that draw point arrays take them as const (#4051) by @Jeffery Myers +[rtextures] ADDED: `ColorIsEqual()` by @Ray +[rtextures] ADDED: `ColorLerp()`, to mix 2 colors together (#4310) by @SusgUY446 +[rtextures] ADDED: `LoadImageAnimFromMemory()` (#3681) by @IoIxD +[rtextures] ADDED: `ImageKernelConvolution()` (#3528) by @Karim +[rtextures] ADDED: `ImageFromChannel()` (#4105) by @Bruno Cabral +[rtextures] ADDED: `ImageDrawLineEx()` (#4097) by @Le Juez Victor +[rtextures] ADDED: `ImageDrawTriangle()` (#4094) by @Le Juez Victor +[rtextures] REMOVED: SVG files loading and drawing, moving it to raylib-extras by @Ray -WARNING- +[rtextures] REVIEWED: `LoadImage()`, added support for 3-channel QOI images (#4384) by @R-YaTian +[rtextures] REVIEWED: `LoadImageRaw()` #3926 by @Ray +[rtextures] REVIEWED: `LoadImageColors()`, advance k in loop (#4120) by @Bruno Cabral +[rtextures] REVIEWED: `LoadTextureCubemap()`, added `mipmaps` #3665 by @Ray +[rtextures] REVIEWED: `LoadTextureCubemap(), assign format to cubemap (#3823) by @Gary M +[rtextures] REVIEWED: `LoadImageFromScreen()`, fix scaling (#3881) by @proberge-dev +[rtextures] REVIEWED: `LoadImageFromMemory()`, warnings on invalid image data (#4179) by @Jutastre +[rtextures] REVIEWED: `LoadImageAnimFromMemory()`, added security checks (#3924) by @Ray +[rtextures] REVIEWED: `ImageColorTint()` and `ColorTint()`, optimized (#4015) by @Le Juez Victor +[rtextures] REVIEWED: `ImageKernelConvolution()`, formating and warnings by @Ray +[rtextures] REVIEWED: `ImageDrawRectangleRec`, fix bounds check (#3732) by @Blockguy24 +[rtextures] REVIEWED: `ImageResizeCanvas()`, implemented fill color (#3720) by @Lieven Petersen +[rtextures] REVIEWED: `ImageDrawRectangleRec()` (#3721) by @Le Juez Victor +[rtextures] REVIEWED: `ImageDraw()`, don't try to blend images without alpha (#4395) by @Nikolas +[rtextures] REVIEWED: `GenImagePerlinNoise()` being stretched (#4276) by @Bugsia +[rtextures] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 by @Ray +[rtextures] REVIEWED: `ColorToInt()`, fix undefined behaviour (#3996) by @OetkenPurveyorOfCode +[rtextures] REVIEWED: Simplified for loop for some image manipulation functions (#3712) by @Alice Nyaa +[rtext] ADDED: BDF fonts support (#3735) by @Stanley Fuller -WARNING- +[rtext] ADDED: `TextToCamel()` (#4033) by @IoIxD +[rtext] ADDED: `TextToSnake()` (#4033) by @IoIxD +[rtext] REDESIGNED: `SetTextLineSpacing()` by @Ray -WARNING- +[rtext] REVIEWED: `LoadFontDataBDF()` name and formating by @Ray +[rtext] REVIEWED: `LoadFontDefault()`, initialize glyphs and recs to zero #4319 by @Ray +[rtext] REVIEWED: `LoadFontEx()`, avoid default font fallback (#4077) by @Peter0x44 -WARNING- +[rtext] REVIEWED: `LoadBMFont()`, extended functionality (#3536) by @Dongkun Lee +[rtext] REVIEWED: `LoadBMFont()`, issue on not glyph data initialized by @Ray +[rtext] REVIEWED: `LoadFontFromMemory()`, use strncpy() to fix buffer overflow (#3795) by @Mingjie Shen +[rtext] REVIEWED: `LoadCodepoints()` returning a freed ptr when count is 0 (#4089) by @Alice Nyaa +[rtext] REVIEWED: `LoadFontData()` avoid fallback glyphs by @Ray -WARNING- +[rtext] REVIEWED: `LoadFontData()`, load image only if glyph has been found in font by @Ray +[rtext] REVIEWED: `ExportFontAsCode()`, fix C++ compiler errors (#4013) by @DarkAssassin23 +[rtext] REVIEWED: `MeasureTextEx()` height calculation (#3770) by @Marrony Neris +[rtext] REVIEWED: `CodepointToUTF8()`, clean static buffer #4379 by @Ray +[rtext] REVIEWED: `TextToFloat()`, always multiply by sign (#4273) by @listeria +[rtext] REVIEWED: `TextReplace()` const correctness (#3678) by @maverikou +[rtext] REVIEWED: `TextToFloat()`, coding style (#3627) by @Benjamin Schmid Ties +[rtext] REVIEWED: Some comments to align to style (#3756) by @Idir Carlos Aliane +[rtext] REVIEWED: Adjust font atlas area calculation so padding area is not underestimated at small font sizes (#3719) by @Tim Romero +[rmodels] ADDED: GPU skinning support for models animations (#4321) by @Daniel Holden -WARNING- +[rmodels] ADDED: Support 16-bit unsigned short vec4 format for gltf joint loading (#3821) by @Gary M +[rmodels] ADDED: Support animation names for the m3d model format (#3714) by @kolunmi +[rmodels] ADDED: `DrawModelPoints()`, more performant point cloud rendering (#4203) by @Reese Gallagher +[rmodels] ADDED: `ExportMeshAsCode()` by @Ray +[rmodels] REVIEWED: Multiple updates to gltf loading, improved macro (#4373) by @Harald Scheirich +[rmodels] REVIEWED: `LoadOBJ()`, correctly split obj meshes by material (#4285) by @Jeffery Myers +[rmodels] REVIEWED: `LoadOBJ()`, add warning when loading an OBJ with multiple materials (#4271) by @Jeffery Myers +[rmodels] REVIEWED: `LoadIQM()`, set model.meshMaterial[] (#4092) by @SuperUserNameMan +[rmodels] REVIEWED: `LoadIQM()`, attempt to load texture from IQM at loadtime (#4029) by @Jett +[rmodels] REVIEWED: `LoadM3D(), fix vertex colors for m3d files (#3859) by @Jeffery Myers +[rmodels] REVIEWED: `LoadGLTF()`, supporting additional vertex data formats (#3546) by @MrScautHD +[rmodels] REVIEWED: `LoadGLTF()`, correctly handle the node hierarchy in a glTF file (#4037) by @Paul Melis +[rmodels] REVIEWED: `LoadGLTF()`, replaced SQUAD quat interpolation with cubic hermite (gltf 2.0 specs) (#3920) by @Benji +[rmodels] REVIEWED: `LoadGLTF()`, support 2nd texture coordinates loading by @Ray +[rmodels] REVIEWED: `LoadGLTF()`, support additional vertex attributes data formats #3890 by @Ray +[rmodels] REVIEWED: `LoadGLTF()`, set cgltf callbacks to use `LoadFileData()` and `UnloadFileData()` (#3652) by @kolunmi +[rmodels] REVIEWED: `LoadGLTF()`, JOINTS loading #3836 by @Ray +[rmodels] REVIEWED: `LoadImageFromCgltfImage()`, fix base64 padding support (#4112) by @SuperUserNameMan +[rmodels] REVIEWED: `LoadModelAnimationsIQM()`, fix corrupted animation names (#4026) by @Jett +[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, load animations with 1 frame (#3804) by @Nikita Blizniuk +[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, added missing interpolation types (#3919) by @Benji +[rmodels] REVIEWED: `LoadModelAnimationsGLTF()` (#4107) by @VitoTringolo +[rmodels] REVIEWED: `LoadBoneInfoGLTF()`, add check for animation name being NULL (#4053) by @VitoTringolo +[rmodels] REVIEWED: `GenMeshTangents()`, read uninitialized values, fix bounding case (#4066) by @kai-z99 +[rmodels] REVIEWED: `GenMeshTangents()`, fixed out of bounds error (#3990) by @Salvador Galindo +[rmodels] REVIEWED: `DrawCylinder()`, fix drawing due to imprecise angle (#4034) by @Paul Melis +[rmodels] REVIEWED: `DrawMesh()`, send full matModel to shader in DrawMesh (#4005) (#4022) by @David Holland +[rmodels] REVIEWED: `DrawMesh()`, fix material specular map retrieval (#3758) by @Victor Gallet +[rmodels] REVIEWED: `DrawModelEx()`, simplified multiplication of colors (#4002) by @Le Juez Victor +[rmodels] REVIEWED: `DrawBillboardPro()`, to be consistend with `DrawTexturePro()` (#4132) by @bohonghuang +[rmodels] REVIEWED: `DrawSphereEx()` optimization (#4106) by @smalltimewizard +[raudio] REVIEWED: `LoadMusicStreamFromMemory()`, support 24-bit FLACs (#4279) by @konstruktor227 +[raudio] REVIEWED: `LoadWaveSamples()`, fix mapping of wave data (#4062) by @listeria +[raudio] REVIEWED: `LoadMusicStream()`, remove drwav_uninit() (#3986) by @FishingHacks +[raudio] REVIEWED: `LoadMusicStream()` qoa and wav loading (#3966) by @veins1 +[raudio] REVIEWED: `ExportWaveAsCode()`, segfault (#3769) by @IoIxD +[raudio] REVIEWED: `WaveCrop()`, fix issues and use frames instead of samples (#3994) by @listeria +[raudio] REVIEWED: Crash from multithreading issues (#3907) by @Christian Haas +[raudio] REVIEWED: Reset music.ctxType if loading wasn't succesful (#3917) by @veins1 +[raudio] REVIEWED: Added missing functions in "standalone" mode (#3760) by @Alessandro Nikolaev +[raudio] REVIEWED: Disable unused miniaudio features (#3544) by @Alexandre Almeida +[raudio] REVIEWED: Fix crash when switching playback device at runtime (#4102) by @jkaup +[raudio] REVIEWED: Support 24 bits samples for FLAC format (#4058) by @Alexey Kutepov +[examples] ADDED: `core_random_sequence` (#3846) by @Dalton Overmyer +[examples] ADDED: `models_bone_socket` (#3833) by @iP +[examples] ADDED: `shaders_vertex_displacement` (#4186) by @Alex ZH +[examples] ADDED: `shaders_shadowmap` (#3653) by @TheManTheMythTheGameDev +[examples] REVIEWED: `core_2d_camera_platformer` by @Ray +[examples] REVIEWED: `core_2d_camera_mouse_zoom`, use logarithmic scaling for a 2d zoom functionality (#3977) by @Mike Will +[examples] REVIEWED: `core_input_gamepad_info`, all buttons displayed within the window (#4241) by @Asdqwe +[examples] REVIEWED: `core_input_gamepad_info`, show ps3 controller (#4040) by @Konrad Gutvik Grande +[examples] REVIEWED: `shapes_bouncing_ball` (#4226) by @Anthony Carbajal +[examples] REVIEWED: `shapes_following_eyes` (#3710) by @Hongyu Ouyang +[examples] REVIEWED: `shapes_draw_rectangle_rounded` by @Ray +[examples] REVIEWED: `shapes_draw_ring`, fix other examples (#4211) by @kai-z99 +[examples] REVIEWED: `shapes_lines_bezier` by @Ray +[examples] REVIEWED: `textures_image_kernel` #3556 by @Ray +[examples] REVIEWED: `text_input_box` (#4229) by @Anthony Carbajal +[examples] REVIEWED: `text_writing_anim` (#4230) by @Anthony Carbajal +[examples] REVIEWED: `models_billboard` by @Ray +[examples] REVIEWED: `models_cubicmap` by @Ray +[examples] REVIEWED: `models_point_rendering` by @Ray +[examples] REVIEWED: `models_box_collisions` (#4224) by @Anthony Carbajal +[examples] REVIEWED: `models_skybox`, do not use HDR by default (#4115) by @Jeffery Myers +[examples] REVIEWED: `shaders_basic_pbr` (#4225) by @Anthony Carbajal +[examples] REVIEWED: `shaders_palette_switch` by @Ray +[examples] REVIEWED: `shaders_hybrid_render` (#3908) by @Yousif +[examples] REVIEWED: `shaders_lighting_instancing`, fix vertex shader (#4056) by @Karl Zylinski +[examples] REVIEWED: `shaders_raymarching`, add `raymarching.fs` for GLSL120 (#4183) by @CDM15y +[examples] REVIEWED: `shaders_shadowmap`, fix shaders for GLSL 1.20 (#4167) by @CDM15y +[examples] REVIEWED: `shaders_deferred_render` (#3655) by @Jett +[examples] REVIEWED: `shaders_basic_pbr` (#3621) by @devdad +[examples] REVIEWED: `shaders_basic_pbr`, remove dependencies (#3649) by @TheManTheMythTheGameDev +[examples] REVIEWED: `shaders_basic_pbr`, added more comments by @Ray +[examples] REVIEWED: `audio_stream_effects` (#3618) by @lipx +[examples] REVIEWED: `audio_raw_stream` (#3624) by @riadbettole +[examples] REVIEWED: `audio_mixed_processor` (#4214) by @Anthony Carbajal +[examples] REVIEWED: `raylib_opengl_interop`, fix building on PLATFORM_DESKTOP_SDL (#3826) by @Peter0x44 +[examples] REVIEWED: Update examples missing UnloadTexture() calls (#4234) by @Anthony Carbajal +[examples] REVIEWED: Added GLSL 100 and 120 shaders to lightmap example (#3543) by @Jussi Viitala +[examples] REVIEWED: Set FPS to always 60 in all exampels (#4235) by @Anthony Carbajal +[build] REVIEWED: Makefile by @Ray +[build] REVIEWED: Makefile, fix wrong flag #3593 by @Ray +[build] REVIEWED: Makefile, disable wayland by default (#4369) by @Anthony Carbajal +[build] REVIEWED: Makefile, VSCode, fix to support multiple .c files (#4391) by @Alan Arrecis +[build] REVIEWED: Makefile, fix -Wstringop-truncation warning (#4096) by @Peter0x44 +[build] REVIEWED: Makefile, fix issues for RGFW on Linux/macOS (#3969) by @Colleague Riley +[build] REVIEWED: Makefile, update RAYLIB_VERSION (#3901) by @Belllg +[build] REVIEWED: Makefile (#4054) by @Lázaro Albuquerque +[build] REVIEWED: Makefile examples, align /usr/local with /src Makefile (#4286) by @Tchan0 +[build] REVIEWED: Makefile examples, added `textures_image_kernel` (#3555) by @Sergey Zapunidi +[build] REVIEWED: Makefile examples (#4209) by @Anthony Carbajal +[build] REVIEWED: build.zig, fix various issues around `-Dconfig` (#4398) by @Sage Hane +[build] REVIEWED: build.zig, fix type mismatch (#4383) by @yuval_dev +[build] REVIEWED: build.zig, minor fixes (#4381) by @Sage Hane +[build] REVIEWED: build.zig, fix @src logic and a few things (#4380) by @Sage Hane +[build] REVIEWED: build.zig, improve logic (#4375) by @Sage Hane +[build] REVIEWED: build.zig, issues (#4374) by @William Culver +[build] REVIEWED: build.zig, issues (#4366) by @Visen +[build] REVIEWED: build.zig, support desktop backend change (#4358) by @Nikolas +[build] REVIEWED: build.zig, use zig fmt (#4242) by @freakmangd +[build] REVIEWED: build.zig, check if wayland-scanner is installed (#4217) by @lnc3l0t +[build] REVIEWED: build.zig, override config.h definitions (#4193) by @lnc3l0t +[build] REVIEWED: build.zig, support GLFW platform detection (#4150) by @InventorXtreme +[build] REVIEWED: build.zig, make emscripten build compatible with Zig 0.13.0 (#4121) by @Mike Will +[build] REVIEWED: build.zig, pass the real build.zig file (#4113) by @InKryption +[build] REVIEWED: build.zig, leverage `dependencyFromBuildZig` (#4109) by @InKryption +[build] REVIEWED: build.zig, run examples from their directories (#4063) by @Mike Will +[build] REVIEWED: build.zig, fix raygui build when using addRaygui externally (#4027) by @Viktor Pocedulić +[build] REVIEWED: build.zig, fix emscripten build (#4012) by @Dylan +[build] REVIEWED: build.zig, update to zig 0.12.0dev while keeping 0.11.0 compatibility (#3715) by @freakmangd +[build] REVIEWED: build.zig, drop support for 0.11.0 and use more idiomatic build script code (#3927) by @freakmangd +[build] REVIEWED: build.zig, sdd shared library build option and update to zig 0.12.0-dev.2139 (#3727) by @Andrew Lee +[build] REVIEWED: build.zig, add `opengl_version` option (#3979) by @Alexei Mozaidze +[build] REVIEWED: build.zig, fix local dependency break (#3913) by @freakmangd +[build] REVIEWED: build.zig, fix breaking builds for Zig v0.11.0 (#3896) by @iarkn +[build] REVIEWED: build.zig, update to latest version and simplify (#3905) by @freakmangd +[build] REVIEWED: build.zig, remove all uses of deps/mingw (#3805) by @Peter0x44 +[build] REVIEWED: build.zig, fixed illegal instruction crash (#3682) by @WisonYe +[build] REVIEWED: build.zig, fix broken build on #3863 (#3891) by @Nikolas Mauropoulos +[build] REVIEWED: CMake, update to raylib 5.0 (#3623) by @Peter0x44 +[build] REVIEWED: CMake, added PLATFORM option for Desktop SDL (#3809) by @mooff +[build] REVIEWED: CMake, fix GRAPHICS_* check (#4359) by @Kacper ZybaÅ‚a +[build] REVIEWED: CMake, examples projects (#4332) by @Ridge3Dproductions +[build] REVIEWED: CMake, fix warnings in projects/CMake/CMakeLists.txt (#4278) by @Peter0x44 +[build] REVIEWED: CMake, delete BuildOptions.cmake (#4277) by @Peter0x44 +[build] REVIEWED: CMake, update version to 5.0 so libraries are correctly versioned (#3615) by @David Williams +[build] REVIEWED: CMake, improved linkage flags to save 28KB on the final bundle (#4177) by @Lázaro Albuquerque +[build] REVIEWED: CMake, support OpenGL ES3 in `LibraryConfigurations.cmake` (#4079) by @manuel5975p +[build] REVIEWED: CMake, `config.h` fully available to users (#4044) by @Lázaro Albuquerque +[build] REVIEWED: CMake, pass -sFULL_ES3 instead of -sFULL_ES3=1 (#4090) by @manuel5975p +[build] REVIEWED: CMake, SDL build link the glfw dependency (#3860) by @Rob Loach +[build] REVIEWED: CMake, infer CMAKE_MODULE_PATH in super-build (#4042) by @fruzitent +[build] REVIEWED: CMake, remove USE_WAYLAND option (#3851) by @Alexandre Almeida +[build] REVIEWED: CMake, disable SDL rlgl_standalone example (#3861) by @Rob Loach +[build] REVIEWED: CMake, bump version required to avoid deprecated #3639 by @Ray +[build] REVIEWED: CMake, fix examples linking -DPLATFORM=SDL (#3825) by @Peter0x44 +[build] REVIEWED: VS2022 project by @Ray +[build] REVIEWED: VS2022, fix build warnings (#4095) by @Jeffery Myers +[build] REVIEWED: Fix fix-build-paths (#3849) by @Caleb Barger +[build] REVIEWED: Fix build paths (#3835) by @Steve Biedermann +[build] REVIEWED: Fix VSCode sample project for macOS (#3666) by @Tim Romero +[build] REVIEWED: Fix some warnings on web builds and remove some redundant flags (#4069) by @Lázaro Albuquerque +[build] REVIEWED: Fix examples not building with gestures system disabled (#4020) by @Sprix +[build] REVIEWED: Fix GLFW runtime platform detection (#3863) by @Alexandre Almeida +[build] REVIEWED: Fix DRM cross-compile without sysroot (#3839) by @Christian W. Zuckschwerdt +[build] REVIEWED: Fix cmake-built libraylib.a to properly include GLFW's object files (#3598) by @Peter0x44 +[build] REVIEWED: Hide unneeded internal symbols when building raylib as an so or dylib (#3573) by @Peter0x44 +[build] REVIEWED: Corrected the path of android ndk toolchains for OSX platforms (#3574) by @Emmanuel Méra +[build][CI] ADDED: Automatic update for raylib_api.* (#3692) by @seiren +[build][CI] REVIEWED: Update workflows to use latest actions/upload-artifact by @Ray +[build][CI] REVIEWED: CodeQL minor tweaks to avoid some warnings by @Ray +[build][CI] REVIEWED: Update linux_examples.yml by @Ray +[build][CI] REVIEWED: Update linux.yml by @Ray +[build][CI] REVIEWED: Update webassembly.yml by @Ray +[build][CI] REVIEWED: Update cmake.yml by @Ray +[build][CI] REVIEWED: Update codeql.yml, exclude src/external files by @Ray +[bindings] ADDED: raylib-APL (#4253) by @Brian E +[bindings] ADDED: raylib-bqn, moved rayed-bqn (#4331) by @Brian E +[bindings] ADDED: brainfuck binding (#4169) by @_Tradam +[bindings] ADDED: raylib-zig-bindings (#4004) by @Lionel Briand +[bindings] ADDED: Raylib-CSharp wrapper (#3963) by @MrScautHD +[bindings] ADDED: COBOL binding (#3661) by @glowiak +[bindings] ADDED: raylib-beef binding (#3640) by @Braedon Lewis +[bindings] ADDED: Raylib-CSharp-Vinculum (#3571) by @Danil +[bindings] REVIEWED: Remove broken-link bindings #3899 by @Ray +[bindings] REVIEWED: Updated some versions on BINDINGS.md by @Ray +[bindings] REVIEWED: Removed umaintained repos (#3999) by @Antonis Geralis +[bindings] REDESIGNED: Add binding link to name, instead of separate column (#3995) by @Carmine Pietroluongo +[bindings] UPDATED: h-raylib (#4378) by @Anand Swaroop +[bindings] UPDATED: Raylib.lean, to master version (#4337) by @Daniil Kisel +[bindings] UPDATED: raybit, to latest master (#4311) by @Alex +[bindings] UPDATED: dray binding (#4163) by @red thing +[bindings] UPDATED: Julia (#4068) by @ShalokShalom +[bindings] UPDATED: nim to latest master (#3999) by @Antonis Geralis +[bindings] UPDATED: raylib-rs (#3991) by @IoIxD +[bindings] UPDATED: raylib-zig version (#3902) by @Nikolas +[bindings] UPDATED: raylib-odin (#3868) by @joyousblunder +[bindings] UPDATED: Raylib VAPI (#3829) by @Alex Macafee +[bindings] UPDATED: Raylib-cs (#3774) by @Brandon Baker +[bindings] UPDATED: h-raylib (#3739) by @Anand Swaroop +[bindings] UPDATED: OCaml bindings version (#3730) by @Tobias Mock +[bindings] UPDATED: Raylib.c3 (#3689) by @Kenta +[bindings] UPDATED: ray-cyber to 5.0 (#3654) by @fubark +[bindings] UPDATED: raylib-freebasic binding (#3591) by @WIITD +[bindings] UPDATED: SmallBASIC (#3562) by @Chris Warren-Smith +[bindings] UPDATED: Python raylib-py v5.0.0beta1 (#3557) by @Jorge A. Gomes +[bindings] UPDATED: raylib-d binding (#3561) by @Steven Schveighoffer +[bindings] UPDATED: Janet (#3553) by @Dmitry Matveyev +[bindings] UPDATED: Raylib.nelua (#3552) by @Auz +[bindings] UPDATED: raylib-cpp to 5.0 (#3551) by @Rob Loach +[bindings] UPDATED: Pascal binding (#3548) by @Gunko Vadim +[external] REVIEWED: rl_gputex, correctly load mipmaps from DDS files (#4399) by @Nikolas +[external] REVIEWED: stb_image_resize2, dix vld1q_f16 undeclared in arm (#4309) by @masnm +[external] REVIEWED: miniaudio, fix library and Makefile for NetBSD (#4212) by @NishiOwO +[external] REVIEWED: raygui, update to latest version 4.5-dev (#4238) by @Anthony Carbajal +[external] REVIEWED: jar_xml, replace unicode characters by ascii characters to avoid warning in MSVC (#4196) by @Rico P +[external] REVIEWED: vox_loader, normals and new voxels shader (#3843) by @johann nadalutti +[parser] REVIEWED: README.md, to mirror fixed help text (#4336) by @Daniil Kisel +[parser] REVIEWED: Fix seg fault with long comment lines (#4306) by @Chris Warren-Smith +[parser] REVIEWED: Don't crash for files that don't end in newlines (#3981) by @Peter0x44 +[parser] REVIEWED: Issues in usage example help text (#4084) by @Peter0x44 +[parser] REVIEWED: Fix parsing of empty parentheses (#3974) by @Filyus +[parser] REVIEWED: Address parsing issue when generating XML #3893 by @Ray +[parser] REVIEWED: `MemoryCopy()`, prevent buffer overflow by replacing hard-coded arguments (#4011) by @avx0 +[misc] ADDED: Create logo/raylib.icns by @Ray +[misc] ADDED: Create logo/raylib_1024x1024.png by @Ray +[misc] ADDED: Default vertex/fragment shader for OpenGL ES 3.0 (#4178) by @Lázaro Albuquerque +[misc] REVIEWED: README.md, fix Reddit badge (#4136) by @Ninad Sachania +[misc] REVIEWED: .gitignore, ignore compiled dll binaries (#3628) by @2Bear +[misc] REVIEWED: Fix undesired scrollbars on web shell files (#4104) by @jspast +[misc] REVIEWED: Made comments on raylib.h match comments in rcamera.h (#3942) by @Tomas Fabrizio Orsi +[misc] REVIEWED: Make raylib/raygui work better on touchscreen (#3728) by @Hongyu Ouyang +[misc] REVIEWED: Update config.h by @Ray ------------------------------------------------------------------------- Release: raylib 5.0 - 10th Anniversary Edition (18 November 2023) From ea81436befffe16b2898c6f0874a16525c2a1afe Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 00:14:36 +0200 Subject: [PATCH 022/155] Update CHANGELOG --- CHANGELOG | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d215dcbc4..e78f26c93 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,10 +10,13 @@ KEY CHANGES: - New rcore backend: RGFW - New raylib project creator tool - New platforms supported: Dreamcast, N64, PSP, PSVita, PS4 - - GPU Skinning (all platforms and GPU versions) + - GPU Skinning (all platforms and GL versions) - raymath C++ operators Detailed changes: + +WIP: Last update with commit from 21-Oct-2024 + [rcore] ADDED: Working directory info at initialization by @Ray [rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray [rcore] ADDED: `ComputeSHA1()` (#4390) by @Anthony Carbajal From 00c1f0836becda57e10917ca64cbf743ff0d8069 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 01:35:37 +0200 Subject: [PATCH 023/155] Update Makefile --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 137c28b53..15ec74634 100644 --- a/src/Makefile +++ b/src/Makefile @@ -184,8 +184,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) EMSDK_PATH ?= C:/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH := $(EMSDK_PATH)/upstream/bin - PYTHON_PATH := $(EMSDK_PATH)/python/3.9.2-1_64bit - NODE_PATH := $(EMSDK_PATH)/node/14.15.5_64bit/bin + PYTHON_PATH := $(EMSDK_PATH)/python/3.9.2-nuget_64bit + NODE_PATH := $(EMSDK_PATH)/node/20.18.0_64bit/bin export PATH := $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:/raylib/MinGW/bin;$(PATH) endif endif From eb04154c98616f0355b0035945a58fa7b56d59e2 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 01:35:44 +0200 Subject: [PATCH 024/155] Update Makefile --- examples/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Makefile b/examples/Makefile index 65ee4fb80..cf4c3b389 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -197,7 +197,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) - MAKE = emmake make + MAKE = mingw32-make endif # Define compiler flags: CFLAGS From 0b650f62a6d185bc56970b3d8a0f8e1830bc3a2d Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 24 Oct 2024 00:06:24 -0700 Subject: [PATCH 025/155] [RTEXTURES] Remove the panorama cubemap layout option (#4425) * Remove the panorama cubemap layout, it was not implemented. Left a todo in the code for some aspiring developer to finish. * Update raylib_api.* by CI --------- Co-authored-by: github-actions[bot] --- parser/output/raylib_api.json | 5 ----- parser/output/raylib_api.lua | 5 ----- parser/output/raylib_api.txt | 3 +-- parser/output/raylib_api.xml | 3 +-- src/raylib.h | 3 +-- src/rtextures.c | 8 +++----- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 9db3d7ac0..948ff45e7 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -2839,11 +2839,6 @@ "name": "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE", "value": 4, "description": "Layout is defined by a 4x3 cross with cubemap faces" - }, - { - "name": "CUBEMAP_LAYOUT_PANORAMA", - "value": 5, - "description": "Layout is defined by a panorama image (equirrectangular map)" } ] }, diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d5492cb9b..fb16decc4 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -2839,11 +2839,6 @@ return { name = "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE", value = 4, description = "Layout is defined by a 4x3 cross with cubemap faces" - }, - { - name = "CUBEMAP_LAYOUT_PANORAMA", - value = 5, - description = "Layout is defined by a panorama image (equirrectangular map)" } } }, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index f6c79f85e..2c107a894 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -889,7 +889,7 @@ Enum 14: TextureWrap (4 values) Value[TEXTURE_WRAP_CLAMP]: 1 Value[TEXTURE_WRAP_MIRROR_REPEAT]: 2 Value[TEXTURE_WRAP_MIRROR_CLAMP]: 3 -Enum 15: CubemapLayout (6 values) +Enum 15: CubemapLayout (5 values) Name: CubemapLayout Description: Cubemap layouts Value[CUBEMAP_LAYOUT_AUTO_DETECT]: 0 @@ -897,7 +897,6 @@ Enum 15: CubemapLayout (6 values) Value[CUBEMAP_LAYOUT_LINE_HORIZONTAL]: 2 Value[CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR]: 3 Value[CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE]: 4 - Value[CUBEMAP_LAYOUT_PANORAMA]: 5 Enum 16: FontType (3 values) Name: FontType Description: Font type, defines generation method diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 6de5933d4..29689bf69 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -595,13 +595,12 @@ - + - diff --git a/src/raylib.h b/src/raylib.h index 536b441b4..aceb458ce 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -877,8 +877,7 @@ typedef enum { CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by a horizontal line with faces CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces - CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirrectangular map) + CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE // Layout is defined by a 4x3 cross with cubemap faces } CubemapLayout; // Font type, defines generation method diff --git a/src/rtextures.c b/src/rtextures.c index 23b32c1b8..ca3ad0990 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4100,7 +4100,6 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) { if ((image.width/6) == image.height) { layout = CUBEMAP_LAYOUT_LINE_HORIZONTAL; cubemap.width = image.width/6; } else if ((image.width/4) == (image.height/3)) { layout = CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE; cubemap.width = image.width/4; } - else if (image.width >= (int)((float)image.height*1.85f)) { layout = CUBEMAP_LAYOUT_PANORAMA; cubemap.width = image.width/4; } } else if (image.height > image.width) { @@ -4114,7 +4113,6 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) if (layout == CUBEMAP_LAYOUT_LINE_HORIZONTAL) cubemap.width = image.width/6; if (layout == CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR) cubemap.width = image.width/3; if (layout == CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE) cubemap.width = image.width/4; - if (layout == CUBEMAP_LAYOUT_PANORAMA) cubemap.width = image.width/4; } cubemap.height = cubemap.width; @@ -4133,11 +4131,11 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) { faces = ImageCopy(image); // Image data already follows expected convention } - else if (layout == CUBEMAP_LAYOUT_PANORAMA) + /*else if (layout == CUBEMAP_LAYOUT_PANORAMA) { - // TODO: Convert panorama image to square faces... + // TODO: implement panorama by converting image to square faces... // Ref: https://github.com/denivip/panorama/blob/master/panorama.cpp - } + } */ else { if (layout == CUBEMAP_LAYOUT_LINE_HORIZONTAL) for (int i = 0; i < 6; i++) faceRecs[i].x = (float)size*i; From f80a44c7294e1fe3e0a4c54d97a450c2981f6074 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 09:58:37 +0200 Subject: [PATCH 026/155] Update HISTORY.md --- HISTORY.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 035054dbe..555e81b38 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -471,3 +471,20 @@ Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/ray 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!** :) + +notes on raylib 5.5 +------------------- + +It's been **1 year** since latest raylib release and **11 years** since raylib 1.0 was officially released... + +Some numbers for this release: + + - **+260** closed issues (for a TOTAL of **+1800**!) + - **+700** commits since previous RELEASE (for a TOTAL of **+7670**!) + - **+30** functions ADDED to raylib API (for a TOTAL of **580**!) + - **+110** functions REVIEWED with fixes and improvements + - **+135** new contributors (for a TOTAL of **+635**!) + +Highlights for `raylib 5.5`: + +TODO. From 4abc6c39897755d01e4c620d56944ea4a3b47f60 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 09:59:21 +0200 Subject: [PATCH 027/155] Update CHANGELOG --- CHANGELOG | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e78f26c93..da66bf6a9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,12 +24,12 @@ WIP: Last update with commit from 21-Oct-2024 [rcore] ADDED: `GetKeyName()` (#4161) by @MrScautHD [rcore] ADDED: `IsFileNameValid()` by @Ray [rcore] ADDED: `GetViewRay()`, viewport independent raycast (#3709) by @Luís Almeida -[rcore] ADDED: Directory filtering to `LoadDirectoryFilesEx()`/`ScanDirectoryFiles()` (#4302) by @foxblock [rcore] RENAMED: `GetMouseRay()` to `GetScreenToWorldRay()` (#3830) by @Ray [rcore] RENAMED: `GetViewRay()` to `GetScreenToWorldRayEx()` (#3830) by @Ray [rcore] REVIEWED: `GetApplicationDirectory()` for FreeBSD (#4318) by @base +[rcore] REVIEWED: `LoadDirectoryFilesEx()`/`ScanDirectoryFiles()`, support directory on filter (#4302) by @foxblock [rcore] REVIEWED: Update comments on fullscreen and boderless window to describe what they do (#4280) by @Jeffery Myers -[rcore] REVIEWED: Automation events mouse wheel #4263 by @Ray +[rcore] REVIEWED: Correct processing of mouse wheel on Automation events #4263 by @Ray [rcore] REVIEWED: Fix gamepad axis movement and its automation event recording (#4184) by @maxmutant [rcore] REVIEWED: Do not set RL_TEXTURE_FILTER_LINEAR when high dpi flag is enabled (#4189) by @Dave Green [rcore] REVIEWED: `GetScreenWidth()`/`GetScreenHeight()` (#4074) by @Anthony Carbajal @@ -194,6 +194,7 @@ WIP: Last update with commit from 21-Oct-2024 [rtext] ADDED: BDF fonts support (#3735) by @Stanley Fuller -WARNING- [rtext] ADDED: `TextToCamel()` (#4033) by @IoIxD [rtext] ADDED: `TextToSnake()` (#4033) by @IoIxD +[rtext] ADDED: `TextToFloat()` (#3627) by @Benjamin Schmid Ties [rtext] REDESIGNED: `SetTextLineSpacing()` by @Ray -WARNING- [rtext] REVIEWED: `LoadFontDataBDF()` name and formating by @Ray [rtext] REVIEWED: `LoadFontDefault()`, initialize glyphs and recs to zero #4319 by @Ray From 2072b4fa04eedcb181dea7545ad675464a11c02d Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 09:59:54 +0200 Subject: [PATCH 028/155] Update raylib.h --- src/raylib.h | 60 +++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index aceb458ce..c5d1912e4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,22 +1,22 @@ /********************************************************************************************** * -* raylib v5.5-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) +* raylib v5.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) * * FEATURES: * - NO external dependencies, all required libraries included with raylib * - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, * MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5. * - Written in plain C code (C99) in PascalCase/camelCase notation -* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES2 - choose at compile) +* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3, ES2, ES3 - choose at compile) * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] -* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) +* - Multiple Fonts formats supported (TTF, OTF, FNT, BDF, Sprite fonts) * - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) * - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! * - Flexible Materials system, supporting classic maps and PBR maps -* - Animated 3D models supported (skeletal bones animation) (IQM) +* - Animated 3D models supported (skeletal bones animation) (IQM, M3D, GLTF) * - Shaders support, including Model shaders and Postprocessing shaders * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] -* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) +* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, QOA, XM, MOD) * - VR stereo rendering with configurable HMD device parameters * - Bindings to multiple programming languages available! * @@ -27,29 +27,35 @@ * - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) * * DEPENDENCIES (included): -* [rcore] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) -* [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) +* [rcore][GLFW] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input +* [rcore][RGFW] rgfw (ColleagueRiley - github.com/ColleagueRiley/RGFW) for window/context management and input +* [rlgl] glad/glad_gles2 (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading * [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management * * OPTIONAL DEPENDENCIES (included): * [rcore] msf_gif (Miles Fogle) for GIF recording * [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorithm * [rcore] sdefl (Micha Mettke) for DEFLATE compression algorithm +* [rcore] rprand (Ramon Snatamaria) for pseudo-random numbers generation +* [rtextures] qoi (Dominic Szablewski - https://phoboslab.org) for QOI image manage * [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) * [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG) -* [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms +* [rtextures] stb_image_resize2 (Sean Barret) for image resizing algorithms +* [rtextures] stb_perlin (Sean Barret) for Perlin Noise image generation * [rtext] stb_truetype (Sean Barret) for ttf fonts loading * [rtext] stb_rect_pack (Sean Barret) for rectangles packing * [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation * [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) * [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF) -* [rmodels] Model3D (bzt) for models loading (M3D, https://bztsrc.gitlab.io/model3d) +* [rmodels] m3d (bzt) for models loading (M3D, https://bztsrc.gitlab.io/model3d) +* [rmodels] vox_loader (Johann Nadalutti) for models loading (VOX) * [raudio] dr_wav (David Reid) for WAV audio file loading * [raudio] dr_flac (David Reid) for FLAC audio file loading * [raudio] dr_mp3 (David Reid) for MP3 audio file loading * [raudio] stb_vorbis (Sean Barret) for OGG audio loading * [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading * [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading +* [raudio] qoa (Dominic Szablewski - https://phoboslab.org) for QOA audio manage * * * LICENSE: zlib/libpng @@ -84,7 +90,7 @@ #define RAYLIB_VERSION_MAJOR 5 #define RAYLIB_VERSION_MINOR 5 #define RAYLIB_VERSION_PATCH 0 -#define RAYLIB_VERSION "5.5-dev" +#define RAYLIB_VERSION "5.5" // Function specifiers in case library is build/used as a shared library // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll @@ -964,29 +970,29 @@ RLAPI void CloseWindow(void); // Close windo RLAPI bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen -RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden +RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized +RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized +RLAPI bool IsWindowFocused(void); // Check if window is currently focused RLAPI bool IsWindowResized(void); // Check if window has been resized last frame RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled -RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) +RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags -RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP) -RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP) -RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) -RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) -RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) -RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) -RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) -RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) -RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed, resizes monitor to match window resolution +RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution +RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable +RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable +RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized +RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit) +RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit) +RLAPI void SetWindowTitle(const char *title); // Set title for window +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowMaxSize(int width, int height); // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) -RLAPI void SetWindowFocused(void); // Set window focused (only PLATFORM_DESKTOP) +RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] +RLAPI void SetWindowFocused(void); // Set window focused RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height @@ -1164,7 +1170,7 @@ RLAPI void PlayAutomationEvent(AutomationEvent event); // Input-related functions: keyboard RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again (Only PLATFORM_DESKTOP) +RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again RLAPI bool IsKeyDown(int key); // Check if a key is being pressed RLAPI bool IsKeyReleased(int key); // Check if a key has been released once RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed From c6a58d974429e57deb244828c63f13e8bff59cf5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Oct 2024 08:00:11 +0000 Subject: [PATCH 029/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 36 +++++++++++++++++------------------ parser/output/raylib_api.lua | 36 +++++++++++++++++------------------ parser/output/raylib_api.txt | 36 +++++++++++++++++------------------ parser/output/raylib_api.xml | 36 +++++++++++++++++------------------ 4 files changed, 72 insertions(+), 72 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 948ff45e7..34474bdf4 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -27,7 +27,7 @@ { "name": "RAYLIB_VERSION", "type": "STRING", - "value": "5.5-dev", + "value": "5.5", "description": "" }, { @@ -3177,22 +3177,22 @@ }, { "name": "IsWindowHidden", - "description": "Check if window is currently hidden (only PLATFORM_DESKTOP)", + "description": "Check if window is currently hidden", "returnType": "bool" }, { "name": "IsWindowMinimized", - "description": "Check if window is currently minimized (only PLATFORM_DESKTOP)", + "description": "Check if window is currently minimized", "returnType": "bool" }, { "name": "IsWindowMaximized", - "description": "Check if window is currently maximized (only PLATFORM_DESKTOP)", + "description": "Check if window is currently maximized", "returnType": "bool" }, { "name": "IsWindowFocused", - "description": "Check if window is currently focused (only PLATFORM_DESKTOP)", + "description": "Check if window is currently focused", "returnType": "bool" }, { @@ -3213,7 +3213,7 @@ }, { "name": "SetWindowState", - "description": "Set window configuration state using flags (only PLATFORM_DESKTOP)", + "description": "Set window configuration state using flags", "returnType": "void", "params": [ { @@ -3235,32 +3235,32 @@ }, { "name": "ToggleFullscreen", - "description": "Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP)", + "description": "Toggle window state: fullscreen/windowed, resizes monitor to match window resolution", "returnType": "void" }, { "name": "ToggleBorderlessWindowed", - "description": "Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP)", + "description": "Toggle window state: borderless windowed, resizes window to match monitor resolution", "returnType": "void" }, { "name": "MaximizeWindow", - "description": "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)", + "description": "Set window state: maximized, if resizable", "returnType": "void" }, { "name": "MinimizeWindow", - "description": "Set window state: minimized, if resizable (only PLATFORM_DESKTOP)", + "description": "Set window state: minimized, if resizable", "returnType": "void" }, { "name": "RestoreWindow", - "description": "Set window state: not minimized/maximized (only PLATFORM_DESKTOP)", + "description": "Set window state: not minimized/maximized", "returnType": "void" }, { "name": "SetWindowIcon", - "description": "Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)", + "description": "Set icon for window (single image, RGBA 32bit)", "returnType": "void", "params": [ { @@ -3271,7 +3271,7 @@ }, { "name": "SetWindowIcons", - "description": "Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)", + "description": "Set icon for window (multiple images, RGBA 32bit)", "returnType": "void", "params": [ { @@ -3286,7 +3286,7 @@ }, { "name": "SetWindowTitle", - "description": "Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)", + "description": "Set title for window", "returnType": "void", "params": [ { @@ -3297,7 +3297,7 @@ }, { "name": "SetWindowPosition", - "description": "Set window position on screen (only PLATFORM_DESKTOP)", + "description": "Set window position on screen", "returnType": "void", "params": [ { @@ -3368,7 +3368,7 @@ }, { "name": "SetWindowOpacity", - "description": "Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)", + "description": "Set window opacity [0.0f..1.0f]", "returnType": "void", "params": [ { @@ -3379,7 +3379,7 @@ }, { "name": "SetWindowFocused", - "description": "Set window focused (only PLATFORM_DESKTOP)", + "description": "Set window focused", "returnType": "void" }, { @@ -4824,7 +4824,7 @@ }, { "name": "IsKeyPressedRepeat", - "description": "Check if a key has been pressed again (Only PLATFORM_DESKTOP)", + "description": "Check if a key has been pressed again", "returnType": "bool", "params": [ { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index fb16decc4..dfdf69147 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -27,7 +27,7 @@ return { { name = "RAYLIB_VERSION", type = "STRING", - value = "5.5-dev", + value = "5.5", description = "" }, { @@ -3129,22 +3129,22 @@ return { }, { name = "IsWindowHidden", - description = "Check if window is currently hidden (only PLATFORM_DESKTOP)", + description = "Check if window is currently hidden", returnType = "bool" }, { name = "IsWindowMinimized", - description = "Check if window is currently minimized (only PLATFORM_DESKTOP)", + description = "Check if window is currently minimized", returnType = "bool" }, { name = "IsWindowMaximized", - description = "Check if window is currently maximized (only PLATFORM_DESKTOP)", + description = "Check if window is currently maximized", returnType = "bool" }, { name = "IsWindowFocused", - description = "Check if window is currently focused (only PLATFORM_DESKTOP)", + description = "Check if window is currently focused", returnType = "bool" }, { @@ -3162,7 +3162,7 @@ return { }, { name = "SetWindowState", - description = "Set window configuration state using flags (only PLATFORM_DESKTOP)", + description = "Set window configuration state using flags", returnType = "void", params = { {type = "unsigned int", name = "flags"} @@ -3178,32 +3178,32 @@ return { }, { name = "ToggleFullscreen", - description = "Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP)", + description = "Toggle window state: fullscreen/windowed, resizes monitor to match window resolution", returnType = "void" }, { name = "ToggleBorderlessWindowed", - description = "Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP)", + description = "Toggle window state: borderless windowed, resizes window to match monitor resolution", returnType = "void" }, { name = "MaximizeWindow", - description = "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)", + description = "Set window state: maximized, if resizable", returnType = "void" }, { name = "MinimizeWindow", - description = "Set window state: minimized, if resizable (only PLATFORM_DESKTOP)", + description = "Set window state: minimized, if resizable", returnType = "void" }, { name = "RestoreWindow", - description = "Set window state: not minimized/maximized (only PLATFORM_DESKTOP)", + description = "Set window state: not minimized/maximized", returnType = "void" }, { name = "SetWindowIcon", - description = "Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)", + description = "Set icon for window (single image, RGBA 32bit)", returnType = "void", params = { {type = "Image", name = "image"} @@ -3211,7 +3211,7 @@ return { }, { name = "SetWindowIcons", - description = "Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)", + description = "Set icon for window (multiple images, RGBA 32bit)", returnType = "void", params = { {type = "Image *", name = "images"}, @@ -3220,7 +3220,7 @@ return { }, { name = "SetWindowTitle", - description = "Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)", + description = "Set title for window", returnType = "void", params = { {type = "const char *", name = "title"} @@ -3228,7 +3228,7 @@ return { }, { name = "SetWindowPosition", - description = "Set window position on screen (only PLATFORM_DESKTOP)", + description = "Set window position on screen", returnType = "void", params = { {type = "int", name = "x"}, @@ -3272,7 +3272,7 @@ return { }, { name = "SetWindowOpacity", - description = "Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)", + description = "Set window opacity [0.0f..1.0f]", returnType = "void", params = { {type = "float", name = "opacity"} @@ -3280,7 +3280,7 @@ return { }, { name = "SetWindowFocused", - description = "Set window focused (only PLATFORM_DESKTOP)", + description = "Set window focused", returnType = "void" }, { @@ -4281,7 +4281,7 @@ return { }, { name = "IsKeyPressedRepeat", - description = "Check if a key has been pressed again (Only PLATFORM_DESKTOP)", + description = "Check if a key has been pressed again", returnType = "bool", params = { {type = "int", name = "key"} diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 2c107a894..d2f70fe39 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -24,7 +24,7 @@ Define 004: RAYLIB_VERSION_PATCH Define 005: RAYLIB_VERSION Name: RAYLIB_VERSION Type: STRING - Value: "5.5-dev" + Value: "5.5" Description: Define 006: __declspec(x) Name: __declspec(x) @@ -1020,22 +1020,22 @@ Function 005: IsWindowFullscreen() (0 input parameters) Function 006: IsWindowHidden() (0 input parameters) Name: IsWindowHidden Return type: bool - Description: Check if window is currently hidden (only PLATFORM_DESKTOP) + Description: Check if window is currently hidden No input parameters Function 007: IsWindowMinimized() (0 input parameters) Name: IsWindowMinimized Return type: bool - Description: Check if window is currently minimized (only PLATFORM_DESKTOP) + Description: Check if window is currently minimized No input parameters Function 008: IsWindowMaximized() (0 input parameters) Name: IsWindowMaximized Return type: bool - Description: Check if window is currently maximized (only PLATFORM_DESKTOP) + Description: Check if window is currently maximized No input parameters Function 009: IsWindowFocused() (0 input parameters) Name: IsWindowFocused Return type: bool - Description: Check if window is currently focused (only PLATFORM_DESKTOP) + Description: Check if window is currently focused No input parameters Function 010: IsWindowResized() (0 input parameters) Name: IsWindowResized @@ -1050,7 +1050,7 @@ Function 011: IsWindowState() (1 input parameters) Function 012: SetWindowState() (1 input parameters) Name: SetWindowState Return type: void - Description: Set window configuration state using flags (only PLATFORM_DESKTOP) + Description: Set window configuration state using flags Param[1]: flags (type: unsigned int) Function 013: ClearWindowState() (1 input parameters) Name: ClearWindowState @@ -1060,48 +1060,48 @@ Function 013: ClearWindowState() (1 input parameters) Function 014: ToggleFullscreen() (0 input parameters) Name: ToggleFullscreen Return type: void - Description: Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP) + Description: Toggle window state: fullscreen/windowed, resizes monitor to match window resolution No input parameters Function 015: ToggleBorderlessWindowed() (0 input parameters) Name: ToggleBorderlessWindowed Return type: void - Description: Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP) + Description: Toggle window state: borderless windowed, resizes window to match monitor resolution No input parameters Function 016: MaximizeWindow() (0 input parameters) Name: MaximizeWindow Return type: void - Description: Set window state: maximized, if resizable (only PLATFORM_DESKTOP) + Description: Set window state: maximized, if resizable No input parameters Function 017: MinimizeWindow() (0 input parameters) Name: MinimizeWindow Return type: void - Description: Set window state: minimized, if resizable (only PLATFORM_DESKTOP) + Description: Set window state: minimized, if resizable No input parameters Function 018: RestoreWindow() (0 input parameters) Name: RestoreWindow Return type: void - Description: Set window state: not minimized/maximized (only PLATFORM_DESKTOP) + Description: Set window state: not minimized/maximized No input parameters Function 019: SetWindowIcon() (1 input parameters) Name: SetWindowIcon Return type: void - Description: Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) + Description: Set icon for window (single image, RGBA 32bit) Param[1]: image (type: Image) Function 020: SetWindowIcons() (2 input parameters) Name: SetWindowIcons Return type: void - Description: Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) + Description: Set icon for window (multiple images, RGBA 32bit) Param[1]: images (type: Image *) Param[2]: count (type: int) Function 021: SetWindowTitle() (1 input parameters) Name: SetWindowTitle Return type: void - Description: Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) + Description: Set title for window Param[1]: title (type: const char *) Function 022: SetWindowPosition() (2 input parameters) Name: SetWindowPosition Return type: void - Description: Set window position on screen (only PLATFORM_DESKTOP) + Description: Set window position on screen Param[1]: x (type: int) Param[2]: y (type: int) Function 023: SetWindowMonitor() (1 input parameters) @@ -1130,12 +1130,12 @@ Function 026: SetWindowSize() (2 input parameters) Function 027: SetWindowOpacity() (1 input parameters) Name: SetWindowOpacity Return type: void - Description: Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) + Description: Set window opacity [0.0f..1.0f] Param[1]: opacity (type: float) Function 028: SetWindowFocused() (0 input parameters) Name: SetWindowFocused Return type: void - Description: Set window focused (only PLATFORM_DESKTOP) + Description: Set window focused No input parameters Function 029: GetWindowHandle() (0 input parameters) Name: GetWindowHandle @@ -1854,7 +1854,7 @@ Function 160: IsKeyPressed() (1 input parameters) Function 161: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool - Description: Check if a key has been pressed again (Only PLATFORM_DESKTOP) + Description: Check if a key has been pressed again Param[1]: key (type: int) Function 162: IsKeyDown() (1 input parameters) Name: IsKeyDown diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 29689bf69..11e4dc7f4 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -5,7 +5,7 @@ - + @@ -688,46 +688,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -746,10 +746,10 @@ - + - + @@ -1163,7 +1163,7 @@ - + From 0f5e76f91fc51ccc647766bbbded47d1f51a0ea8 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 10:00:57 +0200 Subject: [PATCH 030/155] Update CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index da66bf6a9..7ec73066f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,7 +4,7 @@ changelog Current Release: raylib 5.0 (18 November 2023) ------------------------------------------------------------------------- -Release: raylib 5.5 - 11th Anniversary Edition? (18 November 2024?) +Release: raylib 5.5 (November 2024?) ------------------------------------------------------------------------- KEY CHANGES: - New rcore backend: RGFW From d85c6fe2c05dea42efbe036de9d36fb6a3660dd1 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 11:50:30 +0200 Subject: [PATCH 031/155] 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 c5d1912e4..e850fbc08 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -999,7 +999,7 @@ RLAPI int GetScreenHeight(void); // Get current RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) RLAPI int GetMonitorCount(void); // Get number of connected monitors -RLAPI int GetCurrentMonitor(void); // Get current connected monitor +RLAPI int GetCurrentMonitor(void); // Get primary system monitor RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor) RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor) From 5706cfd600f141fe08963a7ed191a2d22673b6ab Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 11:50:42 +0200 Subject: [PATCH 032/155] Update Makefile --- src/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 15ec74634..84be9f5a0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -230,8 +230,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) endif # Define raylib graphics api depending on selected platform +# NOTE: By default use OpenGL 3.3 on desktop platforms ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) - # By default use OpenGL 3.3 on desktop platforms GRAPHICS ?= GRAPHICS_API_OPENGL_33 #GRAPHICS = GRAPHICS_API_OPENGL_11 # Uncomment to use OpenGL 1.1 #GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1 @@ -239,11 +239,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) #GRAPHICS = GRAPHICS_API_OPENGL_ES2 # Uncomment to use OpenGL ES 2.0 (ANGLE) endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) - # By default use OpenGL 3.3 on desktop platform with SDL backend GRAPHICS ?= GRAPHICS_API_OPENGL_33 endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) - # By default use OpenGL 3.3 on desktop platforms GRAPHICS ?= GRAPHICS_API_OPENGL_33 #GRAPHICS = GRAPHICS_API_OPENGL_11 # Uncomment to use OpenGL 1.1 #GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1 @@ -257,7 +255,7 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) # On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0 GRAPHICS = GRAPHICS_API_OPENGL_ES2 - #GRAPHICS = GRAPHICS_API_OPENGL_ES3 # Uncomment to use ES3/WebGL2 (preliminary support). + #GRAPHICS = GRAPHICS_API_OPENGL_ES3 # Uncomment to use ES3/WebGL2 (preliminary support) endif ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) # By default use OpenGL ES 2.0 on Android From b0e77c7afd8a2dc62025080bbe89ec1a5ecffd40 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Oct 2024 09:50:59 +0000 Subject: [PATCH 033/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 2 +- parser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 34474bdf4..f171a7900 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3414,7 +3414,7 @@ }, { "name": "GetCurrentMonitor", - "description": "Get current connected monitor", + "description": "Get primary system monitor", "returnType": "int" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index dfdf69147..b1a379aa7 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3315,7 +3315,7 @@ return { }, { name = "GetCurrentMonitor", - description = "Get current connected monitor", + description = "Get primary system monitor", returnType = "int" }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index d2f70fe39..e099f3ba4 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1170,7 +1170,7 @@ Function 034: GetMonitorCount() (0 input parameters) Function 035: GetCurrentMonitor() (0 input parameters) Name: GetCurrentMonitor Return type: int - Description: Get current connected monitor + Description: Get primary system monitor No input parameters Function 036: GetMonitorPosition() (1 input parameters) Name: GetMonitorPosition diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 11e4dc7f4..a43600961 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -763,7 +763,7 @@ - + From 3483a4d9cb4fecbe9313f80e53890e3911f663f7 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 11:57:36 +0200 Subject: [PATCH 034/155] 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 e850fbc08..bc7bc372c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -999,7 +999,7 @@ RLAPI int GetScreenHeight(void); // Get current RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) RLAPI int GetMonitorCount(void); // Get number of connected monitors -RLAPI int GetCurrentMonitor(void); // Get primary system monitor +RLAPI int GetCurrentMonitor(void); // Get current monitor where window is placed RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor) RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor) From 865265b83226037f93c0c9c3115730500283342d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Oct 2024 09:58:05 +0000 Subject: [PATCH 035/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 2 +- parser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index f171a7900..47ede2e5a 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3414,7 +3414,7 @@ }, { "name": "GetCurrentMonitor", - "description": "Get primary system monitor", + "description": "Get current monitor where window is placed", "returnType": "int" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index b1a379aa7..20f2a8f0c 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3315,7 +3315,7 @@ return { }, { name = "GetCurrentMonitor", - description = "Get primary system monitor", + description = "Get current monitor where window is placed", returnType = "int" }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index e099f3ba4..e409a0116 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1170,7 +1170,7 @@ Function 034: GetMonitorCount() (0 input parameters) Function 035: GetCurrentMonitor() (0 input parameters) Name: GetCurrentMonitor Return type: int - Description: Get primary system monitor + Description: Get current monitor where window is placed No input parameters Function 036: GetMonitorPosition() (1 input parameters) Name: GetMonitorPosition diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index a43600961..9ab4b52cc 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -763,7 +763,7 @@ - + From b0140b876bf3670034bba67b1de2c5248d51a456 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 12:25:05 +0200 Subject: [PATCH 036/155] REVIEWED: GPU skninning on Web, some gotchas! #4412 --- examples/Makefile | 4 +-- examples/Makefile.Web | 11 +++++-- .../resources/shaders/glsl100/skinning.vs | 30 ++++++++++++++++--- src/rlgl.h | 8 +++-- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index cf4c3b389..be9751db1 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -157,8 +157,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) EMSDK_PATH ?= C:/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin - PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit - NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin + PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit + NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH) endif endif diff --git a/examples/Makefile.Web b/examples/Makefile.Web index f6c8b785a..5155458e0 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -110,8 +110,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB) EMSDK_PATH ?= C:/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin - PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit - NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin + PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit + NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH) endif endif @@ -434,6 +434,7 @@ TEXT = \ MODELS = \ models/models_animation \ + models/models_gpu_skinning \ models/models_billboard \ models/models_box_collisions \ models/models_cubicmap \ @@ -853,6 +854,12 @@ models/models_animation: models/models_animation.c --preload-file models/resources/models/iqm/guy.iqm@resources/models/iqm/guy.iqm \ --preload-file models/resources/models/iqm/guytex.png@resources/models/iqm/guytex.png \ --preload-file models/resources/models/iqm/guyanim.iqm@resources/models/iqm/guyanim.iqm + +models/models_gpu_skinning: models/models_gpu_skinning.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ + --preload-file models/resources/models/gltf/greenman.glb@resources/models/gltf/greenman.glb \ + --preload-file models/resources/shaders/glsl100/skinning.vs@resources/shaders/glsl100/skinning.vs \ + --preload-file models/resources/shaders/glsl100/skinning.fs@resources/shaders/glsl100/skinning.fs models/models_billboard: models/models_billboard.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ diff --git a/examples/models/resources/shaders/glsl100/skinning.vs b/examples/models/resources/shaders/glsl100/skinning.vs index f7b6d8fb2..627a7dda4 100644 --- a/examples/models/resources/shaders/glsl100/skinning.vs +++ b/examples/models/resources/shaders/glsl100/skinning.vs @@ -24,11 +24,33 @@ void main() int boneIndex2 = int(vertexBoneIds.z); int boneIndex3 = int(vertexBoneIds.w); + // WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function + mat4 boneMatrixTransposed0 = mat4( + vec4(boneMatrices[boneIndex0][0].x, boneMatrices[boneIndex0][1].x, boneMatrices[boneIndex0][2].x, boneMatrices[boneIndex0][3].x), + vec4(boneMatrices[boneIndex0][0].y, boneMatrices[boneIndex0][1].y, boneMatrices[boneIndex0][2].y, boneMatrices[boneIndex0][3].y), + vec4(boneMatrices[boneIndex0][0].z, boneMatrices[boneIndex0][1].z, boneMatrices[boneIndex0][2].z, boneMatrices[boneIndex0][3].z), + vec4(boneMatrices[boneIndex0][0].w, boneMatrices[boneIndex0][1].w, boneMatrices[boneIndex0][2].w, boneMatrices[boneIndex0][3].w)); + mat4 boneMatrixTransposed1 = mat4( + vec4(boneMatrices[boneIndex1][0].x, boneMatrices[boneIndex1][1].x, boneMatrices[boneIndex1][2].x, boneMatrices[boneIndex1][3].x), + vec4(boneMatrices[boneIndex1][0].y, boneMatrices[boneIndex1][1].y, boneMatrices[boneIndex1][2].y, boneMatrices[boneIndex1][3].y), + vec4(boneMatrices[boneIndex1][0].z, boneMatrices[boneIndex1][1].z, boneMatrices[boneIndex1][2].z, boneMatrices[boneIndex1][3].z), + vec4(boneMatrices[boneIndex1][0].w, boneMatrices[boneIndex1][1].w, boneMatrices[boneIndex1][2].w, boneMatrices[boneIndex1][3].w)); + mat4 boneMatrixTransposed2 = mat4( + vec4(boneMatrices[boneIndex2][0].x, boneMatrices[boneIndex2][1].x, boneMatrices[boneIndex2][2].x, boneMatrices[boneIndex2][3].x), + vec4(boneMatrices[boneIndex2][0].y, boneMatrices[boneIndex2][1].y, boneMatrices[boneIndex2][2].y, boneMatrices[boneIndex2][3].y), + vec4(boneMatrices[boneIndex2][0].z, boneMatrices[boneIndex2][1].z, boneMatrices[boneIndex2][2].z, boneMatrices[boneIndex2][3].z), + vec4(boneMatrices[boneIndex2][0].w, boneMatrices[boneIndex2][1].w, boneMatrices[boneIndex2][2].w, boneMatrices[boneIndex2][3].w)); + mat4 boneMatrixTransposed3 = mat4( + vec4(boneMatrices[boneIndex3][0].x, boneMatrices[boneIndex3][1].x, boneMatrices[boneIndex3][2].x, boneMatrices[boneIndex3][3].x), + vec4(boneMatrices[boneIndex3][0].y, boneMatrices[boneIndex3][1].y, boneMatrices[boneIndex3][2].y, boneMatrices[boneIndex3][3].y), + vec4(boneMatrices[boneIndex3][0].z, boneMatrices[boneIndex3][1].z, boneMatrices[boneIndex3][2].z, boneMatrices[boneIndex3][3].z), + vec4(boneMatrices[boneIndex3][0].w, boneMatrices[boneIndex3][1].w, boneMatrices[boneIndex3][2].w, boneMatrices[boneIndex3][3].w)); + vec4 skinnedPosition = - vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0)) + - vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) + - vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) + - vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0)); + vertexBoneWeights.x*(boneMatrixTransposed0*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.y*(boneMatrixTransposed1*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.z*(boneMatrixTransposed2*vec4(vertexPosition, 1.0)) + + vertexBoneWeights.w*(boneMatrixTransposed3*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; fragColor = vertexColor; diff --git a/src/rlgl.h b/src/rlgl.h index 6cfc2dcfb..56462b8f8 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -4337,8 +4337,12 @@ void rlSetUniformMatrix(int locIndex, Matrix mat) // Set shader value uniform matrix void rlSetUniformMatrices(int locIndex, const Matrix *matrices, int count) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUniformMatrix4fv(locIndex, count, true, (const float*)matrices); +#if defined(GRAPHICS_API_OPENGL_33) + glUniformMatrix4fv(locIndex, count, true, (const float *)matrices); +#elif defined(GRAPHICS_API_OPENGL_ES2) + // WARNING: WebGL does not support Matrix transpose ("true" parameter) + // REF: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix + glUniformMatrix4fv(locIndex, count, true, (const float *)matrices); #endif } From 5065b85d33ce6d7d696b7347bad4ba1ce70a1845 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 12:45:12 +0200 Subject: [PATCH 037/155] Update rlgl.h --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 56462b8f8..3730e1702 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -4342,7 +4342,7 @@ void rlSetUniformMatrices(int locIndex, const Matrix *matrices, int count) #elif defined(GRAPHICS_API_OPENGL_ES2) // WARNING: WebGL does not support Matrix transpose ("true" parameter) // REF: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix - glUniformMatrix4fv(locIndex, count, true, (const float *)matrices); + glUniformMatrix4fv(locIndex, count, false, (const float *)matrices); #endif } From 6ff0b03629bec6452d4576e1ffdc91864ef7db03 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 12:46:02 +0200 Subject: [PATCH 038/155] REVIEWED: `UpdateModelAnimationBoneMatrices()` comments --- examples/models/models_gpu_skinning.c | 11 ++++++----- src/raylib.h | 4 ++-- src/rmodels.c | 3 +++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/examples/models/models_gpu_skinning.c b/examples/models/models_gpu_skinning.c index 6868a62d3..7e81b0d82 100644 --- a/examples/models/models_gpu_skinning.c +++ b/examples/models/models_gpu_skinning.c @@ -93,10 +93,11 @@ int main(void) BeginMode3D(camera); - // Draw character + // Draw character mesh, pose calculation is done in shader (GPU skinning) DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform); DrawGrid(10, 1.0f); + EndMode3D(); DrawText("Use the T/G to switch animation", 10, 10, 20, GRAY); @@ -107,11 +108,11 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - UnloadModelAnimations(modelAnimations, animsCount); - UnloadModel(characterModel); // Unload character model and meshes/material - UnloadShader(skinningShader); + UnloadModelAnimations(modelAnimations, animsCount); // Unload model animation + UnloadModel(characterModel); // Unload model and meshes/material + UnloadShader(skinningShader); // Unload GPU skinning shader - CloseWindow(); // Close window and OpenGL context + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; diff --git a/src/raylib.h b/src/raylib.h index bc7bc372c..c9d9f6e54 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1601,11 +1601,11 @@ RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Model animations loading/unloading functions RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU) +RLAPI void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match -RLAPI void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (Note GPU skinning does not work on Mac) // Collision detection functions RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres diff --git a/src/rmodels.c b/src/rmodels.c index 30130d9e0..ed15d9658 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2364,6 +2364,9 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) } } +// Update model animated bones transform matrices for a given frame +// NOTE: Updated data is not uploaded to GPU but kept at model.meshes[i].boneMatrices[boneId], +// to be uploaded to shader at drawing, in case GPU skinning is enabled void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame) { if ((anim.frameCount > 0) && (anim.bones != NULL) && (anim.framePoses != NULL)) From cb73970f084e73a8f76a408fab8e5376b877ecbe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Oct 2024 10:46:22 +0000 Subject: [PATCH 039/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 40 +++++++++++++++++------------------ parser/output/raylib_api.lua | 22 +++++++++---------- parser/output/raylib_api.txt | 22 +++++++++---------- parser/output/raylib_api.xml | 12 +++++------ 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 47ede2e5a..37b0a16a6 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -11069,7 +11069,26 @@ }, { "name": "UpdateModelAnimation", - "description": "Update model animation pose", + "description": "Update model animation pose (CPU)", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "ModelAnimation", + "name": "anim" + }, + { + "type": "int", + "name": "frame" + } + ] + }, + { + "name": "UpdateModelAnimationBoneMatrices", + "description": "Update model animation mesh bone matrices (GPU skinning)", "returnType": "void", "params": [ { @@ -11127,25 +11146,6 @@ } ] }, - { - "name": "UpdateModelAnimationBoneMatrices", - "description": "Update model animation mesh bone matrices (Note GPU skinning does not work on Mac)", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "ModelAnimation", - "name": "anim" - }, - { - "type": "int", - "name": "frame" - } - ] - }, { "name": "CheckCollisionSpheres", "description": "Check collision between two spheres", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 20f2a8f0c..934c08eb7 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -7598,7 +7598,17 @@ return { }, { name = "UpdateModelAnimation", - description = "Update model animation pose", + description = "Update model animation pose (CPU)", + returnType = "void", + params = { + {type = "Model", name = "model"}, + {type = "ModelAnimation", name = "anim"}, + {type = "int", name = "frame"} + } + }, + { + name = "UpdateModelAnimationBoneMatrices", + description = "Update model animation mesh bone matrices (GPU skinning)", returnType = "void", params = { {type = "Model", name = "model"}, @@ -7632,16 +7642,6 @@ return { {type = "ModelAnimation", name = "anim"} } }, - { - name = "UpdateModelAnimationBoneMatrices", - description = "Update model animation mesh bone matrices (Note GPU skinning does not work on Mac)", - returnType = "void", - params = { - {type = "Model", name = "model"}, - {type = "ModelAnimation", name = "anim"}, - {type = "int", name = "frame"} - } - }, { name = "CheckCollisionSpheres", description = "Check collision between two spheres", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index e409a0116..541b5caf3 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -4217,34 +4217,34 @@ Function 501: LoadModelAnimations() (2 input parameters) Function 502: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void - Description: Update model animation pose + Description: Update model animation pose (CPU) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 503: UnloadModelAnimation() (1 input parameters) +Function 503: UpdateModelAnimationBoneMatrices() (3 input parameters) + Name: UpdateModelAnimationBoneMatrices + Return type: void + Description: Update model animation mesh bone matrices (GPU skinning) + Param[1]: model (type: Model) + Param[2]: anim (type: ModelAnimation) + Param[3]: frame (type: int) +Function 504: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 504: UnloadModelAnimations() (2 input parameters) +Function 505: 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 505: IsModelAnimationValid() (2 input parameters) +Function 506: 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 506: UpdateModelAnimationBoneMatrices() (3 input parameters) - Name: UpdateModelAnimationBoneMatrices - Return type: void - Description: Update model animation mesh bone matrices (Note GPU skinning does not work on Mac) - Param[1]: model (type: Model) - Param[2]: anim (type: ModelAnimation) - Param[3]: frame (type: int) Function 507: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 9ab4b52cc..58794b4eb 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2821,7 +2821,12 @@ - + + + + + + @@ -2837,11 +2842,6 @@ - - - - - From 6962364bfb8f21a867e70e6a35a9bbbe255a8889 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 12:53:16 +0200 Subject: [PATCH 040/155] Update emsdk paths to latest versions --- projects/4coder/Makefile | 4 ++-- projects/VSCode/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index f2091f0e3..8e64702a6 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -117,8 +117,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB) EMSDK_PATH ?= C:/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin - PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit - NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin + PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit + NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH) endif diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 86febfba0..65a6f9544 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -120,8 +120,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB) EMSDK_PATH ?= C:/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin - PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit - NODE_PATH = $(EMSDK_PATH)/node/14.18.2_64bit/bin + PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit + NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH) endif From 385187f795bdeaf810099e004c59883a39b4d9b4 Mon Sep 17 00:00:00 2001 From: RadsammyT <32146976+RadsammyT@users.noreply.github.com> Date: Thu, 24 Oct 2024 07:08:12 -0400 Subject: [PATCH 041/155] [rshapes] Review `DrawRectangleLines()` pixel offset (#4261) * [rshapes] Remove `DrawRectangleLines()`'s + 1 offset * ... and replace it with a -/+ 0.5 offset divided by current cam's zoom. --- src/rshapes.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 1479a6f37..f62778e83 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -807,19 +807,21 @@ void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Col // but it solves another issue: https://github.com/raysan5/raylib/issues/3884 void DrawRectangleLines(int posX, int posY, int width, int height, Color color) { + Matrix mat = rlGetMatrixModelview(); + float zoomElement = 0.5f / mat.m0; rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f((float)posX, (float)posY); - rlVertex2f((float)posX + (float)width, (float)posY + 1); + rlVertex2f((float)posX - zoomElement, (float)posY); + rlVertex2f((float)posX + (float)width + zoomElement, (float)posY); - rlVertex2f((float)posX + (float)width, (float)posY + 1); - rlVertex2f((float)posX + (float)width, (float)posY + (float)height); + rlVertex2f((float)posX + (float)width, (float)posY - zoomElement); + rlVertex2f((float)posX + (float)width, (float)posY + (float)height + zoomElement); - rlVertex2f((float)posX + (float)width, (float)posY + (float)height); - rlVertex2f((float)posX + 1, (float)posY + (float)height); + rlVertex2f((float)posX + (float)width + zoomElement, (float)posY + (float)height); + rlVertex2f((float)posX - zoomElement, (float)posY + (float)height); - rlVertex2f((float)posX + 1, (float)posY + (float)height); - rlVertex2f((float)posX + 1, (float)posY + 1); + rlVertex2f((float)posX, (float)posY + (float)height + zoomElement); + rlVertex2f((float)posX, (float)posY - zoomElement); rlEnd(); } From 16368cd3539c1f9ed09e9491964d3f945072e137 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Oct 2024 13:11:39 +0200 Subject: [PATCH 042/155] REVIEWED: `DrawRectangleLines()`, considering view matrix for lines "alignment" --- src/rshapes.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index f62778e83..ece5513b3 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -808,21 +808,45 @@ void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Col void DrawRectangleLines(int posX, int posY, int width, int height, Color color) { Matrix mat = rlGetMatrixModelview(); - float zoomElement = 0.5f / mat.m0; + float zoomFactor = 0.5f/mat.m0; rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f((float)posX - zoomElement, (float)posY); - rlVertex2f((float)posX + (float)width + zoomElement, (float)posY); + rlVertex2f((float)posX - zoomFactor, (float)posY); + rlVertex2f((float)posX + (float)width + zoomFactor, (float)posY); - rlVertex2f((float)posX + (float)width, (float)posY - zoomElement); - rlVertex2f((float)posX + (float)width, (float)posY + (float)height + zoomElement); + rlVertex2f((float)posX + (float)width, (float)posY - zoomFactor); + rlVertex2f((float)posX + (float)width, (float)posY + (float)height + zoomFactor); - rlVertex2f((float)posX + (float)width + zoomElement, (float)posY + (float)height); - rlVertex2f((float)posX - zoomElement, (float)posY + (float)height); + rlVertex2f((float)posX + (float)width + zoomFactor, (float)posY + (float)height); + rlVertex2f((float)posX - zoomFactor, (float)posY + (float)height); - rlVertex2f((float)posX, (float)posY + (float)height + zoomElement); - rlVertex2f((float)posX, (float)posY - zoomElement); + rlVertex2f((float)posX, (float)posY + (float)height + zoomFactor); + rlVertex2f((float)posX, (float)posY - zoomFactor); rlEnd(); +/* +// Previous implementation, it has issues... but it does not require view matrix... +#if defined(SUPPORT_QUADS_DRAW_MODE) + DrawRectangle(posX, posY, width, 1, color); + DrawRectangle(posX + width - 1, posY + 1, 1, height - 2, color); + DrawRectangle(posX, posY + height - 1, width, 1, color); + DrawRectangle(posX, posY + 1, 1, height - 2, color); +#else + rlBegin(RL_LINES); + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f((float)posX, (float)posY); + rlVertex2f((float)posX + (float)width, (float)posY + 1); + + rlVertex2f((float)posX + (float)width, (float)posY + 1); + rlVertex2f((float)posX + (float)width, (float)posY + (float)height); + + rlVertex2f((float)posX + (float)width, (float)posY + (float)height); + rlVertex2f((float)posX + 1, (float)posY + (float)height); + + rlVertex2f((float)posX + 1, (float)posY + (float)height); + rlVertex2f((float)posX + 1, (float)posY + 1); + rlEnd(); +//#endif +*/ } // Draw rectangle outline with extended parameters From 15f6c47f0715afd1fce52d760053026c2b92214c Mon Sep 17 00:00:00 2001 From: IcyLeave6109 <33421921+juliohq@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:49:47 -0300 Subject: [PATCH 043/155] Use free camera in model shader example (#4428) --- examples/shaders/shaders_model_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index bf2c112be..9faa2d589 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -69,7 +69,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - UpdateCamera(&camera, CAMERA_FIRST_PERSON); + UpdateCamera(&camera, CAMERA_FREE); //---------------------------------------------------------------------------------- // Draw From 6c3b1fa1de340df67189839e372ce03bea5c625e Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 24 Oct 2024 14:37:23 -0700 Subject: [PATCH 044/155] Add shadow map example to MSVC projects (#4430) --- .../VS2022/examples/shaders_shadowmap.vcxproj | 387 ++++++++++++++++++ projects/VS2022/raylib.sln | 36 +- 2 files changed, 406 insertions(+), 17 deletions(-) create mode 100644 projects/VS2022/examples/shaders_shadowmap.vcxproj diff --git a/projects/VS2022/examples/shaders_shadowmap.vcxproj b/projects/VS2022/examples/shaders_shadowmap.vcxproj new file mode 100644 index 000000000..d1ec9b23a --- /dev/null +++ b/projects/VS2022/examples/shaders_shadowmap.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629} + Win32Proj + shaders_shadowmap + 10.0 + shaders_shadowmap + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index 1dbd38984..9ce0521ee 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -299,6 +299,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_top_down_lights", "e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_gpu_skinning", "examples\models_gpu_skinning.vcxproj", "{8245DAD9-D402-4D5C-8F45-32229CD3B263}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shadowmap", "examples\shaders_shadowmap.vcxproj", "{41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.DLL|x64 = Debug.DLL|x64 @@ -2483,22 +2485,6 @@ Global {EFA150D4-F93B-4D7D-A69C-9E8B4663BECD}.Release|x64.Build.0 = Release|x64 {EFA150D4-F93B-4D7D-A69C-9E8B4663BECD}.Release|x86.ActiveCfg = Release|Win32 {EFA150D4-F93B-4D7D-A69C-9E8B4663BECD}.Release|x86.Build.0 = Release|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug|x64.ActiveCfg = Debug|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug|x64.Build.0 = Debug|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug|x86.ActiveCfg = Debug|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Debug|x86.Build.0 = Debug|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release.DLL|x64.Build.0 = Release.DLL|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release.DLL|x86.Build.0 = Release.DLL|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release|x64.ActiveCfg = Release|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release|x64.Build.0 = Release|x64 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release|x86.ActiveCfg = Release|Win32 - {D8026C60-CCBC-45DF-9085-BF21569EB414}.Release|x86.Build.0 = Release|Win32 {DF25E545-00FF-4E64-844C-7DF98991F901}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 {DF25E545-00FF-4E64-844C-7DF98991F901}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 {DF25E545-00FF-4E64-844C-7DF98991F901}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 @@ -2547,6 +2533,22 @@ Global {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Release|x64.Build.0 = Release|x64 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Release|x86.ActiveCfg = Release|Win32 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Release|x86.Build.0 = Release|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug|x64.ActiveCfg = Debug|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug|x64.Build.0 = Debug|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug|x86.ActiveCfg = Debug|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Debug|x86.Build.0 = Debug|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x64.ActiveCfg = Release|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x64.Build.0 = Release|x64 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x86.ActiveCfg = Release|Win32 + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2695,10 +2697,10 @@ Global {88DE5AD6-0074-4A5A-BE22-C840153E35D5} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} {A546E75A-5242-46E6-9A9E-6C91554EAB84} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} {EFA150D4-F93B-4D7D-A69C-9E8B4663BECD} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} - {D8026C60-CCBC-45DF-9085-BF21569EB414} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} {DF25E545-00FF-4E64-844C-7DF98991F901} = {278D8859-20B1-428F-8448-064F46E1F021} {703BE7BA-5B99-4F70-806D-3A259F6A991E} = {278D8859-20B1-428F-8448-064F46E1F021} {8245DAD9-D402-4D5C-8F45-32229CD3B263} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} From 728ccc96bcbcd631f7523cff9c87e1b581db209a Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 24 Oct 2024 14:49:30 -0700 Subject: [PATCH 045/155] Use the vertex color as part of the base shader in GLSL330 (#4431) --- examples/shaders/resources/shaders/glsl330/base.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/shaders/resources/shaders/glsl330/base.fs b/examples/shaders/resources/shaders/glsl330/base.fs index 6b5006224..813f32b1d 100644 --- a/examples/shaders/resources/shaders/glsl330/base.fs +++ b/examples/shaders/resources/shaders/glsl330/base.fs @@ -20,6 +20,9 @@ void main() // NOTE: Implement here your fragment shader code - finalColor = texelColor*colDiffuse; + // final color is the color from the texture + // times the tint color (colDiffuse) + // times the fragment color (interpolated vertex color) + finalColor = texelColor*colDiffuse*fragColor; } From f03f093909ec899eecbc298063afd2ca37ce6b07 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Fri, 25 Oct 2024 00:47:04 -0700 Subject: [PATCH 046/155] Add input_virtual_controls to MSVC projects (#4433) Fix input_virtual_controls example to use correct default font sizes --- examples/core/core_input_virtual_controls.c | 22 +++++++++--------- examples/core/core_input_virtual_controls.png | Bin 9604 -> 9094 bytes projects/VS2022/raylib.sln | 19 +++++++++++++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/examples/core/core_input_virtual_controls.c b/examples/core/core_input_virtual_controls.c index ae7f770aa..2d2b91e67 100644 --- a/examples/core/core_input_virtual_controls.c +++ b/examples/core/core_input_virtual_controls.c @@ -54,8 +54,8 @@ int main(void) // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { - // Update - //-------------------------------------------------------------------------- + // Update + //-------------------------------------------------------------------------- dpadKeydown = -1; //reset float inputX=0; float inputY=0; @@ -89,10 +89,9 @@ int main(void) case 3: playerY += 50*GetFrameTime(); default:; }; - //-------------------------------------------------------------------------- - - // Draw - //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // Draw + //-------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); for(int i=0;i<4;i++) @@ -103,14 +102,15 @@ int main(void) { //draw label DrawText(TextSubtext(dpadLabel,i,1), - dpadCollider[i][0]-5, - dpadCollider[i][1]-5,16,BLACK); + dpadCollider[i][0]-7, + dpadCollider[i][1]-8,20,BLACK); } - } - DrawText("Player",playerX,playerY,16,BLACK); + + DrawRectangle(playerX-4,playerY-4,75,28,RED); + DrawText("Player",playerX,playerY,20,WHITE); EndDrawing(); - //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- } // De-Initialization diff --git a/examples/core/core_input_virtual_controls.png b/examples/core/core_input_virtual_controls.png index a9776e68a3dfdd01f5b8afc51859ace27a150622..cb1444598017b9d7ff83480f66909c8523ece519 100644 GIT binary patch literal 9094 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 H{`@}x#HYs# literal 9604 zcmeHtcTkgA+jm^ow)S;dmSz+XRuJhRHMvIE@%+`ZzBBUdHn*CG;jOsG^^d(|h9<+uTs3@#9$&v3fw^_| zfl|QUZ5aFfi9t@5>X|h6LHi)fm>_PFO+3H@`r<-K2d!0fN2OvpKQ)^*eiQFiFjX5->7jcOkXqa_egsqIS{CDRX)=O z4u^9{7i(QD5MvkJrsK!mgT13?GmU4^bN5s=n~f~TYgOlKRVOqE3ddShX>1%lMdTAr zJW&+@>=6*?*~uCgjcV80tq*lEG(0@qeC5p%9D$() z7fxy6rlP~gcS7MC_35KI{Uo?bg$2=(RT49J4<_Ljkn5<6v_`L1u5kC^V<6DWUjPX= zHa12mlw8B`aTillQ>+Q&p);yX*Wae$#m98poY+b_>D&pTxXyb=^@#~#j@@ZtyIbeN z#nflf3{v`M;QVcBFH{FG`_Y+w+5|BHWx^~Zt0m}!yV)d$Lzw}~VZHpV?N@q^BA3kE z8ob;~U#@%u0y$eF5QxB6f9^o`mszwg_CO>nolsZRYL}d)!iw4J+Yg-KF4Q(!!WpEz z27& zWKT}V)0VrSN9)wlDW6~M;#eTqQ&w$lZEA^0fDMU@^Yc(ZfeLdEgL?68(1kNSKp z7CXAQ1~o?6JjqVrF_kbsBQ-qw-U2YZ@9FVi5=k_}ko2#m>&ov3lH0A_GAXO~b}>`%T54yAbjPT7c1tMu2re zS?3p)mj}{iG)HD;%1|g2)DU%huPpmvKyz3QAFUresIYl{8|ZpwQ<9KdsV?1&i;D{s zav8Z{ij+zRng$eU2u0Sr9s&GVXPc>+8HGa8U+5F8u2wWR$Bf*6;?oGvt>`RkA@p8} zpvGLUezM|~vdLSF7IpRMNoC-DA9%ag4XrW<&EtEPTSeJVC%Esa0rYweMh|hQs1+RQ z;Jk@1UZCyj`ov}*9sBN08eqOHNdYSnbx8AgyB~tIBEPTI7CY-yw*(9h3<=mpbGYb!M6?D@)`Gbfk~8bBW}9QGbR7{;_W9B z===S>u+6uz2i0EJT&(r@*tWBMX#+u$CsNZCdfNDZyXIb-|Nf_J{0Ra{OQ6+9I)RvD zid=(cD-Y!LPe%R9p9m&L5GKCu{N4jyR*#^WiIzH@jT(j7FPggfE4q4_GH%SJBTj=z zDSvNk&HT?tF99;;<0eQ(dCRwQww#k@7O(womCr{lZ0uC9g~4Eh7J@0Sr+@(R@U)Rrtuuc=(p1ypI<8?rmj}I?sB}R*8N9)Px@~A z{mEIZq6|E`FRE4jpoK8Pm5&V`%s>soQkjwSLPGiA4oLFP8Reen8NSIx)T<9B%r~*9!lxf~j3hYo-cpzypRtMTL23JEWNY-A zQS}n?n&V{LG{Ly6k1SL#y)9M7D(1Tg;cOtar;rv z{OzyW1Y&*cF+5Z|7vBToogQ@ zlAINeGmM$|;6#dUD!F4-OMPzLZK*^~MR@X^+34Ep+y_pwL6vtBA~F7&v*pS`^}xnZ zJ1!+gVmsKLa?xk?PI-T@`HM0CYQ~sLxV5CSIpzG3KB4QCcf=P?7QEzu=a->K%y%Ewka5734J=daLN0 z!l_Z5r(`{~yc8Ej?_GwO7=j70(4fwZ{v<}Hh#^EYaXO7D|10j*A)MHB5&0}YAlbNzAj@}5m`Emh=I|A zCO9uGE;JfoRtL`}yfB8&PD~~A_|MmlHq&m18cIJI)i#;h9YvnbLsLd@;-)F?O)`T+ zNbxL!T#k!l3&+*D!`ePY#bEa${CxAsOv{P*g< zi4B`+Vy&)PZgiDMOJR(a@?=9C| zeYqx-um%CBE@tnOz+PQiF7R8m$b(Hk`&nRtSJl*4DIWOLhw1r|!PPD;&4}{c6btT0 zDeU|sl)My)CG%Te*ecO6@*ivOiTGN`T;Cl!(oaKk|#?HV5S0k%=FE^3&n!ROJ{Hvn)$K8 zlMgQL&n2H{!5(%DemLEH<-_ZeE3fwmnZ^Y4UhNJYb>Q2B!y|KNG+eEHYpNr1A!lYg zN}dNBT394kyM<5iy|9;5__RtL6egbDM zkp>nFaQYu3kvWrWlMrcZ_1r5ayxmmWHg$<7q|h6g#6I#MJ!QVqJb{rF&0EnX+65m- zUFp_$V|f-#m5-rwZ%USOg^SeX!ujM{3??{H!|rq+0mct$)AVEng4bg$pIvb*6MvX6 zS=KaWQRz~jDDh3g;D<%}BmbMp=aKv#6Dh`);tYE*3lR}J;(9#FB*RraH&}-W6_yfN zX7ce5bMBV#pI0ylTg74;fE@T2COv_ z8ufxrO%UL7 z$`X{F;temL`63hckt$Z4=h(=nWe5MHlp6**y0>=Qd*_WVwp75ODZ)%1mjOOa`Z$(J zcf21~iwSd3$x}KoaCq-&k~hNqp+Z!mo-G^^!}g$@i^EyPd=`h<@Grz_ttA>lwLHPm z=i=MnS59G=!{%HUIEMFG|8AKmH4jNOxPVT+f=U@fp?#niinGxz6(TG$8ir8GGZC@! z?!fara+Xo1ddTGE{HbSLym(`HMp1&?&bi6n#U^fgXBx;OSRW5|sK^RLs0E5s&{dco z?%p0pr(CKt?ZbYPwNm3b4nEPgY%!uQijxFGO$1IygcpitcX$pph4bJ2m0w#H9ChKtXRGlR0GS(S-2I7ZwW=m77Mc%tTP(%dFKKIn)jZwwwD zILNAmS(Z`ZaaQb0xuXb(vi5WXx<@kEL$zsC%>1mY`#?99z3&P*vu<08Xi7oIGpb&G zmU>`{FA@$s!7;@Ib3?bI{DqE{gY?2K*ytNgd7XPMwPU&v^YCXeMn*x3o8&$2sUfb? z7#kat1INE{o+c@rCM8I(dgdce^)5F6SO{vRHU$tXP z-;$%pP#GBWwWauX$0x8whttkMET-q(MeL+%*J80Q<&zyO2WWO8u4QKmp)Kr0&1Eyz zQ@DA^a(q2ua)3{A9gy@#@e}3yc%QasQ1VnW%gp1*7VabM&P;023y9C7vc%4uiWRXQ zq7xrAITNzaa!&&;aQW@VPROfkb^N}cM;9Z>S$|DL{_PUBcmT2Bh!FS|cu0Q<4S0vB zY>X(oDT_Y?YiD$uUzv7_nfNgSqp`NMhUwBzwa(gn1#d>{W{GumuV1~!?)Ype{|Z0d zOB;ON$x{zb)-aQ>1YDRj*_n;!dbWz%6rz`^EK3nfrfu|WQ2pPowfhqvueZ}T*~hh! zuXf1pODy#_K}imeK+MO>_4O{@H_+WOrY9`lQethY08K6^U}d2!H9S`biOaH$#dE4q zjfs!X+*pq?;6y`#IQVqRwTl<%ntNew)02B#p5}XKLH*B``Cv3M`{gBfY@X-~yd=3( zlwud=QjRw+G|I-4=EqvP)UJWhZa*pAY*ue3_u+st4ig;+ujF*t#z(g6;k4RK+`L4w zJ{>^(>)_T*jZw}$^)Faz+k6lCykI8w@o{O_AS}4&v+Gg4x{b7x`kGJyrV7&$>4S~n zR{6$IDZR}Q!ZDUK_G*pU(VXoH#;i10iUsUNY-5txfo6C$HRArv>S{w~-dkg@av*|} z?k_iYjkj#$^kj1iu!`av8NAYi_upQ!ZQ8#aqZb@>!kr($#>}fJ-8MHwLV<^q-t41}g+R}&Pmu28@R-Rf z{!t%ICf~$d=_oUMLdS)V6}K+mz&0Yz=3k5_YD(v<5*Rcv2?voF3#rJX{cD6IWjH;~ z7A_z@93CIX#ppJn8&(^{KHVOWv0&kj`Sdzz-3mgES1L`o_Lh_47C3$*VfuAFj|VnK=hbSU zQ(pG*M(U}XA%8~|D`D%aqRHuAqSk}V49Z|%wdg=}OlDQ|MDR>*xJGG0ys&6BFoFeGh=fInABJkXxU21OmCdWC3 zQb40jw`y3R^SveSwM<^9$Sw6#N#X+5!K@9x!PbvNFDZjCNR%ZH_Ae~deJaU+;wX)l ze7w%|@rz_8%G;%8Hzu!5n!8O~!Yvt%Toeh%`%7P{f=F4+XkESTG#BSE1%5Ivh)r21 zA{esG;qEK_+}Nl2kub@IqK-b44ie1X@Nb57kDjMJu!w&5%9EK6)+W}o2oTN&zkgLL zm5-3!ztGNliyZ7Fr?j4eh+tJrR3kQU;C=zCKgOx|==K3zFuR<3)CA%N<6dh+YD{o@ zsm!4P+jaWK^Eh{KRKJ6{?XJWFM_1c9m4-g#(n?&+gA5m@(N)@Zb0cXI9}&GFR}eVn zN(*53vrnbG(5~+9H{!7hpX)pYsDRP17F{#*TGv{Dj|zBp6^MLEpKpQ{bqszy?Nz9P zI&=ADqoD~ZT~@|7Jv?>gs<0T*sfQeF44&VPV~x|m#07U=^J0d8h$0gZK}f#oM$1IK z4^*Q$rZ@Zm`Nu_q%d}A=ghA%kbh4_R80j|~gMFhtN(*-EV&|6PW=^$?+3}WYJh1QP zUv{i?miOPGKlkVL{WzNe681Y4jBl|!u_n;n9i6)zM8(wT>1&(J&kB35?rrYr zn4fnaE0*I41~r`|A%jUhQF7e40@9LV5~(VBV?~=hLmP069N^Y{3hT=^;}j)CP7i=* zAxmp@q{pf4I#hE?FVj}B0C&2uY#u50lg#yMIlITX;gdh)xvz)@fTMLm=eN@O9m(l= z#2{KA-8ktO*knbZuOhdeqFB4Bm!CG7*55BtFU^M_*DTSH+U&vLg38)RUO%1j)+8jW zbrwkA0vwxLl!TZW=!KD^7&Fay3QuxdZm`&1;uOHxm z*5pny%7~|^*vN9E&`jP17QI;BhHb>bU9r=Cu5AV8IU;bPX=W=j;KS9_Vu;0M>>)pr z+&oA8Q{$ri62_`@QTH9SNXhmDaZiSvWeyl@Gtd=A{`;1f+MP~*$WHweVq22&R5DQrqYA2xTcrHHM-by6=c)pUdB z8kfiUI8MfVk8c@rdAIZW9}7!M_HNW}r6;t1I39fzz$}%18anl^qMptyPQSz}oP64}Qdk5$)t1Ft4m+1EcjF z!F0Gcy@x%hltm_WFp}lwi*KO@4!N?bk(_>|tOm30HyJCSAFvZa#Q@|lpK|?8Ele>_ zRsFP2$9lL*+YbQM!~|%s=CH9EKPO*+?*v!}o5{&;mQLEr(VmV3o?~>#k08+Vy8ub_ zyrtzS4rdHd6Z6Z<$r8c2i?w5bLp{ggvKFSBJR%ei415E+?%JI4)bDX7>x>%F^EE(? zIo~_94FpQxVzqv``rEf4(9e!rT=d&Lhe4o6FA{U6;%SjbEDivS;E@YXIRGCR@wf+A z5b>L05y1cbpl%HUUH^D%HwbjT2T3R}54gl~c&)+I;@Bi_qfi&RWEAWl_S-mA)!R-Qptgdc(!}$`K>>rJa#?qS1v!|ge081^a`32st z)|HQf2A6+YUIWPZONW%5e~}{E7o>uq)B2N~!zTe$@B7!Dp}(rQN51=vEN+d^hp)8j zQh^=24l5TQb&#&-WlurC#&&AM%SJxuuOA zdw@idojYdh*P#;dI0{($`%1KEx4p{`mz1^vcSTLgBNeWf&>^>VzdDvf$Wu_r(VOseDxZ1?7MZhgPw){lcp-li5(anbk70M%gTQqvz4y?W$tnGcdSeHwF?+8G`%7BDPc}_KAbY=mKc^QP)(3q_8=ps7%6FL^4A`UsN*xI}3yA#lV0!O0 zcf$92??^pYV7oxqPxhyOO?K{8y!%AL83P$CaA)Lj^S>lN6hltCtMnFIH4d<;pR4r- zx*rgS*#sysfB0*j4cMN0HPBBFB?l}m{<5@qRr@KTWQ;N@$P5^J#JitJp_&cbV7zCW z8UZy7G@y<^X(L{+K3L)IFSC2V9_wjglSWI+5dopHXl!`+Dz^gdhl=~5j)1Q|L&O4$ zLgKUt$``^eUVa9RuWd-*XE1Yb#tj4-x(}2wxt<#VYdME?-bJ>2tUxNORIEmB1L+vH z%%%5QJH@IeK88Hp-(xg98}|16cF?1iuj6&Q6s$DuUwCT$<`K9LFr%fGjB>p}wbCgY zHRW?V+ooOVz~glu=I_aNE$PR;PEe^&D!i0he?|=i@^G`ebxzai@}2bTm3=v{8dCMx zngITW-juKF5bLvc5X=t&Y8Zdu6dAhvoCSv-Gidi#X`QKV1N3)2+`gYkF(821fbc z3J|ZALjX$lKb+hNSnzr^>C353%}Lj&<>+QU?@j@Vy;z*HCc1ovF9QP2MsV-!Rx$Q^ zz76#9%s;{Z>#>>M2{NhsJK^TCCMyj{J$GfcfcSz)P}ZBOU3dN6r`PO0VA)q+g_1d# zJ*clHRkp8=e6}TPjhgh-@Lz5!!R1?XzE)JmLO1J@OVj3CV*RLlTvIt$*l}aTAGb9> z{huj*$Mxi3TIGN1(g2Iw8wO>}R?OCwRpQCFlmI~eae@d1QYx(U?`;NVe&r!uJGw3% z59@mmym9bu>s^4zp7S{Ui(6_HW4ExNE>_GY>VzttKG3aqD6I`o!~=WzS~Pe6A6uJ_vg0V(>vz85-_{-6iiyw5l-bsQ&^o-(y;bfnmqX#)_0n;Iy&2{cwcd5^%OZ z{oZ%$+=xf+#0}+u$1P#^pO0Ju6j1cgu+AAT9K~L~RYwie9r?~5*olk&jN>T%J`XDV z#QW9e@?(GKbpS^mS}XictCJ=ZrS^w&?3bWR%HINavtwL+(pv7!O8TGG2Gw8A`;^DV zP~DA(>-(Ah31+kPZ{U|@j{zzF=@-qs??(JRLFAuPqvW3WZ9F`l*6j}ij__RE7NX{Z zOVkDingL})WVDho8`gypwa1Bbiu!VcDUJo3&`w@o?zR^FCN=^6(Zuh{=}Z%v~9x? zg}V;|#ycDIYS!8p$QSQR>VRJ3Kb^w=fKH*Is6u!6CUC+=C-;A?pT8pfFL$6-4Bcub zL8Rs_oIV^sq`Wos<>&v>J^m{lZvkF@Of~t41(2(Jb4P-|B-Vj15!b7HD~$gBHLoY< zslx3q*j-o_v`%t3c`40bevl<@j&X bk Date: Fri, 25 Oct 2024 08:47:35 +0100 Subject: [PATCH 047/155] [build] CMake: Don't build for wayland by default (#4432) This is to align with the behavior of #4369, see #4371 for rationale on disabling Wayland by default. --- CMakeOptions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index ce9141e22..b387922b4 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -21,7 +21,7 @@ cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_B enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one") # GLFW build options -option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" ON) +option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF) option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON) option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF) From 8b36253e2f735da42ee895b3ef51b33ca3f0fed4 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Fri, 25 Oct 2024 18:47:55 -0300 Subject: [PATCH 048/155] [build] [web] Fix examples `Makefile` for `PLATFORM_WEB` (#4434) * Fix examples Makefile for PLATFORM_WEB * Replace shell with assignment operator * Replace tab with spaces --- examples/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index be9751db1..3961152c2 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -197,7 +197,12 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) - MAKE = mingw32-make + EMMAKE != type emmake + ifneq (, $(EMMAKE)) + MAKE = emmake make + else + MAKE = mingw32-make + endif endif # Define compiler flags: CFLAGS @@ -451,7 +456,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) ifeq ($(PLATFORM_OS),OSX) # Libraries for Debian GNU/Linux desktop compiling # NOTE: Required packages: libegl1-mesa-dev - LDLIBS = ../src/libraylib.a -lm + LDLIBS = ../src/libraylib.a -lm LDLIBS += -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo endif endif From 7ac36e20cd1e4c6c6f6d5cbf2439927fcced5c0b Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 25 Oct 2024 23:55:31 +0200 Subject: [PATCH 049/155] Update Makefile.Web --- examples/Makefile.Web | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 5155458e0..0e1337fb0 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -139,7 +139,7 @@ endif # Define default make program: MAKE #------------------------------------------------------------------------------------------------ -MAKE ?= emmake make +MAKE ?= make ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) @@ -149,8 +149,13 @@ endif ifeq ($(PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif -ifeq ($(PLATFORM),PLATFORM_WEB) - MAKE = emmake make +ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) + EMMAKE != type emmake + ifneq (, $(EMMAKE)) + MAKE = emmake make + else + MAKE = mingw32-make + endif endif # Define compiler flags: CFLAGS From 22c77d17b7204c4f680d10c93e41d66f645ef32e Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 00:51:37 +0200 Subject: [PATCH 050/155] REVIEWED: WebGL2 (OpenGL ES 3.0) backend flags (PLATFORM_WEB) #4330 --- examples/Makefile.Web | 10 ++++++++++ src/Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 0e1337fb0..ade9bfc26 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -52,6 +52,10 @@ USE_EXTERNAL_GLFW ?= FALSE # NOTE: This variable is only used for PLATFORM_OS: LINUX USE_WAYLAND_DISPLAY ?= FALSE +# Use WebGL2 backend (OpenGL 3.0) +# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 +USE_WEBGL2 ?= FALSE + # Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB)) # No uname.exe on MinGW!, but OS=Windows_NT on Windows! @@ -265,6 +269,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map LDFLAGS += -sUSE_GLFW=3 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=ccall + + # NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0) + # WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 + ifeq ($(USE_WEBGL2),TRUE) + LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 + endif # NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way, # we can compile same code for ALL platforms with no change required, but, working on bigger diff --git a/src/Makefile b/src/Makefile index 84be9f5a0..1f0b730c6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -255,7 +255,7 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) # On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0 GRAPHICS = GRAPHICS_API_OPENGL_ES2 - #GRAPHICS = GRAPHICS_API_OPENGL_ES3 # Uncomment to use ES3/WebGL2 (preliminary support) + #GRAPHICS = GRAPHICS_API_OPENGL_ES3 endif ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) # By default use OpenGL ES 2.0 on Android From 4e3fc84050b1f30469dd08e8e910604dc817cc64 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 00:52:22 +0200 Subject: [PATCH 051/155] Minor format tweaks --- src/rlgl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 3730e1702..3d6a00628 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3060,15 +3060,15 @@ void rlDrawRenderBatch(rlRenderBatch *batch) if ((batch->draws[i].mode == RL_LINES) || (batch->draws[i].mode == RL_TRIANGLES)) glDrawArrays(batch->draws[i].mode, vertexOffset, batch->draws[i].vertexCount); else { -#if defined(GRAPHICS_API_OPENGL_33) + #if defined(GRAPHICS_API_OPENGL_33) // We need to define the number of indices to be processed: elementCount*6 // NOTE: The final parameter tells the GPU the offset in bytes from the // start of the index buffer to the location of the first index to process glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_INT, (GLvoid *)(vertexOffset/4*6*sizeof(GLuint))); -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) + #endif + #if defined(GRAPHICS_API_OPENGL_ES2) glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_SHORT, (GLvoid *)(vertexOffset/4*6*sizeof(GLushort))); -#endif + #endif } vertexOffset += (batch->draws[i].vertexCount + batch->draws[i].vertexAlignment); @@ -4946,7 +4946,7 @@ static void rlLoadShaderDefault(void) RLGL.State.defaultShaderLocs[RL_SHADER_LOC_VERTEX_COLOR] = glGetAttribLocation(RLGL.State.defaultShaderId, RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR); // Set default shader locations: uniform locations - RLGL.State.defaultShaderLocs[RL_SHADER_LOC_MATRIX_MVP] = glGetUniformLocation(RLGL.State.defaultShaderId, RL_DEFAULT_SHADER_UNIFORM_NAME_MVP); + RLGL.State.defaultShaderLocs[RL_SHADER_LOC_MATRIX_MVP] = glGetUniformLocation(RLGL.State.defaultShaderId, RL_DEFAULT_SHADER_UNIFORM_NAME_MVP); RLGL.State.defaultShaderLocs[RL_SHADER_LOC_COLOR_DIFFUSE] = glGetUniformLocation(RLGL.State.defaultShaderId, RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR); RLGL.State.defaultShaderLocs[RL_SHADER_LOC_MAP_DIFFUSE] = glGetUniformLocation(RLGL.State.defaultShaderId, RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0); } From 91a4f047942b4eb261c47291496a2cbed03e5c0d Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Sat, 26 Oct 2024 06:39:24 -0300 Subject: [PATCH 052/155] Use mingw32-make for Windows (#4436) --- examples/Makefile | 12 ++++++++---- examples/Makefile.Web | 38 +++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 3961152c2..969c246e1 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -197,11 +197,15 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) - EMMAKE != type emmake - ifneq (, $(EMMAKE)) - MAKE = emmake make - else + ifeq ($(OS),Windows_NT) MAKE = mingw32-make + else + EMMAKE != type emmake + ifneq (, $(EMMAKE)) + MAKE = emmake make + else + MAKE = mingw32-make + endif endif endif diff --git a/examples/Makefile.Web b/examples/Makefile.Web index ade9bfc26..7e2aaacc5 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -154,11 +154,15 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) - EMMAKE != type emmake - ifneq (, $(EMMAKE)) - MAKE = emmake make - else + ifeq ($(OS),Windows_NT) MAKE = mingw32-make + else + EMMAKE != type emmake + ifneq (, $(EMMAKE)) + MAKE = emmake make + else + MAKE = mingw32-make + endif endif endif @@ -269,7 +273,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map LDFLAGS += -sUSE_GLFW=3 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=ccall - + # NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0) # WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 ifeq ($(USE_WEBGL2),TRUE) @@ -556,10 +560,10 @@ core/core_3d_camera_split_screen: core/core_3d_camera_split_screen.c core/core_3d_picking: core/core_3d_picking.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - + core/core_automation_events : core/core_automation_events.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - + core/core_basic_window: core/core_basic_window.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -658,7 +662,7 @@ shapes/shapes_draw_circle_sector: shapes/shapes_draw_circle_sector.c shapes/shapes_draw_rectangle_rounded: shapes/shapes_draw_rectangle_rounded.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - + shapes/shapes_draw_ring: shapes/shapes_draw_ring.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -728,7 +732,7 @@ textures/textures_image_drawing: textures/textures_image_drawing.c textures/textures_image_generation: textures/textures_image_generation.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 - + textures/textures_image_kernel: textures/textures_image_kernel.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file textures/resources/cat.png@resources/cat.png @@ -804,7 +808,7 @@ textures/textures_to_image: textures/textures_to_image.c text/text_codepoints_loading: text/text_codepoints_loading.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file text/resources/DotGothic16-Regular.ttf@resources/DotGothic16-Regular.ttf - + text/text_draw_3d: text/text_draw_3d.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file text/resources/shaders/glsl100/alpha_discard.fs@resources/shaders/glsl100/alpha_discard.fs @@ -869,7 +873,7 @@ models/models_animation: models/models_animation.c --preload-file models/resources/models/iqm/guy.iqm@resources/models/iqm/guy.iqm \ --preload-file models/resources/models/iqm/guytex.png@resources/models/iqm/guytex.png \ --preload-file models/resources/models/iqm/guyanim.iqm@resources/models/iqm/guyanim.iqm - + models/models_gpu_skinning: models/models_gpu_skinning.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file models/resources/models/gltf/greenman.glb@resources/models/gltf/greenman.glb \ @@ -899,7 +903,7 @@ models/models_first_person_maze: models/models_first_person_maze.c models/models_geometric_shapes: models/models_geometric_shapes.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - + models/models_heightmap: models/models_heightmap.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file models/resources/heightmap.png@resources/heightmap.png @@ -908,7 +912,7 @@ models/models_loading: models/models_loading.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file models/resources/models/obj/castle.obj@resources/models/obj/castle.obj \ --preload-file models/resources/models/obj/castle_diffuse.png@resources/models/obj/castle_diffuse.png - + models/models_loading_gltf: models/models_loading_gltf.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file models/resources/models/gltf/robot.glb@resources/models/gltf/robot.glb @@ -916,12 +920,12 @@ models/models_loading_gltf: models/models_loading_gltf.c models/models_loading_m3d: models/models_loading_m3d.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file models/resources/models/m3d/cesium_man.m3d@resources/models/m3d/cesium_man.m3d - + models/models_loading_vox: models/models_loading_vox.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file models/resources/models/vox/chr_knight.vox@resources/models/vox/chr_knight.vox \ --preload-file models/resources/models/vox/chr_sword.vox@resources/models/vox/chr_sword.vox \ - --preload-file models/resources/models/vox/monu9.vox@resources/models/vox/monu9.vox + --preload-file models/resources/models/vox/monu9.vox@resources/models/vox/monu9.vox models/models_mesh_generation: models/models_mesh_generation.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -947,7 +951,7 @@ models/models_skybox: models/models_skybox.c models/models_waving_cubes: models/models_waving_cubes.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - + models/models_yaw_pitch_roll: models/models_yaw_pitch_roll.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file models/resources/models/obj/plane.obj@resources/models/obj/plane.obj \ @@ -1080,7 +1084,7 @@ audio/audio_mixed_processor: audio/audio_mixed_processor.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file audio/resources/country.mp3@resources/country.mp3 \ --preload-file audio/resources/coin.wav@resources/coin.wav - + audio/audio_module_playing: audio/audio_module_playing.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file audio/resources/mini1111.xm@resources/mini1111.xm From 7fedf9e0b865acb1be48b8a1a4a306401105365e Mon Sep 17 00:00:00 2001 From: Nikolas Date: Sat, 26 Oct 2024 12:09:38 +0200 Subject: [PATCH 053/155] [rtextures/rlgl] Load mipmaps for cubemaps (#4429) * [rlgl] Load cubemap mipmaps * [rtextures] Only generate mipmaps that don't already exist * [rtextures] ImageDraw(): Implement drawing to mipmaps * [rtextures] Load cubemap mipmaps --- examples/models/models_skybox.c | 2 +- src/rlgl.h | 39 +++++++++++++++++----- src/rtextures.c | 57 ++++++++++++++++++++++++++------- 3 files changed, 78 insertions(+), 20 deletions(-) diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index fc9627b42..4689acd77 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -191,7 +191,7 @@ static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int s // STEP 1: Setup framebuffer //------------------------------------------------------------------------------------------ unsigned int rbo = rlLoadTextureDepth(size, size, true); - cubemap.id = rlLoadTextureCubemap(0, size, format); + cubemap.id = rlLoadTextureCubemap(0, size, format, 1); unsigned int fbo = rlLoadFramebuffer(); rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); diff --git a/src/rlgl.h b/src/rlgl.h index 3d6a00628..56f01e5f4 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -749,7 +749,7 @@ RLAPI void rlDrawVertexArrayElementsInstanced(int offset, int count, const void // Textures management RLAPI unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture data RLAPI unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo) -RLAPI unsigned int rlLoadTextureCubemap(const void *data, int size, int format); // Load texture cubemap data +RLAPI unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mipmapCount); // Load texture cubemap data RLAPI void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update texture with new data on GPU RLAPI void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats RLAPI const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format @@ -3386,11 +3386,17 @@ unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer) // Load texture cubemap // NOTE: Cubemap data is expected to be 6 images in a single data array (one after the other), // expected the following convention: +X, -X, +Y, -Y, +Z, -Z -unsigned int rlLoadTextureCubemap(const void *data, int size, int format) +unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mipmapCount) { unsigned int id = 0; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + int mipSize = size; + + // NOTE: Added pointer math separately from function to avoid UBSAN complaining + unsigned char *dataPtr = NULL; + if (data != NULL) dataPtr = (unsigned char *)data; + unsigned int dataSize = rlGetPixelDataSize(size, size, format); glGenTextures(1, &id); @@ -3401,9 +3407,12 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format) if (glInternalFormat != 0) { - // Load cubemap faces - for (unsigned int i = 0; i < 6; i++) + // Load cubemap faces/mipmaps + for (unsigned int i = 0; i < 6 * mipmapCount; i++) { + int mipmapLevel = i / 6; + int face = i % 6; + if (data == NULL) { if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) @@ -3411,14 +3420,14 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format) if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); - else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, NULL); + else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, NULL); } else TRACELOG(RL_LOG_WARNING, "TEXTURES: Empty cubemap creation does not support compressed format"); } else { - if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize); - else glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, dataSize, (unsigned char *)data + i*dataSize); + if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, (unsigned char *)dataPtr + face*dataSize); + else glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, dataSize, (unsigned char *)dataPtr + face*dataSize); } #if defined(GRAPHICS_API_OPENGL_33) @@ -3437,11 +3446,25 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format) glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); } #endif + if (face == 5) { + mipSize /= 2; + if (data != NULL) + dataPtr += dataSize * 6; // Increment data pointer to next mipmap + + // Security check for NPOT textures + if (mipSize < 1) mipSize = 1; + + dataSize = rlGetPixelDataSize(mipSize, mipSize, format); + } } } // Set cubemap texture sampling parameters - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + if (mipmapCount > 1) { + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + } else { + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + } glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); diff --git a/src/rtextures.c b/src/rtextures.c index ca3ad0990..d0f9d4a9e 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -2390,22 +2390,16 @@ void ImageMipmaps(Image *image) else TRACELOG(LOG_WARNING, "IMAGE: Mipmaps required memory could not be allocated"); // Pointer to allocated memory point where store next mipmap level data - unsigned char *nextmip = (unsigned char *)image->data + GetPixelDataSize(image->width, image->height, image->format); + unsigned char *nextmip = image->data; - mipWidth = image->width/2; - mipHeight = image->height/2; + mipWidth = image->width; + mipHeight = image->height; mipSize = GetPixelDataSize(mipWidth, mipHeight, image->format); Image imCopy = ImageCopy(*image); for (int i = 1; i < mipCount; i++) { - TRACELOGD("IMAGE: Generating mipmap level: %i (%i x %i) - size: %i - offset: 0x%x", i, mipWidth, mipHeight, mipSize, nextmip); - - ImageResize(&imCopy, mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter - - memcpy(nextmip, imCopy.data, mipSize); nextmip += mipSize; - image->mipmaps++; mipWidth /= 2; mipHeight /= 2; @@ -2415,9 +2409,20 @@ void ImageMipmaps(Image *image) if (mipHeight < 1) mipHeight = 1; mipSize = GetPixelDataSize(mipWidth, mipHeight, image->format); + + if (i < image->mipmaps) + continue; + + TRACELOGD("IMAGE: Generating mipmap level: %i (%i x %i) - size: %i - offset: 0x%x", i, mipWidth, mipHeight, mipSize, nextmip); + + ImageResize(&imCopy, mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter + + memcpy(nextmip, imCopy.data, mipSize); } UnloadImage(imCopy); + + image->mipmaps = mipCount; } else TRACELOG(LOG_WARNING, "IMAGE: Mipmaps already available"); } @@ -3906,7 +3911,6 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0) || (src.data == NULL) || (src.width == 0) || (src.height == 0)) return; - if (dst->mipmaps > 1) TRACELOG(LOG_WARNING, "Image drawing only applied to base mipmap level"); if (dst->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image drawing not supported for compressed formats"); else { @@ -4019,6 +4023,34 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color } if (useSrcMod) UnloadImage(srcMod); // Unload source modified image + + if (dst->mipmaps > 1 && src.mipmaps > 1) { + Image mipmapDst = *dst; + mipmapDst.data = (char *) mipmapDst.data + GetPixelDataSize(mipmapDst.width, mipmapDst.height, mipmapDst.format); + mipmapDst.width /= 2; + mipmapDst.height /= 2; + mipmapDst.mipmaps--; + + Image mipmapSrc = src; + mipmapSrc.data = (char *) mipmapSrc.data + GetPixelDataSize(mipmapSrc.width, mipmapSrc.height, mipmapSrc.format); + mipmapSrc.width /= 2; + mipmapSrc.height /= 2; + mipmapSrc.mipmaps--; + + Rectangle mipmapSrcRec = srcRec; + mipmapSrcRec.width /= 2; + mipmapSrcRec.height /= 2; + mipmapSrcRec.x /= 2; + mipmapSrcRec.y /= 2; + + Rectangle mipmapDstRec = dstRec; + mipmapDstRec.width /= 2; + mipmapDstRec.height /= 2; + mipmapDstRec.x /= 2; + mipmapDstRec.y /= 2; + + ImageDraw(&mipmapDst, mipmapSrc, mipmapSrcRec, mipmapDstRec, tint); + } } } @@ -4162,6 +4194,9 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) faces = GenImageColor(size, size*6, MAGENTA); ImageFormat(&faces, image.format); + ImageMipmaps(&image); + ImageMipmaps(&faces); + // NOTE: Image formatting does not work with compressed textures for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); @@ -4169,7 +4204,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) // NOTE: Cubemap data is expected to be provided as 6 images in a single data array, // one after the other (that's a vertical image), following convention: +X, -X, +Y, -Y, +Z, -Z - cubemap.id = rlLoadTextureCubemap(faces.data, size, faces.format); + cubemap.id = rlLoadTextureCubemap(faces.data, size, faces.format, faces.mipmaps); if (cubemap.id != 0) { From 80b490c8f1e09c7fd846252926ffe72af4b076b1 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 12:15:06 +0200 Subject: [PATCH 054/155] Reviewed formating to follow raylib conventions #4429 --- src/rlgl.h | 27 +++++++++++++-------------- src/rtextures.c | 12 ++++++------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 56f01e5f4..a7fedf0e4 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3408,18 +3408,19 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi if (glInternalFormat != 0) { // Load cubemap faces/mipmaps - for (unsigned int i = 0; i < 6 * mipmapCount; i++) + for (unsigned int i = 0; i < 6*mipmapCount; i++) { - int mipmapLevel = i / 6; - int face = i % 6; + int mipmapLevel = i/6; + int face = i%6; if (data == NULL) { if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) { - if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32) - || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) - TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); + if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || + (format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32) || + (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || + (format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, NULL); } else TRACELOG(RL_LOG_WARNING, "TEXTURES: Empty cubemap creation does not support compressed format"); @@ -3446,10 +3447,10 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); } #endif - if (face == 5) { + if (face == 5) + { mipSize /= 2; - if (data != NULL) - dataPtr += dataSize * 6; // Increment data pointer to next mipmap + if (data != NULL) dataPtr += dataSize*6; // Increment data pointer to next mipmap // Security check for NPOT textures if (mipSize < 1) mipSize = 1; @@ -3460,11 +3461,9 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi } // Set cubemap texture sampling parameters - if (mipmapCount > 1) { - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - } else { - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - } + if (mipmapCount > 1) glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + else glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); diff --git a/src/rtextures.c b/src/rtextures.c index d0f9d4a9e..076452311 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -2410,12 +2410,11 @@ void ImageMipmaps(Image *image) mipSize = GetPixelDataSize(mipWidth, mipHeight, image->format); - if (i < image->mipmaps) - continue; + if (i < image->mipmaps) continue; TRACELOGD("IMAGE: Generating mipmap level: %i (%i x %i) - size: %i - offset: 0x%x", i, mipWidth, mipHeight, mipSize, nextmip); - ImageResize(&imCopy, mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter + ImageResize(&imCopy, mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter memcpy(nextmip, imCopy.data, mipSize); } @@ -4024,15 +4023,16 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color if (useSrcMod) UnloadImage(srcMod); // Unload source modified image - if (dst->mipmaps > 1 && src.mipmaps > 1) { + if ((dst->mipmaps > 1) && (src.mipmaps > 1)) + { Image mipmapDst = *dst; - mipmapDst.data = (char *) mipmapDst.data + GetPixelDataSize(mipmapDst.width, mipmapDst.height, mipmapDst.format); + mipmapDst.data = (char *)mipmapDst.data + GetPixelDataSize(mipmapDst.width, mipmapDst.height, mipmapDst.format); mipmapDst.width /= 2; mipmapDst.height /= 2; mipmapDst.mipmaps--; Image mipmapSrc = src; - mipmapSrc.data = (char *) mipmapSrc.data + GetPixelDataSize(mipmapSrc.width, mipmapSrc.height, mipmapSrc.format); + mipmapSrc.data = (char *)mipmapSrc.data + GetPixelDataSize(mipmapSrc.width, mipmapSrc.height, mipmapSrc.format); mipmapSrc.width /= 2; mipmapSrc.height /= 2; mipmapSrc.mipmaps--; From 1f6b3384fa1c6ec2743f76f4df8dd4ec10e86ddd Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 12:26:00 +0200 Subject: [PATCH 055/155] Reviewed formatting, remove end-line points, for consistency with comments --- src/rlgl.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index a7fedf0e4..34cae97e8 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -8,17 +8,17 @@ * * ADDITIONAL NOTES: * When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are -* initialized on rlglInit() to accumulate vertex data. +* initialized on rlglInit() to accumulate vertex data * * When an internal state change is required all the stored vertex data is renderer in batch, -* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch. +* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch * * Some resources are also loaded for convenience, here the complete list: * - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data * - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8 * - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs) * -* Internal buffer (and resources) must be manually unloaded calling rlglClose(). +* Internal buffer (and resources) must be manually unloaded calling rlglClose() * * CONFIGURATION: * #define GRAPHICS_API_OPENGL_11 @@ -32,9 +32,9 @@ * required by any other module, use rlGetVersion() to check it * * #define RLGL_IMPLEMENTATION -* Generates the implementation of the library into the included file. +* Generates the implementation of the library into the included file * If not defined, the library is in header only mode and can be included in other headers -* or source files without problems. But only ONE file should hold the implementation. +* or source files without problems. But only ONE file should hold the implementation * * #define RLGL_RENDER_TEXTURES_HINT * Enable framebuffer objects (fbo) support (enabled by default) @@ -1503,8 +1503,8 @@ void rlVertex3f(float x, float y, float z) tz = RLGL.State.transform.m2*x + RLGL.State.transform.m6*y + RLGL.State.transform.m10*z + RLGL.State.transform.m14; } - // WARNING: We can't break primitives when launching a new batch. - // RL_LINES comes in pairs, RL_TRIANGLES come in groups of 3 vertices and RL_QUADS come in groups of 4 vertices. + // WARNING: We can't break primitives when launching a new batch + // RL_LINES comes in pairs, RL_TRIANGLES come in groups of 3 vertices and RL_QUADS come in groups of 4 vertices // We must check current draw.mode when a new vertex is required and finish the batch only if the draw.mode draw.vertexCount is %2, %3 or %4 if (RLGL.State.vertexCounter > (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementCount*4 - 4)) { @@ -2933,11 +2933,11 @@ void rlDrawRenderBatch(rlRenderBatch *batch) glBufferSubData(GL_ARRAY_BUFFER, 0, RLGL.State.vertexCounter*4*sizeof(unsigned char), batch->vertexBuffer[batch->currentBuffer].colors); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*4*batch->vertexBuffer[batch->currentBuffer].elementCount, batch->vertexBuffer[batch->currentBuffer].colors, GL_DYNAMIC_DRAW); // Update all buffer - // NOTE: glMapBuffer() causes sync issue. - // If GPU is working with this buffer, glMapBuffer() will wait(stall) until GPU to finish its job. - // To avoid waiting (idle), you can call first glBufferData() with NULL pointer before glMapBuffer(). + // NOTE: glMapBuffer() causes sync issue + // If GPU is working with this buffer, glMapBuffer() will wait(stall) until GPU to finish its job + // To avoid waiting (idle), you can call first glBufferData() with NULL pointer before glMapBuffer() // If you do that, the previous data in PBO will be discarded and glMapBuffer() returns a new - // allocated pointer immediately even if GPU is still working with the previous data. + // allocated pointer immediately even if GPU is still working with the previous data // Another option: map the buffer object into client's memory // Probably this code could be moved somewhere else... @@ -2990,7 +2990,7 @@ void rlDrawRenderBatch(rlRenderBatch *batch) } // WARNING: For the following setup of the view, model, and normal matrices, it is expected that - // transformations and rendering occur between rlPushMatrix and rlPopMatrix. + // transformations and rendering occur between rlPushMatrix() and rlPopMatrix() if (RLGL.State.currentShaderLocs[RL_SHADER_LOC_MATRIX_VIEW] != -1) { @@ -3622,8 +3622,8 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format) //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); - // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding. - // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. + // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding + // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting // GL_PACK_ALIGNMENT affects operations that read from OpenGL memory (glReadPixels, glGetTexImage, etc.) // GL_UNPACK_ALIGNMENT affects operations that write to OpenGL memory (glTexImage, etc.) glPixelStorei(GL_PACK_ALIGNMENT, 1); @@ -3644,7 +3644,7 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format) #if defined(GRAPHICS_API_OPENGL_ES2) // glGetTexImage() is not available on OpenGL ES 2.0 - // Texture width and height are required on OpenGL ES 2.0. There is no way to get it from texture id. + // Texture width and height are required on OpenGL ES 2.0, there is no way to get it from texture id // Two possible Options: // 1 - Bind texture to color fbo attachment and glReadPixels() // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() @@ -3810,7 +3810,7 @@ void rlUnloadFramebuffer(unsigned int id) else if (depthType == GL_TEXTURE) glDeleteTextures(1, &depthIdU); // NOTE: If a texture object is deleted while its image is attached to the *currently bound* framebuffer, - // the texture image is automatically detached from the currently bound framebuffer. + // the texture image is automatically detached from the currently bound framebuffer glBindFramebuffer(GL_FRAMEBUFFER, 0); glDeleteFramebuffers(1, &id); @@ -4253,7 +4253,7 @@ unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId) else { // Get the size of compiled shader program (not available on OpenGL ES 2.0) - // NOTE: If GL_LINK_STATUS is GL_FALSE, program binary length is zero. + // NOTE: If GL_LINK_STATUS is GL_FALSE, program binary length is zero //GLint binarySize = 0; //glGetProgramiv(id, GL_PROGRAM_BINARY_LENGTH, &binarySize); @@ -4447,7 +4447,7 @@ unsigned int rlLoadComputeShaderProgram(unsigned int shaderId) else { // Get the size of compiled shader program (not available on OpenGL ES 2.0) - // NOTE: If GL_LINK_STATUS is GL_FALSE, program binary length is zero. + // NOTE: If GL_LINK_STATUS is GL_FALSE, program binary length is zero //GLint binarySize = 0; //glGetProgramiv(id, GL_PROGRAM_BINARY_LENGTH, &binarySize); From c6b1ecc5938f92dcd8169b22a8d9b5bb29ee892f Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:12:24 +0200 Subject: [PATCH 056/155] Update cgltf.h --- src/external/cgltf.h | 48 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/external/cgltf.h b/src/external/cgltf.h index 323120145..36fd644e1 100644 --- a/src/external/cgltf.h +++ b/src/external/cgltf.h @@ -1,7 +1,7 @@ /** * cgltf - a single-file glTF 2.0 parser written in C99. * - * Version: 1.13 + * Version: 1.14 * * Website: https://github.com/jkuhlmann/cgltf * @@ -395,6 +395,8 @@ typedef struct cgltf_texture cgltf_sampler* sampler; cgltf_bool has_basisu; cgltf_image* basisu_image; + cgltf_bool has_webp; + cgltf_image* webp_image; cgltf_extras extras; cgltf_size extensions_count; cgltf_extension* extensions; @@ -1697,7 +1699,20 @@ cgltf_result cgltf_validate(cgltf_data* data) { if (data->nodes[i].weights && data->nodes[i].mesh) { - CGLTF_ASSERT_IF (data->nodes[i].mesh->primitives_count && data->nodes[i].mesh->primitives[0].targets_count != data->nodes[i].weights_count, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(data->nodes[i].mesh->primitives_count && data->nodes[i].mesh->primitives[0].targets_count != data->nodes[i].weights_count, cgltf_result_invalid_gltf); + } + + if (data->nodes[i].has_mesh_gpu_instancing) + { + CGLTF_ASSERT_IF(data->nodes[i].mesh == NULL, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(data->nodes[i].mesh_gpu_instancing.attributes_count == 0, cgltf_result_invalid_gltf); + + cgltf_accessor* first = data->nodes[i].mesh_gpu_instancing.attributes[0].data; + + for (cgltf_size k = 0; k < data->nodes[i].mesh_gpu_instancing.attributes_count; ++k) + { + CGLTF_ASSERT_IF(data->nodes[i].mesh_gpu_instancing.attributes[k].data->count != first->count, cgltf_result_invalid_gltf); + } } } @@ -4538,6 +4553,34 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok } } } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "EXT_texture_webp") == 0) + { + out_texture->has_webp = 1; + ++i; + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + int num_properties = tokens[i].size; + ++i; + + for (int t = 0; t < num_properties; ++t) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "source") == 0) + { + ++i; + out_texture->webp_image = CGLTF_PTRINDEX(cgltf_image, cgltf_json_to_int(tokens + i, json_chunk)); + ++i; + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + if (i < 0) + { + return i; + } + } + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_texture->extensions[out_texture->extensions_count++])); @@ -6548,6 +6591,7 @@ static int cgltf_fixup_pointers(cgltf_data* data) { CGLTF_PTRFIXUP(data->textures[i].image, data->images, data->images_count); CGLTF_PTRFIXUP(data->textures[i].basisu_image, data->images, data->images_count); + CGLTF_PTRFIXUP(data->textures[i].webp_image, data->images, data->images_count); CGLTF_PTRFIXUP(data->textures[i].sampler, data->samplers, data->samplers_count); } From c085c73014f8b2333a1fc809d05409785650875d Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:12:26 +0200 Subject: [PATCH 057/155] Update dr_mp3.h --- src/external/dr_mp3.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/external/dr_mp3.h b/src/external/dr_mp3.h index 84849ee4c..e1a66d99c 100644 --- a/src/external/dr_mp3.h +++ b/src/external/dr_mp3.h @@ -1,6 +1,6 @@ /* MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. -dr_mp3 - v0.6.38 - 2023-11-02 +dr_mp3 - v0.6.39 - 2024-02-27 David Reid - mackron@gmail.com @@ -95,7 +95,7 @@ extern "C" { #define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MINOR 6 -#define DRMP3_VERSION_REVISION 38 +#define DRMP3_VERSION_REVISION 39 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include /* For size_t. */ @@ -1985,8 +1985,8 @@ static drmp3_int16 drmp3d_scale_pcm(float sample) s32 -= (s32 < 0); s = (drmp3_int16)drmp3_clip_int16_arm(s32); #else - if (sample >= 32766.5) return (drmp3_int16) 32767; - if (sample <= -32767.5) return (drmp3_int16)-32768; + if (sample >= 32766.5f) return (drmp3_int16) 32767; + if (sample <= -32767.5f) return (drmp3_int16)-32768; s = (drmp3_int16)(sample + .5f); s -= (s < 0); /* away from zero, to be compliant */ #endif @@ -2404,9 +2404,9 @@ DRMP3_API void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, size_t num for(; i < num_samples; i++) { float sample = in[i] * 32768.0f; - if (sample >= 32766.5) + if (sample >= 32766.5f) out[i] = (drmp3_int16) 32767; - else if (sample <= -32767.5) + else if (sample <= -32767.5f) out[i] = (drmp3_int16)-32768; else { @@ -4495,6 +4495,9 @@ counts rather than sample counts. /* REVISION HISTORY ================ +v0.6.39 - 2024-02-27 + - Fix a Wdouble-promotion warning. + v0.6.38 - 2023-11-02 - Fix build for ARMv6-M. From e70bf2bce1e1bdfa35d750a296fa6deca6004f63 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:12:30 +0200 Subject: [PATCH 058/155] Update dr_wav.h --- src/external/dr_wav.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/external/dr_wav.h b/src/external/dr_wav.h index 36451b589..a8207ab90 100644 --- a/src/external/dr_wav.h +++ b/src/external/dr_wav.h @@ -1,6 +1,6 @@ /* WAV audio loader and writer. Choice of public domain or MIT-0. See license statements at the end of this file. -dr_wav - v0.13.13 - 2023-11-02 +dr_wav - v0.13.16 - 2024-02-27 David Reid - mackron@gmail.com @@ -147,7 +147,7 @@ extern "C" { #define DRWAV_VERSION_MAJOR 0 #define DRWAV_VERSION_MINOR 13 -#define DRWAV_VERSION_REVISION 13 +#define DRWAV_VERSION_REVISION 16 #define DRWAV_VERSION_STRING DRWAV_XSTRINGIFY(DRWAV_VERSION_MAJOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_MINOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_REVISION) #include /* For size_t. */ @@ -3075,7 +3075,13 @@ DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc on if (pWav->container == drwav_container_riff || pWav->container == drwav_container_rifx) { if (drwav_bytes_to_u32_ex(chunkSizeBytes, pWav->container) < 36) { - return DRWAV_FALSE; /* Chunk size should always be at least 36 bytes. */ + /* + I've had a report of a WAV file failing to load when the size of the WAVE chunk is not encoded + and is instead just set to 0. I'm going to relax the validation here to allow these files to + load. Considering the chunk size isn't actually used this should be safe. With this change my + test suite still passes. + */ + /*return DRWAV_FALSE;*/ /* Chunk size should always be at least 36 bytes. */ } } else if (pWav->container == drwav_container_rf64) { if (drwav_bytes_to_u32_le(chunkSizeBytes) != 0xFFFFFFFF) { @@ -3554,10 +3560,7 @@ DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc on /* Getting here means it's not a chunk that we care about internally, but might need to be handled as metadata by the caller. */ if (isProcessingMetadata) { - drwav_uint64 metadataBytesRead; - - metadataBytesRead = drwav__metadata_process_chunk(&metadataParser, &header, drwav_metadata_type_all_including_unknown); - DRWAV_ASSERT(metadataBytesRead <= header.sizeInBytes); + drwav__metadata_process_chunk(&metadataParser, &header, drwav_metadata_type_all_including_unknown); /* Go back to the start of the chunk so we can normalize the position of the cursor. */ if (drwav__seek_from_start(pWav->onSeek, cursor, pWav->pUserData) == DRWAV_FALSE) { @@ -7830,7 +7833,7 @@ DRWAV_API void drwav_f32_to_s32(drwav_int32* pOut, const float* pIn, size_t samp } for (i = 0; i < sampleCount; ++i) { - *pOut++ = (drwav_int32)(2147483648.0 * pIn[i]); + *pOut++ = (drwav_int32)(2147483648.0f * pIn[i]); } } @@ -8347,6 +8350,15 @@ DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b) /* REVISION HISTORY ================ +v0.13.16 - 2024-02-27 + - Fix a Wdouble-promotion warning. + +v0.13.15 - 2024-01-23 + - Relax some unnecessary validation that prevented some files from loading. + +v0.13.14 - 2023-12-02 + - Fix a warning about an unused variable. + v0.13.13 - 2023-11-02 - Fix a warning when compiling with Clang. From d0e11a8c921db77b8366e945827f3bad53ee4f51 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:12:33 +0200 Subject: [PATCH 059/155] Update qoa.h --- src/external/qoa.h | 92 ++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/src/external/qoa.h b/src/external/qoa.h index fc62f4765..f0f44214d 100644 --- a/src/external/qoa.h +++ b/src/external/qoa.h @@ -366,22 +366,7 @@ unsigned int qoa_encode_frame(const short *sample_data, qoa_desc *qoa, unsigned ), bytes, &p); - for (int c = 0; c < channels; c++) { - /* If the weights have grown too large, reset them to 0. This may happen - with certain high-frequency sounds. This is a last resort and will - introduce quite a bit of noise, but should at least prevent pops/clicks */ - int weights_sum = - qoa->lms[c].weights[0] * qoa->lms[c].weights[0] + - qoa->lms[c].weights[1] * qoa->lms[c].weights[1] + - qoa->lms[c].weights[2] * qoa->lms[c].weights[2] + - qoa->lms[c].weights[3] * qoa->lms[c].weights[3]; - if (weights_sum > 0x2fffffff) { - qoa->lms[c].weights[0] = 0; - qoa->lms[c].weights[1] = 0; - qoa->lms[c].weights[2] = 0; - qoa->lms[c].weights[3] = 0; - } - + for (unsigned int c = 0; c < channels; c++) { /* Write the current LMS state */ qoa_uint64_t weights = 0; qoa_uint64_t history = 0; @@ -395,9 +380,9 @@ unsigned int qoa_encode_frame(const short *sample_data, qoa_desc *qoa, unsigned /* We encode all samples with the channels interleaved on a slice level. E.g. for stereo: (ch-0, slice 0), (ch 1, slice 0), (ch 0, slice 1), ...*/ - for (int sample_index = 0; sample_index < frame_len; sample_index += QOA_SLICE_LEN) { + for (unsigned int sample_index = 0; sample_index < frame_len; sample_index += QOA_SLICE_LEN) { - for (int c = 0; c < channels; c++) { + for (unsigned int c = 0; c < channels; c++) { int slice_len = qoa_clamp(QOA_SLICE_LEN, 0, frame_len - sample_index); int slice_start = sample_index * channels + c; int slice_end = (sample_index + slice_len) * channels + c; @@ -405,10 +390,13 @@ unsigned int qoa_encode_frame(const short *sample_data, qoa_desc *qoa, unsigned /* Brute for search for the best scalefactor. Just go through all 16 scalefactors, encode all samples for the current slice and meassure the total squared error. */ - qoa_uint64_t best_error = -1; - qoa_uint64_t best_slice; + qoa_uint64_t best_rank = -1; + #ifdef QOA_RECORD_TOTAL_ERROR + qoa_uint64_t best_error = -1; + #endif + qoa_uint64_t best_slice = 0; qoa_lms_t best_lms; - int best_scalefactor; + int best_scalefactor = 0; for (int sfi = 0; sfi < 16; sfi++) { /* There is a strong correlation between the scalefactors of @@ -421,7 +409,10 @@ unsigned int qoa_encode_frame(const short *sample_data, qoa_desc *qoa, unsigned state when encoding. */ qoa_lms_t lms = qoa->lms[c]; qoa_uint64_t slice = scalefactor; - qoa_uint64_t current_error = 0; + qoa_uint64_t current_rank = 0; + #ifdef QOA_RECORD_TOTAL_ERROR + qoa_uint64_t current_error = 0; + #endif for (int si = slice_start; si < slice_end; si += channels) { int sample = sample_data[si]; @@ -434,9 +425,27 @@ unsigned int qoa_encode_frame(const short *sample_data, qoa_desc *qoa, unsigned int dequantized = qoa_dequant_tab[scalefactor][quantized]; int reconstructed = qoa_clamp_s16(predicted + dequantized); + + /* If the weights have grown too large, we introduce a penalty + here. This prevents pops/clicks in certain problem cases */ + int weights_penalty = (( + lms.weights[0] * lms.weights[0] + + lms.weights[1] * lms.weights[1] + + lms.weights[2] * lms.weights[2] + + lms.weights[3] * lms.weights[3] + ) >> 18) - 0x8ff; + if (weights_penalty < 0) { + weights_penalty = 0; + } + long long error = (sample - reconstructed); - current_error += error * error; - if (current_error > best_error) { + qoa_uint64_t error_sq = error * error; + + current_rank += error_sq + weights_penalty * weights_penalty; + #ifdef QOA_RECORD_TOTAL_ERROR + current_error += error_sq; + #endif + if (current_rank > best_rank) { break; } @@ -444,8 +453,11 @@ unsigned int qoa_encode_frame(const short *sample_data, qoa_desc *qoa, unsigned slice = (slice << 3) | quantized; } - if (current_error < best_error) { - best_error = current_error; + if (current_rank < best_rank) { + best_rank = current_rank; + #ifdef QOA_RECORD_TOTAL_ERROR + best_error = current_error; + #endif best_slice = slice; best_lms = lms; best_scalefactor = scalefactor; @@ -490,7 +502,7 @@ void *qoa_encode(const short *sample_data, qoa_desc *qoa, unsigned int *out_len) unsigned char *bytes = QOA_MALLOC(encoded_size); - for (int c = 0; c < qoa->channels; c++) { + for (unsigned int c = 0; c < qoa->channels; c++) { /* Set the initial LMS weights to {0, 0, -1, 2}. This helps with the prediction of the first few ms of a file. */ qoa->lms[c].weights[0] = 0; @@ -513,7 +525,7 @@ void *qoa_encode(const short *sample_data, qoa_desc *qoa, unsigned int *out_len) #endif int frame_len = QOA_FRAME_LEN; - for (int sample_index = 0; sample_index < qoa->samples; sample_index += frame_len) { + for (unsigned int sample_index = 0; sample_index < qoa->samples; sample_index += frame_len) { frame_len = qoa_clamp(QOA_FRAME_LEN, 0, qoa->samples - sample_index); const short *frame_samples = sample_data + sample_index * qoa->channels; unsigned int frame_size = qoa_encode_frame(frame_samples, qoa, frame_len, bytes + p); @@ -576,14 +588,14 @@ unsigned int qoa_decode_frame(const unsigned char *bytes, unsigned int size, qoa /* Read and verify the frame header */ qoa_uint64_t frame_header = qoa_read_u64(bytes, &p); - int channels = (frame_header >> 56) & 0x0000ff; - int samplerate = (frame_header >> 32) & 0xffffff; - int samples = (frame_header >> 16) & 0x00ffff; - int frame_size = (frame_header ) & 0x00ffff; + unsigned int channels = (frame_header >> 56) & 0x0000ff; + unsigned int samplerate = (frame_header >> 32) & 0xffffff; + unsigned int samples = (frame_header >> 16) & 0x00ffff; + unsigned int frame_size = (frame_header ) & 0x00ffff; - int data_size = frame_size - 8 - QOA_LMS_LEN * 4 * channels; - int num_slices = data_size / 8; - int max_total_samples = num_slices * QOA_SLICE_LEN; + unsigned int data_size = frame_size - 8 - QOA_LMS_LEN * 4 * channels; + unsigned int num_slices = data_size / 8; + unsigned int max_total_samples = num_slices * QOA_SLICE_LEN; if ( channels != qoa->channels || @@ -596,7 +608,7 @@ unsigned int qoa_decode_frame(const unsigned char *bytes, unsigned int size, qoa /* Read the LMS state: 4 x 2 bytes history, 4 x 2 bytes weights per channel */ - for (int c = 0; c < channels; c++) { + for (unsigned int c = 0; c < channels; c++) { qoa_uint64_t history = qoa_read_u64(bytes, &p); qoa_uint64_t weights = qoa_read_u64(bytes, &p); for (int i = 0; i < QOA_LMS_LEN; i++) { @@ -609,17 +621,19 @@ unsigned int qoa_decode_frame(const unsigned char *bytes, unsigned int size, qoa /* Decode all slices for all channels in this frame */ - for (int sample_index = 0; sample_index < samples; sample_index += QOA_SLICE_LEN) { - for (int c = 0; c < channels; c++) { + for (unsigned int sample_index = 0; sample_index < samples; sample_index += QOA_SLICE_LEN) { + for (unsigned int c = 0; c < channels; c++) { qoa_uint64_t slice = qoa_read_u64(bytes, &p); int scalefactor = (slice >> 60) & 0xf; + slice <<= 4; + int slice_start = sample_index * channels + c; int slice_end = qoa_clamp(sample_index + QOA_SLICE_LEN, 0, samples) * channels + c; for (int si = slice_start; si < slice_end; si += channels) { int predicted = qoa_lms_predict(&qoa->lms[c]); - int quantized = (slice >> 57) & 0x7; + int quantized = (slice >> 61) & 0x7; int dequantized = qoa_dequant_tab[scalefactor][quantized]; int reconstructed = qoa_clamp_s16(predicted + dequantized); From 28e7e2cffd6d8118a71c63ca4bd58fc659b1ee14 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:12:36 +0200 Subject: [PATCH 060/155] Update stb_image.h --- src/external/stb_image.h | 355 ++++++++++++++++++++------------------- 1 file changed, 178 insertions(+), 177 deletions(-) diff --git a/src/external/stb_image.h b/src/external/stb_image.h index 5e807a0a6..9eedabedc 100644 --- a/src/external/stb_image.h +++ b/src/external/stb_image.h @@ -1,4 +1,4 @@ -/* stb_image - v2.28 - public domain image loader - http://nothings.org/stb +/* stb_image - v2.30 - public domain image loader - http://nothings.org/stb no warranty implied; use at your own risk Do this: @@ -48,6 +48,8 @@ LICENSE RECENT REVISION HISTORY: + 2.30 (2024-05-31) avoid erroneous gcc warning + 2.29 (2023-05-xx) optimizations 2.28 (2023-01-29) many error fixes, security errors, just tons of stuff 2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes 2.26 (2020-07-13) many minor fixes @@ -1072,8 +1074,8 @@ static int stbi__addints_valid(int a, int b) return a <= INT_MAX - b; } -// returns 1 if the product of two signed shorts is valid, 0 on overflow. -static int stbi__mul2shorts_valid(short a, short b) +// returns 1 if the product of two ints fits in a signed short, 0 on overflow. +static int stbi__mul2shorts_valid(int a, int b) { if (b == 0 || b == -1) return 1; // multiplication by 0 is always 0; check for -1 so SHRT_MIN/b doesn't overflow if ((a >= 0) == (b >= 0)) return a <= SHRT_MAX/b; // product is positive, so similar to mul2sizes_valid @@ -3384,13 +3386,13 @@ static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) return 1; } -static int stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) +static stbi_uc stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) { // some JPEGs have junk at end, skip over it but if we find what looks // like a valid marker, resume there while (!stbi__at_eof(j->s)) { - int x = stbi__get8(j->s); - while (x == 255) { // might be a marker + stbi_uc x = stbi__get8(j->s); + while (x == 0xff) { // might be a marker if (stbi__at_eof(j->s)) return STBI__MARKER_none; x = stbi__get8(j->s); if (x != 0x00 && x != 0xff) { @@ -4176,6 +4178,7 @@ typedef struct { stbi_uc *zbuffer, *zbuffer_end; int num_bits; + int hit_zeof_once; stbi__uint32 code_buffer; char *zout; @@ -4242,9 +4245,20 @@ stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) int b,s; if (a->num_bits < 16) { if (stbi__zeof(a)) { - return -1; /* report error for unexpected end of data. */ + if (!a->hit_zeof_once) { + // This is the first time we hit eof, insert 16 extra padding btis + // to allow us to keep going; if we actually consume any of them + // though, that is invalid data. This is caught later. + a->hit_zeof_once = 1; + a->num_bits += 16; // add 16 implicit zero bits + } else { + // We already inserted our extra 16 padding bits and are again + // out, this stream is actually prematurely terminated. + return -1; + } + } else { + stbi__fill_bits(a); } - stbi__fill_bits(a); } b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; if (b) { @@ -4309,6 +4323,13 @@ static int stbi__parse_huffman_block(stbi__zbuf *a) int len,dist; if (z == 256) { a->zout = zout; + if (a->hit_zeof_once && a->num_bits < 16) { + // The first time we hit zeof, we inserted 16 extra zero bits into our bit + // buffer so the decoder can just do its speculative decoding. But if we + // actually consumed any of those bits (which is the case when num_bits < 16), + // the stream actually read past the end so it is malformed. + return stbi__err("unexpected end","Corrupt PNG"); + } return 1; } if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data @@ -4320,7 +4341,7 @@ static int stbi__parse_huffman_block(stbi__zbuf *a) dist = stbi__zdist_base[z]; if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); - if (zout + len > a->zout_end) { + if (len > a->zout_end - zout) { if (!stbi__zexpand(a, zout, len)) return 0; zout = a->zout; } @@ -4464,6 +4485,7 @@ static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) if (!stbi__parse_zlib_header(a)) return 0; a->num_bits = 0; a->code_buffer = 0; + a->hit_zeof_once = 0; do { final = stbi__zreceive(a,1); type = stbi__zreceive(a,2); @@ -4619,9 +4641,8 @@ enum { STBI__F_up=2, STBI__F_avg=3, STBI__F_paeth=4, - // synthetic filters used for first scanline to avoid needing a dummy row of 0s - STBI__F_avg_first, - STBI__F_paeth_first + // synthetic filter used for first scanline to avoid needing a dummy row of 0s + STBI__F_avg_first }; static stbi_uc first_row_filter[5] = @@ -4630,29 +4651,56 @@ static stbi_uc first_row_filter[5] = STBI__F_sub, STBI__F_none, STBI__F_avg_first, - STBI__F_paeth_first + STBI__F_sub // Paeth with b=c=0 turns out to be equivalent to sub }; static int stbi__paeth(int a, int b, int c) { - int p = a + b - c; - int pa = abs(p-a); - int pb = abs(p-b); - int pc = abs(p-c); - if (pa <= pb && pa <= pc) return a; - if (pb <= pc) return b; - return c; + // This formulation looks very different from the reference in the PNG spec, but is + // actually equivalent and has favorable data dependencies and admits straightforward + // generation of branch-free code, which helps performance significantly. + int thresh = c*3 - (a + b); + int lo = a < b ? a : b; + int hi = a < b ? b : a; + int t0 = (hi <= thresh) ? lo : c; + int t1 = (thresh <= lo) ? hi : t0; + return t1; } static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; +// adds an extra all-255 alpha channel +// dest == src is legal +// img_n must be 1 or 3 +static void stbi__create_png_alpha_expand8(stbi_uc *dest, stbi_uc *src, stbi__uint32 x, int img_n) +{ + int i; + // must process data backwards since we allow dest==src + if (img_n == 1) { + for (i=x-1; i >= 0; --i) { + dest[i*2+1] = 255; + dest[i*2+0] = src[i]; + } + } else { + STBI_ASSERT(img_n == 3); + for (i=x-1; i >= 0; --i) { + dest[i*4+3] = 255; + dest[i*4+2] = src[i*3+2]; + dest[i*4+1] = src[i*3+1]; + dest[i*4+0] = src[i*3+0]; + } + } +} + // create the png data from post-deflated data static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { - int bytes = (depth == 16? 2 : 1); + int bytes = (depth == 16 ? 2 : 1); stbi__context *s = a->s; stbi__uint32 i,j,stride = x*out_n*bytes; stbi__uint32 img_len, img_width_bytes; + stbi_uc *filter_buf; + int all_ok = 1; int k; int img_n = s->img_n; // copy it into a local for later @@ -4664,8 +4712,11 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into if (!a->out) return stbi__err("outofmem", "Out of memory"); + // note: error exits here don't need to clean up a->out individually, + // stbi__do_png always does on error. if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG"); img_width_bytes = (((img_n * x * depth) + 7) >> 3); + if (!stbi__mad2sizes_valid(img_width_bytes, y, img_width_bytes)) return stbi__err("too large", "Corrupt PNG"); img_len = (img_width_bytes + 1) * y; // we used to check for exact match between raw_len and img_len on non-interlaced PNGs, @@ -4673,189 +4724,137 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // so just check for raw_len < img_len always. if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); + // Allocate two scan lines worth of filter workspace buffer. + filter_buf = (stbi_uc *) stbi__malloc_mad2(img_width_bytes, 2, 0); + if (!filter_buf) return stbi__err("outofmem", "Out of memory"); + + // Filtering for low-bit-depth images + if (depth < 8) { + filter_bytes = 1; + width = img_width_bytes; + } + for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *prior; + // cur/prior filter buffers alternate + stbi_uc *cur = filter_buf + (j & 1)*img_width_bytes; + stbi_uc *prior = filter_buf + (~j & 1)*img_width_bytes; + stbi_uc *dest = a->out + stride*j; + int nk = width * filter_bytes; int filter = *raw++; - if (filter > 4) - return stbi__err("invalid filter","Corrupt PNG"); - - if (depth < 8) { - if (img_width_bytes > x) return stbi__err("invalid width","Corrupt PNG"); - cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place - filter_bytes = 1; - width = img_width_bytes; + // check filter type + if (filter > 4) { + all_ok = stbi__err("invalid filter","Corrupt PNG"); + break; } - prior = cur - stride; // bugfix: need to compute this after 'cur +=' computation above // if first row, use special filter that doesn't sample previous row if (j == 0) filter = first_row_filter[filter]; - // handle first byte explicitly - for (k=0; k < filter_bytes; ++k) { - switch (filter) { - case STBI__F_none : cur[k] = raw[k]; break; - case STBI__F_sub : cur[k] = raw[k]; break; - case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; - case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; - case STBI__F_avg_first : cur[k] = raw[k]; break; - case STBI__F_paeth_first: cur[k] = raw[k]; break; - } + // perform actual filtering + switch (filter) { + case STBI__F_none: + memcpy(cur, raw, nk); + break; + case STBI__F_sub: + memcpy(cur, raw, filter_bytes); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); + break; + case STBI__F_up: + for (k = 0; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + break; + case STBI__F_avg: + for (k = 0; k < filter_bytes; ++k) + cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); + break; + case STBI__F_paeth: + for (k = 0; k < filter_bytes; ++k) + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); // prior[k] == stbi__paeth(0,prior[k],0) + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes], prior[k], prior[k-filter_bytes])); + break; + case STBI__F_avg_first: + memcpy(cur, raw, filter_bytes); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); + break; } - if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255; // first pixel - raw += img_n; - cur += out_n; - prior += out_n; - } else if (depth == 16) { - if (img_n != out_n) { - cur[filter_bytes] = 255; // first pixel top byte - cur[filter_bytes+1] = 255; // first pixel bottom byte - } - raw += filter_bytes; - cur += output_bytes; - prior += output_bytes; - } else { - raw += 1; - cur += 1; - prior += 1; - } + raw += nk; - // this is a little gross, so that we don't switch per-pixel or per-component - if (depth < 8 || img_n == out_n) { - int nk = (width - 1)*filter_bytes; - #define STBI__CASE(f) \ - case f: \ - for (k=0; k < nk; ++k) - switch (filter) { - // "none" filter turns into a memcpy here; make that explicit. - case STBI__F_none: memcpy(cur, raw, nk); break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break; - } - #undef STBI__CASE - raw += nk; - } else { - STBI_ASSERT(img_n+1 == out_n); - #define STBI__CASE(f) \ - case f: \ - for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ - for (k=0; k < filter_bytes; ++k) - switch (filter) { - STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break; - } - #undef STBI__CASE - - // the loop above sets the high byte of the pixels' alpha, but for - // 16 bit png files we also need the low byte set. we'll do that here. - if (depth == 16) { - cur = a->out + stride*j; // start at the beginning of the row again - for (i=0; i < x; ++i,cur+=output_bytes) { - cur[filter_bytes+1] = 255; - } - } - } - } - - // we make a separate pass to expand bits to pixels; for performance, - // this could run two scanlines behind the above code, so it won't - // intefere with filtering but will still be in the cache. - if (depth < 8) { - for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; - // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit - // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop + // expand decoded bits in cur to dest, also adding an extra alpha channel if desired + if (depth < 8) { stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range + stbi_uc *in = cur; + stbi_uc *out = dest; + stbi_uc inb = 0; + stbi__uint32 nsmp = x*img_n; - // note that the final byte might overshoot and write more data than desired. - // we can allocate enough data that this never writes out of memory, but it - // could also overwrite the next scanline. can it overwrite non-empty data - // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel. - // so we need to explicitly clamp the final ones - + // expand bits to bytes first if (depth == 4) { - for (k=x*img_n; k >= 2; k-=2, ++in) { - *cur++ = scale * ((*in >> 4) ); - *cur++ = scale * ((*in ) & 0x0f); + for (i=0; i < nsmp; ++i) { + if ((i & 1) == 0) inb = *in++; + *out++ = scale * (inb >> 4); + inb <<= 4; } - if (k > 0) *cur++ = scale * ((*in >> 4) ); } else if (depth == 2) { - for (k=x*img_n; k >= 4; k-=4, ++in) { - *cur++ = scale * ((*in >> 6) ); - *cur++ = scale * ((*in >> 4) & 0x03); - *cur++ = scale * ((*in >> 2) & 0x03); - *cur++ = scale * ((*in ) & 0x03); + for (i=0; i < nsmp; ++i) { + if ((i & 3) == 0) inb = *in++; + *out++ = scale * (inb >> 6); + inb <<= 2; } - if (k > 0) *cur++ = scale * ((*in >> 6) ); - if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); - if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); - } else if (depth == 1) { - for (k=x*img_n; k >= 8; k-=8, ++in) { - *cur++ = scale * ((*in >> 7) ); - *cur++ = scale * ((*in >> 6) & 0x01); - *cur++ = scale * ((*in >> 5) & 0x01); - *cur++ = scale * ((*in >> 4) & 0x01); - *cur++ = scale * ((*in >> 3) & 0x01); - *cur++ = scale * ((*in >> 2) & 0x01); - *cur++ = scale * ((*in >> 1) & 0x01); - *cur++ = scale * ((*in ) & 0x01); + } else { + STBI_ASSERT(depth == 1); + for (i=0; i < nsmp; ++i) { + if ((i & 7) == 0) inb = *in++; + *out++ = scale * (inb >> 7); + inb <<= 1; } - if (k > 0) *cur++ = scale * ((*in >> 7) ); - if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); - if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); - if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); - if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); - if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); - if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); } - if (img_n != out_n) { - int q; - // insert alpha = 255 - cur = a->out + stride*j; + + // insert alpha=255 values if desired + if (img_n != out_n) + stbi__create_png_alpha_expand8(dest, dest, x, img_n); + } else if (depth == 8) { + if (img_n == out_n) + memcpy(dest, cur, x*img_n); + else + stbi__create_png_alpha_expand8(dest, cur, x, img_n); + } else if (depth == 16) { + // convert the image data from big-endian to platform-native + stbi__uint16 *dest16 = (stbi__uint16*)dest; + stbi__uint32 nsmp = x*img_n; + + if (img_n == out_n) { + for (i = 0; i < nsmp; ++i, ++dest16, cur += 2) + *dest16 = (cur[0] << 8) | cur[1]; + } else { + STBI_ASSERT(img_n+1 == out_n); if (img_n == 1) { - for (q=x-1; q >= 0; --q) { - cur[q*2+1] = 255; - cur[q*2+0] = cur[q]; + for (i = 0; i < x; ++i, dest16 += 2, cur += 2) { + dest16[0] = (cur[0] << 8) | cur[1]; + dest16[1] = 0xffff; } } else { STBI_ASSERT(img_n == 3); - for (q=x-1; q >= 0; --q) { - cur[q*4+3] = 255; - cur[q*4+2] = cur[q*3+2]; - cur[q*4+1] = cur[q*3+1]; - cur[q*4+0] = cur[q*3+0]; + for (i = 0; i < x; ++i, dest16 += 4, cur += 6) { + dest16[0] = (cur[0] << 8) | cur[1]; + dest16[1] = (cur[2] << 8) | cur[3]; + dest16[2] = (cur[4] << 8) | cur[5]; + dest16[3] = 0xffff; } } } } - } else if (depth == 16) { - // force the image data from big-endian to platform-native. - // this is done in a separate pass due to the decoding relying - // on the data being untouched, but could probably be done - // per-line during decode if care is taken. - stbi_uc *cur = a->out; - stbi__uint16 *cur16 = (stbi__uint16*)cur; - - for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { - *cur16 = (cur[0] << 8) | cur[1]; - } } + STBI_FREE(filter_buf); + if (!all_ok) return 0; + return 1; } @@ -5161,9 +5160,11 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) // non-paletted with tRNS = constant alpha. if header-scanning, we can stop now. if (scan == STBI__SCAN_header) { ++s->img_n; return 1; } if (z->depth == 16) { - for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is + for (k = 0; k < s->img_n && k < 3; ++k) // extra loop test to suppress false GCC warning + tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is } else { - for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger + for (k = 0; k < s->img_n && k < 3; ++k) + tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger } } break; From dc679cd1c77d89d604aa4d8efcde00f113ee32ac Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:12:38 +0200 Subject: [PATCH 061/155] Update stb_image_resize2.h --- src/external/stb_image_resize2.h | 131 +++++++++++++++++++------------ 1 file changed, 80 insertions(+), 51 deletions(-) diff --git a/src/external/stb_image_resize2.h b/src/external/stb_image_resize2.h index ae8d730bf..2f2627463 100644 --- a/src/external/stb_image_resize2.h +++ b/src/external/stb_image_resize2.h @@ -1,4 +1,4 @@ -/* stb_image_resize2 - v2.10 - public domain image resizing +/* stb_image_resize2 - v2.12 - public domain image resizing by Jeff Roberts (v2) and Jorge L Rodriguez http://github.com/nothings/stb @@ -11,35 +11,6 @@ #define STB_IMAGE_RESIZE_IMPLEMENTATION before the #include. That will create the implementation in that file. - PORTING FROM VERSION 1 - - The API has changed. You can continue to use the old version of stb_image_resize.h, - which is available in the "deprecated/" directory. - - If you're using the old simple-to-use API, porting is straightforward. - (For more advanced APIs, read the documentation.) - - stbir_resize_uint8(): - - call `stbir_resize_uint8_linear`, cast channel count to `stbir_pixel_layout` - - stbir_resize_float(): - - call `stbir_resize_float_linear`, cast channel count to `stbir_pixel_layout` - - stbir_resize_uint8_srgb(): - - function name is unchanged - - cast channel count to `stbir_pixel_layout` - - above is sufficient unless your image has alpha and it's not RGBA/BGRA - - in that case, follow the below instructions for stbir_resize_uint8_srgb_edgemode - - stbir_resize_uint8_srgb_edgemode() - - switch to the "medium complexity" API - - stbir_resize(), very similar API but a few more parameters: - - pixel_layout: cast channel count to `stbir_pixel_layout` - - data_type: STBIR_TYPE_UINT8_SRGB - - edge: unchanged (STBIR_EDGE_WRAP, etc.) - - filter: STBIR_FILTER_DEFAULT - - which channel is alpha is specified in stbir_pixel_layout, see enum for details - EASY API CALLS: Easy API downsamples w/Mitchell filter, upsamples w/cubic interpolation, clamps to edge. @@ -296,6 +267,34 @@ ASSERT Define STBIR_ASSERT(boolval) to override assert() and not use assert.h + PORTING FROM VERSION 1 + The API has changed. You can continue to use the old version of stb_image_resize.h, + which is available in the "deprecated/" directory. + + If you're using the old simple-to-use API, porting is straightforward. + (For more advanced APIs, read the documentation.) + + stbir_resize_uint8(): + - call `stbir_resize_uint8_linear`, cast channel count to `stbir_pixel_layout` + + stbir_resize_float(): + - call `stbir_resize_float_linear`, cast channel count to `stbir_pixel_layout` + + stbir_resize_uint8_srgb(): + - function name is unchanged + - cast channel count to `stbir_pixel_layout` + - above is sufficient unless your image has alpha and it's not RGBA/BGRA + - in that case, follow the below instructions for stbir_resize_uint8_srgb_edgemode + + stbir_resize_uint8_srgb_edgemode() + - switch to the "medium complexity" API + - stbir_resize(), very similar API but a few more parameters: + - pixel_layout: cast channel count to `stbir_pixel_layout` + - data_type: STBIR_TYPE_UINT8_SRGB + - edge: unchanged (STBIR_EDGE_WRAP, etc.) + - filter: STBIR_FILTER_DEFAULT + - which channel is alpha is specified in stbir_pixel_layout, see enum for details + FUTURE TODOS * For polyphase integral filters, we just memcpy the coeffs to dupe them, but we should indirect and use the same coeff memory. @@ -328,6 +327,10 @@ Nathan Reed: warning fixes for 1.0 REVISIONS + 2.12 (2024-10-18) fix incorrect use of user_data with STBIR_FREE + 2.11 (2024-09-08) fix harmless asan warnings in 2-channel and 3-channel mode + with AVX-2, fix some weird scaling edge conditions with + point sample mode. 2.10 (2024-07-27) fix the defines GCC and mingw for loop unroll control, fix MSVC 32-bit arm half float routines. 2.09 (2024-06-19) fix the defines for 32-bit ARM GCC builds (was selecting @@ -3247,6 +3250,7 @@ static void stbir__calculate_in_pixel_range( int * first_pixel, int * last_pixel first = (int)(STBIR_FLOORF(in_pixel_influence_lowerbound + 0.5f)); last = (int)(STBIR_FLOORF(in_pixel_influence_upperbound - 0.5f)); + if ( last < first ) last = first; // point sample mode can span a value *right* at 0.5, and cause these to cross if ( edge == STBIR_EDGE_WRAP ) { @@ -3282,6 +3286,11 @@ static void stbir__calculate_coefficients_for_gather_upsample( float out_filter_ stbir__calculate_in_pixel_range( &in_first_pixel, &in_last_pixel, out_pixel_center, out_filter_radius, inv_scale, out_shift, input_size, edge ); + // make sure we never generate a range larger than our precalculated coeff width + // this only happens in point sample mode, but it's a good safe thing to do anyway + if ( ( in_last_pixel - in_first_pixel + 1 ) > coefficient_width ) + in_last_pixel = in_first_pixel + coefficient_width - 1; + last_non_zero = -1; for (i = 0; i <= in_last_pixel - in_first_pixel; i++) { @@ -3317,19 +3326,22 @@ static void stbir__calculate_coefficients_for_gather_upsample( float out_filter_ } } -static void stbir__insert_coeff( stbir__contributors * contribs, float * coeffs, int new_pixel, float new_coeff ) +static void stbir__insert_coeff( stbir__contributors * contribs, float * coeffs, int new_pixel, float new_coeff, int max_width ) { if ( new_pixel <= contribs->n1 ) // before the end { if ( new_pixel < contribs->n0 ) // before the front? { - int j, o = contribs->n0 - new_pixel; - for ( j = contribs->n1 - contribs->n0 ; j <= 0 ; j-- ) - coeffs[ j + o ] = coeffs[ j ]; - for ( j = 1 ; j < o ; j-- ) - coeffs[ j ] = coeffs[ 0 ]; - coeffs[ 0 ] = new_coeff; - contribs->n0 = new_pixel; + if ( ( contribs->n1 - new_pixel + 1 ) <= max_width ) + { + int j, o = contribs->n0 - new_pixel; + for ( j = contribs->n1 - contribs->n0 ; j <= 0 ; j-- ) + coeffs[ j + o ] = coeffs[ j ]; + for ( j = 1 ; j < o ; j-- ) + coeffs[ j ] = coeffs[ 0 ]; + coeffs[ 0 ] = new_coeff; + contribs->n0 = new_pixel; + } } else { @@ -3338,12 +3350,15 @@ static void stbir__insert_coeff( stbir__contributors * contribs, float * coeffs, } else { - int j, e = new_pixel - contribs->n0; - for( j = ( contribs->n1 - contribs->n0 ) + 1 ; j < e ; j++ ) // clear in-betweens coeffs if there are any - coeffs[j] = 0; + if ( ( new_pixel - contribs->n0 + 1 ) <= max_width ) + { + int j, e = new_pixel - contribs->n0; + for( j = ( contribs->n1 - contribs->n0 ) + 1 ; j < e ; j++ ) // clear in-betweens coeffs if there are any + coeffs[j] = 0; - coeffs[ e ] = new_coeff; - contribs->n1 = new_pixel; + coeffs[ e ] = new_coeff; + contribs->n1 = new_pixel; + } } } @@ -3522,6 +3537,7 @@ static void stbir__cleanup_gathered_coefficients( stbir_edge edge, stbir__filter coeffs = coefficient_group; contribs = contributors; + for (n = 0; n < num_contributors; n++) { int i; @@ -3561,7 +3577,7 @@ static void stbir__cleanup_gathered_coefficients( stbir_edge edge, stbir__filter int endi = contribs->n1; contribs->n1 = input_last_n1; for( i = input_size; i <= endi; i++ ) - stbir__insert_coeff( contribs, coeffs, stbir__edge_wrap_slow[edge]( i, input_size ), coeffs[i-start] ); + stbir__insert_coeff( contribs, coeffs, stbir__edge_wrap_slow[edge]( i, input_size ), coeffs[i-start], coefficient_width ); } // now check left hand edge @@ -3573,7 +3589,7 @@ static void stbir__cleanup_gathered_coefficients( stbir_edge edge, stbir__filter // reinsert the coeffs with it reflected or clamped (insert accumulates, if the coeffs exist) for( i = -1 ; i > contribs->n0 ; i-- ) - stbir__insert_coeff( contribs, coeffs, stbir__edge_wrap_slow[edge]( i, input_size ), *c-- ); + stbir__insert_coeff( contribs, coeffs, stbir__edge_wrap_slow[edge]( i, input_size ), *c--, coefficient_width ); save_n0 = contribs->n0; save_n0_coeff = c[0]; // save it, since we didn't do the final one (i==n0), because there might be too many coeffs to hold (before we resize)! @@ -3583,7 +3599,7 @@ static void stbir__cleanup_gathered_coefficients( stbir_edge edge, stbir__filter coeffs[i] = coeffs[i-save_n0]; // now that we have shrunk down the contribs, we insert the first one safely - stbir__insert_coeff( contribs, coeffs, stbir__edge_wrap_slow[edge]( save_n0, input_size ), save_n0_coeff ); + stbir__insert_coeff( contribs, coeffs, stbir__edge_wrap_slow[edge]( save_n0, input_size ), save_n0_coeff, coefficient_width ); } } @@ -3592,6 +3608,7 @@ static void stbir__cleanup_gathered_coefficients( stbir_edge edge, stbir__filter int diff = contribs->n1 - contribs->n0 + 1; while ( diff && ( coeffs[ diff-1 ] == 0.0f ) ) --diff; + contribs->n1 = contribs->n0 + diff - 1; if ( contribs->n0 <= contribs->n1 ) @@ -3964,7 +3981,7 @@ static void stbir__calculate_filters( stbir__sampler * samp, stbir__sampler * ot } else { - stbir__insert_coeff( scatter_contributors, scatter_coeffs, n, gc ); + stbir__insert_coeff( scatter_contributors, scatter_coeffs, n, gc, scatter_coefficient_width ); } STBIR_ASSERT( ( scatter_contributors->n1 - scatter_contributors->n0 + 1 ) <= scatter_coefficient_width ); } @@ -4810,12 +4827,13 @@ static void stbir__decode_scanline(stbir__info const * stbir_info, int n, float stbir__simdf8_madd_mem( tot0, tot0, c, decode+(ofs)*2 ); #define stbir__1_coeff_remnant( ofs ) \ - { stbir__simdf t; \ + { stbir__simdf t,d; \ stbir__simdf_load1z( t, hc + (ofs) ); \ + stbir__simdf_load2( d, decode + (ofs) * 2 ); \ stbir__simdf_0123to0011( t, t ); \ - stbir__simdf_mult_mem( t, t, decode+(ofs)*2 ); \ + stbir__simdf_mult( t, t, d ); \ stbir__simdf8_add4( tot0, tot0, t ); } - + #define stbir__2_coeff_remnant( ofs ) \ { stbir__simdf t; \ stbir__simdf_load2( t, hc + (ofs) ); \ @@ -6714,7 +6732,7 @@ static void stbir__free_internal_mem( stbir__info *info ) STBIR__FREE_AND_CLEAR( info->horizontal.coefficients ); STBIR__FREE_AND_CLEAR( info->horizontal.contributors ); STBIR__FREE_AND_CLEAR( info->alloced_mem ); - STBIR__FREE_AND_CLEAR( info ); + STBIR_FREE( info, info->user_data ); #endif } @@ -7112,6 +7130,11 @@ static stbir__info * stbir__alloc_internal_mem_and_build_samplers( stbir__sample #ifdef STBIR__SEPARATE_ALLOCATIONS temp_mem_amt = decode_buffer_size; + + #ifdef STBIR_SIMD8 + if ( effective_channels == 3 ) + --temp_mem_amt; // avx in 3 channel mode needs one float at the start of the buffer + #endif #else temp_mem_amt = ( decode_buffer_size + ring_buffer_size + vertical_buffer_size ) * splits; #endif @@ -7217,6 +7240,12 @@ static stbir__info * stbir__alloc_internal_mem_and_build_samplers( stbir__sample int t, ofs, start; ofs = decode_buffer_size / 4; + + #if defined( STBIR__SEPARATE_ALLOCATIONS ) && defined(STBIR_SIMD8) + if ( effective_channels == 3 ) + --ofs; // avx in 3 channel mode needs one float at the start of the buffer, so we snap back for clearing + #endif + start = ofs - 4; if ( start < 0 ) start = 0; From ec79bffa2073a2471dd803c8983d4c4ace2e3104 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:13:05 +0200 Subject: [PATCH 062/155] Update stb_truetype.h --- src/external/stb_truetype.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/external/stb_truetype.h b/src/external/stb_truetype.h index bbf2284b1..90a5c2e2b 100644 --- a/src/external/stb_truetype.h +++ b/src/external/stb_truetype.h @@ -54,7 +54,7 @@ // Hou Qiming Derek Vinyard // Rob Loach Cort Stratton // Kenney Phillis Jr. Brian Costabile -// Ken Voskuil (kaesve) +// Ken Voskuil (kaesve) Yakov Galka // // VERSION HISTORY // @@ -4604,6 +4604,8 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc scale_y = -scale_y; { + // distance from singular values (in the same units as the pixel grid) + const float eps = 1./1024, eps2 = eps*eps; int x,y,i,j; float *precompute; stbtt_vertex *verts; @@ -4616,15 +4618,15 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y; float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); - precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist; + precompute[i] = (dist < eps) ? 0.0f : 1.0f / dist; } else if (verts[i].type == STBTT_vcurve) { float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y; float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y; float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y; float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; float len2 = bx*bx + by*by; - if (len2 != 0.0f) - precompute[i] = 1.0f / (bx*bx + by*by); + if (len2 >= eps2) + precompute[i] = 1.0f / len2; else precompute[i] = 0.0f; } else @@ -4689,8 +4691,8 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc float a = 3*(ax*bx + ay*by); float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by); float c = mx*ax+my*ay; - if (a == 0.0) { // if a is 0, it's linear - if (b != 0.0) { + if (STBTT_fabs(a) < eps2) { // if a is 0, it's linear + if (STBTT_fabs(b) >= eps2) { res[num++] = -c/b; } } else { From 3dcddaedd79540cb09e7fe125f71463120d45cf2 Mon Sep 17 00:00:00 2001 From: NishiOwO <89888985+NishiOwO@users.noreply.github.com> Date: Sat, 26 Oct 2024 20:41:54 +0900 Subject: [PATCH 063/155] Fix examples Makefile for NetBSD (#4438) * fix makefile * moving to LDPATHS * fix clean and ldlibs stuff --- examples/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/Makefile b/examples/Makefile index 969c246e1..7dc891ec1 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -268,7 +268,7 @@ INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external # Define additional directories containing required header files ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),BSD) - INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) + INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include endif ifeq ($(PLATFORM_OS),LINUX) INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) @@ -401,6 +401,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling # NOTE: Required packages: mesa-libs + LDFLAGS += -L /usr/pkg/lib -L /usr/X11R7/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R7/lib LDLIBS = -lraylib -lGL -lpthread -lm # On XWindow requires also below libraries @@ -677,6 +678,10 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),WINDOWS) del *.o *.exe /s endif + ifeq ($(PLATFORM_OS),BSD) + find . -type f -perm -ugo+x -delete + rm -fv *.o + endif ifeq ($(PLATFORM_OS),LINUX) find . -type f -executable -delete rm -fv *.o From 8b9ea8cd5fb88449093c8e9db369c306f355f215 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:46:56 +0200 Subject: [PATCH 064/155] Update Makefile --- examples/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Makefile b/examples/Makefile index 7dc891ec1..87a4d2f87 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -401,7 +401,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling # NOTE: Required packages: mesa-libs - LDFLAGS += -L /usr/pkg/lib -L /usr/X11R7/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R7/lib + LDFLAGS += -L/usr/pkg/lib -L/usr/X11R7/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R7/lib LDLIBS = -lraylib -lGL -lpthread -lm # On XWindow requires also below libraries From 7ad8fa689f92de4796d9a4121677a16cd8798c81 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 26 Oct 2024 13:51:10 +0200 Subject: [PATCH 065/155] REVIEWED: `LoadTextureCubemap()` to avoid crash #4429 --- src/rtextures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtextures.c b/src/rtextures.c index 076452311..84144068d 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4194,7 +4194,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) faces = GenImageColor(size, size*6, MAGENTA); ImageFormat(&faces, image.format); - ImageMipmaps(&image); + //ImageMipmaps(&image); // WARNING: image is a copy, it can't be done here, no intention to pass image by reference... ImageMipmaps(&faces); // NOTE: Image formatting does not work with compressed textures From ff66b49c19b88b9953a140034e20c60066099e18 Mon Sep 17 00:00:00 2001 From: NishiOwO <89888985+NishiOwO@users.noreply.github.com> Date: Sat, 26 Oct 2024 22:10:35 +0900 Subject: [PATCH 066/155] fix (#4440) --- examples/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Makefile b/examples/Makefile index 87a4d2f87..ee3f1fc4c 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -401,7 +401,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling # NOTE: Required packages: mesa-libs - LDFLAGS += -L/usr/pkg/lib -L/usr/X11R7/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R7/lib + LDFLAGS += -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib LDLIBS = -lraylib -lGL -lpthread -lm # On XWindow requires also below libraries From 38cf9f32244cd46254800b16fbd98e4951a0ea60 Mon Sep 17 00:00:00 2001 From: Nikolas Date: Sat, 26 Oct 2024 22:52:24 +0200 Subject: [PATCH 067/155] [rtextures] LoadTextureCubemap(): Copy image before generating mipmaps, to avoid dangling re-allocated pointers (#4439) --- src/rtextures.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 84144068d..92186dd96 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4194,12 +4194,15 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) faces = GenImageColor(size, size*6, MAGENTA); ImageFormat(&faces, image.format); - //ImageMipmaps(&image); // WARNING: image is a copy, it can't be done here, no intention to pass image by reference... + Image mipmapped = ImageCopy(image); + ImageMipmaps(&mipmapped); ImageMipmaps(&faces); // NOTE: Image formatting does not work with compressed textures - for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); + for (int i = 0; i < 6; i++) ImageDraw(&faces, mipmapped, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); + + UnloadImage(mipmapped); } // NOTE: Cubemap data is expected to be provided as 6 images in a single data array, From 7fe5f7126b2117545c781fc4caaa67d08f6ec89c Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Sat, 26 Oct 2024 16:59:10 -0400 Subject: [PATCH 068/155] Fix MSVC errors for PLATFORM_DESKTOP_RGFW (#4441) * (rcore_desktop_rgfw.c) fix errors when compiling with mingw * define WideCharToMultiByte * update RGFW * move stdcall def to windows only * fix raw cursor input * Fix warnings, update RGFW, fix msvc errors (make sure windows macro _WIN32 is correct) --- src/external/RGFW.h | 50 +++++++++++++++++++++--------- src/platforms/rcore_desktop_rgfw.c | 16 +++++++--- src/rcore.c | 4 +-- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/external/RGFW.h b/src/external/RGFW.h index fb389d5b4..978536f2d 100644 --- a/src/external/RGFW.h +++ b/src/external/RGFW.h @@ -38,6 +38,7 @@ #define RGFW_OPENGL_ES2 - (optional) use OpenGL ES (version 2) #define RGFW_OPENGL_ES3 - (optional) use OpenGL ES (version 3) #define RGFW_DIRECTX - (optional) use directX for the rendering backend (rather than opengl) (windows only, defaults to opengl for unix) + #define RGFW_WEBGPU - (optional) use webGPU for rendering (Web ONLY) #define RGFW_NO_API - (optional) don't use any rendering API (no opengl, no vulkan, no directX) #define RGFW_LINK_EGL (optional) (windows only) if EGL is being used, if EGL functions should be defined dymanically (using GetProcAddress) @@ -84,6 +85,9 @@ Rob Rohan -> X11 bugs and missing features, MacOS/Cocoa fixing memory issues/bugs AICDG (@THISISAGOODNAME) -> vulkan support (example) @Easymode -> support, testing/debugging, bug fixes and reviews + Joshua Rowe (omnisci3nce) - bug fix, review (macOS) + @lesleyrs -> bug fix, review (OpenGL) + Nick Porcino (meshula) - testing, organization, review (MacOS, examples) */ #if _MSC_VER @@ -201,7 +205,7 @@ #ifdef __EMSCRIPTEN__ #define RGFW_WEBASM - #ifndef RGFW_NO_API + #if !defined(RGFW_NO_API) && !defined(RGFW_WEBGPU) #define RGFW_OPENGL #endif @@ -211,6 +215,10 @@ #include #include + + #ifdef RGFW_WEBGPU + #include + #endif #endif #if defined(RGFW_X11) && defined(__APPLE__) @@ -573,7 +581,13 @@ typedef struct RGFW_window_src { void* image; #endif #elif defined(RGFW_WEBASM) - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx; + #ifdef RGFW_WEBGPU + WGPUInstance ctx; + WGPUDevice device; + WGPUQueue queue; + #else + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx; + #endif #endif } RGFW_window_src; @@ -1180,9 +1194,9 @@ int main() { static : ar rcs RGFW.a RGFW.o shared : windows: - gcc -shared RGFW.o -lopengl32 -lshell32 -lgdi32 -o RGFW.dll + gcc -shared RGFW.o -lwinmm -lopengl32 -lshell32 -lgdi32 -o RGFW.dll linux: - gcc -shared RGFW.o -lX11 -lXcursor -lGL -o RGFW.so + gcc -shared RGFW.o -lX11 -lXcursor -lGL -lXrandr -o RGFW.so macos: gcc -shared RGFW.o -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo */ @@ -1406,7 +1420,7 @@ char RGFW_keyCodeToChar(u32 keycode, b8 shift) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '`', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '=', 0, '\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', ',', '/', '[', ']', ';', '\n', '\'', '\\', - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', '*', '-', '1', '2', '3', '3', '5', '6', '7', '8', '9', '0', '\n' + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', '*', '-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\n' }; static const char mapCaps[] = { @@ -1969,7 +1983,7 @@ void RGFW_updateLockState(RGFW_window* win, b8 capital, b8 numlock) { size_t index = (sizeof(attribs) / sizeof(attribs[0])) - 13; -#define RGFW_GL_ADD_ATTRIB(attrib, attVal) \ + #define RGFW_GL_ADD_ATTRIB(attrib, attVal) \ if (attVal) { \ attribs[index] = attrib;\ attribs[index + 1] = attVal;\ @@ -2522,7 +2536,8 @@ Start of Linux / Unix defines 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 || best_fbc == -1)) { + if ((!(args & RGFW_TRANSPARENT_WINDOW) || vi->depth == 32) && + (best_fbc < 0 || samp_buf) && (samples == RGFW_SAMPLES || best_fbc == -1)) { best_fbc = i; } } @@ -2538,11 +2553,6 @@ Start of Linux / Unix defines XVisualInfo* vi = glXGetVisualFromFBConfig((Display*) win->src.display, bestFbc); XFree(fbc); - - if (args & RGFW_TRANSPARENT_WINDOW) { - XMatchVisualInfo((Display*) win->src.display, DefaultScreen((Display*) win->src.display), 32, TrueColor, vi); /*!< for RGBA backgrounds*/ - } - #else XVisualInfo viNorm; @@ -8547,7 +8557,8 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { RGFW_UNUSED(RGFW_initFormatAttribs); RGFW_window* win = RGFW_window_basic_init(rect, args); - + +#ifndef RGFW_WEBGPU EmscriptenWebGLContextAttributes attrs; attrs.alpha = EM_TRUE; attrs.depth = EM_TRUE; @@ -8576,6 +8587,11 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { #ifdef LEGACY_GL_EMULATION EM_ASM("Module.useWebGL = true; GLImmediate.init();"); #endif +#else + win->src.ctx = wgpuCreateInstance(NULL); + win->src.device = emscripten_webgpu_get_device(); + win->src.queue = wgpuDeviceGetQueue(win->src.device); +#endif emscripten_set_canvas_element_size("#canvas", rect.w, rect.h); emscripten_set_window_title(name); @@ -8871,16 +8887,20 @@ void RGFW_window_swapBuffers(RGFW_window* win) { } #endif +#ifndef RGFW_WEBGPU emscripten_webgl_commit_frame(); +#endif emscripten_sleep(0); } void RGFW_window_makeCurrent_OpenGL(RGFW_window* win) { +#ifndef RGFW_WEBGPU if (win == NULL) emscripten_webgl_make_context_current(0); else emscripten_webgl_make_context_current(win->src.ctx); +#endif } #ifndef RGFW_EGL @@ -8888,7 +8908,9 @@ void RGFW_window_swapInterval(RGFW_window* win, i32 swapInterval) { RGFW_UNUSED( #endif void RGFW_window_close(RGFW_window* win) { - emscripten_webgl_destroy_context(win->src.ctx); +#ifndef RGFW_WEBGPU + emscripten_webgl_destroy_context(win->src.ctx); +#endif free(win); } diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 20bff2128..98d4fec75 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -63,13 +63,16 @@ void CloseWindow(void); #define RGFW_IMPLEMENTATION -#if defined(__WIN32) || defined(__WIN64) +#if defined(_WIN32) || defined(_WIN64) #define WIN32_LEAN_AND_MEAN - #define Rectangle rectangle_win32 + #define Rectangle rectangle_win32 #define CloseWindow CloseWindow_win32 #define ShowCursor __imp_ShowCursor - #define _APISETSTRING_ - __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char *lpMultiByteStr, int cbMultiByte, wchar_t *lpWideCharStr, int cchWideChar); + #define _APISETSTRING_ + + #undef MAX_PATH + + __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char *lpMultiByteStr, int cbMultiByte, wchar_t *lpWideCharStr, int cchWideChar); #endif #if defined(__APPLE__) @@ -79,11 +82,14 @@ void CloseWindow(void); #include "../external/RGFW.h" -#if defined(__WIN32) || defined(__WIN64) +#if defined(_WIN32) || defined(_WIN64) #undef DrawText #undef ShowCursor #undef CloseWindow #undef Rectangle + + #undef MAX_PATH + #define MAX_PATH 1025 #endif #if defined(__APPLE__) diff --git a/src/rcore.c b/src/rcore.c index 9734972cf..75b9bf451 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -161,8 +161,8 @@ __declspec(dllimport) unsigned long __stdcall GetModuleFileNameA(void *hModule, void *lpFilename, unsigned long nSize); __declspec(dllimport) unsigned long __stdcall GetModuleFileNameW(void *hModule, void *lpFilename, unsigned long nSize); __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, void *widestr, int cchwide, void *str, int cbmb, void *defchar, int *used_default); -unsigned int __stdcall timeBeginPeriod(unsigned int uPeriod); -unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); +__declspec(dllimport) unsigned int __stdcall timeBeginPeriod(unsigned int uPeriod); +__declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); #elif defined(__linux__) #include #elif defined(__FreeBSD__) From 0e1fc33c5c85a81fb1397e1f98f6bed68519e8fc Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sat, 26 Oct 2024 13:59:50 -0700 Subject: [PATCH 069/155] Fix signed/unsigned mismatch in rlgl (#4443) --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 34cae97e8..756656e58 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3408,7 +3408,7 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi if (glInternalFormat != 0) { // Load cubemap faces/mipmaps - for (unsigned int i = 0; i < 6*mipmapCount; i++) + for (int i = 0; i < 6*mipmapCount; i++) { int mipmapLevel = i/6; int face = i%6; From f59e185d7a733ab7f94cb3912c2cb938f157e36f Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 27 Oct 2024 22:27:18 +0100 Subject: [PATCH 070/155] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 303bbcdd1..29173d665 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ features - Written in plain C code (C99) using PascalCase/camelCase notation - Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**) - **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) - - Multiple **Fonts** formats supported (TTF, OTF, Image fonts, AngelCode fonts) + - Multiple **Fonts** formats supported (TTF, OTF, FNT, BDF, sprite fonts) - Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC) - **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more! - Flexible Materials system, supporting classic maps and **PBR maps** @@ -82,7 +82,7 @@ build and installation raylib binary releases for Windows, Linux, macOS, Android and HTML5 are available at the [Github Releases page](https://github.com/raysan5/raylib/releases). -raylib is also available via multiple [package managers](https://github.com/raysan5/raylib/issues/613) on multiple OS distributions. +raylib is also available via multiple package managers on multiple OS distributions. #### Installing and building raylib on multiple platforms From de7ab83f5a0f32d0f03867186c13371cb22fd286 Mon Sep 17 00:00:00 2001 From: mpv-enjoyer <123133847+mpv-enjoyer@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:33:03 +0000 Subject: [PATCH 071/155] Fix empty input string for MeasureTextEx (#4448) --- src/rtext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 3510671be..5665b01fc 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1327,7 +1327,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing if (tempTextWidth < textWidth) tempTextWidth = textWidth; - textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); + if (size > 0) textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); textSize.y = textHeight; return textSize; From 743e557e1e589386fbedd4b13ab66ffaff93c901 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Tue, 29 Oct 2024 01:34:57 -0700 Subject: [PATCH 072/155] Fix inconsistent dll linkage warning on windows (#4447) --- src/platforms/rcore_desktop_glfw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 41f7fac39..b6097981f 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -65,8 +65,9 @@ #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) // NOTE: Those functions require linking with winmm library - unsigned int __stdcall timeBeginPeriod(unsigned int uPeriod); +#pragma warning( disable : 4273 ) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); +#pragma warning(default : 4273) #endif #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) From 10c8e4e43590cb548d3ff70ab10ead0cabfe0055 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 29 Oct 2024 09:37:33 +0100 Subject: [PATCH 073/155] Update rcore_desktop_glfw.c --- src/platforms/rcore_desktop_glfw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index b6097981f..45811e766 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -65,9 +65,9 @@ #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) // NOTE: Those functions require linking with winmm library -#pragma warning( disable : 4273 ) + #pragma warning(disable: 4273) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); -#pragma warning(default : 4273) + #pragma warning(default: 4273) #endif #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) From d15e5834607187ba73c13be906be98848f4e93c0 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 29 Oct 2024 09:37:38 +0100 Subject: [PATCH 074/155] Update rtext.c --- src/rtext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 5665b01fc..81bfe1a8a 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1282,7 +1282,8 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing { Vector2 textSize = { 0 }; - if ((isGpuReady && (font.texture.id == 0)) || (text == NULL)) return textSize; // Security check + if ((isGpuReady && (font.texture.id == 0)) || + (text == NULL) || (text[0] == '\0')) return textSize; // Security check int size = TextLength(text); // Get size in bytes of text int tempByteCounter = 0; // Used to count longer text line num chars @@ -1327,7 +1328,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing if (tempTextWidth < textWidth) tempTextWidth = textWidth; - if (size > 0) textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); + textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); textSize.y = textHeight; return textSize; From ad79d4a88422256d348ecfd06c53f8bc44b7777f Mon Sep 17 00:00:00 2001 From: "Everton Jr." <69195288+evertonse@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:23:51 -0300 Subject: [PATCH 075/155] [shapes] Add `shapes_rectangle_advanced ` example implementing a `DrawRectangleRoundedGradientH` function (#4435) * [rshapes] Add function * "[shapes] rectangle advanced: fix screen width and height to fit with other examples" --- examples/Makefile | 3 +- examples/Makefile.Web | 3 + examples/README.md | 163 ++++---- examples/shapes/shapes_rectangle_advanced.c | 330 +++++++++++++++ examples/shapes/shapes_rectangle_advanced.png | Bin 0 -> 6839 bytes .../shapes_rectangle_advanced.vcxproj | 390 ++++++++++++++++++ projects/VS2022/raylib.sln | 2 + 7 files changed, 809 insertions(+), 82 deletions(-) create mode 100644 examples/shapes/shapes_rectangle_advanced.c create mode 100644 examples/shapes/shapes_rectangle_advanced.png create mode 100644 projects/VS2022/examples/shapes_rectangle_advanced.vcxproj diff --git a/examples/Makefile b/examples/Makefile index ee3f1fc4c..a3ce8f6d1 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -532,7 +532,8 @@ SHAPES = \ shapes/shapes_logo_raylib_anim \ shapes/shapes_rectangle_scaling \ shapes/shapes_splines_drawing \ - shapes/shapes_top_down_lights + shapes/shapes_top_down_lights \ + shapes/shapes_rectangle_advanced TEXTURES = \ textures/textures_background_scrolling \ diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 7e2aaacc5..250145053 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -696,6 +696,9 @@ shapes/shapes_splines_drawing: shapes/shapes_splines_drawing.c shapes/shapes_top_down_lights: shapes/shapes_top_down_lights.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +shapes/shapes_rectangle_advanced: shapes/shapes_rectangle_advanced.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + # Compile TEXTURES examples textures/textures_background_scrolling: textures/textures_background_scrolling.c diff --git a/examples/README.md b/examples/README.md index ee528d049..d25ad10cc 100644 --- a/examples/README.md +++ b/examples/README.md @@ -80,6 +80,7 @@ Examples using raylib shapes drawing functionality, provided by raylib [shapes]( | 47 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | shapes_draw_circle_sector | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | | 48 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | shapes_draw_rectangle_rounded | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) | | 49 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | shapes_top_down_lights | â­ï¸â­ï¸â­ï¸â­ï¸ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) | +| 50 | [shapes_rectangle_advanced](shapes/shapes_rectangle_advanced.c) | shapes_rectangle_advanced | â­ï¸â­ï¸â­ï¸â­ï¸â­ï¸| **5.0** | **5.0** | [ExCyber](https://github.com/evertonse) | ### category: textures @@ -87,28 +88,28 @@ Examples using raylib textures functionality, including image/textures loading/g | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | |----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 50 | [textures_logo_raylib](textures/textures_logo_raylib.c) | textures_logo_raylib | â­ï¸â˜†â˜†â˜† | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | -| 51 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | textures_srcrec_dstrec | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 52 | [textures_image_drawing](textures/textures_image_drawing.c) | textures_image_drawing | â­ï¸â­ï¸â˜†â˜† | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | -| 53 | [textures_image_generation](textures/textures_image_generation.c) | textures_image_generation | â­ï¸â­ï¸â˜†â˜† | 1.8 | 1.8 | [Ray](https://github.com/raysan5) | -| 54 | [textures_image_loading](textures/textures_image_loading.c) | textures_image_loading | â­ï¸â˜†â˜†â˜† | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 55 | [textures_image_processing](textures/textures_image_processing.c) | textures_image_processing | â­ï¸â­ï¸â­ï¸â˜† | 1.4 | 3.5 | [Ray](https://github.com/raysan5) | -| 56 | [textures_image_text](textures/textures_image_text.c) | textures_image_text | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | -| 57 | [textures_to_image](textures/textures_to_image.c) | textures_to_image | â­ï¸â˜†â˜†â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 58 | [textures_raw_data](textures/textures_raw_data.c) | textures_raw_data | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | -| 59 | [textures_particles_blending](textures/textures_particles_blending.c) | textures_particles_blending | â­ï¸â˜†â˜†â˜† | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | -| 60 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | textures_npatch_drawing | â­ï¸â­ï¸â­ï¸â˜† | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) | -| 61 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | â­ï¸â˜†â˜†â˜† | 2.0 | 2.5 | [Ray](https://github.com/raysan5) | -| 62 | [textures_sprite_anim](textures/textures_sprite_anim.c) | textures_sprite_anim | â­ï¸â­ï¸â˜†â˜† | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | -| 63 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | â­ï¸â­ï¸â˜†â˜† | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | -| 64 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 65 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | â­ï¸â­ï¸â­ï¸â˜† | 1.6 | 2.5 | [Ray](https://github.com/raysan5) | -| 66 | [textures_mouse_painting](textures/textures_mouse_painting.c) | textures_mouse_painting | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) | -| 67 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | â­ï¸â˜†â˜†â˜† | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) | -| 68 | [textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) | -| 69 | [textures_polygon](textures/textures_polygon.c) | textures_polygon | â­ï¸â˜†â˜†â˜† | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 70 | [textures_fog_of_war](textures/textures_fog_of_war.c) | textures_fog_of_war | â­ï¸â­ï¸â­ï¸â˜† | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | -| 71 | [textures_gif_player](textures/textures_gif_player.c) | textures_gif_player | â­ï¸â­ï¸â­ï¸â˜† | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | +| 51 | [textures_logo_raylib](textures/textures_logo_raylib.c) | textures_logo_raylib | â­ï¸â˜†â˜†â˜† | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | +| 52 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | textures_srcrec_dstrec | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 53 | [textures_image_drawing](textures/textures_image_drawing.c) | textures_image_drawing | â­ï¸â­ï¸â˜†â˜† | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | +| 54 | [textures_image_generation](textures/textures_image_generation.c) | textures_image_generation | â­ï¸â­ï¸â˜†â˜† | 1.8 | 1.8 | [Ray](https://github.com/raysan5) | +| 55 | [textures_image_loading](textures/textures_image_loading.c) | textures_image_loading | â­ï¸â˜†â˜†â˜† | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 56 | [textures_image_processing](textures/textures_image_processing.c) | textures_image_processing | â­ï¸â­ï¸â­ï¸â˜† | 1.4 | 3.5 | [Ray](https://github.com/raysan5) | +| 57 | [textures_image_text](textures/textures_image_text.c) | textures_image_text | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | +| 58 | [textures_to_image](textures/textures_to_image.c) | textures_to_image | â­ï¸â˜†â˜†â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | +| 59 | [textures_raw_data](textures/textures_raw_data.c) | textures_raw_data | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | +| 60 | [textures_particles_blending](textures/textures_particles_blending.c) | textures_particles_blending | â­ï¸â˜†â˜†â˜† | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | +| 61 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | textures_npatch_drawing | â­ï¸â­ï¸â­ï¸â˜† | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) | +| 62 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | â­ï¸â˜†â˜†â˜† | 2.0 | 2.5 | [Ray](https://github.com/raysan5) | +| 63 | [textures_sprite_anim](textures/textures_sprite_anim.c) | textures_sprite_anim | â­ï¸â­ï¸â˜†â˜† | 1.3 | 1.3 | [Ray](https://github.com/raysan5) | +| 64 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | â­ï¸â­ï¸â˜†â˜† | 2.5 | 2.5 | [Ray](https://github.com/raysan5) | +| 65 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 66 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | â­ï¸â­ï¸â­ï¸â˜† | 1.6 | 2.5 | [Ray](https://github.com/raysan5) | +| 67 | [textures_mouse_painting](textures/textures_mouse_painting.c) | textures_mouse_painting | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) | +| 68 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | â­ï¸â˜†â˜†â˜† | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) | +| 69 | [textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) | +| 70 | [textures_polygon](textures/textures_polygon.c) | textures_polygon | â­ï¸â˜†â˜†â˜† | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) | +| 71 | [textures_fog_of_war](textures/textures_fog_of_war.c) | textures_fog_of_war | â­ï¸â­ï¸â­ï¸â˜† | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | +| 72 | [textures_gif_player](textures/textures_gif_player.c) | textures_gif_player | â­ï¸â­ï¸â­ï¸â˜† | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | ### category: text @@ -116,18 +117,18 @@ Examples using raylib text functionality, including sprite fonts loading/generat | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | |----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 72 | [text_raylib_fonts](text/text_raylib_fonts.c) | text_raylib_fonts | â­ï¸â˜†â˜†â˜† | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | -| 73 | [text_font_spritefont](text/text_font_spritefont.c) | text_font_spritefont | â­ï¸â˜†â˜†â˜† | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | -| 74 | [text_font_filters](text/text_font_filters.c) | text_font_filters | â­ï¸â­ï¸â˜†â˜† | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | -| 75 | [text_font_loading](text/text_font_loading.c) | text_font_loading | â­ï¸â˜†â˜†â˜† | 1.4 | 3.0 | [Ray](https://github.com/raysan5) | -| 76 | [text_font_sdf](text/text_font_sdf.c) | text_font_sdf | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 77 | [text_format_text](text/text_format_text.c) | text_format_text | â­ï¸â˜†â˜†â˜† | 1.1 | 3.0 | [Ray](https://github.com/raysan5) | -| 78 | [text_input_box](text/text_input_box.c) | text_input_box | â­ï¸â­ï¸â˜†â˜† | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | -| 79 | [text_writing_anim](text/text_writing_anim.c) | text_writing_anim | â­ï¸â­ï¸â˜†â˜† | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | -| 80 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | text_rectangle_bounds | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | -| 81 | [text_unicode](text/text_unicode.c) | text_unicode | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | -| 82 | [text_draw_3d](text/text_draw_3d.c) | text_draw_3d | â­ï¸â­ï¸â­ï¸â­ï¸ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | -| 83 | [text_codepoints_loading](text/text_codepoints_loading.c) | text_codepoints_loading | â­ï¸â­ï¸â­ï¸â˜† | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | +| 73 | [text_raylib_fonts](text/text_raylib_fonts.c) | text_raylib_fonts | â­ï¸â˜†â˜†â˜† | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | +| 74 | [text_font_spritefont](text/text_font_spritefont.c) | text_font_spritefont | â­ï¸â˜†â˜†â˜† | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | +| 75 | [text_font_filters](text/text_font_filters.c) | text_font_filters | â­ï¸â­ï¸â˜†â˜† | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | +| 76 | [text_font_loading](text/text_font_loading.c) | text_font_loading | â­ï¸â˜†â˜†â˜† | 1.4 | 3.0 | [Ray](https://github.com/raysan5) | +| 77 | [text_font_sdf](text/text_font_sdf.c) | text_font_sdf | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | +| 78 | [text_format_text](text/text_format_text.c) | text_format_text | â­ï¸â˜†â˜†â˜† | 1.1 | 3.0 | [Ray](https://github.com/raysan5) | +| 79 | [text_input_box](text/text_input_box.c) | text_input_box | â­ï¸â­ï¸â˜†â˜† | 1.7 | 3.5 | [Ray](https://github.com/raysan5) | +| 80 | [text_writing_anim](text/text_writing_anim.c) | text_writing_anim | â­ï¸â­ï¸â˜†â˜† | 1.4 | 1.4 | [Ray](https://github.com/raysan5) | +| 81 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | text_rectangle_bounds | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | +| 82 | [text_unicode](text/text_unicode.c) | text_unicode | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | +| 83 | [text_draw_3d](text/text_draw_3d.c) | text_draw_3d | â­ï¸â­ï¸â­ï¸â­ï¸ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) | +| 84 | [text_codepoints_loading](text/text_codepoints_loading.c) | text_codepoints_loading | â­ï¸â­ï¸â­ï¸â˜† | **4.2** | **4.2** | [Ray](https://github.com/raysan5) | ### category: models @@ -135,25 +136,25 @@ Examples using raylib models functionality, including models loading/generation | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | |----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 84 | [models_animation](models/models_animation.c) | models_animation | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.5 | [culacant](https://github.com/culacant) | -| 85 | [models_billboard](models/models_billboard.c) | models_billboard | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | -| 86 | [models_box_collisions](models/models_box_collisions.c) | models_box_collisions | â­ï¸â˜†â˜†â˜† | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | -| 87 | [models_cubicmap](models/models_cubicmap.c) | models_cubicmap | â­ï¸â­ï¸â˜†â˜† | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | -| 88 | [models_first_person_maze](models/models_first_person_maze.c) | models_first_person_maze | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 89 | [models_geometric_shapes](models/models_geometric_shapes.c) | models_geometric_shapes | â­ï¸â˜†â˜†â˜† | 1.0 | 3.5 | [Ray](https://github.com/raysan5) | -| 90 | [models_mesh_generation](models/models_mesh_generation.c) | models_mesh_generation | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | -| 91 | [models_mesh_picking](models/models_mesh_picking.c) | models_mesh_picking | â­ï¸â­ï¸â­ï¸â˜† | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) | -| 92 | [models_loading](models/models_loading.c) | models_loading | â­ï¸â˜†â˜†â˜† | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | -| 93 | [models_loading_gltf](models/models_loading_gltf.c) | models_loading_gltf | â­ï¸â˜†â˜†â˜† | 3.7 | **4.2** | [Ray](https://github.com/raysan5) | -| 94 | [models_loading_vox](models/models_loading_vox.c) | models_loading_vox | â­ï¸â˜†â˜†â˜† | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) | -| 95 | [models_loading_m3d](models/models_loading_m3d.c) | models_loading_m3d | â­ï¸â˜†â˜†â˜† | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) | -| 96 | [models_orthographic_projection](models/models_orthographic_projection.c) | models_orthographic_projection | â­ï¸â˜†â˜†â˜† | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) | -| 97 | [models_point_rendering](models/models_point_rendering.c) | models_point_rendering | â­ï¸â­ï¸â˜†â˜† | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) | -| 98 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | models_rlgl_solar_system | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | -| 99 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | models_yaw_pitch_roll | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) | -| 100 | [models_waving_cubes](models/models_waving_cubes.c) | models_waving_cubes | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 3.7 | [codecat](https://github.com/codecat) | -| 101 | [models_heightmap](models/models_heightmap.c) | models_heightmap | â­ï¸â˜†â˜†â˜† | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | -| 102 | [models_skybox](models/models_skybox.c) | models_skybox | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | +| 85 | [models_animation](models/models_animation.c) | models_animation | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.5 | [culacant](https://github.com/culacant) | +| 86 | [models_billboard](models/models_billboard.c) | models_billboard | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | +| 87 | [models_box_collisions](models/models_box_collisions.c) | models_box_collisions | â­ï¸â˜†â˜†â˜† | 1.3 | 3.5 | [Ray](https://github.com/raysan5) | +| 88 | [models_cubicmap](models/models_cubicmap.c) | models_cubicmap | â­ï¸â­ï¸â˜†â˜† | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | +| 89 | [models_first_person_maze](models/models_first_person_maze.c) | models_first_person_maze | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 90 | [models_geometric_shapes](models/models_geometric_shapes.c) | models_geometric_shapes | â­ï¸â˜†â˜†â˜† | 1.0 | 3.5 | [Ray](https://github.com/raysan5) | +| 91 | [models_mesh_generation](models/models_mesh_generation.c) | models_mesh_generation | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | +| 92 | [models_mesh_picking](models/models_mesh_picking.c) | models_mesh_picking | â­ï¸â­ï¸â­ï¸â˜† | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) | +| 93 | [models_loading](models/models_loading.c) | models_loading | â­ï¸â˜†â˜†â˜† | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | +| 94 | [models_loading_gltf](models/models_loading_gltf.c) | models_loading_gltf | â­ï¸â˜†â˜†â˜† | 3.7 | **4.2** | [Ray](https://github.com/raysan5) | +| 95 | [models_loading_vox](models/models_loading_vox.c) | models_loading_vox | â­ï¸â˜†â˜†â˜† | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) | +| 96 | [models_loading_m3d](models/models_loading_m3d.c) | models_loading_m3d | â­ï¸â˜†â˜†â˜† | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) | +| 97 | [models_orthographic_projection](models/models_orthographic_projection.c) | models_orthographic_projection | â­ï¸â˜†â˜†â˜† | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) | +| 98 | [models_point_rendering](models/models_point_rendering.c) | models_point_rendering | â­ï¸â­ï¸â˜†â˜† | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) | +| 99 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | models_rlgl_solar_system | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) | +| 100 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | models_yaw_pitch_roll | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) | +| 101 | [models_waving_cubes](models/models_waving_cubes.c) | models_waving_cubes | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 3.7 | [codecat](https://github.com/codecat) | +| 102 | [models_heightmap](models/models_heightmap.c) | models_heightmap | â­ï¸â˜†â˜†â˜† | 1.8 | 3.5 | [Ray](https://github.com/raysan5) | +| 103 | [models_skybox](models/models_skybox.c) | models_skybox | â­ï¸â­ï¸â˜†â˜† | 1.8 | **4.0** | [Ray](https://github.com/raysan5) | ### category: shaders @@ -161,25 +162,25 @@ Examples using raylib shaders functionality, including shaders loading, paramete | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | |----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 103 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | shaders_basic_lighting | â­ï¸â­ï¸â­ï¸â­ï¸ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) | -| 104 | [shaders_model_shader](shaders/shaders_model_shader.c) | shaders_model_shader | â­ï¸â­ï¸â˜†â˜† | 1.3 | 3.7 | [Ray](https://github.com/raysan5) | -| 105 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | shaders_shapes_textures | â­ï¸â­ï¸â˜†â˜† | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | -| 106 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | shaders_custom_uniform | â­ï¸â­ï¸â˜†â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 107 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | shaders_postprocessing | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | -| 108 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | shaders_palette_switch | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) | -| 109 | [shaders_raymarching](shaders/shaders_raymarching.c) | shaders_raymarching | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) | -| 110 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | shaders_texture_drawing | â­ï¸â­ï¸â˜†â˜† | 2.0 | 3.7 | [MichaÅ‚ Ciesielski](https://github.com/) | -| 111 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | shaders_texture_outline | â­ï¸â­ï¸â­ï¸â˜† | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) | -| 112 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | shaders_texture_waves | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) | -| 113 | [shaders_julia_set](shaders/shaders_julia_set.c) | shaders_julia_set | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) | -| 114 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | shaders_eratosthenes | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) | -| 115 | [shaders_fog](shaders/shaders_fog.c) | shaders_fog | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 116 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | shaders_simple_mask | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 117 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | shaders_hot_reloading | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | 3.5 | [Ray](https://github.com/raysan5) | -| 118 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | shaders_mesh_instancing | â­ï¸â­ï¸â­ï¸â­ï¸ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) | -| 119 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | shaders_multi_sample2d | â­ï¸â­ï¸â˜†â˜† | 3.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 120 | [shaders_spotlight](shaders/shaders_spotlight.c) | shaders_spotlight | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | -| 121 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | shaders_deferred_render | â­ï¸â­ï¸â­ï¸â­ï¸ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) | +| 104 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | shaders_basic_lighting | â­ï¸â­ï¸â­ï¸â­ï¸ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) | +| 105 | [shaders_model_shader](shaders/shaders_model_shader.c) | shaders_model_shader | â­ï¸â­ï¸â˜†â˜† | 1.3 | 3.7 | [Ray](https://github.com/raysan5) | +| 106 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | shaders_shapes_textures | â­ï¸â­ï¸â˜†â˜† | 1.7 | 3.7 | [Ray](https://github.com/raysan5) | +| 107 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | shaders_custom_uniform | â­ï¸â­ï¸â˜†â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | +| 108 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | shaders_postprocessing | â­ï¸â­ï¸â­ï¸â˜† | 1.3 | **4.0** | [Ray](https://github.com/raysan5) | +| 109 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | shaders_palette_switch | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) | +| 110 | [shaders_raymarching](shaders/shaders_raymarching.c) | shaders_raymarching | â­ï¸â­ï¸â­ï¸â­ï¸ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) | +| 111 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | shaders_texture_drawing | â­ï¸â­ï¸â˜†â˜† | 2.0 | 3.7 | [MichaÅ‚ Ciesielski](https://github.com/) | +| 112 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | shaders_texture_outline | â­ï¸â­ï¸â­ï¸â˜† | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) | +| 113 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | shaders_texture_waves | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) | +| 114 | [shaders_julia_set](shaders/shaders_julia_set.c) | shaders_julia_set | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) | +| 115 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | shaders_eratosthenes | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) | +| 116 | [shaders_fog](shaders/shaders_fog.c) | shaders_fog | â­ï¸â­ï¸â­ï¸â˜† | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | +| 117 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | shaders_simple_mask | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | +| 118 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | shaders_hot_reloading | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | 3.5 | [Ray](https://github.com/raysan5) | +| 119 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | shaders_mesh_instancing | â­ï¸â­ï¸â­ï¸â­ï¸ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) | +| 120 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | shaders_multi_sample2d | â­ï¸â­ï¸â˜†â˜† | 3.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 121 | [shaders_spotlight](shaders/shaders_spotlight.c) | shaders_spotlight | â­ï¸â­ï¸â˜†â˜† | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) | +| 122 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | shaders_deferred_render | â­ï¸â­ï¸â­ï¸â­ï¸ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) | ### category: audio @@ -187,10 +188,10 @@ Examples using raylib audio functionality, including sound/music loading and pla | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | |----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 122 | [audio_module_playing](audio/audio_module_playing.c) | audio_module_playing | â­ï¸â˜†â˜†â˜† | 1.5 | 3.5 | [Ray](https://github.com/raysan5) | -| 123 | [audio_music_stream](audio/audio_music_stream.c) | audio_music_stream | â­ï¸â˜†â˜†â˜† | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | -| 124 | [audio_raw_stream](audio/audio_raw_stream.c) | audio_raw_stream | â­ï¸â­ï¸â­ï¸â˜† | 1.6 | **4.2** | [Ray](https://github.com/raysan5) | -| 125 | [audio_sound_loading](audio/audio_sound_loading.c) | audio_sound_loading | â­ï¸â˜†â˜†â˜† | 1.1 | 3.5 | [Ray](https://github.com/raysan5) | +| 123 | [audio_module_playing](audio/audio_module_playing.c) | audio_module_playing | â­ï¸â˜†â˜†â˜† | 1.5 | 3.5 | [Ray](https://github.com/raysan5) | +| 124 | [audio_music_stream](audio/audio_music_stream.c) | audio_music_stream | â­ï¸â˜†â˜†â˜† | 1.3 | **4.2** | [Ray](https://github.com/raysan5) | +| 125 | [audio_raw_stream](audio/audio_raw_stream.c) | audio_raw_stream | â­ï¸â­ï¸â­ï¸â˜† | 1.6 | **4.2** | [Ray](https://github.com/raysan5) | +| 126 | [audio_sound_loading](audio/audio_sound_loading.c) | audio_sound_loading | â­ï¸â˜†â˜†â˜† | 1.1 | 3.5 | [Ray](https://github.com/raysan5) | ### category: others @@ -198,11 +199,11 @@ Examples showing raylib misc functionality that does not fit in other categories | ## | example | image | difficulty
level | version
created | last version
updated | original
developer | |----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------| -| 126 | [rlgl_standalone](others/rlgl_standalone.c) | rlgl_standalone | â­ï¸â­ï¸â­ï¸â­ï¸ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) | -| 127 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | rlgl_compute_shader | â­ï¸â­ï¸â­ï¸â­ï¸ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) | -| 128 | [easings_testbed](others/easings_testbed.c) | easings_testbed | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) | -| 129 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | raylib_opengl_interop | â­ï¸â­ï¸â­ï¸â­ï¸ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) | -| 130 | [embedded_files_loading](others/embedded_files_loading.c) | embedded_files_loading | â­ï¸â­ï¸â˜†â˜† | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) | +| 127 | [rlgl_standalone](others/rlgl_standalone.c) | rlgl_standalone | â­ï¸â­ï¸â­ï¸â­ï¸ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) | +| 128 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | rlgl_compute_shader | â­ï¸â­ï¸â­ï¸â­ï¸ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) | +| 129 | [easings_testbed](others/easings_testbed.c) | easings_testbed | â­ï¸â­ï¸â­ï¸â˜† | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) | +| 130 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | raylib_opengl_interop | â­ï¸â­ï¸â­ï¸â­ï¸ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) | +| 131 | [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 is an [examples template](examples_template.c) to start with! diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c new file mode 100644 index 000000000..a103e82a1 --- /dev/null +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -0,0 +1,330 @@ +#include "raylib.h" +#include "rlgl.h" +#include + +// Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness +// Adapted from both `DrawRectangleRounded` and `DrawRectangleGradientH` +void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right) +{ + // Neither side is rounded + if ((roundnessLeft <= 0.0f && roundnessRight <= 0.0f) || (rec.width < 1) || (rec.height < 1 )) + { + DrawRectangleGradientEx(rec, left, left, right, right); + return; + } + + if (roundnessLeft >= 1.0f) roundnessLeft = 1.0f; + if (roundnessRight >= 1.0f) roundnessRight = 1.0f; + + // Calculate corner radius both from right and left + float recSize = rec.width > rec.height ? rec.height : rec.width; + float radiusLeft = (recSize*roundnessLeft)/2; + float radiusRight = (recSize*roundnessRight)/2; + + if (radiusLeft <= 0.0f) radiusLeft = 0.0f; + if (radiusRight <= 0.0f) radiusRight = 0.0f; + + if (radiusRight <= 0.0f && radiusLeft <= 0.0f) return; + + float stepLength = 90.0f/(float)segments; + + /* + Diagram Copied here for reference, original at `DrawRectangleRounded` source code + + P0____________________P1 + /| |\ + /1| 2 |3\ + P7 /__|____________________|__\ P2 + | |P8 P9| | + | 8 | 9 | 4 | + | __|____________________|__ | + P6 \ |P11 P10| / P3 + \7| 6 |5/ + \|____________________|/ + P5 P4 + */ + + // Coordinates of the 12 points also apdated from `DrawRectangleRounded` + const Vector2 point[12] = { + // PO, P1, P2 + {(float)rec.x + radiusLeft, rec.y}, {(float)(rec.x + rec.width) - radiusRight, rec.y}, { rec.x + rec.width, (float)rec.y + radiusRight }, + // P3, P4 + {rec.x + rec.width, (float)(rec.y + rec.height) - radiusRight}, {(float)(rec.x + rec.width) - radiusRight, rec.y + rec.height}, + // P5, P6, P7 + {(float)rec.x + radiusLeft, rec.y + rec.height}, { rec.x, (float)(rec.y + rec.height) - radiusLeft}, {rec.x, (float)rec.y + radiusLeft}, + // P8, P9 + {(float)rec.x + radiusLeft, (float)rec.y + radiusLeft}, {(float)(rec.x + rec.width) - radiusRight, (float)rec.y + radiusRight}, + // P10, P11 + {(float)(rec.x + rec.width) - radiusRight, (float)(rec.y + rec.height) - radiusRight}, {(float)rec.x + radiusLeft, (float)(rec.y + rec.height) - radiusLeft} + }; + + const Vector2 centers[4] = { point[8], point[9], point[10], point[11] }; + const float angles[4] = { 180.0f, 270.0f, 0.0f, 90.0f }; + +#if defined(SUPPORT_QUADS_DRAW_MODE) + rlSetTexture(GetShapesTexture().id); + Rectangle shapeRect = GetShapesTextureRectangle(); + + rlBegin(RL_QUADS); + // Draw all the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner + for (int k = 0; k < 4; ++k) + { + Color color; + float radius; + if (k == 0) color = left, radius = radiusLeft; // [1] Upper Left Corner + if (k == 1) color = right, radius = radiusRight; // [3] Upper Right Corner + if (k == 2) color = right, radius = radiusRight; // [5] Lower Right Corner + if (k == 3) color = left, radius = radiusLeft; // [7] Lower Left Corner + float angle = angles[k]; + const Vector2 center = centers[k]; + + for (int i = 0; i < segments/2; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x, center.y); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength*2))*radius, center.y + sinf(DEG2RAD*(angle + stepLength*2))*radius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + + angle += (stepLength*2); + } + + // End one even segments + if ( segments % 2) + { + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x, center.y); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x, center.y); + } + } + + // + // Here we use the `Diagram` to guide ourselves to which point receives what color. + // + // By choosing the color correctly associated with a pointe the gradient effect + // will naturally come from OpenGL interpolation. + // + + // [2] Upper Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[0].x, point[0].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[8].x, point[8].y); + + rlColor4ub(right.r, right.g, right.b, right.a); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[9].x, point[9].y); + + rlColor4ub(right.r, right.g, right.b, right.a); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[1].x, point[1].y); + + // [4] Left Rectangle + rlColor4ub(right.r, right.g, right.b, right.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[2].x, point[2].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[9].x, point[9].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[10].x, point[10].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[3].x, point[3].y); + + // [6] Bottom Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[11].x, point[11].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[5].x, point[5].y); + + rlColor4ub(right.r, right.g, right.b, right.a); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[4].x, point[4].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[10].x, point[10].y); + + // [8] left Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[7].x, point[7].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[6].x, point[6].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[11].x, point[11].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[8].x, point[8].y); + + // [9] Middle Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[8].x, point[8].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[11].x, point[11].y); + + rlColor4ub(right.r, right.g, right.b, right.a); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[10].x, point[10].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[9].x, point[9].y); + + rlEnd(); + rlSetTexture(0); +#else + + // + // Here we use the `Diagram` to guide ourselves to which point receives what color. + // + // By choosing the color correctly associated with a pointe the gradient effect + // will naturally come from OpenGL interpolation. + // But this time instead of Quad, we think in triangles. + // + + rlBegin(RL_TRIANGLES); + + // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner + for (int k = 0; k < 4; ++k) + { + Color color; + float radius; + if (k == 0) color = left, radius = radiusLeft; // [1] Upper Left Corner + if (k == 1) color = right, radius = radiusRight; // [3] Upper Right Corner + if (k == 2) color = right, radius = radiusRight; // [5] Lower Right Corner + if (k == 3) color = left, radius = radiusLeft; // [7] Lower Left Corner + float angle = angles[k]; + const Vector2 center = centers[k]; + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(center.x, center.y); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*radius, center.y + sinf(DEG2RAD*(angle + stepLength))*radius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*radius, center.y + sinf(DEG2RAD*angle)*radius); + angle += stepLength; + } + } + + // [2] Upper Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[0].x, point[0].y); + rlVertex2f(point[8].x, point[8].y); + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[9].x, point[9].y); + rlVertex2f(point[1].x, point[1].y); + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[0].x, point[0].y); + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[9].x, point[9].y); + + // [4] Right Rectangle + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[9].x, point[9].y); + rlVertex2f(point[10].x, point[10].y); + rlVertex2f(point[3].x, point[3].y); + rlVertex2f(point[2].x, point[2].y); + rlVertex2f(point[9].x, point[9].y); + rlVertex2f(point[3].x, point[3].y); + + // [6] Bottom Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[11].x, point[11].y); + rlVertex2f(point[5].x, point[5].y); + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[4].x, point[4].y); + rlVertex2f(point[10].x, point[10].y); + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[11].x, point[11].y); + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[4].x, point[4].y); + + // [8] Left Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[7].x, point[7].y); + rlVertex2f(point[6].x, point[6].y); + rlVertex2f(point[11].x, point[11].y); + rlVertex2f(point[8].x, point[8].y); + rlVertex2f(point[7].x, point[7].y); + rlVertex2f(point[11].x, point[11].y); + + // [9] Middle Rectangle + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[8].x, point[8].y); + rlVertex2f(point[11].x, point[11].y); + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[10].x, point[10].y); + rlVertex2f(point[9].x, point[9].y); + rlColor4ub(left.r, left.g, left.b, left.a); + rlVertex2f(point[8].x, point[8].y); + rlColor4ub(right.r, right.g, right.b, right.a); + rlVertex2f(point[10].x, point[10].y); + rlEnd(); +#endif +} + +int main(int argc, char *argv[]) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rectangle avanced"); + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update rectangle bounds + //---------------------------------------------------------------------------------- + double width = GetScreenWidth()/2.0, height = GetScreenHeight()/6.0; + Rectangle rec = { + GetScreenWidth() / 2.0 - width/2, + GetScreenHeight() / 2.0 - (5)*(height/2), + width, height + }; + //-------------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + ClearBackground(RAYWHITE); + + // Draw All Rectangles with different roundess for each side and different gradients + DrawRectangleRoundedGradientH(rec, 0.8, 0.8, 36, BLUE, RED); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 0.5, 1.0, 36, RED, PINK); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 1.0, 0.5, 36, RED, BLUE); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 0.0, 1.0, 36, BLUE, BLACK); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 1.0, 0.0, 36, BLUE, PINK); + EndDrawing(); + //-------------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + return 0; +} + diff --git a/examples/shapes/shapes_rectangle_advanced.png b/examples/shapes/shapes_rectangle_advanced.png new file mode 100644 index 0000000000000000000000000000000000000000..a68170a31f5c9ba3e184a002b510b12fe82c3a2a GIT binary patch literal 6839 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 y + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {703BE7BA-5B99-4F70-806D-3A259F6A991E} + Win32Proj + shapes_rectangle_advanced + 10.0 + shapes_rectangle_advanced + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index acda9e25a..e2f512d81 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -297,6 +297,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_splines_drawing", "e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_top_down_lights", "examples\shapes_top_down_lights.vcxproj", "{703BE7BA-5B99-4F70-806D-3A259F6A991E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_rectangle_advanced", "examples\shapes_rectangle_advanced.vcxproj", "{703BE7BA-5B99-4F70-806D-3A259F6A991E}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_gpu_skinning", "examples\models_gpu_skinning.vcxproj", "{8245DAD9-D402-4D5C-8F45-32229CD3B263}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shadowmap", "examples\shaders_shadowmap.vcxproj", "{41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}" From 3bad05aa7bd319eaaae937928b396b46f4886e3e Mon Sep 17 00:00:00 2001 From: Arche Washi <166983671+archewashi@users.noreply.github.com> Date: Thu, 31 Oct 2024 03:13:53 +0800 Subject: [PATCH 076/155] fix the issue with GetScreenWidth/GetScreenHeight that was identified on other platforms (#4451) --- src/platforms/rcore_desktop_rgfw.c | 3 +++ src/platforms/rcore_web.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 98d4fec75..68885ce3f 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -520,6 +520,9 @@ void SetWindowMaxSize(int width, int height) // Set window dimensions void SetWindowSize(int width, int height) { + CORE.Window.screen.width = width; + CORE.Window.screen.height = height; + RGFW_window_resize(platform.window, RGFW_AREA(width, height)); } diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index e15d3f5bf..15c0918dc 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -667,6 +667,9 @@ void SetWindowMaxSize(int width, int height) // Set window dimensions void SetWindowSize(int width, int height) { + CORE.Window.screen.width = width; + CORE.Window.Screen.height = height; + glfwSetWindowSize(platform.handle, width, height); } From b8c0842b2e5f783e5f8f0f22e95afb82434d7ec2 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 30 Oct 2024 18:21:37 -0300 Subject: [PATCH 077/155] Fix SetWindowSize() for PLATFORM_WEB (#4452) --- src/platforms/rcore_web.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 15c0918dc..e15d3f5bf 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -667,9 +667,6 @@ void SetWindowMaxSize(int width, int height) // Set window dimensions void SetWindowSize(int width, int height) { - CORE.Window.screen.width = width; - CORE.Window.Screen.height = height; - glfwSetWindowSize(platform.handle, width, height); } From b7ef2fd58022982fe65e954cd878143992eb0408 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 1 Nov 2024 12:07:27 +0100 Subject: [PATCH 078/155] Update HISTORY.md --- HISTORY.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 555e81b38..6b1a5be29 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -479,11 +479,11 @@ It's been **1 year** since latest raylib release and **11 years** since raylib 1 Some numbers for this release: - - **+260** closed issues (for a TOTAL of **+1800**!) - - **+700** commits since previous RELEASE (for a TOTAL of **+7670**!) + - **+270** closed issues (for a TOTAL of **+1810**!) + - **+760** commits since previous RELEASE (for a TOTAL of **+7730**!) - **+30** functions ADDED to raylib API (for a TOTAL of **580**!) - **+110** functions REVIEWED with fixes and improvements - - **+135** new contributors (for a TOTAL of **+635**!) + - **+140** new contributors (for a TOTAL of **+640**!) Highlights for `raylib 5.5`: From 9e2591e612bcf651ed8dca0d4ba242b64c694f25 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 1 Nov 2024 12:14:06 +0100 Subject: [PATCH 079/155] Update Makefile --- examples/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index a3ce8f6d1..304599cf8 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -402,7 +402,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling # NOTE: Required packages: mesa-libs LDFLAGS += -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib - LDLIBS = -lraylib -lGL -lpthread -lm + LDLIBS = -lraylib -lGL -lm -lpthread # On XWindow requires also below libraries LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor @@ -443,12 +443,14 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation - LDLIBS = ..\src\libraylib.a -lgdi32 -lwinmm -lopengl32 + LDFLAGS += -L..\src + LDLIBS = -lraylib -lgdi32 -lwinmm -lopengl32 endif ifeq ($(PLATFORM_OS),LINUX) # Libraries for Debian GNU/Linux desktop compipling # NOTE: Required packages: libegl1-mesa-dev - LDLIBS = ../src/libraylib.a -lGL -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lm -lpthread -ldl -lrt + LDFLAGS += -L../src + LDLIBS = -lraylib -lGL -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lm -lpthread -ldl -lrt # Explicit link to libc ifeq ($(RAYLIB_LIBTYPE),SHARED) @@ -461,7 +463,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) ifeq ($(PLATFORM_OS),OSX) # Libraries for Debian GNU/Linux desktop compiling # NOTE: Required packages: libegl1-mesa-dev - LDLIBS = ../src/libraylib.a -lm + LDFLAGS += -L../src + LDLIBS = -lraylib -lm LDLIBS += -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo endif endif From 8e5d5f89c2233a0c2ff62e6ebd9b191eef37135f Mon Sep 17 00:00:00 2001 From: MikiZX1 <161243635+MikiZX1@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:35:35 +0100 Subject: [PATCH 080/155] Update rmodels.c - 'fix' for GenMeshSphere artifact (#4460) When creating a new sphere mesh with high number of slices/rings the top and bottom parts of the generated sphere are removed. This happens because the triangles in those parts, due to high resolution, end up being very small and are removed as part of the 'par_shapes' library's optimization. Adding par_shapes_set_epsilon_degenerate_sphere(0.0); before generating the sphere mesh sets the threshold for removal of small triangles is removed and the sphere is returned to raylib correctly. --- src/rmodels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rmodels.c b/src/rmodels.c index ed15d9658..40e0182ad 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2820,6 +2820,7 @@ Mesh GenMeshSphere(float radius, int rings, int slices) if ((rings >= 3) && (slices >= 3)) { + par_shapes_set_epsilon_degenerate_sphere(0.0); par_shapes_mesh *sphere = par_shapes_create_parametric_sphere(slices, rings); par_shapes_scale(sphere, radius, radius, radius); // NOTE: Soft normals are computed internally From 24724d33bbb0dba1871bbcbde4e21ff7cf562e9d Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Nov 2024 12:30:02 +0100 Subject: [PATCH 081/155] Added last week commits info --- CHANGELOG | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7ec73066f..1f68fc46f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,7 +15,7 @@ KEY CHANGES: Detailed changes: -WIP: Last update with commit from 21-Oct-2024 +WIP: Last update with commit from 02-Nov-2024 [rcore] ADDED: Working directory info at initialization by @Ray [rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray @@ -48,6 +48,10 @@ WIP: Last update with commit from 21-Oct-2024 [rcore] REVIEWED: Fix typos in src/platforms/rcore_*.c (#3581) by @RadsammyT [rcore] REVIEWED: `ExportDataAsCode()`, change sanitization check (#3837) by @Laurentino Luna [rcore] REVIEWED: `ExportDataAsCode()`, add little sanitization to indentifier names (#3832) by @4rk +[rcore] REVIEWED: `GetScreenWidth()`/`GetScreenHeight()` align with all platforms (#4451) by @Arche Washi +[rcore] REVIEWED: `SetGamepadVibration()`, added duration parameter (#4410) by @Asdqwe -WARNING- +[rcore] REVIEWED: `GetGamepadAxisMovement()`, fix #4405 (#4420) by @Asdqwe +[rcore] REVIEWED: `GetGestureHoldDuration()` comments by @Ray [rcore][rlgl] REVIEWED: Fix scale issues when ending a view mode (#3746) by @Jeffery Myers [rcore][GLFW] REVIEWED: Keep CORE.Window.position properly in sync with glfw window position (#4190) by @Dave Green [rcore][GLFW] REVIEWED: Set AUTO_ICONIFY flag to false per default (#4188) by @Dave Green @@ -57,6 +61,7 @@ WIP: Last update with commit from 21-Oct-2024 [rcore][GLFW] REVIEWED: Remove GLFW mouse passthrough hack and increase GLFW version in CMake (#3852) by @Alexandre Almeida [rcore][GLFW] REVIEWED: Updated GLFW to 3.4 (#3827) by @Alexandre Almeida [rcore][GLFW] REVIEWED: Feature test macros before include (#3737) by @John +[rcore][GLFW] REVIEWED: Fix inconsistent dll linkage warning on windows (#4447) by @Jeffery Myers [rcore][Web] ADDED: `SetWindowOpacity()` implementation (#4403) by @Asdqwe [rcore][Web] ADDED: `MaximizeWindow()` and `RestoreWindow()` implementations (#4397) by @Asdqwe [rcore][Web] ADDED: `ToggleFullscreen()` implementation (#3634) by @ubkp @@ -70,6 +75,8 @@ WIP: Last update with commit from 21-Oct-2024 [rcore][Web] REVIEWED: Fix CORE.Input.Mouse.cursorHidden with callbacks (#3644) by @ubkp [rcore][Web] REVIEWED: Fix `IsMouseButtonUp()` (#3611) by @ubkp [rcore][Web] REVIEWED: HighDPI support #3372 by @Ray +[rcore][Web] REVIEWED: `SetWindowSize()` (#4452) by @Asdqwe +[rcore][Web] REVIEWED: `EmscriptenResizeCallback()`, simplified (#4415) by @Asdqwe [rcore][SDL] ADDED: `IsCursorOnScreen()` (#3862) by @Peter0x44 [rcore][SDL] ADDED: Gamepad rumble/vibration support (#3819) by @GideonSerf [rcore][SDL] REVIEWED: Gamepad support (#3776) by @A @@ -107,6 +114,7 @@ WIP: Last update with commit from 21-Oct-2024 [rcore][RGFW] REVIEWED: RGFW 1.0 (#4144) by @Colleague Riley [rcore][RGFW] REVIEWED: Fix errors when compiling with mingw (#4282) by @Colleague Riley [rcore][RGFW] REVIEWED: Replace long switch with a lookup table (#4108) by @Colleague Riley +[rcore][RGFW] REVIEWED: Fix MSVC build errors (#4441) by @Colleague Riley [rlgl] ADDED: More uniform data type options #4137 by @Ray [rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang [rlgl] ADDED: `rlCullDistance*()` variables and getters (#3912) by @KotzaBoss @@ -123,6 +131,7 @@ WIP: Last update with commit from 21-Oct-2024 [rlgl] REVIEWED: `rlMultMatrixf()`, fix matrix multiplication order (#3935) by @bohonghuang [rlgl] REVIEWED: `rlSetVertexAttribute()`, define last parameter as offset #3800 by @Ray [rlgl] REVIEWED: `rlDisableVertexAttribute()`, remove redundat calls for SHADER_LOC_VERTEX_COLOR (#3871) by @Kacper ZybaÅ‚a +[rlgl] REVIEWED: `rlLoadTextureCubemap()`, load mipmaps for cubemaps (#4429) by @Nikolas [rlgl] REVIEWED: `rlLoadFramebuffer()`, parameters not required by @Ray [rlgl] REVIEWED: `rlSetUniformSampler()` (#3759) by @veins1 [rlgl] REVIEWED: Renamed near/far variables (#4039) by @jgabaut @@ -132,7 +141,8 @@ WIP: Last update with commit from 21-Oct-2024 [rlgl] REVIEWED: rlgl function description and comments by @Ray [rlgl] REVIEWED: Expose glad functions when building raylib as a shared lib (#3572) by @Peter0x44 [rlgl] REVIEWED: Fix version info in rlgl.h (#3558) by @Steven Schveighoffer -[rcamera] REVIEWED: Make camera movement independant of framerate (#4247) by @hanaxars -WARNING- +[rlgl] REVIEWED: Use the vertex color to the base shader in GLSL330 (#4431) by @Jeffery Myers +[rcamera] REVIEWED: Make camera movement independant of framerate (#4247) by @hanaxars -WARNING- [rcamera] REVIEWED: Updated camera speeds with GetFrameTime() (#4362) by @Anthony Carbajal [rcamera] REVIEWED: `UpdateCamera()`, added CAMERA_CUSTOM check (#3938) by @Tomas Fabrizio Orsi [rcamera] REVIEWED: Support mouse/keyboard and gamepad coexistence for input (#3579) by @ubkp @@ -152,8 +162,10 @@ WIP: Last update with commit from 21-Oct-2024 [rshapes] REVIEWED: `DrawLine()` #4075 by @Ray [rshapes] REVIEWED: `DrawPixel()` drawing by @Ray [rshapes] REVIEWED: `DrawLine()` to avoid pixel rounding issues #3931 by @Ray -[rshapes] REVIEWED: `DrawRectangleLinesEx()`, make sure accounts for square tiles (#4382) by @Jojaby +[rshapes] REVIEWED: `DrawRectangleLines()`, considering view matrix for lines "alignment" by @Ray +[rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset (#4261) by @RadsammyT [rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset when scaling (#3884) by @Ray +[rshapes] REVIEWED: `DrawRectangleLinesEx()`, make sure accounts for square tiles (#4382) by @Jojaby [rshapes] REVIEWED: `Draw*Gradient()` color parameter names (#4270) by @Paperdomo101 [rshapes] REVIEWED: `DrawGrid()`, remove duplicate color calls (#4148) by @Jeffery Myers [rshapes] REVIEWED: `DrawSplineLinear()` to `SUPPORT_SPLINE_MITERS` by @Ray @@ -177,7 +189,9 @@ WIP: Last update with commit from 21-Oct-2024 [rtextures] REVIEWED: `LoadImageRaw()` #3926 by @Ray [rtextures] REVIEWED: `LoadImageColors()`, advance k in loop (#4120) by @Bruno Cabral [rtextures] REVIEWED: `LoadTextureCubemap()`, added `mipmaps` #3665 by @Ray -[rtextures] REVIEWED: `LoadTextureCubemap(), assign format to cubemap (#3823) by @Gary M +[rtextures] REVIEWED: `LoadTextureCubemap()`, assign format to cubemap (#3823) by @Gary M +[rtextures] REVIEWED: `LoadTextureCubemap()`, load mipmaps for cubemaps (#4429) by @Nikolas +[rtextures] REVIEWED: `LoadTextureCubemap()`, avoid dangling re-allocated pointers (#4439) by @Nikolas [rtextures] REVIEWED: `LoadImageFromScreen()`, fix scaling (#3881) by @proberge-dev [rtextures] REVIEWED: `LoadImageFromMemory()`, warnings on invalid image data (#4179) by @Jutastre [rtextures] REVIEWED: `LoadImageAnimFromMemory()`, added security checks (#3924) by @Ray @@ -190,6 +204,8 @@ WIP: Last update with commit from 21-Oct-2024 [rtextures] REVIEWED: `GenImagePerlinNoise()` being stretched (#4276) by @Bugsia [rtextures] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 by @Ray [rtextures] REVIEWED: `ColorToInt()`, fix undefined behaviour (#3996) by @OetkenPurveyorOfCode +[rtextures] REVIEWED: Remove panorama cubemap layout option (#4425) by @Jeffery Myers +[rtextures] REVIEWED: Removed unneeded module check, `rtextures` should not depend on `rtext` by @Ray [rtextures] REVIEWED: Simplified for loop for some image manipulation functions (#3712) by @Alice Nyaa [rtext] ADDED: BDF fonts support (#3735) by @Stanley Fuller -WARNING- [rtext] ADDED: `TextToCamel()` (#4033) by @IoIxD @@ -207,6 +223,7 @@ WIP: Last update with commit from 21-Oct-2024 [rtext] REVIEWED: `LoadFontData()`, load image only if glyph has been found in font by @Ray [rtext] REVIEWED: `ExportFontAsCode()`, fix C++ compiler errors (#4013) by @DarkAssassin23 [rtext] REVIEWED: `MeasureTextEx()` height calculation (#3770) by @Marrony Neris +[rtext] REVIEWED: `MeasureTextEx()`, additional check for empty input string (#4448) by @mpv-enjoyer [rtext] REVIEWED: `CodepointToUTF8()`, clean static buffer #4379 by @Ray [rtext] REVIEWED: `TextToFloat()`, always multiply by sign (#4273) by @listeria [rtext] REVIEWED: `TextReplace()` const correctness (#3678) by @maverikou @@ -237,6 +254,7 @@ WIP: Last update with commit from 21-Oct-2024 [rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, added missing interpolation types (#3919) by @Benji [rmodels] REVIEWED: `LoadModelAnimationsGLTF()` (#4107) by @VitoTringolo [rmodels] REVIEWED: `LoadBoneInfoGLTF()`, add check for animation name being NULL (#4053) by @VitoTringolo +[rmodels] REVIEWED: `GenMeshSphere()`, fix artifacts (#4460) by @MikiZX1 [rmodels] REVIEWED: `GenMeshTangents()`, read uninitialized values, fix bounding case (#4066) by @kai-z99 [rmodels] REVIEWED: `GenMeshTangents()`, fixed out of bounds error (#3990) by @Salvador Galindo [rmodels] REVIEWED: `DrawCylinder()`, fix drawing due to imprecise angle (#4034) by @Paul Melis @@ -258,6 +276,8 @@ WIP: Last update with commit from 21-Oct-2024 [raudio] REVIEWED: Fix crash when switching playback device at runtime (#4102) by @jkaup [raudio] REVIEWED: Support 24 bits samples for FLAC format (#4058) by @Alexey Kutepov [examples] ADDED: `core_random_sequence` (#3846) by @Dalton Overmyer +[examples] ADDED: `core_input_virtual_controls` (#4342) by @oblerion +[examples] ADDED: `shapes_rectangle_advanced `, implementing `DrawRectangleRoundedGradientH()` (#4435) by @Everton Jr. [examples] ADDED: `models_bone_socket` (#3833) by @iP [examples] ADDED: `shaders_vertex_displacement` (#4186) by @Alex ZH [examples] ADDED: `shaders_shadowmap` (#3653) by @TheManTheMythTheGameDev @@ -265,6 +285,8 @@ WIP: Last update with commit from 21-Oct-2024 [examples] REVIEWED: `core_2d_camera_mouse_zoom`, use logarithmic scaling for a 2d zoom functionality (#3977) by @Mike Will [examples] REVIEWED: `core_input_gamepad_info`, all buttons displayed within the window (#4241) by @Asdqwe [examples] REVIEWED: `core_input_gamepad_info`, show ps3 controller (#4040) by @Konrad Gutvik Grande +[examples] REVIEWED: `core_input_gamepad`, add drawing for generic gamepad (#4424) by @Asdqwe +[examples] REVIEWED: `core_input_gamepad`, add deadzone handling (#4422) by @Asdqwe [examples] REVIEWED: `shapes_bouncing_ball` (#4226) by @Anthony Carbajal [examples] REVIEWED: `shapes_following_eyes` (#3710) by @Hongyu Ouyang [examples] REVIEWED: `shapes_draw_rectangle_rounded` by @Ray @@ -288,6 +310,8 @@ WIP: Last update with commit from 21-Oct-2024 [examples] REVIEWED: `shaders_basic_pbr` (#3621) by @devdad [examples] REVIEWED: `shaders_basic_pbr`, remove dependencies (#3649) by @TheManTheMythTheGameDev [examples] REVIEWED: `shaders_basic_pbr`, added more comments by @Ray +[examples] REVIEWED: `shaders_gpu_skinning`, to work with OpenGL ES 2.0 #4412 by @Ray +[examples] REVIEWED: `shaders_model_shader`, use free camera (#4428) by @IcyLeave6109 [examples] REVIEWED: `audio_stream_effects` (#3618) by @lipx [examples] REVIEWED: `audio_raw_stream` (#3624) by @riadbettole [examples] REVIEWED: `audio_mixed_processor` (#4214) by @Anthony Carbajal @@ -302,10 +326,15 @@ WIP: Last update with commit from 21-Oct-2024 [build] REVIEWED: Makefile, fix -Wstringop-truncation warning (#4096) by @Peter0x44 [build] REVIEWED: Makefile, fix issues for RGFW on Linux/macOS (#3969) by @Colleague Riley [build] REVIEWED: Makefile, update RAYLIB_VERSION (#3901) by @Belllg -[build] REVIEWED: Makefile (#4054) by @Lázaro Albuquerque +[build] REVIEWED: Makefile, use mingw32-make for Windows (#4436) by @Asdqwe +[build] REVIEWED: Makefile, move CUSTOM_CFLAGS for better visibility (#4054) by @Lázaro Albuquerque +[build] REVIEWED: Makefile, update emsdk paths to latest versions by @Ray [build] REVIEWED: Makefile examples, align /usr/local with /src Makefile (#4286) by @Tchan0 [build] REVIEWED: Makefile examples, added `textures_image_kernel` (#3555) by @Sergey Zapunidi [build] REVIEWED: Makefile examples (#4209) by @Anthony Carbajal +[build] REVIEWED: Makefile examples, to work on NetBSD (#4438) by @NishiOwO +[build] REVIEWED: Makefile examples, WebGL2 (OpenGL ES 3.0) backend flags #4330 by @Ray +[build] REVIEWED: Makefile examples, web building (#4434) by @Asdqwe [build] REVIEWED: build.zig, fix various issues around `-Dconfig` (#4398) by @Sage Hane [build] REVIEWED: build.zig, fix type mismatch (#4383) by @yuval_dev [build] REVIEWED: build.zig, minor fixes (#4381) by @Sage Hane @@ -351,6 +380,7 @@ WIP: Last update with commit from 21-Oct-2024 [build] REVIEWED: CMake, disable SDL rlgl_standalone example (#3861) by @Rob Loach [build] REVIEWED: CMake, bump version required to avoid deprecated #3639 by @Ray [build] REVIEWED: CMake, fix examples linking -DPLATFORM=SDL (#3825) by @Peter0x44 +[build] REVIEWED: CMake, don't build for wayland by default (#4432) by @Peter0x44 [build] REVIEWED: VS2022 project by @Ray [build] REVIEWED: VS2022, fix build warnings (#4095) by @Jeffery Myers [build] REVIEWED: Fix fix-build-paths (#3849) by @Caleb Barger @@ -406,6 +436,13 @@ WIP: Last update with commit from 21-Oct-2024 [bindings] UPDATED: Raylib.nelua (#3552) by @Auz [bindings] UPDATED: raylib-cpp to 5.0 (#3551) by @Rob Loach [bindings] UPDATED: Pascal binding (#3548) by @Gunko Vadim +[external] UPDATED: stb_truetype.h to latest version by @Ray +[external] UPDATED: stb_image_resize2.h to latest version by @Ray +[external] UPDATED: stb_image.h to latest version by @Ray +[external] UPDATED: qoa.h to latest version by @Ray +[external] UPDATED: dr_wav.h to latest version by @Ray +[external] UPDATED: dr_mp3.h to latest version by @Ray +[external] UPDATED: cgltf.h to latest version by @Ray [external] REVIEWED: rl_gputex, correctly load mipmaps from DDS files (#4399) by @Nikolas [external] REVIEWED: stb_image_resize2, dix vld1q_f16 undeclared in arm (#4309) by @masnm [external] REVIEWED: miniaudio, fix library and Makefile for NetBSD (#4212) by @NishiOwO From be360d2ad18707887b3e556da5e50c334c234505 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Nov 2024 13:12:01 +0100 Subject: [PATCH 082/155] RENAMED: `UpdateModelAnimationBoneMatrices()` to `UpdateModelAnimationBones()` Still, not fully convinced of those functions naming, despite quite descriptive, sounds a bit confusing to me... --- examples/models/models_gpu_skinning.c | 2 +- src/raylib.h | 2 +- src/rmodels.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/models/models_gpu_skinning.c b/examples/models/models_gpu_skinning.c index 7e81b0d82..98bf09922 100644 --- a/examples/models/models_gpu_skinning.c +++ b/examples/models/models_gpu_skinning.c @@ -82,7 +82,7 @@ int main(void) ModelAnimation anim = modelAnimations[animIndex]; animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount; characterModel.transform = MatrixTranslate(position.x, position.y, position.z); - UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame); + UpdateModelAnimationBones(characterModel, anim, animCurrentFrame); //---------------------------------------------------------------------------------- // Draw diff --git a/src/raylib.h b/src/raylib.h index c9d9f6e54..e0822bb7d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1602,7 +1602,7 @@ RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Model animations loading/unloading functions RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU) -RLAPI void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) +RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match diff --git a/src/rmodels.c b/src/rmodels.c index 40e0182ad..daabbe209 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1508,7 +1508,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform) #ifdef RL_SUPPORT_MESH_GPU_SKINNING // Upload Bone Transforms - if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices) + if ((material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1) && mesh.boneMatrices) { rlSetUniformMatrices(material.shader.locs[SHADER_LOC_BONE_MATRICES], mesh.boneMatrices, mesh.boneCount); } @@ -1754,7 +1754,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i #ifdef RL_SUPPORT_MESH_GPU_SKINNING // Upload Bone Transforms - if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices) + if ((material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1) && mesh.boneMatrices) { rlSetUniformMatrices(material.shader.locs[SHADER_LOC_BONE_MATRICES], mesh.boneMatrices, mesh.boneCount); } @@ -2367,7 +2367,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) // Update model animated bones transform matrices for a given frame // NOTE: Updated data is not uploaded to GPU but kept at model.meshes[i].boneMatrices[boneId], // to be uploaded to shader at drawing, in case GPU skinning is enabled -void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame) +void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) { if ((anim.frameCount > 0) && (anim.bones != NULL) && (anim.framePoses != NULL)) { From 6028052c7eb0a0702423f8a4b0625bca1ad5b731 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 3 Nov 2024 12:12:25 +0000 Subject: [PATCH 083/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 37b0a16a6..8f5a6c826 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -11087,7 +11087,7 @@ ] }, { - "name": "UpdateModelAnimationBoneMatrices", + "name": "UpdateModelAnimationBones", "description": "Update model animation mesh bone matrices (GPU skinning)", "returnType": "void", "params": [ diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 934c08eb7..f532cd0d5 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -7607,7 +7607,7 @@ return { } }, { - name = "UpdateModelAnimationBoneMatrices", + name = "UpdateModelAnimationBones", description = "Update model animation mesh bone matrices (GPU skinning)", returnType = "void", params = { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 541b5caf3..f45217ac6 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -4221,8 +4221,8 @@ Function 502: UpdateModelAnimation() (3 input parameters) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 503: UpdateModelAnimationBoneMatrices() (3 input parameters) - Name: UpdateModelAnimationBoneMatrices +Function 503: UpdateModelAnimationBones() (3 input parameters) + Name: UpdateModelAnimationBones Return type: void Description: Update model animation mesh bone matrices (GPU skinning) Param[1]: model (type: Model) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 58794b4eb..20cb502d8 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2826,7 +2826,7 @@
- + From 66a4f2e90b62d0f322e2b39b1459b148f1c4079b Mon Sep 17 00:00:00 2001 From: waveydave Date: Sun, 3 Nov 2024 19:36:32 +0000 Subject: [PATCH 084/155] Fix for issue 4454, MatrixDecompose() gave incorrect output for certain combinations of scale and rotation (#4461) --- src/raymath.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index d1b5ab01e..e522113b1 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -2569,7 +2569,13 @@ RMAPI void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotatio if (!FloatEquals(det, 0)) { clone.m0 /= s.x; + clone.m4 /= s.x; + clone.m8 /= s.x; + clone.m1 /= s.y; clone.m5 /= s.y; + clone.m9 /= s.y; + clone.m2 /= s.z; + clone.m6 /= s.z; clone.m10 /= s.z; // Extract rotation From ec953240b1023d39b0f5219ee9cc8b56f1fc454f Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Nov 2024 21:02:13 +0100 Subject: [PATCH 085/155] Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 1f68fc46f..e0403dd63 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -155,6 +155,7 @@ WIP: Last update with commit from 02-Nov-2024 [raymath] REVIEWED: Add extern "C" to raymath header for C++ (#3978) by @Jeffery Myers [raymath] REVIEWED: `QuaternionFromAxisAngle()`, remove redundant axis length calculation (#3900) by @jtainer [raymath] REVIEWED: `Vector3Perpendicular()`, avoid implicit conversion from float to double (#3799) by @João Foscarini +[raymath] REVIEWED: `MatrixDecompose()`, incorrect output for certain scale and rotations (#4461) by @waveydave [raymath] REVIEWED: Small code refactor (#3753) by @Idir Carlos Aliane [rshapes] ADDED: `CheckCollisionCircleLine()` (#4018) by @kai-z99 [rshapes] REVIEWED: Multisegment Bezier splines (#3744) by @Santiago Pelufo From 281ee51aff02c9e454891b75d6fdfead8ffccb0f Mon Sep 17 00:00:00 2001 From: decromo Date: Mon, 4 Nov 2024 15:57:50 +0100 Subject: [PATCH 086/155] implemented new linear gradient generation function (#4462) --- src/rtextures.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 92186dd96..c798bdcbf 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -827,16 +827,27 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, float cosDir = cosf(radianDirection); float sinDir = sinf(radianDirection); + // Calculate how far the top-left pixel is along the gradient direction from the center of said gradient + float startingPos = 0.5 - (cosDir*width/2) - (sinDir*height/2); + // With directions that lie in the first or third quadrant (i.e. from top-left to + // bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient + // (i.e. the pixel which should become one of the gradient's ends color); while for + // directions that lie in the second or fourth quadrant, that point is pixel (width, 0). + float maxPosValue = + ((signbit(sinDir) != 0) == (signbit(cosDir) != 0)) + ? fabs(startingPos) + : fabs(startingPos+width*cosDir); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { // Calculate the relative position of the pixel along the gradient direction - float pos = (i*cosDir + j*sinDir)/(width*cosDir + height*sinDir); + float pos = (startingPos + (i*cosDir + j*sinDir)) / maxPosValue; float factor = pos; - factor = (factor > 1.0f)? 1.0f : factor; // Clamp to [0,1] - factor = (factor < 0.0f)? 0.0f : factor; // Clamp to [0,1] + factor = (factor > 1.0f)? 1.0f : factor; // Clamp to [-1,1] + factor = (factor < -1.0f)? -1.0f : factor; // Clamp to [-1,1] + factor = factor / 2 + 0.5f; // Generate the color for this pixel pixels[j*width + i].r = (int)((float)end.r*factor + (float)start.r*(1.0f - factor)); From b47fffb48bfeb6a73060c5fb8847d8db2879110c Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 5 Nov 2024 00:09:12 +0100 Subject: [PATCH 087/155] Update Makefile.Web --- examples/Makefile.Web | 44 +++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 250145053..7ea7f4784 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -1,6 +1,6 @@ #************************************************************************************************** # -# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 +# raylib makefile for Web platform # # Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) # @@ -30,9 +30,12 @@ PLATFORM ?= PLATFORM_WEB # Define required raylib variables PROJECT_NAME ?= raylib_examples -RAYLIB_VERSION ?= 5.0.0 +RAYLIB_VERSION ?= 5.5.0 RAYLIB_PATH ?= .. +# Define raylib source code path +RAYLIB_SRC_PATH ?= ../src + # Locations of raylib.h and libraylib.a/libraylib.so # NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD DESTDIR ?= /usr/local @@ -52,6 +55,11 @@ USE_EXTERNAL_GLFW ?= FALSE # NOTE: This variable is only used for PLATFORM_OS: LINUX USE_WAYLAND_DISPLAY ?= FALSE +# PLATFORM_WEB: Default properties +BUILD_WEB_ASYNCIFY ?= TRUE +BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/shell.html +BUILD_WEB_HEAP_SIZE ?= 134217728 + # Use WebGL2 backend (OpenGL 3.0) # WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 USE_WEBGL2 ?= FALSE @@ -266,13 +274,17 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) - # -sEXPORTED_RUNTIME_METHODS=ccall # require exporting some LEGACY_RUNTIME functions, ccall() is required by miniaudio # -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading # --profiling # include information for code profiling # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map - LDFLAGS += -sUSE_GLFW=3 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=ccall + LDFLAGS += -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall + + # Build using asyncify + ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) + LDFLAGS += -sASYNCIFY + endif # NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0) # WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 @@ -280,17 +292,20 @@ ifeq ($(PLATFORM),PLATFORM_WEB) LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 endif + # Add debug mode flags if required + ifeq ($(BUILD_MODE),DEBUG) + LDFLAGS += -sASSERTIONS=1 --profiling + endif + + # Define a custom shell .html and output extension + LDFLAGS += --shell-file $(BUILD_WEB_SHELL) + EXT = .html + # NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way, # we can compile same code for ALL platforms with no change required, but, working on bigger # projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw # logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference. - # NOTE: Additional compilate flags for TOTAL_MEMORY, FORCE_FILESYSTEM and resources loading - # are specified per-example for optimization - - # Define a custom shell .html and output extension - LDFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html - EXT = .html endif # Define libraries required on linking: LDLIBS @@ -332,7 +347,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling # NOTE: Required packages: mesa-libs - LDLIBS = -lraylib -lGL -lpthread -lm + LDFLAGS += -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib + LDLIBS = -lraylib -lGL -lm -lpthread # On XWindow requires also below libraries LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor @@ -408,7 +424,8 @@ SHAPES = \ shapes/shapes_logo_raylib_anim \ shapes/shapes_rectangle_scaling \ shapes/shapes_splines_drawing \ - shapes/shapes_top_down_lights + shapes/shapes_top_down_lights \ + shapes/shapes_rectangle_advanced TEXTURES = \ textures/textures_background_scrolling \ @@ -417,6 +434,7 @@ TEXTURES = \ textures/textures_draw_tiled \ textures/textures_fog_of_war \ textures/textures_gif_player \ + textures/textures_image_channel \ textures/textures_image_drawing \ textures/textures_image_generation \ textures/textures_image_kernel \ @@ -455,6 +473,7 @@ MODELS = \ models/models_animation \ models/models_gpu_skinning \ models/models_billboard \ + models/models_bone_socket \ models/models_box_collisions \ models/models_cubicmap \ models/models_draw_cube_texture \ @@ -476,6 +495,7 @@ MODELS = \ SHADERS = \ shaders/shaders_basic_lighting \ + shaders/shaders_basic_pbr \ shaders/shaders_custom_uniform \ shaders/shaders_deferred_render \ shaders/shaders_eratosthenes \ From a617e1e217fa3d78e1d3d4e7d0bc4266c88a6dd4 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 6 Nov 2024 12:00:39 +0100 Subject: [PATCH 088/155] Update core_2d_camera_mouse_zoom.c --- examples/core/core_2d_camera_mouse_zoom.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/core/core_2d_camera_mouse_zoom.c b/examples/core/core_2d_camera_mouse_zoom.c index 8af94440d..a9864b168 100644 --- a/examples/core/core_2d_camera_mouse_zoom.c +++ b/examples/core/core_2d_camera_mouse_zoom.c @@ -45,7 +45,7 @@ int main () else if (IsKeyPressed(KEY_TWO)) zoomMode = 1; // Translate based on mouse right click - if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) { Vector2 delta = GetMouseDelta(); delta = Vector2Scale(delta, -1.0f/camera.zoom); @@ -76,8 +76,8 @@ int main () } else { - // Zoom based on mouse left click - if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) + // Zoom based on mouse right click + if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) { // Get the world point that is under the mouse Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera); @@ -89,7 +89,7 @@ int main () // under the cursor to the screen space point under the cursor at any zoom camera.target = mouseWorldPos; } - if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { // Zoom increment float deltaX = GetMouseDelta().x; @@ -119,10 +119,16 @@ int main () DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON); EndMode2D(); + + // Draw mouse reference + //Vector2 mousePos = GetWorldToScreen2D(GetMousePosition(), camera) + DrawCircleV(GetMousePosition(), 4, DARKGRAY); + DrawTextEx(GetFontDefault(), TextFormat("[%i, %i]", GetMouseX(), GetMouseY()), + Vector2Add(GetMousePosition(), (Vector2){ -44, -24 }), 20, 2, BLACK); 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); + if (zoomMode == 0) DrawText("Mouse left button drag to move, mouse wheel to zoom", 20, 50, 20, DARKGRAY); + else DrawText("Mouse left button drag to move, mouse press and move to zoom", 20, 50, 20, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- From 55a64f51b805d158020b74fda3c507ab7510478a Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 7 Nov 2024 12:42:59 -0800 Subject: [PATCH 089/155] fix float casting warnings (#4471) --- src/rtextures.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index c798bdcbf..2d269d7f3 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -828,15 +828,15 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, float sinDir = sinf(radianDirection); // Calculate how far the top-left pixel is along the gradient direction from the center of said gradient - float startingPos = 0.5 - (cosDir*width/2) - (sinDir*height/2); + float startingPos = 0.5f - (cosDir*width/2) - (sinDir*height/2); // With directions that lie in the first or third quadrant (i.e. from top-left to // bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient // (i.e. the pixel which should become one of the gradient's ends color); while for // directions that lie in the second or fourth quadrant, that point is pixel (width, 0). float maxPosValue = ((signbit(sinDir) != 0) == (signbit(cosDir) != 0)) - ? fabs(startingPos) - : fabs(startingPos+width*cosDir); + ? fabsf(startingPos) + : fabsf(startingPos+width*cosDir); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) From dc489786b022bc7bc5de7a3fa4cadc0881916dce Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:28:39 -0500 Subject: [PATCH 090/155] UpdateModelAnimation speedup (#4470) If we borrow from the GPU skinned animation code, we can just multiply the vertex by the matrix * weight and shave a chunk of CPU time. --- src/rmodels.c | 162 +++++++++++++++++++------------------------------- 1 file changed, 60 insertions(+), 102 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index daabbe209..6ddb53ae4 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2262,108 +2262,6 @@ ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount) return animations; } -// Update model animated vertex data (positions and normals) for a given frame -// NOTE: Updated data is uploaded to GPU -void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) -{ - if ((anim.frameCount > 0) && (anim.bones != NULL) && (anim.framePoses != NULL)) - { - if (frame >= anim.frameCount) frame = frame%anim.frameCount; - - for (int m = 0; m < model.meshCount; m++) - { - Mesh mesh = model.meshes[m]; - - if (mesh.boneIds == NULL || mesh.boneWeights == NULL) - { - TRACELOG(LOG_WARNING, "MODEL: UpdateModelAnimation(): Mesh %i has no connection to bones", m); - continue; - } - - bool updated = false; // Flag to check when anim vertex information is updated - Vector3 animVertex = { 0 }; - Vector3 animNormal = { 0 }; - - Vector3 inTranslation = { 0 }; - Quaternion inRotation = { 0 }; - // Vector3 inScale = { 0 }; - - Vector3 outTranslation = { 0 }; - Quaternion outRotation = { 0 }; - Vector3 outScale = { 0 }; - - int boneId = 0; - int boneCounter = 0; - float boneWeight = 0.0; - - const int vValues = mesh.vertexCount*3; - for (int vCounter = 0; vCounter < vValues; vCounter += 3) - { - mesh.animVertices[vCounter] = 0; - mesh.animVertices[vCounter + 1] = 0; - mesh.animVertices[vCounter + 2] = 0; - - if (mesh.animNormals != NULL) - { - mesh.animNormals[vCounter] = 0; - mesh.animNormals[vCounter + 1] = 0; - mesh.animNormals[vCounter + 2] = 0; - } - - // Iterates over 4 bones per vertex - for (int j = 0; j < 4; j++, boneCounter++) - { - boneWeight = mesh.boneWeights[boneCounter]; - - // Early stop when no transformation will be applied - if (boneWeight == 0.0f) continue; - - boneId = mesh.boneIds[boneCounter]; - //int boneIdParent = model.bones[boneId].parent; - inTranslation = model.bindPose[boneId].translation; - inRotation = model.bindPose[boneId].rotation; - //inScale = model.bindPose[boneId].scale; - outTranslation = anim.framePoses[frame][boneId].translation; - outRotation = anim.framePoses[frame][boneId].rotation; - outScale = anim.framePoses[frame][boneId].scale; - - // Vertices processing - // NOTE: We use meshes.vertices (default vertex position) to calculate meshes.animVertices (animated vertex position) - animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] }; - animVertex = Vector3Subtract(animVertex, inTranslation); - animVertex = Vector3Multiply(animVertex, outScale); - animVertex = Vector3RotateByQuaternion(animVertex, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); - animVertex = Vector3Add(animVertex, outTranslation); - //animVertex = Vector3Transform(animVertex, model.transform); - mesh.animVertices[vCounter] += animVertex.x*boneWeight; - mesh.animVertices[vCounter + 1] += animVertex.y*boneWeight; - mesh.animVertices[vCounter + 2] += animVertex.z*boneWeight; - updated = true; - - // Normals processing - // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) - if (mesh.normals != NULL) - { - animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; - animNormal = Vector3RotateByQuaternion(animNormal, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); - mesh.animNormals[vCounter] += animNormal.x*boneWeight; - mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; - mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight; - } - } - } - - // Upload new vertex data to GPU for model drawing - // NOTE: Only update data when values changed - if (updated) - { - rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position - rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals - } - } - } -} - // Update model animated bones transform matrices for a given frame // NOTE: Updated data is not uploaded to GPU but kept at model.meshes[i].boneMatrices[boneId], // to be uploaded to shader at drawing, in case GPU skinning is enabled @@ -2411,6 +2309,66 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) } } +// at least 2x speed up vs the old method +// Update model animated vertex data (positions and normals) for a given frame +// NOTE: Updated data is uploaded to GPU +void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) +{ + UpdateModelAnimationBones(model,anim,frame); + for (int m = 0; m < model.meshCount; m++) + { + Mesh mesh = model.meshes[m]; + Vector3 animVertex = { 0 }; + Vector3 animNormal = { 0 }; + int boneId = 0; + int boneCounter = 0; + float boneWeight = 0.0; + bool updated = false; // Flag to check when anim vertex information is updated + const int vValues = mesh.vertexCount*3; + for (int vCounter = 0; vCounter < vValues; vCounter += 3) + { + mesh.animVertices[vCounter] = 0; + mesh.animVertices[vCounter + 1] = 0; + mesh.animVertices[vCounter + 2] = 0; + if (mesh.animNormals != NULL) + { + mesh.animNormals[vCounter] = 0; + mesh.animNormals[vCounter + 1] = 0; + mesh.animNormals[vCounter + 2] = 0; + } + // Iterates over 4 bones per vertex + for (int j = 0; j < 4; j++, boneCounter++) + { + boneWeight = mesh.boneWeights[boneCounter]; + boneId = mesh.boneIds[boneCounter]; + // Early stop when no transformation will be applied + if (boneWeight == 0.0f) continue; + animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] }; + animVertex = Vector3Transform(animVertex,model.meshes[m].boneMatrices[boneId]); + mesh.animVertices[vCounter] += animVertex.x * boneWeight; + mesh.animVertices[vCounter+1] += animVertex.y * boneWeight; + mesh.animVertices[vCounter+2] += animVertex.z * boneWeight; + updated = true; + // Normals processing + // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) + if (mesh.normals != NULL) + { + animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; + animNormal = Vector3Transform(animNormal,model.meshes[m].boneMatrices[boneId]); + mesh.animNormals[vCounter] += animNormal.x*boneWeight; + mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; + mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight; + } + } + } + if (updated) + { + rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position + rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals + } + } +} + // Unload animation array data void UnloadModelAnimations(ModelAnimation *animations, int animCount) { From 53b929cbfb50300a4b1e3bfd7986ee091b0d2dcf Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Fri, 8 Nov 2024 14:31:31 +0100 Subject: [PATCH 091/155] Improve cross-compilation with zig builds (#4468) - Add xcode_frameworks when cross compiling for mac (ref: https://github.com/hexops/mach/blob/main/build.zig) - Add emsdk when cross compiling for wasm (ref: https://github.com/floooh/sokol-zig/blob/master/build.zig) Signed-off-by: Tomas Slusny --- build.zig | 55 ++++++++++++++++++++++++++++++++++++++++----------- build.zig.zon | 24 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 build.zig.zon diff --git a/build.zig b/build.zig index 75a77dd51..c5e2f718b 100644 --- a/build.zig +++ b/build.zig @@ -2,7 +2,7 @@ const std = @import("std"); const builtin = @import("builtin"); /// Minimum supported version of Zig -const min_ver = "0.12.0"; +const min_ver = "0.13.0"; comptime { const order = std.SemanticVersion.order; @@ -15,7 +15,7 @@ comptime { // get the flags a second time when adding raygui var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{}; -// This has been tested with zig version 0.12.0 +// This has been tested with zig version 0.13.0 pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { const raylib_dep = b.dependencyFromBuildZig(@This(), .{ .target = target, @@ -52,6 +52,30 @@ fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend } } +fn createEmsdkStep(b: *std.Build, emsdk: *std.Build.Dependency) *std.Build.Step.Run { + if (builtin.os.tag == .windows) { + return b.addSystemCommand(&.{emsdk.path("emsdk.bat").getPath(b)}); + } else { + return b.addSystemCommand(&.{emsdk.path("emsdk").getPath(b)}); + } +} + +fn emSdkSetupStep(b: *std.Build, emsdk: *std.Build.Dependency) !?*std.Build.Step.Run { + const dot_emsc_path = emsdk.path(".emscripten").getPath(b); + const dot_emsc_exists = !std.meta.isError(std.fs.accessAbsolute(dot_emsc_path, .{})); + + if (!dot_emsc_exists) { + const emsdk_install = createEmsdkStep(b, emsdk); + emsdk_install.addArgs(&.{ "install", "latest" }); + const emsdk_activate = createEmsdkStep(b, emsdk); + emsdk_activate.addArgs(&.{ "activate", "latest" }); + emsdk_activate.step.dependOn(&emsdk_install.step); + return emsdk_activate; + } else { + return null; + } +} + /// A list of all flags from `src/config.h` that one may override const config_h_flags = outer: { // Set this value higher if compile errors happen as `src/config.h` gets larger @@ -223,6 +247,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. waylandGenerate(b, raylib, "xdg-activation-v1.xml", "xdg-activation-v1-client-protocol"); waylandGenerate(b, raylib, "idle-inhibit-unstable-v1.xml", "idle-inhibit-unstable-v1-client-protocol"); } + setDesktopPlatform(raylib, options.platform); } else { if (options.opengl_version == .auto) { @@ -255,6 +280,13 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. setDesktopPlatform(raylib, options.platform); }, .macos => { + // Include xcode_frameworks for cross compilation + if (b.lazyDependency("xcode_frameworks", .{})) |dep| { + raylib.addSystemFrameworkPath(dep.path("Frameworks")); + raylib.addSystemIncludePath(dep.path("include")); + raylib.addLibraryPath(dep.path("lib")); + } + // On macos rglfw.c include Objective-C files. try raylib_flags_arr.append(b.allocator, "-ObjC"); raylib.root_module.addCSourceFile(.{ @@ -271,20 +303,19 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. setDesktopPlatform(raylib, options.platform); }, .emscripten => { + // Include emscripten for cross compilation + if (b.lazyDependency("emsdk", .{})) |dep| { + if (try emSdkSetupStep(b, dep)) |emSdkStep| { + raylib.step.dependOn(&emSdkStep.step); + } + + raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include")); + } + raylib.defineCMacro("PLATFORM_WEB", null); if (options.opengl_version == .auto) { raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); } - - if (b.sysroot == null) { - @panic("Pass '--sysroot \"$EMSDK/upstream/emscripten\"'"); - } - - const cache_include = b.pathJoin(&.{ b.sysroot.?, "cache", "sysroot", "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(.{ .cwd_relative = cache_include }); }, else => { @panic("Unsupported OS"); diff --git a/build.zig.zon b/build.zig.zon new file mode 100644 index 000000000..557028e45 --- /dev/null +++ b/build.zig.zon @@ -0,0 +1,24 @@ +.{ + .name = "raylib", + .version = "5.5.0", + .minimum_zig_version = "0.13.0", + + .dependencies = .{ + .xcode_frameworks = .{ + .url = "git+https://github.com/hexops/xcode-frameworks#a6bf82e032d4d9923ad5c222d466710fcc05f249", + .hash = "12208da4dfcd9b53fb367375fb612ec73f38e53015f1ce6ae6d6e8437a637078e170", + .lazy = true, + }, + .emsdk = .{ + .url = "git+https://github.com/emscripten-core/emsdk#3.1.50", + .hash = "1220e8fe9509f0843e5e22326300ca415c27afbfbba3992f3c3184d71613540b5564", + .lazy = true, + }, + }, + + .paths = .{ + "build.zig", + "build.zig.zon", + "src", + }, +} From 00396e34369a1696180849216c3e5aca264c70e4 Mon Sep 17 00:00:00 2001 From: "Everton Jr." <69195288+evertonse@users.noreply.github.com> Date: Sat, 9 Nov 2024 15:40:41 -0300 Subject: [PATCH 092/155] [rcore] Clipboard Image Support (#4459) * [rcore] add 'GetClipboardImage' for windows * [rcore] GetClipboardImage removed some unneeded defines * [rcore] PLATFORM_SDL: create a compatility layer for SDL3 * external: add win32_clipboard.h header only lib * [rcore] using win32_clipboard on platforms rlfw and rgfw * [rcore] fix warnings in SDL3 compatibility layer * Makefile: Allow specifying SDL_LIBRARIES to link, this helps with SDL3 * Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW * Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW * [rcore]: PLATFORM_SDL: improve clipboard data retrieval * external: remove unused function from win32_clipboard.h * Makefile: allow for extra flags necessary when compiling for SDL3 * [rcore]: fix string typo * [rcore]: Properly handle NULL dpi passing. As is allowed in SDL2 * external: fix arch finding on win32_clipboard.h to allow compilation on msvc cmake CI * [rcore]: PLATFORM_SDL: Treat monitor as an ID in SDL3 as opposed to an index as in SDL2 * [rcore]: typo --- examples/Makefile | 18 +- src/Makefile | 6 +- src/config.h | 28 +++ src/external/win32_clipboard.h | 374 +++++++++++++++++++++++++++++ src/platforms/rcore_desktop_glfw.c | 32 +++ src/platforms/rcore_desktop_rgfw.c | 37 +++ src/platforms/rcore_desktop_sdl.c | 346 +++++++++++++++++++++++++- src/raylib.h | 1 + src/rcore.c | 6 + 9 files changed, 837 insertions(+), 11 deletions(-) create mode 100644 src/external/win32_clipboard.h diff --git a/examples/Makefile b/examples/Makefile index 304599cf8..a47911b5e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -87,6 +87,8 @@ USE_EXTERNAL_GLFW ?= FALSE # WARNING: Library is not included in raylib, it MUST be configured by users SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib +SDL_LIBRARIES ?= -lSDL2 -lSDL2main + # Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system) # NOTE: This variable is only used for PLATFORM_OS: LINUX @@ -263,9 +265,9 @@ endif # Define include paths for required headers: INCLUDE_PATHS # NOTE: Some external/extras libraries could be required (stb, easings...) #------------------------------------------------------------------------------------------------ -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external - +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS) # Define additional directories containing required header files + ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),BSD) INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include @@ -415,12 +417,12 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation - LDLIBS = -lraylib -lSDL2 -lSDL2main -lopengl32 -lgdi32 + LDLIBS = -lraylib $(SDL_LIBRARIES) -lopengl32 -lgdi32 endif ifeq ($(PLATFORM_OS),LINUX) # Libraries for Debian GNU/Linux desktop compiling # NOTE: Required packages: libegl1-mesa-dev - LDLIBS = -lraylib -lSDL2 -lSDL2main -lGL -lm -lpthread -ldl -lrt + LDLIBS = -lraylib $(SDL_LIBRARIES) -lGL -lm -lpthread -ldl -lrt # On X11 requires also below libraries LDLIBS += -lX11 @@ -646,8 +648,12 @@ OTHERS = \ others/embedded_files_loading \ others/raylib_opengl_interop \ others/raymath_vector_angle \ - others/rlgl_compute_shader \ - others/rlgl_standalone + others/rlgl_compute_shader + +ifeq ($(TARGET_PLATFORM), PLATFORM_DESKTOP_GFLW) + OTHERS += others/rlgl_standalone +endif + CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST)) diff --git a/src/Makefile b/src/Makefile index 1f0b730c6..265f95ca0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -118,6 +118,8 @@ GLFW_LINUX_ENABLE_X11 ?= TRUE # WARNING: Library is not included in raylib, it MUST be configured by users SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib +SDL_LIBRARIES ?= -lSDL2 -lSDL2main + # Determine if the file has root access (only required to install raylib) # "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root") @@ -460,7 +462,7 @@ CFLAGS += $(CUSTOM_CFLAGS) # Define include paths for required headers: INCLUDE_PATHS # NOTE: Several external required libraries (stb and others) #------------------------------------------------------------------------------------------------ -INCLUDE_PATHS = -I. +INCLUDE_PATHS = -I. $(EXTRA_INCLUDE_PATHS) # Define additional directories containing required header files ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) @@ -586,7 +588,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) LDLIBS += -lX11 endif endif - LDLIBS += -lSDL2 -lSDL2main + LDLIBS += $(SDL_LIBRARIES) endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) ifeq ($(PLATFORM_OS),WINDOWS) diff --git a/src/config.h b/src/config.h index f37a9de3e..e3749c560 100644 --- a/src/config.h +++ b/src/config.h @@ -71,6 +71,7 @@ // Enabling this flag allows manual control of the frame processes, use at your own risk //#define SUPPORT_CUSTOM_FRAME_CONTROL 1 + // rcore: Configuration values //------------------------------------------------------------------------------------ #define MAX_FILEPATH_CAPACITY 8192 // Maximum file paths capacity @@ -272,4 +273,31 @@ //------------------------------------------------------------------------------------ #define MAX_TRACELOG_MSG_LENGTH 256 // Max length of one trace-log message + +// Enable partial support for clipboard image, only working on SDL3 or +// being on both Windows OS + GLFW or Windows OS + RGFW +#define SUPPORT_CLIPBOARD_IMAGE 1 + +#if defined(SUPPORT_CLIPBOARD_IMAGE) + #ifndef STBI_REQUIRED + #define STBI_REQUIRED + #endif + + #ifndef SUPPORT_FILEFORMAT_BMP // For clipboard image on Windows + #define SUPPORT_FILEFORMAT_BMP 1 + #endif + + #ifndef SUPPORT_FILEFORMAT_PNG // Wayland uses png for prints, at least it was on 22 LTS ubuntu + #define SUPPORT_FILEFORMAT_PNG 1 + #endif + + #ifndef SUPPORT_FILEFORMAT_JPG + #define SUPPORT_FILEFORMAT_JPG 1 + #endif + + #ifndef SUPPORT_MODULE_RTEXTURES + #define SUPPORT_MODULE_RTEXTURES 1 + #endif +#endif + #endif // CONFIG_H diff --git a/src/external/win32_clipboard.h b/src/external/win32_clipboard.h new file mode 100644 index 000000000..832856432 --- /dev/null +++ b/src/external/win32_clipboard.h @@ -0,0 +1,374 @@ +#if !defined(_WIN32) +# error "This module is only made for Windows OS" +#endif + +#ifndef WIN32_CLIPBOARD_ +#define WIN32_CLIPBOARD_ +unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long long int *dataSize); +#endif // WIN32_CLIPBOARD_ + +#ifdef WIN32_CLIPBOARD_IMPLEMENTATION +#include +#include +#include +#include + +// NOTE: These search for architecture is taken from "Windows.h", and it's necessary if we really don't wanna import windows.h +// and still make it compile on msvc, because import indirectly importing "winnt.h" (e.g. ) can cause problems is these are not defined. +#if !defined(_X86_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IX86) +#define _X86_ +#if !defined(_CHPE_X86_ARM64_) && defined(_M_HYBRID) +#define _CHPE_X86_ARM64_ +#endif +#endif + +#if !defined(_AMD64_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && (defined(_M_AMD64) || defined(_M_ARM64EC)) +#define _AMD64_ +#endif + +#if !defined(_ARM_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_ARM) +#define _ARM_ +#endif + +#if !defined(_ARM64_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64EC_) && defined(_M_ARM64) +#define _ARM64_ +#endif + +#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_ARM64EC) +#define _ARM64EC_ +#endif + +#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_M68K) +#define _68K_ +#endif + +#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_MPPC) +#define _MPPC_ +#endif + +#if !defined(_IA64_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_M_IX86) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IA64) +#define _IA64_ +#endif + + +#define WIN32_LEAN_AND_MEAN +// #include +// #include +// #include +#include +// #include + +#ifndef WINAPI +#if defined(_ARM_) +#define WINAPI +#else +#define WINAPI __stdcall +#endif +#endif + +#ifndef WINAPI +#if defined(_ARM_) +#define WINAPI +#else +#define WINAPI __stdcall +#endif +#endif + +#ifndef WINBASEAPI +#ifndef _KERNEL32_ +#define WINBASEAPI DECLSPEC_IMPORT +#else +#define WINBASEAPI +#endif +#endif + +#ifndef WINUSERAPI +#ifndef _USER32_ +#define WINUSERAPI __declspec (dllimport) +#else +#define WINUSERAPI +#endif +#endif + +typedef int WINBOOL; + + + +// typedef HANDLE HGLOBAL; + +#ifndef HWND +#define HWND void* +#endif + + +#if !defined(_WINUSER_) || !defined(WINUSER_ALREADY_INCLUDED) +WINUSERAPI WINBOOL WINAPI OpenClipboard(HWND hWndNewOwner); +WINUSERAPI WINBOOL WINAPI CloseClipboard(VOID); +WINUSERAPI DWORD WINAPI GetClipboardSequenceNumber(VOID); +WINUSERAPI HWND WINAPI GetClipboardOwner(VOID); +WINUSERAPI HWND WINAPI SetClipboardViewer(HWND hWndNewViewer); +WINUSERAPI HWND WINAPI GetClipboardViewer(VOID); +WINUSERAPI WINBOOL WINAPI ChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext); +WINUSERAPI HANDLE WINAPI SetClipboardData(UINT uFormat, HANDLE hMem); +WINUSERAPI HANDLE WINAPI GetClipboardData(UINT uFormat); +WINUSERAPI UINT WINAPI RegisterClipboardFormatA(LPCSTR lpszFormat); +WINUSERAPI UINT WINAPI RegisterClipboardFormatW(LPCWSTR lpszFormat); +WINUSERAPI int WINAPI CountClipboardFormats(VOID); +WINUSERAPI UINT WINAPI EnumClipboardFormats(UINT format); +WINUSERAPI int WINAPI GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount); +WINUSERAPI int WINAPI GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, int cchMaxCount); +WINUSERAPI WINBOOL WINAPI EmptyClipboard(VOID); +WINUSERAPI WINBOOL WINAPI IsClipboardFormatAvailable(UINT format); +WINUSERAPI int WINAPI GetPriorityClipboardFormat(UINT *paFormatPriorityList, int cFormats); +WINUSERAPI HWND WINAPI GetOpenClipboardWindow(VOID); +#endif + +#ifndef HGLOBAL +#define HGLOBAL void* +#endif + +#if !defined(_WINBASE_) || !defined(WINBASE_ALREADY_INCLUDED) +WINBASEAPI SIZE_T WINAPI GlobalSize (HGLOBAL hMem); +WINBASEAPI LPVOID WINAPI GlobalLock (HGLOBAL hMem); +WINBASEAPI WINBOOL WINAPI GlobalUnlock (HGLOBAL hMem); +#endif + + +#if !defined(_WINGDI_) || !defined(WINGDI_ALREADY_INCLUDED) +#ifndef BITMAPINFOHEADER_ALREADY_DEFINED +#define BITMAPINFOHEADER_ALREADY_DEFINED +// Does this header need to be packed ? by the windowps header it doesnt seem to be +#pragma pack(push, 1) +typedef struct tagBITMAPINFOHEADER { + DWORD biSize; + LONG biWidth; + LONG biHeight; + WORD biPlanes; + WORD biBitCount; + DWORD biCompression; + DWORD biSizeImage; + LONG biXPelsPerMeter; + LONG biYPelsPerMeter; + DWORD biClrUsed; + DWORD biClrImportant; +} BITMAPINFOHEADER,*LPBITMAPINFOHEADER,*PBITMAPINFOHEADER; +#pragma pack(pop) +#endif + +#ifndef BITMAPFILEHEADER_ALREADY_DEFINED +#define BITMAPFILEHEADER_ALREADY_DEFINED +#pragma pack(push, 1) +typedef struct tagBITMAPFILEHEADER { + WORD bfType; + DWORD bfSize; + WORD bfReserved1; + WORD bfReserved2; + DWORD bfOffBits; +} BITMAPFILEHEADER,*LPBITMAPFILEHEADER,*PBITMAPFILEHEADER; +#pragma pack(pop) +#endif + +#ifndef RGBQUAD_ALREADY_DEFINED +#define RGBQUAD_ALREADY_DEFINED +typedef struct tagRGBQUAD { + BYTE rgbBlue; + BYTE rgbGreen; + BYTE rgbRed; + BYTE rgbReserved; +} RGBQUAD, *LPRGBQUAD; +#endif + + +// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/4e588f70-bd92-4a6f-b77f-35d0feaf7a57 +#define BI_RGB 0x0000 +#define BI_RLE8 0x0001 +#define BI_RLE4 0x0002 +#define BI_BITFIELDS 0x0003 +#define BI_JPEG 0x0004 +#define BI_PNG 0x0005 +#define BI_CMYK 0x000B +#define BI_CMYKRLE8 0x000C +#define BI_CMYKRLE4 0x000D + +#endif + +// https://learn.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats +#define CF_DIB 8 + +// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setsystemcursor +// #define OCR_NORMAL 32512 // Normal select +// #define OCR_IBEAM 32513 // Text select +// #define OCR_WAIT 32514 // Busy +// #define OCR_CROSS 32515 // Precision select +// #define OCR_UP 32516 // Alternate select +// #define OCR_SIZENWSE 32642 // Diagonal resize 1 +// #define OCR_SIZENESW 32643 // Diagonal resize 2 +// #define OCR_SIZEWE 32644 // Horizontal resize +// #define OCR_SIZENS 32645 // Vertical resize +// #define OCR_SIZEALL 32646 // Move +// #define OCR_NO 32648 // Unavailable +// #define OCR_HAND 32649 // Link select +// #define OCR_APPSTARTING 32650 // + + +//---------------------------------------------------------------------------------- +// Module Internal Functions Declaration +//---------------------------------------------------------------------------------- + + +static BOOL OpenClipboardRetrying(HWND handle); // Open clipboard with a number of retries +static int GetPixelDataOffset(BITMAPINFOHEADER bih); + +unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long long int *dataSize) +{ + HWND win = NULL; // Get from somewhere but is doesnt seem to matter + const char* msgString = ""; + int severity = LOG_INFO; + BYTE* bmpData = NULL; + if (!OpenClipboardRetrying(win)) { + severity = LOG_ERROR; + msgString = "Couldn't open clipboard"; + goto end; + } + + HGLOBAL clipHandle = (HGLOBAL)GetClipboardData(CF_DIB); + if (!clipHandle) { + severity = LOG_ERROR; + msgString = "Clipboard data is not an Image"; + goto close; + } + + BITMAPINFOHEADER *bmpInfoHeader = (BITMAPINFOHEADER *)GlobalLock(clipHandle); + if (!bmpInfoHeader) { + // Mapping from HGLOBAL to our local *address space* failed + severity = LOG_ERROR; + msgString = "Clipboard data failed to be locked"; + goto unlock; + } + + *width = bmpInfoHeader->biWidth; + *height = bmpInfoHeader->biHeight; + + SIZE_T clipDataSize = GlobalSize(clipHandle); + if (clipDataSize < sizeof(BITMAPINFOHEADER)) { + // Format CF_DIB needs space for BITMAPINFOHEADER struct. + msgString = "Clipboard has Malformed data"; + severity = LOG_ERROR; + goto unlock; + } + + // Denotes where the pixel data starts from the bmpInfoHeader pointer + int pixelOffset = GetPixelDataOffset(*bmpInfoHeader); + + //--------------------------------------------------------------------------------// + // + // The rest of the section is about create the bytes for a correct BMP file + // Then we copy the data and to a pointer + // + //--------------------------------------------------------------------------------// + + BITMAPFILEHEADER bmpFileHeader = {0}; + SIZE_T bmpFileSize = sizeof(bmpFileHeader) + clipDataSize; + *dataSize = bmpFileSize; + + bmpFileHeader.bfType = 0x4D42; //https://stackoverflow.com/questions/601430/multibyte-character-constants-and-bitmap-file-header-type-constants#601536 + + bmpFileHeader.bfSize = (DWORD)bmpFileSize; // Up to 4GB works fine + bmpFileHeader.bfOffBits = sizeof(bmpFileHeader) + pixelOffset; + + // + // Each process has a default heap provided by the system + // Memory objects allocated by GlobalAlloc and LocalAlloc are in private, + // committed pages with read/write access that cannot be accessed by other processes. + // + // This may be wrong since we might be allocating in a DLL and freeing from another module, the main application + // that may cause heap corruption. We could create a FreeImage function + // + bmpData = malloc(sizeof(bmpFileHeader) + clipDataSize); + // First we add the header for a bmp file + memcpy(bmpData, &bmpFileHeader, sizeof(bmpFileHeader)); + // Then we add the header for the bmp itself + the pixel data + memcpy(bmpData + sizeof(bmpFileHeader), bmpInfoHeader, clipDataSize); + msgString = "Clipboad image acquired successfully"; + + +unlock: + GlobalUnlock(clipHandle); +close: + CloseClipboard(); +end: + + TRACELOG(severity, msgString); + return bmpData; +} + +static BOOL OpenClipboardRetrying(HWND hWnd) +{ + static const int maxTries = 20; + static const int sleepTimeMS = 60; + for (int _ = 0; _ < maxTries; ++_) + { + // Might be being hold by another process + // Or yourself forgot to CloseClipboard + if (OpenClipboard(hWnd)) { + return true; + } + Sleep(sleepTimeMS); + } + return false; +} + +// Based off of researching microsoft docs and reponses from this question https://stackoverflow.com/questions/30552255/how-to-read-a-bitmap-from-the-windows-clipboard#30552856 +// https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader +// Get the byte offset where does the pixels data start (from a packed DIB) +static int GetPixelDataOffset(BITMAPINFOHEADER bih) +{ + int offset = 0; + const unsigned int rgbaSize = sizeof(RGBQUAD); + + // biSize Specifies the number of bytes required by the structure + // We expect to always be 40 because it should be packed + if (40 == bih.biSize && 40 == sizeof(BITMAPINFOHEADER)) + { + // + // biBitCount Specifies the number of bits per pixel. + // Might exist some bit masks *after* the header and *before* the pixel offset + // we're looking, but only if we have more than + // 8 bits per pixel, so we need to ajust for that + // + if (bih.biBitCount > 8) + { + // if bih.biCompression is RBG we should NOT offset more + + if (bih.biCompression == BI_BITFIELDS) + { + offset += 3 * rgbaSize; + } else if (bih.biCompression == 6 /* BI_ALPHABITFIELDS */) + { + // Not widely supported, but valid. + offset += 4 * rgbaSize; + } + } + } + + // + // biClrUsed Specifies the number of color indices in the color table that are actually used by the bitmap. + // If this value is zero, the bitmap uses the maximum number of colors + // corresponding to the value of the biBitCount member for the compression mode specified by biCompression. + // If biClrUsed is nonzero and the biBitCount member is less than 16 + // the biClrUsed member specifies the actual number of colors + // + if (bih.biClrUsed > 0) { + offset += bih.biClrUsed * rgbaSize; + } else { + if (bih.biBitCount < 16) + { + offset = offset + (rgbaSize << bih.biBitCount); + } + } + + return bih.biSize + offset; +} +#endif // WIN32_CLIPBOARD_IMPLEMENTATION +// EOF + diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 45811e766..e765debc1 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -58,6 +58,7 @@ #if defined(_WIN32) typedef void *PVOID; typedef PVOID HANDLE; + #include "../external/win32_clipboard.h" typedef HANDLE HWND; #define GLFW_EXPOSE_NATIVE_WIN32 #define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h @@ -966,6 +967,33 @@ const char *GetClipboardText(void) return glfwGetClipboardString(platform.handle); } +#if defined(SUPPORT_CLIPBOARD_IMAGE) +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = {0}; + unsigned long long int dataSize = 0; + void* fileData = NULL; + +#ifdef _WIN32 + int width, height; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); +#else + TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_GLFW doesn't implement `GetClipboardImage` for this OS"); +#endif + + if (fileData == NULL) + { + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + } + else + { + image = LoadImageFromMemory(".bmp", fileData, dataSize); + } + return image; +} +#endif // SUPPORT_CLIPBOARD_IMAGE + // Show mouse cursor void ShowCursor(void) { @@ -1898,4 +1926,8 @@ static void JoystickCallback(int jid, int event) } } +#ifdef _WIN32 +# define WIN32_CLIPBOARD_IMPLEMENTATION +# include "../external/win32_clipboard.h" +#endif // EOF diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 68885ce3f..f3f26e3e8 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -664,6 +664,43 @@ const char *GetClipboardText(void) return RGFW_readClipboard(NULL); } + +#if defined(SUPPORT_CLIPBOARD_IMAGE) + +#ifdef _WIN32 +# define WIN32_CLIPBOARD_IMPLEMENTATION +# define WINUSER_ALREADY_INCLUDED +# define WINBASE_ALREADY_INCLUDED +# define WINGDI_ALREADY_INCLUDED +# include "../external/win32_clipboard.h" +#endif + +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = {0}; + unsigned long long int dataSize = 0; + void* fileData = NULL; + +#ifdef _WIN32 + int width, height; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); +#else + TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); +#endif + + if (fileData == NULL) + { + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + } + else + { + image = LoadImageFromMemory(".bmp", fileData, dataSize); + } + return image; +} +#endif // SUPPORT_CLIPBOARD_IMAGE + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 7cbe0354e..a201f2cde 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -23,7 +23,7 @@ * Custom flag for rcore on target platform -not used- * * DEPENDENCIES: -* - SDL 2 (main library): Windowing and inputs management +* - SDL 2 or SLD 3 (main library): Windowing and inputs management * - gestures: Gestures system for touch-ready devices (or simulated from mouse inputs) * * @@ -48,6 +48,10 @@ * **********************************************************************************************/ + +#ifndef SDL_ENABLE_OLD_NAMES + #define SDL_ENABLE_OLD_NAMES // Just in case we're on SDL3, we need some in-between compatibily +#endif #include "SDL.h" // SDL base library (window/rendered, input, timing... functionality) #if defined(GRAPHICS_API_OPENGL_ES2) @@ -64,6 +68,13 @@ #define MAX_CLIPBOARD_BUFFER_LENGTH 1024 // Size of the clipboard buffer used on GetClipboardText() #endif +#if ((defined(SDL_MAJOR_VERSION) && SDL_MAJOR_VERSION == 3) && (defined(SDL_MINOR_VERSION) && SDL_MINOR_VERSION >= 1)) + #ifndef PLATFORM_DESKTOP_SDL3 + #define PLATFORM_DESKTOP_SDL3 + #endif +#endif + + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -227,6 +238,190 @@ static const int CursorsLUT[] = { //SDL_SYSTEM_CURSOR_WAITARROW, // No equivalent implemented on MouseCursor enum on raylib.h }; + +// SDL3 Migration Layer made to avoid `ifdefs` inside functions when we can. +#ifdef PLATFORM_DESKTOP_SDL3 + +// SDL3 Migration: +// SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, +// and you can call SDL_GetWindowFullscreenMode() +// to see whether an exclusive fullscreen mode will be used +// or the borderless fullscreen desktop mode will be used +#define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN + + +#define SDL_IGNORE false +#define SDL_DISABLE false +#define SDL_ENABLE true + +// SDL3 Migration: SDL_INIT_TIMER - no longer needed before calling SDL_AddTimer() +#define SDL_INIT_TIMER 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) + +// SDL3 Migration: The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag. +#define SDL_WINDOW_SHOWN 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) + +// +// SDL3 Migration: Renamed +// IMPORTANT: +// Might need to call SDL_CleanupEvent somewhere see :https://github.com/libsdl-org/SDL/issues/3540#issuecomment-1793449852 +// +#define SDL_DROPFILE SDL_EVENT_DROP_FILE + + +const char* SDL_GameControllerNameForIndex(int joystickIndex) +{ + // NOTE: SDL3 uses the IDs itself (SDL_JoystickID) instead of SDL2 joystick_index + const char* name = NULL; + int numJoysticks = 0; + SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); + if (joysticks) { + if (joystickIndex < numJoysticks) { + SDL_JoystickID instance_id = joysticks[joystickIndex]; + name = SDL_GetGamepadNameForID(instance_id); + } + SDL_free(joysticks); + } + return name; +} + +int SDL_GetNumVideoDisplays(void) +{ + int monitorCount = 0; + SDL_DisplayID *displays = SDL_GetDisplays(&monitorCount); + // Safe because If `mem` is NULL, SDL_free does nothing. + SDL_free(displays); + + return monitorCount; +} + + +// SLD3 Migration: +// To emulate SDL2 this function should return `SDL_DISABLE` or `SDL_ENABLE` +// representing the *processing state* of the event before this function makes any changes to it. +Uint8 SDL_EventState(Uint32 type, int state) { + + Uint8 stateBefore = SDL_EventEnabled(type); + switch (state) + { + case SDL_DISABLE: SDL_SetEventEnabled(type, false); break; + case SDL_ENABLE: SDL_SetEventEnabled(type, true); break; + default: TRACELOG(LOG_WARNING, "Event sate: unknow type"); + } + return stateBefore; +} + +void SDL_GetCurrentDisplayMode_Adapter(SDL_DisplayID displayID, SDL_DisplayMode* mode) +{ + const SDL_DisplayMode* currMode = SDL_GetCurrentDisplayMode(displayID); + if (currMode == NULL) + { + TRACELOG(LOG_WARNING, "No current display mode"); + } + else + { + *mode = *currMode; + } +} + +// SDL3 Migration: Renamed +#define SDL_GetCurrentDisplayMode SDL_GetCurrentDisplayMode_Adapter + + +SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +{ + return SDL_CreateSurface(width, height, SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask)); +} + +// SDL3 Migration: +// SDL_GetDisplayDPI() - +// not reliable across platforms, approximately replaced by multiplying +// SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms. +// returns 0 on success or a negative error code on failure +int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) { + float dpi = SDL_GetWindowDisplayScale(platform.window) * 96.0; + if (ddpi != NULL) *ddpi = dpi; + if (hdpi != NULL) *hdpi = dpi; + if (vdpi != NULL) *vdpi = dpi; + return 0; +} + +SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format) +{ + return SDL_CreateSurface(width, height, format); +} + +SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +{ + return SDL_CreateSurfaceFrom(width, height, SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask), pixels, pitch); +} + +SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format) +{ + return SDL_CreateSurfaceFrom(width, height, format, pixels, pitch); +} + +int SDL_NumJoysticks(void) +{ + int numJoysticks; + SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); + SDL_free(joysticks); + return numJoysticks; +} + + +// SDL_SetRelativeMouseMode +// returns 0 on success or a negative error code on failure +// If relative mode is not supported, this returns -1. +int SDL_SetRelativeMouseMode_Adapter(SDL_bool enabled) +{ + + // + // SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled) + // \returns true on success or false on failure; call SDL_GetError() for more + // + if (SDL_SetWindowRelativeMouseMode(platform.window, enabled)) + { + return 0; // success + } + else + { + return -1; // failure + } +} + +#define SDL_SetRelativeMouseMode SDL_SetRelativeMouseMode_Adapter + +bool SDL_GetRelativeMouseMode_Adapter(void) +{ + return SDL_GetWindowRelativeMouseMode(platform.window); +} + +#define SDL_GetRelativeMouseMode SDL_GetRelativeMouseMode_Adapter + + +int SDL_GetNumTouchFingers(SDL_TouchID touchID) +{ + // SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) + int count = 0; + SDL_Finger **fingers = SDL_GetTouchFingers(touchID, &count); + SDL_free(fingers); + return count; +} + +#else // We're on SDL2 + +// Since SDL2 doesn't have this function we leave a stub +// SDL_GetClipboardData function is available since SDL 3.1.3. (e.g. SDL3) +void* SDL_GetClipboardData(const char *mime_type, size_t *size) { + TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); + // We could possibly implement it ourselves in this case for some easier platforms + return NULL; +} + +#endif // PLATFORM_DESKTOP_SDL3 + + + //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- @@ -256,7 +451,12 @@ void ToggleFullscreen(void) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); + +#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) +#else if ((monitor >= 0) && (monitor < monitorCount)) +#endif { if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) > 0) { @@ -279,7 +479,11 @@ void ToggleBorderlessWindowed(void) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); +#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) +#else if ((monitor >= 0) && (monitor < monitorCount)) +#endif { if ((CORE.Window.flags & FLAG_BORDERLESS_WINDOWED_MODE) > 0) { @@ -328,7 +532,11 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); + #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) + #else if ((monitor >= 0) && (monitor < monitorCount)) + #endif { SDL_SetWindowFullscreen(platform.window, SDL_WINDOW_FULLSCREEN); CORE.Window.fullscreen = true; @@ -387,7 +595,11 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); + #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) + #else if ((monitor >= 0) && (monitor < monitorCount)) + #endif { SDL_SetWindowFullscreen(platform.window, SDL_WINDOW_FULLSCREEN_DESKTOP); } @@ -606,7 +818,11 @@ void SetWindowMonitor(int monitor) const int screenWidth = CORE.Window.screen.width; const int screenHeight = CORE.Window.screen.height; SDL_Rect usableBounds; + #ifdef PLATFORM_DESKTOP_SDL3 // Different style for success checking + if (SDL_GetDisplayUsableBounds(monitor, &usableBounds)) + #else if (SDL_GetDisplayUsableBounds(monitor, &usableBounds) == 0) + #endif { if (wasFullscreen == 1) ToggleFullscreen(); // Leave fullscreen. @@ -704,6 +920,7 @@ int GetCurrentMonitor(void) { int currentMonitor = 0; + // Be aware that this returns an ID in SDL3 and a Index in SDL2 currentMonitor = SDL_GetWindowDisplayIndex(platform.window); return currentMonitor; @@ -716,7 +933,11 @@ Vector2 GetMonitorPosition(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { SDL_Rect displayBounds; + #ifdef PLATFORM_DESKTOP_SDL3 + if (SDL_GetDisplayUsableBounds(monitor, &displayBounds)) + #else if (SDL_GetDisplayUsableBounds(monitor, &displayBounds) == 0) + #endif { return (Vector2){ (float)displayBounds.x, (float)displayBounds.y }; } @@ -844,10 +1065,16 @@ Vector2 GetWindowScaleDPI(void) { Vector2 scale = { 1.0f, 1.0f }; +#ifndef PLATFORM_DESKTOP_SDL3 // NOTE: SDL_GetWindowDisplayScale was only added on SDL3 // see https://wiki.libsdl.org/SDL3/SDL_GetWindowDisplayScale // TODO: Implement the window scale factor calculation manually. TRACELOG(LOG_WARNING, "GetWindowScaleDPI() not implemented on target platform"); +#else + scale.x = SDL_GetWindowDisplayScale(platform.window); + scale.y = scale.x; + TRACELOG(LOG_INFO, "WindowScaleDPI is %f", scale.x); +#endif return scale; } @@ -877,19 +1104,68 @@ const char *GetClipboardText(void) return buffer; } + +#if defined(SUPPORT_CLIPBOARD_IMAGE) +// Get clipboard image +Image GetClipboardImage(void) +{ + // Let's hope compiler put these arrays in static memory + const char *image_formats[] = { + "image/bmp", + "image/png", + "image/jpg", + "image/tiff", + }; + const char *image_extensions[] = { + ".bmp", + ".png", + ".jpg", + ".tiff", + }; + + + Image image = {0}; + size_t dataSize = 0; + void *fileData = NULL; + for (int i = 0; i < SDL_arraysize(image_formats); ++i) + { + // NOTE: This pointer should be free with SDL_free() at some point. + fileData = SDL_GetClipboardData(image_formats[i], &dataSize); + if (fileData) { + image = LoadImageFromMemory(image_extensions[i], fileData, dataSize); + if (IsImageValid(image)) + { + TRACELOG(LOG_INFO, "Clipboard image: Got image from clipboard as a `%s` successfully", image_extensions[i]); + return image; + } + } + } + + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data. %s", SDL_GetError()); + return image; +} +#endif + + // Show mouse cursor void ShowCursor(void) { +#ifdef PLATFORM_DESKTOP_SDL3 + SDL_ShowCursor(); +#else SDL_ShowCursor(SDL_ENABLE); - +#endif CORE.Input.Mouse.cursorHidden = false; } // Hides mouse cursor void HideCursor(void) { +#ifdef PLATFORM_DESKTOP_SDL3 + SDL_HideCursor(); +#else SDL_ShowCursor(SDL_DISABLE); - +#endif CORE.Input.Mouse.cursorHidden = true; } @@ -897,7 +1173,13 @@ void HideCursor(void) void EnableCursor(void) { SDL_SetRelativeMouseMode(SDL_FALSE); + +#ifdef PLATFORM_DESKTOP_SDL3 + // SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible() + SDL_ShowCursor(); +#else SDL_ShowCursor(SDL_ENABLE); +#endif platform.cursorRelative = false; CORE.Input.Mouse.cursorHidden = false; @@ -993,6 +1275,22 @@ const char *GetKeyName(int key) static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) { +#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 + int count = 0; + SDL_Finger **fingers = SDL_GetTouchFingers(event.touchID, &count); + CORE.Input.Touch.pointCount = count; + + for (int i = 0; i < CORE.Input.Touch.pointCount; i++) + { + SDL_Finger *finger = fingers[i]; + CORE.Input.Touch.pointId[i] = finger->id; + CORE.Input.Touch.position[i].x = finger->x*CORE.Window.screen.width; + CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; + CORE.Input.Touch.currentTouchState[i] = 1; + } + SDL_free(fingers); +#else // SDL2 + CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId); for (int i = 0; i < CORE.Input.Touch.pointCount; i++) @@ -1003,6 +1301,7 @@ static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; CORE.Input.Touch.currentTouchState[i] = 1; } +#endif for (int i = CORE.Input.Touch.pointCount; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.currentTouchState[i] = 0; } @@ -1094,16 +1393,26 @@ void PollInputEvents(void) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); + #ifdef PLATFORM_DESKTOP_SDL3 + // const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ + // Event memory is now managed by SDL, so you should not free the data in SDL_EVENT_DROP_FILE, and if you want to hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, you should make a copy of it. SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed. + strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); + #else strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file); SDL_free(event.drop.file); + #endif CORE.Window.dropFileCount++; } else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); + #ifdef PLATFORM_DESKTOP_SDL3 + strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); + #else strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file); SDL_free(event.drop.file); + #endif CORE.Window.dropFileCount++; } @@ -1112,10 +1421,18 @@ void PollInputEvents(void) } break; // Window events are also polled (Minimized, maximized, close...) + + #ifndef PLATFORM_DESKTOP_SDL3 + // SDL3 states: + // The SDL_WINDOWEVENT_* events have been moved to top level events, + // and SDL_WINDOWEVENT has been removed. + // In general, handling this change just means checking for the individual events instead of first checking for SDL_WINDOWEVENT + // and then checking for window events. You can compare the event >= SDL_EVENT_WINDOW_FIRST and <= SDL_EVENT_WINDOW_LAST if you need to see whether it's a window event. case SDL_WINDOWEVENT: { switch (event.window.event) { + #endif case SDL_WINDOWEVENT_RESIZED: case SDL_WINDOWEVENT_SIZE_CHANGED: { @@ -1143,14 +1460,23 @@ void PollInputEvents(void) case SDL_WINDOWEVENT_FOCUS_GAINED: case SDL_WINDOWEVENT_MAXIMIZED: case SDL_WINDOWEVENT_RESTORED: + #ifdef PLATFORM_DESKTOP_SDL3 + break; + #else default: break; } } break; + #endif // Keyboard events case SDL_KEYDOWN: { + #ifdef PLATFORM_DESKTOP_SDL3 + // SDL3 Migration: The following structures have been removed: * SDL_Keysym + KeyboardKey key = ConvertScancodeToKey(event.key.scancode); + #else KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); + #endif if (key != KEY_NULL) { @@ -1175,7 +1501,12 @@ void PollInputEvents(void) case SDL_KEYUP: { + + #ifdef PLATFORM_DESKTOP_SDL3 + KeyboardKey key = ConvertScancodeToKey(event.key.scancode); + #else KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); + #endif if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 0; } break; @@ -1527,7 +1858,11 @@ int InitPlatform(void) } // Init window +#ifdef PLATFORM_DESKTOP_SDL3 + platform.window = SDL_CreateWindow(CORE.Window.title, CORE.Window.screen.width, CORE.Window.screen.height, flags); +#else platform.window = SDL_CreateWindow(CORE.Window.title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, CORE.Window.screen.width, CORE.Window.screen.height, flags); +#endif // Init OpenGL context platform.glContext = SDL_GL_CreateContext(platform.window); @@ -1611,7 +1946,12 @@ int InitPlatform(void) CORE.Storage.basePath = SDL_GetBasePath(); // Alternative: GetWorkingDirectory(); //---------------------------------------------------------------------------- + +#ifdef PLATFORM_DESKTOP_SDL3 + TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL3): Initialized successfully"); +#else TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL): Initialized successfully"); +#endif return 0; } diff --git a/src/raylib.h b/src/raylib.h index e0822bb7d..02b3ee731 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1011,6 +1011,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI Image GetClipboardImage(void); // Get clipboard image RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling diff --git a/src/rcore.c b/src/rcore.c index 75b9bf451..2d1808c14 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -512,6 +512,12 @@ const char *TextFormat(const char *text, ...); // Formatting of tex #define PLATFORM_DESKTOP_GLFW #endif +#if defined(SUPPORT_CLIPBOARD_IMAGE) + #if !defined(SUPPORT_FILEFORMAT_BMP) || !defined(STBI_REQUIRED) || !defined(SUPPORT_MODULE_RTEXTURES) + #error "To enabled SUPPORT_CLIPBOARD_IMAGE, it also needs SUPPORT_FILEFORMAT_BMP, SUPPORT_MODULE_RTEXTURES and STBI_REQUIRED to be defined. It should have been defined earlier" + #endif +#endif // SUPPORT_CLIPBOARD_IMAGE + // Include platform-specific submodules #if defined(PLATFORM_DESKTOP_GLFW) #include "platforms/rcore_desktop_glfw.c" From d8feef5279a6a13f4bf1e59e4c72f07d71e7553b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 9 Nov 2024 18:40:56 +0000 Subject: [PATCH 093/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 5 + parser/output/raylib_api.lua | 5 + parser/output/raylib_api.txt | 1075 +++++++++++++++++---------------- parser/output/raylib_api.xml | 4 +- 4 files changed, 553 insertions(+), 536 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 8f5a6c826..aa86d3f71 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3520,6 +3520,11 @@ "description": "Get clipboard text content", "returnType": "const char *" }, + { + "name": "GetClipboardImage", + "description": "Get clipboard image", + "returnType": "Image" + }, { "name": "EnableEventWaiting", "description": "Enable waiting for events on EndDrawing(), no automatic event polling", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index f532cd0d5..e5a20049e 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3397,6 +3397,11 @@ return { description = "Get clipboard text content", returnType = "const char *" }, + { + name = "GetClipboardImage", + description = "Get clipboard image", + returnType = "Image" + }, { name = "EnableEventWaiting", description = "Enable waiting for events on EndDrawing(), no automatic event polling", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index f45217ac6..e38495559 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -988,7 +988,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 580 +Functions found: 581 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -1227,112 +1227,117 @@ Function 046: GetClipboardText() (0 input parameters) Return type: const char * Description: Get clipboard text content No input parameters -Function 047: EnableEventWaiting() (0 input parameters) +Function 047: GetClipboardImage() (0 input parameters) + Name: GetClipboardImage + Return type: Image + Description: Get clipboard image + No input parameters +Function 048: EnableEventWaiting() (0 input parameters) Name: EnableEventWaiting Return type: void Description: Enable waiting for events on EndDrawing(), no automatic event polling No input parameters -Function 048: DisableEventWaiting() (0 input parameters) +Function 049: DisableEventWaiting() (0 input parameters) Name: DisableEventWaiting Return type: void Description: Disable waiting for events on EndDrawing(), automatic events polling No input parameters -Function 049: ShowCursor() (0 input parameters) +Function 050: ShowCursor() (0 input parameters) Name: ShowCursor Return type: void Description: Shows cursor No input parameters -Function 050: HideCursor() (0 input parameters) +Function 051: HideCursor() (0 input parameters) Name: HideCursor Return type: void Description: Hides cursor No input parameters -Function 051: IsCursorHidden() (0 input parameters) +Function 052: IsCursorHidden() (0 input parameters) Name: IsCursorHidden Return type: bool Description: Check if cursor is not visible No input parameters -Function 052: EnableCursor() (0 input parameters) +Function 053: EnableCursor() (0 input parameters) Name: EnableCursor Return type: void Description: Enables cursor (unlock cursor) No input parameters -Function 053: DisableCursor() (0 input parameters) +Function 054: DisableCursor() (0 input parameters) Name: DisableCursor Return type: void Description: Disables cursor (lock cursor) No input parameters -Function 054: IsCursorOnScreen() (0 input parameters) +Function 055: IsCursorOnScreen() (0 input parameters) Name: IsCursorOnScreen Return type: bool Description: Check if cursor is on the screen No input parameters -Function 055: ClearBackground() (1 input parameters) +Function 056: ClearBackground() (1 input parameters) Name: ClearBackground Return type: void Description: Set background color (framebuffer clear color) Param[1]: color (type: Color) -Function 056: BeginDrawing() (0 input parameters) +Function 057: BeginDrawing() (0 input parameters) Name: BeginDrawing Return type: void Description: Setup canvas (framebuffer) to start drawing No input parameters -Function 057: EndDrawing() (0 input parameters) +Function 058: EndDrawing() (0 input parameters) Name: EndDrawing Return type: void Description: End canvas drawing and swap buffers (double buffering) No input parameters -Function 058: BeginMode2D() (1 input parameters) +Function 059: BeginMode2D() (1 input parameters) Name: BeginMode2D Return type: void Description: Begin 2D mode with custom camera (2D) Param[1]: camera (type: Camera2D) -Function 059: EndMode2D() (0 input parameters) +Function 060: EndMode2D() (0 input parameters) Name: EndMode2D Return type: void Description: Ends 2D mode with custom camera No input parameters -Function 060: BeginMode3D() (1 input parameters) +Function 061: BeginMode3D() (1 input parameters) Name: BeginMode3D Return type: void Description: Begin 3D mode with custom camera (3D) Param[1]: camera (type: Camera3D) -Function 061: EndMode3D() (0 input parameters) +Function 062: EndMode3D() (0 input parameters) Name: EndMode3D Return type: void Description: Ends 3D mode and returns to default 2D orthographic mode No input parameters -Function 062: BeginTextureMode() (1 input parameters) +Function 063: BeginTextureMode() (1 input parameters) Name: BeginTextureMode Return type: void Description: Begin drawing to render texture Param[1]: target (type: RenderTexture2D) -Function 063: EndTextureMode() (0 input parameters) +Function 064: EndTextureMode() (0 input parameters) Name: EndTextureMode Return type: void Description: Ends drawing to render texture No input parameters -Function 064: BeginShaderMode() (1 input parameters) +Function 065: BeginShaderMode() (1 input parameters) Name: BeginShaderMode Return type: void Description: Begin custom shader drawing Param[1]: shader (type: Shader) -Function 065: EndShaderMode() (0 input parameters) +Function 066: EndShaderMode() (0 input parameters) Name: EndShaderMode Return type: void Description: End custom shader drawing (use default shader) No input parameters -Function 066: BeginBlendMode() (1 input parameters) +Function 067: BeginBlendMode() (1 input parameters) Name: BeginBlendMode Return type: void Description: Begin blending mode (alpha, additive, multiplied, subtract, custom) Param[1]: mode (type: int) -Function 067: EndBlendMode() (0 input parameters) +Function 068: EndBlendMode() (0 input parameters) Name: EndBlendMode Return type: void Description: End blending mode (reset to default: alpha blending) No input parameters -Function 068: BeginScissorMode() (4 input parameters) +Function 069: BeginScissorMode() (4 input parameters) Name: BeginScissorMode Return type: void Description: Begin scissor mode (define screen area for following drawing) @@ -1340,61 +1345,61 @@ Function 068: BeginScissorMode() (4 input parameters) Param[2]: y (type: int) Param[3]: width (type: int) Param[4]: height (type: int) -Function 069: EndScissorMode() (0 input parameters) +Function 070: EndScissorMode() (0 input parameters) Name: EndScissorMode Return type: void Description: End scissor mode No input parameters -Function 070: BeginVrStereoMode() (1 input parameters) +Function 071: BeginVrStereoMode() (1 input parameters) Name: BeginVrStereoMode Return type: void Description: Begin stereo rendering (requires VR simulator) Param[1]: config (type: VrStereoConfig) -Function 071: EndVrStereoMode() (0 input parameters) +Function 072: EndVrStereoMode() (0 input parameters) Name: EndVrStereoMode Return type: void Description: End stereo rendering (requires VR simulator) No input parameters -Function 072: LoadVrStereoConfig() (1 input parameters) +Function 073: LoadVrStereoConfig() (1 input parameters) Name: LoadVrStereoConfig Return type: VrStereoConfig Description: Load VR stereo config for VR simulator device parameters Param[1]: device (type: VrDeviceInfo) -Function 073: UnloadVrStereoConfig() (1 input parameters) +Function 074: UnloadVrStereoConfig() (1 input parameters) Name: UnloadVrStereoConfig Return type: void Description: Unload VR stereo config Param[1]: config (type: VrStereoConfig) -Function 074: LoadShader() (2 input parameters) +Function 075: LoadShader() (2 input parameters) Name: LoadShader Return type: Shader Description: Load shader from files and bind default locations Param[1]: vsFileName (type: const char *) Param[2]: fsFileName (type: const char *) -Function 075: LoadShaderFromMemory() (2 input parameters) +Function 076: LoadShaderFromMemory() (2 input parameters) Name: LoadShaderFromMemory Return type: Shader Description: Load shader from code strings and bind default locations Param[1]: vsCode (type: const char *) Param[2]: fsCode (type: const char *) -Function 076: IsShaderValid() (1 input parameters) +Function 077: IsShaderValid() (1 input parameters) Name: IsShaderValid Return type: bool Description: Check if a shader is valid (loaded on GPU) Param[1]: shader (type: Shader) -Function 077: GetShaderLocation() (2 input parameters) +Function 078: GetShaderLocation() (2 input parameters) Name: GetShaderLocation Return type: int Description: Get shader uniform location Param[1]: shader (type: Shader) Param[2]: uniformName (type: const char *) -Function 078: GetShaderLocationAttrib() (2 input parameters) +Function 079: GetShaderLocationAttrib() (2 input parameters) Name: GetShaderLocationAttrib Return type: int Description: Get shader attribute location Param[1]: shader (type: Shader) Param[2]: attribName (type: const char *) -Function 079: SetShaderValue() (4 input parameters) +Function 080: SetShaderValue() (4 input parameters) Name: SetShaderValue Return type: void Description: Set shader uniform value @@ -1402,7 +1407,7 @@ Function 079: SetShaderValue() (4 input parameters) Param[2]: locIndex (type: int) Param[3]: value (type: const void *) Param[4]: uniformType (type: int) -Function 080: SetShaderValueV() (5 input parameters) +Function 081: SetShaderValueV() (5 input parameters) Name: SetShaderValueV Return type: void Description: Set shader uniform value vector @@ -1411,32 +1416,32 @@ Function 080: SetShaderValueV() (5 input parameters) Param[3]: value (type: const void *) Param[4]: uniformType (type: int) Param[5]: count (type: int) -Function 081: SetShaderValueMatrix() (3 input parameters) +Function 082: SetShaderValueMatrix() (3 input parameters) Name: SetShaderValueMatrix Return type: void Description: Set shader uniform value (matrix 4x4) Param[1]: shader (type: Shader) Param[2]: locIndex (type: int) Param[3]: mat (type: Matrix) -Function 082: SetShaderValueTexture() (3 input parameters) +Function 083: SetShaderValueTexture() (3 input parameters) Name: SetShaderValueTexture Return type: void Description: Set shader uniform value for texture (sampler2d) Param[1]: shader (type: Shader) Param[2]: locIndex (type: int) Param[3]: texture (type: Texture2D) -Function 083: UnloadShader() (1 input parameters) +Function 084: UnloadShader() (1 input parameters) Name: UnloadShader Return type: void Description: Unload shader from GPU memory (VRAM) Param[1]: shader (type: Shader) -Function 084: GetScreenToWorldRay() (2 input parameters) +Function 085: GetScreenToWorldRay() (2 input parameters) Name: GetScreenToWorldRay Return type: Ray Description: Get a ray trace from screen position (i.e mouse) Param[1]: position (type: Vector2) Param[2]: camera (type: Camera) -Function 085: GetScreenToWorldRayEx() (4 input parameters) +Function 086: GetScreenToWorldRayEx() (4 input parameters) Name: GetScreenToWorldRayEx Return type: Ray Description: Get a ray trace from screen position (i.e mouse) in a viewport @@ -1444,13 +1449,13 @@ Function 085: GetScreenToWorldRayEx() (4 input parameters) Param[2]: camera (type: Camera) Param[3]: width (type: int) Param[4]: height (type: int) -Function 086: GetWorldToScreen() (2 input parameters) +Function 087: GetWorldToScreen() (2 input parameters) Name: GetWorldToScreen Return type: Vector2 Description: Get the screen space position for a 3d world space position Param[1]: position (type: Vector3) Param[2]: camera (type: Camera) -Function 087: GetWorldToScreenEx() (4 input parameters) +Function 088: GetWorldToScreenEx() (4 input parameters) Name: GetWorldToScreenEx Return type: Vector2 Description: Get size position for a 3d world space position @@ -1458,490 +1463,490 @@ Function 087: GetWorldToScreenEx() (4 input parameters) Param[2]: camera (type: Camera) Param[3]: width (type: int) Param[4]: height (type: int) -Function 088: GetWorldToScreen2D() (2 input parameters) +Function 089: GetWorldToScreen2D() (2 input parameters) Name: GetWorldToScreen2D Return type: Vector2 Description: Get the screen space position for a 2d camera world space position Param[1]: position (type: Vector2) Param[2]: camera (type: Camera2D) -Function 089: GetScreenToWorld2D() (2 input parameters) +Function 090: GetScreenToWorld2D() (2 input parameters) Name: GetScreenToWorld2D Return type: Vector2 Description: Get the world space position for a 2d camera screen space position Param[1]: position (type: Vector2) Param[2]: camera (type: Camera2D) -Function 090: GetCameraMatrix() (1 input parameters) +Function 091: GetCameraMatrix() (1 input parameters) Name: GetCameraMatrix Return type: Matrix Description: Get camera transform matrix (view matrix) Param[1]: camera (type: Camera) -Function 091: GetCameraMatrix2D() (1 input parameters) +Function 092: GetCameraMatrix2D() (1 input parameters) Name: GetCameraMatrix2D Return type: Matrix Description: Get camera 2d transform matrix Param[1]: camera (type: Camera2D) -Function 092: SetTargetFPS() (1 input parameters) +Function 093: SetTargetFPS() (1 input parameters) Name: SetTargetFPS Return type: void Description: Set target FPS (maximum) Param[1]: fps (type: int) -Function 093: GetFrameTime() (0 input parameters) +Function 094: GetFrameTime() (0 input parameters) Name: GetFrameTime Return type: float Description: Get time in seconds for last frame drawn (delta time) No input parameters -Function 094: GetTime() (0 input parameters) +Function 095: GetTime() (0 input parameters) Name: GetTime Return type: double Description: Get elapsed time in seconds since InitWindow() No input parameters -Function 095: GetFPS() (0 input parameters) +Function 096: GetFPS() (0 input parameters) Name: GetFPS Return type: int Description: Get current FPS No input parameters -Function 096: SwapScreenBuffer() (0 input parameters) +Function 097: SwapScreenBuffer() (0 input parameters) Name: SwapScreenBuffer Return type: void Description: Swap back buffer with front buffer (screen drawing) No input parameters -Function 097: PollInputEvents() (0 input parameters) +Function 098: PollInputEvents() (0 input parameters) Name: PollInputEvents Return type: void Description: Register all input events No input parameters -Function 098: WaitTime() (1 input parameters) +Function 099: WaitTime() (1 input parameters) Name: WaitTime Return type: void Description: Wait for some time (halt program execution) Param[1]: seconds (type: double) -Function 099: SetRandomSeed() (1 input parameters) +Function 100: SetRandomSeed() (1 input parameters) Name: SetRandomSeed Return type: void Description: Set the seed for the random number generator Param[1]: seed (type: unsigned int) -Function 100: GetRandomValue() (2 input parameters) +Function 101: GetRandomValue() (2 input parameters) Name: GetRandomValue Return type: int Description: Get a random value between min and max (both included) Param[1]: min (type: int) Param[2]: max (type: int) -Function 101: LoadRandomSequence() (3 input parameters) +Function 102: LoadRandomSequence() (3 input parameters) Name: LoadRandomSequence Return type: int * Description: Load random values sequence, no values repeated Param[1]: count (type: unsigned int) Param[2]: min (type: int) Param[3]: max (type: int) -Function 102: UnloadRandomSequence() (1 input parameters) +Function 103: UnloadRandomSequence() (1 input parameters) Name: UnloadRandomSequence Return type: void Description: Unload random values sequence Param[1]: sequence (type: int *) -Function 103: TakeScreenshot() (1 input parameters) +Function 104: TakeScreenshot() (1 input parameters) Name: TakeScreenshot Return type: void Description: Takes a screenshot of current screen (filename extension defines format) Param[1]: fileName (type: const char *) -Function 104: SetConfigFlags() (1 input parameters) +Function 105: SetConfigFlags() (1 input parameters) Name: SetConfigFlags Return type: void Description: Setup init configuration flags (view FLAGS) Param[1]: flags (type: unsigned int) -Function 105: OpenURL() (1 input parameters) +Function 106: OpenURL() (1 input parameters) Name: OpenURL Return type: void Description: Open URL with default system browser (if available) Param[1]: url (type: const char *) -Function 106: TraceLog() (3 input parameters) +Function 107: TraceLog() (3 input parameters) Name: TraceLog Return type: void Description: Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) Param[1]: logLevel (type: int) Param[2]: text (type: const char *) Param[3]: args (type: ...) -Function 107: SetTraceLogLevel() (1 input parameters) +Function 108: SetTraceLogLevel() (1 input parameters) Name: SetTraceLogLevel Return type: void Description: Set the current threshold (minimum) log level Param[1]: logLevel (type: int) -Function 108: MemAlloc() (1 input parameters) +Function 109: MemAlloc() (1 input parameters) Name: MemAlloc Return type: void * Description: Internal memory allocator Param[1]: size (type: unsigned int) -Function 109: MemRealloc() (2 input parameters) +Function 110: MemRealloc() (2 input parameters) Name: MemRealloc Return type: void * Description: Internal memory reallocator Param[1]: ptr (type: void *) Param[2]: size (type: unsigned int) -Function 110: MemFree() (1 input parameters) +Function 111: MemFree() (1 input parameters) Name: MemFree Return type: void Description: Internal memory free Param[1]: ptr (type: void *) -Function 111: SetTraceLogCallback() (1 input parameters) +Function 112: SetTraceLogCallback() (1 input parameters) Name: SetTraceLogCallback Return type: void Description: Set custom trace log Param[1]: callback (type: TraceLogCallback) -Function 112: SetLoadFileDataCallback() (1 input parameters) +Function 113: SetLoadFileDataCallback() (1 input parameters) Name: SetLoadFileDataCallback Return type: void Description: Set custom file binary data loader Param[1]: callback (type: LoadFileDataCallback) -Function 113: SetSaveFileDataCallback() (1 input parameters) +Function 114: SetSaveFileDataCallback() (1 input parameters) Name: SetSaveFileDataCallback Return type: void Description: Set custom file binary data saver Param[1]: callback (type: SaveFileDataCallback) -Function 114: SetLoadFileTextCallback() (1 input parameters) +Function 115: SetLoadFileTextCallback() (1 input parameters) Name: SetLoadFileTextCallback Return type: void Description: Set custom file text data loader Param[1]: callback (type: LoadFileTextCallback) -Function 115: SetSaveFileTextCallback() (1 input parameters) +Function 116: SetSaveFileTextCallback() (1 input parameters) Name: SetSaveFileTextCallback Return type: void Description: Set custom file text data saver Param[1]: callback (type: SaveFileTextCallback) -Function 116: LoadFileData() (2 input parameters) +Function 117: LoadFileData() (2 input parameters) Name: LoadFileData Return type: unsigned char * Description: Load file data as byte array (read) Param[1]: fileName (type: const char *) Param[2]: dataSize (type: int *) -Function 117: UnloadFileData() (1 input parameters) +Function 118: UnloadFileData() (1 input parameters) Name: UnloadFileData Return type: void Description: Unload file data allocated by LoadFileData() Param[1]: data (type: unsigned char *) -Function 118: SaveFileData() (3 input parameters) +Function 119: SaveFileData() (3 input parameters) Name: SaveFileData Return type: bool Description: Save data to file from byte array (write), returns true on success Param[1]: fileName (type: const char *) Param[2]: data (type: void *) Param[3]: dataSize (type: int) -Function 119: ExportDataAsCode() (3 input parameters) +Function 120: ExportDataAsCode() (3 input parameters) Name: ExportDataAsCode Return type: bool Description: Export data to code (.h), returns true on success Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: fileName (type: const char *) -Function 120: LoadFileText() (1 input parameters) +Function 121: LoadFileText() (1 input parameters) Name: LoadFileText Return type: char * Description: Load text data from file (read), returns a '\0' terminated string Param[1]: fileName (type: const char *) -Function 121: UnloadFileText() (1 input parameters) +Function 122: UnloadFileText() (1 input parameters) Name: UnloadFileText Return type: void Description: Unload file text data allocated by LoadFileText() Param[1]: text (type: char *) -Function 122: SaveFileText() (2 input parameters) +Function 123: SaveFileText() (2 input parameters) Name: SaveFileText Return type: bool Description: Save text data to file (write), string must be '\0' terminated, returns true on success Param[1]: fileName (type: const char *) Param[2]: text (type: char *) -Function 123: FileExists() (1 input parameters) +Function 124: FileExists() (1 input parameters) Name: FileExists Return type: bool Description: Check if file exists Param[1]: fileName (type: const char *) -Function 124: DirectoryExists() (1 input parameters) +Function 125: DirectoryExists() (1 input parameters) Name: DirectoryExists Return type: bool Description: Check if a directory path exists Param[1]: dirPath (type: const char *) -Function 125: IsFileExtension() (2 input parameters) +Function 126: IsFileExtension() (2 input parameters) Name: IsFileExtension Return type: bool Description: Check file extension (including point: .png, .wav) Param[1]: fileName (type: const char *) Param[2]: ext (type: const char *) -Function 126: GetFileLength() (1 input parameters) +Function 127: GetFileLength() (1 input parameters) Name: GetFileLength Return type: int Description: Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) Param[1]: fileName (type: const char *) -Function 127: GetFileExtension() (1 input parameters) +Function 128: GetFileExtension() (1 input parameters) Name: GetFileExtension Return type: const char * Description: Get pointer to extension for a filename string (includes dot: '.png') Param[1]: fileName (type: const char *) -Function 128: GetFileName() (1 input parameters) +Function 129: GetFileName() (1 input parameters) Name: GetFileName Return type: const char * Description: Get pointer to filename for a path string Param[1]: filePath (type: const char *) -Function 129: GetFileNameWithoutExt() (1 input parameters) +Function 130: GetFileNameWithoutExt() (1 input parameters) Name: GetFileNameWithoutExt Return type: const char * Description: Get filename string without extension (uses static string) Param[1]: filePath (type: const char *) -Function 130: GetDirectoryPath() (1 input parameters) +Function 131: GetDirectoryPath() (1 input parameters) Name: GetDirectoryPath Return type: const char * Description: Get full path for a given fileName with path (uses static string) Param[1]: filePath (type: const char *) -Function 131: GetPrevDirectoryPath() (1 input parameters) +Function 132: GetPrevDirectoryPath() (1 input parameters) Name: GetPrevDirectoryPath Return type: const char * Description: Get previous directory path for a given path (uses static string) Param[1]: dirPath (type: const char *) -Function 132: GetWorkingDirectory() (0 input parameters) +Function 133: GetWorkingDirectory() (0 input parameters) Name: GetWorkingDirectory Return type: const char * Description: Get current working directory (uses static string) No input parameters -Function 133: GetApplicationDirectory() (0 input parameters) +Function 134: GetApplicationDirectory() (0 input parameters) Name: GetApplicationDirectory Return type: const char * Description: Get the directory of the running application (uses static string) No input parameters -Function 134: MakeDirectory() (1 input parameters) +Function 135: MakeDirectory() (1 input parameters) Name: MakeDirectory Return type: int Description: Create directories (including full path requested), returns 0 on success Param[1]: dirPath (type: const char *) -Function 135: ChangeDirectory() (1 input parameters) +Function 136: ChangeDirectory() (1 input parameters) Name: ChangeDirectory Return type: bool Description: Change working directory, return true on success Param[1]: dir (type: const char *) -Function 136: IsPathFile() (1 input parameters) +Function 137: IsPathFile() (1 input parameters) Name: IsPathFile Return type: bool Description: Check if a given path is a file or a directory Param[1]: path (type: const char *) -Function 137: IsFileNameValid() (1 input parameters) +Function 138: 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 138: LoadDirectoryFiles() (1 input parameters) +Function 139: LoadDirectoryFiles() (1 input parameters) Name: LoadDirectoryFiles Return type: FilePathList Description: Load directory filepaths Param[1]: dirPath (type: const char *) -Function 139: LoadDirectoryFilesEx() (3 input parameters) +Function 140: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList Description: Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) -Function 140: UnloadDirectoryFiles() (1 input parameters) +Function 141: UnloadDirectoryFiles() (1 input parameters) Name: UnloadDirectoryFiles Return type: void Description: Unload filepaths Param[1]: files (type: FilePathList) -Function 141: IsFileDropped() (0 input parameters) +Function 142: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool Description: Check if a file has been dropped into window No input parameters -Function 142: LoadDroppedFiles() (0 input parameters) +Function 143: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles Return type: FilePathList Description: Load dropped filepaths No input parameters -Function 143: UnloadDroppedFiles() (1 input parameters) +Function 144: UnloadDroppedFiles() (1 input parameters) Name: UnloadDroppedFiles Return type: void Description: Unload dropped filepaths Param[1]: files (type: FilePathList) -Function 144: GetFileModTime() (1 input parameters) +Function 145: GetFileModTime() (1 input parameters) Name: GetFileModTime Return type: long Description: Get file modification time (last write time) Param[1]: fileName (type: const char *) -Function 145: CompressData() (3 input parameters) +Function 146: 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 146: DecompressData() (3 input parameters) +Function 147: 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 147: EncodeDataBase64() (3 input parameters) +Function 148: 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 148: DecodeDataBase64() (2 input parameters) +Function 149: 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 149: ComputeCRC32() (2 input parameters) +Function 150: ComputeCRC32() (2 input parameters) Name: ComputeCRC32 Return type: unsigned int Description: Compute CRC32 hash code Param[1]: data (type: unsigned char *) Param[2]: dataSize (type: int) -Function 150: ComputeMD5() (2 input parameters) +Function 151: ComputeMD5() (2 input parameters) Name: ComputeMD5 Return type: unsigned int * Description: Compute MD5 hash code, returns static int[4] (16 bytes) Param[1]: data (type: unsigned char *) Param[2]: dataSize (type: int) -Function 151: ComputeSHA1() (2 input parameters) +Function 152: ComputeSHA1() (2 input parameters) Name: ComputeSHA1 Return type: unsigned int * Description: Compute SHA1 hash code, returns static int[5] (20 bytes) Param[1]: data (type: unsigned char *) Param[2]: dataSize (type: int) -Function 152: LoadAutomationEventList() (1 input parameters) +Function 153: 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 153: UnloadAutomationEventList() (1 input parameters) +Function 154: UnloadAutomationEventList() (1 input parameters) Name: UnloadAutomationEventList Return type: void Description: Unload automation events list from file Param[1]: list (type: AutomationEventList) -Function 154: ExportAutomationEventList() (2 input parameters) +Function 155: 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 155: SetAutomationEventList() (1 input parameters) +Function 156: SetAutomationEventList() (1 input parameters) Name: SetAutomationEventList Return type: void Description: Set automation event list to record to Param[1]: list (type: AutomationEventList *) -Function 156: SetAutomationEventBaseFrame() (1 input parameters) +Function 157: 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 157: StartAutomationEventRecording() (0 input parameters) +Function 158: StartAutomationEventRecording() (0 input parameters) Name: StartAutomationEventRecording Return type: void Description: Start recording automation events (AutomationEventList must be set) No input parameters -Function 158: StopAutomationEventRecording() (0 input parameters) +Function 159: StopAutomationEventRecording() (0 input parameters) Name: StopAutomationEventRecording Return type: void Description: Stop recording automation events No input parameters -Function 159: PlayAutomationEvent() (1 input parameters) +Function 160: PlayAutomationEvent() (1 input parameters) Name: PlayAutomationEvent Return type: void Description: Play a recorded automation event Param[1]: event (type: AutomationEvent) -Function 160: IsKeyPressed() (1 input parameters) +Function 161: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool Description: Check if a key has been pressed once Param[1]: key (type: int) -Function 161: IsKeyPressedRepeat() (1 input parameters) +Function 162: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool Description: Check if a key has been pressed again Param[1]: key (type: int) -Function 162: IsKeyDown() (1 input parameters) +Function 163: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool Description: Check if a key is being pressed Param[1]: key (type: int) -Function 163: IsKeyReleased() (1 input parameters) +Function 164: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool Description: Check if a key has been released once Param[1]: key (type: int) -Function 164: IsKeyUp() (1 input parameters) +Function 165: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool Description: Check if a key is NOT being pressed Param[1]: key (type: int) -Function 165: GetKeyPressed() (0 input parameters) +Function 166: 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 166: GetCharPressed() (0 input parameters) +Function 167: 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 167: SetExitKey() (1 input parameters) +Function 168: 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 168: IsGamepadAvailable() (1 input parameters) +Function 169: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool Description: Check if a gamepad is available Param[1]: gamepad (type: int) -Function 169: GetGamepadName() (1 input parameters) +Function 170: GetGamepadName() (1 input parameters) Name: GetGamepadName Return type: const char * Description: Get gamepad internal name id Param[1]: gamepad (type: int) -Function 170: IsGamepadButtonPressed() (2 input parameters) +Function 171: 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 171: IsGamepadButtonDown() (2 input parameters) +Function 172: 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 172: IsGamepadButtonReleased() (2 input parameters) +Function 173: 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 173: IsGamepadButtonUp() (2 input parameters) +Function 174: 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 174: GetGamepadButtonPressed() (0 input parameters) +Function 175: GetGamepadButtonPressed() (0 input parameters) Name: GetGamepadButtonPressed Return type: int Description: Get the last gamepad button pressed No input parameters -Function 175: GetGamepadAxisCount() (1 input parameters) +Function 176: GetGamepadAxisCount() (1 input parameters) Name: GetGamepadAxisCount Return type: int Description: Get gamepad axis count for a gamepad Param[1]: gamepad (type: int) -Function 176: GetGamepadAxisMovement() (2 input parameters) +Function 177: 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 177: SetGamepadMappings() (1 input parameters) +Function 178: SetGamepadMappings() (1 input parameters) Name: SetGamepadMappings Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 178: SetGamepadVibration() (4 input parameters) +Function 179: SetGamepadVibration() (4 input parameters) Name: SetGamepadVibration Return type: void Description: Set gamepad vibration for both motors (duration in seconds) @@ -1949,151 +1954,151 @@ Function 178: SetGamepadVibration() (4 input parameters) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) Param[4]: duration (type: float) -Function 179: IsMouseButtonPressed() (1 input parameters) +Function 180: 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 180: IsMouseButtonDown() (1 input parameters) +Function 181: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool Description: Check if a mouse button is being pressed Param[1]: button (type: int) -Function 181: IsMouseButtonReleased() (1 input parameters) +Function 182: 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 182: IsMouseButtonUp() (1 input parameters) +Function 183: 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 183: GetMouseX() (0 input parameters) +Function 184: GetMouseX() (0 input parameters) Name: GetMouseX Return type: int Description: Get mouse position X No input parameters -Function 184: GetMouseY() (0 input parameters) +Function 185: GetMouseY() (0 input parameters) Name: GetMouseY Return type: int Description: Get mouse position Y No input parameters -Function 185: GetMousePosition() (0 input parameters) +Function 186: GetMousePosition() (0 input parameters) Name: GetMousePosition Return type: Vector2 Description: Get mouse position XY No input parameters -Function 186: GetMouseDelta() (0 input parameters) +Function 187: GetMouseDelta() (0 input parameters) Name: GetMouseDelta Return type: Vector2 Description: Get mouse delta between frames No input parameters -Function 187: SetMousePosition() (2 input parameters) +Function 188: 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 188: SetMouseOffset() (2 input parameters) +Function 189: SetMouseOffset() (2 input parameters) Name: SetMouseOffset Return type: void Description: Set mouse offset Param[1]: offsetX (type: int) Param[2]: offsetY (type: int) -Function 189: SetMouseScale() (2 input parameters) +Function 190: SetMouseScale() (2 input parameters) Name: SetMouseScale Return type: void Description: Set mouse scaling Param[1]: scaleX (type: float) Param[2]: scaleY (type: float) -Function 190: GetMouseWheelMove() (0 input parameters) +Function 191: 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 191: GetMouseWheelMoveV() (0 input parameters) +Function 192: GetMouseWheelMoveV() (0 input parameters) Name: GetMouseWheelMoveV Return type: Vector2 Description: Get mouse wheel movement for both X and Y No input parameters -Function 192: SetMouseCursor() (1 input parameters) +Function 193: SetMouseCursor() (1 input parameters) Name: SetMouseCursor Return type: void Description: Set mouse cursor Param[1]: cursor (type: int) -Function 193: GetTouchX() (0 input parameters) +Function 194: 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 194: GetTouchY() (0 input parameters) +Function 195: 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 195: GetTouchPosition() (1 input parameters) +Function 196: 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 196: GetTouchPointId() (1 input parameters) +Function 197: GetTouchPointId() (1 input parameters) Name: GetTouchPointId Return type: int Description: Get touch point identifier for given index Param[1]: index (type: int) -Function 197: GetTouchPointCount() (0 input parameters) +Function 198: GetTouchPointCount() (0 input parameters) Name: GetTouchPointCount Return type: int Description: Get number of touch points No input parameters -Function 198: SetGesturesEnabled() (1 input parameters) +Function 199: SetGesturesEnabled() (1 input parameters) Name: SetGesturesEnabled Return type: void Description: Enable a set of gestures using flags Param[1]: flags (type: unsigned int) -Function 199: IsGestureDetected() (1 input parameters) +Function 200: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool Description: Check if a gesture have been detected Param[1]: gesture (type: unsigned int) -Function 200: GetGestureDetected() (0 input parameters) +Function 201: GetGestureDetected() (0 input parameters) Name: GetGestureDetected Return type: int Description: Get latest detected gesture No input parameters -Function 201: GetGestureHoldDuration() (0 input parameters) +Function 202: GetGestureHoldDuration() (0 input parameters) Name: GetGestureHoldDuration Return type: float Description: Get gesture hold time in seconds No input parameters -Function 202: GetGestureDragVector() (0 input parameters) +Function 203: GetGestureDragVector() (0 input parameters) Name: GetGestureDragVector Return type: Vector2 Description: Get gesture drag vector No input parameters -Function 203: GetGestureDragAngle() (0 input parameters) +Function 204: GetGestureDragAngle() (0 input parameters) Name: GetGestureDragAngle Return type: float Description: Get gesture drag angle No input parameters -Function 204: GetGesturePinchVector() (0 input parameters) +Function 205: GetGesturePinchVector() (0 input parameters) Name: GetGesturePinchVector Return type: Vector2 Description: Get gesture pinch delta No input parameters -Function 205: GetGesturePinchAngle() (0 input parameters) +Function 206: GetGesturePinchAngle() (0 input parameters) Name: GetGesturePinchAngle Return type: float Description: Get gesture pinch angle No input parameters -Function 206: UpdateCamera() (2 input parameters) +Function 207: 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 207: UpdateCameraPro() (4 input parameters) +Function 208: UpdateCameraPro() (4 input parameters) Name: UpdateCameraPro Return type: void Description: Update camera movement/rotation @@ -2101,36 +2106,36 @@ Function 207: UpdateCameraPro() (4 input parameters) Param[2]: movement (type: Vector3) Param[3]: rotation (type: Vector3) Param[4]: zoom (type: float) -Function 208: SetShapesTexture() (2 input parameters) +Function 209: 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 209: GetShapesTexture() (0 input parameters) +Function 210: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D Description: Get texture that is used for shapes drawing No input parameters -Function 210: GetShapesTextureRectangle() (0 input parameters) +Function 211: GetShapesTextureRectangle() (0 input parameters) Name: GetShapesTextureRectangle Return type: Rectangle Description: Get texture source rectangle that is used for shapes drawing No input parameters -Function 211: DrawPixel() (3 input parameters) +Function 212: DrawPixel() (3 input parameters) Name: DrawPixel Return type: void Description: Draw a pixel using geometry [Can be slow, use with care] Param[1]: posX (type: int) Param[2]: posY (type: int) Param[3]: color (type: Color) -Function 212: DrawPixelV() (2 input parameters) +Function 213: DrawPixelV() (2 input parameters) Name: DrawPixelV Return type: void Description: Draw a pixel using geometry (Vector version) [Can be slow, use with care] Param[1]: position (type: Vector2) Param[2]: color (type: Color) -Function 213: DrawLine() (5 input parameters) +Function 214: DrawLine() (5 input parameters) Name: DrawLine Return type: void Description: Draw a line @@ -2139,14 +2144,14 @@ Function 213: DrawLine() (5 input parameters) Param[3]: endPosX (type: int) Param[4]: endPosY (type: int) Param[5]: color (type: Color) -Function 214: DrawLineV() (3 input parameters) +Function 215: 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 215: DrawLineEx() (4 input parameters) +Function 216: DrawLineEx() (4 input parameters) Name: DrawLineEx Return type: void Description: Draw a line (using triangles/quads) @@ -2154,14 +2159,14 @@ Function 215: DrawLineEx() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 216: DrawLineStrip() (3 input parameters) +Function 217: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 217: DrawLineBezier() (4 input parameters) +Function 218: DrawLineBezier() (4 input parameters) Name: DrawLineBezier Return type: void Description: Draw line segment cubic-bezier in-out interpolation @@ -2169,7 +2174,7 @@ Function 217: DrawLineBezier() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 218: DrawCircle() (4 input parameters) +Function 219: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2177,7 +2182,7 @@ Function 218: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 219: DrawCircleSector() (6 input parameters) +Function 220: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2187,7 +2192,7 @@ Function 219: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 220: DrawCircleSectorLines() (6 input parameters) +Function 221: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2197,7 +2202,7 @@ Function 220: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 221: DrawCircleGradient() (5 input parameters) +Function 222: DrawCircleGradient() (5 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2206,14 +2211,14 @@ Function 221: DrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 222: DrawCircleV() (3 input parameters) +Function 223: 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 223: DrawCircleLines() (4 input parameters) +Function 224: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2221,14 +2226,14 @@ Function 223: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 224: DrawCircleLinesV() (3 input parameters) +Function 225: 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 225: DrawEllipse() (5 input parameters) +Function 226: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2237,7 +2242,7 @@ Function 225: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 226: DrawEllipseLines() (5 input parameters) +Function 227: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2246,7 +2251,7 @@ Function 226: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 227: DrawRing() (7 input parameters) +Function 228: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2257,7 +2262,7 @@ Function 227: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 228: DrawRingLines() (7 input parameters) +Function 229: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2268,7 +2273,7 @@ Function 228: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 229: DrawRectangle() (5 input parameters) +Function 230: DrawRectangle() (5 input parameters) Name: DrawRectangle Return type: void Description: Draw a color-filled rectangle @@ -2277,20 +2282,20 @@ Function 229: DrawRectangle() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 230: DrawRectangleV() (3 input parameters) +Function 231: 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 231: DrawRectangleRec() (2 input parameters) +Function 232: 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 232: DrawRectanglePro() (4 input parameters) +Function 233: DrawRectanglePro() (4 input parameters) Name: DrawRectanglePro Return type: void Description: Draw a color-filled rectangle with pro parameters @@ -2298,7 +2303,7 @@ Function 232: DrawRectanglePro() (4 input parameters) Param[2]: origin (type: Vector2) Param[3]: rotation (type: float) Param[4]: color (type: Color) -Function 233: DrawRectangleGradientV() (6 input parameters) +Function 234: DrawRectangleGradientV() (6 input parameters) Name: DrawRectangleGradientV Return type: void Description: Draw a vertical-gradient-filled rectangle @@ -2308,7 +2313,7 @@ Function 233: DrawRectangleGradientV() (6 input parameters) Param[4]: height (type: int) Param[5]: top (type: Color) Param[6]: bottom (type: Color) -Function 234: DrawRectangleGradientH() (6 input parameters) +Function 235: DrawRectangleGradientH() (6 input parameters) Name: DrawRectangleGradientH Return type: void Description: Draw a horizontal-gradient-filled rectangle @@ -2318,7 +2323,7 @@ Function 234: DrawRectangleGradientH() (6 input parameters) Param[4]: height (type: int) Param[5]: left (type: Color) Param[6]: right (type: Color) -Function 235: DrawRectangleGradientEx() (5 input parameters) +Function 236: DrawRectangleGradientEx() (5 input parameters) Name: DrawRectangleGradientEx Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors @@ -2327,7 +2332,7 @@ Function 235: DrawRectangleGradientEx() (5 input parameters) Param[3]: bottomLeft (type: Color) Param[4]: topRight (type: Color) Param[5]: bottomRight (type: Color) -Function 236: DrawRectangleLines() (5 input parameters) +Function 237: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void Description: Draw rectangle outline @@ -2336,14 +2341,14 @@ Function 236: DrawRectangleLines() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 237: DrawRectangleLinesEx() (3 input parameters) +Function 238: 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 238: DrawRectangleRounded() (4 input parameters) +Function 239: DrawRectangleRounded() (4 input parameters) Name: DrawRectangleRounded Return type: void Description: Draw rectangle with rounded edges @@ -2351,7 +2356,7 @@ Function 238: DrawRectangleRounded() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 239: DrawRectangleRoundedLines() (4 input parameters) +Function 240: DrawRectangleRoundedLines() (4 input parameters) Name: DrawRectangleRoundedLines Return type: void Description: Draw rectangle lines with rounded edges @@ -2359,7 +2364,7 @@ Function 239: DrawRectangleRoundedLines() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 240: DrawRectangleRoundedLinesEx() (5 input parameters) +Function 241: DrawRectangleRoundedLinesEx() (5 input parameters) Name: DrawRectangleRoundedLinesEx Return type: void Description: Draw rectangle with rounded edges outline @@ -2368,7 +2373,7 @@ Function 240: DrawRectangleRoundedLinesEx() (5 input parameters) Param[3]: segments (type: int) Param[4]: lineThick (type: float) Param[5]: color (type: Color) -Function 241: DrawTriangle() (4 input parameters) +Function 242: DrawTriangle() (4 input parameters) Name: DrawTriangle Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -2376,7 +2381,7 @@ Function 241: DrawTriangle() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 242: DrawTriangleLines() (4 input parameters) +Function 243: DrawTriangleLines() (4 input parameters) Name: DrawTriangleLines Return type: void Description: Draw triangle outline (vertex in counter-clockwise order!) @@ -2384,21 +2389,21 @@ Function 242: DrawTriangleLines() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 243: DrawTriangleFan() (3 input parameters) +Function 244: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 244: DrawTriangleStrip() (3 input parameters) +Function 245: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 245: DrawPoly() (5 input parameters) +Function 246: DrawPoly() (5 input parameters) Name: DrawPoly Return type: void Description: Draw a regular polygon (Vector version) @@ -2407,7 +2412,7 @@ Function 245: DrawPoly() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 246: DrawPolyLines() (5 input parameters) +Function 247: DrawPolyLines() (5 input parameters) Name: DrawPolyLines Return type: void Description: Draw a polygon outline of n sides @@ -2416,7 +2421,7 @@ Function 246: DrawPolyLines() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 247: DrawPolyLinesEx() (6 input parameters) +Function 248: DrawPolyLinesEx() (6 input parameters) Name: DrawPolyLinesEx Return type: void Description: Draw a polygon outline of n sides with extended parameters @@ -2426,7 +2431,7 @@ Function 247: DrawPolyLinesEx() (6 input parameters) Param[4]: rotation (type: float) Param[5]: lineThick (type: float) Param[6]: color (type: Color) -Function 248: DrawSplineLinear() (4 input parameters) +Function 249: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2434,7 +2439,7 @@ Function 248: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 249: DrawSplineBasis() (4 input parameters) +Function 250: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2442,7 +2447,7 @@ Function 249: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 250: DrawSplineCatmullRom() (4 input parameters) +Function 251: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2450,7 +2455,7 @@ Function 250: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 251: DrawSplineBezierQuadratic() (4 input parameters) +Function 252: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2458,7 +2463,7 @@ Function 251: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 252: DrawSplineBezierCubic() (4 input parameters) +Function 253: 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...] @@ -2466,7 +2471,7 @@ Function 252: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 253: DrawSplineSegmentLinear() (4 input parameters) +Function 254: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2474,7 +2479,7 @@ Function 253: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 254: DrawSplineSegmentBasis() (6 input parameters) +Function 255: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2484,7 +2489,7 @@ Function 254: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 255: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 256: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2494,7 +2499,7 @@ Function 255: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 256: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 257: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2503,7 +2508,7 @@ Function 256: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 257: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 258: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2513,14 +2518,14 @@ Function 257: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 258: GetSplinePointLinear() (3 input parameters) +Function 259: 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 259: GetSplinePointBasis() (5 input parameters) +Function 260: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2529,7 +2534,7 @@ Function 259: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 260: GetSplinePointCatmullRom() (5 input parameters) +Function 261: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2538,7 +2543,7 @@ Function 260: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 261: GetSplinePointBezierQuad() (4 input parameters) +Function 262: GetSplinePointBezierQuad() (4 input parameters) Name: GetSplinePointBezierQuad Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2546,7 +2551,7 @@ Function 261: GetSplinePointBezierQuad() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 262: GetSplinePointBezierCubic() (5 input parameters) +Function 263: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2555,13 +2560,13 @@ Function 262: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 263: CheckCollisionRecs() (2 input parameters) +Function 264: 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 264: CheckCollisionCircles() (4 input parameters) +Function 265: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2569,14 +2574,14 @@ Function 264: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 265: CheckCollisionCircleRec() (3 input parameters) +Function 266: 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 266: CheckCollisionCircleLine() (4 input parameters) +Function 267: CheckCollisionCircleLine() (4 input parameters) Name: CheckCollisionCircleLine Return type: bool Description: Check if circle collides with a line created betweeen two points [p1] and [p2] @@ -2584,20 +2589,20 @@ Function 266: CheckCollisionCircleLine() (4 input parameters) Param[2]: radius (type: float) Param[3]: p1 (type: Vector2) Param[4]: p2 (type: Vector2) -Function 267: CheckCollisionPointRec() (2 input parameters) +Function 268: 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 268: CheckCollisionPointCircle() (3 input parameters) +Function 269: 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 269: CheckCollisionPointTriangle() (4 input parameters) +Function 270: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2605,7 +2610,7 @@ Function 269: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 270: CheckCollisionPointLine() (4 input parameters) +Function 271: 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] @@ -2613,14 +2618,14 @@ Function 270: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 271: CheckCollisionPointPoly() (3 input parameters) +Function 272: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 272: CheckCollisionLines() (5 input parameters) +Function 273: 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 @@ -2629,18 +2634,18 @@ Function 272: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 273: GetCollisionRec() (2 input parameters) +Function 274: 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 274: LoadImage() (1 input parameters) +Function 275: 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 275: LoadImageRaw() (5 input parameters) +Function 276: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2649,13 +2654,13 @@ Function 275: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 276: LoadImageAnim() (2 input parameters) +Function 277: 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 277: LoadImageAnimFromMemory() (4 input parameters) +Function 278: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2663,60 +2668,60 @@ Function 277: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 278: LoadImageFromMemory() (3 input parameters) +Function 279: 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 279: LoadImageFromTexture() (1 input parameters) +Function 280: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 280: LoadImageFromScreen() (0 input parameters) +Function 281: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 281: IsImageValid() (1 input parameters) +Function 282: IsImageValid() (1 input parameters) Name: IsImageValid Return type: bool Description: Check if an image is valid (data and parameters) Param[1]: image (type: Image) -Function 282: UnloadImage() (1 input parameters) +Function 283: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 283: ExportImage() (2 input parameters) +Function 284: 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 284: ExportImageToMemory() (3 input parameters) +Function 285: 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 285: ExportImageAsCode() (2 input parameters) +Function 286: 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 286: GenImageColor() (3 input parameters) +Function 287: 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 287: GenImageGradientLinear() (5 input parameters) +Function 288: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2725,7 +2730,7 @@ Function 287: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 288: GenImageGradientRadial() (5 input parameters) +Function 289: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2734,7 +2739,7 @@ Function 288: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 289: GenImageGradientSquare() (5 input parameters) +Function 290: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2743,7 +2748,7 @@ Function 289: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 290: GenImageChecked() (6 input parameters) +Function 291: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2753,14 +2758,14 @@ Function 290: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 291: GenImageWhiteNoise() (3 input parameters) +Function 292: 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 292: GenImagePerlinNoise() (5 input parameters) +Function 293: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2769,45 +2774,45 @@ Function 292: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 293: GenImageCellular() (3 input parameters) +Function 294: 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 294: GenImageText() (3 input parameters) +Function 295: 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 295: ImageCopy() (1 input parameters) +Function 296: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 296: ImageFromImage() (2 input parameters) +Function 297: 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 297: ImageFromChannel() (2 input parameters) +Function 298: ImageFromChannel() (2 input parameters) Name: ImageFromChannel Return type: Image Description: Create an image from a selected channel of another image (GRAYSCALE) Param[1]: image (type: Image) Param[2]: selectedChannel (type: int) -Function 298: ImageText() (3 input parameters) +Function 299: 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 299: ImageTextEx() (5 input parameters) +Function 300: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2816,76 +2821,76 @@ Function 299: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 300: ImageFormat() (2 input parameters) +Function 301: 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 301: ImageToPOT() (2 input parameters) +Function 302: 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 302: ImageCrop() (2 input parameters) +Function 303: 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 303: ImageAlphaCrop() (2 input parameters) +Function 304: 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 304: ImageAlphaClear() (3 input parameters) +Function 305: 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 305: ImageAlphaMask() (2 input parameters) +Function 306: 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 306: ImageAlphaPremultiply() (1 input parameters) +Function 307: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 307: ImageBlurGaussian() (2 input parameters) +Function 308: 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 308: ImageKernelConvolution() (3 input parameters) +Function 309: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) -Function 309: ImageResize() (3 input parameters) +Function 310: 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 310: ImageResizeNN() (3 input parameters) +Function 311: 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 311: ImageResizeCanvas() (6 input parameters) +Function 312: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2895,12 +2900,12 @@ Function 311: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 312: ImageMipmaps() (1 input parameters) +Function 313: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 313: ImageDither() (5 input parameters) +Function 314: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2909,109 +2914,109 @@ Function 313: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 314: ImageFlipVertical() (1 input parameters) +Function 315: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 315: ImageFlipHorizontal() (1 input parameters) +Function 316: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 316: ImageRotate() (2 input parameters) +Function 317: 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 317: ImageRotateCW() (1 input parameters) +Function 318: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 318: ImageRotateCCW() (1 input parameters) +Function 319: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 319: ImageColorTint() (2 input parameters) +Function 320: 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 320: ImageColorInvert() (1 input parameters) +Function 321: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 321: ImageColorGrayscale() (1 input parameters) +Function 322: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 322: ImageColorContrast() (2 input parameters) +Function 323: 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 323: ImageColorBrightness() (2 input parameters) +Function 324: 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 324: ImageColorReplace() (3 input parameters) +Function 325: 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 325: LoadImageColors() (1 input parameters) +Function 326: 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 326: LoadImagePalette() (3 input parameters) +Function 327: 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 327: UnloadImageColors() (1 input parameters) +Function 328: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 328: UnloadImagePalette() (1 input parameters) +Function 329: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 329: GetImageAlphaBorder() (2 input parameters) +Function 330: 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 330: GetImageColor() (3 input parameters) +Function 331: 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 331: ImageClearBackground() (2 input parameters) +Function 332: 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 332: ImageDrawPixel() (4 input parameters) +Function 333: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -3019,14 +3024,14 @@ Function 332: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 333: ImageDrawPixelV() (3 input parameters) +Function 334: 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 334: ImageDrawLine() (6 input parameters) +Function 335: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3036,7 +3041,7 @@ Function 334: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 335: ImageDrawLineV() (4 input parameters) +Function 336: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3044,7 +3049,7 @@ Function 335: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 336: ImageDrawLineEx() (5 input parameters) +Function 337: ImageDrawLineEx() (5 input parameters) Name: ImageDrawLineEx Return type: void Description: Draw a line defining thickness within an image @@ -3053,7 +3058,7 @@ Function 336: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 337: ImageDrawCircle() (5 input parameters) +Function 338: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3062,7 +3067,7 @@ Function 337: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 338: ImageDrawCircleV() (4 input parameters) +Function 339: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3070,7 +3075,7 @@ Function 338: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 339: ImageDrawCircleLines() (5 input parameters) +Function 340: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3079,7 +3084,7 @@ Function 339: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 340: ImageDrawCircleLinesV() (4 input parameters) +Function 341: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3087,7 +3092,7 @@ Function 340: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 341: ImageDrawRectangle() (6 input parameters) +Function 342: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3097,7 +3102,7 @@ Function 341: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 342: ImageDrawRectangleV() (4 input parameters) +Function 343: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3105,14 +3110,14 @@ Function 342: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 343: ImageDrawRectangleRec() (3 input parameters) +Function 344: 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 344: ImageDrawRectangleLines() (4 input parameters) +Function 345: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3120,7 +3125,7 @@ Function 344: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 345: ImageDrawTriangle() (5 input parameters) +Function 346: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3129,7 +3134,7 @@ Function 345: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 346: ImageDrawTriangleEx() (7 input parameters) +Function 347: ImageDrawTriangleEx() (7 input parameters) Name: ImageDrawTriangleEx Return type: void Description: Draw triangle with interpolated colors within an image @@ -3140,7 +3145,7 @@ Function 346: ImageDrawTriangleEx() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 347: ImageDrawTriangleLines() (5 input parameters) +Function 348: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3149,7 +3154,7 @@ Function 347: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 348: ImageDrawTriangleFan() (4 input parameters) +Function 349: ImageDrawTriangleFan() (4 input parameters) Name: ImageDrawTriangleFan Return type: void Description: Draw a triangle fan defined by points within an image (first vertex is the center) @@ -3157,7 +3162,7 @@ Function 348: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 349: ImageDrawTriangleStrip() (4 input parameters) +Function 350: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3165,7 +3170,7 @@ Function 349: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 350: ImageDraw() (5 input parameters) +Function 351: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3174,7 +3179,7 @@ Function 350: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 351: ImageDrawText() (6 input parameters) +Function 352: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3184,7 +3189,7 @@ Function 351: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 352: ImageDrawTextEx() (7 input parameters) +Function 353: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3195,79 +3200,79 @@ Function 352: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 353: LoadTexture() (1 input parameters) +Function 354: 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 354: LoadTextureFromImage() (1 input parameters) +Function 355: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 355: LoadTextureCubemap() (2 input parameters) +Function 356: 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 356: LoadRenderTexture() (2 input parameters) +Function 357: 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 357: IsTextureValid() (1 input parameters) +Function 358: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if a texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 358: UnloadTexture() (1 input parameters) +Function 359: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 359: IsRenderTextureValid() (1 input parameters) +Function 360: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if a render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 360: UnloadRenderTexture() (1 input parameters) +Function 361: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 361: UpdateTexture() (2 input parameters) +Function 362: 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 362: UpdateTextureRec() (3 input parameters) +Function 363: 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 363: GenTextureMipmaps() (1 input parameters) +Function 364: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 364: SetTextureFilter() (2 input parameters) +Function 365: 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 365: SetTextureWrap() (2 input parameters) +Function 366: 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 366: DrawTexture() (4 input parameters) +Function 367: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3275,14 +3280,14 @@ Function 366: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 367: DrawTextureV() (3 input parameters) +Function 368: 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 368: DrawTextureEx() (5 input parameters) +Function 369: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3291,7 +3296,7 @@ Function 368: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 369: DrawTextureRec() (4 input parameters) +Function 370: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3299,7 +3304,7 @@ Function 369: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 370: DrawTexturePro() (6 input parameters) +Function 371: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3309,7 +3314,7 @@ Function 370: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 371: DrawTextureNPatch() (6 input parameters) +Function 372: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3319,119 +3324,119 @@ Function 371: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 372: ColorIsEqual() (2 input parameters) +Function 373: 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 373: Fade() (2 input parameters) +Function 374: 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 374: ColorToInt() (1 input parameters) +Function 375: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 375: ColorNormalize() (1 input parameters) +Function 376: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 376: ColorFromNormalized() (1 input parameters) +Function 377: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 377: ColorToHSV() (1 input parameters) +Function 378: 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 378: ColorFromHSV() (3 input parameters) +Function 379: 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 379: ColorTint() (2 input parameters) +Function 380: 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 380: ColorBrightness() (2 input parameters) +Function 381: 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 381: ColorContrast() (2 input parameters) +Function 382: 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 382: ColorAlpha() (2 input parameters) +Function 383: 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 383: ColorAlphaBlend() (3 input parameters) +Function 384: 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 384: ColorLerp() (3 input parameters) +Function 385: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 385: GetColor() (1 input parameters) +Function 386: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 386: GetPixelColor() (2 input parameters) +Function 387: 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 387: SetPixelColor() (3 input parameters) +Function 388: 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 388: GetPixelDataSize() (3 input parameters) +Function 389: 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 389: GetFontDefault() (0 input parameters) +Function 390: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 390: LoadFont() (1 input parameters) +Function 391: 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 391: LoadFontEx() (4 input parameters) +Function 392: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3439,14 +3444,14 @@ Function 391: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 392: LoadFontFromImage() (3 input parameters) +Function 393: 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 393: LoadFontFromMemory() (6 input parameters) +Function 394: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3456,12 +3461,12 @@ Function 393: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 394: IsFontValid() (1 input parameters) +Function 395: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if a font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 395: LoadFontData() (6 input parameters) +Function 396: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3471,7 +3476,7 @@ Function 395: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 396: GenImageFontAtlas() (6 input parameters) +Function 397: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3481,30 +3486,30 @@ Function 396: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 397: UnloadFontData() (2 input parameters) +Function 398: 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 398: UnloadFont() (1 input parameters) +Function 399: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 399: ExportFontAsCode() (2 input parameters) +Function 400: 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 400: DrawFPS() (2 input parameters) +Function 401: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 401: DrawText() (5 input parameters) +Function 402: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3513,7 +3518,7 @@ Function 401: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 402: DrawTextEx() (6 input parameters) +Function 403: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3523,7 +3528,7 @@ Function 402: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 403: DrawTextPro() (8 input parameters) +Function 404: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3535,7 +3540,7 @@ Function 403: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 404: DrawTextCodepoint() (5 input parameters) +Function 405: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3544,7 +3549,7 @@ Function 404: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 405: DrawTextCodepoints() (7 input parameters) +Function 406: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3555,18 +3560,18 @@ Function 405: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 406: SetTextLineSpacing() (1 input parameters) +Function 407: 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 407: MeasureText() (2 input parameters) +Function 408: 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 408: MeasureTextEx() (4 input parameters) +Function 409: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3574,195 +3579,195 @@ Function 408: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 409: GetGlyphIndex() (2 input parameters) +Function 410: 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 410: GetGlyphInfo() (2 input parameters) +Function 411: 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 411: GetGlyphAtlasRec() (2 input parameters) +Function 412: 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 412: LoadUTF8() (2 input parameters) +Function 413: 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 413: UnloadUTF8() (1 input parameters) +Function 414: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 414: LoadCodepoints() (2 input parameters) +Function 415: 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 415: UnloadCodepoints() (1 input parameters) +Function 416: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 416: GetCodepointCount() (1 input parameters) +Function 417: 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 417: GetCodepoint() (2 input parameters) +Function 418: 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 418: GetCodepointNext() (2 input parameters) +Function 419: 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 419: GetCodepointPrevious() (2 input parameters) +Function 420: 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 420: CodepointToUTF8() (2 input parameters) +Function 421: 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 421: TextCopy() (2 input parameters) +Function 422: 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 422: TextIsEqual() (2 input parameters) +Function 423: 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 423: TextLength() (1 input parameters) +Function 424: 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 424: TextFormat() (2 input parameters) +Function 425: 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 425: TextSubtext() (3 input parameters) +Function 426: 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 426: TextReplace() (3 input parameters) +Function 427: 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 427: TextInsert() (3 input parameters) +Function 428: 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 428: TextJoin() (3 input parameters) +Function 429: 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 429: TextSplit() (3 input parameters) +Function 430: 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 430: TextAppend() (3 input parameters) +Function 431: 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 431: TextFindIndex() (2 input parameters) +Function 432: 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 432: TextToUpper() (1 input parameters) +Function 433: 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 433: TextToLower() (1 input parameters) +Function 434: 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 434: TextToPascal() (1 input parameters) +Function 435: 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 435: TextToSnake() (1 input parameters) +Function 436: 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 436: TextToCamel() (1 input parameters) +Function 437: 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 437: TextToInteger() (1 input parameters) +Function 438: 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 438: TextToFloat() (1 input parameters) +Function 439: 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 439: DrawLine3D() (3 input parameters) +Function 440: 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 440: DrawPoint3D() (2 input parameters) +Function 441: 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 441: DrawCircle3D() (5 input parameters) +Function 442: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3771,7 +3776,7 @@ Function 441: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 442: DrawTriangle3D() (4 input parameters) +Function 443: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3779,14 +3784,14 @@ Function 442: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 443: DrawTriangleStrip3D() (3 input parameters) +Function 444: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 444: DrawCube() (5 input parameters) +Function 445: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3795,14 +3800,14 @@ Function 444: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 445: DrawCubeV() (3 input parameters) +Function 446: 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 446: DrawCubeWires() (5 input parameters) +Function 447: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3811,21 +3816,21 @@ Function 446: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 447: DrawCubeWiresV() (3 input parameters) +Function 448: 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 448: DrawSphere() (3 input parameters) +Function 449: 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 449: DrawSphereEx() (5 input parameters) +Function 450: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3834,7 +3839,7 @@ Function 449: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 450: DrawSphereWires() (5 input parameters) +Function 451: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3843,7 +3848,7 @@ Function 450: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 451: DrawCylinder() (6 input parameters) +Function 452: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3853,7 +3858,7 @@ Function 451: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 452: DrawCylinderEx() (6 input parameters) +Function 453: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3863,7 +3868,7 @@ Function 452: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 453: DrawCylinderWires() (6 input parameters) +Function 454: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3873,7 +3878,7 @@ Function 453: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 454: DrawCylinderWiresEx() (6 input parameters) +Function 455: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3883,7 +3888,7 @@ Function 454: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 455: DrawCapsule() (6 input parameters) +Function 456: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3893,7 +3898,7 @@ Function 455: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 456: DrawCapsuleWires() (6 input parameters) +Function 457: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3903,51 +3908,51 @@ Function 456: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 457: DrawPlane() (3 input parameters) +Function 458: 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 458: DrawRay() (2 input parameters) +Function 459: 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 459: DrawGrid() (2 input parameters) +Function 460: 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 460: LoadModel() (1 input parameters) +Function 461: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 461: LoadModelFromMesh() (1 input parameters) +Function 462: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 462: IsModelValid() (1 input parameters) +Function 463: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if a model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 463: UnloadModel() (1 input parameters) +Function 464: 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 464: GetModelBoundingBox() (1 input parameters) +Function 465: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 465: DrawModel() (4 input parameters) +Function 466: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3955,7 +3960,7 @@ Function 465: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 466: DrawModelEx() (6 input parameters) +Function 467: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3965,7 +3970,7 @@ Function 466: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 467: DrawModelWires() (4 input parameters) +Function 468: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3973,7 +3978,7 @@ Function 467: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 468: DrawModelWiresEx() (6 input parameters) +Function 469: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3983,7 +3988,7 @@ Function 468: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 469: DrawModelPoints() (4 input parameters) +Function 470: DrawModelPoints() (4 input parameters) Name: DrawModelPoints Return type: void Description: Draw a model as points @@ -3991,7 +3996,7 @@ Function 469: DrawModelPoints() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 470: DrawModelPointsEx() (6 input parameters) +Function 471: DrawModelPointsEx() (6 input parameters) Name: DrawModelPointsEx Return type: void Description: Draw a model as points with extended parameters @@ -4001,13 +4006,13 @@ Function 470: DrawModelPointsEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 471: DrawBoundingBox() (2 input parameters) +Function 472: 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 472: DrawBillboard() (5 input parameters) +Function 473: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4016,7 +4021,7 @@ Function 472: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 473: DrawBillboardRec() (6 input parameters) +Function 474: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -4026,7 +4031,7 @@ Function 473: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 474: DrawBillboardPro() (9 input parameters) +Function 475: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -4039,13 +4044,13 @@ Function 474: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 475: UploadMesh() (2 input parameters) +Function 476: 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 476: UpdateMeshBuffer() (5 input parameters) +Function 477: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4054,19 +4059,19 @@ Function 476: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 477: UnloadMesh() (1 input parameters) +Function 478: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 478: DrawMesh() (3 input parameters) +Function 479: 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 479: DrawMeshInstanced() (4 input parameters) +Function 480: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4074,35 +4079,35 @@ Function 479: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 480: GetMeshBoundingBox() (1 input parameters) +Function 481: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 481: GenMeshTangents() (1 input parameters) +Function 482: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 482: ExportMesh() (2 input parameters) +Function 483: 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 483: ExportMeshAsCode() (2 input parameters) +Function 484: 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 484: GenMeshPoly() (2 input parameters) +Function 485: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 485: GenMeshPlane() (4 input parameters) +Function 486: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4110,42 +4115,42 @@ Function 485: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 486: GenMeshCube() (3 input parameters) +Function 487: 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 487: GenMeshSphere() (3 input parameters) +Function 488: 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 488: GenMeshHemiSphere() (3 input parameters) +Function 489: 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 489: GenMeshCylinder() (3 input parameters) +Function 490: 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 490: GenMeshCone() (3 input parameters) +Function 491: 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 491: GenMeshTorus() (4 input parameters) +Function 492: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4153,7 +4158,7 @@ Function 491: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 492: GenMeshKnot() (4 input parameters) +Function 493: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4161,91 +4166,91 @@ Function 492: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 493: GenMeshHeightmap() (2 input parameters) +Function 494: 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 494: GenMeshCubicmap() (2 input parameters) +Function 495: 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 495: LoadMaterials() (2 input parameters) +Function 496: 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 496: LoadMaterialDefault() (0 input parameters) +Function 497: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 497: IsMaterialValid() (1 input parameters) +Function 498: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if a material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 498: UnloadMaterial() (1 input parameters) +Function 499: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 499: SetMaterialTexture() (3 input parameters) +Function 500: 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 500: SetModelMeshMaterial() (3 input parameters) +Function 501: 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 501: LoadModelAnimations() (2 input parameters) +Function 502: 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 502: UpdateModelAnimation() (3 input parameters) +Function 503: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (CPU) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 503: UpdateModelAnimationBones() (3 input parameters) +Function 504: UpdateModelAnimationBones() (3 input parameters) Name: UpdateModelAnimationBones Return type: void Description: Update model animation mesh bone matrices (GPU skinning) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 504: UnloadModelAnimation() (1 input parameters) +Function 505: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 505: UnloadModelAnimations() (2 input parameters) +Function 506: 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 506: IsModelAnimationValid() (2 input parameters) +Function 507: 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 507: CheckCollisionSpheres() (4 input parameters) +Function 508: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4253,40 +4258,40 @@ Function 507: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 508: CheckCollisionBoxes() (2 input parameters) +Function 509: 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 509: CheckCollisionBoxSphere() (3 input parameters) +Function 510: 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 510: GetRayCollisionSphere() (3 input parameters) +Function 511: 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 511: GetRayCollisionBox() (2 input parameters) +Function 512: 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 512: GetRayCollisionMesh() (3 input parameters) +Function 513: 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 513: GetRayCollisionTriangle() (4 input parameters) +Function 514: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4294,7 +4299,7 @@ Function 513: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 514: GetRayCollisionQuad() (5 input parameters) +Function 515: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4303,158 +4308,158 @@ Function 514: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 515: InitAudioDevice() (0 input parameters) +Function 516: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 516: CloseAudioDevice() (0 input parameters) +Function 517: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 517: IsAudioDeviceReady() (0 input parameters) +Function 518: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 518: SetMasterVolume() (1 input parameters) +Function 519: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 519: GetMasterVolume() (0 input parameters) +Function 520: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 520: LoadWave() (1 input parameters) +Function 521: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 521: LoadWaveFromMemory() (3 input parameters) +Function 522: 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 522: IsWaveValid() (1 input parameters) +Function 523: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Checks if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 523: LoadSound() (1 input parameters) +Function 524: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 524: LoadSoundFromWave() (1 input parameters) +Function 525: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 525: LoadSoundAlias() (1 input parameters) +Function 526: 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 526: IsSoundValid() (1 input parameters) +Function 527: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Checks if a sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 527: UpdateSound() (3 input parameters) +Function 528: 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 528: UnloadWave() (1 input parameters) +Function 529: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 529: UnloadSound() (1 input parameters) +Function 530: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 530: UnloadSoundAlias() (1 input parameters) +Function 531: 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 531: ExportWave() (2 input parameters) +Function 532: 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 532: ExportWaveAsCode() (2 input parameters) +Function 533: 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 533: PlaySound() (1 input parameters) +Function 534: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 534: StopSound() (1 input parameters) +Function 535: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 535: PauseSound() (1 input parameters) +Function 536: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 536: ResumeSound() (1 input parameters) +Function 537: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 537: IsSoundPlaying() (1 input parameters) +Function 538: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 538: SetSoundVolume() (2 input parameters) +Function 539: 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 539: SetSoundPitch() (2 input parameters) +Function 540: 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 540: SetSoundPan() (2 input parameters) +Function 541: 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 541: WaveCopy() (1 input parameters) +Function 542: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 542: WaveCrop() (3 input parameters) +Function 543: 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 543: WaveFormat() (4 input parameters) +Function 544: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4462,203 +4467,203 @@ Function 543: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 544: LoadWaveSamples() (1 input parameters) +Function 545: 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 545: UnloadWaveSamples() (1 input parameters) +Function 546: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 546: LoadMusicStream() (1 input parameters) +Function 547: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 547: LoadMusicStreamFromMemory() (3 input parameters) +Function 548: 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 548: IsMusicValid() (1 input parameters) +Function 549: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Checks if a music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 549: UnloadMusicStream() (1 input parameters) +Function 550: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 550: PlayMusicStream() (1 input parameters) +Function 551: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 551: IsMusicStreamPlaying() (1 input parameters) +Function 552: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 552: UpdateMusicStream() (1 input parameters) +Function 553: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 553: StopMusicStream() (1 input parameters) +Function 554: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 554: PauseMusicStream() (1 input parameters) +Function 555: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 555: ResumeMusicStream() (1 input parameters) +Function 556: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 556: SeekMusicStream() (2 input parameters) +Function 557: 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 557: SetMusicVolume() (2 input parameters) +Function 558: 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 558: SetMusicPitch() (2 input parameters) +Function 559: 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 559: SetMusicPan() (2 input parameters) +Function 560: 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 560: GetMusicTimeLength() (1 input parameters) +Function 561: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 561: GetMusicTimePlayed() (1 input parameters) +Function 562: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 562: LoadAudioStream() (3 input parameters) +Function 563: 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 563: IsAudioStreamValid() (1 input parameters) +Function 564: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Checks if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 564: UnloadAudioStream() (1 input parameters) +Function 565: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 565: UpdateAudioStream() (3 input parameters) +Function 566: 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 566: IsAudioStreamProcessed() (1 input parameters) +Function 567: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 567: PlayAudioStream() (1 input parameters) +Function 568: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 568: PauseAudioStream() (1 input parameters) +Function 569: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 569: ResumeAudioStream() (1 input parameters) +Function 570: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 570: IsAudioStreamPlaying() (1 input parameters) +Function 571: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 571: StopAudioStream() (1 input parameters) +Function 572: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 572: SetAudioStreamVolume() (2 input parameters) +Function 573: 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 573: SetAudioStreamPitch() (2 input parameters) +Function 574: 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 574: SetAudioStreamPan() (2 input parameters) +Function 575: 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 575: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 576: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 576: SetAudioStreamCallback() (2 input parameters) +Function 577: 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 577: AttachAudioStreamProcessor() (2 input parameters) +Function 578: 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 578: DetachAudioStreamProcessor() (2 input parameters) +Function 579: 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 579: AttachAudioMixedProcessor() (1 input parameters) +Function 580: 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 580: DetachAudioMixedProcessor() (1 input parameters) +Function 581: 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 20cb502d8..b91874cc0 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -674,7 +674,7 @@ - + @@ -795,6 +795,8 @@ + + From ce3b121f07ae9b0aae87e3adc9a30d4a4a816924 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sun, 10 Nov 2024 13:47:15 +0100 Subject: [PATCH 094/155] build.zig: Remove addRaylib and fix raygui builds when using raylib as dep (#4475) - addRaylib just duplicates what adding raylib as dependency already does so it do not needs to exist - move raygui build to standard build process when flag is enabled. this works correctly when using raylib as dependency and having raygui as dependency as well. problem with previous approach was that raygui was in options but it was doing nothing because you had to also use addRaygui for it to be effective Signed-off-by: Tomas Slusny --- build.zig | 85 ++++++++++++++++--------------------------------------- 1 file changed, 25 insertions(+), 60 deletions(-) diff --git a/build.zig b/build.zig index c5e2f718b..9c2757364 100644 --- a/build.zig +++ b/build.zig @@ -11,36 +11,6 @@ comptime { @compileError("Raylib requires zig version " ++ min_ver); } -// NOTE(freakmangd): I don't like using a global here, but it prevents having to -// get the flags a second time when adding raygui -var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{}; - -// This has been tested with zig version 0.13.0 -pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { - const raylib_dep = b.dependencyFromBuildZig(@This(), .{ - .target = target, - .optimize = optimize, - .raudio = options.raudio, - .rmodels = options.rmodels, - .rshapes = options.rshapes, - .rtext = options.rtext, - .rtextures = options.rtextures, - .platform = options.platform, - .shared = options.shared, - .linux_display_backend = options.linux_display_backend, - .opengl_version = options.opengl_version, - .config = options.config, - }); - const raylib = raylib_dep.artifact("raylib"); - - if (options.raygui) { - const raygui_dep = b.dependency(options.raygui_dependency_name, .{}); - addRaygui(b, raylib, raygui_dep); - } - - return raylib; -} - fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void { raylib.defineCMacro("PLATFORM_DESKTOP", null); @@ -107,21 +77,26 @@ const config_h_flags = outer: { }; fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { - raylib_flags_arr.clearRetainingCapacity(); + var raylib_flags_arr = std.ArrayList([]const u8).init(b.allocator); + defer raylib_flags_arr.deinit(); - const shared_flags = &[_][]const u8{ - "-fPIC", - "-DBUILD_LIBTYPE_SHARED", - }; - try raylib_flags_arr.appendSlice(b.allocator, &[_][]const u8{ + try raylib_flags_arr.appendSlice(&[_][]const u8{ "-std=gnu99", "-D_GNU_SOURCE", "-DGL_SILENCE_DEPRECATION=199309L", "-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/3674 }); + + if (options.shared) { + try raylib_flags_arr.appendSlice(&[_][]const u8{ + "-fPIC", + "-DBUILD_LIBTYPE_SHARED", + }); + } + if (options.config.len > 0) { // Sets a flag indiciating the use of a custom `config.h` - try raylib_flags_arr.append(b.allocator, "-DEXTERNAL_CONFIG_FLAGS"); + try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS"); // Splits a space-separated list of config flags into multiple flags // @@ -131,7 +106,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. // Apply config flags supplied by the user while (config_iter.next()) |config_flag| - try raylib_flags_arr.append(b.allocator, config_flag); + try raylib_flags_arr.append(config_flag); // Apply all relevant configs from `src/config.h` *except* the user-specified ones // @@ -149,14 +124,10 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } // Otherwise, append default value from config.h to compile flags - try raylib_flags_arr.append(b.allocator, flag); + try raylib_flags_arr.append(flag); } } - if (options.shared) { - try raylib_flags_arr.appendSlice(b.allocator, shared_flags); - } - const raylib = if (options.shared) b.addSharedLibrary(.{ .name = "raylib", @@ -288,7 +259,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } // On macos rglfw.c include Objective-C files. - try raylib_flags_arr.append(b.allocator, "-ObjC"); + try raylib_flags_arr.append("-ObjC"); raylib.root_module.addCSourceFile(.{ .file = b.path("src/rglfw.c"), .flags = raylib_flags_arr.items, @@ -327,25 +298,19 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .flags = raylib_flags_arr.items, }); - return raylib; -} + if (options.raygui) { + const raygui_dep = b.dependency(options.raygui_dependency_name, .{}); -/// This function does not need to be called if you passed .raygui = true to addRaylib -pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void { - if (raylib_flags_arr.items.len == 0) { - @panic( - \\argument 2 `raylib` in `addRaygui` must come from b.dependency("raylib", ...).artifact("raylib") - ); + var gen_step = b.addWriteFiles(); + raylib.step.dependOn(&gen_step.step); + + const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); + raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags_arr.items }); + raylib.addIncludePath(raygui_dep.path("src")); + raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); } - var gen_step = b.addWriteFiles(); - raylib.step.dependOn(&gen_step.step); - - const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); - raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags_arr.items }); - raylib.addIncludePath(raygui_dep.path("src")); - - raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); + return raylib; } pub const Options = struct { From 85de743d1c2da8ea14a5962c9feadac32eb91151 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 10 Nov 2024 17:53:50 +0100 Subject: [PATCH 095/155] Improved logos size --- logo/raylib.ico | Bin 9752 -> 6177 bytes logo/raylib_1024x1024.png | Bin 4536 -> 4591 bytes logo/raylib_144x144.png | Bin 422 -> 475 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/logo/raylib.ico b/logo/raylib.ico index 0cedcc55cee7da0e5784256078a93f2901e5d734..8dd7bb7add704d75af0588f095ab2a5486eb8a87 100644 GIT binary patch literal 6177 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 literal 9752 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 AR{#J2 diff --git a/logo/raylib_1024x1024.png b/logo/raylib_1024x1024.png index b855a6bf64bc19ab0b04c2ce9d22e601bf17c5d6..3930aeb79e595f2571e1035391bc4c1e32bf059c 100644 GIT binary patch delta 72 zcmdm?{9bv(dO-*664!_lm(=3qqRfJl%=|otqQuIa%p`^Uw6x6R%)}gpoc#2BD+NOX YBa;dc5nGgXg#idWUHx3vIVCg!0Mic`;s5{u delta 17 YcmaE_yhC}zdO=PGPgg&ebxsLQ06iWCSpWb4 diff --git a/logo/raylib_144x144.png b/logo/raylib_144x144.png index 7c533d2de571bbe5ac2633049ffb543fc54e5b71..f89d90b23ce52f7c11155258738a45d48bb47ee5 100644 GIT binary patch delta 62 zcmZ3+e4BZKvN3~ZiEBiOOKNd)QD#9&W_}(+QDS9IW|BgFT3TjuW@3&)PJVj6m4cy( QNd*w|EoRT$sMyK~0H)Ry&Hw-a delta 10 Rcmcc3yo`B*^2Uf}MgSJt1IPdX From 2af4f317122d73dd459e0c9c3aed14192c08c186 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sun, 10 Nov 2024 13:04:58 -0800 Subject: [PATCH 096/155] Fix the X axis of the second vertex of the Y negative cap of a cylinders, triangle fan (#4478) --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 6ddb53ae4..04f7210f2 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -603,7 +603,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < sides; i++) { rlVertex3f(0, 0, 0); - rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); } From fb69b39d548ffa3c4e89daea2dc08c09f2c3da8d Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 11 Nov 2024 10:46:54 -0800 Subject: [PATCH 097/155] Fix a typecast warning in glfw clipboard access (#4479) --- src/platforms/rcore_desktop_glfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index e765debc1..061fe72ca 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -988,7 +988,7 @@ Image GetClipboardImage(void) } else { - image = LoadImageFromMemory(".bmp", fileData, dataSize); + image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); } return image; } From 5cc06f4ba4086c868b94034c5a3b48789d9508c0 Mon Sep 17 00:00:00 2001 From: "Everton Jr." <69195288+evertonse@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:47:25 -0300 Subject: [PATCH 098/155] [rcore]: Issue an warning instead of an error when checking SUPPORT_CLIPBOARD_IMAGE necessary support detection (#4477) --- src/rcore.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 2d1808c14..ba23df776 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -512,10 +512,27 @@ const char *TextFormat(const char *text, ...); // Formatting of tex #define PLATFORM_DESKTOP_GLFW #endif +// We're using `#pragma message` because `#warning` is not adopted by MSVC. #if defined(SUPPORT_CLIPBOARD_IMAGE) - #if !defined(SUPPORT_FILEFORMAT_BMP) || !defined(STBI_REQUIRED) || !defined(SUPPORT_MODULE_RTEXTURES) - #error "To enabled SUPPORT_CLIPBOARD_IMAGE, it also needs SUPPORT_FILEFORMAT_BMP, SUPPORT_MODULE_RTEXTURES and STBI_REQUIRED to be defined. It should have been defined earlier" + #if !defined(SUPPORT_MODULE_RTEXTURES) + #pragma message ("Warning: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly") #endif + + // It's nice to have support Bitmap on Linux as well, but not as necessary as Windows + #if !defined(SUPPORT_FILEFORMAT_BMP) && defined(_WIN32) + #pragma message ("Warning: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows") + #endif + + // From what I've tested applications on Wayland saves images on clipboard as PNG. + #if (!defined(SUPPORT_FILEFORMAT_PNG) || !defined(SUPPORT_FILEFORMAT_JPG)) && !defined(_WIN32) + #pragma message ("Warning: Getting image from the clipboard might not work without SUPPORT_FILEFORMAT_PNG or SUPPORT_FILEFORMAT_JPG") + #endif + + // Not needed because `rtexture.c` will automatically defined STBI_REQUIRED when any SUPPORT_FILEFORMAT_* is defined. + // #if !defined(STBI_REQUIRED) + // #pragma message ("Warning: "STBI_REQUIRED is not defined, that means we can't load images from clipbard" + // #endif + #endif // SUPPORT_CLIPBOARD_IMAGE // Include platform-specific submodules From 10fd4de25876657f5b52d30ecbbe2ee98a88dd40 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 11 Nov 2024 10:55:33 -0800 Subject: [PATCH 099/155] Fix the example lighting shaders to use both frag and diffuse colors so they work with shapes and meshes. (#4482) --- examples/shaders/resources/shaders/glsl100/lighting.fs | 4 +++- examples/shaders/resources/shaders/glsl120/lighting.fs | 4 +++- examples/shaders/resources/shaders/glsl330/lighting.fs | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/lighting.fs b/examples/shaders/resources/shaders/glsl100/lighting.fs index 73531a8bb..f9b0bd3c1 100644 --- a/examples/shaders/resources/shaders/glsl100/lighting.fs +++ b/examples/shaders/resources/shaders/glsl100/lighting.fs @@ -40,6 +40,8 @@ void main() vec3 viewD = normalize(viewPos - fragPosition); vec3 specular = vec3(0.0); + vec4 tint = colDiffuse * fragColor; + // NOTE: Implement here your fragment shader code for (int i = 0; i < MAX_LIGHTS; i++) @@ -67,7 +69,7 @@ void main() } } - vec4 finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); finalColor += texelColor*(ambient/10.0); // Gamma correction diff --git a/examples/shaders/resources/shaders/glsl120/lighting.fs b/examples/shaders/resources/shaders/glsl120/lighting.fs index 8dda5a549..600c0f84d 100644 --- a/examples/shaders/resources/shaders/glsl120/lighting.fs +++ b/examples/shaders/resources/shaders/glsl120/lighting.fs @@ -38,6 +38,8 @@ void main() vec3 viewD = normalize(viewPos - fragPosition); vec3 specular = vec3(0.0); + vec4 tint = colDiffuse * fragColor; + // NOTE: Implement here your fragment shader code for (int i = 0; i < MAX_LIGHTS; i++) @@ -65,7 +67,7 @@ void main() } } - vec4 finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); finalColor += texelColor*(ambient/10.0); // Gamma correction diff --git a/examples/shaders/resources/shaders/glsl330/lighting.fs b/examples/shaders/resources/shaders/glsl330/lighting.fs index d1f3140a1..d2a8e8743 100644 --- a/examples/shaders/resources/shaders/glsl330/lighting.fs +++ b/examples/shaders/resources/shaders/glsl330/lighting.fs @@ -3,7 +3,7 @@ // Input vertex attributes (from vertex shader) in vec3 fragPosition; in vec2 fragTexCoord; -//in vec4 fragColor; +in vec4 fragColor; in vec3 fragNormal; // Input uniform values @@ -41,6 +41,8 @@ void main() vec3 viewD = normalize(viewPos - fragPosition); vec3 specular = vec3(0.0); + vec4 tint = colDiffuse * fragColor; + // NOTE: Implement here your fragment shader code for (int i = 0; i < MAX_LIGHTS; i++) @@ -68,8 +70,8 @@ void main() } } - finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0))); - finalColor += texelColor*(ambient/10.0)*colDiffuse; + finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + finalColor += texelColor*(ambient/10.0)*tint; // Gamma correction finalColor = pow(finalColor, vec4(1.0/2.2)); From 4ddf4679b49b253846e87f8500fe28ed417986f0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 11 Nov 2024 20:28:25 +0100 Subject: [PATCH 100/155] Update CHANGELOG --- CHANGELOG | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e0403dd63..34770bae4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,17 +7,18 @@ Current Release: raylib 5.0 (18 November 2023) Release: raylib 5.5 (November 2024?) ------------------------------------------------------------------------- KEY CHANGES: - - New rcore backend: RGFW - - New raylib project creator tool + - New rcore backends: RGFW and SDL3 - New platforms supported: Dreamcast, N64, PSP, PSVita, PS4 - - GPU Skinning (all platforms and GL versions) - - raymath C++ operators + - Added GPU Skinning support (all platforms and GL versions) + - Added raymath C++ operators + - New tool: raylib project creator Detailed changes: WIP: Last update with commit from 02-Nov-2024 [rcore] ADDED: Working directory info at initialization by @Ray +[rcore] ADDED: `GetClipboardImage()`, supported by multiple backends (#4459) by @evertonse [rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray [rcore] ADDED: `ComputeSHA1()` (#4390) by @Anthony Carbajal [rcore] ADDED: `ComputeCRC32()` and `ComputeMD5()` by @Ray @@ -203,6 +204,7 @@ WIP: Last update with commit from 02-Nov-2024 [rtextures] REVIEWED: `ImageDrawRectangleRec()` (#3721) by @Le Juez Victor [rtextures] REVIEWED: `ImageDraw()`, don't try to blend images without alpha (#4395) by @Nikolas [rtextures] REVIEWED: `GenImagePerlinNoise()` being stretched (#4276) by @Bugsia +[rtextures] REVIEWED: `GenImageGradientLinear()`, fix some angles (#4462) by @decromo [rtextures] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 by @Ray [rtextures] REVIEWED: `ColorToInt()`, fix undefined behaviour (#3996) by @OetkenPurveyorOfCode [rtextures] REVIEWED: Remove panorama cubemap layout option (#4425) by @Jeffery Myers @@ -258,7 +260,9 @@ WIP: Last update with commit from 02-Nov-2024 [rmodels] REVIEWED: `GenMeshSphere()`, fix artifacts (#4460) by @MikiZX1 [rmodels] REVIEWED: `GenMeshTangents()`, read uninitialized values, fix bounding case (#4066) by @kai-z99 [rmodels] REVIEWED: `GenMeshTangents()`, fixed out of bounds error (#3990) by @Salvador Galindo +[rmodels] REVIEWED: `UpdateModelAnimation()`, performance speedup (#4470) by @JettMonstersGoBoom [rmodels] REVIEWED: `DrawCylinder()`, fix drawing due to imprecise angle (#4034) by @Paul Melis +[rmodels] REVIEWED: `DrawCylinder()`, fix drawing of cap (#4478) by @JeffM2501 [rmodels] REVIEWED: `DrawMesh()`, send full matModel to shader in DrawMesh (#4005) (#4022) by @David Holland [rmodels] REVIEWED: `DrawMesh()`, fix material specular map retrieval (#3758) by @Victor Gallet [rmodels] REVIEWED: `DrawModelEx()`, simplified multiplication of colors (#4002) by @Le Juez Victor @@ -364,6 +368,7 @@ WIP: Last update with commit from 02-Nov-2024 [build] REVIEWED: build.zig, remove all uses of deps/mingw (#3805) by @Peter0x44 [build] REVIEWED: build.zig, fixed illegal instruction crash (#3682) by @WisonYe [build] REVIEWED: build.zig, fix broken build on #3863 (#3891) by @Nikolas Mauropoulos +[build] REVIEWED: build.zig, improve cross-compilation (#4468) by @deathbeam [build] REVIEWED: CMake, update to raylib 5.0 (#3623) by @Peter0x44 [build] REVIEWED: CMake, added PLATFORM option for Desktop SDL (#3809) by @mooff [build] REVIEWED: CMake, fix GRAPHICS_* check (#4359) by @Kacper Zybała From 7053970f7b4d311f41c604b10ff1b312fead0dc3 Mon Sep 17 00:00:00 2001 From: kimierik <105240664+kimierik@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:52:12 +0200 Subject: [PATCH 101/155] build.zig: remove raygui from options and re add adding raygui as a (#4485) function --- build.zig | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/build.zig b/build.zig index 9c2757364..5c2ac77cd 100644 --- a/build.zig +++ b/build.zig @@ -298,28 +298,26 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .flags = raylib_flags_arr.items, }); - if (options.raygui) { - const raygui_dep = b.dependency(options.raygui_dependency_name, .{}); - - var gen_step = b.addWriteFiles(); - raylib.step.dependOn(&gen_step.step); - - const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); - raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags_arr.items }); - raylib.addIncludePath(raygui_dep.path("src")); - raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); - } - return raylib; } +pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void { + var gen_step = b.addWriteFiles(); + raylib.step.dependOn(&gen_step.step); + + const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); + raylib.addCSourceFile(.{ .file = raygui_c_path }); + raylib.addIncludePath(raygui_dep.path("src")); + + raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); +} + pub const Options = struct { raudio: bool = true, rmodels: bool = true, rshapes: bool = true, rtext: bool = true, rtextures: bool = true, - raygui: bool = false, platform: PlatformBackend = .glfw, shared: bool = false, linux_display_backend: LinuxDisplayBackend = .Both, @@ -327,15 +325,12 @@ pub const Options = struct { /// config should be a list of space-separated cflags, eg, "-DSUPPORT_CUSTOM_FRAME_CONTROL" config: []const u8 = &.{}, - raygui_dependency_name: []const u8 = "raygui", - const defaults = Options{}; fn getOptions(b: *std.Build) Options { return .{ .platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform, .raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio, - .raygui = b.option(bool, "raygui", "Compile with raygui support") orelse defaults.raygui, .rmodels = b.option(bool, "rmodels", "Compile with models support") orelse defaults.rmodels, .rtext = b.option(bool, "rtext", "Compile with text support") orelse defaults.rtext, .rtextures = b.option(bool, "rtextures", "Compile with textures support") orelse defaults.rtextures, From 377248b1ac3c0d1a56e1e2abea5495aa4c12ec1a Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 13 Nov 2024 18:21:10 -0300 Subject: [PATCH 102/155] Fix Makefile.Web (#4487) --- examples/Makefile.Web | 56 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 7ea7f4784..13125f22d 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -280,7 +280,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map LDFLAGS += -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall - + # Build using asyncify ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) LDFLAGS += -sASYNCIFY @@ -383,6 +383,7 @@ CORE = \ core/core_automation_events \ core/core_basic_screen_manager \ core/core_basic_window \ + core/core_basic_window_web \ core/core_custom_frame_control \ core/core_custom_logging \ core/core_drop_files \ @@ -587,6 +588,9 @@ core/core_automation_events : core/core_automation_events.c core/core_basic_window: core/core_basic_window.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +core/core_basic_window_web: core/core_basic_window_web.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + core/core_basic_screen_manager: core/core_basic_screen_manager.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -625,6 +629,9 @@ core/core_input_mouse_wheel: core/core_input_mouse_wheel.c core/core_input_multitouch: core/core_input_multitouch.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +core/core_input_virtual_controls: core/core_input_virtual_controls.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + # NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1) # WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021) # WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any) @@ -747,6 +754,10 @@ textures/textures_gif_player: textures/textures_gif_player.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file textures/resources/scarfy_run.gif@resources/scarfy_run.gif +textures/textures_image_channel: textures/textures_image_channel.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file textures/resources/fudesumi.png@resources/fudesumi.png + textures/textures_image_drawing: textures/textures_image_drawing.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file textures/resources/custom_jupiter_crash.png@resources/custom_jupiter_crash.png \ @@ -907,6 +918,13 @@ models/models_billboard: models/models_billboard.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file models/resources/billboard.png@resources/billboard.png +models/models_bone_socket: models/models_bone_socket.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file models/resources/models/gltf/greenman.glb@resources/models/gltf/greenman.glb \ + --preload-file models/resources/models/gltf/greenman_hat.glb@resources/models/gltf/greenman_hat.glb \ + --preload-file models/resources/models/gltf/greenman_sword.glb@resources/models/gltf/greenman_sword.glb \ + --preload-file models/resources/models/gltf/greenman_shield.glb@resources/models/gltf/greenman_shield.glb + models/models_box_collisions: models/models_box_collisions.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -961,6 +979,9 @@ models/models_mesh_picking: models/models_mesh_picking.c models/models_orthographic_projection: models/models_orthographic_projection.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +models/models_point_rendering: models/models_point_rendering.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + models/models_rlgl_solar_system: models/models_rlgl_solar_system.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -988,6 +1009,24 @@ shaders/shaders_basic_lighting: shaders/shaders_basic_lighting.c --preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs \ --preload-file shaders/resources/shaders/glsl100/lighting.vs@resources/shaders/glsl100/lighting.vs +shaders/shaders_basic_pbr: shaders/shaders_basic_pbr.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file shaders/resources/shaders/glsl100/pbr.vs@resources/shaders/glsl100/pbr.vs \ + --preload-file shaders/resources/shaders/glsl120/pbr.vs@resources/shaders/glsl120/pbr.vs \ + --preload-file shaders/resources/shaders/glsl330/pbr.vs@resources/shaders/glsl330/pbr.vs \ + --preload-file shaders/resources/shaders/glsl100/pbr.fs@resources/shaders/glsl100/pbr.fs \ + --preload-file shaders/resources/shaders/glsl120/pbr.fs@resources/shaders/glsl120/pbr.fs \ + --preload-file shaders/resources/shaders/glsl330/pbr.fs@resources/shaders/glsl330/pbr.fs \ + --preload-file shaders/resources/models/old_car_new.glb@resources/models/old_car_new.glb \ + --preload-file shaders/resources/old_car_d.png@resources/old_car_d.png \ + --preload-file shaders/resources/old_car_mra.png@resources/old_car_mra.png \ + --preload-file shaders/resources/old_car_n.png@resources/old_car_n.png \ + --preload-file shaders/resources/old_car_e.png@resources/old_car_e.png \ + --preload-file shaders/resources/models/plane.glb@resources/models/plane.glb \ + --preload-file shaders/resources/road_a.png@resources/road_a.png \ + --preload-file shaders/resources/road_mra.png@resources/road_mra.png \ + --preload-file shaders/resources/road_n.png@resources/road_n.png + shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file shaders/resources/models/barracks.obj@resources/models/barracks.obj \ @@ -1061,6 +1100,14 @@ shaders/shaders_raymarching: shaders/shaders_raymarching.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/shaders/glsl100/raymarching.fs@resources/shaders/glsl100/raymarching.fs +shaders/shaders_shadowmap: shaders/shaders_shadowmap.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file shaders/resources/shaders/glsl120/shadowmap.vs@resources/shaders/glsl120/shadowmap.vs \ + --preload-file shaders/resources/shaders/glsl330/shadowmap.vs@resources/shaders/glsl330/shadowmap.vs \ + --preload-file shaders/resources/shaders/glsl120/shadowmap.fs@resources/shaders/glsl120/shadowmap.fs \ + --preload-file shaders/resources/shaders/glsl330/shadowmap.fs@resources/shaders/glsl330/shadowmap.fs \ + --preload-file shaders/resources/models/robot.glb@resources/models/robot.glb + shaders/shaders_shapes_textures: shaders/shaders_shapes_textures.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/fudesumi.png@resources/fudesumi.png \ @@ -1101,6 +1148,13 @@ shaders/shaders_write_depth: shaders/shaders_write_depth.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/shaders/glsl100/write_depth.fs@resources/shaders/glsl100/write_depth.fs +shaders/shaders_vertex_displacement: shaders/shaders_vertex_displacement.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file shaders/resources/shaders/glsl100/vertex_displacement.vs@resources/shaders/glsl100/vertex_displacement.vs \ + --preload-file shaders/resources/shaders/glsl330/vertex_displacement.vs@resources/shaders/glsl330/vertex_displacement.vs \ + --preload-file shaders/resources/shaders/glsl100/vertex_displacement.fs@resources/shaders/glsl100/vertex_displacement.fs \ + --preload-file shaders/resources/shaders/glsl330/vertex_displacement.fs@resources/shaders/glsl330/vertex_displacement.fs + # Compile AUDIO examples audio/audio_mixed_processor: audio/audio_mixed_processor.c From f76a5e2b10cdee694a0474f35dc629d3e9fd751c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 10:45:19 +0100 Subject: [PATCH 103/155] Update CHANGELOG --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 34770bae4..9cafc61c0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -117,7 +117,7 @@ WIP: Last update with commit from 02-Nov-2024 [rcore][RGFW] REVIEWED: Replace long switch with a lookup table (#4108) by @Colleague Riley [rcore][RGFW] REVIEWED: Fix MSVC build errors (#4441) by @Colleague Riley [rlgl] ADDED: More uniform data type options #4137 by @Ray -[rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang +[rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang -WARNING- [rlgl] ADDED: `rlCullDistance*()` variables and getters (#3912) by @KotzaBoss [rlgl] ADDED: `rlSetClipPlanes()` function (#3912) by @KotzaBoss [rlgl] ADDED: `isGpuReady` flag, allow font loading with no GPU acceleration by @Ray -WARNING- @@ -150,7 +150,7 @@ WIP: Last update with commit from 02-Nov-2024 [rcamera] REVIEWED: Cleaned away unused macros(#3762) by @Brian E [rcamera] REVIEWED: Fix for free camera mode (#3603) by @lesleyrs [rcamera] REVIEWED: `GetCameraRight()` (#3784) by @Danil -[raymath] ADDED: C++ operator overloads for common math function (#4385) by @Jeffery Myers +[raymath] ADDED: C++ operator overloads for common math function (#4385) by @Jeffery Myers -WARNING- [raymath] ADDED: Vector4 math functions and Vector2 variants of some Vector3 functions (#3828) by @Bowserinator [raymath] REVIEWED: Fix MSVC warnings/errors in C++ (#4125) by @Jeffery Myers [raymath] REVIEWED: Add extern "C" to raymath header for C++ (#3978) by @Jeffery Myers From 0c7edbc2ee220d6b23892e22295237170b684742 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 10:45:56 +0100 Subject: [PATCH 104/155] Update HISTORY.md --- HISTORY.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 6b1a5be29..f7dc14be1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -475,16 +475,34 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature notes on raylib 5.5 ------------------- -It's been **1 year** since latest raylib release and **11 years** since raylib 1.0 was officially released... +One year after raylib 5.0 release, arribes raylib 5.5, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. Some numbers for this release: - **+270** closed issues (for a TOTAL of **+1810**!) - - **+760** commits since previous RELEASE (for a TOTAL of **+7730**!) + - **+800** commits since previous RELEASE (for a TOTAL of **+7750**!) - **+30** functions ADDED to raylib API (for a TOTAL of **580**!) - **+110** functions REVIEWED with fixes and improvements - **+140** new contributors (for a TOTAL of **+640**!) Highlights for `raylib 5.5`: -TODO. + - **`NEW` raylib project creator tool**: A brand new support tool developed to help raylib users to setup new projects in a professional way. This tools generates a complete project structure with multiple build systems and ready for GitHub with CI/CD actions pre-configured. And only providing some project C files and basic properties! + + - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, adding new platforms backends has been greatly simplified, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: `RGFW`. `RGFW` is a **new** single-file header-only (`RGFW.h`) portable library intended for platform-functionality management (windowing and inputs); in this case for desktop platforms (Windows, Linux, macOS) and also for Web platform. It adds to the already existing platform backends supporting those same platforms: `GLFW` and `SDL`. + + - **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added experimental support for `SDL2` library, in this new `raylib` release some issues with SDL2 has been reviewed and it has been added support for the latest `SDL3` implementation. Now users can select at compile time the desired SDL version to use, increasing the number of potential platforms supported in the future! + + - **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, supporting new platform backends is easier than ever! Along the `OpenGL 1.1` graphics option supported by raylib, it opened the door to multiple retro-consoles backend implementations! It's amazing to see raylib running on +20 year old consoles like Dreamcast or PSP, considering the hardware constraints of those platforms and proves raylib versability! Those additional platforms can be found in separate repositories (links) and have been created by Antonio Jose Ramos Marquez (@psxdev). + + - **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to Daniel Holden (@orangeduck) contribution. Adding GPU skinning was a tricky feature, considering it had to be available for all raylib supported platforms, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found and this new advance feature was added. An [usage example] was also added and also in the process, current models animation system was greatly improved in performance, simplifiying the required math. + + - **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, this operators simplify C++ code, when doing math operations. + +Beside those new big features, `raylib 5.5` comes with MANY other improvements: **Normals support on batching system**, **clipboard images reading support**, **CRC32/MD5/SHA1 hash computation**, **gamepad vibration support**, **improved font loading (no GPU required) with BDF fonts support**, **time-based camera movement**, **improved GLTF animations loading** and much much more, including many functions reviews and new functions added! + +Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! + +**After 11 years of development, `raylib 5.5` is the best raylib ever.** + +**Enjoy programming with raylib!** :) From 8af7985ece2b8c99d9280bbf77a438fce61751d1 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 10:46:34 +0100 Subject: [PATCH 105/155] Update CHANGELOG --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9cafc61c0..1f3f333a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,10 @@ changelog --------- -Current Release: raylib 5.0 (18 November 2023) +Current Release: raylib 5.5 (18 November 2024) ------------------------------------------------------------------------- -Release: raylib 5.5 (November 2024?) +Release: raylib 5.5 (18 November 2024) ------------------------------------------------------------------------- KEY CHANGES: - New rcore backends: RGFW and SDL3 From 700e2c5e5db90702d7787c3cc231fc41f97d8de6 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Thu, 14 Nov 2024 06:49:35 -0300 Subject: [PATCH 106/155] Fix touch count reset (#4488) --- src/platforms/rcore_web.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index e15d3f5bf..f9d93e5a3 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -1778,11 +1778,14 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); - - // Reset the pointCount for web, if it was the last Touch End event - if (eventType == EMSCRIPTEN_EVENT_TOUCHEND && CORE.Input.Touch.pointCount == 1) CORE.Input.Touch.pointCount = 0; #endif + if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) + { + CORE.Input.Touch.pointCount--; + if (CORE.Input.Touch.pointCount < 0) CORE.Input.Touch.pointCount = 0; + } + return 1; // The event was consumed by the callback handler } From 14d3bbbb8629cc6d1a837b7b22ffbdff1b5f9e1d Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:38:27 +0100 Subject: [PATCH 107/155] Update raygui.h --- examples/shapes/raygui.h | 76 +++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/examples/shapes/raygui.h b/examples/shapes/raygui.h index 16e01a28f..85c477870 100644 --- a/examples/shapes/raygui.h +++ b/examples/shapes/raygui.h @@ -998,7 +998,7 @@ typedef enum { ICON_LAYERS2 = 225, ICON_MLAYERS = 226, ICON_MAPS = 227, - ICON_228 = 228, + ICON_HOT = 228, ICON_229 = 229, ICON_230 = 230, ICON_231 = 231, @@ -1045,6 +1045,7 @@ typedef enum { #if defined(RAYGUI_IMPLEMENTATION) +#include // required for: isspace() [GuiTextBox()] #include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] #include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] #include // Required for: strlen() [GuiTextBox(), GuiValueBox()], memset(), memcpy() @@ -1316,7 +1317,7 @@ static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS] = 0x07fe0000, 0x1c020402, 0x74021402, 0x54025402, 0x54025402, 0x500857fe, 0x40205ff8, 0x00007fe0, // ICON_LAYERS2 0x0ffe0000, 0x3ffa0802, 0x7fea200a, 0x402a402a, 0x422a422a, 0x422e422a, 0x40384e28, 0x00007fe0, // ICON_MLAYERS 0x0ffe0000, 0x3ffa0802, 0x7fea200a, 0x402a402a, 0x5b2a512a, 0x512e552a, 0x40385128, 0x00007fe0, // ICON_MAPS - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_228 + 0x04200000, 0x1cf00c60, 0x11f019f0, 0x0f3807b8, 0x1e3c0f3c, 0x1c1c1e1c, 0x1e3c1c1c, 0x00000f70, // ICON_HOT 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_229 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_230 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_231 @@ -1639,9 +1640,9 @@ int GuiGroupBox(Rectangle bounds, const char *text) // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR))); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR))); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR))); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR))); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR))); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR))); GuiLine(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, bounds.width, (float)GuiGetStyle(DEFAULT, TEXT_SIZE) }, text); //-------------------------------------------------------------------- @@ -1662,7 +1663,7 @@ int GuiLine(Rectangle bounds, const char *text) int result = 0; GuiState state = guiState; - Color color = GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)); + Color color = GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR)); // Draw control //-------------------------------------------------------------------- @@ -1710,7 +1711,7 @@ int GuiPanel(Rectangle bounds, const char *text) //-------------------------------------------------------------------- if (text != NULL) GuiStatusBar(statusBar, text); // Draw panel header as status bar - GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED: LINE_COLOR)), + GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED: (int)LINE_COLOR)), GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BASE_COLOR_DISABLED : BACKGROUND_COLOR))); //-------------------------------------------------------------------- @@ -2603,24 +2604,59 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) } } - // Delete codepoint from text, before current cursor position - if ((textLength > 0) && (IsKeyPressed(KEY_BACKSPACE) || (IsKeyDown(KEY_BACKSPACE) && (autoCursorCooldownCounter >= RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN)))) + // Delete related codepoints from text, before current cursor position + if ((textLength > 0) && IsKeyPressed(KEY_BACKSPACE) && (IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_CONTROL))) + { + int i = textBoxCursorIndex - 1; + int accCodepointSize = 0; + + // Move cursor to the end of word if on space already + while ((i > 0) && isspace(text[i])) + { + int prevCodepointSize = 0; + GetCodepointPrevious(text + i, &prevCodepointSize); + i -= prevCodepointSize; + accCodepointSize += prevCodepointSize; + } + + // Move cursor to the start of the word + while ((i > 0) && !isspace(text[i])) + { + int prevCodepointSize = 0; + GetCodepointPrevious(text + i, &prevCodepointSize); + i -= prevCodepointSize; + accCodepointSize += prevCodepointSize; + } + + // Move forward text from cursor position + for (int j = (textBoxCursorIndex - accCodepointSize); j < textLength; j++) text[j] = text[j + accCodepointSize]; + + // Prevent cursor index from decrementing past 0 + if (textBoxCursorIndex > 0) + { + textBoxCursorIndex -= accCodepointSize; + textLength -= accCodepointSize; + } + + // Make sure text last character is EOL + text[textLength] = '\0'; + } + else if ((textLength > 0) && (IsKeyPressed(KEY_BACKSPACE) || (IsKeyDown(KEY_BACKSPACE) && (autoCursorCooldownCounter >= RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN)))) { autoCursorDelayCounter++; if (IsKeyPressed(KEY_BACKSPACE) || (autoCursorDelayCounter%RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY) == 0) // Delay every movement some frames { int prevCodepointSize = 0; - GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); - - // Move backward text from cursor position - for (int i = (textBoxCursorIndex - prevCodepointSize); i < textLength; i++) text[i] = text[i + prevCodepointSize]; - - // TODO Check: >= cursor+codepointsize and <= length-codepointsize // Prevent cursor index from decrementing past 0 if (textBoxCursorIndex > 0) { + GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); + + // Move backward text from cursor position + for (int i = (textBoxCursorIndex - prevCodepointSize); i < textLength; i++) text[i] = text[i + prevCodepointSize]; + textBoxCursorIndex -= codepointSize; textLength -= codepointSize; } @@ -2638,7 +2674,7 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) if (IsKeyPressed(KEY_LEFT) || (autoCursorDelayCounter%RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY) == 0) // Delay every movement some frames { int prevCodepointSize = 0; - GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); + if (textBoxCursorIndex > 0) GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); if (textBoxCursorIndex >= prevCodepointSize) textBoxCursorIndex -= prevCodepointSize; } @@ -3426,7 +3462,7 @@ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *scrollInd // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background + GuiDrawRectangle(bounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background // Draw visible items for (int i = 0; ((i < visibleItems) && (text != NULL)); i++) @@ -3881,7 +3917,7 @@ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, cons buttonBounds.width = (bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING*(buttonCount + 1))/buttonCount; buttonBounds.height = RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; - int textWidth = GetTextWidth(message) + 2; + //int textWidth = GetTextWidth(message) + 2; Rectangle textBounds = { 0 }; textBounds.x = bounds.x + RAYGUI_MESSAGEBOX_BUTTON_PADDING; @@ -4485,7 +4521,7 @@ static void GuiLoadStyleFromMemory(const unsigned char *fileData, int dataSize) // NOTE: All DEFAULT properties should be defined first in the file GuiSetStyle(0, (int)propertyId, propertyValue); - if (propertyId < RAYGUI_MAX_PROPS_BASE) for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) GuiSetStyle(i, (int)propertyId, propertyValue); + if (propertyId < RAYGUI_MAX_PROPS_BASE) for (int j = 1; j < RAYGUI_MAX_CONTROLS; j++) GuiSetStyle(j, (int)propertyId, propertyValue); } else GuiSetStyle((int)controlId, (int)propertyId, propertyValue); } @@ -5718,4 +5754,4 @@ static int GetCodepointNext(const char *text, int *codepointSize) } #endif // RAYGUI_STANDALONE -#endif // RAYGUI_IMPLEMENTATION \ No newline at end of file +#endif // RAYGUI_IMPLEMENTATION From 637debb62d5781f47c2e2811b4439995211eff7f Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:38:55 +0100 Subject: [PATCH 108/155] Updated Notepad++ autocomplete list for raylib 5.5 --- projects/Notepad++/npes_saved_w64devkit.txt | Bin 8604 -> 10400 bytes .../raylib_npp_parser/raylib_npp.xml | 430 +++++++++++++----- .../raylib_npp_parser/raylib_to_parse.h | 193 ++++---- 3 files changed, 432 insertions(+), 191 deletions(-) diff --git a/projects/Notepad++/npes_saved_w64devkit.txt b/projects/Notepad++/npes_saved_w64devkit.txt index 92375c24aec58c21a1137c86acd9d3b108a1888d..767fa274d9778860a26893655eef4c4b026e8590 100644 GIT binary patch delta 493 zcma)3!7c+)6uo0w9qlO9PRgR~OIVN^-H3>-l?c@k6_Hdssv25DTd9SlU64p@^e!w| z_y8Ko{DF-XD<9!AoHx1?iN(u%_uO;NJ@37T#mCIcl}}AkiZ6ZVfhNt<9GO_N-1b>K zVZ^zsc32y zg1Ron{2WgACgtQLM~%EGznt6AsPkd81~{(oa!ViS7(xDuZ1ZYDgau7f3075Uha?tF z-JUG*+Nj2#i3LN@AoA8CKQWHTzy-3|Zof?Xu3VsMx*2W05ZCT|fM5Iv zpN^oNhNrx78U7`lv%m`2Ef=jLMFrIgCLE$8XG+z~50BeoEM@}zli}P6ufk877An9( pjJ@*QC6-`Z2lHUUv$KSW3sA;NkUXArW@Wvw_;TsuuY}Wt) delta 239 zcmZ1wILCQI8~bD-j=0G$*rg^LuyaiQq`qpi6lWUiVuJ zV8&pd6OFz zohKhqW~tX_&}UF!aAGKB$YjW2NCC1Ffw&mR%VS6filhR0sSFiB(OiZCD8CdgufR|Q zl&J)YXEG!KO+r;!3>5JN%4Y+`)4=AZGVn5R0Y&v0R2VdXa*mVrl}aZsV4em5tK&JF diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index c869a1a18..3c642ad31 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -23,16 +23,16 @@ - + - + - + - + @@ -43,7 +43,7 @@ - + @@ -53,38 +53,38 @@ - + - + - + - + - + - + - + - + - + @@ -113,12 +113,12 @@ - + - + @@ -139,7 +139,7 @@ - + @@ -190,6 +190,9 @@ + + + @@ -315,8 +318,8 @@ - - + + @@ -370,20 +373,18 @@ - - - + + + - - + + + - - - - - + + @@ -392,12 +393,6 @@ - - - - - - @@ -412,6 +407,22 @@ + + + + + + + + + + + + + + + + @@ -430,6 +441,9 @@ + + + @@ -484,6 +498,8 @@ + + @@ -575,6 +591,7 @@ + @@ -629,6 +646,11 @@ + + + + + @@ -639,13 +661,18 @@ + + + + + - + @@ -701,6 +728,25 @@ + + + + + + + + + + + + + + + + + + + @@ -710,7 +756,7 @@ - + @@ -752,7 +798,7 @@ - + @@ -837,6 +883,14 @@ + + + + + + + + @@ -939,7 +993,7 @@ - + @@ -984,17 +1038,23 @@ + + + + + + - + - + @@ -1025,7 +1085,7 @@ - + @@ -1071,8 +1131,8 @@ - - + + @@ -1173,8 +1233,8 @@ - - + + @@ -1183,17 +1243,17 @@ - - + + - - - - + + + + @@ -1221,6 +1281,14 @@ + + + + + + + + @@ -1247,14 +1315,14 @@ - + - + @@ -1291,7 +1359,7 @@ - + @@ -1299,7 +1367,7 @@ - + @@ -1307,7 +1375,7 @@ - + @@ -1315,7 +1383,7 @@ - + @@ -1323,7 +1391,7 @@ - + @@ -1443,6 +1511,14 @@ + + + + + + + + @@ -1464,10 +1540,18 @@ + + + + + + + + - + @@ -1480,14 +1564,6 @@ - - - - - - - - @@ -1515,19 +1591,20 @@ - - - - - - - + + + + + + + + @@ -1543,8 +1620,8 @@ - - + + @@ -1661,6 +1738,12 @@ + + + + + + @@ -1725,6 +1808,13 @@ + + + + + + + @@ -1901,6 +1991,15 @@ + + + + + + + + + @@ -1968,6 +2067,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2023,8 +2167,8 @@ - - + + @@ -2033,8 +2177,8 @@ - - + + @@ -2131,6 +2275,12 @@ + + + + + + @@ -2138,7 +2288,7 @@ - + @@ -2195,6 +2345,13 @@ + + + + + + + @@ -2228,7 +2385,7 @@ - + @@ -2252,8 +2409,8 @@ - - + + @@ -2480,7 +2637,7 @@ - + @@ -2534,11 +2691,27 @@ + + + + + + + + + + + + + + + + @@ -2577,7 +2750,7 @@ - + @@ -2734,8 +2907,8 @@ - - + + @@ -2787,6 +2960,24 @@ + + + + + + + + + + + + + + + + + + @@ -2798,7 +2989,7 @@ - + @@ -2822,7 +3013,7 @@ - + @@ -2862,12 +3053,6 @@ - - - - - - @@ -2878,6 +3063,18 @@ + + + + + + + + + + + + @@ -2968,8 +3165,8 @@ - - + + @@ -3001,7 +3198,14 @@ - + + + + + + + + @@ -3121,8 +3325,8 @@ - - + + @@ -3141,8 +3345,8 @@ - - + + @@ -3231,10 +3435,10 @@ - + - - + + @@ -3269,8 +3473,8 @@ - - + + @@ -3352,8 +3556,8 @@ - - + + @@ -3430,7 +3634,7 @@ - + @@ -3443,7 +3647,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 0a3c2417d..19bf37135 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -8,36 +8,36 @@ RLAPI void CloseWindow(void); // Close windo RLAPI bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen -RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden +RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized +RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized +RLAPI bool IsWindowFocused(void); // Check if window is currently focused RLAPI bool IsWindowResized(void); // Check if window has been resized last frame RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled -RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) +RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags -RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) -RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed (only PLATFORM_DESKTOP) -RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) -RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) -RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) -RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) -RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) -RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) -RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed, resizes monitor to match window resolution +RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution +RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable +RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable +RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized +RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit) +RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit) +RLAPI void SetWindowTitle(const char *title); // Set title for window +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowMaxSize(int width, int height); // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) -RLAPI void SetWindowFocused(void); // Set window focused (only PLATFORM_DESKTOP) +RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] +RLAPI void SetWindowFocused(void); // Set window focused RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) RLAPI int GetMonitorCount(void); // Get number of connected monitors -RLAPI int GetCurrentMonitor(void); // Get current connected monitor +RLAPI int GetCurrentMonitor(void); // Get current monitor where window is placed RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor) RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor) @@ -49,6 +49,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI Image GetClipboardImage(void); // Get clipboard image RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling @@ -87,7 +88,7 @@ RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR s // NOTE: Shader functionality is not available on OpenGL 1.1 RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI bool IsShaderReady(Shader shader); // Check if a shader is ready +RLAPI bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU) RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value @@ -97,13 +98,15 @@ RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture) RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position -RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) -RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix -RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position -RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +#define GetMouseRay GetScreenToWorldRay // Compatibility hack for previous raylib versions +RLAPI Ray GetScreenToWorldRay(Vector2 position, Camera camera); // Get a ray trace from screen position (i.e mouse) +RLAPI Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height); // Get a ray trace from screen position (i.e mouse) in a viewport +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position -RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) +RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix // Timing-related functions RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) @@ -112,6 +115,9 @@ RLAPI double GetTime(void); // Get elapsed RLAPI int GetFPS(void); // Get current FPS // Custom frame control functions +// 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) RLAPI void PollInputEvents(void); // Register all input events RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution) @@ -127,6 +133,8 @@ RLAPI void TakeScreenshot(const char *fileName); // Takes a scr RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) +// NOTE: Following functions implemented in module [utils] +//------------------------------------------------------------------ RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator @@ -149,6 +157,7 @@ RLAPI bool ExportDataAsCode(const unsigned char *data, int dataSize, const char RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success +//------------------------------------------------------------------ // File system functions RLAPI bool FileExists(const char *fileName); // Check if file exists @@ -162,10 +171,12 @@ RLAPI const char *GetDirectoryPath(const char *filePath); // Get full pa RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) +RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success RLAPI bool ChangeDirectory(const char *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 FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths @@ -177,10 +188,14 @@ RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int * RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree() RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree() RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() +RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code +RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) + // Automation events functionality RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS -RLAPI void UnloadAutomationEventList(AutomationEventList *list); // Unload automation events list from file +RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording @@ -194,7 +209,7 @@ RLAPI void PlayAutomationEvent(AutomationEvent event); // Input-related functions: keyboard RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again (Only PLATFORM_DESKTOP) +RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again RLAPI bool IsKeyDown(int key); // Check if a key is being pressed RLAPI bool IsKeyReleased(int key); // Check if a key has been released once RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed @@ -203,16 +218,17 @@ RLAPI int GetCharPressed(void); // Get char presse RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available -RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed -RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis -RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once @@ -243,7 +259,7 @@ RLAPI int GetTouchPointCount(void); // Get number of t RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected RLAPI int GetGestureDetected(void); // Get latest detected gesture -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector RLAPI float GetGestureDragAngle(void); // Get gesture drag angle RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta @@ -262,19 +278,21 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing +RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing // Basic shapes drawing functions -RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel -RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care] +RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel using geometry (Vector version) [Can be slow, use with care] RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (using gl lines) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads) -RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) +RLAPI void DrawLineStrip(const Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline -RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version) @@ -286,27 +304,28 @@ RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color) RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle -RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges +RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +RLAPI void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Splines drawing functions -RLAPI void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points -RLAPI void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points -RLAPI void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points -RLAPI void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] -RLAPI void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] +RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points +RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points +RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points +RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] +RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] RLAPI void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points @@ -324,12 +343,13 @@ RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vect RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +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 bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices -RLAPI bool 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 CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices +RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ @@ -340,12 +360,12 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // NOTE: These functions do not require GPU access RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -RLAPI Image LoadImageSvg(const char *fileNameOrString, int width, int height); // Load image from SVG file data or string with specified size RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) +RLAPI Image LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) -RLAPI bool IsImageReady(Image image); // Check if an image is ready +RLAPI bool IsImageValid(Image image); // Check if an image is valid (data and parameters) RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success RLAPI unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer @@ -365,6 +385,7 @@ RLAPI Image GenImageText(int width, int height, const char *text); // Image manipulation functions RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece +RLAPI Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format @@ -375,10 +396,10 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -RLAPI void ImageKernelConvolution(Image *image, float* kernel, int kernelSize); // Apply Custom Square image convolution kernel +RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically @@ -406,6 +427,7 @@ RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image @@ -414,6 +436,11 @@ RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int hei RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image +RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image +RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image +RLAPI void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center) +RLAPI void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) @@ -424,9 +451,9 @@ RLAPI Texture2D LoadTexture(const char *fileName); RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -RLAPI bool IsTextureReady(Texture2D texture); // Check if a texture is ready +RLAPI bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -RLAPI bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready +RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data @@ -445,8 +472,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, V RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely // Color/pixel related functions +RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color +RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA) RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] @@ -456,6 +484,7 @@ RLAPI Color ColorBrightness(Color color, float factor); // G RLAPI Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint +RLAPI Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f] RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer @@ -468,10 +497,10 @@ RLAPI int GetPixelDataSize(int width, int height, int format); // G // Font loading/unloading functions RLAPI Font GetFontDefault(void); // Get the default Font RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -RLAPI bool IsFontReady(Font font); // Check if a font is ready +RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) @@ -512,7 +541,7 @@ RLAPI bool TextIsEqual(const char *text1, const char *text2); RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) +RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings @@ -521,7 +550,11 @@ 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) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) @@ -532,7 +565,7 @@ RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires @@ -557,7 +590,7 @@ RLAPI void DrawGrid(int slices, float spacing); // Model management functions RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI bool IsModelReady(Model model); // Check if a model is ready +RLAPI bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs) RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) @@ -566,8 +599,10 @@ RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points +RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) -RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation @@ -577,9 +612,10 @@ RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms -RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +RLAPI bool ExportMeshAsCode(Mesh mesh, const char *fileName); // Export mesh as code file (.h) defining multiple arrays of vertex attributes // Mesh generation functions RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh @@ -597,14 +633,15 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Material loading/unloading functions RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI bool IsMaterialReady(Material material); // Check if a material is ready +RLAPI bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU) RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh // Model animations loading/unloading functions RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU) +RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match @@ -634,11 +671,11 @@ RLAPI float GetMasterVolume(void); // Get mas // Wave/Sound loading/unloading functions RLAPI Wave LoadWave(const char *fileName); // Load wave data from file RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' -RLAPI bool IsWaveReady(Wave wave); // Checks if wave data is ready +RLAPI bool IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters) RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data RLAPI Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data -RLAPI bool IsSoundReady(Sound sound); // Checks if a sound is ready +RLAPI bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized) RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound @@ -656,7 +693,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() @@ -664,7 +701,7 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data -RLAPI bool IsMusicReady(Music music); // Checks if a music stream is ready +RLAPI bool IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized) RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing @@ -681,7 +718,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur // AudioStream management functions RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) -RLAPI bool IsAudioStreamReady(AudioStream stream); // Checks if an audio stream is ready +RLAPI bool IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized) RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill @@ -696,9 +733,9 @@ RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data -RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as s +RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as 'float' RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream -RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as s +RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' RLAPI void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline From 928535a828ad10c2fe76c440224246c40bdfba0c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:39:38 +0100 Subject: [PATCH 109/155] Commented code issuing warnings on w64devkit (GCC) Tested with w64devkit/MSVC and all seem to work as expected --- src/platforms/rcore_desktop_glfw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 061fe72ca..baf2967fe 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -66,9 +66,9 @@ #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) // NOTE: Those functions require linking with winmm library - #pragma warning(disable: 4273) - unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); - #pragma warning(default: 4273) + //#pragma warning(disable: 4273) + __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); + //#pragma warning(default: 4273) #endif #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) From 15eb8221e316f5f2a873e3c996b6ffa219975941 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:39:58 +0100 Subject: [PATCH 110/155] Updated raylib resource data --- src/raylib.dll.rc | 2 +- src/raylib.dll.rc.data | Bin 11246 -> 11318 bytes src/raylib.rc | 6 +++--- src/raylib.rc.data | Bin 11182 -> 11302 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/raylib.dll.rc b/src/raylib.dll.rc index b0c2f58f8..2f02b495c 100644 --- a/src/raylib.dll.rc +++ b/src/raylib.dll.rc @@ -9,7 +9,7 @@ BEGIN //BLOCK "080904E4" // English UK BLOCK "040904E4" // English US BEGIN - //VALUE "CompanyName", "raylib technologies" + VALUE "CompanyName", "raylib technologies" VALUE "FileDescription", "raylib dynamic library (www.raylib.com)" VALUE "FileVersion", "5.5.0" VALUE "InternalName", "raylib.dll" diff --git a/src/raylib.dll.rc.data b/src/raylib.dll.rc.data index 3c87c5ca34644547b4c229bfdd185df4174c5954..64d2a1cd5708166afa50efa2611b82ee528088e0 100644 GIT binary patch delta 158 zcmaDCzAb_)rHzpR1Qc{8a!E-vXfrU_0C{_WGzf43u>*sF!$unyCUya4u-N4N^5UE4 zG4ZJ}2{2DyrxC?iFquiN`Rut3>iRG`9QIJhIF8KDns#RN6ocN01xgSF#rGn delta 88 zcmdlM@h+SzrHzpR1a4?g*s_fsHmUOzbC^z+#j4%ZqQG h$Hb?`bb@K}I*lksjmeyv%8V?Nbv4B|_h_zS0st;16I}oR diff --git a/src/raylib.rc b/src/raylib.rc index 5076b4a26..327b2c4de 100644 --- a/src/raylib.rc +++ b/src/raylib.rc @@ -9,12 +9,12 @@ BEGIN //BLOCK "080904E4" // English UK BLOCK "040904E4" // English US BEGIN - //VALUE "CompanyName", "raylib technologies" + VALUE "CompanyName", "raylib technologies" VALUE "FileDescription", "raylib application (www.raylib.com)" VALUE "FileVersion", "5.5.0" - VALUE "InternalName", "raylib app" + VALUE "InternalName", "raylib" VALUE "LegalCopyright", "(c) 2024 Ramon Santamaria (@raysan5)" - //VALUE "OriginalFilename", "raylib_app" + VALUE "OriginalFilename", "raylib" VALUE "ProductName", "raylib app" VALUE "ProductVersion", "5.5.0" END diff --git a/src/raylib.rc.data b/src/raylib.rc.data index 5a9aa4ea0603f67448db688d502efe5173e92e11..ceeafa6822baa8ea52830c5c46ba6883212cc2f6 100644 GIT binary patch delta 189 zcmZ1%zAS<(rHzpR1O#*@a!GL(XfrU_0C{UR>IO5hGcbdtChwOQ-#m|rPmPIzdGb1q zD5eCa$y}OBOg2oD^)$tVJs3n77#W-y@)>d&3K$X@@)#;7&(@L_FJVY!NM^_Y^79#T zfH<8Y6DU$V*->*ovmOKcecplT2=7f3Sz SIsv>5?lwI^%< delta 95 zcmZ1$u`Zk|rHzpR1ZHSYTWNj_Y$p Date: Thu, 14 Nov 2024 16:40:04 +0100 Subject: [PATCH 111/155] Update raylib.ico --- src/raylib.ico | Bin 9752 -> 6177 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/raylib.ico b/src/raylib.ico index 0cedcc55cee7da0e5784256078a93f2901e5d734..8dd7bb7add704d75af0588f095ab2a5486eb8a87 100644 GIT binary patch literal 6177 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 literal 9752 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 AR{#J2 From 5e6cdf3a73cb8e92c98393aadb4a8c2335f65621 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 18:41:37 +0100 Subject: [PATCH 112/155] Update emsdk path on Windows to match new raylib installer package --- examples/Makefile | 2 +- examples/Makefile.Web | 2 +- projects/4coder/Makefile | 2 +- projects/VSCode/Makefile | 2 +- src/Makefile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index a47911b5e..a65a4961e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -156,7 +156,7 @@ RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM_OS),WINDOWS) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 13125f22d..dd5dc6881 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -119,7 +119,7 @@ RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM_OS),WINDOWS) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 8e64702a6..641731291 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -114,7 +114,7 @@ endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 65a6f9544..72b850d9b 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -117,7 +117,7 @@ endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/src/Makefile b/src/Makefile index 265f95ca0..7dde52fbd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -183,7 +183,7 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM_OS), WINDOWS) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH := $(EMSDK_PATH)/upstream/bin PYTHON_PATH := $(EMSDK_PATH)/python/3.9.2-nuget_64bit From a2f6ae6796bc4e341ec16c014c1c106a95a6270d Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 14 Nov 2024 23:25:09 -0800 Subject: [PATCH 113/155] Fix warnings in examples (#4492) Move shapes/shapes_rectangle_advanced to the correct folder in MSVC project Add core_input_virtual_controls.vcxproj back into sln file --- examples/core/core_input_gamepad.c | 10 +- examples/core/core_input_virtual_controls.c | 28 +- examples/shapes/shapes_rectangle_advanced.c | 16 +- .../core_input_virtual_controls.vcxproj | 390 ++++++++++++++++++ .../shapes_rectangle_advanced.vcxproj | 4 +- projects/VS2022/raylib.sln | 55 ++- 6 files changed, 455 insertions(+), 48 deletions(-) create mode 100644 projects/VS2022/examples/core_input_virtual_controls.vcxproj diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 538e1c389..f9310fdc3 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -196,7 +196,7 @@ int main(void) { // Draw background: generic - DrawRectangleRounded((Rectangle){ 175, 110, 460, 220}, 0.3f, 0.0f, DARKGRAY); + DrawRectangleRounded((Rectangle){ 175, 110, 460, 220}, 0.3f, 16, DARKGRAY); // Draw buttons: basic DrawCircle(365, 170, 12, RAYWHITE); @@ -225,10 +225,10 @@ int main(void) if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(217 + 54, 176, 30, 25, RED); // Draw buttons: left-right back - DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 0.0f, DARKGRAY); - DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 0.0f, DARKGRAY); - if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 0.0f, RED); - if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 0.0f, RED); + DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 16, DARKGRAY); + DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 16, DARKGRAY); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 16, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 16, RED); // Draw axis: left joystick Color leftGamepadColor = BLACK; diff --git a/examples/core/core_input_virtual_controls.c b/examples/core/core_input_virtual_controls.c index 2d2b91e67..bbbad208f 100644 --- a/examples/core/core_input_virtual_controls.c +++ b/examples/core/core_input_virtual_controls.c @@ -29,19 +29,19 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [core] example - input virtual controls"); - const int dpadX = 90; - const int dpadY = 300; - const int dpadRad = 25;//radius of each pad + const float dpadX = 90; + const float dpadY = 300; + const float dpadRad = 25.0f;//radius of each pad Color dpadColor = BLUE; int dpadKeydown = -1;//-1 if not down, else 0,1,2,3 const float dpadCollider[4][2]= // collider array with x,y position { - {dpadX,dpadY-dpadRad*1.5},//up - {dpadX-dpadRad*1.5,dpadY},//left - {dpadX+dpadRad*1.5,dpadY},//right - {dpadX,dpadY+dpadRad*1.5}//down + {dpadX,dpadY-dpadRad*1.5f},//up + {dpadX-dpadRad*1.5f,dpadY},//left + {dpadX+dpadRad*1.5f,dpadY},//right + {dpadX,dpadY+dpadRad*1.5f}//down }; const char dpadLabel[4]="XYBA";//label of Dpad @@ -57,8 +57,8 @@ int main(void) // Update //-------------------------------------------------------------------------- dpadKeydown = -1; //reset - float inputX=0; - float inputY=0; + int inputX = 0; + int inputY = 0; if(GetTouchPointCount()>0) {//use touch pos inputX = GetTouchX(); @@ -97,18 +97,18 @@ int main(void) for(int i=0;i<4;i++) { //draw all pad - DrawCircle(dpadCollider[i][0],dpadCollider[i][1],dpadRad,dpadColor); + DrawCircleV((Vector2) { dpadCollider[i][0], dpadCollider[i][1] }, dpadRad, dpadColor); if(i!=dpadKeydown) { //draw label DrawText(TextSubtext(dpadLabel,i,1), - dpadCollider[i][0]-7, - dpadCollider[i][1]-8,20,BLACK); + (int)dpadCollider[i][0]-7, + (int)dpadCollider[i][1]-8,20,BLACK); } } - DrawRectangle(playerX-4,playerY-4,75,28,RED); - DrawText("Player",playerX,playerY,20,WHITE); + DrawRectangleRec((Rectangle) { playerX - 4, playerY - 4, 75, 28 }, RED); + DrawText("Player", (int)playerX, (int)playerY, 20, WHITE); EndDrawing(); //-------------------------------------------------------------------------- } diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c index a103e82a1..e885a10ee 100644 --- a/examples/shapes/shapes_rectangle_advanced.c +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -290,10 +290,10 @@ int main(int argc, char *argv[]) { // Update rectangle bounds //---------------------------------------------------------------------------------- - double width = GetScreenWidth()/2.0, height = GetScreenHeight()/6.0; + float width = GetScreenWidth()/2.0f, height = GetScreenHeight()/6.0f; Rectangle rec = { - GetScreenWidth() / 2.0 - width/2, - GetScreenHeight() / 2.0 - (5)*(height/2), + GetScreenWidth() / 2.0f - width/2, + GetScreenHeight() / 2.0f - (5)*(height/2), width, height }; //-------------------------------------------------------------------------------------- @@ -304,19 +304,19 @@ int main(int argc, char *argv[]) ClearBackground(RAYWHITE); // Draw All Rectangles with different roundess for each side and different gradients - DrawRectangleRoundedGradientH(rec, 0.8, 0.8, 36, BLUE, RED); + DrawRectangleRoundedGradientH(rec, 0.8f, 0.8f, 36, BLUE, RED); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 0.5, 1.0, 36, RED, PINK); + DrawRectangleRoundedGradientH(rec, 0.5f, 1.0f, 36, RED, PINK); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 1.0, 0.5, 36, RED, BLUE); + DrawRectangleRoundedGradientH(rec, 1.0f, 0.5f, 36, RED, BLUE); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 0.0, 1.0, 36, BLUE, BLACK); + DrawRectangleRoundedGradientH(rec, 0.0f, 1.0f, 36, BLUE, BLACK); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 1.0, 0.0, 36, BLUE, PINK); + DrawRectangleRoundedGradientH(rec, 1.0f, 0.0f, 36, BLUE, PINK); EndDrawing(); //-------------------------------------------------------------------------------------- } diff --git a/projects/VS2022/examples/core_input_virtual_controls.vcxproj b/projects/VS2022/examples/core_input_virtual_controls.vcxproj new file mode 100644 index 000000000..c5a043b74 --- /dev/null +++ b/projects/VS2022/examples/core_input_virtual_controls.vcxproj @@ -0,0 +1,390 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0981CA28-E4A5-4DF1-987F-A41D09131EFC} + Win32Proj + core_input_virtual_controls + 10.0 + core_input_virtual_controls + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj b/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj index 9e5a04710..7ec07e4b3 100644 --- a/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj +++ b/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj @@ -35,7 +35,7 @@ - {703BE7BA-5B99-4F70-806D-3A259F6A991E} + {FAFEE2F9-24B0-4AF1-B512-433E9590033F} Win32Proj shapes_rectangle_advanced 10.0 @@ -387,4 +387,4 @@ - + \ No newline at end of file diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index e2f512d81..4d03db808 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -297,13 +297,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_splines_drawing", "e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_top_down_lights", "examples\shapes_top_down_lights.vcxproj", "{703BE7BA-5B99-4F70-806D-3A259F6A991E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_rectangle_advanced", "examples\shapes_rectangle_advanced.vcxproj", "{703BE7BA-5B99-4F70-806D-3A259F6A991E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_rectangle_advanced", "examples\shapes_rectangle_advanced.vcxproj", "{FAFEE2F9-24B0-4AF1-B512-433E9590033F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_gpu_skinning", "examples\models_gpu_skinning.vcxproj", "{8245DAD9-D402-4D5C-8F45-32229CD3B263}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shadowmap", "examples\shaders_shadowmap.vcxproj", "{41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_virtual_controls", "examples\core_input_virtual_controls.vcxproj", "{92B64AE7-D773-6F03-89F1-CE59BBF4F053}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_virtual_controls", "examples\core_input_virtual_controls.vcxproj", "{0981CA28-E4A5-4DF1-987F-A41D09131EFC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -2521,6 +2521,22 @@ Global {703BE7BA-5B99-4F70-806D-3A259F6A991E}.Release|x64.Build.0 = Release|x64 {703BE7BA-5B99-4F70-806D-3A259F6A991E}.Release|x86.ActiveCfg = Release|Win32 {703BE7BA-5B99-4F70-806D-3A259F6A991E}.Release|x86.Build.0 = Release|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x64.ActiveCfg = Debug|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x64.Build.0 = Debug|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x86.ActiveCfg = Debug|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x86.Build.0 = Debug|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x64.ActiveCfg = Release|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x64.Build.0 = Release|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x86.ActiveCfg = Release|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x86.Build.0 = Release|Win32 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 @@ -2553,22 +2569,22 @@ Global {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x64.Build.0 = Release|x64 {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x86.ActiveCfg = Release|Win32 {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x86.Build.0 = Release|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x64.ActiveCfg = Debug|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x64.Build.0 = Debug|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x86.ActiveCfg = Debug|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x86.Build.0 = Debug|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x64.Build.0 = Release.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x86.Build.0 = Release.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x64.ActiveCfg = Release|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x64.Build.0 = Release|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x86.ActiveCfg = Release|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x86.Build.0 = Release|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.ActiveCfg = Debug|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.Build.0 = Debug|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2719,9 +2735,10 @@ Global {EFA150D4-F93B-4D7D-A69C-9E8B4663BECD} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} {DF25E545-00FF-4E64-844C-7DF98991F901} = {278D8859-20B1-428F-8448-064F46E1F021} {703BE7BA-5B99-4F70-806D-3A259F6A991E} = {278D8859-20B1-428F-8448-064F46E1F021} + {FAFEE2F9-24B0-4AF1-B512-433E9590033F} = {278D8859-20B1-428F-8448-064F46E1F021} {8245DAD9-D402-4D5C-8F45-32229CD3B263} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} - {92B64AE7-D773-6F03-89F1-CE59BBF4F053} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {0981CA28-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} From 4f091f44a8d91d51019aa65c12da570435de450b Mon Sep 17 00:00:00 2001 From: Oussama Teyib Date: Fri, 15 Nov 2024 07:26:22 +0000 Subject: [PATCH 114/155] Fix typo in BINDINGS.md (#4493) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 576d9b463..fd9bddcb6 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -87,7 +87,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers ### 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. +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 paradigm. | 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 | From 7c5d74e98e22e6095a21720f0f7b1e965a6d3ea3 Mon Sep 17 00:00:00 2001 From: Eike Decker Date: Fri, 15 Nov 2024 16:40:14 +0100 Subject: [PATCH 115/155] Fixing an OBJ loader bug that fragmented the loaded meshes (#4494) The nextShapeEnd integer is a pointer in the OBJ data structures. The faceVertIndex is a vertex index counter for the mesh we are about to create. Both integers are not compatible, which causes the code to finish the meshes too early, thus writing the OBJ data incompletely into the target meshes. It wasn't noticed because for the last mesh, it process all remaining data, causing the last mesh to contain all remaining triangles. This would have been noticed if the OBJ meshes used different textures for each mesh. --- src/rmodels.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 04f7210f2..b5830b2c0 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4244,7 +4244,7 @@ static Model LoadOBJ(const char *fileName) // walk all the faces for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { - if (faceVertIndex >= nextShapeEnd) + if (faceId >= nextShapeEnd) { // try to find the last vert in the next shape nextShape++; @@ -4295,7 +4295,7 @@ static Model LoadOBJ(const char *fileName) for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { bool newMesh = false; // do we need a new mesh? - if (faceVertIndex >= nextShapeEnd) + if (faceId >= nextShapeEnd) { // try to find the last vert in the next shape nextShape++; @@ -4357,7 +4357,7 @@ static Model LoadOBJ(const char *fileName) for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { bool newMesh = false; // do we need a new mesh? - if (faceVertIndex >= nextShapeEnd) + if (faceId >= nextShapeEnd) { // try to find the last vert in the next shape nextShape++; From 816b60505458d922f6279b474d3ee4647c3460c8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 13:18:04 +0100 Subject: [PATCH 116/155] Update CHANGELOG --- CHANGELOG | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1f3f333a3..61e12a3d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,11 +7,11 @@ Current Release: raylib 5.5 (18 November 2024) Release: raylib 5.5 (18 November 2024) ------------------------------------------------------------------------- KEY CHANGES: + - New tool: raylib project creator - New rcore backends: RGFW and SDL3 - New platforms supported: Dreamcast, N64, PSP, PSVita, PS4 - Added GPU Skinning support (all platforms and GL versions) - Added raymath C++ operators - - New tool: raylib project creator Detailed changes: @@ -241,6 +241,7 @@ WIP: Last update with commit from 02-Nov-2024 [rmodels] REVIEWED: Multiple updates to gltf loading, improved macro (#4373) by @Harald Scheirich [rmodels] REVIEWED: `LoadOBJ()`, correctly split obj meshes by material (#4285) by @Jeffery Myers [rmodels] REVIEWED: `LoadOBJ()`, add warning when loading an OBJ with multiple materials (#4271) by @Jeffery Myers +[rmodels] REVIEWED: `LoadOBJ()`, fix bug that fragmented the loaded meshes (#4494) by @Eike Decker [rmodels] REVIEWED: `LoadIQM()`, set model.meshMaterial[] (#4092) by @SuperUserNameMan [rmodels] REVIEWED: `LoadIQM()`, attempt to load texture from IQM at loadtime (#4029) by @Jett [rmodels] REVIEWED: `LoadM3D(), fix vertex colors for m3d files (#3859) by @Jeffery Myers @@ -387,8 +388,9 @@ WIP: Last update with commit from 02-Nov-2024 [build] REVIEWED: CMake, bump version required to avoid deprecated #3639 by @Ray [build] REVIEWED: CMake, fix examples linking -DPLATFORM=SDL (#3825) by @Peter0x44 [build] REVIEWED: CMake, don't build for wayland by default (#4432) by @Peter0x44 -[build] REVIEWED: VS2022 project by @Ray +[build] REVIEWED: VS2022, misc improvements by @Ray [build] REVIEWED: VS2022, fix build warnings (#4095) by @Jeffery Myers +[build] REVIEWED: VS2022, added new examples (#4492) by @Jeffery Myers [build] REVIEWED: Fix fix-build-paths (#3849) by @Caleb Barger [build] REVIEWED: Fix build paths (#3835) by @Steve Biedermann [build] REVIEWED: Fix VSCode sample project for macOS (#3666) by @Tim Romero From d567b35d9a50dbd26e94608795f6bf28dec9bc29 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 17:57:00 +0100 Subject: [PATCH 117/155] Update HISTORY.md --- HISTORY.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f7dc14be1..feefbc13b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -480,28 +480,38 @@ One year after raylib 5.0 release, arribes raylib 5.5, the next big revision of Some numbers for this release: - **+270** closed issues (for a TOTAL of **+1810**!) - - **+800** commits since previous RELEASE (for a TOTAL of **+7750**!) + - **+800** commits since previous RELEASE (for a TOTAL of **+7770**!) - **+30** functions ADDED to raylib API (for a TOTAL of **580**!) - **+110** functions REVIEWED with fixes and improvements - **+140** new contributors (for a TOTAL of **+640**!) Highlights for `raylib 5.5`: - - **`NEW` raylib project creator tool**: A brand new support tool developed to help raylib users to setup new projects in a professional way. This tools generates a complete project structure with multiple build systems and ready for GitHub with CI/CD actions pre-configured. And only providing some project C files and basic properties! + - **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!. - - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, adding new platforms backends has been greatly simplified, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: `RGFW`. `RGFW` is a **new** single-file header-only (`RGFW.h`) portable library intended for platform-functionality management (windowing and inputs); in this case for desktop platforms (Windows, Linux, macOS) and also for Web platform. It adds to the already existing platform backends supporting those same platforms: `GLFW` and `SDL`. + - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, **adding new platforms backends has been greatly simplified**, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: [`RGFW`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_rgfw.c). `RGFW` is a **new single-file header-only portable library** ([`RGFW.h`](https://github.com/ColleagueRiley/RGFW)) intended for platform-functionality management (windowing and inputs); in this case for **desktop platforms** (Windows, Linux, macOS) but also for **Web platform**. It adds a new alternative to the already existing `GLFW` and `SDL` platform backends. - - **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added experimental support for `SDL2` library, in this new `raylib` release some issues with SDL2 has been reviewed and it has been added support for the latest `SDL3` implementation. Now users can select at compile time the desired SDL version to use, increasing the number of potential platforms supported in the future! + - **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added support for `SDL2` library, and `raylib 5.5` not only improves SDL2 functionality, with several issues reviewed, but also adds support for the recently released big SDL update in years: [`SDL3`](https://wiki.libsdl.org/SDL3/FrontPage). Now users can **select at compile time the desired SDL version to use**, increasing the number of potential platforms supported in the future! - - **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, supporting new platform backends is easier than ever! Along the `OpenGL 1.1` graphics option supported by raylib, it opened the door to multiple retro-consoles backend implementations! It's amazing to see raylib running on +20 year old consoles like Dreamcast or PSP, considering the hardware constraints of those platforms and proves raylib versability! Those additional platforms can be found in separate repositories (links) and have been created by Antonio Jose Ramos Marquez (@psxdev). + - **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, **supporting new platform backends is easier than ever!** Along the raylib `rlgl` module support for the `OpenGL 1.1` graphics API, it opened the door to [**multiple homebrew retro-consoles backend implementations!**](https://github.com/raylib4Consoles) It's amazing to see raylib running on +20 year old consoles like [Dreamcast](https://github.com/raylib4Consoles/raylib4Dreamcast), [PSP](https://github.com/raylib4Consoles/raylib4Psp) or [PSVita](https://github.com/psp2dev/raylib4Vita), considering the hardware constraints of those platforms and proves **raylib outstanding versability!** Those additional platforms can be found in separate repositories and have been created by the amazing programmer Antonio Jose Ramos Marquez (@psxdev). - - **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to Daniel Holden (@orangeduck) contribution. Adding GPU skinning was a tricky feature, considering it had to be available for all raylib supported platforms, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found and this new advance feature was added. An [usage example] was also added and also in the process, current models animation system was greatly improved in performance, simplifiying the required math. + - **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to the contributor Daniel Holden (@orangeduck), probably the developer that has further pushed models animations with raylib, developing two amazing tools to visualize and test animations: [GenoView](https://github.com/orangeduck/GenoView) and [BVHView](https://github.com/orangeduck/BVHView). Adding GPU skinning was a tricky feature, considering it had to be **available for all raylib supported platforms**, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found to make it possible. A new example, [`models_gpu_skinning`](https://github.com/raysan5/raylib/blob/master/examples/models/models_gpu_skinning.c) has been added to illustrate this new functionality. As an extra, previous existing CPU animation system has been greatly improved, multiplying performance by a factor (simplifiying required maths). - - **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, this operators simplify C++ code, when doing math operations. + - **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, these operators **simplify C++ code when doing math operations**. -Beside those new big features, `raylib 5.5` comes with MANY other improvements: **Normals support on batching system**, **clipboard images reading support**, **CRC32/MD5/SHA1 hash computation**, **gamepad vibration support**, **improved font loading (no GPU required) with BDF fonts support**, **time-based camera movement**, **improved GLTF animations loading** and much much more, including many functions reviews and new functions added! +Beside those new big features, `raylib 5.5` comes with MANY other improvements: + +- Normals support on batching system +- Clipboard images reading support +- CRC32/MD5/SHA1 hash computation +- Gamepad vibration support +- Improved font loading (no GPU required) with BDF fonts support +- Time-based camera movement +- Improved GLTF animations loading + +...and [much much more](https://github.com/raysan5/raylib/blob/master/CHANGELOG), including **many functions reviews and new functions added!** -Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! +Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes! **After 11 years of development, `raylib 5.5` is the best raylib ever.** From dd688d81a6a08bd205d57111a17f533705a3c4d1 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:16:00 +0100 Subject: [PATCH 118/155] =?UTF-8?q?Thanks=20@everyone=20for=20everything?= =?UTF-8?q?=20=F0=9F=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index feefbc13b..2c93e9c54 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -513,6 +513,10 @@ Beside those new big features, `raylib 5.5` comes with MANY other improvements: Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes! +To end with, I want to **thank all the contributors (+640!**) that along the years have **greatly improved raylib** and pushed it further and better day after day. Thanks to all of them, raylib is the amazing library it is today. + +Last but not least, I want to thank **raylib sponsors and all the raylib community** for their support and continuous engagement with the library, creating and sharing amazing raylib projects on a daily basis. **Thanks for making raylib a great platform to enjoy games/tools/graphic programming!** + **After 11 years of development, `raylib 5.5` is the best raylib ever.** **Enjoy programming with raylib!** :) From da7ab040526cae4ed759f7774a59470de7661e6e Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:44:48 +0100 Subject: [PATCH 119/155] Update HISTORY.md --- HISTORY.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 2c93e9c54..af158bada 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -475,7 +475,7 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature notes on raylib 5.5 ------------------- -One year after raylib 5.0 release, arribes raylib 5.5, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. +One year after raylib 5.0 release, arribes `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. Some numbers for this release: @@ -487,6 +487,8 @@ Some numbers for this release: Highlights for `raylib 5.5`: + - **`NEW` raylib pre-configured Windows package**: The new raylib **postable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib). + - **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!. - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, **adding new platforms backends has been greatly simplified**, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: [`RGFW`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_rgfw.c). `RGFW` is a **new single-file header-only portable library** ([`RGFW.h`](https://github.com/ColleagueRiley/RGFW)) intended for platform-functionality management (windowing and inputs); in this case for **desktop platforms** (Windows, Linux, macOS) but also for **Web platform**. It adds a new alternative to the already existing `GLFW` and `SDL` platform backends. From 162efc1ec7d52cc1297258e50c53aea836a35cfb Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:45:12 +0100 Subject: [PATCH 120/155] Update core_basic_window.c --- examples/core/core_basic_window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/core/core_basic_window.c b/examples/core/core_basic_window.c index 81bea16b8..3cf2c7c5d 100644 --- a/examples/core/core_basic_window.c +++ b/examples/core/core_basic_window.c @@ -4,9 +4,12 @@ * * Welcome to raylib! * -* To test examples, just press F6 and execute raylib_compile_execute script +* To test examples, just press F6 and execute 'raylib_compile_execute' script * Note that compiled executable is placed in the same folder as .c file * +* To test the examples on Web, press F6 and execute 'raylib_compile_execute_web' script +* Web version of the program is generated in the same folder as .c file +* * You can find all basic examples on C:\raylib\raylib\examples folder or * raylib official webpage: www.raylib.com * From 938b805bfb575613d49e3ba57e2f3c9829614e45 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:45:16 +0100 Subject: [PATCH 121/155] 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 02b3ee731..a26b8ce6b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1011,7 +1011,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content RLAPI const char *GetClipboardText(void); // Get clipboard text content -RLAPI Image GetClipboardImage(void); // Get clipboard image +RLAPI Image GetClipboardImage(void); // Get clipboard image content RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling From 88c922f4335b9b8fb2c7d19a4ee22df29c6df963 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 16 Nov 2024 17:45:33 +0000 Subject: [PATCH 122/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 2 +- parser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index aa86d3f71..0921ed40e 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3522,7 +3522,7 @@ }, { "name": "GetClipboardImage", - "description": "Get clipboard image", + "description": "Get clipboard image content", "returnType": "Image" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index e5a20049e..a8e242ac7 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3399,7 +3399,7 @@ return { }, { name = "GetClipboardImage", - description = "Get clipboard image", + description = "Get clipboard image content", returnType = "Image" }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index e38495559..a9cfa005c 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1230,7 +1230,7 @@ Function 046: GetClipboardText() (0 input parameters) Function 047: GetClipboardImage() (0 input parameters) Name: GetClipboardImage Return type: Image - Description: Get clipboard image + Description: Get clipboard image content No input parameters Function 048: EnableEventWaiting() (0 input parameters) Name: EnableEventWaiting diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index b91874cc0..dcc079f10 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -795,7 +795,7 @@ - + From 68503ed96ff66702ba8b7ca1de917f2fa1a77cee Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 19:00:28 +0100 Subject: [PATCH 123/155] Update webassembly.yml --- .github/workflows/webassembly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index f676877fd..c3a392215 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -29,7 +29,7 @@ jobs: - name: Setup emsdk uses: mymindstorm/setup-emsdk@v14 with: - version: 3.1.64 + version: 3.1.71 actions-cache-folder: 'emsdk-cache' - name: Setup Release Version From c1ab645ca298a2801097931d1079b10ff7eb9df8 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 18 Nov 2024 13:21:10 +0100 Subject: [PATCH 124/155] Update HISTORY.md --- HISTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index af158bada..3cecb2a67 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -487,7 +487,7 @@ Some numbers for this release: Highlights for `raylib 5.5`: - - **`NEW` raylib pre-configured Windows package**: The new raylib **postable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib). + - **`NEW` raylib pre-configured Windows package**: The new raylib **portable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib). - **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!. From 71e0b8b5813fb1d2916c81c8e6db42d12d9274ab Mon Sep 17 00:00:00 2001 From: Gunko Vadim Date: Mon, 18 Nov 2024 18:38:28 +0500 Subject: [PATCH 125/155] Update BINDINGS.md (#4504) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index fd9bddcb6..8f68c66d3 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -51,7 +51,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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 | +| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [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 | From 8375581f870ec1c4bcf17fdf842c608463a46b68 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 00:19:39 +0100 Subject: [PATCH 126/155] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29173d665..29f0f61ff 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html) [![GitHub Releases Downloads](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases) [![GitHub Stars](https://img.shields.io/github/stars/raysan5/raylib?style=flat&label=stars)](https://github.com/raysan5/raylib/stargazers) -[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/5.0)](https://github.com/raysan5/raylib/commits/master) +[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/5.5)](https://github.com/raysan5/raylib/commits/master) [![GitHub Sponsors](https://img.shields.io/github/sponsors/raysan5?label=sponsors)](https://github.com/sponsors/raysan5) [![Packaging Status](https://repology.org/badge/tiny-repos/raylib.svg)](https://repology.org/project/raylib/versions) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) From fde3779ebd58e69f84b61cb4c3f941235e418881 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 18 Nov 2024 18:37:33 -0500 Subject: [PATCH 127/155] BINDINGS: raylib-cpp supports raylib 5.5 (#4511) [raylib-cpp](https://github.com/RobLoach/raylib-cpp) has been updated to use the new raylib 5.5 functions. This is a great release! Thanks so much. --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 8f68c66d3..7f79cb8d5 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -90,7 +90,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers 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 paradigm. | 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 | +| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [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 | | [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT | From 05b2603c456eab3d12f37de0d4271bed869dc717 Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Tue, 19 Nov 2024 03:03:39 -0500 Subject: [PATCH 128/155] Update raylib-d binding to 5.5 (#4506) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 7f79cb8d5..e5aa66815 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -23,7 +23,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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) | **5.0** | [D](https://dlang.org) | Apache-2.0 | -| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.0** | [D](https://dlang.org) | Zlib | +| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.5** | [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 | From f979cc62eeff9bd510eadb99d4937ac6da353f0f Mon Sep 17 00:00:00 2001 From: Mute Date: Tue, 19 Nov 2024 08:04:14 +0000 Subject: [PATCH 129/155] Fixed grammar mistakes in core_3d_camera_first_person.c (#4508) Changed line 118 from, "// For advance camera controls, it's reecommended to compute camera movement manually", to, "// For advanced camera controls, it's recommended to compute camera movement manually". --- examples/core/core_3d_camera_first_person.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index 35b18ace4..2b36c598b 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -115,7 +115,7 @@ int main(void) // Update camera computes movement internally depending on the camera mode // Some default standard keyboard/mouse inputs are hardcoded to simplify use - // For advance camera controls, it's reecommended to compute camera movement manually + // For advanced camera controls, it's recommended to compute camera movement manually UpdateCamera(&camera, cameraMode); // Update camera /* @@ -203,4 +203,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} From 65f955a4dc967c1a9c0c0935724cc5117f5c3d9e Mon Sep 17 00:00:00 2001 From: kovidomi Date: Tue, 19 Nov 2024 09:05:09 +0100 Subject: [PATCH 130/155] Add missing VS2022 example projects for models_bone_socket and shaders_vertex_displacement (#4510) --- .../examples/models_bone_socket.vcxproj | 387 ++++++++++++++++++ .../shaders_vertex_displacement.vcxproj | 387 ++++++++++++++++++ projects/VS2022/raylib.sln | 38 ++ 3 files changed, 812 insertions(+) create mode 100644 projects/VS2022/examples/models_bone_socket.vcxproj create mode 100644 projects/VS2022/examples/shaders_vertex_displacement.vcxproj diff --git a/projects/VS2022/examples/models_bone_socket.vcxproj b/projects/VS2022/examples/models_bone_socket.vcxproj new file mode 100644 index 000000000..9d89856b0 --- /dev/null +++ b/projects/VS2022/examples/models_bone_socket.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F} + Win32Proj + models_bone_socket + 10.0 + models_bone_socket + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/examples/shaders_vertex_displacement.vcxproj b/projects/VS2022/examples/shaders_vertex_displacement.vcxproj new file mode 100644 index 000000000..294d5f76d --- /dev/null +++ b/projects/VS2022/examples/shaders_vertex_displacement.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {CCA63A76-D9FC-4130-9F67-4D97F9770D53} + Win32Proj + shaders_vertex_displacement + 10.0 + shaders_vertex_displacement + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index 4d03db808..5142c14a1 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -305,6 +305,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shadowmap", "exampl EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_virtual_controls", "examples\core_input_virtual_controls.vcxproj", "{0981CA28-E4A5-4DF1-987F-A41D09131EFC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_bone_socket", "examples\models_bone_socket.vcxproj", "{3A7FE53D-35F7-49DC-9C9A-A5204A53523F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_vertex_displacement", "examples\shaders_vertex_displacement.vcxproj", "{CCA63A76-D9FC-4130-9F67-4D97F9770D53}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.DLL|x64 = Debug.DLL|x64 @@ -2585,6 +2589,38 @@ Global {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x64.ActiveCfg = Debug|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x64.Build.0 = Debug|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x86.ActiveCfg = Debug|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x86.Build.0 = Debug|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x64.ActiveCfg = Release|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x64.Build.0 = Release|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x86.ActiveCfg = Release|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x86.Build.0 = Release|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x64.ActiveCfg = Debug|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x64.Build.0 = Debug|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x86.ActiveCfg = Debug|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x86.Build.0 = Debug|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x64.ActiveCfg = Release|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x64.Build.0 = Release|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x86.ActiveCfg = Release|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2739,6 +2775,8 @@ Global {8245DAD9-D402-4D5C-8F45-32229CD3B263} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} {0981CA28-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {CCA63A76-D9FC-4130-9F67-4D97F9770D53} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} From 21575856f4fb35e9138cc4947e23caa6bd55a1ba Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares <3694604+villares@users.noreply.github.com> Date: Tue, 19 Nov 2024 05:05:39 -0300 Subject: [PATCH 131/155] Update BINDINGS.md: raylib-python-cffi is on v5.0 (#4512) According to https://github.com/electronstudio/raylib-python-cffi --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index e5aa66815..62c01d86c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -54,7 +54,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [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 | +| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 5.0 | [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 | From 7127cba5cc7c217a747096b500bfae795aa5e6c0 Mon Sep 17 00:00:00 2001 From: Andrew Dunbar Date: Tue, 19 Nov 2024 16:33:36 +0700 Subject: [PATCH 132/155] typo/spello: arribes->arrives (#4515) --- HISTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 3cecb2a67..02e226437 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -475,7 +475,7 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature notes on raylib 5.5 ------------------- -One year after raylib 5.0 release, arribes `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. +One year after raylib 5.0 release, arrives `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. Some numbers for this release: From bd706dfcf240355cb4e0fd8b84b554f601016d2d Mon Sep 17 00:00:00 2001 From: Jannis Date: Tue, 19 Nov 2024 09:35:10 +0000 Subject: [PATCH 133/155] Update BINDINGS.md for raylib-beef (#4514) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 62c01d86c..b3aef1293 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -7,7 +7,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | 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-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | From 95e766472f0b71c66b97e2fb7d612b335194da17 Mon Sep 17 00:00:00 2001 From: mikeemm <42421968+mikeemm@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:35:47 +0100 Subject: [PATCH 134/155] [rmodels] Improve OBJ vertex data precision and lower memory usage by ExportMesh() (#4496) * increased vertex data precision to match blender exports * modified memory allocation to better fit higher precision data * now accounting for newline characters during allocation * now accounting for potentially higher vertex counts * removed unnecessary final newline --- src/rmodels.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index b5830b2c0..05ad8083c 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1943,13 +1943,14 @@ bool ExportMesh(Mesh mesh, const char *fileName) if (IsFileExtension(fileName, ".obj")) { // Estimated data size, it should be enough... - int dataSize = mesh.vertexCount*(int)strlen("v 0000.00f 0000.00f 0000.00f") + - mesh.vertexCount*(int)strlen("vt 0.000f 0.00f") + - mesh.vertexCount*(int)strlen("vn 0.000f 0.00f 0.00f") + - mesh.triangleCount*(int)strlen("f 00000/00000/00000 00000/00000/00000 00000/00000/00000"); + int vc = mesh.vertexCount; + int dataSize = vc*(int)strlen("v -0000.000000f -0000.000000f -0000.000000f\n") + + vc*(int)strlen("vt -0.000000f -0.000000f\n") + + vc*(int)strlen("vn -0.0000f -0.0000f -0.0000f\n") + + mesh.triangleCount*snprintf(NULL, 0, "f %i/%i/%i %i/%i/%i %i/%i/%i\n", vc, vc, vc, vc, vc, vc, vc, vc, vc); // NOTE: Text data buffer size is estimated considering mesh data size - char *txtData = (char *)RL_CALLOC(dataSize*2 + 2000, sizeof(char)); + char *txtData = (char *)RL_CALLOC(dataSize + 1000, sizeof(char)); int byteCount = 0; byteCount += sprintf(txtData + byteCount, "# //////////////////////////////////////////////////////////////////////////////////\n"); @@ -1969,17 +1970,17 @@ bool ExportMesh(Mesh mesh, const char *fileName) for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3) { - byteCount += sprintf(txtData + byteCount, "v %.2f %.2f %.2f\n", mesh.vertices[v], mesh.vertices[v + 1], mesh.vertices[v + 2]); + byteCount += sprintf(txtData + byteCount, "v %.6f %.6f %.6f\n", mesh.vertices[v], mesh.vertices[v + 1], mesh.vertices[v + 2]); } for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 2) { - byteCount += sprintf(txtData + byteCount, "vt %.3f %.3f\n", mesh.texcoords[v], mesh.texcoords[v + 1]); + byteCount += sprintf(txtData + byteCount, "vt %.6f %.6f\n", mesh.texcoords[v], mesh.texcoords[v + 1]); } for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3) { - byteCount += sprintf(txtData + byteCount, "vn %.3f %.3f %.3f\n", mesh.normals[v], mesh.normals[v + 1], mesh.normals[v + 2]); + byteCount += sprintf(txtData + byteCount, "vn %.4f %.4f %.4f\n", mesh.normals[v], mesh.normals[v + 1], mesh.normals[v + 2]); } if (mesh.indices != NULL) @@ -2000,8 +2001,6 @@ bool ExportMesh(Mesh mesh, const char *fileName) } } - byteCount += sprintf(txtData + byteCount, "\n"); - // NOTE: Text data length exported is determined by '\0' (NULL) character success = SaveFileText(fileName, txtData); From 10789a4d496128492d190877f2506b6fa728325d Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:31:14 +0100 Subject: [PATCH 135/155] Update rlgl.h --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 756656e58..3bb996add 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3,7 +3,7 @@ * rlgl v5.0 - A multi-OpenGL abstraction layer with an immediate-mode style API * * DESCRIPTION: -* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0) +* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0, ES 3.0) * that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...) * * ADDITIONAL NOTES: From c78757a95957adb3c3b3437d99e31273c1e361ea Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:31:49 +0100 Subject: [PATCH 136/155] REVIEWED: `GetClipboardImage()`, make symbol available on all platforms --- src/config.h | 51 ++++++++++++++---------------- src/platforms/rcore_android.c | 10 ++++++ src/platforms/rcore_desktop_glfw.c | 29 ++++++++--------- src/platforms/rcore_desktop_rgfw.c | 43 ++++++++++++------------- src/platforms/rcore_drm.c | 10 ++++++ src/platforms/rcore_template.c | 10 ++++++ src/platforms/rcore_web.c | 10 ++++++ 7 files changed, 97 insertions(+), 66 deletions(-) diff --git a/src/config.h b/src/config.h index e3749c560..d8f7112eb 100644 --- a/src/config.h +++ b/src/config.h @@ -71,6 +71,30 @@ // Enabling this flag allows manual control of the frame processes, use at your own risk //#define SUPPORT_CUSTOM_FRAME_CONTROL 1 +// Support for clipboard image loading +// NOTE: Only working on SDL3, GLFW (Windows) and RGFW (Windows) +#define SUPPORT_CLIPBOARD_IMAGE 1 + +// NOTE: Clipboard image loading requires support for some image file formats +// TODO: Those defines should probably be removed from here, I prefer to let the user manage them +#if defined(SUPPORT_CLIPBOARD_IMAGE) + #ifndef SUPPORT_MODULE_RTEXTURES + #define SUPPORT_MODULE_RTEXTURES 1 + #endif + #ifndef STBI_REQUIRED + #define STBI_REQUIRED + #endif + #ifndef SUPPORT_FILEFORMAT_BMP // For clipboard image on Windows + #define SUPPORT_FILEFORMAT_BMP 1 + #endif + #ifndef SUPPORT_FILEFORMAT_PNG // Wayland uses png for prints, at least it was on 22 LTS ubuntu + #define SUPPORT_FILEFORMAT_PNG 1 + #endif + #ifndef SUPPORT_FILEFORMAT_JPG + #define SUPPORT_FILEFORMAT_JPG 1 + #endif +#endif + // rcore: Configuration values //------------------------------------------------------------------------------------ @@ -273,31 +297,4 @@ //------------------------------------------------------------------------------------ #define MAX_TRACELOG_MSG_LENGTH 256 // Max length of one trace-log message - -// Enable partial support for clipboard image, only working on SDL3 or -// being on both Windows OS + GLFW or Windows OS + RGFW -#define SUPPORT_CLIPBOARD_IMAGE 1 - -#if defined(SUPPORT_CLIPBOARD_IMAGE) - #ifndef STBI_REQUIRED - #define STBI_REQUIRED - #endif - - #ifndef SUPPORT_FILEFORMAT_BMP // For clipboard image on Windows - #define SUPPORT_FILEFORMAT_BMP 1 - #endif - - #ifndef SUPPORT_FILEFORMAT_PNG // Wayland uses png for prints, at least it was on 22 LTS ubuntu - #define SUPPORT_FILEFORMAT_PNG 1 - #endif - - #ifndef SUPPORT_FILEFORMAT_JPG - #define SUPPORT_FILEFORMAT_JPG 1 - #endif - - #ifndef SUPPORT_MODULE_RTEXTURES - #define SUPPORT_MODULE_RTEXTURES 1 - #endif -#endif - #endif // CONFIG_H diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 85ce82a3a..401e2a067 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -515,6 +515,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index baf2967fe..839852d9f 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -967,32 +967,29 @@ const char *GetClipboardText(void) return glfwGetClipboardString(platform.handle); } -#if defined(SUPPORT_CLIPBOARD_IMAGE) // Get clipboard image Image GetClipboardImage(void) { - Image image = {0}; + Image image = { 0 }; + +#if defined(SUPPORT_CLIPBOARD_IMAGE) +#if defined(_WIN32) unsigned long long int dataSize = 0; - void* fileData = NULL; - -#ifdef _WIN32 - int width, height; + void *fileData = NULL; + int width = 0; + int height = 0; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); + + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else - TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_GLFW doesn't implement `GetClipboardImage` for this OS"); + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); #endif +#endif // SUPPORT_CLIPBOARD_IMAGE - if (fileData == NULL) - { - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); - } - else - { - image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); - } return image; } -#endif // SUPPORT_CLIPBOARD_IMAGE // Show mouse cursor void ShowCursor(void) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index f3f26e3e8..7a2ea9c0d 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -664,42 +664,39 @@ const char *GetClipboardText(void) return RGFW_readClipboard(NULL); } - #if defined(SUPPORT_CLIPBOARD_IMAGE) - -#ifdef _WIN32 -# define WIN32_CLIPBOARD_IMPLEMENTATION -# define WINUSER_ALREADY_INCLUDED -# define WINBASE_ALREADY_INCLUDED -# define WINGDI_ALREADY_INCLUDED -# include "../external/win32_clipboard.h" +#if defined(_WIN32) + #define WIN32_CLIPBOARD_IMPLEMENTATION + #define WINUSER_ALREADY_INCLUDED + #define WINBASE_ALREADY_INCLUDED + #define WINGDI_ALREADY_INCLUDED + #include "../external/win32_clipboard.h" #endif +#endif // SUPPORT_CLIPBOARD_IMAGE // Get clipboard image Image GetClipboardImage(void) { - Image image = {0}; + Image image = { 0 }; + +#if defined(SUPPORT_CLIPBOARD_IMAGE) +#if defined(_WIN32) unsigned long long int dataSize = 0; - void* fileData = NULL; - -#ifdef _WIN32 - int width, height; + void *fileData = NULL; + int width = 0; + int height = 0; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); + + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else - TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); #endif +#endif // SUPPORT_CLIPBOARD_IMAGE - if (fileData == NULL) - { - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); - } - else - { - image = LoadImageFromMemory(".bmp", fileData, dataSize); - } return image; } -#endif // SUPPORT_CLIPBOARD_IMAGE // Show mouse cursor void ShowCursor(void) diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index eb8ef0103..e53f6e86d 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -509,6 +509,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 6bc3432eb..83994e30f 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -292,6 +292,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index f9d93e5a3..aea9fef83 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -805,6 +805,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { From 9e4f513a43a953b17203cab2c1257573850ab918 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:31:57 +0100 Subject: [PATCH 137/155] Reviewed formating --- src/platforms/rcore_desktop_sdl.c | 147 +++++++++++++++--------------- 1 file changed, 75 insertions(+), 72 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index a201f2cde..0b8406c7d 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -74,7 +74,6 @@ #endif #endif - //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -240,7 +239,7 @@ static const int CursorsLUT[] = { // SDL3 Migration Layer made to avoid `ifdefs` inside functions when we can. -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: // SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, @@ -249,7 +248,6 @@ static const int CursorsLUT[] = { // or the borderless fullscreen desktop mode will be used #define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN - #define SDL_IGNORE false #define SDL_DISABLE false #define SDL_ENABLE true @@ -260,27 +258,29 @@ static const int CursorsLUT[] = { // SDL3 Migration: The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag. #define SDL_WINDOW_SHOWN 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) -// // SDL3 Migration: Renamed -// IMPORTANT: -// Might need to call SDL_CleanupEvent somewhere see :https://github.com/libsdl-org/SDL/issues/3540#issuecomment-1793449852 -// +// IMPORTANT: Might need to call SDL_CleanupEvent somewhere see :https://github.com/libsdl-org/SDL/issues/3540#issuecomment-1793449852 #define SDL_DROPFILE SDL_EVENT_DROP_FILE - -const char* SDL_GameControllerNameForIndex(int joystickIndex) +// SDL2 implementation for SDL3 function +const char *SDL_GameControllerNameForIndex(int joystickIndex) { // NOTE: SDL3 uses the IDs itself (SDL_JoystickID) instead of SDL2 joystick_index - const char* name = NULL; + const char *name = NULL; int numJoysticks = 0; SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); - if (joysticks) { - if (joystickIndex < numJoysticks) { + + if (joysticks) + { + if (joystickIndex < numJoysticks) + { SDL_JoystickID instance_id = joysticks[joystickIndex]; name = SDL_GetGamepadNameForID(instance_id); } + SDL_free(joysticks); } + return name; } @@ -288,45 +288,40 @@ int SDL_GetNumVideoDisplays(void) { int monitorCount = 0; SDL_DisplayID *displays = SDL_GetDisplays(&monitorCount); - // Safe because If `mem` is NULL, SDL_free does nothing. + + // Safe because If `mem` is NULL, SDL_free does nothing SDL_free(displays); return monitorCount; } - -// SLD3 Migration: -// To emulate SDL2 this function should return `SDL_DISABLE` or `SDL_ENABLE` -// representing the *processing state* of the event before this function makes any changes to it. -Uint8 SDL_EventState(Uint32 type, int state) { - +// SLD3 Migration: To emulate SDL2 this function should return `SDL_DISABLE` or `SDL_ENABLE` +// representing the *processing state* of the event before this function makes any changes to it +Uint8 SDL_EventState(Uint32 type, int state) +{ Uint8 stateBefore = SDL_EventEnabled(type); + switch (state) { case SDL_DISABLE: SDL_SetEventEnabled(type, false); break; case SDL_ENABLE: SDL_SetEventEnabled(type, true); break; default: TRACELOG(LOG_WARNING, "Event sate: unknow type"); } + return stateBefore; } void SDL_GetCurrentDisplayMode_Adapter(SDL_DisplayID displayID, SDL_DisplayMode* mode) { const SDL_DisplayMode* currMode = SDL_GetCurrentDisplayMode(displayID); - if (currMode == NULL) - { - TRACELOG(LOG_WARNING, "No current display mode"); - } - else - { - *mode = *currMode; - } + + if (currMode == NULL) TRACELOG(LOG_WARNING, "No current display mode"); + else *mode = *currMode; } // SDL3 Migration: Renamed #define SDL_GetCurrentDisplayMode SDL_GetCurrentDisplayMode_Adapter - SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { return SDL_CreateSurface(width, height, SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask)); @@ -337,11 +332,14 @@ SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth // not reliable across platforms, approximately replaced by multiplying // SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms. // returns 0 on success or a negative error code on failure -int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) { - float dpi = SDL_GetWindowDisplayScale(platform.window) * 96.0; +int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) +{ + float dpi = SDL_GetWindowDisplayScale(platform.window)*96.0; + if (ddpi != NULL) *ddpi = dpi; if (hdpi != NULL) *hdpi = dpi; if (vdpi != NULL) *vdpi = dpi; + return 0; } @@ -368,17 +366,13 @@ int SDL_NumJoysticks(void) return numJoysticks; } - // SDL_SetRelativeMouseMode // returns 0 on success or a negative error code on failure // If relative mode is not supported, this returns -1. int SDL_SetRelativeMouseMode_Adapter(SDL_bool enabled) { - - // // SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled) // \returns true on success or false on failure; call SDL_GetError() for more - // if (SDL_SetWindowRelativeMouseMode(platform.window, enabled)) { return 0; // success @@ -398,7 +392,6 @@ bool SDL_GetRelativeMouseMode_Adapter(void) #define SDL_GetRelativeMouseMode SDL_GetRelativeMouseMode_Adapter - int SDL_GetNumTouchFingers(SDL_TouchID touchID) { // SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) @@ -412,16 +405,16 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID) // Since SDL2 doesn't have this function we leave a stub // SDL_GetClipboardData function is available since SDL 3.1.3. (e.g. SDL3) -void* SDL_GetClipboardData(const char *mime_type, size_t *size) { +void* SDL_GetClipboardData(const char *mime_type, size_t *size) +{ TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); + // We could possibly implement it ourselves in this case for some easier platforms return NULL; } #endif // PLATFORM_DESKTOP_SDL3 - - //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- @@ -452,7 +445,7 @@ void ToggleFullscreen(void) const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); -#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -479,7 +472,8 @@ void ToggleBorderlessWindowed(void) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); -#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -532,7 +526,8 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); - #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + + #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -595,7 +590,8 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); - #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + + #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -818,7 +814,8 @@ void SetWindowMonitor(int monitor) const int screenWidth = CORE.Window.screen.width; const int screenHeight = CORE.Window.screen.height; SDL_Rect usableBounds; - #ifdef PLATFORM_DESKTOP_SDL3 // Different style for success checking + + #if defined(PLATFORM_DESKTOP_SDL3) // Different style for success checking if (SDL_GetDisplayUsableBounds(monitor, &usableBounds)) #else if (SDL_GetDisplayUsableBounds(monitor, &usableBounds) == 0) @@ -933,7 +930,8 @@ Vector2 GetMonitorPosition(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { SDL_Rect displayBounds; - #ifdef PLATFORM_DESKTOP_SDL3 + + #if defined(PLATFORM_DESKTOP_SDL3) if (SDL_GetDisplayUsableBounds(monitor, &displayBounds)) #else if (SDL_GetDisplayUsableBounds(monitor, &displayBounds) == 0) @@ -1104,53 +1102,55 @@ const char *GetClipboardText(void) return buffer; } - -#if defined(SUPPORT_CLIPBOARD_IMAGE) // Get clipboard image Image GetClipboardImage(void) { + Image image = { 0 }; + +#if defined(SUPPORT_CLIPBOARD_IMAGE) // Let's hope compiler put these arrays in static memory - const char *image_formats[] = { + const char *imageFormats[] = { "image/bmp", "image/png", "image/jpg", "image/tiff", }; - const char *image_extensions[] = { + const char *imageExtensions[] = { ".bmp", ".png", ".jpg", ".tiff", }; - - Image image = {0}; size_t dataSize = 0; void *fileData = NULL; - for (int i = 0; i < SDL_arraysize(image_formats); ++i) + + for (int i = 0; i < SDL_arraysize(imageFormats); ++i) { - // NOTE: This pointer should be free with SDL_free() at some point. - fileData = SDL_GetClipboardData(image_formats[i], &dataSize); - if (fileData) { - image = LoadImageFromMemory(image_extensions[i], fileData, dataSize); + // NOTE: This pointer should be free with SDL_free() at some point + fileData = SDL_GetClipboardData(imageFormats[i], &dataSize); + + if (fileData) + { + image = LoadImageFromMemory(imageExtensions[i], fileData, dataSize); if (IsImageValid(image)) { - TRACELOG(LOG_INFO, "Clipboard image: Got image from clipboard as a `%s` successfully", image_extensions[i]); + TRACELOG(LOG_INFO, "Clipboard image: Got image from clipboard as a `%s` successfully", imageExtensions[i]); return image; } } } - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data. %s", SDL_GetError()); - return image; -} + if (!IsImageValid(image)) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data. Error: %s", SDL_GetError()); #endif + return image; +} // Show mouse cursor void ShowCursor(void) { -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) SDL_ShowCursor(); #else SDL_ShowCursor(SDL_ENABLE); @@ -1161,7 +1161,7 @@ void ShowCursor(void) // Hides mouse cursor void HideCursor(void) { -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) SDL_HideCursor(); #else SDL_ShowCursor(SDL_DISABLE); @@ -1174,7 +1174,7 @@ void EnableCursor(void) { SDL_SetRelativeMouseMode(SDL_FALSE); -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) // SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible() SDL_ShowCursor(); #else @@ -1275,7 +1275,7 @@ const char *GetKeyName(int key) static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) { -#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 int count = 0; SDL_Finger **fingers = SDL_GetTouchFingers(event.touchID, &count); CORE.Input.Touch.pointCount = count; @@ -1288,7 +1288,9 @@ static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; CORE.Input.Touch.currentTouchState[i] = 1; } + SDL_free(fingers); + #else // SDL2 CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId); @@ -1393,7 +1395,8 @@ void PollInputEvents(void) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - #ifdef PLATFORM_DESKTOP_SDL3 + + #if defined(PLATFORM_DESKTOP_SDL3) // const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ // Event memory is now managed by SDL, so you should not free the data in SDL_EVENT_DROP_FILE, and if you want to hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, you should make a copy of it. SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed. strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); @@ -1407,7 +1410,8 @@ void PollInputEvents(void) else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - #ifdef PLATFORM_DESKTOP_SDL3 + + #if defined(PLATFORM_DESKTOP_SDL3) strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); #else strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file); @@ -1460,7 +1464,7 @@ void PollInputEvents(void) case SDL_WINDOWEVENT_FOCUS_GAINED: case SDL_WINDOWEVENT_MAXIMIZED: case SDL_WINDOWEVENT_RESTORED: - #ifdef PLATFORM_DESKTOP_SDL3 + #if defined(PLATFORM_DESKTOP_SDL3) break; #else default: break; @@ -1471,7 +1475,7 @@ void PollInputEvents(void) // Keyboard events case SDL_KEYDOWN: { - #ifdef PLATFORM_DESKTOP_SDL3 + #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: The following structures have been removed: * SDL_Keysym KeyboardKey key = ConvertScancodeToKey(event.key.scancode); #else @@ -1502,7 +1506,7 @@ void PollInputEvents(void) case SDL_KEYUP: { - #ifdef PLATFORM_DESKTOP_SDL3 + #if defined(PLATFORM_DESKTOP_SDL3) KeyboardKey key = ConvertScancodeToKey(event.key.scancode); #else KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); @@ -1858,7 +1862,7 @@ int InitPlatform(void) } // Init window -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) platform.window = SDL_CreateWindow(CORE.Window.title, CORE.Window.screen.width, CORE.Window.screen.height, flags); #else platform.window = SDL_CreateWindow(CORE.Window.title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, CORE.Window.screen.width, CORE.Window.screen.height, flags); @@ -1946,11 +1950,10 @@ int InitPlatform(void) CORE.Storage.basePath = SDL_GetBasePath(); // Alternative: GetWorkingDirectory(); //---------------------------------------------------------------------------- - -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL3): Initialized successfully"); #else - TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL): Initialized successfully"); + TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL2): Initialized successfully"); #endif return 0; From 26548c10620c4ae6937cf8b506c777a006b33c16 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:33:13 +0100 Subject: [PATCH 138/155] Remove trail-spaces --- src/platforms/rcore_android.c | 2 +- src/platforms/rcore_desktop_glfw.c | 8 +++---- src/platforms/rcore_desktop_rgfw.c | 14 ++++++------ src/platforms/rcore_desktop_sdl.c | 36 +++++++++++++++--------------- src/platforms/rcore_drm.c | 2 +- src/platforms/rcore_template.c | 2 +- src/platforms/rcore_web.c | 2 +- src/rlgl.h | 4 ++-- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 401e2a067..47dc5cabc 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -519,7 +519,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 839852d9f..5caf17ead 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -68,7 +68,7 @@ // NOTE: Those functions require linking with winmm library //#pragma warning(disable: 4273) __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); - //#pragma warning(default: 4273) + //#pragma warning(default: 4273) #endif #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) @@ -971,16 +971,16 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + #if defined(SUPPORT_CLIPBOARD_IMAGE) #if defined(_WIN32) unsigned long long int dataSize = 0; void *fileData = NULL; int width = 0; int height = 0; - + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); - + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 7a2ea9c0d..1d3ddf60f 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -246,7 +246,7 @@ bool WindowShouldClose(void) // Toggle fullscreen mode void ToggleFullscreen(void) -{ +{ RGFW_window_maximize(platform.window); ToggleBorderlessWindowed(); } @@ -678,16 +678,16 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + #if defined(SUPPORT_CLIPBOARD_IMAGE) #if defined(_WIN32) unsigned long long int dataSize = 0; void *fileData = NULL; int width = 0; int height = 0; - + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); - + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else @@ -1194,7 +1194,7 @@ void PollInputEvents(void) int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; int pressed = (value > 0.1f); CORE.Input.Gamepad.currentButtonState[event->joystick][button] = pressed; - + if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; } @@ -1286,8 +1286,8 @@ int InitPlatform(void) RGFW_area screenSize = RGFW_getScreenSize(); CORE.Window.display.width = screenSize.w; CORE.Window.display.height = screenSize.h; - /* - I think this is needed by Raylib now ? + /* + I think this is needed by Raylib now ? If so, rcore_destkop_sdl should be updated too */ SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height); diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 0b8406c7d..99de9af22 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -244,7 +244,7 @@ static const int CursorsLUT[] = { // SDL3 Migration: // SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, // and you can call SDL_GetWindowFullscreenMode() -// to see whether an exclusive fullscreen mode will be used +// to see whether an exclusive fullscreen mode will be used // or the borderless fullscreen desktop mode will be used #define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN @@ -269,7 +269,7 @@ const char *SDL_GameControllerNameForIndex(int joystickIndex) const char *name = NULL; int numJoysticks = 0; SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); - + if (joysticks) { if (joystickIndex < numJoysticks) @@ -277,10 +277,10 @@ const char *SDL_GameControllerNameForIndex(int joystickIndex) SDL_JoystickID instance_id = joysticks[joystickIndex]; name = SDL_GetGamepadNameForID(instance_id); } - + SDL_free(joysticks); } - + return name; } @@ -288,7 +288,7 @@ int SDL_GetNumVideoDisplays(void) { int monitorCount = 0; SDL_DisplayID *displays = SDL_GetDisplays(&monitorCount); - + // Safe because If `mem` is NULL, SDL_free does nothing SDL_free(displays); @@ -300,21 +300,21 @@ int SDL_GetNumVideoDisplays(void) Uint8 SDL_EventState(Uint32 type, int state) { Uint8 stateBefore = SDL_EventEnabled(type); - + switch (state) { case SDL_DISABLE: SDL_SetEventEnabled(type, false); break; case SDL_ENABLE: SDL_SetEventEnabled(type, true); break; default: TRACELOG(LOG_WARNING, "Event sate: unknow type"); } - + return stateBefore; } void SDL_GetCurrentDisplayMode_Adapter(SDL_DisplayID displayID, SDL_DisplayMode* mode) { const SDL_DisplayMode* currMode = SDL_GetCurrentDisplayMode(displayID); - + if (currMode == NULL) TRACELOG(LOG_WARNING, "No current display mode"); else *mode = *currMode; } @@ -335,11 +335,11 @@ SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) { float dpi = SDL_GetWindowDisplayScale(platform.window)*96.0; - + if (ddpi != NULL) *ddpi = dpi; if (hdpi != NULL) *hdpi = dpi; if (vdpi != NULL) *vdpi = dpi; - + return 0; } @@ -408,7 +408,7 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID) void* SDL_GetClipboardData(const char *mime_type, size_t *size) { TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); - + // We could possibly implement it ourselves in this case for some easier platforms return NULL; } @@ -930,7 +930,7 @@ Vector2 GetMonitorPosition(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { SDL_Rect displayBounds; - + #if defined(PLATFORM_DESKTOP_SDL3) if (SDL_GetDisplayUsableBounds(monitor, &displayBounds)) #else @@ -1124,12 +1124,12 @@ Image GetClipboardImage(void) size_t dataSize = 0; void *fileData = NULL; - + for (int i = 0; i < SDL_arraysize(imageFormats); ++i) { // NOTE: This pointer should be free with SDL_free() at some point fileData = SDL_GetClipboardData(imageFormats[i], &dataSize); - + if (fileData) { image = LoadImageFromMemory(imageExtensions[i], fileData, dataSize); @@ -1288,9 +1288,9 @@ static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; CORE.Input.Touch.currentTouchState[i] = 1; } - + SDL_free(fingers); - + #else // SDL2 CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId); @@ -1395,7 +1395,7 @@ void PollInputEvents(void) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - + #if defined(PLATFORM_DESKTOP_SDL3) // const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ // Event memory is now managed by SDL, so you should not free the data in SDL_EVENT_DROP_FILE, and if you want to hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, you should make a copy of it. SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed. @@ -1410,7 +1410,7 @@ void PollInputEvents(void) else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - + #if defined(PLATFORM_DESKTOP_SDL3) strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); #else diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index e53f6e86d..e9a236868 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -513,7 +513,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 83994e30f..891c4ab34 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -296,7 +296,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index aea9fef83..859b2c1f3 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -809,7 +809,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/rlgl.h b/src/rlgl.h index 3bb996add..92971df62 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3417,9 +3417,9 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi { if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) { - if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || + if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32) || - (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || + (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, NULL); } From 481095226daedfc2a2254372cdb5f5ff225915d7 Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares <3694604+villares@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:41:14 -0300 Subject: [PATCH 139/155] Update BINDINGS.md: github.com/electronstudio/raylib-python-cffi now 5.5 (#4517) --- BINDINGS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index b3aef1293..f82a66be7 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -54,9 +54,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [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) | 5.0 | [Python](https://www.python.org) | EPL-2.0 | +| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [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-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 | From a145779e215772cbcbb7d68e74fdf927264facc1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 19 Nov 2024 21:42:34 +0000 Subject: [PATCH 140/155] Update BINDINGS.md: fortran-raylib is on v5.5 (#4518) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index f82a66be7..5c2170373 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -27,7 +27,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [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 | +| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.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) | **???** | From 57edbc3bab77e89b88e157f6f31ee29d9f62a040 Mon Sep 17 00:00:00 2001 From: "Jorge A. Gomes" Date: Wed, 20 Nov 2024 07:24:47 -0300 Subject: [PATCH 141/155] Update BINDINGS.md for raylib-py 5.5 (#4519) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 5c2170373..919bc51ca 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -56,7 +56,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | | [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [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-py](https://github.com/overdev/raylib-py) | 5.5 | [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 | From 6af664c04ee4d75cff31c563967d75f0295a7325 Mon Sep 17 00:00:00 2001 From: devdad Date: Wed, 20 Nov 2024 11:25:31 +0100 Subject: [PATCH 142/155] Update shaders_basic_pbr example to work on web (#4516) * basic pbr example pbr implementation includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve * Unloading PBRMAterial I forgot unloading PBRMaterial * fix small issue with texOffset assigment. value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset . * Changed size of textures and file name changed Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c , Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh); but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh * Update to 5.5 version of eexample and fix to work in web set GLSL_VERSION 100 set precision highp float; removed in keyword fix for loop has to use only constant * Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error * Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error * removed rpbr.h removed rpbr.h --- .../shaders/resources/shaders/glsl100/pbr.fs | 16 ++++++++-------- examples/shaders/shaders_basic_pbr.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index 1ada83317..27d496968 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -1,6 +1,6 @@ #version 100 -precision mediump float; +precision highp float; #define MAX_LIGHTS 4 #define LIGHT_DIRECTIONAL 0 @@ -17,12 +17,12 @@ struct Light { }; // Input vertex attributes (from vertex shader) -varying in vec3 fragPosition; -varying in vec2 fragTexCoord; -varying in vec4 fragColor; -varying in vec3 fragNormal; -varying in vec4 shadowPos; -varying in mat3 TBN; +varying vec3 fragPosition; +varying vec2 fragTexCoord; +varying vec4 fragColor; +varying vec3 fragNormal; +varying vec4 shadowPos; +varying mat3 TBN; // Input uniform values @@ -113,7 +113,7 @@ vec3 pbr(){ vec3 baseRefl = mix(vec3(0.04),albedo.rgb,metallic); vec3 Lo = vec3(0.0); // acumulate lighting lum - for(int i=0;i // Required for: NULL From 532167d28baade92a50c1020c127f2d060cd392f Mon Sep 17 00:00:00 2001 From: kimierik <105240664+kimierik@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:26:29 +0200 Subject: [PATCH 143/155] build.zig: fix raygui inclusion in windows crosscompilation (#4489) --- build.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.zig b/build.zig index 5c2ac77cd..4cc412bc5 100644 --- a/build.zig +++ b/build.zig @@ -302,12 +302,14 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void { + const raylib_dep = b.dependencyFromBuildZig(@This(), .{}); var gen_step = b.addWriteFiles(); raylib.step.dependOn(&gen_step.step); const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); raylib.addCSourceFile(.{ .file = raygui_c_path }); raylib.addIncludePath(raygui_dep.path("src")); + raylib.addIncludePath(raylib_dep.path("src")); raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); } From 415a98965a9d8ca1538e890367f27ec08c95f05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gael=20P=C3=A9rez?= Date: Wed, 20 Nov 2024 04:27:14 -0600 Subject: [PATCH 144/155] update raymath.h: add Vector2CrossProduct function (#4520) --- src/raymath.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index e522113b1..06865e199 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -304,6 +304,14 @@ RMAPI float Vector2DotProduct(Vector2 v1, Vector2 v2) return result; } +// Calculate two vectors cross product +RMAPI float Vector2CrossProduct(Vector2 v1, Vector2 v2) +{ + float result = (v1.x*v2.y - v1.y*v2.x); + + return result; +} + // Calculate distance between two vectors RMAPI float Vector2Distance(Vector2 v1, Vector2 v2) { From 11429b48eb244c8e153838cf7d876d75da992815 Mon Sep 17 00:00:00 2001 From: veins1 <19636663+veins1@users.noreply.github.com> Date: Thu, 21 Nov 2024 01:28:46 +0500 Subject: [PATCH 145/155] Fix for #4521 (#4523) --- src/raudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/raudio.c b/src/raudio.c index 15859a661..33c0c4e04 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1855,6 +1855,8 @@ void SeekMusicStream(Music music, float position) ma_mutex_lock(&AUDIO.System.lock); music.stream.buffer->framesProcessed = positionInFrames; + music.stream.buffer->isSubBufferProcessed[0] = true; + music.stream.buffer->isSubBufferProcessed[1] = true; ma_mutex_unlock(&AUDIO.System.lock); } From 0d39e7137b28980f05843bd505ef3e74d8772d03 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 21 Nov 2024 12:38:29 +0100 Subject: [PATCH 146/155] Fix #4527 --- .../shaders/glsl330/hybrid_raster.fs | 12 +++++++-- .../resources/shaders/glsl330/sobel.fs | 26 +++++++++---------- .../resources/shaders/glsl330/swirl.fs | 2 +- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs b/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs index 85ef492c0..26c7e8f26 100644 --- a/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs +++ b/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs @@ -1,14 +1,22 @@ -#version 330 +#version 330 +// Input vertex attributes (from vertex shader) in vec2 fragTexCoord; in vec4 fragColor; +// Input uniform values uniform sampler2D texture0; uniform vec4 colDiffuse; +// Output fragment color +//out vec4 finalColor; + +// NOTE: Add here your custom variables + void main() { - vec4 texelColor = texture2D(texture0, fragTexCoord); + vec4 texelColor = texture(texture0, fragTexCoord); + gl_FragColor = texelColor*colDiffuse*fragColor; gl_FragDepth = gl_FragCoord.z; } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/sobel.fs b/examples/shaders/resources/shaders/glsl330/sobel.fs index f76e9cab9..80883710d 100644 --- a/examples/shaders/resources/shaders/glsl330/sobel.fs +++ b/examples/shaders/resources/shaders/glsl330/sobel.fs @@ -20,22 +20,22 @@ void main() float y = 1.0/resolution.y; vec4 horizEdge = vec4(0.0); - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + horizEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + horizEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; + horizEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + horizEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + horizEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; + horizEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; vec4 vertEdge = vec4(0.0); - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vertEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + vertEdge -= texture(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; + vertEdge -= texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + vertEdge += texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + vertEdge += texture(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; + vertEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); - finalColor = vec4(edge, texture2D(texture0, fragTexCoord).a); + finalColor = vec4(edge, texture(texture0, fragTexCoord).a); } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/swirl.fs b/examples/shaders/resources/shaders/glsl330/swirl.fs index bb0732c55..6a71e3696 100644 --- a/examples/shaders/resources/shaders/glsl330/swirl.fs +++ b/examples/shaders/resources/shaders/glsl330/swirl.fs @@ -41,7 +41,7 @@ void main() } tc += center; - vec4 color = texture2D(texture0, tc/texSize)*colDiffuse*fragColor;; + vec4 color = texture(texture0, tc/texSize)*colDiffuse*fragColor;; finalColor = vec4(color.rgb, 1.0);; } \ No newline at end of file From a53a8958f293c0cc5760021cce616574408aee50 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Fri, 22 Nov 2024 06:52:55 -0300 Subject: [PATCH 147/155] Add implementation to GetWindowScaleDPI() for PLATFORM_WEB (#4526) --- src/platforms/rcore_web.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 859b2c1f3..d0be02514 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -771,8 +771,11 @@ Vector2 GetWindowPosition(void) // Get window scale DPI factor for current monitor Vector2 GetWindowScaleDPI(void) { - TRACELOG(LOG_WARNING, "GetWindowScaleDPI() not implemented on target platform"); - return (Vector2){ 1.0f, 1.0f }; + // NOTE: Returned scale is relative to the current monitor where the browser window is located + Vector2 scale = { 1.0f, 1.0f }; + scale.x = (float)EM_ASM_DOUBLE( { return window.devicePixelRatio; } ); + scale.y = scale.x; + return scale; } // Set clipboard text content From 50a2afff9ebf4f76c61fcf84c046586c9e9b6355 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 22 Nov 2024 11:01:10 +0100 Subject: [PATCH 148/155] Update raylib version to 5.6-dev to avoid confusions with release --- src/raylib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index a26b8ce6b..e548f6def 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* raylib v5.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) +* raylib v5.6-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) * * FEATURES: * - NO external dependencies, all required libraries included with raylib @@ -88,9 +88,9 @@ #include // Required for: va_list - Only used by TraceLogCallback #define RAYLIB_VERSION_MAJOR 5 -#define RAYLIB_VERSION_MINOR 5 +#define RAYLIB_VERSION_MINOR 6 #define RAYLIB_VERSION_PATCH 0 -#define RAYLIB_VERSION "5.5" +#define RAYLIB_VERSION "5.6-dev" // Function specifiers in case library is build/used as a shared library // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll From 65e0d2cfda9a53a00b8b9e9350544867896817d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Nov 2024 10:01:29 +0000 Subject: [PATCH 149/155] Update raylib_api.* by CI --- parser/output/raylib_api.json | 4 ++-- parser/output/raylib_api.lua | 4 ++-- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 0921ed40e..8561bc343 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -15,7 +15,7 @@ { "name": "RAYLIB_VERSION_MINOR", "type": "INT", - "value": 5, + "value": 6, "description": "" }, { @@ -27,7 +27,7 @@ { "name": "RAYLIB_VERSION", "type": "STRING", - "value": "5.5", + "value": "5.6-dev", "description": "" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index a8e242ac7..9ff6c1a9c 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -15,7 +15,7 @@ return { { name = "RAYLIB_VERSION_MINOR", type = "INT", - value = 5, + value = 6, description = "" }, { @@ -27,7 +27,7 @@ return { { name = "RAYLIB_VERSION", type = "STRING", - value = "5.5", + value = "5.6-dev", description = "" }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index a9cfa005c..e7d04cb46 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -14,7 +14,7 @@ Define 002: RAYLIB_VERSION_MAJOR Define 003: RAYLIB_VERSION_MINOR Name: RAYLIB_VERSION_MINOR Type: INT - Value: 5 + Value: 6 Description: Define 004: RAYLIB_VERSION_PATCH Name: RAYLIB_VERSION_PATCH @@ -24,7 +24,7 @@ Define 004: RAYLIB_VERSION_PATCH Define 005: RAYLIB_VERSION Name: RAYLIB_VERSION Type: STRING - Value: "5.5" + Value: "5.6-dev" Description: Define 006: __declspec(x) Name: __declspec(x) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index dcc079f10..6a5cecf5e 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -3,9 +3,9 @@ - + - + From da6fa1d756b4fac76881250089dc48f6e9d2ac1c Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 22 Nov 2024 11:06:34 +0100 Subject: [PATCH 150/155] Fix #4529 --- src/rtext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rtext.c b/src/rtext.c index 81bfe1a8a..999557d38 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1339,6 +1339,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing int GetGlyphIndex(Font font, int codepoint) { int index = 0; + if (!IsFontValid(font)) return index; #define SUPPORT_UNORDERED_CHARSET #if defined(SUPPORT_UNORDERED_CHARSET) From a9aa6b498834925509ed9176d71ad9e96033cc4d Mon Sep 17 00:00:00 2001 From: HaxSam Date: Sun, 24 Nov 2024 16:22:51 +0100 Subject: [PATCH 151/155] [build.zig] improve build system for zig (#4531) Is now possible to switch platform Is now possible to diable raudio, rmodels, and so on Made getOptions public so it can be used for zig wrappers --- build.zig | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/build.zig b/build.zig index 4cc412bc5..866e70034 100644 --- a/build.zig +++ b/build.zig @@ -12,8 +12,6 @@ comptime { } fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void { - raylib.defineCMacro("PLATFORM_DESKTOP", null); - switch (platform) { .glfw => raylib.defineCMacro("PLATFORM_DESKTOP_GLFW", null), .rgfw => raylib.defineCMacro("PLATFORM_DESKTOP_RGFW", null), @@ -58,6 +56,7 @@ const config_h_flags = outer: { var lines = std.mem.tokenizeScalar(u8, config_h, '\n'); while (lines.next()) |line| { if (!std.mem.containsAtLeast(u8, line, 1, "SUPPORT")) continue; + if (std.mem.containsAtLeast(u8, line, 1, "MODULE")) continue; if (std.mem.startsWith(u8, line, "//")) continue; if (std.mem.startsWith(u8, line, "#if")) continue; @@ -94,10 +93,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. }); } + // Sets a flag indiciating the use of a custom `config.h` + try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS"); if (options.config.len > 0) { - // Sets a flag indiciating the use of a custom `config.h` - try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS"); - // Splits a space-separated list of config flags into multiple flags // // Note: This means certain flags like `-x c++` won't be processed properly. @@ -126,6 +124,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. // Otherwise, append default value from config.h to compile flags try raylib_flags_arr.append(flag); } + } else { + // Set default config if no custome config got set + try raylib_flags_arr.appendSlice(&config_h_flags); } const raylib = if (options.shared) @@ -150,26 +151,32 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. var c_source_files = try std.ArrayList([]const u8).initCapacity(b.allocator, 2); c_source_files.appendSliceAssumeCapacity(&.{ "src/rcore.c", "src/utils.c" }); - if (options.raudio) { - try c_source_files.append("src/raudio.c"); - } - if (options.rmodels) { - try c_source_files.append("src/rmodels.c"); - } if (options.rshapes) { try c_source_files.append("src/rshapes.c"); - } - if (options.rtext) { - try c_source_files.append("src/rtext.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RSHAPES"); } if (options.rtextures) { try c_source_files.append("src/rtextures.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RTEXTURES"); + } + if (options.rtext) { + try c_source_files.append("src/rtext.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RTEXT"); + } + if (options.rmodels) { + try c_source_files.append("src/rmodels.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RMODELS"); + } + if (options.raudio) { + try c_source_files.append("src/raudio.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RAUDIO"); } if (options.opengl_version != .auto) { raylib.defineCMacro(options.opengl_version.toCMacroStr(), null); } + raylib.addIncludePath(b.path("src/platforms")); switch (target.result.os.tag) { .windows => { try c_source_files.append("src/rglfw.c"); @@ -329,7 +336,7 @@ pub const Options = struct { const defaults = Options{}; - fn getOptions(b: *std.Build) Options { + pub fn getOptions(b: *std.Build) Options { return .{ .platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform, .raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio, From e494c545b879fa80f55aae13772316fd5c25daac Mon Sep 17 00:00:00 2001 From: listeria <56203103+ListeriaM@users.noreply.github.com> Date: Sun, 24 Nov 2024 12:24:34 -0300 Subject: [PATCH 152/155] raymath: fix C++ operator overloads (#4535) Co-authored-by: Listeria monocytogenes --- src/raymath.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 06865e199..5b5e4c74f 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -2656,7 +2656,7 @@ inline Vector2 operator * (const Vector2& lhs, const Matrix& rhs) return Vector2Transform(lhs, rhs); } -inline const Vector2& operator -= (Vector2& lhs, const Matrix& rhs) +inline const Vector2& operator *= (Vector2& lhs, const Matrix& rhs) { lhs = Vector2Transform(lhs, rhs); return lhs; @@ -2669,7 +2669,7 @@ inline Vector2 operator / (const Vector2& lhs, const float& rhs) inline const Vector2& operator /= (Vector2& lhs, const float& rhs) { - lhs = Vector2Scale(lhs, rhs); + lhs = Vector2Scale(lhs, 1.0f / rhs); return lhs; } @@ -2750,7 +2750,7 @@ inline Vector3 operator * (const Vector3& lhs, const Matrix& rhs) return Vector3Transform(lhs, rhs); } -inline const Vector3& operator -= (Vector3& lhs, const Matrix& rhs) +inline const Vector3& operator *= (Vector3& lhs, const Matrix& rhs) { lhs = Vector3Transform(lhs, rhs); return lhs; @@ -2763,7 +2763,7 @@ inline Vector3 operator / (const Vector3& lhs, const float& rhs) inline const Vector3& operator /= (Vector3& lhs, const float& rhs) { - lhs = Vector3Scale(lhs, rhs); + lhs = Vector3Scale(lhs, 1.0f / rhs); return lhs; } @@ -2847,7 +2847,7 @@ inline Vector4 operator / (const Vector4& lhs, const float& rhs) inline const Vector4& operator /= (Vector4& lhs, const float& rhs) { - lhs = Vector4Scale(lhs, rhs); + lhs = Vector4Scale(lhs, 1.0f / rhs); return lhs; } From 6141489b003be8136d0900479b44fb0732998ff8 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sun, 24 Nov 2024 07:25:36 -0800 Subject: [PATCH 153/155] Fixes casting warnings with RGFW platform. (#4534) --- src/platforms/rcore_desktop_rgfw.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 1d3ddf60f..913223511 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -587,7 +587,7 @@ Vector2 GetMonitorPosition(int monitor) { RGFW_monitor *mons = RGFW_getMonitors(); - return (Vector2){mons[monitor].rect.x, mons[monitor].rect.y}; + return (Vector2){(float)mons[monitor].rect.x, (float)mons[monitor].rect.y}; } // Get selected monitor width (currently used by monitor) @@ -611,7 +611,7 @@ int GetMonitorPhysicalWidth(int monitor) { RGFW_monitor* mons = RGFW_getMonitors(); - return mons[monitor].physW; + return (int)mons[monitor].physW; } // Get selected monitor physical height in millimetres @@ -619,7 +619,7 @@ int GetMonitorPhysicalHeight(int monitor) { RGFW_monitor *mons = RGFW_getMonitors(); - return mons[monitor].physH; + return (int)mons[monitor].physH; } // Get selected monitor refresh rate @@ -640,7 +640,7 @@ const char *GetMonitorName(int monitor) // Get window position XY on monitor Vector2 GetWindowPosition(void) { - return (Vector2){ platform.window->r.x, platform.window->r.y }; + return (Vector2){ (float)platform.window->r.x, (float)platform.window->r.y }; } // Get window scale DPI factor for current monitor @@ -654,7 +654,7 @@ Vector2 GetWindowScaleDPI(void) // Set clipboard text content void SetClipboardText(const char *text) { - RGFW_writeClipboard(text, strlen(text)); + RGFW_writeClipboard(text, (u32)strlen(text)); } // Get clipboard text content @@ -947,7 +947,7 @@ void PollInputEvents(void) case RGFW_quit: CORE.Window.shouldClose = true; break; case RGFW_dnd: // Dropped file { - for (int i = 0; i < event->droppedFilesCount; i++) + for (u32 i = 0; i < event->droppedFilesCount; i++) { if (CORE.Window.dropFileCount == 0) { @@ -1031,7 +1031,7 @@ void PollInputEvents(void) { if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) { - CORE.Input.Mouse.currentWheelMove.y = event->scroll; + CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll; break; } @@ -1050,7 +1050,7 @@ void PollInputEvents(void) if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) { - CORE.Input.Mouse.currentWheelMove.y = event->scroll; + CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll; break; } From 79188f570bf15791c3abad619933d039448023b1 Mon Sep 17 00:00:00 2001 From: Anthony Carbajal <5776225+CrackedPixel@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:17:22 -0600 Subject: [PATCH 154/155] fixed spacing in sha1 comment (#4540) --- projects/Notepad++/raylib_npp_parser/raylib_to_parse.h | 2 +- src/raylib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 19bf37135..3467e21db 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -190,7 +190,7 @@ RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outpu RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) -RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) // Automation events functionality diff --git a/src/raylib.h b/src/raylib.h index e548f6def..56abfa7a5 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1152,7 +1152,7 @@ RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outpu RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) -RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) // Automation events functionality From c53dd8a9310ad34f730ea853478dc77c8caff23d Mon Sep 17 00:00:00 2001 From: Leonardo Guilherme de Freitas Date: Wed, 27 Nov 2024 07:39:36 -0300 Subject: [PATCH 155/155] [build][cmake] Improve cmake config file generation (#4541) * Improve cmake config file generation This allows for finding raylib on a non-standard location (eg, not in /usr/lib{,64}) * Only have glfw as private if using internal glfw and not static --- cmake/GlfwImport.cmake | 10 +++- cmake/InstallConfigurations.cmake | 4 +- cmake/LibraryConfigurations.cmake | 4 -- cmake/SetupCmakeConfig.cmake | 23 +++++++++ cmake/raylib-config-version.cmake | 21 -------- cmake/raylib-config.cmake | 80 +------------------------------ src/CMakeLists.txt | 11 ++++- 7 files changed, 43 insertions(+), 110 deletions(-) create mode 100644 cmake/SetupCmakeConfig.cmake delete mode 100644 cmake/raylib-config-version.cmake diff --git a/cmake/GlfwImport.cmake b/cmake/GlfwImport.cmake index 4a5ef8c60..f10257c3d 100644 --- a/cmake/GlfwImport.cmake +++ b/cmake/GlfwImport.cmake @@ -12,12 +12,18 @@ endif() # Also adding only on desktop (web also uses glfw but it is more limited and is added using an emcc linker flag) if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MATCHES "Desktop") MESSAGE(STATUS "Using raylib's GLFW") + set(INTERNAL_GLFW ON CACHE INTERNAL "" FORCE) set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) set(GLFW_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE) - + + + if (NOT BUILD_SHARED_LIBS) + message(STATUS "Enabling install of GLFW static libs because raylib will be built statically") + set(GLFW_INSTALL ON CACHE BOOL "" FORCE) + endif () add_subdirectory(external/glfw) @@ -25,7 +31,7 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT if (BUILD_SHARED_LIBS) set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden) endif() - + list(APPEND raylib_sources $) include_directories(BEFORE SYSTEM external/glfw/include) elseif("${PLATFORM}" STREQUAL "DRM") diff --git a/cmake/InstallConfigurations.cmake b/cmake/InstallConfigurations.cmake index 6c606e565..e0f84a152 100644 --- a/cmake/InstallConfigurations.cmake +++ b/cmake/InstallConfigurations.cmake @@ -18,10 +18,8 @@ endif () join_paths(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}") join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}") configure_file(../raylib.pc.in raylib.pc @ONLY) -configure_file(../cmake/raylib-config-version.cmake raylib-config-version.cmake @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib") -install(FILES ${PROJECT_SOURCE_DIR}/../cmake/raylib-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib") +include(SetupCmakeConfig) # populates raylib_{FOUND, INCLUDE_DIRS, LIBRARIES, LDFLAGS, DEFINITIONS} include(PopulateConfigVariablesLocally) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index fb7898306..6206928cb 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -125,7 +125,3 @@ if (NOT GRAPHICS) endif () set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY}) - -if (${PLATFORM} MATCHES "Desktop") - set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) -endif () diff --git a/cmake/SetupCmakeConfig.cmake b/cmake/SetupCmakeConfig.cmake new file mode 100644 index 000000000..ba0929514 --- /dev/null +++ b/cmake/SetupCmakeConfig.cmake @@ -0,0 +1,23 @@ +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) + +# Setup install of exported targets +install(EXPORT raylib-targets + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/raylib +) + +# Macro to write config +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake" + VERSION ${raylib_VERSION} + COMPATIBILITY SameMajorVersion +) + +# Setup install of version config +install( + FILES + "../cmake/raylib-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake" + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/cmake/raylib +) diff --git a/cmake/raylib-config-version.cmake b/cmake/raylib-config-version.cmake deleted file mode 100644 index 74fd03ccc..000000000 --- a/cmake/raylib-config-version.cmake +++ /dev/null @@ -1,21 +0,0 @@ -set(PACKAGE_VERSION "@PROJECT_VERSION@") - -if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) -endif() -if(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - set(PACKAGE_VERSION_COMPATIBLE TRUE) -else(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") - return() -endif() - -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff --git a/cmake/raylib-config.cmake b/cmake/raylib-config.cmake index 700965c95..17fefd81e 100644 --- a/cmake/raylib-config.cmake +++ b/cmake/raylib-config.cmake @@ -1,79 +1 @@ -# - Try to find raylib -# Options: -# raylib_USE_STATIC_LIBS - OFF by default -# raylib_VERBOSE - OFF by default -# Once done, this defines a raylib target that can be passed to -# target_link_libraries as well as following variables: -# -# raylib_FOUND - System has raylib installed -# raylib_INCLUDE_DIRS - The include directories for the raylib header(s) -# raylib_LIBRARIES - The libraries needed to use raylib -# raylib_LDFLAGS - The linker flags needed with raylib -# raylib_DEFINITIONS - Compiler switches required for using raylib - -if (NOT TARGET raylib) - set(XPREFIX PC_RAYLIB) - - find_package(PkgConfig QUIET) - pkg_check_modules(${XPREFIX} QUIET raylib) - - if (raylib_USE_STATIC_LIBS) - set(XPREFIX ${XPREFIX}_STATIC) - endif() - - set(raylib_DEFINITIONS ${${XPREFIX}_CFLAGS}) - - find_path(raylib_INCLUDE_DIR - NAMES raylib.h - HINTS ${${XPREFIX}_INCLUDE_DIRS} - ) - - set(RAYLIB_NAMES raylib) - - if (raylib_USE_STATIC_LIBS) - set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES}) - endif() - - find_library(raylib_LIBRARY - NAMES ${RAYLIB_NAMES} - HINTS ${${XPREFIX}_LIBRARY_DIRS} - ) - - set(raylib_LIBRARIES ${raylib_LIBRARY}) - set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS}) - set(raylib_LIBRARY_DIR ${raylib_LIBRARY_DIRS}) - set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR}) - set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS}) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(raylib DEFAULT_MSG - raylib_LIBRARY - raylib_INCLUDE_DIR - ) - - mark_as_advanced(raylib_LIBRARY raylib_INCLUDE_DIR) - - if (raylib_USE_STATIC_LIBS) - add_library(raylib STATIC IMPORTED GLOBAL) - else() - add_library(raylib SHARED IMPORTED GLOBAL) - endif() - string (REPLACE ";" " " raylib_LDFLAGS "${raylib_LDFLAGS}") - - set_target_properties(raylib - PROPERTIES - IMPORTED_LOCATION "${raylib_LIBRARIES}" - IMPORTED_IMPLIB "${raylib_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${raylib_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${raylib_LDFLAGS}" - INTERFACE_COMPILE_OPTIONS "${raylib_DEFINITIONS}" - ) - - if (raylib_VERBOSE) - message(STATUS "raylib_FOUND: ${raylib_FOUND}") - message(STATUS "raylib_INCLUDE_DIRS: ${raylib_INCLUDE_DIRS}") - message(STATUS "raylib_LIBRARIES: ${raylib_LIBRARIES}") - message(STATUS "raylib_LDFLAGS: ${raylib_LDFLAGS}") - message(STATUS "raylib_DEFINITIONS: ${raylib_DEFINITIONS}") - endif() -endif() +include("${CMAKE_CURRENT_LIST_DIR}/raylib-targets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9735e267f..12cc24347 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,7 +90,16 @@ if (BUILD_SHARED_LIBS) set_property(TARGET raylib PROPERTY C_VISIBILITY_PRESET hidden) endif () -target_link_libraries(raylib "${LIBS_PRIVATE}") + +# If building as a static lib *AND* using internal GLFW we +# need to set it up as a PRIVATE import so cmake doesn't complain +# it isn't declared on an install rule +if (INTERNAL_GLFW AND BUILD_SHARED_LIBS) + target_link_libraries(raylib PRIVATE glfw) +endif() + +target_link_libraries(raylib PUBLIC "${LIBS_PRIVATE}") + # Sets some compile time definitions for the pre-processor # If CUSTOMIZE_BUILD option is on you will not use config.h by default