|
|
|
@ -17,7 +17,9 @@ public unsafe struct World |
|
|
|
|
public World(ecs_world_t* handle) |
|
|
|
|
=> Handle = handle; |
|
|
|
|
|
|
|
|
|
public World(params string[] args) |
|
|
|
|
/// <summary> Initializes a new Flecs world. </summary> |
|
|
|
|
/// <param name="minimal"> If true, doesn't automatically import built-in modules. </param> |
|
|
|
|
public World(bool minimal = false) |
|
|
|
|
{ |
|
|
|
|
[UnmanagedCallersOnly] |
|
|
|
|
static void Abort() => throw new FlecsAbortException(); |
|
|
|
@ -27,14 +29,7 @@ public unsafe struct World |
|
|
|
|
api.abort_ = new FnPtr_Void { Pointer = &Abort }; |
|
|
|
|
ecs_os_set_api(&api); |
|
|
|
|
|
|
|
|
|
if (args?.Length > 0) { |
|
|
|
|
var ptr = Runtime.CStrings.CStringArray(args); |
|
|
|
|
Handle = ecs_init_w_args(args.Length, ptr); |
|
|
|
|
for (var i = 0; i < args.Length; i++) |
|
|
|
|
Marshal.FreeHGlobal(ptr[i]); |
|
|
|
|
} else { |
|
|
|
|
Handle = ecs_init(); |
|
|
|
|
} |
|
|
|
|
Handle = minimal ? ecs_mini() : ecs_init(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool Progress(TimeSpan delta) |
|
|
|
|