Skip to content

Commit

Permalink
Update to Raylib-5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MrScautHD committed Jul 7, 2024
1 parent ab329d8 commit a754910
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches: [ "main" ]

env:
raylib_version: 'a3ef381b3e55cd2a7cf2a521f136330a295c5a9d'
raylib_version: 'a8240722c61d216d96c3f2cab27426ee7b7a3919'

jobs:

Expand Down
2 changes: 1 addition & 1 deletion src/Raylib-CSharp.Samples/CMake.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<RlVersion>a3ef381b3e55cd2a7cf2a521f136330a295c5a9d</RlVersion>
<RlVersion>a8240722c61d216d96c3f2cab27426ee7b7a3919</RlVersion>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
Expand Down
2 changes: 1 addition & 1 deletion src/Raylib-CSharp.Test/CMake.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<RlVersion>a3ef381b3e55cd2a7cf2a521f136330a295c5a9d</RlVersion>
<RlVersion>a8240722c61d216d96c3f2cab27426ee7b7a3919</RlVersion>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
Expand Down
10 changes: 10 additions & 0 deletions src/Raylib-CSharp/Apis/RaylibApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4013,6 +4013,16 @@ internal static partial class RaylibApi {
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
internal static partial Image ImageTextEx(Font font, string text, float fontSize, float spacing, Color tint);

/// <summary>
/// Create an image from a selected channel of another image (GRAYSCALE).
/// </summary>
/// <param name="image">The input Image.</param>
/// <param name="selectedChannel">The index of the channel to extract (0 for red, 1 for green, 2 for blue, 3 for alpha).</param>
/// <returns>The Image containing only the selected channel.</returns>
[LibraryImport(Raylib.Name)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
internal static partial Image ImageFromChannel(Image image, int selectedChannel);

/// <summary>
/// Unload color data loaded with LoadImageColors().
/// </summary>
Expand Down
15 changes: 10 additions & 5 deletions src/Raylib-CSharp/Images/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public static Image GenText(int width, int height, string text) {
return RaylibApi.GenImageText(width, height, text);
}

/// <inheritdoc cref="RaylibApi.ImageFromImage" />
public static Image FromImage(Image image, Rectangle rec) {
return RaylibApi.ImageFromImage(image, rec);
}

/// <inheritdoc cref="RaylibApi.ImageText" />
public static Image FromText(string text, int fontSize, Color color) {
return RaylibApi.ImageText(text, fontSize, color);
Expand All @@ -135,6 +140,11 @@ public static Image FromTextEx(Font font, string text, float fontSize, float spa
return RaylibApi.ImageTextEx(font, text, fontSize, spacing, tint);
}

/// <inheritdoc cref="RaylibApi.ImageFromChannel" />
public static Image FromChannel(Image image, int selectedChannel) {
return RaylibApi.ImageFromChannel(image, selectedChannel);
}

/// <inheritdoc cref="RaylibApi.UnloadImageColors" />
public static unsafe void UnloadColors(ReadOnlySpan<Color> colors) {
fixed (Color* colorPtr = colors) {
Expand Down Expand Up @@ -179,11 +189,6 @@ public Image Copy() {
return RaylibApi.ImageCopy(this);
}

/// <inheritdoc cref="RaylibApi.ImageFromImage" />
public Image FromImage(Rectangle rec) {
return RaylibApi.ImageFromImage(this, rec);
}

/// <inheritdoc cref="RaylibApi.ImageFormat" />
public void FromFormat(PixelFormat newFormat) {
RaylibApi.ImageFormat(ref this, newFormat);
Expand Down
2 changes: 1 addition & 1 deletion src/Raylib-CSharp/Raylib-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PropertyGroup>
<Title>Raylib-CSharp</Title>
<Authors>MrScautHD</Authors>
<Version>4.1.4</Version>
<Version>4.1.6</Version>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
Expand Down
4 changes: 2 additions & 2 deletions src/Raylib-CSharp/Raylib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public static class Raylib {

public const string Name = "raylib";

public static readonly Version Version = new(4, 1, 4);
public static readonly Version RlVersion = new(5, 1, 0);
public static readonly Version Version = new(4, 1, 6);
public static readonly Version RlVersion = new(5, 5, 0);

/// <inheritdoc cref="RaylibApi.TakeScreenshot" />
public static void TakeScreenshot(string path) {
Expand Down

0 comments on commit a754910

Please sign in to comment.