2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-09-09 03:01:41 -04:00

Merge branch 'master' into dev

This commit is contained in:
2023-08-07 20:05:03 +01:00
committed by GitHub
5 changed files with 218 additions and 125 deletions

View File

@@ -12,10 +12,12 @@
<PropertyGroup>
<TargetRaylibTag>4.5.0</TargetRaylibTag>
<Version>4.5.0.2</Version>
<PackageVersion>4.5.0.2</PackageVersion>
<Version>4.5.0.3</Version>
<PackageVersion>4.5.0.3</PackageVersion>
<Authors>Chris Dill, Raysan5</Authors>
<PackProject>true</PackProject>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageLicenseExpression>Zlib</PackageLicenseExpression>
<Title>Raylib-cs</Title>
<Description>C# bindings for raylib - A simple and easy-to-use library to learn videogames programming</Description>
@@ -23,6 +25,7 @@
<PackageTags>raylib;bindings;gamedev</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ChrisDill/Raylib-cs/</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://www.raylib.com/</PackageProjectUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -35,6 +38,7 @@
<ItemGroup>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>

View File

@@ -38,6 +38,20 @@ namespace Raylib_cs
using var str1 = text.ToUTF8Buffer();
SetClipboardText(str1.AsPointer());
}
/// <summary>Open URL with default system browser (if available)</summary>
public static void OpenURL(string url)
{
using var str1 = url.ToUTF8Buffer();
OpenURL(str1.AsPointer());
}
/// <summary>Set internal gamepad mappings (SDL_GameControllerDB)</summary>
public static int SetGamepadMappings(string mappings)
{
using var str1 = mappings.ToUTF8Buffer();
return SetGamepadMappings(str1.AsPointer());
}
/// <summary>Load shader from files and bind default locations</summary>
public static Shader LoadShader(string vsFileName, string fsFileName)
@@ -652,6 +666,36 @@ namespace Raylib_cs
return LoadTexture(str1.AsPointer());
}
/// <summary>Update GPU texture with new data</summary>
public static void UpdateTexture<T>(Texture2D texture, T[] pixels) where T : unmanaged
{
UpdateTexture(texture, (ReadOnlySpan<T>)pixels);
}
/// <summary>Update GPU texture with new data</summary>
public static void UpdateTexture<T>(Texture2D texture, ReadOnlySpan<T> pixels) where T : unmanaged
{
fixed (void* pixelPtr = pixels)
{
UpdateTexture(texture, pixelPtr);
}
}
/// <summary>Update GPU texture rectangle with new data</summary>
public static void UpdateTextureRec<T>(Texture2D texture, Rectangle rec, T[] pixels) where T : unmanaged
{
UpdateTextureRec(texture, rec, (ReadOnlySpan<T>)pixels);
}
/// <summary>Update GPU texture rectangle with new data</summary>
public static void UpdateTextureRec<T>(Texture2D texture, Rectangle rec, ReadOnlySpan<T> pixels) where T : unmanaged
{
fixed (void* pixelPtr = pixels)
{
UpdateTextureRec(texture, rec, pixelPtr);
}
}
/// <summary>Generate GPU mipmaps for a texture</summary>
public static void GenTextureMipmaps(ref Texture2D texture)
{