mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
33 lines
893 B
C#
33 lines
893 B
C#
using System.Reflection;
|
|
|
|
namespace Dalamud.Bindings.ImPlot
|
|
{
|
|
using HexaGen.Runtime;
|
|
using System.Diagnostics;
|
|
|
|
public static class ImPlotConfig
|
|
{
|
|
public static bool AotStaticLink;
|
|
}
|
|
|
|
public static unsafe partial class ImPlot
|
|
{
|
|
static ImPlot()
|
|
{
|
|
if (ImPlotConfig.AotStaticLink)
|
|
{
|
|
InitApi(new NativeLibraryContext(Process.GetCurrentProcess().MainModule!.BaseAddress));
|
|
}
|
|
else
|
|
{
|
|
// InitApi(new NativeLibraryContext(LibraryLoader.LoadLibrary(GetLibraryName, null)));
|
|
InitApi(new NativeLibraryContext(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)!, GetLibraryName() + ".dll")));
|
|
}
|
|
}
|
|
|
|
public static string GetLibraryName()
|
|
{
|
|
return "cimplot";
|
|
}
|
|
}
|
|
}
|