Skip to content

Commit d61ff42

Browse files
committed
Fix for native AOT and for other os than win, linux and osx.
1 parent c8f85b8 commit d61ff42

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Hexa.NET.Raylib/Generated/Functions.VT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public unsafe partial class Raylib
2121

2222
public static void InitApi()
2323
{
24-
vt = new VTable(LibraryLoader.LoadLibrary(), 713);
24+
vt = new VTable(LibraryLoader.LoadLibrary(GetLibraryName, null), 713);
2525
vt.Load(0, "InitWindow");
2626
vt.Load(1, "CloseWindow");
2727
vt.Load(2, "WindowShouldClose");

Hexa.NET.Raylib/Hexa.NET.Raylib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<PackageReference Include="HexaGen.Runtime" Version="1.1.8" />
32+
<PackageReference Include="HexaGen.Runtime" Version="1.1.9" />
3333
</ItemGroup>
3434

3535
<ItemGroup>

Hexa.NET.Raylib/Raylib.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
namespace Hexa.NET.Raylib
22
{
3+
using System.Runtime.InteropServices;
4+
35
public partial class Raylib
46
{
57
static Raylib()
@@ -33,5 +35,14 @@ static Raylib()
3335
public static readonly Color Blank = new Color(0, 0, 0, 0); // Transparent
3436
public static readonly Color Magenta = new Color(255, 0, 255, 255);
3537
public static readonly Color RayWhite = new Color(245, 245, 245, 255);
38+
39+
internal static string GetLibraryName()
40+
{
41+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
42+
{
43+
return "raylib";
44+
}
45+
return "libraylib";
46+
}
3647
}
3748
}

0 commit comments

Comments
 (0)