From 28bca2791727faafcdae4c5d8aa77a0cad75da46 Mon Sep 17 00:00:00 2001 From: Nickolas McDonald <43690021+n77y@users.noreply.github.com> Date: Wed, 26 Jul 2023 15:55:00 -0400 Subject: [PATCH 1/3] Add managed methods for updating textures (#177) --- Raylib-cs/types/Raylib.Utils.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 9231fb6..1f77bb8 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -652,6 +652,36 @@ namespace Raylib_cs return LoadTexture(str1.AsPointer()); } + /// Update GPU texture with new data + public static void UpdateTexture(Texture2D texture, T[] pixels) where T : unmanaged + { + UpdateTexture(texture, (ReadOnlySpan)pixels); + } + + /// Update GPU texture with new data + public static void UpdateTexture(Texture2D texture, ReadOnlySpan pixels) where T : unmanaged + { + fixed (void* pixelPtr = pixels) + { + UpdateTexture(texture, pixelPtr); + } + } + + /// Update GPU texture rectangle with new data + public static void UpdateTextureRec(Texture2D texture, Rectangle rec, T[] pixels) where T : unmanaged + { + UpdateTextureRec(texture, rec, (ReadOnlySpan)pixels); + } + + /// Update GPU texture rectangle with new data + public static void UpdateTextureRec(Texture2D texture, Rectangle rec, ReadOnlySpan pixels) where T : unmanaged + { + fixed (void* pixelPtr = pixels) + { + UpdateTextureRec(texture, rec, pixelPtr); + } + } + /// Generate GPU mipmaps for a texture public static void GenTextureMipmaps(ref Texture2D texture) { From 7e0866c2226f609a8b876d743deb5e0c58bb1424 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Thu, 27 Jul 2023 08:24:34 +0100 Subject: [PATCH 2/3] Point release 4.5.0.3 --- .github/ISSUE_TEMPLATE/new-issue-template.md | 12 ++++++++---- README.md | 2 +- Raylib-cs/Raylib-cs.csproj | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/new-issue-template.md b/.github/ISSUE_TEMPLATE/new-issue-template.md index 96d4676..f97c351 100644 --- a/.github/ISSUE_TEMPLATE/new-issue-template.md +++ b/.github/ISSUE_TEMPLATE/new-issue-template.md @@ -1,7 +1,7 @@ --- name: new issue template about: generic template for new issues -title: "[module] Short description of the issue/bug/feature" +title: "Short description of the issue/bug/feature" labels: '' assignees: '' --- @@ -14,11 +14,14 @@ Before submitting a new issue, please verify and check: ### Issue description -*Briefly describe the issue you are experiencing (or the feature you want to see added to Raylib-cs). Tell us what you were trying to do and what happened instead. You can also ask questions on the [raylib discord server](https://discord.gg/raylib).* +*Briefly describe the issue you are experiencing (or the feature you want to see added to Raylib-cs). Tell us +what you were trying to do and what happened instead. You can also ask questions on the +[raylib discord server](https://discord.gg/raylib).* ### Environment -*Provide your Platform, Operating System, OpenGL version, GPU, Raylib-cs version, Raylib version (if applicable), and details of where or how you experienced the issue.* +*Provide your Platform, Operating System, OpenGL version, GPU, Raylib-cs version, Raylib version (if applicable), +and details of where or how you experienced the issue.* ### Issue screenshot @@ -26,4 +29,5 @@ Before submitting a new issue, please verify and check: ### Code example -*Provide minimal reproduction code to test the issue. Please, format the code properly and try to keep it as simple as possible, just focusing on the experienced issue.* +*Provide minimal reproduction code to test the issue. Please, format the code properly and try to keep it as simple +as possible, just focusing on the experienced issue.* diff --git a/README.md b/README.md index 416edf3..56c0c71 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Raylib-cs targets net5.0 and net6.0. This is the prefered method to get started. ``` -dotnet add package Raylib-cs --version 4.5.0.2 +dotnet add package Raylib-cs ``` [![NuGet](https://img.shields.io/nuget/dt/raylib-cs)](https://www.nuget.org/packages/Raylib-cs/) diff --git a/Raylib-cs/Raylib-cs.csproj b/Raylib-cs/Raylib-cs.csproj index 3e1039b..e0db93b 100644 --- a/Raylib-cs/Raylib-cs.csproj +++ b/Raylib-cs/Raylib-cs.csproj @@ -12,8 +12,8 @@ 4.5.0 - 4.5.0.2 - 4.5.0.2 + 4.5.0.3 + 4.5.0.3 Chris Dill, Raysan5 true true From 083a776aee2d453605772917609ef6fcde1774e2 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Sat, 5 Aug 2023 00:04:42 +0200 Subject: [PATCH 3/3] Adding a string method for `OpenURL` and `SetGamepadMappings` (#180) --- Raylib-cs/types/Raylib.Utils.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 1f77bb8..db4c676 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -38,6 +38,20 @@ namespace Raylib_cs using var str1 = text.ToUTF8Buffer(); SetClipboardText(str1.AsPointer()); } + + /// Open URL with default system browser (if available) + public static void OpenURL(string url) + { + using var str1 = url.ToUTF8Buffer(); + OpenURL(str1.AsPointer()); + } + + /// Set internal gamepad mappings (SDL_GameControllerDB) + public static int SetGamepadMappings(string mappings) + { + using var str1 = mappings.ToUTF8Buffer(); + return SetGamepadMappings(str1.AsPointer()); + } /// Load shader from files and bind default locations public static Shader LoadShader(string vsFileName, string fsFileName)