Watch
2
0
Fork
You've already forked raylib-cs
0

fix: centralized version data in Directory.build.props, and fixed various interop details that had incorrect function signatures

This commit is contained in:
tiger tiger tiger 2026-06-30 17:12:15 +02:00
commit 3b305013a1
11 changed files with 169 additions and 105 deletions

View file

@ -26,7 +26,14 @@ public static unsafe partial class Raylib
static Raylib()
{
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), ResolveDllImport);
// On WebAssembly (browser) the native library is statically linked into the main
// module, and P/Invokes are resolved by the runtime's built-in static-linking table.
// A custom resolver would override that and fail (there is no library to load), so we
// only install it on platforms where raylib is a separate dynamic library.
if (!OperatingSystem.IsBrowser())
{
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), ResolveDllImport);
}
}
public static IntPtr ResolveDllImport(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)

View file

@ -744,7 +744,7 @@ public static unsafe partial class Rlgl
/// <summary>Load depth texture/renderbuffer (to be attached to fbo)</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlLoadTextureDepth")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial uint LoadTextureDepth(int width, int height, CBool useRenderBuffer);
public static partial uint LoadTextureDepth(int width, int height, int useRenderBuffer);
/// <summary>Load texture cubemap data</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlLoadTextureCubemap")]
@ -813,15 +813,15 @@ public static unsafe partial class Rlgl
public static partial void FramebufferAttach(
uint fboId,
uint texId,
FramebufferAttachType attachType,
FramebufferAttachTextureType texType,
int attachType,
int texType,
int mipLevel
);
/// <summary>Verify framebuffer is complete</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlFramebufferComplete")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial CBool FramebufferComplete(uint id);
public static partial int FramebufferComplete(uint id);
/// <summary>Delete framebuffer from GPU</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlUnloadFramebuffer")]