diff options
| author | Joel Stålnacke <joel@saker.fi> | 2024-10-11 13:31:44 +0300 |
|---|---|---|
| committer | Joel Stålnacke <joel@saker.fi> | 2024-10-13 13:34:46 +0300 |
| commit | 53a1cdf5bee2955995dfbf441f5354d1dcfc1e0c (patch) | |
| tree | be8c2894226a2b7e1a47f7583f2041df75f795b3 /Djup.Native/LibDjup.cs | |
| parent | 4bac6ae2e725a1997674fd3369bf4ea032235d8b (diff) | |
Add Godot client
Diffstat (limited to 'Djup.Native/LibDjup.cs')
| -rw-r--r-- | Djup.Native/LibDjup.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Djup.Native/LibDjup.cs b/Djup.Native/LibDjup.cs new file mode 100644 index 0000000..fece18a --- /dev/null +++ b/Djup.Native/LibDjup.cs @@ -0,0 +1,36 @@ +using System.Runtime.InteropServices; + +namespace Djup.Native; + +public static partial class LibDjup +{ + const string LibraryName = "djup"; + const string Prefix = "dp_"; + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(hello_world))] + public static partial void hello_world(); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(get_num))] + public static partial int get_num(); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(get_vec2))] + public static partial Vec2 get_vec2(); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(world_create))] + public static partial IntPtr world_create(); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(world_free))] + public static partial void world_free(IntPtr world); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(world_create_entity))] + public static partial int world_create_entity(IntPtr world, EntityKind kind); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(world_find_entity))] + public static unsafe partial Entity* world_find_entity(IntPtr world, int entityId); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(world_remove_entity))] + public static partial void world_remove_entity(IntPtr world, int entityId); + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(world_tick))] + public static partial int world_tick(IntPtr world, double delta); +} |
