mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
32
Brutal.Box2D/Box2D.cs
Normal file
32
Brutal.Box2D/Box2D.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Brutal.Box2DApi;
|
||||
|
||||
/// <summary>
|
||||
/// A 2D physics engine.
|
||||
/// </summary>
|
||||
public static partial class Box2D
|
||||
{
|
||||
private const string Dll =
|
||||
#if DEBUG
|
||||
"box2dd";
|
||||
#else
|
||||
"box2d";
|
||||
#endif
|
||||
|
||||
static Box2D()
|
||||
{
|
||||
// Load the GLFW native library
|
||||
var glfwNative = NativeLibrary.Load(Dll, typeof(Box2D).Assembly, DllImportSearchPath.AssemblyDirectory);
|
||||
|
||||
// Assign the native library to the assembly resolver
|
||||
NativeLibrary.SetDllImportResolver(
|
||||
typeof(Box2D).Assembly,
|
||||
(libraryName, _, _) =>
|
||||
{
|
||||
return glfwNative;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue