From 86338960b1974162a8dbe2edb26154d79aa1dfa9 Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Thu, 23 Jun 2022 20:12:08 -0400 Subject: [PATCH 1/8] Work in progress for `hello_world` example --- ext/flecs | 2 +- flecs.props | 3 +- .../examples/flecs-01_hello_world/Program.cs | 115 +++++++------ src/cs/production/flecs/CLibrary.cs | 93 +++++++++++ src/cs/production/flecs/Iterator.cs | 25 +++ .../flecs/SystemBindingContextHelper.cs | 40 +++++ src/cs/production/flecs/SystemCallback.cs | 3 + src/cs/production/flecs/World.cs | 151 ++++++++++++++++++ src/cs/production/flecs/flecs.Extensions.cs | 73 +-------- src/cs/production/flecs/flecs.csproj | 10 +- 10 files changed, 381 insertions(+), 134 deletions(-) create mode 100644 src/cs/production/flecs/CLibrary.cs create mode 100644 src/cs/production/flecs/Iterator.cs create mode 100644 src/cs/production/flecs/SystemBindingContextHelper.cs create mode 100644 src/cs/production/flecs/SystemCallback.cs create mode 100644 src/cs/production/flecs/World.cs diff --git a/ext/flecs b/ext/flecs index 60d1e20..1f622d0 160000 --- a/ext/flecs +++ b/ext/flecs @@ -1 +1 @@ -Subproject commit 60d1e200344f40a901ecca151eae650cc405428a +Subproject commit 1f622d0a246e607a895e87eafadca2a2f9a70832 diff --git a/flecs.props b/flecs.props index e414380..9af67e7 100644 --- a/flecs.props +++ b/flecs.props @@ -6,10 +6,11 @@ <_LibraryDirectoryPath>$(_GitDirectoryPath)/lib <_SourceCodeDirectoryPath>$(_GitDirectoryPath)/src/cs/production/$(_LibraryName)/ <_LinkDirectoryPath>$(_LibraryName)/ + <_IsEnabledSourceCode Condition=" '$(_IsEnabledSourceCode)' == '' ">true - + false $(_LinkDirectoryPath)/%(RecursiveDir)%(Filename)%(Extension) diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index 5988db0..d76650b 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -1,61 +1,8 @@ using System.Runtime.InteropServices; -using static flecs_hub.flecs; - -internal static unsafe class Program -{ - /* Move system implementation. System callbacks may be called multiple times, - * as entities are grouped by which components they have, and each group has - * its own set of component arrays. */ - [UnmanagedCallersOnly] - private static void Move(ecs_iter_t *it) - { - var p = ecs_term(it, 1); - var v = ecs_term(it, 2); - - // /* Print the set of components for the iterated over entities */ - // var typeString = (string)ecs_table_str(it->world, it->table); - // Console.WriteLine("Move entities with [{0}]", typeString); - // flecs.ecs_os_free(typeString); - - /* Iterate entities for the current group */ - for (var i = 0; i < it->count; i ++) - { - p[i].X += v[i].X; - p[i].Y += v[i].Y; - } - } - - private static int Main(string[] args) - { - /* Create the world, pass arguments for overriding the number of threads,fps - * or for starting the admin dashboard (see flecs.h for details). */ - var world = ecs_init_w_args(args); - - /* Register a component with the world. */ - var component = ecs_component_init(world); - - /* Create a new empty entity */ - Span entityComponentIds = stackalloc ecs_id_t[] { component }; - var entity = ecs_entity_init(world, Entities.MyEntity, entityComponentIds); - - /* Set the Position component on the entity */ - var position = new Position - { - X = 10, - Y = 20 - }; - ecs_set_id(world, entity, component, ref position); - - /* Get the Position component */ - var p = ecs_get_id(world, entity, component); - - var name = ecs_get_name(world, entity); - Console.WriteLine($"Position of {name} is {p.X}, {p.Y}"); - - /* Cleanup */ - return ecs_fini(world); - } +using flecs_hub; +internal static class Program +{ [StructLayout(LayoutKind.Sequential)] // Necessary so the C# compiler is not allowed to reorganize the struct public struct Position { @@ -69,9 +16,61 @@ public struct Velocity public double X; public double Y; } + + // Move system implementation. System callbacks may be called multiple times, as entities are grouped by which + // components they have, and each group has its own set of component arrays. + public static void Move(Iterator iterator) + { + var p = iterator.Term(1); + var v = iterator.Term(2); + + // // Print the set of components for the iterated over entities + // var typeString = ecs_table_str(it->world, it->table).ToString(); + // Console.WriteLine("Move entities with " + typeString); + // // ecs_os_free(type_str); + + // Iterate entities for the current group + for (var i = 0; i < iterator.Count; i ++) + { + ref var position = ref p[i]; + ref var velocity = ref v[i]; + + position.X += velocity.X; + position.Y += velocity.Y; + } + } - private static class Entities + private static int Main(string[] args) { - public static readonly Runtime.CString MyEntity = "MyEntity"; + // Create the world + var world = new World(args); + + // Register components + var componentPosition = world.RegisterComponent(); + var componentVelocity = world.RegisterComponent(); + + // Register system + world.RegisterSystem(Move, "Position, Velocity"); + + // Register tags (components without a size) + var eats = world.Tag("eats"); + var apples = world.Tag("apples"); + var pears = world.Tag("pears"); + + // Create an entity with name Bob, add Position and food preference + var bob = world.CreateEntity("Bob"); + world.SetComponent(bob, componentPosition, new Position { X = 0, Y = 0 }); + world.SetComponent(bob, componentVelocity, new Velocity { X = 2, Y = 2 }); + world.AddPair(bob, eats, apples); + + // Run systems twice. Usually this function is called once per frame + world.Progress(0); + world.Progress(0); + + // See if Bob has moved (he has) + var p = world.GetComponent(bob, componentPosition); + Console.WriteLine("Bob's position is {" + p.X + ", " + p.Y + "}"); + + return world.Fini(); } } diff --git a/src/cs/production/flecs/CLibrary.cs b/src/cs/production/flecs/CLibrary.cs new file mode 100644 index 0000000..4292478 --- /dev/null +++ b/src/cs/production/flecs/CLibrary.cs @@ -0,0 +1,93 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +namespace flecs_hub; + +public static class CLibrary +{ + public static IntPtr Load(string name) + { + if (IsLinux) return libdl.dlopen(name, 0x101); // RTLD_GLOBAL | RTLD_LAZY + if (IsWindows) return Kernel32.LoadLibrary(name); + if (IsDarwin) return libSystem.dlopen(name, 0x101); // RTLD_GLOBAL | RTLD_LAZY + return IntPtr.Zero; + } + + public static void Free(IntPtr handle) + { + if (IsLinux) libdl.dlclose(handle); + if (IsWindows) Kernel32.FreeLibrary(handle); + if (IsDarwin) libSystem.dlclose(handle); + } + + public static IntPtr GetExport(IntPtr handle, string symbolName) + { + if (IsLinux) return libdl.dlsym(handle, symbolName); + if (IsWindows) return Kernel32.GetProcAddress(handle, symbolName); + if (IsDarwin) return libSystem.dlsym(handle, symbolName); + return IntPtr.Zero; + } + + private static bool IsWindows + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + } + + private static bool IsDarwin + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + } + + private static bool IsLinux + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + } + + [SuppressUnmanagedCodeSecurity] + public static class libdl + { + private const string LibraryName = "libdl"; + + [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] + public static extern IntPtr dlopen(string fileName, int flags); + + [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] + public static extern IntPtr dlsym(IntPtr handle, string name); + + [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall)] + public static extern int dlclose(IntPtr handle); + } + + [SuppressUnmanagedCodeSecurity] + internal static class libSystem + { + private const string LibraryName = "libSystem"; + + [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] + public static extern IntPtr dlopen(string fileName, int flags); + + [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] + public static extern IntPtr dlsym(IntPtr handle, string name); + + [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall)] + public static extern int dlclose(IntPtr handle); + } + + [SuppressUnmanagedCodeSecurity] + private static class Kernel32 + { + [DllImport("kernel32", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)] + public static extern IntPtr LoadLibrary(string fileName); + + [DllImport("kernel32", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)] + public static extern IntPtr GetProcAddress(IntPtr module, string procName); + + [DllImport("kernel32", CallingConvention = CallingConvention.StdCall, SetLastError = true)] + public static extern int FreeLibrary(IntPtr module); + } +} diff --git a/src/cs/production/flecs/Iterator.cs b/src/cs/production/flecs/Iterator.cs new file mode 100644 index 0000000..004e3c0 --- /dev/null +++ b/src/cs/production/flecs/Iterator.cs @@ -0,0 +1,25 @@ +using System; +using System.Runtime.CompilerServices; + +namespace flecs_hub; +using static flecs; + +public readonly unsafe struct Iterator +{ + private readonly ecs_iter_t* _handle; + + public int Count => _handle->count; + + internal Iterator(ecs_iter_t* it) + { + _handle = it; + } + + public Span Term(int index) + where T : unmanaged + { + var structSize = Unsafe.SizeOf(); + var pointer = ecs_term_w_size(_handle, (ulong) structSize, index); + return new Span(pointer, _handle->count); + } +} diff --git a/src/cs/production/flecs/SystemBindingContextHelper.cs b/src/cs/production/flecs/SystemBindingContextHelper.cs new file mode 100644 index 0000000..2aa91c1 --- /dev/null +++ b/src/cs/production/flecs/SystemBindingContextHelper.cs @@ -0,0 +1,40 @@ +using System; +using System.Threading; + +namespace flecs_hub; + +internal static class SystemBindingContextHelper +{ + private static SystemBindingContextData[] _bindingContextInstances = new SystemBindingContextData[512]; + private static int _systemsCount; + + public static IntPtr CreateSystemBindingContext(SystemCallback callback) + { + var data = new SystemBindingContextData(callback); + var count = Interlocked.Increment(ref _systemsCount); + if (count > _bindingContextInstances.Length) + { + Array.Resize(ref _bindingContextInstances, count * 2); + } + + _bindingContextInstances[count - 1] = data; + var result = (IntPtr)count; + return result; + } + + public static void GetSystemBindingContext(IntPtr pointer, out SystemBindingContextData data) + { + var index = (int)pointer; + data = _bindingContextInstances[index - 1]; + } + + public readonly struct SystemBindingContextData + { + public readonly SystemCallback Callback; + + public SystemBindingContextData(SystemCallback callback) + { + Callback = callback; + } + } +} diff --git a/src/cs/production/flecs/SystemCallback.cs b/src/cs/production/flecs/SystemCallback.cs new file mode 100644 index 0000000..c6034bb --- /dev/null +++ b/src/cs/production/flecs/SystemCallback.cs @@ -0,0 +1,3 @@ +namespace flecs_hub; + +public delegate void SystemCallback(Iterator iterator); diff --git a/src/cs/production/flecs/World.cs b/src/cs/production/flecs/World.cs new file mode 100644 index 0000000..7eaf7be --- /dev/null +++ b/src/cs/production/flecs/World.cs @@ -0,0 +1,151 @@ +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace flecs_hub; +using static flecs; + +public unsafe class World +{ + private readonly IntPtr _libraryHandle; + private readonly ecs_world_t* _worldHandle; + + private readonly ecs_id_t ECS_PAIR; + private readonly ecs_entity_t EcsOnUpdate; + private readonly ecs_entity_t EcsDependsOn; + + public int ExitCode { get; private set; } + + public World(string[] args) + { + _worldHandle = ecs_init_w_args(args); + _libraryHandle = CLibrary.Load("libflecs.dylib"); + + var ecsPair = CLibrary.GetExport(_libraryHandle, "ECS_PAIR"); + ECS_PAIR.Data = (ulong)Marshal.ReadInt64(ecsPair); + + var ecsOnUpdate = CLibrary.GetExport(_libraryHandle, "EcsOnUpdate"); + EcsOnUpdate.Data.Data = (ulong)Marshal.ReadInt64(ecsOnUpdate); + + var ecsDependsOn = CLibrary.GetExport(_libraryHandle, "EcsDependsOn"); + EcsDependsOn.Data.Data = (ulong)Marshal.ReadInt64(ecsDependsOn); + } + + public int Fini() + { + CLibrary.Free(_libraryHandle); + var exitCode = ecs_fini(_worldHandle); + return exitCode; + } + + public ecs_entity_t RegisterComponent() + where TComponent : unmanaged + { + var componentType = typeof(TComponent); + var componentName = componentType.Name; + var componentNameC = Runtime.CStrings.CString(componentName); + var structLayoutAttribute = componentType.StructLayoutAttribute; + var structSize = Unsafe.SizeOf(); + var structAlignment = structLayoutAttribute!.Pack; + + var id = new ecs_entity_t(); + ecs_component_desc_t desc; + desc.entity.entity = id; + desc.entity.name = componentNameC; + desc.entity.symbol = componentNameC; + desc.type.size = structSize; + desc.type.alignment = structAlignment; + id = ecs_component_init(_worldHandle, &desc); + Debug.Assert(id.Data.Data != 0, "ECS_INVALID_PARAMETER"); + return id; + } + + public ref T GetComponent(ecs_entity_t entity, ecs_id_t id) + where T : unmanaged + { + var pointer = ecs_get_id(_worldHandle, entity, id); + return ref Unsafe.AsRef(pointer); + } + + public ecs_entity_t SetComponent(ecs_entity_t entity, ecs_id_t componentId, ref TComponent component) + where TComponent : unmanaged + { + var structSize = Unsafe.SizeOf(); + var pointer = Unsafe.AsPointer(ref component); + var result = ecs_set_id(_worldHandle, entity, componentId, (ulong)structSize, pointer); + return result; + } + + public ecs_entity_t SetComponent(ecs_entity_t entity, ecs_id_t componentId, TComponent component) + where TComponent : unmanaged + { + var result = SetComponent(entity, componentId, ref component); + return result; + } + + public ecs_entity_t RegisterSystem(SystemCallback callback, string? filterExpression = null) + { + var id = new ecs_entity_t(); + ecs_system_desc_t desc = default; + desc.entity.name = "Test"; + var phase = EcsOnUpdate; + desc.entity.add[0] = phase.Data != 0 ? ecs_pair(EcsDependsOn, phase) : default; + desc.entity.add[1] = phase; + desc.query.filter.expr = filterExpression ?? string.Empty; + desc.callback.Data.Pointer = &SystemCallback; + desc.binding_ctx = (void*)SystemBindingContextHelper.CreateSystemBindingContext(callback); + + id = ecs_system_init(_worldHandle, &desc); + return id; + } + + [UnmanagedCallersOnly] + private static void SystemCallback(ecs_iter_t* it) + { + SystemBindingContextHelper.GetSystemBindingContext((IntPtr)it->binding_ctx, out var data); + + var context = new Iterator(it); + data.Callback(context); + } + + public ecs_entity_t Tag(string name) + { + ecs_entity_desc_t desc = default; + desc.name = name; + var id = ecs_entity_init(_worldHandle, &desc); + Debug.Assert(id.Data != 0, "ECS_INVALID_PARAMETER"); + return id; + } + + public ecs_entity_t CreateEntity(string name) + { + var desc = default(ecs_entity_desc_t); + desc.name = name; + var result = ecs_entity_init(_worldHandle, &desc); + return result; + } + + // #define ecs_pair(pred, obj) (ECS_PAIR | ecs_entity_t_comb(obj, pred)) + + public void AddPair(ecs_entity_t subject, ecs_entity_t relation, ecs_entity_t @object) + { + var id = ecs_pair(relation, @object); + ecs_add_id(_worldHandle, subject, id); + } + + public bool Progress(float deltaTime) + { + return ecs_progress(_worldHandle, deltaTime); + } + + private ulong ecs_pair(ecs_entity_t pred, ecs_entity_t obj) + { + return ECS_PAIR | ecs_entity_t_comb(obj.Data.Data, pred.Data.Data); + } + + private ulong ecs_entity_t_comb(ulong lo, ulong hi) + { + return (hi << 32) + lo; + } +} diff --git a/src/cs/production/flecs/flecs.Extensions.cs b/src/cs/production/flecs/flecs.Extensions.cs index 5434c85..38c5b9d 100644 --- a/src/cs/production/flecs/flecs.Extensions.cs +++ b/src/cs/production/flecs/flecs.Extensions.cs @@ -4,6 +4,7 @@ #nullable enable using System; +using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using static flecs_hub.flecs.Runtime; @@ -12,16 +13,16 @@ namespace flecs_hub { public static unsafe partial class flecs { - public static ecs_world_t* ecs_init_w_args(ReadOnlySpan args) + public static ecs_world_t* ecs_init_w_args(string[] args) { - var argv = CStrings.CStringArray(args); + var argv = args.Length == 0 ? default : CStrings.CStringArray(args); var world = ecs_init_w_args(args.Length, argv); CStrings.FreeCStrings(argv, args.Length); return world; } public static ecs_entity_t ecs_entity_init( - ecs_world_t* world, Runtime.CString name, Span componentIds) + ecs_world_t* world, CString name, Span componentIds) { var entityDescriptor = new ecs_entity_desc_t { @@ -37,72 +38,6 @@ public static ecs_entity_t ecs_entity_init( return ecs_entity_init(world, &entityDescriptor); } - // public static ecs_entity_t ecs_entity_init(ecs_world_t* world, CString name, ecs_id_t componentId) - // { - // var entityDescriptor = new ecs_entity_desc_t - // { - // name = name - // }; - // - // entityDescriptor.add[0] = componentId; - // - // return ecs_entity_init(world, &entityDescriptor); - // } - - public static ecs_entity_t ecs_component_init(ecs_world_t* world) - where TComponent : unmanaged - { - var componentType = typeof(TComponent); - var componentName = componentType.Name; - var componentNameC = CStrings.String(componentName); - var structLayoutAttribute = componentType.StructLayoutAttribute; - CheckStructLayout(structLayoutAttribute); - var structAlignment = structLayoutAttribute!.Pack; - var structSize = Unsafe.SizeOf(); - - var componentDescriptor = new ecs_component_desc_t - { - entity = - { - name = componentNameC, - }, - type = - { - size = structSize, - alignment = structAlignment - } - }; - - return ecs_component_init(world, &componentDescriptor); - } - - public static ecs_entity_t ecs_set_id(ecs_world_t* world, ecs_entity_t entity, ecs_id_t componentId, - ref T component) - where T : unmanaged - { - var componentType = typeof(T); - var structLayoutAttribute = componentType.StructLayoutAttribute; - CheckStructLayout(structLayoutAttribute); - var structSize = Unsafe.SizeOf(); - var pointer = Unsafe.AsPointer(ref component); - return ecs_set_id(world, entity, componentId, (ulong)structSize, pointer); - } - - public static ref readonly T ecs_get_id(ecs_world_t* world, ecs_entity_t entity, ecs_id_t id) - where T : unmanaged - { - var pointer = ecs_get_id(world, entity, id); - return ref Unsafe.AsRef(pointer); - } - - public static Span ecs_term(ecs_iter_t* it, int index) - where T : unmanaged - { - var structSize = Unsafe.SizeOf(); - var pointer = ecs_term_w_size(it, (ulong) structSize, index); - return new Span(pointer, it->count); - } - private static void CheckStructLayout(StructLayoutAttribute? structLayoutAttribute) { if (structLayoutAttribute == null || structLayoutAttribute.Value == LayoutKind.Auto) diff --git a/src/cs/production/flecs/flecs.csproj b/src/cs/production/flecs/flecs.csproj index 652929d..547bd40 100644 --- a/src/cs/production/flecs/flecs.csproj +++ b/src/cs/production/flecs/flecs.csproj @@ -1,10 +1,9 @@ - - - - - + + + <_IsEnabledSourceCode>false + @@ -13,6 +12,7 @@ true flecs_hub false + enable \ No newline at end of file From 03e4ae8f2fe038ae063d3935c40a2cd0a86fd99b Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Thu, 23 Jun 2022 22:30:25 -0400 Subject: [PATCH 2/8] Use `Initialize` instead of `Create`/`Register` --- .../examples/flecs-01_hello_world/Program.cs | 12 ++--- src/cs/production/flecs/World.cs | 54 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index d76650b..61d7c8b 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -46,16 +46,16 @@ private static int Main(string[] args) var world = new World(args); // Register components - var componentPosition = world.RegisterComponent(); - var componentVelocity = world.RegisterComponent(); + var componentPosition = world.InitializeComponent(); + var componentVelocity = world.InitializeComponent(); // Register system - world.RegisterSystem(Move, "Position, Velocity"); + world.InitializeSystem(Move, "Position, Velocity"); // Register tags (components without a size) - var eats = world.Tag("eats"); - var apples = world.Tag("apples"); - var pears = world.Tag("pears"); + var eats = world.InitializeTag("eats"); + var apples = world.InitializeTag("apples"); + var pears = world.InitializeTag("pears"); // Create an entity with name Bob, add Position and food preference var bob = world.CreateEntity("Bob"); diff --git a/src/cs/production/flecs/World.cs b/src/cs/production/flecs/World.cs index 7eaf7be..76ed7a8 100644 --- a/src/cs/production/flecs/World.cs +++ b/src/cs/production/flecs/World.cs @@ -39,7 +39,7 @@ public int Fini() return exitCode; } - public ecs_entity_t RegisterComponent() + public ecs_entity_t InitializeComponent() where TComponent : unmanaged { var componentType = typeof(TComponent); @@ -61,6 +61,31 @@ public ecs_entity_t RegisterComponent() return id; } + public ecs_entity_t InitializeSystem(SystemCallback callback, string? filterExpression = null) + { + var id = new ecs_entity_t(); + ecs_system_desc_t desc = default; + desc.entity.name = "Test"; + var phase = EcsOnUpdate; + desc.entity.add[0] = phase.Data != 0 ? ecs_pair(EcsDependsOn, phase) : default; + desc.entity.add[1] = phase; + desc.query.filter.expr = filterExpression ?? string.Empty; + desc.callback.Data.Pointer = &SystemCallback; + desc.binding_ctx = (void*)SystemBindingContextHelper.CreateSystemBindingContext(callback); + + id = ecs_system_init(_worldHandle, &desc); + return id; + } + + public ecs_entity_t InitializeTag(string name) + { + ecs_entity_desc_t desc = default; + desc.name = name; + var id = ecs_entity_init(_worldHandle, &desc); + Debug.Assert(id.Data != 0, "ECS_INVALID_PARAMETER"); + return id; + } + public ref T GetComponent(ecs_entity_t entity, ecs_id_t id) where T : unmanaged { @@ -84,22 +109,6 @@ public ecs_entity_t SetComponent(ecs_entity_t entity, ecs_id_t compo return result; } - public ecs_entity_t RegisterSystem(SystemCallback callback, string? filterExpression = null) - { - var id = new ecs_entity_t(); - ecs_system_desc_t desc = default; - desc.entity.name = "Test"; - var phase = EcsOnUpdate; - desc.entity.add[0] = phase.Data != 0 ? ecs_pair(EcsDependsOn, phase) : default; - desc.entity.add[1] = phase; - desc.query.filter.expr = filterExpression ?? string.Empty; - desc.callback.Data.Pointer = &SystemCallback; - desc.binding_ctx = (void*)SystemBindingContextHelper.CreateSystemBindingContext(callback); - - id = ecs_system_init(_worldHandle, &desc); - return id; - } - [UnmanagedCallersOnly] private static void SystemCallback(ecs_iter_t* it) { @@ -108,16 +117,7 @@ private static void SystemCallback(ecs_iter_t* it) var context = new Iterator(it); data.Callback(context); } - - public ecs_entity_t Tag(string name) - { - ecs_entity_desc_t desc = default; - desc.name = name; - var id = ecs_entity_init(_worldHandle, &desc); - Debug.Assert(id.Data != 0, "ECS_INVALID_PARAMETER"); - return id; - } - + public ecs_entity_t CreateEntity(string name) { var desc = default(ecs_entity_desc_t); From 6a0bf67e043102c6362d255b40536410c6188067 Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Thu, 23 Jun 2022 22:34:54 -0400 Subject: [PATCH 3/8] Use velocity as readonly --- src/cs/examples/flecs-01_hello_world/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index 61d7c8b..1b14126 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -33,7 +33,7 @@ public static void Move(Iterator iterator) for (var i = 0; i < iterator.Count; i ++) { ref var position = ref p[i]; - ref var velocity = ref v[i]; + var velocity = v[i]; position.X += velocity.X; position.Y += velocity.Y; From 183a5cadeccef9303595c2d3a64fb5a065582150 Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Thu, 23 Jun 2022 22:43:02 -0400 Subject: [PATCH 4/8] Cleanup a bit more --- src/cs/examples/flecs-01_hello_world/Program.cs | 4 ++-- src/cs/production/flecs/World.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index 1b14126..1ed0672 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -30,7 +30,7 @@ public static void Move(Iterator iterator) // // ecs_os_free(type_str); // Iterate entities for the current group - for (var i = 0; i < iterator.Count; i ++) + for (var i = 0; i < iterator.Count; i++) { ref var position = ref p[i]; var velocity = v[i]; @@ -58,7 +58,7 @@ private static int Main(string[] args) var pears = world.InitializeTag("pears"); // Create an entity with name Bob, add Position and food preference - var bob = world.CreateEntity("Bob"); + var bob = world.InitializeEntity("Bob"); world.SetComponent(bob, componentPosition, new Position { X = 0, Y = 0 }); world.SetComponent(bob, componentVelocity, new Velocity { X = 2, Y = 2 }); world.AddPair(bob, eats, apples); diff --git a/src/cs/production/flecs/World.cs b/src/cs/production/flecs/World.cs index 76ed7a8..46ead86 100644 --- a/src/cs/production/flecs/World.cs +++ b/src/cs/production/flecs/World.cs @@ -118,7 +118,7 @@ private static void SystemCallback(ecs_iter_t* it) data.Callback(context); } - public ecs_entity_t CreateEntity(string name) + public ecs_entity_t InitializeEntity(string name) { var desc = default(ecs_entity_desc_t); desc.name = name; From e8bbdedfe1edc941eca09c5402ff0fd47cffa7a2 Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Thu, 23 Jun 2022 23:00:39 -0400 Subject: [PATCH 5/8] Use `flecs` as namespace --- .../examples/flecs-01_hello_world/Program.cs | 9 ++-- src/cs/production/flecs/FlecsException.cs | 2 +- src/cs/production/flecs/Iterator.cs | 4 +- .../flecs/SystemBindingContextHelper.cs | 2 +- src/cs/production/flecs/SystemCallback.cs | 2 +- src/cs/production/flecs/World.cs | 32 +++++++++--- src/cs/production/flecs/flecs.Extensions.cs | 50 ------------------- src/cs/production/flecs/flecs.csproj | 1 - 8 files changed, 34 insertions(+), 68 deletions(-) delete mode 100644 src/cs/production/flecs/flecs.Extensions.cs diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index 1ed0672..4e8bd40 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -1,17 +1,14 @@ -using System.Runtime.InteropServices; -using flecs_hub; +using flecs_hub; internal static class Program { - [StructLayout(LayoutKind.Sequential)] // Necessary so the C# compiler is not allowed to reorganize the struct - public struct Position + struct Position { public double X; public double Y; } - [StructLayout(LayoutKind.Sequential)] // Necessary so the C# compiler is not allowed to reorganize the struct - public struct Velocity + struct Velocity { public double X; public double Y; diff --git a/src/cs/production/flecs/FlecsException.cs b/src/cs/production/flecs/FlecsException.cs index 76ddedb..713a8af 100644 --- a/src/cs/production/flecs/FlecsException.cs +++ b/src/cs/production/flecs/FlecsException.cs @@ -1,7 +1,7 @@ // Copyright (c) Bottlenose Labs Inc. (https://github.com/bottlenoselabs). All rights reserved. // Licensed under the MIT license. See LICENSE file in the Git repository root directory for full license information. -#nullable enable +namespace flecs; using System; diff --git a/src/cs/production/flecs/Iterator.cs b/src/cs/production/flecs/Iterator.cs index 004e3c0..b951118 100644 --- a/src/cs/production/flecs/Iterator.cs +++ b/src/cs/production/flecs/Iterator.cs @@ -1,8 +1,8 @@ using System; using System.Runtime.CompilerServices; +using static flecs_hub.flecs; -namespace flecs_hub; -using static flecs; +namespace flecs; public readonly unsafe struct Iterator { diff --git a/src/cs/production/flecs/SystemBindingContextHelper.cs b/src/cs/production/flecs/SystemBindingContextHelper.cs index 2aa91c1..b38b077 100644 --- a/src/cs/production/flecs/SystemBindingContextHelper.cs +++ b/src/cs/production/flecs/SystemBindingContextHelper.cs @@ -1,7 +1,7 @@ using System; using System.Threading; -namespace flecs_hub; +namespace flecs; internal static class SystemBindingContextHelper { diff --git a/src/cs/production/flecs/SystemCallback.cs b/src/cs/production/flecs/SystemCallback.cs index c6034bb..42c0a71 100644 --- a/src/cs/production/flecs/SystemCallback.cs +++ b/src/cs/production/flecs/SystemCallback.cs @@ -1,3 +1,3 @@ -namespace flecs_hub; +namespace flecs; public delegate void SystemCallback(Iterator iterator); diff --git a/src/cs/production/flecs/World.cs b/src/cs/production/flecs/World.cs index 46ead86..b6b2ad9 100644 --- a/src/cs/production/flecs/World.cs +++ b/src/cs/production/flecs/World.cs @@ -2,9 +2,10 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using flecs_hub; +using static flecs_hub.flecs; -namespace flecs_hub; -using static flecs; +namespace flecs; public unsafe class World { @@ -19,7 +20,10 @@ public unsafe class World public World(string[] args) { - _worldHandle = ecs_init_w_args(args); + var argv = args.Length == 0 ? default : Runtime.CStrings.CStringArray(args); + _worldHandle = ecs_init_w_args(args.Length, argv); + Runtime.CStrings.FreeCStrings(argv, args.Length); +; _libraryHandle = CLibrary.Load("libflecs.dylib"); var ecsPair = CLibrary.GetExport(_libraryHandle, "ECS_PAIR"); @@ -46,6 +50,7 @@ public ecs_entity_t InitializeComponent() var componentName = componentType.Name; var componentNameC = Runtime.CStrings.CString(componentName); var structLayoutAttribute = componentType.StructLayoutAttribute; + CheckStructLayout(structLayoutAttribute); var structSize = Unsafe.SizeOf(); var structAlignment = structLayoutAttribute!.Pack; @@ -86,16 +91,22 @@ public ecs_entity_t InitializeTag(string name) return id; } - public ref T GetComponent(ecs_entity_t entity, ecs_id_t id) - where T : unmanaged + public ref TComponent GetComponent(ecs_entity_t entity, ecs_id_t id) + where TComponent : unmanaged { + var componentType = typeof(TComponent); + var structLayoutAttribute = componentType.StructLayoutAttribute; + CheckStructLayout(structLayoutAttribute); var pointer = ecs_get_id(_worldHandle, entity, id); - return ref Unsafe.AsRef(pointer); + return ref Unsafe.AsRef(pointer); } public ecs_entity_t SetComponent(ecs_entity_t entity, ecs_id_t componentId, ref TComponent component) where TComponent : unmanaged { + var componentType = typeof(TComponent); + var structLayoutAttribute = componentType.StructLayoutAttribute; + CheckStructLayout(structLayoutAttribute); var structSize = Unsafe.SizeOf(); var pointer = Unsafe.AsPointer(ref component); var result = ecs_set_id(_worldHandle, entity, componentId, (ulong)structSize, pointer); @@ -148,4 +159,13 @@ private ulong ecs_entity_t_comb(ulong lo, ulong hi) { return (hi << 32) + lo; } + + private static void CheckStructLayout(StructLayoutAttribute? structLayoutAttribute) + { + if (structLayoutAttribute == null || structLayoutAttribute.Value == LayoutKind.Auto) + { + throw new FlecsException( + "Component must have a StructLayout attribute with LayoutKind sequential or explicit. This is to ensure that the struct fields are not reorganized by the C# compiler."); + } + } } diff --git a/src/cs/production/flecs/flecs.Extensions.cs b/src/cs/production/flecs/flecs.Extensions.cs deleted file mode 100644 index 38c5b9d..0000000 --- a/src/cs/production/flecs/flecs.Extensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Bottlenose Labs Inc. (https://github.com/bottlenoselabs). All rights reserved. -// Licensed under the MIT license. See LICENSE file in the Git repository root directory for full license information. - -#nullable enable - -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using static flecs_hub.flecs.Runtime; - -namespace flecs_hub -{ - public static unsafe partial class flecs - { - public static ecs_world_t* ecs_init_w_args(string[] args) - { - var argv = args.Length == 0 ? default : CStrings.CStringArray(args); - var world = ecs_init_w_args(args.Length, argv); - CStrings.FreeCStrings(argv, args.Length); - return world; - } - - public static ecs_entity_t ecs_entity_init( - ecs_world_t* world, CString name, Span componentIds) - { - var entityDescriptor = new ecs_entity_desc_t - { - name = name - }; - - for (var index = 0; index < componentIds.Length; index++) - { - var componentId = componentIds[index]; - entityDescriptor.add[index] = componentId; - } - - return ecs_entity_init(world, &entityDescriptor); - } - - private static void CheckStructLayout(StructLayoutAttribute? structLayoutAttribute) - { - if (structLayoutAttribute == null || structLayoutAttribute.Value == LayoutKind.Auto) - { - throw new FlecsException( - "Component must have a StructLayout attribute with LayoutKind sequential or explicit. This is to ensure that the struct fields are not reorganized by the C# compiler."); - } - } - } -} diff --git a/src/cs/production/flecs/flecs.csproj b/src/cs/production/flecs/flecs.csproj index 547bd40..658bee6 100644 --- a/src/cs/production/flecs/flecs.csproj +++ b/src/cs/production/flecs/flecs.csproj @@ -10,7 +10,6 @@ net6.0 true - flecs_hub false enable From 80ac9184f00e89614aa4a9b12e41c4368b0c2116 Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Thu, 23 Jun 2022 23:01:07 -0400 Subject: [PATCH 6/8] Use `flecs` as namespace --- src/cs/examples/flecs-01_hello_world/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index 4e8bd40..58554bb 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -1,4 +1,4 @@ -using flecs_hub; +using flecs; internal static class Program { From 9e7b8720d7cb8d222f9ed14748f48f06d6d793dc Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Sat, 2 Jul 2022 04:35:37 -0400 Subject: [PATCH 7/8] Add scripts submodule --- .gitmodules | 3 +++ ext/scripts | 1 + 2 files changed, 4 insertions(+) create mode 160000 ext/scripts diff --git a/.gitmodules b/.gitmodules index d238ec0..07161ba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "ext/flecs"] path = ext/flecs url = https://github.com/SanderMertens/flecs +[submodule "ext/scripts"] + path = ext/scripts + url = https://github.com/bottlenoselabs/scripts.git diff --git a/ext/scripts b/ext/scripts new file mode 160000 index 0000000..d285ce8 --- /dev/null +++ b/ext/scripts @@ -0,0 +1 @@ +Subproject commit d285ce8968aa5486f225db15464c0af2a40981a8 From 5b11ffeb7630232399ade883039d3b33450e6abf Mon Sep 17 00:00:00 2001 From: Lucas Girouard-Stranks Date: Sat, 2 Jul 2022 14:16:27 -0400 Subject: [PATCH 8/8] Update --- bindgen/ast_linux.json | 5 +- bindgen/ast_osx.json | 5 +- bindgen/ast_win.json | 5 +- library.sh | 140 +- src/c/production/flecs/CMakeLists.txt | 26 + .../production/flecs/include/flecs_pinvoke.h | 6 + src/c/production/flecs/include/pinvoke.h | 95 ++ src/c/production/flecs/src/flecs_pinvoke.c | 17 + .../examples/flecs-01_hello_world/Program.cs | 19 +- src/cs/production/flecs/CLibrary.cs | 93 -- src/cs/production/flecs/Iterator.cs | 22 +- src/cs/production/flecs/Table.cs | 25 + src/cs/production/flecs/World.cs | 75 +- src/cs/production/flecs/flecs.cs | 1253 ++++++++++------- src/cs/production/flecs/flecs.csproj | 3 + 15 files changed, 982 insertions(+), 807 deletions(-) create mode 100644 src/c/production/flecs/CMakeLists.txt create mode 100644 src/c/production/flecs/include/flecs_pinvoke.h create mode 100644 src/c/production/flecs/include/pinvoke.h create mode 100644 src/c/production/flecs/src/flecs_pinvoke.c delete mode 100644 src/cs/production/flecs/CLibrary.cs create mode 100644 src/cs/production/flecs/Table.cs diff --git a/bindgen/ast_linux.json b/bindgen/ast_linux.json index 0767dd7..3261619 100644 --- a/bindgen/ast_linux.json +++ b/bindgen/ast_linux.json @@ -1,7 +1,10 @@ { "directory": "./ast", "c": { - "input_file": "../ext/flecs/include/flecs.h", + "input_file": "../src/c/production/flecs/include/flecs_pinvoke.h", + "user_include_directories": [ + "../ext/flecs/include" + ], "platforms": { "aarch64-unknown-linux-gnu": {}, "x86_64-unknown-linux-gnu": {} diff --git a/bindgen/ast_osx.json b/bindgen/ast_osx.json index d653e7f..63be045 100644 --- a/bindgen/ast_osx.json +++ b/bindgen/ast_osx.json @@ -1,7 +1,10 @@ { "directory": "./ast", "c": { - "input_file": "../ext/flecs/include/flecs.h", + "input_file": "../src/c/production/flecs/include/flecs_pinvoke.h", + "user_include_directories": [ + "../ext/flecs/include" + ], "platforms": { "aarch64-apple-darwin": {}, "x86_64-apple-darwin": {} diff --git a/bindgen/ast_win.json b/bindgen/ast_win.json index b3f1ffd..56505c3 100644 --- a/bindgen/ast_win.json +++ b/bindgen/ast_win.json @@ -1,7 +1,10 @@ { "directory": "./ast", "c": { - "input_file": "../ext/flecs/include/flecs.h", + "input_file": "../src/c/production/flecs/include/flecs_pinvoke.h", + "user_include_directories": [ + "../ext/flecs/include" + ], "platforms": { "aarch64-pc-windows-msvc": {}, "x86_64-pc-windows-msvc": {} diff --git a/library.sh b/library.sh index ecbb667..80959b0 100755 --- a/library.sh +++ b/library.sh @@ -1,136 +1,10 @@ #!/bin/bash -# NOTE: This script builds a target C/C++ library using CMake as a shared library (`.dll`/`.so`/`.dylib`) for the purposes of P/Invoke with C#. -# INPUT: -# $1: The target operating system to build the shared library for. Possible values are "host", "windows", "linux", "macos". -# $2: The taget architecture to build the shared library for. Possible values are "default", "x86_64", "arm64". -# OUTPUT: The built shared library if successful, or nothing upon first failure. - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -echo "Started building native libraries... Directory: $DIR" -LIB_DIR="$DIR/lib" -mkdir -p $LIB_DIR -echo "Started '$0' $1 $2 $3 $4" - -if [[ ! -z "$1" ]]; then - TARGET_BUILD_OS="$1" -fi - -if [[ ! -z "$2" ]]; then - TARGET_BUILD_ARCH="$2" -fi - -function set_target_build_os { - if [[ -z "$TARGET_BUILD_OS" || $TARGET_BUILD_OS == "host" ]]; then - uname_str="$(uname -a)" - case "${uname_str}" in - *Microsoft*) TARGET_BUILD_OS="windows";; - *microsoft*) TARGET_BUILD_OS="windows";; - Linux*) TARGET_BUILD_OS="linux";; - Darwin*) TARGET_BUILD_OS="macos";; - CYGWIN*) TARGET_BUILD_OS="linux";; - MINGW*) TARGET_BUILD_OS="windows";; - *Msys) TARGET_BUILD_OS="windows";; - *) TARGET_BUILD_OS="UNKNOWN:${uname_str}" - esac - - if [[ - "$TARGET_BUILD_OS" != "windows" && - "$TARGET_BUILD_OS" != "macos" && - "$TARGET_BUILD_OS" != "linux" - ]]; then - echo "Unknown target build operating system: $TARGET_BUILD_OS" - exit 1 - fi - - echo "Target build operating system: '$TARGET_BUILD_OS' (host)" - else - if [[ - "$TARGET_BUILD_OS" == "windows" || - "$TARGET_BUILD_OS" == "macos" || - "$TARGET_BUILD_OS" == "linux" - ]]; then - echo "Target build operating system: '$TARGET_BUILD_OS' (override)" - else - echo "Unknown '$TARGET_BUILD_OS' passed as first argument. Use 'host' to use the host build platform or use either: 'windows', 'macos', 'linux'." - exit 1 - fi - fi -} - -function set_target_build_arch { - if [[ -z "$TARGET_BUILD_ARCH" || $TARGET_BUILD_ARCH == "default" ]]; then - if [[ "$TARGET_BUILD_OS" == "macos" ]]; then - TARGET_BUILD_ARCH="x86_64;arm64" - else - TARGET_BUILD_ARCH="$(uname -m)" - fi - - echo "Target build CPU architecture: '$TARGET_BUILD_ARCH' (default)" - else - if [[ "$TARGET_BUILD_ARCH" == "x86_64" || "$TARGET_BUILD_ARCH" == "arm64" ]]; then - echo "Target build CPU architecture: '$TARGET_BUILD_ARCH' (override)" - else - echo "Unknown '$TARGET_BUILD_ARCH' passed as second argument. Use 'default' to use the host CPU architecture or use either: 'x86_64', 'arm64'." - exit 1 - fi - fi - if [[ "$TARGET_BUILD_OS" == "macos" ]]; then - CMAKE_ARCH_ARGS="-DCMAKE_OSX_ARCHITECTURES=$TARGET_BUILD_ARCH" - fi -} - -set_target_build_os -set_target_build_arch - -function exit_if_last_command_failed() { - error=$? - if [ $error -ne 0 ]; then - echo "Last command failed: $error" - exit $error - fi -} - -function build_library() { - echo "Building native library..." - BUILD_DIR="$DIR/cmake-build-release" - rm -rf BUILD_DIR - - cmake -S $DIR/ext/flecs -B $BUILD_DIR $CMAKE_ARCH_ARGS \ - `# change output directories` \ - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=$BUILD_DIR -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$BUILD_DIR -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$BUILD_DIR -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$BUILD_DIR \ - `# project specific` \ - -DFLECS_STATIC_LIBS=OFF - exit_if_last_command_failed - cmake --build $BUILD_DIR --config Release - exit_if_last_command_failed - - if [[ "$TARGET_BUILD_OS" == "linux" ]]; then - LIBRARY_FILENAME="libflecs.so" - LIBRARY_FILE_PATH_BUILD="$(readlink -f $BUILD_DIR/$LIBRARY_FILENAME)" - elif [[ "$TARGET_BUILD_OS" == "macos" ]]; then - LIBRARY_FILENAME="libflecs.dylib" - LIBRARY_FILE_PATH_BUILD="$(perl -MCwd -e 'print Cwd::abs_path shift' $BUILD_DIR/$LIBRARY_FILENAME)" - elif [[ "$TARGET_BUILD_OS" == "windows" ]]; then - LIBRARY_FILENAME="flecs.dll" - LIBRARY_FILE_PATH_BUILD="$BUILD_DIR/$LIBRARY_FILENAME" - fi - LIBRARY_FILE_PATH="$LIB_DIR/$LIBRARY_FILENAME" - - if [[ ! -f "$LIBRARY_FILE_PATH_BUILD" ]]; then - echo "The file '$LIBRARY_FILE_PATH_BUILD' does not exist!" - exit 1 - fi - - mv "$LIBRARY_FILE_PATH_BUILD" "$LIBRARY_FILE_PATH" - exit_if_last_command_failed - echo "Copied '$LIBRARY_FILE_PATH_BUILD' to '$LIBRARY_FILE_PATH'" - - rm -r $BUILD_DIR - exit_if_last_command_failed - echo "Building native library finished!" -} - -build_library -ls -d "$LIB_DIR"/* -echo "Finished '$0'!" +$DIR/ext/scripts/c/library/main.sh \ + $DIR/src/c/production/flecs \ + $DIR/lib \ + "flecs" \ + "flecs" \ + "" \ + "" \ \ No newline at end of file diff --git a/src/c/production/flecs/CMakeLists.txt b/src/c/production/flecs/CMakeLists.txt new file mode 100644 index 0000000..786a672 --- /dev/null +++ b/src/c/production/flecs/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.16) + +project(flecs C) +set(CMAKE_C_STANDARD 11) + +get_filename_component(FLECS_DIRECTORY_PATH "../../../../ext/flecs" REALPATH BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +include(${FLECS_DIRECTORY_PATH}/cmake/target_default_compile_warnings.cmake) +include(${FLECS_DIRECTORY_PATH}/cmake/target_default_compile_options.cmake) +file(GLOB_RECURSE INC ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${FLECS_DIRECTORY_PATH}/include/*.h) +file(GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c ${FLECS_DIRECTORY_PATH}/src/*.c) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${FLECS_DIRECTORY_PATH}/include) + +message("FILES: ${INC} ${SRC}") + +add_library(flecs SHARED ${INC} ${SRC}) + +set_target_properties(flecs PROPERTIES LINKER_LANGUAGE C) + +if(WIN32) + target_link_libraries(flecs wsock32 ws2_32) +endif() + +#target_default_compile_options_c(flecs) +#target_default_compile_warnings_c(flecs) +#target_include_directories(flecs PUBLIC ${FLECS_DIRECTORY_PATH}/include ${CMAKE_CURRENT_SOURCE_DIR}/include) \ No newline at end of file diff --git a/src/c/production/flecs/include/flecs_pinvoke.h b/src/c/production/flecs/include/flecs_pinvoke.h new file mode 100644 index 0000000..749afda --- /dev/null +++ b/src/c/production/flecs/include/flecs_pinvoke.h @@ -0,0 +1,6 @@ +#include "pinvoke.h" +#include "flecs.h" + +PINVOKE_API_DECL ecs_id_t pinvoke_ECS_PAIR(); +PINVOKE_API_DECL ecs_entity_t pinvoke_EcsOnUpdate(); +PINVOKE_API_DECL ecs_entity_t pinvoke_EcsDependsOn(); \ No newline at end of file diff --git a/src/c/production/flecs/include/pinvoke.h b/src/c/production/flecs/include/pinvoke.h new file mode 100644 index 0000000..3adec49 --- /dev/null +++ b/src/c/production/flecs/include/pinvoke.h @@ -0,0 +1,95 @@ +// Provides macros, types, and functions that make P/Invoke with C# easier. +#pragma once + +#if defined(__APPLE__) && __has_include("TargetConditionals.h") + #include + + #define PINVOKE_TARGET_CPU_X64 TARGET_CPU_X86_64 + #define PINVOKE_TARGET_CPU_X86 TARGET_CPU_X86 + #define PINVOKE_TARGET_CPU_ARM64 TARGET_CPU_ARM64 + + #define PINVOKE_TARGET_OS_WINDOWS 0 + #define PINVOKE_TARGET_OS_LINUX 0 + #define PINVOKE_TARGET_OS_MACOS TARGET_OS_OSX + #define PINVOKE_TARGET_OS_IOS TARGET_OS_IOS + + #define PINVOKE_TARGET_ENV_MSVC 0 + #define PINVOKE_TARGET_ENV_GNU 0 +#else + #define PINVOKE_TARGET_CPU_X64 defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) + #define PINVOKE_TARGET_CPU_X86 defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86) + #define PINVOKE_TARGET_CPU_ARM64 defined(__aarch64__) || defined(_M_ARM64) + + #define PINVOKE_TARGET_OS_WINDOWS defined(WIN32) || defined(_WIN32) || defined(__WIN32__) + #define PINVOKE_TARGET_OS_LINUX defined(__linux__) + #define PINVOKE_TARGET_OS_MACOS 0 + #define PINVOKE_TARGET_OS_IOS 0 + + #define PINVOKE_TARGET_ENV_MSVC defined(_MSC_VER) + #define PINVOKE_TARGET_ENV_GNU defined(__GNUC__) +#endif + +#if PINVOKE_TARGET_OS_WINDOWS && PINVOKE_TARGET_ENV_GNU + #if PINVOKE_TARGET_CPU_X64 + #define PINVOKE_TARGET_NAME "x86_64-pc-windows-gnu" + #elif PINVOKE_TARGET_CPU_X86 + #define PINVOKE_TARGET_NAME "i686-pc-windows-gnu" + #elif PINVOKE_TARGET_CPU_ARM64 + #define PINVOKE_TARGET_NAME "aarch64-pc-windows-gnu" + #else + #error "Unknown computer architecture for Windows (GNU)." + #endif +#elif PINVOKE_TARGET_OS_WINDOWS && PINVOKE_TARGET_ENV_MSVC + #if PINVOKE_TARGET_CPU_X64 + #define PINVOKE_TARGET_NAME "x86_64-pc-windows-msvc" + #elif PINVOKE_TARGET_CPU_X86 + #define PINVOKE_TARGET_NAME "i686-pc-windows-msvc" + #elif PINVOKE_TARGET_CPU_ARM64 + #define PINVOKE_TARGET_NAME "aarch64-pc-windows-msvc" + #else + #error "Unknown computer architecture for Windows (Microsoft Visual C++)." + #endif +#elif PINVOKE_TARGET_OS_LINUX + #if PINVOKE_TARGET_CPU_X64 + #define PINVOKE_TARGET_NAME "x86_64-unknown-linux-gnu" + #elif PINVOKE_TARGET_CPU_X86 + #define PINVOKE_TARGET_NAME "i686-unknown-linux-gnu" + #elif PINVOKE_TARGET_CPU_ARM64 + #define PINVOKE_TARGET_NAME "aarch64-unknown-linux-gnu" + #else + #error "Unknown computer architecture for Linux." + #endif +#elif PINVOKE_TARGET_OS_MACOS + #if PINVOKE_TARGET_CPU_X64 + #define PINVOKE_TARGET_NAME "x86_64-apple-darwin" + #elif PINVOKE_TARGET_CPU_X86 + #define PINVOKE_TARGET_NAME "i686-apple-darwin" + #elif PINVOKE_TARGET_CPU_ARM64 + #define PINVOKE_TARGET_NAME "aarch64-apple-darwin" + #else + #error "Unknown computer architecture for macOS." + #endif +#elif PINVOKE_TARGET_OS_IOS + #if PINVOKE_TARGET_CPU_X64 + #define PINVOKE_TARGET_NAME "x86_64-apple-ios" + #elif PINVOKE_TARGET_CPU_X86 + #define PINVOKE_TARGET_NAME "i686-apple-ios" + #elif PINVOKE_TARGET_CPU_ARM64 + #define PINVOKE_TARGET_NAME "aarch64-apple-ios" + #else + #error "Unknown computer architecture for iOS." + #endif +#else + #define PINVOKE_TARGET_NAME 0 +#endif + +#if PINVOKE_TARGET_OS_WINDOWS + #define PINVOKE_API_DECL __declspec(dllexport) +#else + #define PINVOKE_API_DECL extern +#endif + +PINVOKE_API_DECL const char* pinvoke_get_platform_name() +{ + return PINVOKE_TARGET_NAME; +} \ No newline at end of file diff --git a/src/c/production/flecs/src/flecs_pinvoke.c b/src/c/production/flecs/src/flecs_pinvoke.c new file mode 100644 index 0000000..b459cd8 --- /dev/null +++ b/src/c/production/flecs/src/flecs_pinvoke.c @@ -0,0 +1,17 @@ +#include "pinvoke.h" +#include "flecs.h" + +ecs_id_t pinvoke_ECS_PAIR() +{ + return ECS_PAIR; +} + +ecs_entity_t pinvoke_EcsOnUpdate() +{ + return EcsOnUpdate; +} + +ecs_entity_t pinvoke_EcsDependsOn() +{ + return EcsDependsOn; +} \ No newline at end of file diff --git a/src/cs/examples/flecs-01_hello_world/Program.cs b/src/cs/examples/flecs-01_hello_world/Program.cs index 58554bb..a8197ec 100644 --- a/src/cs/examples/flecs-01_hello_world/Program.cs +++ b/src/cs/examples/flecs-01_hello_world/Program.cs @@ -1,13 +1,16 @@ -using flecs; +using System.Runtime.InteropServices; +using flecs; internal static class Program { + [StructLayout(LayoutKind.Sequential)] struct Position { public double X; public double Y; } + [StructLayout(LayoutKind.Sequential)] struct Velocity { public double X; @@ -16,15 +19,15 @@ struct Velocity // Move system implementation. System callbacks may be called multiple times, as entities are grouped by which // components they have, and each group has its own set of component arrays. - public static void Move(Iterator iterator) + static void Move(Iterator iterator) { var p = iterator.Term(1); var v = iterator.Term(2); - // // Print the set of components for the iterated over entities - // var typeString = ecs_table_str(it->world, it->table).ToString(); - // Console.WriteLine("Move entities with " + typeString); - // // ecs_os_free(type_str); + // Print the set of components for the iterated over entities + var table = iterator.Table(); + var typeString = table.String(); + Console.WriteLine("Move entities with " + typeString); // Iterate entities for the current group for (var i = 0; i < iterator.Count; i++) @@ -37,7 +40,7 @@ public static void Move(Iterator iterator) } } - private static int Main(string[] args) + static int Main(string[] args) { // Create the world var world = new World(args); @@ -47,7 +50,7 @@ private static int Main(string[] args) var componentVelocity = world.InitializeComponent(); // Register system - world.InitializeSystem(Move, "Position, Velocity"); + world.InitializeSystem(Move); // Register tags (components without a size) var eats = world.InitializeTag("eats"); diff --git a/src/cs/production/flecs/CLibrary.cs b/src/cs/production/flecs/CLibrary.cs deleted file mode 100644 index 4292478..0000000 --- a/src/cs/production/flecs/CLibrary.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; - -namespace flecs_hub; - -public static class CLibrary -{ - public static IntPtr Load(string name) - { - if (IsLinux) return libdl.dlopen(name, 0x101); // RTLD_GLOBAL | RTLD_LAZY - if (IsWindows) return Kernel32.LoadLibrary(name); - if (IsDarwin) return libSystem.dlopen(name, 0x101); // RTLD_GLOBAL | RTLD_LAZY - return IntPtr.Zero; - } - - public static void Free(IntPtr handle) - { - if (IsLinux) libdl.dlclose(handle); - if (IsWindows) Kernel32.FreeLibrary(handle); - if (IsDarwin) libSystem.dlclose(handle); - } - - public static IntPtr GetExport(IntPtr handle, string symbolName) - { - if (IsLinux) return libdl.dlsym(handle, symbolName); - if (IsWindows) return Kernel32.GetProcAddress(handle, symbolName); - if (IsDarwin) return libSystem.dlsym(handle, symbolName); - return IntPtr.Zero; - } - - private static bool IsWindows - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - } - - private static bool IsDarwin - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); - } - - private static bool IsLinux - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); - } - - [SuppressUnmanagedCodeSecurity] - public static class libdl - { - private const string LibraryName = "libdl"; - - [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] - public static extern IntPtr dlopen(string fileName, int flags); - - [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] - public static extern IntPtr dlsym(IntPtr handle, string name); - - [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall)] - public static extern int dlclose(IntPtr handle); - } - - [SuppressUnmanagedCodeSecurity] - internal static class libSystem - { - private const string LibraryName = "libSystem"; - - [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] - public static extern IntPtr dlopen(string fileName, int flags); - - [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] - public static extern IntPtr dlsym(IntPtr handle, string name); - - [DllImport(LibraryName, CallingConvention = CallingConvention.StdCall)] - public static extern int dlclose(IntPtr handle); - } - - [SuppressUnmanagedCodeSecurity] - private static class Kernel32 - { - [DllImport("kernel32", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)] - public static extern IntPtr LoadLibrary(string fileName); - - [DllImport("kernel32", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)] - public static extern IntPtr GetProcAddress(IntPtr module, string procName); - - [DllImport("kernel32", CallingConvention = CallingConvention.StdCall, SetLastError = true)] - public static extern int FreeLibrary(IntPtr module); - } -} diff --git a/src/cs/production/flecs/Iterator.cs b/src/cs/production/flecs/Iterator.cs index b951118..b604e19 100644 --- a/src/cs/production/flecs/Iterator.cs +++ b/src/cs/production/flecs/Iterator.cs @@ -1,25 +1,31 @@ using System; -using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using JetBrains.Annotations; using static flecs_hub.flecs; namespace flecs; +[PublicAPI] public readonly unsafe struct Iterator { - private readonly ecs_iter_t* _handle; + public readonly ecs_iter_t* Handle; - public int Count => _handle->count; + public int Count => Handle->count; internal Iterator(ecs_iter_t* it) { - _handle = it; + Handle = it; } public Span Term(int index) - where T : unmanaged { - var structSize = Unsafe.SizeOf(); - var pointer = ecs_term_w_size(_handle, (ulong) structSize, index); - return new Span(pointer, _handle->count); + var structSize = Marshal.SizeOf(); + var pointer = ecs_term_w_size(Handle, (ulong) structSize, index); + return new Span(pointer, Handle->count); + } + + public Table Table() + { + return new Table(Handle->world, Handle->table); } } diff --git a/src/cs/production/flecs/Table.cs b/src/cs/production/flecs/Table.cs new file mode 100644 index 0000000..3a0632c --- /dev/null +++ b/src/cs/production/flecs/Table.cs @@ -0,0 +1,25 @@ +using System.Runtime.InteropServices; +using JetBrains.Annotations; +using static flecs_hub.flecs; +namespace flecs; + +[PublicAPI] +public readonly unsafe struct Table +{ + private readonly ecs_world_t* _worldHandle; + public readonly ecs_table_t* Handle; + + internal Table(ecs_world_t* world, ecs_table_t* handle) + { + _worldHandle = world; + Handle = handle; + } + + public string String() + { + var cString = ecs_table_str(_worldHandle, Handle); + var result = Marshal.PtrToStringAnsi(cString._pointer)!; + Marshal.FreeHGlobal(cString._pointer); + return result; + } +} diff --git a/src/cs/production/flecs/World.cs b/src/cs/production/flecs/World.cs index b6b2ad9..904c01e 100644 --- a/src/cs/production/flecs/World.cs +++ b/src/cs/production/flecs/World.cs @@ -1,16 +1,18 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using flecs_hub; +using JetBrains.Annotations; using static flecs_hub.flecs; namespace flecs; +[PublicAPI] public unsafe class World { - private readonly IntPtr _libraryHandle; private readonly ecs_world_t* _worldHandle; + private Dictionary _componentHandlesByType = new(); private readonly ecs_id_t ECS_PAIR; private readonly ecs_entity_t EcsOnUpdate; @@ -23,22 +25,14 @@ public World(string[] args) var argv = args.Length == 0 ? default : Runtime.CStrings.CStringArray(args); _worldHandle = ecs_init_w_args(args.Length, argv); Runtime.CStrings.FreeCStrings(argv, args.Length); -; - _libraryHandle = CLibrary.Load("libflecs.dylib"); - var ecsPair = CLibrary.GetExport(_libraryHandle, "ECS_PAIR"); - ECS_PAIR.Data = (ulong)Marshal.ReadInt64(ecsPair); - - var ecsOnUpdate = CLibrary.GetExport(_libraryHandle, "EcsOnUpdate"); - EcsOnUpdate.Data.Data = (ulong)Marshal.ReadInt64(ecsOnUpdate); - - var ecsDependsOn = CLibrary.GetExport(_libraryHandle, "EcsDependsOn"); - EcsDependsOn.Data.Data = (ulong)Marshal.ReadInt64(ecsDependsOn); + ECS_PAIR = pinvoke_ECS_PAIR(); + EcsOnUpdate = pinvoke_EcsOnUpdate(); + EcsDependsOn = pinvoke_EcsDependsOn(); } public int Fini() { - CLibrary.Free(_libraryHandle); var exitCode = ecs_fini(_worldHandle); return exitCode; } @@ -65,23 +59,61 @@ public ecs_entity_t InitializeComponent() Debug.Assert(id.Data.Data != 0, "ECS_INVALID_PARAMETER"); return id; } + + public ecs_entity_t InitializeSystem( + SystemCallback callback, ecs_entity_t phase, string filterExpression, string? name = null) + { + ecs_system_desc_t desc = default; + FillSystemDescriptorCommon(ref desc, callback, phase, name); + + desc.query.filter.expr = filterExpression; - public ecs_entity_t InitializeSystem(SystemCallback callback, string? filterExpression = null) + var id = ecs_system_init(_worldHandle, &desc); + return id; + } + + public ecs_entity_t InitializeSystem( + SystemCallback callback, ecs_entity_t phase, string? name = null) + { + ecs_system_desc_t desc = default; + FillSystemDescriptorCommon(ref desc, callback, phase, name); + + desc.query.filter.expr = GetComponentName(); + + var id = ecs_system_init(_worldHandle, &desc); + return id; + } + + public ecs_entity_t InitializeSystem( + SystemCallback callback, string? name = null) { var id = new ecs_entity_t(); ecs_system_desc_t desc = default; - desc.entity.name = "Test"; + desc.entity.name = name ?? callback.Method.Name; var phase = EcsOnUpdate; desc.entity.add[0] = phase.Data != 0 ? ecs_pair(EcsDependsOn, phase) : default; desc.entity.add[1] = phase; - desc.query.filter.expr = filterExpression ?? string.Empty; desc.callback.Data.Pointer = &SystemCallback; desc.binding_ctx = (void*)SystemBindingContextHelper.CreateSystemBindingContext(callback); + var componentName1 = GetComponentName(); + var componentName2 = GetComponentName(); + desc.query.filter.expr = componentName1 + ", " + componentName2; + id = ecs_system_init(_worldHandle, &desc); return id; } - + + private void FillSystemDescriptorCommon( + ref ecs_system_desc_t desc, SystemCallback callback, ecs_entity_t phase, string? name) + { + desc.entity.name = name ?? callback.Method.Name; + desc.entity.add[0] = phase.Data != 0 ? ecs_pair(EcsDependsOn, phase) : default; + desc.entity.add[1] = phase; + desc.callback.Data.Pointer = &SystemCallback; + desc.binding_ctx = (void*)SystemBindingContextHelper.CreateSystemBindingContext(callback); + } + public ecs_entity_t InitializeTag(string name) { ecs_entity_desc_t desc = default; @@ -125,8 +157,8 @@ private static void SystemCallback(ecs_iter_t* it) { SystemBindingContextHelper.GetSystemBindingContext((IntPtr)it->binding_ctx, out var data); - var context = new Iterator(it); - data.Callback(context); + var iterator = new Iterator(it); + data.Callback(iterator); } public ecs_entity_t InitializeEntity(string name) @@ -168,4 +200,9 @@ private static void CheckStructLayout(StructLayoutAttribute? structLayoutAttribu "Component must have a StructLayout attribute with LayoutKind sequential or explicit. This is to ensure that the struct fields are not reorganized by the C# compiler."); } } + + private string GetComponentName() + { + return typeof(TComponent).Name; + } } diff --git a/src/cs/production/flecs/flecs.cs b/src/cs/production/flecs/flecs.cs index ccce6bd..721db7d 100644 --- a/src/cs/production/flecs/flecs.cs +++ b/src/cs/production/flecs/flecs.cs @@ -31,6 +31,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_world_t* ecs_mini(); @@ -41,6 +42,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_emplace_id(ecs_world_t* world, ecs_entity_t entity, ecs_id_t id); @@ -51,6 +53,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_get_object(ecs_world_t* world, ecs_entity_t entity, ecs_entity_t rel, int index); @@ -81,6 +84,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_defer_end(ecs_world_t* world); @@ -101,6 +105,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_term_fini(ecs_term_t* term); @@ -121,6 +126,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_fini(ecs_world_t* world); @@ -151,6 +157,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_filter_str(ecs_world_t* world, ecs_filter_t* filter); @@ -221,6 +228,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_new_from_path_w_sep(ecs_world_t* world, ecs_entity_t parent, CString path, CString sep, CString prefix); @@ -231,6 +239,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_type_t* ecs_table_get_type(ecs_table_t* table); @@ -241,6 +250,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_async_stage_free(ecs_world_t* stage); @@ -277,10 +287,12 @@ public static unsafe partial class flecs // Function @ flecs.h:4669:15 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ecs_emit(ecs_world_t* world, ecs_event_desc_t* desc); + + // Function @ flecs.h:1706:21 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_record_t* ecs_record_find(ecs_world_t* world, ecs_entity_t entity); @@ -301,6 +313,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_ref_get_id(ecs_world_t* world, ecs_ref_t* @ref, ecs_id_t id); @@ -411,6 +424,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_search(ecs_world_t* world, ecs_table_t* table, ecs_id_t id, ecs_id_t* id_out); @@ -451,6 +465,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_term_finalize(ecs_world_t* world, CString name, ecs_term_t* term); @@ -461,6 +476,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_query_table_count(ecs_query_t* query); @@ -521,6 +537,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_run_post_frame(ecs_world_t* world, ecs_fini_action_t action, void* ctx); @@ -547,10 +564,12 @@ public static unsafe partial class flecs // Function @ flecs.h:3834:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ecs_table_swap_rows(ecs_world_t* world, ecs_table_t* table, int row_1, int row_2); + + // Function @ flecs.h:2740:14 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_iter_var_is_constrained(ecs_iter_t* it, int var_id); @@ -561,6 +580,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\meta.h) // aarch64-unknown-linux-gnu (flecs/addons/meta.h) // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_meta_push(ecs_meta_cursor_t* cursor); @@ -571,6 +591,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_defer_resume(ecs_world_t* world); @@ -581,6 +602,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ulong ecs_iter_column_size(ecs_iter_t* it, int index); @@ -661,6 +683,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_component_init(ecs_world_t* world, ecs_component_desc_t* desc); @@ -701,6 +724,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_entity_init(ecs_world_t* world, ecs_entity_desc_t* desc); @@ -721,6 +745,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_search_relation(ecs_world_t* world, ecs_table_t* table, int offset, ecs_id_t id, ecs_entity_t rel, int min_depth, int max_depth, ecs_entity_t* subject_out, ecs_id_t* id_out, int* depth_out, ecs_table_record_t** tr_out); @@ -731,6 +756,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_has_id(ecs_world_t* world, ecs_entity_t entity, ecs_id_t id); @@ -761,6 +787,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_table_t* ecs_get_storage_table(ecs_world_t* world, ecs_entity_t entity); @@ -877,10 +904,6 @@ public static unsafe partial class flecs // Function @ flecs.h:1524:16 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_measure_system_time(ecs_world_t* world, CBool enable); @@ -892,7 +915,7 @@ public static unsafe partial class flecs // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern void ecs_os_dbg(CString file, int line, CString msg); + public static extern ecs_entity_t ecs_get_object(ecs_world_t* world, ecs_entity_t entity, ecs_entity_t rel, int index); // Function @ map.h:174:9 // x86_64-unknown-linux-gnu (flecs/private/map.h) @@ -921,6 +944,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_table_t* ecs_get_table(ecs_world_t* world, ecs_entity_t entity); @@ -961,6 +985,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_should_quit(ecs_world_t* world); @@ -1001,6 +1026,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_table_str(ecs_world_t* world, ecs_table_t* table); @@ -1011,6 +1037,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t* ecs_set_lookup_path(ecs_world_t* world, ecs_entity_t* lookup_path); @@ -1041,16 +1068,19 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_term_next(ecs_iter_t* it); // Function @ flecs.h:2593:14 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ecs_defer_resume(ecs_world_t* world); + + // Function @ flecs.h:1524:16 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_lookup_symbol(ecs_world_t* world, CString symbol, CBool lookup_as_path); @@ -1061,6 +1091,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_filter_finalize(ecs_world_t* world, ecs_filter_t* filter); @@ -1072,7 +1103,7 @@ public static unsafe partial class flecs // aarch64-unknown-linux-gnu // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern int ecs_query_entity_count(ecs_query_t* query); + public static extern CBool ecs_pipeline_stats_get(ecs_world_t* world, ecs_entity_t pipeline, ecs_pipeline_stats_t* stats); // Function @ flecs.h:4595:6 // x86_64-unknown-linux-gnu @@ -1131,6 +1162,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_type_hooks_t* ecs_get_hooks_id(ecs_world_t* world, ecs_entity_t id); @@ -1141,6 +1173,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_table_get_column(ecs_table_t* table, int index); @@ -1161,6 +1194,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_set_hooks_id(ecs_world_t* world, ecs_entity_t id, ecs_type_hooks_t* hooks); @@ -1187,10 +1221,6 @@ public static unsafe partial class flecs // Function @ flecs.h:1448:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_dim(ecs_world_t* world, int entity_count); @@ -1221,6 +1251,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_query_fini(ecs_query_t* query); @@ -1371,6 +1402,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_get_trigger_binding_ctx(ecs_world_t* world, ecs_entity_t trigger); @@ -1461,6 +1493,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_table_t* ecs_table_add_id(ecs_world_t* world, ecs_table_t* table, ecs_id_t id); @@ -1471,6 +1504,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_query_t* ecs_query_init(ecs_world_t* world, ecs_query_desc_t* desc); @@ -1481,6 +1515,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_get_path_w_sep(ecs_world_t* world, ecs_entity_t parent, ecs_entity_t child, CString sep, CString prefix); @@ -1521,6 +1556,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_iter_t ecs_page_iter(ecs_iter_t* it, int offset, int limit); @@ -1541,6 +1577,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_table_type_to_storage_index(ecs_table_t* table, int index); @@ -1601,6 +1638,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\stats.h) // aarch64-unknown-linux-gnu (flecs/addons/stats.h) // aarch64-apple-darwin (flecs/addons/stats.h) + // x86_64-apple-darwin (flecs/addons/stats.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_pipeline_stats_copy_last(ecs_pipeline_stats_t* dst, ecs_pipeline_stats_t* src); @@ -1611,6 +1649,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_is_valid(ecs_world_t* world, ecs_entity_t e); @@ -1621,6 +1660,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_new_id(ecs_world_t* world); @@ -1661,6 +1701,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_world_info_t* ecs_get_world_info(ecs_world_t* world); @@ -1691,6 +1732,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\private\sparse.h) // aarch64-unknown-linux-gnu (flecs/private/sparse.h) // aarch64-apple-darwin (flecs/private/sparse.h) + // x86_64-apple-darwin (flecs/private/sparse.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int flecs_sparse_size(ecs_sparse_t* sparse); @@ -1761,6 +1803,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_flags32_t ecs_id_get_flags(ecs_world_t* world, ecs_id_t id); @@ -1801,6 +1844,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_query_empty_table_count(ecs_query_t* query); @@ -1831,6 +1875,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_term_is_set(ecs_iter_t* it, int index); @@ -1841,6 +1886,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\stats.h) // aarch64-unknown-linux-gnu (flecs/addons/stats.h) // aarch64-apple-darwin (flecs/addons/stats.h) + // x86_64-apple-darwin (flecs/addons/stats.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_query_stats_reduce(ecs_query_stats_t* dst, ecs_query_stats_t* src); @@ -1861,16 +1907,19 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_get_observer_binding_ctx(ecs_world_t* world, ecs_entity_t observer); // Function @ flecs.h:2864:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ecs_filter_copy(ecs_filter_t* dst, ecs_filter_t* src); + + // Function @ flecs.h:4595:6 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_term_id_is_set(ecs_term_id_t* id); @@ -1891,6 +1940,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_table_has_module(ecs_table_t* table); @@ -1954,15 +2004,11 @@ public static unsafe partial class flecs [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void flecs_hashmap_copy(ecs_hashmap_t* src, ecs_hashmap_t* dst); - // Function @ meta.h:483:6 - // x86_64-unknown-linux-gnu (flecs/addons/meta.h) - // x86_64-apple-darwin (flecs/addons/meta.h) - // aarch64-pc-windows-msvc (flecs\addons\meta.h) - // x86_64-pc-windows-msvc (flecs\addons\meta.h) - // aarch64-unknown-linux-gnu (flecs/addons/meta.h) - // aarch64-apple-darwin (flecs/addons/meta.h) + // Function @ sparse.h:183:9 + // aarch64-apple-darwin (flecs/private/sparse.h) + // x86_64-apple-darwin (flecs/private/sparse.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern CChar ecs_meta_get_char(ecs_meta_cursor_t* cursor); + public static extern int flecs_sparse_size(ecs_sparse_t* sparse); // Function @ doc.h:55:6 // x86_64-unknown-linux-gnu (flecs/addons/doc.h) @@ -2011,6 +2057,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_atfini(ecs_world_t* world, ecs_fini_action_t action, void* ctx); @@ -2031,6 +2078,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_iter_poly(ecs_world_t* world, ecs_poly_t* poly, ecs_iter_t* iter, ecs_term_t* filter); @@ -2087,10 +2135,6 @@ public static unsafe partial class flecs // Function @ flecs.h:1858:10 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_id_t ecs_make_pair(ecs_entity_t relation, ecs_entity_t @object); @@ -2101,6 +2145,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_iter_t ecs_filter_iter(ecs_world_t* world, ecs_filter_t* filter); @@ -2161,6 +2206,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_query_next(ecs_iter_t* iter); @@ -2181,6 +2227,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_id_in_use(ecs_world_t* world, ecs_id_t id); @@ -2231,6 +2278,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_set_symbol(ecs_world_t* world, ecs_entity_t entity, CString symbol); @@ -2277,10 +2325,12 @@ public static unsafe partial class flecs // Function @ flecs.h:3369:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern CBool ecs_id_is_valid(ecs_world_t* world, ecs_id_t id); + + // Function @ flecs.h:1468:6 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_query_changed(ecs_query_t* query, ecs_iter_t* it); @@ -2301,6 +2351,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_term_is_readonly(ecs_iter_t* it, int index); @@ -2351,6 +2402,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_iter_fini(ecs_iter_t* it); @@ -2361,6 +2413,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_term_t ecs_term_copy(ecs_term_t* src); @@ -2431,6 +2484,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\doc.h) // aarch64-unknown-linux-gnu (flecs/addons/doc.h) // aarch64-apple-darwin (flecs/addons/doc.h) + // x86_64-apple-darwin (flecs/addons/doc.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_doc_get_detail(ecs_world_t* world, ecs_entity_t entity); @@ -2487,10 +2541,6 @@ public static unsafe partial class flecs // Function @ flecs.h:3593:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_observer_default_run_action(ecs_iter_t* it); @@ -2541,6 +2591,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_type_info_t* ecs_get_type_info(ecs_world_t* world, ecs_id_t id); @@ -2562,25 +2613,29 @@ public static unsafe partial class flecs // aarch64-unknown-linux-gnu (flecs/private/sparse.h) // aarch64-apple-darwin (flecs/private/sparse.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern void flecs_sparse_set_generation(ecs_sparse_t* sparse, ulong id); + public static extern CBool ecs_progress(ecs_world_t* world, float delta_time); // Function @ flecs.h:4261:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ecs_get_path_w_sep_buf(ecs_world_t* world, ecs_entity_t parent, ecs_entity_t child, CString sep, CString prefix, ecs_strbuf_t* buf); + + // Function @ flecs.h:2110:10 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_set_stage_count(ecs_world_t* world, int stages); // Function @ flecs.h:2879:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern ecs_term_t ecs_term_move(ecs_term_t* src); + + // Function @ flecs.h:3133:7 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_term_is_initialized(ecs_term_t* term); @@ -2617,10 +2672,12 @@ public static unsafe partial class flecs // Function @ flecs.h:4629:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern ecs_iter_t ecs_filter_chain_iter(ecs_iter_t* it, ecs_filter_t* filter); + + // Function @ flecs.h:3210:6 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_table_swap_rows(ecs_world_t* world, ecs_table_t* table, int row_1, int row_2); @@ -2731,6 +2788,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\meta.h) // aarch64-unknown-linux-gnu (flecs/addons/meta.h) // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_meta_set_null(ecs_meta_cursor_t* cursor); @@ -2791,6 +2849,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_get_alive(ecs_world_t* world, ecs_entity_t e); @@ -2831,6 +2890,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_table_range_t ecs_iter_get_var_as_range(ecs_iter_t* it, int var_id); @@ -2851,6 +2911,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_iter_t ecs_worker_iter(ecs_iter_t* it, int index, int count); @@ -2891,6 +2952,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_id_t ecs_strip_generation(ecs_entity_t e); @@ -2931,6 +2993,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t* ecs_get_lookup_path(ecs_world_t* world); @@ -2941,6 +3004,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t* ecs_bulk_init(ecs_world_t* world, ecs_bulk_desc_t* desc); @@ -2981,6 +3045,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_set_with(ecs_world_t* world, ecs_id_t id); @@ -2991,6 +3056,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_is_component_enabled_w_id(ecs_world_t* world, ecs_entity_t entity, ecs_id_t id); @@ -3011,6 +3077,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_iter_set_var(ecs_iter_t* it, int var_id, ecs_entity_t entity); @@ -3037,12 +3104,8 @@ public static unsafe partial class flecs // Function @ flecs.h:1640:14 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern ecs_entity_t ecs_new_low_id(ecs_world_t* world); + public static extern ecs_iter_t ecs_worker_iter(ecs_iter_t* it, int index, int count); // Function @ flecs.h:4243:6 // x86_64-unknown-linux-gnu @@ -3051,6 +3114,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_set_automerge(ecs_world_t* world, CBool automerge); @@ -3077,10 +3141,6 @@ public static unsafe partial class flecs // Function @ flecs.h:1426:7 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_get_context(ecs_world_t* world); @@ -3122,7 +3182,7 @@ public static unsafe partial class flecs // aarch64-unknown-linux-gnu (flecs/private/sparse.h) // aarch64-apple-darwin (flecs/private/sparse.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern ulong* flecs_sparse_new_ids(ecs_sparse_t* sparse, int count); + public static extern CBool ecs_os_has_dl(); // Function @ snapshot.h:44:17 // x86_64-unknown-linux-gnu (flecs/addons/snapshot.h) @@ -3141,6 +3201,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_lookup_child(ecs_world_t* world, ecs_entity_t parent, CString name); @@ -3181,6 +3242,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_filter_next_instanced(ecs_iter_t* it); @@ -3197,10 +3259,12 @@ public static unsafe partial class flecs // Function @ flecs.h:4272:9 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern ecs_world_t* ecs_get_world(ecs_poly_t* world); + + // Function @ flecs.h:2906:6 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_get_stage_count(ecs_world_t* world); @@ -3221,6 +3285,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_term_t ecs_term_move(ecs_term_t* src); @@ -3297,10 +3362,6 @@ public static unsafe partial class flecs // Function @ flecs.h:4214:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_defer_suspend(ecs_world_t* world); @@ -3327,10 +3388,6 @@ public static unsafe partial class flecs // Function @ meta.h:506:13 // x86_64-unknown-linux-gnu (flecs/addons/meta.h) // x86_64-apple-darwin (flecs/addons/meta.h) - // aarch64-pc-windows-msvc (flecs\addons\meta.h) - // x86_64-pc-windows-msvc (flecs\addons\meta.h) - // aarch64-unknown-linux-gnu (flecs/addons/meta.h) - // aarch64-apple-darwin (flecs/addons/meta.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_meta_get_string(ecs_meta_cursor_t* cursor); @@ -3411,18 +3468,15 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\stats.h) // aarch64-unknown-linux-gnu (flecs/addons/stats.h) // aarch64-apple-darwin (flecs/addons/stats.h) + // x86_64-apple-darwin (flecs/addons/stats.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_pipeline_stats_fini(ecs_pipeline_stats_t* stats); - // Function @ timer.h:72:14 - // x86_64-unknown-linux-gnu (flecs/addons/timer.h) - // x86_64-apple-darwin (flecs/addons/timer.h) - // aarch64-pc-windows-msvc (flecs\addons\timer.h) - // x86_64-pc-windows-msvc (flecs\addons\timer.h) - // aarch64-unknown-linux-gnu (flecs/addons/timer.h) - // aarch64-apple-darwin (flecs/addons/timer.h) + // Function @ flecs.h:3284:21 + // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern ecs_entity_t ecs_set_timeout(ecs_world_t* world, ecs_entity_t tick_source, float timeout); + public static extern ecs_filter_t* ecs_query_get_filter(ecs_query_t* query); // Function @ flecs.h:2381:13 // x86_64-unknown-linux-gnu @@ -3441,6 +3495,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_delete_empty_tables(ecs_world_t* world, ecs_id_t id, ushort clear_generation, ushort delete_generation, int min_id_count, double time_budget_seconds); @@ -3451,6 +3506,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_filter_find_this_var(ecs_filter_t* filter); @@ -3461,6 +3517,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_new_w_id(ecs_world_t* world, ecs_id_t id); @@ -3491,6 +3548,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_set_scope(ecs_world_t* world, ecs_entity_t scope); @@ -3501,6 +3559,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void* ecs_get_id(ecs_world_t* world, ecs_entity_t entity, ecs_id_t id); @@ -3521,6 +3580,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_frame_end(ecs_world_t* world); @@ -3561,6 +3621,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_world_t* ecs_init(); @@ -3571,6 +3632,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_merge(ecs_world_t* world); @@ -3624,23 +3686,21 @@ public static unsafe partial class flecs [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_system_stats_copy_last(ecs_system_stats_t* dst, ecs_system_stats_t* src); - // Function @ system.h:254:6 - // x86_64-unknown-linux-gnu (flecs/addons/system.h) - // x86_64-apple-darwin (flecs/addons/system.h) - // aarch64-pc-windows-msvc (flecs\addons\system.h) - // x86_64-pc-windows-msvc (flecs\addons\system.h) - // aarch64-unknown-linux-gnu (flecs/addons/system.h) - // aarch64-apple-darwin (flecs/addons/system.h) + // Function @ flecs.h:3414:9 + // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern void FlecsSystemImport(ecs_world_t* world); + public static extern int ecs_query_table_count(ecs_query_t* query); // Function @ flecs.h:2335:14 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern CBool ecs_term_is_set(ecs_iter_t* it, int index); + + // Function @ flecs.h:4067:8 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_set_name(ecs_world_t* world, ecs_entity_t entity, CString name); @@ -3661,6 +3721,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_iter_next(ecs_iter_t* it); @@ -3691,6 +3752,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_set_name_prefix(ecs_world_t* world, CString prefix); @@ -3727,20 +3789,36 @@ public static unsafe partial class flecs // Function @ flecs.h:1755:14 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void* ecs_get_observer_ctx(ecs_world_t* world, ecs_entity_t observer); + + // Function @ os_api.h:469:6 + // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern CBool ecs_os_has_heap(); + + // Function @ os_api.h:408:6 + // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ecs_os_enable_high_timer_resolution(CBool enable); + + // Function @ flecs.h:1301:14 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_clone(ecs_world_t* world, ecs_entity_t dst, ecs_entity_t src, CBool copy_value); // Function @ flecs.h:2307:13 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern CBool ecs_commit(ecs_world_t* world, ecs_entity_t entity, ecs_record_t* @record, ecs_table_t* table, ecs_type_t* added, ecs_type_t* removed); + + // Function @ flecs.h:3124:7 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_get_name(ecs_world_t* world, ecs_entity_t entity); @@ -3791,6 +3869,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_id_match(ecs_id_t id, ecs_id_t pattern); @@ -3831,6 +3910,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_get_typeid(ecs_world_t* world, ecs_id_t id); @@ -3851,6 +3931,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_table_storage_to_type_index(ecs_table_t* table, int index); @@ -3871,6 +3952,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_get_symbol(ecs_world_t* world, ecs_entity_t entity); @@ -3891,6 +3973,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_iter_is_true(ecs_iter_t* it); @@ -3931,6 +4014,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern int ecs_table_count(ecs_table_t* table); @@ -3941,6 +4025,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_table_t* ecs_table_remove_id(ecs_world_t* world, ecs_table_t* table, ecs_id_t id); @@ -4004,15 +4089,11 @@ public static unsafe partial class flecs [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_vasprintf(CString fmt, void* args); - // Function @ sparse.h:150:6 - // x86_64-unknown-linux-gnu (flecs/private/sparse.h) - // x86_64-apple-darwin (flecs/private/sparse.h) - // aarch64-pc-windows-msvc (flecs\private\sparse.h) - // x86_64-pc-windows-msvc (flecs\private\sparse.h) - // aarch64-unknown-linux-gnu (flecs/private/sparse.h) - // aarch64-apple-darwin (flecs/private/sparse.h) + // Function @ flecs_cpp.h:51:7 + // aarch64-apple-darwin (flecs/addons/flecs_cpp.h) + // x86_64-apple-darwin (flecs/addons/flecs_cpp.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool flecs_sparse_is_alive(ecs_sparse_t* sparse, ulong id); + public static extern CString ecs_cpp_get_constant_name(CString constant_name, CString func_name, ulong len); // Function @ meta.h:648:14 // x86_64-unknown-linux-gnu (flecs/addons/meta.h) @@ -4021,16 +4102,19 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\addons\meta.h) // aarch64-unknown-linux-gnu (flecs/addons/meta.h) // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_quantity_init(ecs_world_t* world, ecs_entity_desc_t* desc); // Function @ flecs.h:4180:6 // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] + public static extern CBool ecs_readonly_begin(ecs_world_t* world); + + // Function @ flecs.h:3486:7 // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_defer_begin(ecs_world_t* world); @@ -4041,6 +4125,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_quit(ecs_world_t* world); @@ -4101,6 +4186,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_query_next_instanced(ecs_iter_t* iter); @@ -4131,6 +4217,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_term_is_writeonly(ecs_iter_t* it, int index); @@ -4142,7 +4229,7 @@ public static unsafe partial class flecs // aarch64-unknown-linux-gnu (flecs/addons/expr.h) // aarch64-apple-darwin (flecs/addons/expr.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern ecs_size_t ecs_stresc(CString @out, ecs_size_t size, CChar delimiter, CString @in); + public static extern CString ecs_module_path_from_c(CString c_name); // Function @ os_api.h:485:6 // x86_64-unknown-linux-gnu (flecs/os_api.h) @@ -4251,6 +4338,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc (flecs\private\strbuf.h) // aarch64-unknown-linux-gnu (flecs/private/strbuf.h) // aarch64-apple-darwin (flecs/private/strbuf.h) + // x86_64-apple-darwin (flecs/private/strbuf.h) [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_strbuf_appendch(ecs_strbuf_t* buffer, CChar ch); @@ -4271,6 +4359,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_delete(ecs_world_t* world, ecs_entity_t entity); @@ -4291,6 +4380,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_enable(ecs_world_t* world, ecs_entity_t entity, CBool enabled); @@ -4331,6 +4421,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_type_t* ecs_get_type(ecs_world_t* world, ecs_entity_t entity); @@ -4351,6 +4442,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_world_t* ecs_get_world(ecs_poly_t* world); @@ -4371,6 +4463,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern void ecs_query_skip(ecs_iter_t* it); @@ -4441,6 +4534,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_table_t* ecs_iter_get_var_as_table(ecs_iter_t* it, int var_id); @@ -4461,6 +4555,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CString ecs_iter_str(ecs_iter_t* it); @@ -4601,6 +4696,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_commit(ecs_world_t* world, ecs_entity_t entity, ecs_record_t* @record, ecs_table_t* table, ecs_type_t* added, ecs_type_t* removed); @@ -4671,6 +4767,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ecs_id_is_wildcard(ecs_id_t id); @@ -4721,6 +4818,7 @@ public static unsafe partial class flecs // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern ecs_entity_t ecs_lookup_path_w_sep(ecs_world_t* world, ecs_entity_t parent, CString path, CString sep, CString prefix, CBool recursive); @@ -4759,11 +4857,6 @@ public static unsafe partial class flecs #region Types // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_thread_t_VoidPtr @@ -4774,10 +4867,6 @@ public struct FnPtr_Ecs_os_thread_t_VoidPtr // FunctionPointer @ NoLocation // x86_64-unknown-linux-gnu // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_IntPtr_Int { @@ -4785,12 +4874,8 @@ public struct FnPtr_IntPtr_Int } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_thread_callback_t_VoidPtr_Ecs_os_thread_t { @@ -4798,12 +4883,8 @@ public struct FnPtr_Ecs_os_thread_callback_t_VoidPtr_Ecs_os_thread_t } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_CString_Ecs_os_dl_t { @@ -4811,12 +4892,8 @@ public struct FnPtr_CString_Ecs_os_dl_t } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_dl_t_Void { @@ -4824,25 +4901,17 @@ public struct FnPtr_Ecs_os_dl_t_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] - public struct FnPtr_Void + public struct FnPtr_VoidPtr_Ecs_size_t_VoidPtr { - public delegate* unmanaged Pointer; + public delegate* unmanaged Pointer; } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_Ecs_size_t_VoidPtr { @@ -4850,12 +4919,8 @@ public struct FnPtr_VoidPtr_Ecs_size_t_VoidPtr } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_cond_t { @@ -4863,12 +4928,8 @@ public struct FnPtr_Ecs_os_cond_t } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_mutex_t_Void { @@ -4876,12 +4937,8 @@ public struct FnPtr_Ecs_os_mutex_t_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_Ecs_app_desc_tPtr_Int { @@ -4889,12 +4946,8 @@ public struct FnPtr_Ecs_world_tPtr_Ecs_app_desc_tPtr_Int } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_VoidPtr { @@ -4902,12 +4955,8 @@ public struct FnPtr_VoidPtr_VoidPtr } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_cond_t_Void { @@ -4915,12 +4964,8 @@ public struct FnPtr_Ecs_os_cond_t_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_Int { @@ -4928,12 +4973,8 @@ public struct FnPtr_Ecs_world_tPtr_Int } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_Ecs_table_tPtr_Ecs_entity_tPtr_VoidPtr_Int_Int_Int_Ecs_order_by_action_t_Void { @@ -4941,12 +4982,8 @@ public struct FnPtr_Ecs_world_tPtr_Ecs_table_tPtr_Ecs_entity_tPtr_VoidPtr_Int_In } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_iter_tPtr_Void { @@ -4954,12 +4991,8 @@ public struct FnPtr_Ecs_iter_tPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_Void { @@ -4967,12 +5000,8 @@ public struct FnPtr_Ecs_world_tPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_CString_CString { @@ -4980,12 +5009,8 @@ public struct FnPtr_CString_CString } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_mutex_t { @@ -4993,12 +5018,8 @@ public struct FnPtr_Ecs_os_mutex_t } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_time_tPtr_Void { @@ -5006,12 +5027,8 @@ public struct FnPtr_Ecs_time_tPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_cond_t_Ecs_os_mutex_t_Void { @@ -5019,12 +5036,8 @@ public struct FnPtr_Ecs_os_cond_t_Ecs_os_mutex_t_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_Ecs_poly_tPtr_Ecs_iter_tPtr_Ecs_term_tPtr_Void { @@ -5032,12 +5045,8 @@ public struct FnPtr_Ecs_world_tPtr_Ecs_poly_tPtr_Ecs_iter_tPtr_Ecs_term_tPtr_Voi } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_size_t_VoidPtr { @@ -5045,12 +5054,8 @@ public struct FnPtr_Ecs_size_t_VoidPtr } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_os_dl_t_CString_Ecs_os_proc_t { @@ -5058,12 +5063,8 @@ public struct FnPtr_Ecs_os_dl_t_CString_Ecs_os_proc_t } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_iter_tPtr_CBool { @@ -5071,12 +5072,8 @@ public struct FnPtr_Ecs_iter_tPtr_CBool } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ulong { @@ -5084,12 +5081,8 @@ public struct FnPtr_Ulong } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_Ecs_table_tPtr_Ecs_id_t_VoidPtr_Ulong { @@ -5097,12 +5090,8 @@ public struct FnPtr_Ecs_world_tPtr_Ecs_table_tPtr_Ecs_id_t_VoidPtr_Ulong } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Int_CString_Int_CString_Void { @@ -5110,12 +5099,8 @@ public struct FnPtr_Int_CString_Int_CString_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_CBool_Void { @@ -5123,12 +5108,8 @@ public struct FnPtr_CBool_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void { @@ -5136,12 +5117,8 @@ public struct FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_CString_VoidPtr_Ecs_entity_t { @@ -5149,12 +5126,8 @@ public struct FnPtr_Ecs_world_tPtr_CString_VoidPtr_Ecs_entity_t } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_entity_t_VoidPtr_Ecs_entity_t_VoidPtr_Int { @@ -5162,12 +5135,8 @@ public struct FnPtr_Ecs_entity_t_VoidPtr_Ecs_entity_t_VoidPtr_Int } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_VoidPtr_Int { @@ -5175,12 +5144,8 @@ public struct FnPtr_VoidPtr_VoidPtr_Int } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_world_tPtr_VoidPtr_Void { @@ -5188,12 +5153,8 @@ public struct FnPtr_Ecs_world_tPtr_VoidPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_Void { @@ -5201,12 +5162,8 @@ public struct FnPtr_VoidPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void { @@ -5214,12 +5171,8 @@ public struct FnPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_VoidPtr_Ulong { @@ -5227,12 +5180,8 @@ public struct FnPtr_VoidPtr_Ulong } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Int_Int_Void { @@ -5240,12 +5189,8 @@ public struct FnPtr_Int_Int_Void } // FunctionPointer @ NoLocation - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct FnPtr_Ecs_http_request_tPtr_Ecs_http_reply_tPtr_VoidPtr_CBool { @@ -5265,6 +5210,15 @@ public struct ecs_event_desc_t [FieldOffset(0)] // size = 8, padding = 0 public ecs_entity_t @event; + // Struct @ expr.h:106:16 + // aarch64-apple-darwin (flecs/addons/expr.h) + // x86_64-apple-darwin (flecs/addons/expr.h) + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] + public struct ecs_parse_expr_desc_t + { + [FieldOffset(0)] // size = 8, padding = 0 + public CString name; + [FieldOffset(8)] // size = 8, padding = 0 public ecs_type_t* ids; @@ -5279,6 +5233,7 @@ public struct ecs_event_desc_t [FieldOffset(36)] // size = 4, padding = 0 public int count; + } [FieldOffset(40)] // size = 8, padding = 0 public void* param; @@ -6801,12 +6756,8 @@ public struct ecs_worker_iter_t } // Union @ api_types.h:221:5 - // x86_64-unknown-linux-gnu (flecs/private/api_types.h) - // x86_64-apple-darwin (flecs/private/api_types.h) - // aarch64-pc-windows-msvc (flecs\private\api_types.h) - // x86_64-pc-windows-msvc (flecs\private\api_types.h) - // aarch64-unknown-linux-gnu (flecs/private/api_types.h) // aarch64-apple-darwin (flecs/private/api_types.h) + // x86_64-apple-darwin (flecs/private/api_types.h) [StructLayout(LayoutKind.Explicit, Size = 1152, Pack = 8)] public struct ecs_iter_private_t_ANONYMOUS_FIELD0 { @@ -7520,24 +7471,17 @@ public Span members } } - // Struct @ meta.h:630:16 - // x86_64-unknown-linux-gnu (flecs/addons/meta.h) - // x86_64-apple-darwin (flecs/addons/meta.h) - // aarch64-pc-windows-msvc (flecs\addons\meta.h) - // x86_64-pc-windows-msvc (flecs\addons\meta.h) - // aarch64-unknown-linux-gnu (flecs/addons/meta.h) - // aarch64-apple-darwin (flecs/addons/meta.h) - [StructLayout(LayoutKind.Explicit, Size = 336, Pack = 8)] - public struct ecs_unit_prefix_desc_t + // Struct @ hashmap.h:18:9 + // aarch64-apple-darwin (flecs/private/hashmap.h) + // x86_64-apple-darwin (flecs/private/hashmap.h) + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] + public struct ecs_hm_bucket_t { - [FieldOffset(0)] // size = 320, padding = 0 - public ecs_entity_desc_t entity; - - [FieldOffset(320)] // size = 8, padding = 0 - public CString symbol; + [FieldOffset(0)] // size = 8, padding = 0 + public ecs_vector_t* keys; - [FieldOffset(328)] // size = 8, padding = 0 - public ecs_unit_translation_t translation; + [FieldOffset(8)] // size = 8, padding = 0 + public ecs_vector_t* values; } // Struct @ http.h:43:9 @@ -7824,13 +7768,78 @@ public struct ecs_member_t public ecs_entity_t member; } + // Struct @ flecs.h:3490:16 + // aarch64-apple-darwin + // x86_64-apple-darwin + [StructLayout(LayoutKind.Explicit, Size = 72, Pack = 8)] + public struct ecs_event_desc_t + { + [FieldOffset(0)] // size = 8, padding = 0 + public ecs_entity_t @event; + + [FieldOffset(8)] // size = 8, padding = 0 + public ecs_type_t* ids; + + [FieldOffset(16)] // size = 8, padding = 0 + public ecs_table_t* table; + + [FieldOffset(24)] // size = 8, padding = 0 + public ecs_table_t* other_table; + + [FieldOffset(32)] // size = 4, padding = 0 + public int offset; + + [FieldOffset(36)] // size = 4, padding = 0 + public int count; + + [FieldOffset(40)] // size = 8, padding = 0 + public void* param; + + [FieldOffset(48)] // size = 8, padding = 0 + public ecs_poly_t* observable; + + [FieldOffset(56)] // size = 1, padding = 7 + public CBool table_event; + + [FieldOffset(64)] // size = 8, padding = 0 + public ecs_entity_t relation; + } + + // Struct @ monitor.h:42:9 + // aarch64-apple-darwin (flecs/addons/monitor.h) + // x86_64-apple-darwin (flecs/addons/monitor.h) + [StructLayout(LayoutKind.Explicit, Size = 43220, Pack = 4)] + public struct EcsWorldStats + { + [FieldOffset(0)] // size = 8, padding = 0 + public EcsStatsHeader hdr; + + [FieldOffset(8)] // size = 43212, padding = 0 + public ecs_world_stats_t stats; + } + + // Struct @ strbuf.h:30:16 + // aarch64-apple-darwin (flecs/private/strbuf.h) + // x86_64-apple-darwin (flecs/private/strbuf.h) + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] + public struct ecs_strbuf_element + { + [FieldOffset(0)] // size = 1, padding = 3 + public CBool buffer_embedded; + + [FieldOffset(4)] // size = 4, padding = 0 + public int pos; + + [FieldOffset(8)] // size = 8, padding = 0 + public CString buf; + + [FieldOffset(16)] // size = 8, padding = 0 + public ecs_strbuf_element* next; + } + // Struct @ api_types.h:111:16 - // x86_64-unknown-linux-gnu (flecs/private/api_types.h) - // x86_64-apple-darwin (flecs/private/api_types.h) - // aarch64-pc-windows-msvc (flecs\private\api_types.h) - // x86_64-pc-windows-msvc (flecs\private\api_types.h) - // aarch64-unknown-linux-gnu (flecs/private/api_types.h) // aarch64-apple-darwin (flecs/private/api_types.h) + // x86_64-apple-darwin (flecs/private/api_types.h) [StructLayout(LayoutKind.Explicit, Size = 304, Pack = 8)] public struct ecs_term_iter_t { @@ -8102,48 +8111,51 @@ public struct EcsStatsHeader public int reduce_count; } - // Struct @ flecs.h:748:16 - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu + // Struct @ flecs.h:712:16 // aarch64-apple-darwin - [StructLayout(LayoutKind.Explicit, Size = 3192, Pack = 8)] - public struct ecs_query_desc_t + // x86_64-apple-darwin + [StructLayout(LayoutKind.Explicit, Size = 3112, Pack = 8)] + public struct ecs_filter_desc_t { [FieldOffset(0)] // size = 4, padding = 4 public int _canary; - [FieldOffset(8)] // size = 3112, padding = 0 - public ecs_filter_desc_t filter; - - [FieldOffset(3120)] // size = 8, padding = 0 - public ecs_entity_t order_by_component; + [FieldOffset(8)] // size = 8, padding = 3064 + public fixed byte _terms[8]; // ecs_term_t[16] - [FieldOffset(3128)] // size = 8, padding = 0 - public ecs_order_by_action_t order_by; + public Span terms + { + get + { + fixed (ecs_filter_desc_t* @this = &this) + { + var pointer = &@this->_terms[0]; + var span = new Span(pointer, 16); + return span; + } + } + } - [FieldOffset(3136)] // size = 8, padding = 0 - public ecs_sort_table_action_t sort_table; + [FieldOffset(3080)] // size = 8, padding = 0 + public ecs_term_t* terms_buffer; - [FieldOffset(3144)] // size = 8, padding = 0 - public ecs_id_t group_by_id; + [FieldOffset(3088)] // size = 4, padding = 0 + public int terms_buffer_count; - [FieldOffset(3152)] // size = 8, padding = 0 - public ecs_group_by_action_t group_by; + [FieldOffset(3092)] // size = 1, padding = 0 + public CBool filter; - [FieldOffset(3160)] // size = 8, padding = 0 - public void* group_by_ctx; + [FieldOffset(3093)] // size = 1, padding = 0 + public CBool instanced; - [FieldOffset(3168)] // size = 8, padding = 0 - public ecs_ctx_free_t group_by_ctx_free; + [FieldOffset(3094)] // size = 1, padding = 1 + public CBool match_empty_tables; - [FieldOffset(3176)] // size = 8, padding = 0 - public ecs_query_t* parent; + [FieldOffset(3096)] // size = 8, padding = 0 + public CString expr; - [FieldOffset(3184)] // size = 8, padding = 0 - public ecs_entity_t system; + [FieldOffset(3104)] // size = 8, padding = 0 + public CString name; } // Struct @ map.h:50:16 @@ -8325,8 +8337,8 @@ public Span max [StructLayout(LayoutKind.Explicit, Size = 3112, Pack = 8)] public struct ecs_filter_desc_t { - [FieldOffset(0)] // size = 4, padding = 4 - public int _canary; + [FieldOffset(0)] // size = 4, padding = 0 + public ecs_meta_type_op_kind_t kind; [FieldOffset(8)] // size = 8, padding = 3064 public fixed byte _terms[8]; // ecs_term_t[16] @@ -8398,13 +8410,106 @@ public struct ecs_query_iter_t public int skip_count; } - // Struct @ api_types.h:178:16 - // x86_64-unknown-linux-gnu (flecs/private/api_types.h) + // Struct @ meta.h:257:16 + // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public struct ecs_unit_translation_t + { + [FieldOffset(0)] // size = 4, padding = 0 + public int factor; + + [FieldOffset(4)] // size = 4, padding = 0 + public int power; + } + + // Struct @ flecs.h:394:16 + // aarch64-apple-darwin + // x86_64-apple-darwin + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] + public struct ecs_iterable_t + { + [FieldOffset(0)] // size = 8, padding = 0 + public ecs_iter_init_action_t init; + } + + // Struct @ api_types.h:143:16 + // aarch64-apple-darwin (flecs/private/api_types.h) // x86_64-apple-darwin (flecs/private/api_types.h) - // aarch64-pc-windows-msvc (flecs\private\api_types.h) - // x86_64-pc-windows-msvc (flecs\private\api_types.h) - // aarch64-unknown-linux-gnu (flecs/private/api_types.h) + [StructLayout(LayoutKind.Explicit, Size = 1152, Pack = 8)] + public struct ecs_filter_iter_t + { + [FieldOffset(0)] // size = 832, padding = 0 + public ecs_filter_t filter; + + [FieldOffset(832)] // size = 4, padding = 4 + public ecs_iter_kind_t kind; + + [FieldOffset(840)] // size = 304, padding = 0 + public ecs_term_iter_t term_iter; + + [FieldOffset(1144)] // size = 4, padding = 0 + public int matches_left; + + [FieldOffset(1148)] // size = 4, padding = 0 + public int pivot_term; + } + + // Struct @ api_types.h:220:16 + // aarch64-apple-darwin (flecs/private/api_types.h) + // x86_64-apple-darwin (flecs/private/api_types.h) + [StructLayout(LayoutKind.Explicit, Size = 1400, Pack = 8)] + public struct ecs_iter_private_t + { + [FieldOffset(0)] // size = 1152, padding = 0 + public ecs_iter_private_t_ANONYMOUS_FIELD0 iter; + + [FieldOffset(1152)] // size = 248, padding = 0 + public ecs_iter_cache_t cache; + } + + // Struct @ meta.h:544:16 + // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) + [StructLayout(LayoutKind.Explicit, Size = 1088, Pack = 8)] + public struct ecs_bitmask_desc_t + { + [FieldOffset(0)] // size = 320, padding = 0 + public ecs_entity_desc_t entity; + + [FieldOffset(320)] // size = 8, padding = 760 + public fixed byte _constants[8]; // ecs_bitmask_constant_t[32] + + public Span constants + { + get + { + fixed (ecs_bitmask_desc_t* @this = &this) + { + var pointer = &@this->_constants[0]; + var span = new Span(pointer, 32); + return span; + } + } + } + } + + // Struct @ os_api.h:31:16 + // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public struct ecs_time_t + { + [FieldOffset(0)] // size = 4, padding = 0 + public uint sec; + + [FieldOffset(4)] // size = 4, padding = 0 + public uint nanosec; + } + + // Struct @ api_types.h:178:16 // aarch64-apple-darwin (flecs/private/api_types.h) + // x86_64-apple-darwin (flecs/private/api_types.h) [StructLayout(LayoutKind.Explicit, Size = 56, Pack = 8)] public struct ecs_rule_iter_t { @@ -8505,18 +8610,23 @@ public struct ecs_rule_op_ctx_t [StructLayout(LayoutKind.Sequential)] public struct ecs_id_record_t { - } + [FieldOffset(0)] // size = 4, padding = 0 + public int first_; - // OpaqueType @ api_types.h:46:39 - // x86_64-unknown-linux-gnu (flecs/private/api_types.h) - // x86_64-apple-darwin (flecs/private/api_types.h) - // aarch64-pc-windows-msvc (flecs\private\api_types.h) - // x86_64-pc-windows-msvc (flecs\private\api_types.h) - // aarch64-unknown-linux-gnu (flecs/private/api_types.h) - // aarch64-apple-darwin (flecs/private/api_types.h) - [StructLayout(LayoutKind.Sequential)] - public struct ecs_query_table_node_t - { + [FieldOffset(4)] // size = 960, padding = 0 + public ecs_metric_t matched_table_count; + + [FieldOffset(964)] // size = 960, padding = 0 + public ecs_metric_t matched_empty_table_count; + + [FieldOffset(1924)] // size = 960, padding = 0 + public ecs_metric_t matched_entity_count; + + [FieldOffset(2884)] // size = 4, padding = 0 + public int last_; + + [FieldOffset(2888)] // size = 4, padding = 0 + public int t; } // OpaqueType @ vector.h:53:29 @@ -8529,27 +8639,52 @@ public struct ecs_query_table_node_t [StructLayout(LayoutKind.Sequential)] public struct ecs_vector_t { + [FieldOffset(0)] // size = 8, padding = 0 + public ecs_world_t* world; + + [FieldOffset(8)] // size = 8, padding = 2040 + public fixed byte _scope[8]; // ecs_meta_scope_t[32] + + public Span scope + { + get + { + fixed (ecs_meta_cursor_t* @this = &this) + { + var pointer = &@this->_scope[0]; + var span = new Span(pointer, 32); + return span; + } + } + } + + [FieldOffset(2056)] // size = 4, padding = 0 + public int depth; + + [FieldOffset(2060)] // size = 1, padding = 0 + public CBool valid; + + [FieldOffset(2061)] // size = 1, padding = 2 + public CBool is_primitive_scope; + + [FieldOffset(2064)] // size = 8, padding = 0 + public FnPtr_Ecs_world_tPtr_CString_VoidPtr_Ecs_entity_t lookup_action; + + [FieldOffset(2072)] // size = 8, padding = 0 + public void* lookup_ctx; } - // OpaqueType @ flecs.h:179:28 - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu - // aarch64-apple-darwin + // OpaqueType @ api_types.h:43:32 + // aarch64-apple-darwin (flecs/private/api_types.h) + // x86_64-apple-darwin (flecs/private/api_types.h) [StructLayout(LayoutKind.Sequential)] - public struct ecs_table_t + public struct ecs_id_record_t { } // OpaqueType @ snapshot.h:23:31 - // x86_64-unknown-linux-gnu (flecs/addons/snapshot.h) - // x86_64-apple-darwin (flecs/addons/snapshot.h) - // aarch64-pc-windows-msvc (flecs\addons\snapshot.h) - // x86_64-pc-windows-msvc (flecs\addons\snapshot.h) - // aarch64-unknown-linux-gnu (flecs/addons/snapshot.h) // aarch64-apple-darwin (flecs/addons/snapshot.h) + // x86_64-apple-darwin (flecs/addons/snapshot.h) [StructLayout(LayoutKind.Sequential)] public struct ecs_snapshot_t { @@ -8562,6 +8697,7 @@ public struct ecs_snapshot_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct ecs_poly_t { @@ -8574,6 +8710,7 @@ public struct ecs_poly_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct ecs_rule_t { @@ -8587,7 +8724,7 @@ public struct ecs_rule_t // aarch64-unknown-linux-gnu // aarch64-apple-darwin [StructLayout(LayoutKind.Sequential)] - public struct ecs_query_t + public struct ecs_query_table_node_t { } @@ -8598,6 +8735,7 @@ public struct ecs_query_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Sequential)] public struct ecs_world_t { @@ -8613,6 +8751,11 @@ public struct ecs_world_t [StructLayout(LayoutKind.Sequential)] public struct ecs_mixins_t { + [FieldOffset(0)] // size = 1, padding = 0 + public byte Data; + + public static implicit operator byte(ecs_flags8_t data) => data.Data; + public static implicit operator ecs_flags8_t(byte data) => new() { Data = data }; } // TypeAlias @ flecs.h:337:16 @@ -8724,6 +8867,7 @@ public struct ecs_os_api_abort_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_mutex_new_t { @@ -8741,6 +8885,7 @@ public struct ecs_os_api_mutex_new_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_strdup_t { @@ -8758,6 +8903,7 @@ public struct ecs_os_api_strdup_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_cond_broadcast_t { @@ -8788,10 +8934,19 @@ public struct ecs_os_api_dlclose_t // TypeAlias @ os_api.h:155:12 // x86_64-unknown-linux-gnu (flecs/os_api.h) // x86_64-apple-darwin (flecs/os_api.h) - // aarch64-pc-windows-msvc (flecs\os_api.h) - // x86_64-pc-windows-msvc (flecs\os_api.h) - // aarch64-unknown-linux-gnu (flecs/os_api.h) + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] + public struct ecs_os_thread_callback_t + { + [FieldOffset(0)] // size = 8, padding = 0 + public FnPtr_VoidPtr_VoidPtr Data; + + public static implicit operator FnPtr_VoidPtr_VoidPtr(ecs_os_thread_callback_t data) => data.Data; + public static implicit operator ecs_os_thread_callback_t(FnPtr_VoidPtr_VoidPtr data) => new() { Data = data }; + } + + // TypeAlias @ os_api.h:108:8 // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_now_t { @@ -8813,36 +8968,41 @@ public struct ecs_os_api_now_t public struct ecs_copy_t { [FieldOffset(0)] // size = 8, padding = 0 - public FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void Data; + public FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void Data; + + public static implicit operator FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void(ecs_copy_t data) => data.Data; + public static implicit operator ecs_copy_t(FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void data) => new() { Data = data }; + } + + // TypeAlias @ os_api.h:181:8 + // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] + public struct ecs_os_api_dlclose_t + { + [FieldOffset(0)] // size = 8, padding = 0 + public FnPtr_Ecs_os_dl_t_Void Data; - public static implicit operator FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void(ecs_copy_t data) => data.Data; - public static implicit operator ecs_copy_t(FnPtr_VoidPtr_VoidPtr_Int_Ecs_type_info_tPtr_Void data) => new() { Data = data }; + public static implicit operator FnPtr_Ecs_os_dl_t_Void(ecs_os_api_dlclose_t data) => data.Data; + public static implicit operator ecs_os_api_dlclose_t(FnPtr_Ecs_os_dl_t_Void data) => new() { Data = data }; } - // TypeAlias @ os_api.h:75:9 + // TypeAlias @ os_api.h:176:17 // x86_64-unknown-linux-gnu (flecs/os_api.h) // x86_64-apple-darwin (flecs/os_api.h) - // aarch64-pc-windows-msvc (flecs\os_api.h) - // x86_64-pc-windows-msvc (flecs\os_api.h) - // aarch64-unknown-linux-gnu (flecs/os_api.h) - // aarch64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] - public struct ecs_os_api_calloc_t + public struct ecs_os_api_get_time_t { [FieldOffset(0)] // size = 8, padding = 0 - public FnPtr_Ecs_size_t_VoidPtr Data; + public FnPtr_Ecs_time_tPtr_Void Data; - public static implicit operator FnPtr_Ecs_size_t_VoidPtr(ecs_os_api_calloc_t data) => data.Data; - public static implicit operator ecs_os_api_calloc_t(FnPtr_Ecs_size_t_VoidPtr data) => new() { Data = data }; + public static implicit operator FnPtr_Ecs_time_tPtr_Void(ecs_os_api_get_time_t data) => data.Data; + public static implicit operator ecs_os_api_get_time_t(FnPtr_Ecs_time_tPtr_Void data) => new() { Data = data }; } - // TypeAlias @ os_api.h:176:17 - // x86_64-unknown-linux-gnu (flecs/os_api.h) - // x86_64-apple-darwin (flecs/os_api.h) - // aarch64-pc-windows-msvc (flecs\os_api.h) - // x86_64-pc-windows-msvc (flecs\os_api.h) - // aarch64-unknown-linux-gnu (flecs/os_api.h) + // TypeAlias @ os_api.h:58:8 // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_dlproc_t { @@ -8928,6 +9088,7 @@ public struct ecs_os_api_mutex_lock_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_mutex_t { @@ -8962,6 +9123,7 @@ public struct ecs_iter_action_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_free_t { @@ -9064,6 +9226,7 @@ public struct ecs_xtor_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_cond_new_t { @@ -9077,10 +9240,19 @@ public struct ecs_os_api_cond_new_t // TypeAlias @ os_api.h:46:19 // x86_64-unknown-linux-gnu (flecs/os_api.h) // x86_64-apple-darwin (flecs/os_api.h) - // aarch64-pc-windows-msvc (flecs\os_api.h) - // x86_64-pc-windows-msvc (flecs\os_api.h) - // aarch64-unknown-linux-gnu (flecs/os_api.h) + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] + public struct ecs_os_api_cond_free_t + { + [FieldOffset(0)] // size = 8, padding = 0 + public FnPtr_Ecs_os_cond_t_Void Data; + + public static implicit operator FnPtr_Ecs_os_cond_t_Void(ecs_os_api_cond_free_t data) => data.Data; + public static implicit operator ecs_os_api_cond_free_t(FnPtr_Ecs_os_cond_t_Void data) => new() { Data = data }; + } + + // TypeAlias @ os_api.h:45:19 // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_dl_t { @@ -9098,6 +9270,7 @@ public struct ecs_os_dl_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_cond_free_t { @@ -9132,6 +9305,7 @@ public struct ecs_os_api_thread_new_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_cond_signal_t { @@ -9149,6 +9323,7 @@ public struct ecs_os_api_cond_signal_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_entity_t { @@ -9167,13 +9342,13 @@ public struct ecs_entity_t // aarch64-unknown-linux-gnu // aarch64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] - public struct ecs_run_action_t + public struct ecs_os_api_dlopen_t { [FieldOffset(0)] // size = 8, padding = 0 - public FnPtr_Ecs_iter_tPtr_Void Data; + public FnPtr_CString_Ecs_os_dl_t Data; - public static implicit operator FnPtr_Ecs_iter_tPtr_Void(ecs_run_action_t data) => data.Data; - public static implicit operator ecs_run_action_t(FnPtr_Ecs_iter_tPtr_Void data) => new() { Data = data }; + public static implicit operator FnPtr_CString_Ecs_os_dl_t(ecs_os_api_dlopen_t data) => data.Data; + public static implicit operator ecs_os_api_dlopen_t(FnPtr_CString_Ecs_os_dl_t data) => new() { Data = data }; } // TypeAlias @ os_api.h:44:19 @@ -9200,14 +9375,15 @@ public struct ecs_os_cond_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] - public struct ecs_order_by_action_t + public struct ecs_iter_action_t { [FieldOffset(0)] // size = 8, padding = 0 - public FnPtr_Ecs_entity_t_VoidPtr_Ecs_entity_t_VoidPtr_Int Data; + public FnPtr_Ecs_iter_tPtr_Void Data; - public static implicit operator FnPtr_Ecs_entity_t_VoidPtr_Ecs_entity_t_VoidPtr_Int(ecs_order_by_action_t data) => data.Data; - public static implicit operator ecs_order_by_action_t(FnPtr_Ecs_entity_t_VoidPtr_Ecs_entity_t_VoidPtr_Int data) => new() { Data = data }; + public static implicit operator FnPtr_Ecs_iter_tPtr_Void(ecs_iter_action_t data) => data.Data; + public static implicit operator ecs_iter_action_t(FnPtr_Ecs_iter_tPtr_Void data) => new() { Data = data }; } // TypeAlias @ flecs.h:346:15 @@ -9217,6 +9393,7 @@ public struct ecs_order_by_action_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_compare_action_t { @@ -9313,12 +9490,8 @@ public struct ecs_move_t } // TypeAlias @ flecs.h:164:18 - // x86_64-unknown-linux-gnu - // x86_64-apple-darwin - // aarch64-pc-windows-msvc - // x86_64-pc-windows-msvc - // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_id_t { @@ -9349,10 +9522,6 @@ public struct ecs_flags32_t // TypeAlias @ os_api.h:84:9 // x86_64-unknown-linux-gnu (flecs/os_api.h) // x86_64-apple-darwin (flecs/os_api.h) - // aarch64-pc-windows-msvc (flecs\os_api.h) - // x86_64-pc-windows-msvc (flecs\os_api.h) - // aarch64-unknown-linux-gnu (flecs/os_api.h) - // aarch64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_thread_callback_t { @@ -9387,6 +9556,7 @@ public struct ecs_http_reply_action_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_iter_fini_action_t { @@ -9404,6 +9574,7 @@ public struct ecs_iter_fini_action_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_thread_t { @@ -9414,21 +9585,17 @@ public struct ecs_os_thread_t public static implicit operator ecs_os_thread_t(UIntPtr data) => new() { Data = data }; } - // TypeAlias @ api_defines.h:100:18 - // x86_64-unknown-linux-gnu (flecs/private/api_defines.h) - // x86_64-apple-darwin (flecs/private/api_defines.h) - // aarch64-pc-windows-msvc (flecs\private\api_defines.h) - // x86_64-pc-windows-msvc (flecs\private\api_defines.h) - // aarch64-unknown-linux-gnu (flecs/private/api_defines.h) - // aarch64-apple-darwin (flecs/private/api_defines.h) + // TypeAlias @ flecs.h:337:16 + // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] - public struct ecs_flags64_t + public struct ecs_fini_action_t { [FieldOffset(0)] // size = 8, padding = 0 - public ulong Data; + public FnPtr_Ecs_world_tPtr_VoidPtr_Void Data; - public static implicit operator ulong(ecs_flags64_t data) => data.Data; - public static implicit operator ecs_flags64_t(ulong data) => new() { Data = data }; + public static implicit operator FnPtr_Ecs_world_tPtr_VoidPtr_Void(ecs_fini_action_t data) => data.Data; + public static implicit operator ecs_fini_action_t(FnPtr_Ecs_world_tPtr_VoidPtr_Void data) => new() { Data = data }; } // TypeAlias @ os_api.h:142:8 @@ -9472,6 +9639,7 @@ public struct ecs_app_frame_action_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_sort_table_action_t { @@ -9536,10 +9704,6 @@ public struct ecs_os_api_init_t // TypeAlias @ os_api.h:185:9 // x86_64-unknown-linux-gnu (flecs/os_api.h) // x86_64-apple-darwin (flecs/os_api.h) - // aarch64-pc-windows-msvc (flecs\os_api.h) - // x86_64-pc-windows-msvc (flecs\os_api.h) - // aarch64-unknown-linux-gnu (flecs/os_api.h) - // aarch64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_module_to_path_t { @@ -9574,6 +9738,7 @@ public struct ecs_os_api_thread_join_t // x86_64-pc-windows-msvc // aarch64-unknown-linux-gnu // aarch64-apple-darwin + // x86_64-apple-darwin [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_group_by_action_t { @@ -9608,6 +9773,7 @@ public struct ecs_hash_value_action_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_cond_wait_t { @@ -9625,6 +9791,7 @@ public struct ecs_os_api_cond_wait_t // x86_64-pc-windows-msvc (flecs\os_api.h) // aarch64-unknown-linux-gnu (flecs/os_api.h) // aarch64-apple-darwin (flecs/os_api.h) + // x86_64-apple-darwin (flecs/os_api.h) [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] public struct ecs_os_api_enable_high_timer_resolution_t { @@ -9653,12 +9820,8 @@ public struct ecs_os_api_mutex_free_t } // Enum @ meta.h:131:14 - // x86_64-unknown-linux-gnu (flecs/addons/meta.h) - // x86_64-apple-darwin (flecs/addons/meta.h) - // aarch64-pc-windows-msvc (flecs\addons\meta.h) - // x86_64-pc-windows-msvc (flecs\addons\meta.h) - // aarch64-unknown-linux-gnu (flecs/addons/meta.h) // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) public enum ecs_type_kind_t : int { EcsPrimitiveType = 0, @@ -9671,12 +9834,8 @@ public enum ecs_type_kind_t : int } // Enum @ meta.h:278:14 - // x86_64-unknown-linux-gnu (flecs/addons/meta.h) - // x86_64-apple-darwin (flecs/addons/meta.h) - // aarch64-pc-windows-msvc (flecs\addons\meta.h) - // x86_64-pc-windows-msvc (flecs\addons\meta.h) - // aarch64-unknown-linux-gnu (flecs/addons/meta.h) // aarch64-apple-darwin (flecs/addons/meta.h) + // x86_64-apple-darwin (flecs/addons/meta.h) public enum ecs_meta_type_op_kind_t : int { EcsOpArray = 0, @@ -9777,42 +9936,22 @@ public enum ecs_var_kind_t : int // aarch64-apple-darwin public enum ecs_oper_kind_t : int { - EcsAnd = 0, - EcsOr = 1, - EcsNot = 2, - EcsOptional = 3, - EcsAndFrom = 4, - EcsOrFrom = 5, - EcsNotFrom = 6 + EcsHttpGet = 0, + EcsHttpPost = 1, + EcsHttpPut = 2, + EcsHttpDelete = 3, + EcsHttpOptions = 4, + EcsHttpMethodUnsupported = 5 } - // Enum @ meta.h:150:14 - // x86_64-unknown-linux-gnu (flecs/addons/meta.h) - // x86_64-apple-darwin (flecs/addons/meta.h) - // aarch64-pc-windows-msvc (flecs\addons\meta.h) - // x86_64-pc-windows-msvc (flecs\addons\meta.h) - // aarch64-unknown-linux-gnu (flecs/addons/meta.h) - // aarch64-apple-darwin (flecs/addons/meta.h) - public enum ecs_primitive_kind_t : int - { - EcsBool = 1, - EcsChar = 2, - EcsByte = 3, - EcsU8 = 4, - EcsU16 = 5, - EcsU32 = 6, - EcsU64 = 7, - EcsI8 = 8, - EcsI16 = 9, - EcsI32 = 10, - EcsI64 = 11, - EcsF32 = 12, - EcsF64 = 13, - EcsUPtr = 14, - EcsIPtr = 15, - EcsString = 16, - EcsEntity = 17, - EcsPrimitiveKindLast = 17 + // Enum @ flecs.h:425:14 + // aarch64-apple-darwin + // x86_64-apple-darwin + public enum ecs_var_kind_t : int + { + EcsVarDefault = 0, + EcsVarIsEntity = 1, + EcsVarIsVariable = 2 } // MacroObject @ api_flags.h:114:9 @@ -9834,8 +9973,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:54:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableHasLifecycle = 768; + + // MacroObject @ api_flags.h:116:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsIdDontInherit = 128; @@ -9858,16 +9998,18 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:53:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsWorldQuitWorkers = 1; + + // MacroObject @ api_flags.h:123:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsIdExclusive = 64; // MacroObject @ api_flags.h:137:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsIterIsValid = 1; + + // MacroObject @ api_flags.h:20:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsTableHasRemoveActions = 328200; @@ -9930,8 +10072,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:61:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsEntityObservedAcyclic = 268435456; + + // MacroObject @ api_flags.h:19:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsIdHasOnRemove = 65536; @@ -10039,20 +10182,24 @@ public enum ecs_primitive_kind_t : int // aarch64-apple-darwin (flecs/addons/log.h) public const int ECS_INVALID_OPERATION = 1; - // MacroObject @ api_flags.h:117:9 - // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) + // MacroObject @ api_flags.h:112:9 + // aarch64-apple-darwin (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableIsPrefab = 4; + + // MacroObject @ log.h:479:9 + // aarch64-apple-darwin (flecs/addons/log.h) + // x86_64-apple-darwin (flecs/addons/log.h) + public static string ECS_YELLOW = ""; + + // MacroObject @ api_flags.h:114:9 // aarch64-apple-darwin (flecs/private/api_flags.h) - public const uint EcsTableIsDisabled = 128; + // x86_64-apple-darwin (flecs/private/api_flags.h) + public const uint EcsTableHasChildOf = 16; // MacroObject @ api_flags.h:21:9 - // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) - // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) // aarch64-apple-darwin (flecs/private/api_flags.h) + // x86_64-apple-darwin (flecs/private/api_flags.h) public const uint EcsWorldFini = 8; // MacroObject @ log.h:490:9 @@ -10146,10 +10293,7 @@ public enum ecs_primitive_kind_t : int // MacroObject @ log.h:459:9 // x86_64-unknown-linux-gnu (flecs/addons/log.h) // x86_64-apple-darwin (flecs/addons/log.h) - // aarch64-pc-windows-msvc (flecs\addons\log.h) - // x86_64-pc-windows-msvc (flecs\addons\log.h) - // aarch64-apple-darwin (flecs/addons/log.h) - public const int ECS_INCONSISTENT_COMPONENT_ID = 26; + public const int ECS_INCONSISTENT_NAME = 20; // MacroObject @ api_flags.h:147:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) @@ -10354,8 +10498,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ log.h:448:9 // x86_64-unknown-linux-gnu (flecs/addons/log.h) // x86_64-apple-darwin (flecs/addons/log.h) - // aarch64-pc-windows-msvc (flecs\addons\log.h) - // x86_64-pc-windows-msvc (flecs\addons\log.h) + public const int ECS_OUT_OF_RANGE = 5; + + // MacroObject @ log.h:438:9 // aarch64-apple-darwin (flecs/addons/log.h) public const int ECS_OPERATION_FAILED = 10; @@ -10370,10 +10515,7 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:67:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) - // aarch64-apple-darwin (flecs/private/api_flags.h) - public const uint EcsIdMarkedForDelete = 1073741824; + public const uint EcsIdOnDeleteRemove = 1; // MacroObject @ api_flags.h:116:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) @@ -10490,8 +10632,14 @@ public enum ecs_primitive_kind_t : int // MacroObject @ log.h:467:9 // x86_64-unknown-linux-gnu (flecs/addons/log.h) // x86_64-apple-darwin (flecs/addons/log.h) - // aarch64-pc-windows-msvc (flecs\addons\log.h) - // x86_64-pc-windows-msvc (flecs\addons\log.h) + public const int ECS_MODULE_UNDEFINED = 28; + + // MacroObject @ api_defines.h:161:9 + // aarch64-apple-darwin (flecs/private/api_defines.h) + // x86_64-apple-darwin (flecs/private/api_defines.h) + public const ulong ECS_COMPONENT_MASK = 72057594037927935; + + // MacroObject @ log.h:467:9 // aarch64-apple-darwin (flecs/addons/log.h) public const int ECS_COLUMN_IS_NOT_SHARED = 42; @@ -10522,8 +10670,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:30:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableHasPairs = 32; + + // MacroObject @ api_flags.h:137:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsEntityObserved = 2147483648; @@ -10618,16 +10767,18 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:131:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsFilterMatchAnything = 64; + + // MacroObject @ api_flags.h:60:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsTableMarkedForDelete = 1073741824; // MacroObject @ api_flags.h:127:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsIdHasOnSet = 131072; + + // MacroObject @ api_flags.h:127:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsTableHasOnRemove = 65536; @@ -10690,8 +10841,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ log.h:458:9 // x86_64-unknown-linux-gnu (flecs/addons/log.h) // x86_64-apple-darwin (flecs/addons/log.h) - // aarch64-pc-windows-msvc (flecs\addons\log.h) - // x86_64-pc-windows-msvc (flecs\addons\log.h) + public const int ECS_INVALID_OPERATION = 1; + + // MacroObject @ log.h:476:9 // aarch64-apple-darwin (flecs/addons/log.h) public const int ECS_COMPONENT_NOT_REGISTERED = 25; @@ -10834,8 +10986,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:19:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsAperiodicComponentMonitors = 4; + + // MacroObject @ api_flags.h:157:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsWorldReadonly = 2; @@ -10858,8 +11011,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ log.h:460:9 // x86_64-unknown-linux-gnu (flecs/addons/log.h) // x86_64-apple-darwin (flecs/addons/log.h) - // aarch64-pc-windows-msvc (flecs\addons\log.h) - // x86_64-pc-windows-msvc (flecs\addons\log.h) + public const int ECS_COLUMN_INDEX_OUT_OF_RANGE = 41; + + // MacroObject @ log.h:447:9 // aarch64-apple-darwin (flecs/addons/log.h) public const int ECS_INCONSISTENT_COMPONENT_ACTION = 27; @@ -10890,8 +11044,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ log.h:471:9 // x86_64-unknown-linux-gnu (flecs/addons/log.h) // x86_64-apple-darwin (flecs/addons/log.h) - // aarch64-pc-windows-msvc (flecs\addons\log.h) - // x86_64-pc-windows-msvc (flecs\addons\log.h) + public static string ECS_GREY = ""; + + // MacroObject @ log.h:481:9 // aarch64-apple-darwin (flecs/addons/log.h) public const int ECS_INVALID_WHILE_READONLY = 70; @@ -10946,17 +11101,25 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_defines.h:306:9 // x86_64-unknown-linux-gnu (flecs/private/api_defines.h) // x86_64-apple-darwin (flecs/private/api_defines.h) - // aarch64-pc-windows-msvc (flecs\private\api_defines.h) - // x86_64-pc-windows-msvc (flecs\private\api_defines.h) + public const ulong ECS_ROLE_MASK = 18374686479671623680; + + // MacroObject @ log.h:453:9 + // aarch64-apple-darwin (flecs/addons/log.h) + // x86_64-apple-darwin (flecs/addons/log.h) + public const int ECS_INVALID_COMPONENT_ALIGNMENT = 24; + + // MacroObject @ api_defines.h:307:9 // aarch64-apple-darwin (flecs/private/api_defines.h) public const ulong ECS_OR = 17870283321406128128; - // MacroObject @ api_flags.h:148:9 - // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) + // MacroObject @ api_flags.h:122:9 + // aarch64-apple-darwin (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableHasUnion = 4096; + + // MacroObject @ api_flags.h:148:9 // aarch64-apple-darwin (flecs/private/api_flags.h) + // x86_64-apple-darwin (flecs/private/api_flags.h) public const uint EcsQueryHasMonitor = 32; // MacroObject @ api_flags.h:60:9 @@ -10994,8 +11157,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:63:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableIsDisabled = 128; + + // MacroObject @ api_flags.h:113:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsIdHasUnSet = 262144; @@ -11013,7 +11177,8 @@ public enum ecs_primitive_kind_t : int // aarch64-pc-windows-msvc // x86_64-pc-windows-msvc // aarch64-apple-darwin - public const int EcsParent = 32; + // x86_64-apple-darwin + public const int EcsAll = 16; // MacroObject @ api_flags.h:155:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) @@ -11082,8 +11247,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:126:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableHasDtors = 512; + + // MacroObject @ api_flags.h:61:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsTableHasOnAdd = 32768; @@ -11154,8 +11320,9 @@ public enum ecs_primitive_kind_t : int // MacroObject @ api_flags.h:119:9 // x86_64-unknown-linux-gnu (flecs/private/api_flags.h) // x86_64-apple-darwin (flecs/private/api_flags.h) - // aarch64-pc-windows-msvc (flecs\private\api_flags.h) - // x86_64-pc-windows-msvc (flecs\private\api_flags.h) + public const uint EcsTableHasAddActions = 168200; + + // MacroObject @ api_flags.h:111:9 // aarch64-apple-darwin (flecs/private/api_flags.h) public const uint EcsTableHasDtors = 512; diff --git a/src/cs/production/flecs/flecs.csproj b/src/cs/production/flecs/flecs.csproj index 658bee6..6505332 100644 --- a/src/cs/production/flecs/flecs.csproj +++ b/src/cs/production/flecs/flecs.csproj @@ -13,5 +13,8 @@ false enable + + + \ No newline at end of file