Skip to content

Instantly share code, notes, and snippets.

@genotrance
Last active December 26, 2023 14:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save genotrance/89e718eb6357578448343588bed72520 to your computer and use it in GitHub Desktop.
Save genotrance/89e718eb6357578448343588bed72520 to your computer and use it in GitHub Desktop.
Nim wrapper for flecs using nimterop
# nim c -d:flecsGit -r flecs.nim
import os
import nimterop/[cimport, build]
const
baseDir = getProjectCacheDir("nimflecs")
getHeader(
header = "flecs.h",
giturl = "https://github.com/SanderMertens/flecs",
outdir = baseDir
)
static:
cSkipSymbol(@[
"ECS_ROLE_MASK", "ECS_ENTITY_MASK",
"ECS_INSTANCEOF", "ECS_CHILDOF",
"ECS_TRAIT", "ECS_AND", "ECS_OR",
"ECS_XOR", "ECS_NOT", "ECS_SWITCH",
"ECS_CASE"
])
cIncludeDir(flecsPath.parentDir())
cDefine("FLECS_NO_CPP")
cImport(flecsPath, recurse = true, dynlib = flecsLPath, flags = "-G__=_ -E__,_ -F_")
# Resetting /home/.cache/nim/nimterop/nimflecs
# Copying libflecs.so to /home/flecs
# Including library /home/flecs/libflecs.so
# Importing /home/.cache/nim/nimterop/nimflecs/flecs.h
# Generated @ 2020-09-07T16:29:52-05:00
# Command line:
# /home/.nimble/pkgs/nimterop-0.6.11/nimterop/toast --preprocess -m:c --recurse -G__=_ -E__,_ -F_ --defines+=FLECS_NO_CPP --includeDirs+=/home/.cache/nim/nimterop/nimflecs --pnim --dynlib=/home/flecs/libflecs.so --symOverride=ECS_ROLE_MASK,ECS_ENTITY_MASK,ECS_INSTANCEOF,ECS_CHILDOF,ECS_TRAIT,ECS_AND,ECS_OR,ECS_XOR,ECS_NOT,ECS_SWITCH,ECS_CASE --nim:/home/programming/nimdevel/bin/nim /home/.cache/nim/nimterop/nimflecs/flecs.h -o /home/.cache/nim/nimterop/toastCache/nimterop_552430188.nim
# const 'ECS_UNUSED' has unsupported value '__attribute__((unused))'
# const 'ECS_ROLE_MASK' skipped
# const 'ECS_ENTITY_MASK' skipped
# const 'ECS_TYPE_ROLE_START' has unsupported value 'ECS_CHILDOF'
# const 'ECS_STRBUF_INIT' has unsupported value '(ecs_strbuf_t){0}'
# const 'ECS_INSTANCEOF' skipped
# const 'ECS_CHILDOF' skipped
# const 'ECS_TRAIT' skipped
# const 'ECS_AND' skipped
# const 'ECS_OR' skipped
# const 'ECS_XOR' skipped
# const 'ECS_NOT' skipped
# const 'ECS_CASE' skipped
# const 'ECS_SWITCH' skipped
# const 'EcsLastInternalComponentId' has unsupported value '(ecs_entity(EcsSystem))'
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
type va_list* {.importc, header:"<stdarg.h>".} = object
import macros
macro defineEnum(typ: untyped): untyped =
result = newNimNode(nnkStmtList)
# Enum mapped to distinct cint
result.add quote do:
type `typ`* = distinct cint
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
let
ni = newIdentNode(i)
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
if i[0] == '>': # cannot borrow `>` and `>=` from templates
let
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
result.add quote do:
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
else:
result.add quote do:
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
result.add quote do:
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
let
divop = newIdentNode("/") # `/`()
dlrop = newIdentNode("$") # `$`()
notop = newIdentNode("not") # `not`()
result.add quote do:
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
proc `dlrop`*(x: `typ`): string {.borrow.}
proc `notop`*(x: `typ`): `typ` {.borrow.}
{.pragma: impflecsHdr,
header: "/home/.cache/nim/nimterop/nimflecs/flecs.h".}
{.pragma: impflecsDyn,
dynlib: "/home/flecs/libflecs.so".}
{.experimental: "codeReordering".}
{.passC: "-DFLECS_NO_CPP".}
{.passC: "-I/home/.cache/nim/nimterop/nimflecs".}
defineEnum(ecs_match_kind_t) ## ```
## Describes how a filter should match components with a table.
## ```
defineEnum(EcsMatchFailureReason)
defineEnum(ecs_sig_inout_kind_t)
defineEnum(ecs_sig_from_kind_t) ## ```
## Type that is used by systems to indicate where to fetch a component from
## ```
defineEnum(ecs_sig_oper_kind_t) ## ```
## Type describing an operator used in an signature of a system signature
## ```
defineEnum(ecs_system_status_t) ## ```
## System status change callback
## ```
defineEnum(ecs_blob_header_kind_t)
const
false* = 0
true* = (not
false)
FLECS_EEcsComponent* = (1)
FLECS_EEcsComponentLifecycle* = (2)
FLECS_EEcsType* = (3)
FLECS_EEcsName* = (6)
FLECS_EEcsTrigger* = (4)
FLECS_EEcsSystem* = (5)
FLECS_EEcsTickSource* = (7)
FLECS_EEcsSignatureExpr* = (8)
FLECS_EEcsSignature* = (9)
FLECS_EEcsQuery* = (10)
FLECS_EEcsIterAction* = (11)
FLECS_EEcsContext* = (12)
FLECS_EEcsPipelineQuery* = (13)
FLECS_EEcsTimer* = (14)
FLECS_EEcsRateFilter* = (15)
ECS_STRBUF_ELEMENT_SIZE* = (511)
ECS_STRBUF_MAX_LIST_DEPTH* = (32)
EcsMatchDefault* = (0).ecs_match_kind_t
EcsMatchAll* = (EcsMatchDefault + 1).ecs_match_kind_t ## ```
## < Match all components in a type
## ```
EcsMatchAny* = (EcsMatchAll + 1).ecs_match_kind_t ## ```
## < Match one of the components in a type
## ```
EcsMatchExact* = (EcsMatchAny + 1).ecs_match_kind_t ## ```
## < Match the type exactly
## ```
EcsMatchOk* = (0).EcsMatchFailureReason
EcsMatchNotASystem* = (EcsMatchOk + 1).EcsMatchFailureReason
EcsMatchSystemIsATask* = (EcsMatchNotASystem + 1).EcsMatchFailureReason
EcsMatchEntityIsDisabled* = (EcsMatchSystemIsATask + 1).EcsMatchFailureReason
EcsMatchEntityIsPrefab* = (EcsMatchEntityIsDisabled + 1).EcsMatchFailureReason
EcsMatchFromSelf* = (EcsMatchEntityIsPrefab + 1).EcsMatchFailureReason
EcsMatchFromOwned* = (EcsMatchFromSelf + 1).EcsMatchFailureReason
EcsMatchFromShared* = (EcsMatchFromOwned + 1).EcsMatchFailureReason
EcsMatchFromContainer* = (EcsMatchFromShared + 1).EcsMatchFailureReason
EcsMatchFromEntity* = (EcsMatchFromContainer + 1).EcsMatchFailureReason
EcsMatchOrFromSelf* = (EcsMatchFromEntity + 1).EcsMatchFailureReason
EcsMatchOrFromOwned* = (EcsMatchOrFromSelf + 1).EcsMatchFailureReason
EcsMatchOrFromShared* = (EcsMatchOrFromOwned + 1).EcsMatchFailureReason
EcsMatchOrFromContainer* = (EcsMatchOrFromShared + 1).EcsMatchFailureReason
EcsMatchNotFromSelf* = (EcsMatchOrFromContainer + 1).EcsMatchFailureReason
EcsMatchNotFromOwned* = (EcsMatchNotFromSelf + 1).EcsMatchFailureReason
EcsMatchNotFromShared* = (EcsMatchNotFromOwned + 1).EcsMatchFailureReason
EcsMatchNotFromContainer* = (EcsMatchNotFromShared + 1).EcsMatchFailureReason
ECS_HI_COMPONENT_ID* = (256)
FLECS_TNULL* = 0
FLECS_T0* = 0
EcsInOut* = (0).ecs_sig_inout_kind_t
EcsIn* = (EcsInOut + 1).ecs_sig_inout_kind_t
EcsOut* = (EcsIn + 1).ecs_sig_inout_kind_t
EcsFromAny* = (0).ecs_sig_from_kind_t ## ```
## Get component from self (default)
## ```
EcsFromOwned* = (EcsFromAny + 1).ecs_sig_from_kind_t ## ```
## Get owned component from self
## ```
EcsFromShared* = (EcsFromOwned + 1).ecs_sig_from_kind_t ## ```
## Get shared component from self
## ```
EcsFromParent* = (EcsFromShared + 1).ecs_sig_from_kind_t ## ```
## Get component from container
## ```
EcsFromSystem* = (EcsFromParent + 1).ecs_sig_from_kind_t ## ```
## Get component from system
## ```
EcsFromEmpty* = (EcsFromSystem + 1).ecs_sig_from_kind_t ## ```
## Get entity handle by id
## ```
EcsFromEntity* = (EcsFromEmpty + 1).ecs_sig_from_kind_t ## ```
## Get component from other entity
## ```
EcsCascade* = (EcsFromEntity + 1).ecs_sig_from_kind_t ## ```
## Walk component in cascading (hierarchy) order
## ```
EcsOperAnd* = (0).ecs_sig_oper_kind_t
EcsOperOr* = (1).ecs_sig_oper_kind_t
EcsOperNot* = (2).ecs_sig_oper_kind_t
EcsOperOptional* = (3).ecs_sig_oper_kind_t
EcsOperAll* = (4).ecs_sig_oper_kind_t
EcsOperLast* = (5).ecs_sig_oper_kind_t
ECS_INVALID_HANDLE* = (1)
ECS_INVALID_PARAMETER* = (2)
ECS_INVALID_COMPONENT_ID* = (3)
ECS_INVALID_EXPRESSION* = (4)
ECS_INVALID_TYPE_EXPRESSION* = (5)
ECS_INVALID_SIGNATURE* = (6)
ECS_UNKNOWN_COMPONENT_ID* = (7)
ECS_UNKNOWN_TYPE_ID* = (8)
ECS_TYPE_NOT_AN_ENTITY* = (9)
ECS_MISSING_SYSTEM_CONTEXT* = (10)
ECS_NOT_A_COMPONENT* = (11)
ECS_INTERNAL_ERROR* = (12)
ECS_MORE_THAN_ONE_PREFAB* = (13)
ECS_ALREADY_DEFINED* = (14)
ECS_INVALID_COMPONENT_SIZE* = (15)
ECS_INVALID_COMPONENT_ALIGNMENT* = (16)
ECS_OUT_OF_MEMORY* = (17)
ECS_MODULE_UNDEFINED* = (18)
ECS_COLUMN_INDEX_OUT_OF_RANGE* = (19)
ECS_COLUMN_IS_NOT_SHARED* = (20)
ECS_COLUMN_IS_SHARED* = (21)
ECS_COLUMN_HAS_NO_DATA* = (22)
ECS_COLUMN_TYPE_MISMATCH* = (23)
ECS_INVALID_WHILE_MERGING* = (24)
ECS_INVALID_WHILE_ITERATING* = (25)
ECS_INVALID_FROM_WORKER* = (26)
ECS_UNRESOLVED_IDENTIFIER* = (27)
ECS_OUT_OF_RANGE* = (28)
ECS_COLUMN_IS_NOT_SET* = (29)
ECS_UNRESOLVED_REFERENCE* = (30)
ECS_THREAD_ERROR* = (31)
ECS_MISSING_OS_API* = (32)
ECS_TYPE_TOO_LARGE* = (33)
ECS_INVALID_PREFAB_CHILD_TYPE* = (34)
ECS_UNSUPPORTED* = (35)
ECS_NO_OUT_COLUMNS* = (36)
ECS_COLUMN_ACCESS_VIOLATION* = (37)
ECS_DESERIALIZE_COMPONENT_ID_CONFLICT* = (38)
ECS_DESERIALIZE_COMPONENT_SIZE_CONFLICT* = (39)
ECS_DESERIALIZE_FORMAT_ERROR* = (40)
ECS_INVALID_REACTIVE_SIGNATURE* = (41)
ECS_INCONSISTENT_COMPONENT_NAME* = (42)
ECS_TYPE_CONSTRAINT_VIOLATION* = (43)
ECS_COMPONENT_NOT_REGISTERED* = (44)
ECS_INCONSISTENT_COMPONENT_ID* = (45)
ECS_INVALID_CASE* = (46)
ECS_BLACK* = "\e[1;30m"
ECS_RED* = "\e[0;31m"
ECS_GREEN* = "\e[0;32m"
ECS_YELLOW* = "\e[0;33m"
ECS_BLUE* = "\e[0;34m"
ECS_MAGENTA* = "\e[0;35m"
ECS_CYAN* = "\e[0;36m"
ECS_WHITE* = "\e[1;37m"
ECS_GREY* = "\e[0;37m"
ECS_NORMAL* = "\e[0;49m"
ECS_BOLD* = "\e[1;49m"
EcsModule* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(0))
EcsPrefab* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(1))
EcsHidden* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(2))
EcsDisabled* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(3))
EcsDisabledIntern* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(4))
EcsInactive* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(5))
EcsOnDemand* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(6))
EcsMonitor* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(7))
EcsPipeline* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(8))
EcsOnAdd* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(9))
EcsOnRemove* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(10))
EcsOnSet* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(11))
EcsUnSet* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(12))
EcsPreFrame* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(13))
EcsOnLoad* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(14))
EcsPostLoad* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(15))
EcsPreUpdate* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(16))
EcsOnUpdate* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(17))
EcsOnValidate* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(18))
EcsPostUpdate* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(19))
EcsPreStore* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(20))
EcsOnStore* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(21))
EcsPostFrame* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(22))
EcsFlecs* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(23))
EcsFlecsCore* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(24))
EcsWorld* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(25))
EcsSingleton* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(26))
EcsWildcard* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(27))
EcsFirstUserComponentId* = (32)
EcsFirstUserEntityId* = (ECS_HI_COMPONENT_ID + typeof(ECS_HI_COMPONENT_ID)(32))
EcsSystemStatusNone* = (0).ecs_system_status_t
EcsSystemEnabled* = (EcsSystemStatusNone + 1).ecs_system_status_t
EcsSystemDisabled* = (EcsSystemEnabled + 1).ecs_system_status_t
EcsSystemActivated* = (EcsSystemDisabled + 1).ecs_system_status_t
EcsSystemDeactivated* = (EcsSystemActivated + 1).ecs_system_status_t
EcsStreamHeader* = (0).ecs_blob_header_kind_t
EcsTableSegment* = (EcsStreamHeader + 1).ecs_blob_header_kind_t ## ```
## Stream states
## ```
EcsFooterSegment* = (EcsTableSegment + 1).ecs_blob_header_kind_t
EcsTableHeader* = (EcsFooterSegment + 1).ecs_blob_header_kind_t ## ```
## Table segment
## ```
EcsTableTypeSize* = (EcsTableHeader + 1).ecs_blob_header_kind_t
EcsTableType* = (EcsTableTypeSize + 1).ecs_blob_header_kind_t
EcsTableSize* = (EcsTableType + 1).ecs_blob_header_kind_t
EcsTableColumn* = (EcsTableSize + 1).ecs_blob_header_kind_t
EcsTableColumnHeader* = (EcsTableColumn + 1).ecs_blob_header_kind_t
EcsTableColumnSize* = (EcsTableColumnHeader + 1).ecs_blob_header_kind_t
EcsTableColumnData* = (EcsTableColumnSize + 1).ecs_blob_header_kind_t
EcsTableColumnNameHeader* = (EcsTableColumnData + 1).ecs_blob_header_kind_t ## ```
## Name column (EcsName)
## ```
EcsTableColumnNameLength* = (EcsTableColumnNameHeader + 1).ecs_blob_header_kind_t
EcsTableColumnName* = (EcsTableColumnNameLength + 1).ecs_blob_header_kind_t
EcsStreamFooter* = (EcsTableColumnName + 1).ecs_blob_header_kind_t
type
ecs_flags32_t* {.importc, impflecsHdr.} = uint32
ecs_flags64_t* {.importc, impflecsHdr.} = uint64
ecs_size_t* {.importc, impflecsHdr.} = int32 ## ```
## Keep unsigned integers out of the codebase as they do more harm than good
## ```
ecs_vector_t* {.bycopy, impflecsHdr, importc: "struct ecs_vector_t".} = object
count*: int32
size*: int32
elem_size*: int64
ecs_comparator_t* {.importc, impflecsHdr.} = proc (p1: pointer; p2: pointer): cint {.
cdecl.}
ecs_sparse_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_map_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_bucket_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_map_key_t* {.importc, impflecsHdr.} = uint64
ecs_map_iter_t* {.bycopy, impflecsHdr, importc: "struct ecs_map_iter_t".} = object
map*: ptr ecs_map_t
bucket*: ptr ecs_bucket_t
bucket_index*: int32
element_index*: int32
payload*: pointer
ecs_switch_header_t* {.bycopy, impflecsHdr, importc: "struct ecs_switch_header_t".} = object
element*: int32
count*: int32
ecs_switch_node_t* {.bycopy, impflecsHdr, importc: "struct ecs_switch_node_t".} = object
next*: int32
prev*: int32
ecs_switch_t* {.bycopy, impflecsHdr, importc: "struct ecs_switch_t".} = object
min*: uint64
max*: uint64
headers*: ptr ecs_switch_header_t
nodes*: ptr ecs_vector_t
values*: ptr ecs_vector_t
ecs_strbuf_element* {.bycopy, impflecsHdr, importc: "struct ecs_strbuf_element".} = object
buffer_embedded*: bool
pos*: int32
buf*: cstring
next*: ptr ecs_strbuf_element
ecs_strbuf_element_embedded* {.bycopy, impflecsHdr,
importc: "struct ecs_strbuf_element_embedded".} = object
super*: ecs_strbuf_element
buf*: array[(511) + typeof((511))(1), cchar]
ecs_strbuf_element_str* {.bycopy, impflecsHdr,
importc: "struct ecs_strbuf_element_str".} = object
super*: ecs_strbuf_element
alloc_str*: cstring
ecs_strbuf_list_elem* {.bycopy, impflecsHdr,
importc: "struct ecs_strbuf_list_elem".} = object
count*: int32
separator*: cstring
ecs_strbuf_t* {.bycopy, impflecsHdr, importc: "struct ecs_strbuf_t".} = object
buf*: cstring ## ```
## When set by an application, append will write to this buffer
## ```
max*: int32 ## ```
## The maximum number of characters that may be printed
## ```
size*: int32 ## ```
## Size of elements minus current element
## ```
elementCount*: int32 ## ```
## The number of elements in use
## ```
firstElement*: ecs_strbuf_element_embedded ## ```
## Always allocate at least one element
## ```
current*: ptr ecs_strbuf_element ## ```
## The current element being appended to
## ```
list_stack*: array[(32), ecs_strbuf_list_elem] ## ```
## Stack that keeps track of number of list elements, used for conditionally
## inserting a separator
## ```
list_sp*: int32
ecs_time_t* {.bycopy, impflecsHdr, importc: "struct ecs_time_t".} = object
sec*: uint32
nanosec*: uint32
ecs_os_thread_t* {.importc, impflecsHdr.} = ptr uint ## ```
## Use handle types that _at least_ can store pointers
## ```
ecs_os_cond_t* {.importc, impflecsHdr.} = ptr uint
ecs_os_mutex_t* {.importc, impflecsHdr.} = ptr uint
ecs_os_dl_t* {.importc, impflecsHdr.} = ptr uint
ecs_os_proc_t* {.importc, impflecsHdr.} = proc () {.cdecl.}
ecs_os_api_init_t* {.importc, impflecsHdr.} = proc () {.cdecl.}
ecs_os_api_fini_t* {.importc, impflecsHdr.} = proc () {.cdecl.}
ecs_os_api_malloc_t* {.importc, impflecsHdr.} = proc (size: ecs_size_t): pointer {.
cdecl.}
ecs_os_api_free_t* {.importc, impflecsHdr.} = proc (`ptr`: pointer) {.cdecl.}
ecs_os_api_realloc_t* {.importc, impflecsHdr.} = proc (`ptr`: pointer;
size: ecs_size_t): pointer {.cdecl.}
ecs_os_api_calloc_t* {.importc, impflecsHdr.} = proc (size: ecs_size_t): pointer {.
cdecl.}
ecs_os_api_strdup_t* {.importc, impflecsHdr.} = proc (str: cstring): cstring {.cdecl.}
ecs_os_thread_callback_t* {.importc, impflecsHdr.} = proc (a1: pointer): pointer {.
cdecl.}
ecs_os_api_thread_new_t* {.importc, impflecsHdr.} = proc (
callback: ecs_os_thread_callback_t; param: pointer): ecs_os_thread_t {.cdecl.}
ecs_os_api_thread_join_t* {.importc, impflecsHdr.} = proc (thread: ecs_os_thread_t): pointer {.
cdecl.}
ecs_os_api_ainc_t* {.importc, impflecsHdr.} = proc (value: ptr int32): cint {.cdecl.}
ecs_os_api_mutex_new_t* {.importc, impflecsHdr.} = proc (): ecs_os_mutex_t {.cdecl.}
ecs_os_api_mutex_lock_t* {.importc, impflecsHdr.} = proc (mutex: ecs_os_mutex_t) {.
cdecl.}
ecs_os_api_mutex_unlock_t* {.importc, impflecsHdr.} = proc (mutex: ecs_os_mutex_t) {.
cdecl.}
ecs_os_api_mutex_free_t* {.importc, impflecsHdr.} = proc (mutex: ecs_os_mutex_t) {.
cdecl.}
ecs_os_api_cond_new_t* {.importc, impflecsHdr.} = proc (): ecs_os_cond_t {.cdecl.}
ecs_os_api_cond_free_t* {.importc, impflecsHdr.} = proc (cond: ecs_os_cond_t) {.cdecl.}
ecs_os_api_cond_signal_t* {.importc, impflecsHdr.} = proc (cond: ecs_os_cond_t) {.
cdecl.}
ecs_os_api_cond_broadcast_t* {.importc, impflecsHdr.} = proc (cond: ecs_os_cond_t) {.
cdecl.}
ecs_os_api_cond_wait_t* {.importc, impflecsHdr.} = proc (cond: ecs_os_cond_t;
mutex: ecs_os_mutex_t) {.cdecl.}
ecs_os_api_sleep_t* {.importc, impflecsHdr.} = proc (sec: int32; nanosec: int32) {.
cdecl.}
ecs_os_api_get_time_t* {.importc, impflecsHdr.} = proc (time_out: ptr ecs_time_t) {.
cdecl.}
ecs_os_api_log_t* {.importc, impflecsHdr.} = proc (fmt: cstring; args: va_list) {.cdecl.}
ecs_os_api_abort_t* {.importc, impflecsHdr.} = proc () {.cdecl.}
ecs_os_api_dlopen_t* {.importc, impflecsHdr.} = proc (libname: cstring): ecs_os_dl_t {.
cdecl.}
ecs_os_api_dlproc_t* {.importc, impflecsHdr.} = proc (lib: ecs_os_dl_t;
procname: cstring): ecs_os_proc_t {.cdecl.}
ecs_os_api_dlclose_t* {.importc, impflecsHdr.} = proc (lib: ecs_os_dl_t) {.cdecl.}
ecs_os_api_module_to_path_t* {.importc, impflecsHdr.} = proc (module_id: cstring): cstring {.
cdecl.}
ecs_os_api_t* {.bycopy, impflecsHdr, importc: "struct ecs_os_api_t".} = object
init*: ecs_os_api_init_t ## ```
## API init / deinit
## ```
fini*: ecs_os_api_fini_t
malloc*: ecs_os_api_malloc_t ## ```
## Memory management
## ```
realloc*: ecs_os_api_realloc_t
calloc*: ecs_os_api_calloc_t
free*: ecs_os_api_free_t
strdup*: ecs_os_api_strdup_t ## ```
## Strings
## ```
thread_new*: ecs_os_api_thread_new_t ## ```
## Threads
## ```
thread_join*: ecs_os_api_thread_join_t
ainc*: ecs_os_api_ainc_t ## ```
## Atomic incremenet / decrement
## ```
adec*: ecs_os_api_ainc_t
mutex_new*: ecs_os_api_mutex_new_t ## ```
## Mutex
## ```
mutex_free*: ecs_os_api_mutex_free_t
mutex_lock*: ecs_os_api_mutex_lock_t
mutex_unlock*: ecs_os_api_mutex_lock_t
cond_new*: ecs_os_api_cond_new_t ## ```
## Condition variable
## ```
cond_free*: ecs_os_api_cond_free_t
cond_signal*: ecs_os_api_cond_signal_t
cond_broadcast*: ecs_os_api_cond_broadcast_t
cond_wait*: ecs_os_api_cond_wait_t
sleep*: ecs_os_api_sleep_t ## ```
## Time
## ```
get_time*: ecs_os_api_get_time_t
log*: ecs_os_api_log_t ## ```
## Logging
## ```
log_error*: ecs_os_api_log_t
log_debug*: ecs_os_api_log_t
log_warning*: ecs_os_api_log_t
abort*: ecs_os_api_abort_t ## ```
## Application termination
## ```
dlopen*: ecs_os_api_dlopen_t ## ```
## Dynamic library loading
## ```
dlproc*: ecs_os_api_dlproc_t
dlclose*: ecs_os_api_dlclose_t
module_to_dl*: ecs_os_api_module_to_path_t ## ```
## Overridable function that translates from a logical module id to a
## shared library filename
## ```
module_to_etc*: ecs_os_api_module_to_path_t ## ```
## Overridable function that translates from a logical module id to a
## path that contains module-specif resources or assets
## ```
ecs_entity_t* {.importc, impflecsHdr.} = uint64 ## ```
## @defgroup api_types Basic API types
## @{
##
## An entity identifier.
## ```
ecs_type_t* {.importc, impflecsHdr.} = ptr ecs_vector_t ## ```
## A vector containing component identifiers used to describe a type.
## ```
ecs_world_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_snapshot_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_query_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_iter_t* {.importc, impflecsHdr, bycopy.} = object ## ```
## The ecs_iter_t struct allows applications to iterate tables.
## Queries and filters, among others, allow an application to iterate entities
## that match a certain set of components. Because of how data is stored
## internally, entiites with a given set of components may be stored in multiple
## consecutive arrays, stored across multiple tables. The ecs_iter_t type
## enables iteration across tables.
## ```
world*: ptr ecs_world_t ## ```
## < The world
## ```
system*: ecs_entity_t ## ```
## < The current system (if applicable)
## ```
columns*: ptr int32 ## ```
## < Mapping from query columns to table columns
## ```
table_count*: int32 ## ```
## < Active table count for query
## ```
inactive_table_count*: int32 ## ```
## < Inactive table count for query
## ```
column_count*: int32 ## ```
## < Number of columns for system
## ```
table*: ptr ecs_table_t ## ```
## < The current table.
## ```
table_columns*: pointer ## ```
## < Table component data
## ```
query*: ptr ecs_query_t ## ```
## < Current query being evaluated
## ```
references*: ptr ecs_ref_t ## ```
## < References to entities (from query)
## ```
components*: ptr ecs_entity_t ## ```
## < Components in current table
## ```
entities*: ptr ecs_entity_t ## ```
## < Entity identifiers
## ```
param*: pointer ## ```
## < User data passed system (EcsContext)
## ```
delta_time*: cfloat ## ```
## < Time elapsed since last frame
## ```
delta_system_time*: cfloat ## ```
## < Time elapsed since last system invocation
## ```
world_time*: cfloat ## ```
## < Time elapsed since start of simulation
## ```
frame_offset*: int32 ## ```
## < Offset relative to frame
## ```
table_offset*: int32 ## ```
## < Current active table being processed
## ```
offset*: int32 ## ```
## < Offset relative to current table
## ```
count*: int32 ## ```
## < Number of entities to process by system
## ```
total_count*: int32 ## ```
## < Total number of entities in table
## ```
triggered_by*: ptr ecs_entities_t ## ```
## < Component(s) that triggered the system
## ```
interrupted_by*: ecs_entity_t ## ```
## < When set, system execution is interrupted
## ```
iter*: Union_flecsh1
ecs_ref_t* {.importc, impflecsHdr, bycopy.} = object ## ```
## Non-opaque types
##
## Cached reference.
## ```
entity*: ecs_entity_t ## ```
## < Entity of the reference
## ```
component*: ecs_entity_t ## ```
## < Component of the reference
## ```
table*: pointer ## ```
## < Last known table
## ```
row*: int32 ## ```
## < Last known location in table
## ```
alloc_count*: int32 ## ```
## < Last known alloc count of table
## ```
stage*: ptr ecs_stage_t ## ```
## < Last known stage
## ```
record*: ptr ecs_record_t ## ```
## < Pointer to record, if in main stage
## ```
`ptr`*: pointer ## ```
## < Cached ptr
## ```
ecs_filter_t* {.bycopy, impflecsHdr, importc: "struct ecs_filter_t".} = object ## ```
## Filters alllow for ad-hoc quick filtering of entity tables.
## ```
`include`*: ecs_type_t ## ```
## < Components that should match
## ```
exclude*: ecs_type_t ## ```
## < Components that should not match
## ```
include_kind*: ecs_match_kind_t ## ```
## < Match kind for include components
## ```
exclude_kind*: ecs_match_kind_t ## ```
## < Match kind for exclude components
## ```
ecs_world_info_t* {.bycopy, impflecsHdr, importc: "struct ecs_world_info_t".} = object ## ```
## Type that contains various statistics of a world.
## ```
last_component_id*: ecs_entity_t ## ```
## < Last issued component entity id
## ```
last_id*: ecs_entity_t ## ```
## < Last issued entity id
## ```
min_id*: ecs_entity_t ## ```
## < First allowed entity id
## ```
max_id*: ecs_entity_t ## ```
## < Last allowed entity id
## ```
delta_time_raw*: cfloat ## ```
## < Raw delta time (no time scaling)
## ```
delta_time*: cfloat ## ```
## < Time passed to or computed by ecs_progress
## ```
time_scale*: cfloat ## ```
## < Time scale applied to delta_time
## ```
target_fps*: cfloat ## ```
## < Target fps
## ```
frame_time_total*: cfloat ## ```
## < Total time spent processing a frame
## ```
system_time_total*: cfloat ## ```
## < Total time spent in systems
## ```
merge_time_total*: cfloat ## ```
## < Total time spent in merges
## ```
world_time_total*: cfloat ## ```
## < Time elapsed in simulation
## ```
world_time_total_raw*: cfloat ## ```
## < Time elapsed in simulation (no scaling)
## ```
sleep_err*: cfloat ## ```
## < Measured sleep error
## ```
frame_count_total*: int32 ## ```
## < Total number of frames
## ```
merge_count_total*: int32 ## ```
## < Total number of merges
## ```
pipeline_build_count_total*: int32 ## ```
## < Total number of pipeline builds
## ```
systems_ran_frame*: int32 ## ```
## < Total number of systems ran in last frame
## ```
ecs_iter_action_t* {.importc, impflecsHdr.} = proc (it: ptr ecs_iter_t) {.cdecl.}
ecs_iter_next_action_t* {.importc, impflecsHdr.} = proc (it: ptr ecs_iter_t): bool {.
cdecl.}
ecs_compare_action_t* {.importc, impflecsHdr.} = proc (e1: ecs_entity_t;
ptr1: pointer; e2: ecs_entity_t; ptr2: pointer): cint {.cdecl.}
ecs_rank_type_action_t* {.importc, impflecsHdr.} = proc (world: ptr ecs_world_t;
rank_component: ecs_entity_t; `type`: ecs_type_t): int32 {.cdecl.}
ecs_module_action_t* {.importc, impflecsHdr.} = proc (world: ptr ecs_world_t) {.cdecl.}
ecs_fini_action_t* {.importc, impflecsHdr.} = proc (world: ptr ecs_world_t;
ctx: pointer) {.cdecl.}
ecs_stage_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_table_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_record_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_column_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_data_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_entities_t* {.bycopy, impflecsHdr, importc: "struct ecs_entities_t".} = object ## ```
## Array of entity ids that, other than a type, can live on the stack
## ```
array*: ptr ecs_entity_t ## ```
## < An array with entity ids
## ```
count*: int32 ## ```
## < The number of entities in the array
## ```
ecs_page_cursor_t* {.bycopy, impflecsHdr, importc: "struct ecs_page_cursor_t".} = object
first*: int32
count*: int32
ecs_page_iter_t* {.bycopy, impflecsHdr, importc: "struct ecs_page_iter_t".} = object
offset*: int32
limit*: int32
remaining*: int32
ecs_scope_iter_t* {.bycopy, impflecsHdr, importc: "struct ecs_scope_iter_t".} = object ## ```
## Scope-iterator specific data
## ```
filter*: ecs_filter_t
tables*: ptr ecs_vector_t
index*: int32
ecs_filter_iter_t* {.bycopy, impflecsHdr, importc: "struct ecs_filter_iter_t".} = object ## ```
## Filter-iterator specific data
## ```
filter*: ecs_filter_t
tables*: ptr ecs_sparse_t
index*: int32
ecs_query_iter_t* {.bycopy, impflecsHdr, importc: "struct ecs_query_iter_t".} = object ## ```
## Query-iterator specific data
## ```
query*: ptr ecs_query_t
page_iter*: ecs_page_iter_t
index*: int32
sparse_smallest*: int32
sparse_first*: int32
ecs_snapshot_iter_t* {.bycopy, impflecsHdr, importc: "struct ecs_snapshot_iter_t".} = object ## ```
## Query-iterator specific data
## ```
filter*: ecs_filter_t
tables*: ptr ecs_vector_t ## ```
## ecs_table_leaf_t
## ```
index*: int32 ## ```
## ecs_table_leaf_t
## ```
Union_flecsh1* {.union, bycopy, impflecsHdr, importc: "union Union_flecsh1".} = object
parent*: ecs_scope_iter_t
filter*: ecs_filter_iter_t
query*: ecs_query_iter_t
snapshot*: ecs_snapshot_iter_t
ecs_match_failure_t* {.bycopy, impflecsHdr, importc: "struct ecs_match_failure_t".} = object
reason*: EcsMatchFailureReason
column*: int32
ecs_xtor_t* {.importc, impflecsHdr.} = proc (world: ptr ecs_world_t;
component: ecs_entity_t; entity_ptr: ptr ecs_entity_t; `ptr`: pointer;
size: uint; count: int32; ctx: pointer) {.cdecl.}
ecs_copy_t* {.importc, impflecsHdr.} = proc (world: ptr ecs_world_t;
component: ecs_entity_t; dst_entity: ptr ecs_entity_t;
src_entity: ptr ecs_entity_t; dst_ptr: pointer; src_ptr: pointer; size: uint;
count: int32; ctx: pointer) {.cdecl.}
ecs_move_t* {.importc, impflecsHdr.} = proc (world: ptr ecs_world_t;
component: ecs_entity_t; dst_entity: ptr ecs_entity_t;
src_entity: ptr ecs_entity_t; dst_ptr: pointer; src_ptr: pointer; size: uint;
count: int32; ctx: pointer) {.cdecl.}
Union_flecsh2* {.union, bycopy, impflecsHdr, importc: "union Union_flecsh2".} = object ## ```
## Is component read or written
## ```
`type`*: ptr ecs_vector_t ## ```
## Used for OR operator
## ```
component*: ecs_entity_t ## ```
## Used for AND operator
## ```
ecs_sig_column_t* {.bycopy, impflecsHdr, importc: "struct ecs_sig_column_t".} = object ## ```
## Type that describes a single column in the system signature
## ```
from_kind*: ecs_sig_from_kind_t ## ```
## Element kind (Entity, Component)
## ```
oper_kind*: ecs_sig_oper_kind_t ## ```
## Operator kind (AND, OR, NOT)
## ```
inout_kind*: ecs_sig_inout_kind_t ## ```
## Is component read or written
## ```
`is`*: Union_flecsh2 ## ```
## Is component read or written
## ```
source*: ecs_entity_t ## ```
## Source entity (used with FromEntity)
## ```
name*: cstring ## ```
## Name of column
## ```
ecs_sig_t* {.bycopy, impflecsHdr, importc: "struct ecs_sig_t".} = object ## ```
## Type that stores a parsed signature
## ```
name*: cstring ## ```
## Optional name used for debugging
## ```
expr*: cstring ## ```
## Original expression string
## ```
columns*: ptr ecs_vector_t ## ```
## Columns that contain parsed data
## ```
EcsName* {.bycopy, impflecsHdr, importc: "struct EcsName".} = object ## ```
## @}
##
## @defgroup builtin_types Builtin Types
## @{
##
## Entity name.
## ```
value*: cstring ## ```
## < Entity name
## ```
symbol*: cstring ## ```
## < Optional symbol name, if it differs from name
## ```
alloc_value*: cstring ## ```
## < If set, value will be freed on destruction
## ```
EcsComponent* {.bycopy, impflecsHdr, importc: "struct EcsComponent".} = object ## ```
## Component information.
## ```
size*: ecs_size_t ## ```
## < Component size
## ```
alignment*: ecs_size_t ## ```
## < Component alignment
## ```
EcsType* {.bycopy, impflecsHdr, importc: "struct EcsType".} = object ## ```
## Component that stores an ecs_type_t.
## This component allows for the creation of entities that represent a type, and
## therefore the creation of named types. This component is typically
## instantiated by ECS_TYPE.
## ```
`type`*: ecs_type_t ## ```
## < Preserved nested types
## ```
normalized*: ecs_type_t ## ```
## < Union of type and nested AND types
## ```
EcsComponentLifecycle* {.bycopy, impflecsHdr,
importc: "struct EcsComponentLifecycle".} = object ## ```
## Component that contains lifecycle callbacks for a component.
## ```
ctor*: ecs_xtor_t ## ```
## < Component constructor
## ```
dtor*: ecs_xtor_t ## ```
## < Component destructor
## ```
copy*: ecs_copy_t ## ```
## < Component copy
## ```
move*: ecs_move_t ## ```
## < Component move
## ```
ctx*: pointer ## ```
## < User defined context
## ```
EcsTrigger* {.bycopy, impflecsHdr, importc: "struct EcsTrigger".} = object ## ```
## Component used for registering component triggers
## ```
kind*: ecs_entity_t
action*: ecs_iter_action_t
component*: ecs_entity_t
self*: ecs_entity_t
ctx*: pointer
EcsTickSource* {.bycopy, impflecsHdr, importc: "struct EcsTickSource".} = object ## ```
## Component used to provide a tick source to systems
## ```
tick*: bool ## ```
## True if providing tick
## ```
time_elapsed*: cfloat ## ```
## Time elapsed since last tick
## ```
EcsSignatureExpr* {.bycopy, impflecsHdr, importc: "struct EcsSignatureExpr".} = object ## ```
## Signature expression
## ```
expr*: cstring
EcsSignature* {.bycopy, impflecsHdr, importc: "struct EcsSignature".} = object ## ```
## Parsed signature
## ```
signature*: ecs_sig_t
EcsQuery* {.bycopy, impflecsHdr, importc: "struct EcsQuery".} = object ## ```
## Query component
## ```
query*: ptr ecs_query_t
EcsIterAction* {.bycopy, impflecsHdr, importc: "struct EcsIterAction".} = object ## ```
## System action
## ```
action*: ecs_iter_action_t
EcsContext* {.bycopy, impflecsHdr, importc: "struct EcsContext".} = object ## ```
## System context
## ```
ctx*: pointer
ecs_system_status_action_t* {.importc, impflecsHdr.} = proc (
world: ptr ecs_world_t; system: ecs_entity_t; status: ecs_system_status_t;
ctx: pointer) {.cdecl.}
ecs_dbg_system_t* {.bycopy, impflecsHdr, importc: "struct ecs_dbg_system_t".} = object
system*: ecs_entity_t
entities_matched_count*: int32
active_table_count*: int32
inactive_table_count*: int32
enabled*: bool
system_data*: pointer
FlecsSystem* {.bycopy, impflecsHdr, importc: "struct FlecsSystem".} = object ## ```
## Module
##
## Pipeline component is empty: components and tags in module are static
## ```
dummy*: int32
FlecsPipeline* {.bycopy, impflecsHdr, importc: "struct FlecsPipeline".} = object ## ```
## Module
##
## Pipeline component is empty: components and tags in module are static
## ```
dummy*: int32
EcsTimer* {.bycopy, impflecsHdr, importc: "struct EcsTimer".} = object ## ```
## Component used for timer functionality
## ```
timeout*: cfloat ## ```
## Timer timeout period
## ```
time*: cfloat ## ```
## Incrementing time value
## ```
fired_count*: int32 ## ```
## Number of times ticked
## ```
active*: bool ## ```
## Is the timer active or not
## ```
single_shot*: bool ## ```
## Is this a single shot timer
## ```
EcsRateFilter* {.bycopy, impflecsHdr, importc: "struct EcsRateFilter".} = object ## ```
## Apply a rate filter to a tick source
## ```
src*: ecs_entity_t
rate*: int32
tick_count*: int32
time_elapsed*: cfloat ## ```
## Time elapsed since last tick
## ```
FlecsTimer* {.bycopy, impflecsHdr, importc: "struct FlecsTimer".} = object ## ```
## Module
##
## Timers module component
## ```
dummy*: int32
ecs_memory_stat_t* {.bycopy, impflecsHdr, importc: "struct ecs_memory_stat_t".} = object ## ```
## The naming convention of a metrics is:
## <name>_<unit>
##
## If the metric is a monotonically increasing count, the metric will have the
## suffix 'total'.
##
## If a member is of a composite type, it only has the metric name. A metric
## name will be plural if it is measured from multiple sources/objects.
##
## Type to keep track of memory that is in use vs. allocated
## ```
allocd_bytes*: int32 ## ```
## Memory allocated
## ```
used_bytes*: int32 ## ```
## Memory in use
## ```
EcsAllocStats* {.bycopy, impflecsHdr, importc: "struct EcsAllocStats".} = object ## ```
## Global statistics on memory allocations
## ```
malloc_count_total*: int64 ## ```
## Total number of times malloc was invoked
## ```
realloc_count_total*: int64 ## ```
## Total number of times realloc was invoked
## ```
calloc_count_total*: int64 ## ```
## Total number of times calloc was invoked
## ```
free_count_total*: int64 ## ```
## Total number of times free was invoked
## ```
EcsRowSystemMemoryStats* {.bycopy, impflecsHdr,
importc: "struct EcsRowSystemMemoryStats".} = object ## ```
## Memory statistics on row (reactive) systems
## ```
base_memory_bytes*: int32 ## ```
## Size of the component datatype
## ```
columns_memory*: ecs_memory_stat_t ## ```
## Memory in use for columns
## ```
components_memory*: ecs_memory_stat_t ## ```
## Memory in use for components
## ```
EcsSystemMemoryStats* {.bycopy, impflecsHdr,
importc: "struct EcsSystemMemoryStats".} = object ## ```
## Memory statistics on column (periodic) systems
## ```
base_memory_bytes*: int32 ## ```
## Size of the component datatype
## ```
columns_memory*: ecs_memory_stat_t ## ```
## Memory in use for columns
## ```
active_tables_memory*: ecs_memory_stat_t ## ```
## Memory in use for active tables
## ```
inactive_tables_memory*: ecs_memory_stat_t ## ```
## Memory in use for inactive tables
## ```
jobs_memory*: ecs_memory_stat_t ## ```
## Memory in use for jobs
## ```
other_memory_bytes*: int32 ## ```
## Remaining memory in use
## ```
EcsMemoryStats* {.bycopy, impflecsHdr, importc: "struct EcsMemoryStats".} = object ## ```
## Memory statistics for a world
## ```
dummy*: int32 ## ```
## Allow for {0} initialization
## ```
total_memory*: ecs_memory_stat_t ## ```
## Total amount of memory in use
## ```
entities_memory*: ecs_memory_stat_t ## ```
## Memory in use for entities
## ```
components_memory*: ecs_memory_stat_t ## ```
## Memory in use for components
## ```
systems_memory*: ecs_memory_stat_t ## ```
## Memory in use for systems
## ```
types_memory*: ecs_memory_stat_t ## ```
## Memory in use for types
## ```
tables_memory*: ecs_memory_stat_t ## ```
## Memory in use for tables
## ```
stages_memory*: ecs_memory_stat_t ## ```
## Memory in use for stages
## ```
world_memory*: ecs_memory_stat_t ## ```
## Memory in use for world
## ```
EcsComponentStats* {.bycopy, impflecsHdr, importc: "struct EcsComponentStats".} = object ## ```
## Component statistics
## ```
entity*: ecs_entity_t ## ```
## Entity handle of component
## ```
name*: cstring ## ```
## Entity name
## ```
size_bytes*: int32 ## ```
## Size of the component
## ```
memory*: ecs_memory_stat_t ## ```
## Memory in use for component
## ```
entities_count*: int32 ## ```
## Number of entities for component
## ```
tables_count*: int32 ## ```
## Number of tables for component
## ```
EcsSystemStats* {.bycopy, impflecsHdr, importc: "struct EcsSystemStats".} = object ## ```
## System statistics
## ```
entity*: ecs_entity_t ## ```
## Entity handle of component
## ```
name*: cstring ## ```
## Entity name
## ```
signature*: cstring ## ```
## System signature
## ```
phase*: ecs_entity_t ## ```
## System kind
## ```
period_seconds*: cfloat ## ```
## Period at which system runs
## ```
tables_matched_count*: int32 ## ```
## Number of tables matched
## ```
entities_matched_count*: int32 ## ```
## Number of entities matched
## ```
invoke_count_total*: int64 ## ```
## Number of times system got invoked
## ```
seconds_total*: cfloat ## ```
## Total time spent in system
## ```
is_enabled*: bool ## ```
## Is system enabled
## ```
is_active*: bool ## ```
## Is system active
## ```
is_hidden*: bool ## ```
## Is system hidden
## ```
EcsTypeStats* {.bycopy, impflecsHdr, importc: "struct EcsTypeStats".} = object ## ```
## Type statistics (only for named types, created with ECS_TYPE)
## ```
entity*: ecs_entity_t ## ```
## Entity handle of type
## ```
name*: cstring ## ```
## Type name
## ```
`type`*: ecs_type_t ## ```
## Reference to type with nesting intact
## ```
normalized_type*: ecs_type_t ## ```
## Reference to normalized type
## ```
entities_count*: int32 ## ```
## Number of plain entities in type
## ```
entities_childof_count*: int32 ## ```
## Number of CHILDOF entities in type
## ```
entities_instanceof_count*: int32 ## ```
## Number of INSTANCEOF entities in type
## ```
components_count*: int32 ## ```
## Number of components in type
## ```
col_systems_count*: int32 ## ```
## Number of column (periodic) systems in type
## ```
row_systems_count*: int32 ## ```
## Number of row (reactive) systems in type
## ```
enabled_systems_count*: int32 ## ```
## Number of enabled systems in type
## ```
active_systems_count*: int32 ## ```
## Number of active systems in type
## ```
instance_count*: int32 ## ```
## Number of instances of this type
## ```
is_hidden*: bool ## ```
## Is type hidden
## ```
EcsTableStats* {.bycopy, impflecsHdr, importc: "struct EcsTableStats".} = object ## ```
## Table statistics
## ```
`type`*: ecs_type_t ## ```
## Reference to table type
## ```
columns_count*: int32 ## ```
## Number of columns in table
## ```
rows_count*: int32 ## ```
## Number of rows (entities) in table
## ```
systems_matched_count*: int32 ## ```
## Number of systems matched
## ```
entity_memory*: ecs_memory_stat_t ## ```
## Memory in use for entity data
## ```
component_memory*: ecs_memory_stat_t ## ```
## Memory in use for table data
## ```
other_memory_bytes*: int32 ## ```
## Memory in use for other
## ```
EcsWorldStats* {.bycopy, impflecsHdr, importc: "struct EcsWorldStats".} = object ## ```
## World statistics
## ```
target_fps_hz*: cdouble ## ```
## Target FPS
## ```
tables_count*: int32 ## ```
## Number of tables in world
## ```
components_count*: int32 ## ```
## Number of components in world
## ```
col_systems_count*: int32 ## ```
## Number of column (periodic) systems in world
## ```
row_systems_count*: int32 ## ```
## Nunber of row (reactive) systems in world
## ```
inactive_systems_count*: int32 ## ```
## Number of inactive systems in world
## ```
entities_count*: int32 ## ```
## Number if entities in world
## ```
threads_count*: int32 ## ```
## Number of threads in world
## ```
frame_count_total*: int32 ## ```
## Total number of frames processed
## ```
frame_seconds_total*: cdouble ## ```
## Total time spent processing frames
## ```
system_seconds_total*: cdouble ## ```
## Total time spent in systems
## ```
merge_seconds_total*: cdouble ## ```
## Total time spent merging
## ```
world_seconds_total*: cdouble ## ```
## Total time passed since simulation start
## ```
fps_hz*: cdouble ## ```
## Frames per second (current)
## ```
FlecsStats* {.bycopy, impflecsHdr, importc: "struct FlecsStats".} = object ## ```
## Stats module component
## ```
FLECS_EEcsAllocStats*: ecs_entity_t
FLECS_TEcsAllocStats*: ecs_type_t
FLECS_EEcsWorldStats*: ecs_entity_t
FLECS_TEcsWorldStats*: ecs_type_t
FLECS_EEcsMemoryStats*: ecs_entity_t
FLECS_TEcsMemoryStats*: ecs_type_t
FLECS_EEcsSystemStats*: ecs_entity_t
FLECS_TEcsSystemStats*: ecs_type_t
FLECS_EEcsSystemMemoryStats*: ecs_entity_t
FLECS_TEcsSystemMemoryStats*: ecs_type_t
FLECS_EEcsRowSystemMemoryStats*: ecs_entity_t
FLECS_TEcsRowSystemMemoryStats*: ecs_type_t
FLECS_EEcsComponentStats*: ecs_entity_t
FLECS_TEcsComponentStats*: ecs_type_t
FLECS_EEcsTableStats*: ecs_entity_t
FLECS_TEcsTableStats*: ecs_type_t
FLECS_EEcsTablePtr*: ecs_entity_t
FLECS_TEcsTablePtr*: ecs_type_t
FLECS_EEcsTypeStats*: ecs_entity_t
FLECS_TEcsTypeStats*: ecs_type_t
ecs_dbg_entity_t* {.bycopy, impflecsHdr, importc: "struct ecs_dbg_entity_t".} = object
entity*: ecs_entity_t
table*: ptr ecs_table_t
`type`*: ecs_type_t
row*: int32
is_watched*: bool
ecs_dbg_table_t* {.bycopy, impflecsHdr, importc: "struct ecs_dbg_table_t".} = object
table*: ptr ecs_table_t
`type`*: ecs_type_t
shared*: ecs_type_t
container*: ecs_type_t
parent_entities*: ecs_type_t
base_entities*: ecs_type_t
systems_matched*: ptr ecs_vector_t
entities*: ptr ecs_entity_t
entities_count*: int32
ecs_queue_t* {.importc, impflecsHdr, incompleteStruct.} = object
ecs_table_reader_t* {.bycopy, impflecsHdr, importc: "struct ecs_table_reader_t".} = object
state*: ecs_blob_header_kind_t
table_index*: int32
table*: ptr ecs_table_t
data*: ptr ecs_data_t
type_written*: ecs_size_t ## ```
## Current index in type
## ```
`type`*: ecs_type_t
column_vector*: ptr ecs_vector_t ## ```
## Current column
## ```
column_index*: int32
total_columns*: int32
column_data*: pointer ## ```
## Keep track of how much of the component column has been written
## ```
column_size*: int16
column_alignment*: int16
column_written*: ecs_size_t
row_index*: int32 ## ```
## Keep track of row when writing non-blittable data
## ```
row_count*: int32
name*: cstring ## ```
## Keep track of how much of an entity name has been written
## ```
name_len*: ecs_size_t
name_written*: ecs_size_t
has_next_table*: bool
ecs_reader_t* {.bycopy, impflecsHdr, importc: "struct ecs_reader_t".} = object
world*: ptr ecs_world_t
state*: ecs_blob_header_kind_t
data_iter*: ecs_iter_t
data_next*: ecs_iter_next_action_t
component_iter*: ecs_iter_t
component_next*: ecs_iter_next_action_t
table*: ecs_table_reader_t
ecs_name_writer_t* {.bycopy, impflecsHdr, importc: "struct ecs_name_writer_t".} = object
name*: cstring
written*: int32
len*: int32
max_len*: int32
ecs_table_writer_t* {.bycopy, impflecsHdr, importc: "struct ecs_table_writer_t".} = object
state*: ecs_blob_header_kind_t
table*: ptr ecs_table_t
column_vector*: ptr ecs_vector_t
type_count*: int32 ## ```
## Keep state for parsing type
## ```
type_max_count*: int32
type_written*: ecs_size_t
type_array*: ptr ecs_entity_t
column_index*: int32
column_size*: int16
column_alignment*: int16
column_written*: ecs_size_t
column_data*: pointer
row_count*: int32
row_index*: int32
name*: ecs_name_writer_t
ecs_writer_t* {.bycopy, impflecsHdr, importc: "struct ecs_writer_t".} = object
world*: ptr ecs_world_t
state*: ecs_blob_header_kind_t
table*: ecs_table_writer_t
error*: cint
var
ecs_os_api_malloc_count* {.importc, impflecsDyn.}: int64 ## ```
## Allocation counters (not thread safe)
## ```
ecs_os_api_realloc_count* {.importc, impflecsDyn.}: int64
ecs_os_api_calloc_count* {.importc, impflecsDyn.}: int64
ecs_os_api_free_count* {.importc, impflecsDyn.}: int64
ecs_os_api* {.importc, impflecsDyn.}: ecs_os_api_t
FLECS_TEcsComponent* {.importc: "FLECS__TEcsComponent", impflecsDyn.}: ecs_type_t
FLECS_TEcsComponentLifecycle* {.importc: "FLECS__TEcsComponentLifecycle",
impflecsDyn.}: ecs_type_t
FLECS_TEcsType* {.importc: "FLECS__TEcsType", impflecsDyn.}: ecs_type_t
FLECS_TEcsName* {.importc: "FLECS__TEcsName", impflecsDyn.}: ecs_type_t
FLECS_TEcsTrigger* {.importc: "FLECS__TEcsTrigger", impflecsDyn.}: ecs_type_t
FLECS_TEcsSystem* {.importc: "FLECS__TEcsSystem", impflecsDyn.}: ecs_type_t
FLECS_TEcsTickSource* {.importc: "FLECS__TEcsTickSource", impflecsDyn.}: ecs_type_t
FLECS_TEcsSignatureExpr* {.importc: "FLECS__TEcsSignatureExpr", impflecsDyn.}: ecs_type_t
FLECS_TEcsSignature* {.importc: "FLECS__TEcsSignature", impflecsDyn.}: ecs_type_t
FLECS_TEcsQuery* {.importc: "FLECS__TEcsQuery", impflecsDyn.}: ecs_type_t
FLECS_TEcsIterAction* {.importc: "FLECS__TEcsIterAction", impflecsDyn.}: ecs_type_t
FLECS_TEcsContext* {.importc: "FLECS__TEcsContext", impflecsDyn.}: ecs_type_t
FLECS_TEcsTimer* {.importc: "FLECS__TEcsTimer", impflecsDyn.}: ecs_type_t
FLECS_TEcsRateFilter* {.importc: "FLECS__TEcsRateFilter", impflecsDyn.}: ecs_type_t
proc ecs_vector_new*(elem_size: ecs_size_t; offset: int16; elem_count: int32): ptr ecs_vector_t {.
importc: "_ecs_vector_new", cdecl, impflecsDyn.}
proc ecs_vector_from_array*(elem_size: ecs_size_t; offset: int16; elem_count: int32;
array: pointer): ptr ecs_vector_t {.
importc: "_ecs_vector_from_array", cdecl, impflecsDyn.}
proc ecs_vector_free*(vector: ptr ecs_vector_t) {.importc, cdecl, impflecsDyn.}
proc ecs_vector_clear*(vector: ptr ecs_vector_t) {.importc, cdecl, impflecsDyn.}
proc ecs_vector_add*(array_inout: ptr ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16): pointer {.importc: "_ecs_vector_add", cdecl,
impflecsDyn.}
proc ecs_vector_addn*(array_inout: ptr ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; elem_count: int32): pointer {.
importc: "_ecs_vector_addn", cdecl, impflecsDyn.}
proc ecs_vector_get*(vector: ptr ecs_vector_t; elem_size: ecs_size_t; offset: int16;
index: int32): pointer {.importc: "_ecs_vector_get", cdecl,
impflecsDyn.}
proc ecs_vector_last*(vector: ptr ecs_vector_t; elem_size: ecs_size_t; offset: int16): pointer {.
importc: "_ecs_vector_last", cdecl, impflecsDyn.}
proc ecs_vector_remove*(vector: ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; elem: pointer): int32 {.
importc: "_ecs_vector_remove", cdecl, impflecsDyn.}
proc ecs_vector_remove_last*(vector: ptr ecs_vector_t) {.importc, cdecl, impflecsDyn.}
proc ecs_vector_pop*(vector: ptr ecs_vector_t; elem_size: ecs_size_t; offset: int16;
value: pointer): bool {.importc: "_ecs_vector_pop", cdecl,
impflecsDyn.}
proc ecs_vector_move_index*(dst: ptr ptr ecs_vector_t; src: ptr ecs_vector_t;
elem_size: ecs_size_t; offset: int16; index: int32): int32 {.
importc: "_ecs_vector_move_index", cdecl, impflecsDyn.}
proc ecs_vector_remove_index*(vector: ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; index: int32): int32 {.
importc: "_ecs_vector_remove_index", cdecl, impflecsDyn.}
proc ecs_vector_reclaim*(vector: ptr ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16) {.importc: "_ecs_vector_reclaim", cdecl,
impflecsDyn.}
proc ecs_vector_grow*(vector: ptr ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; elem_count: int32): int32 {.
importc: "_ecs_vector_grow", cdecl, impflecsDyn.}
proc ecs_vector_set_size*(vector: ptr ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; elem_count: int32): int32 {.
importc: "_ecs_vector_set_size", cdecl, impflecsDyn.}
proc ecs_vector_set_count*(vector: ptr ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; elem_count: int32): int32 {.
importc: "_ecs_vector_set_count", cdecl, impflecsDyn.}
proc ecs_vector_set_min_size*(array_inout: ptr ptr ecs_vector_t;
elem_size: ecs_size_t; offset: int16; elem_count: int32): int32 {.
importc: "_ecs_vector_set_min_size", cdecl, impflecsDyn.}
proc ecs_vector_set_min_count*(vector_inout: ptr ptr ecs_vector_t;
elem_size: ecs_size_t; offset: int16;
elem_count: int32): int32 {.
importc: "_ecs_vector_set_min_count", cdecl, impflecsDyn.}
proc ecs_vector_count*(vector: ptr ecs_vector_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_vector_size*(vector: ptr ecs_vector_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_vector_first*(vector: ptr ecs_vector_t; elem_size: ecs_size_t; offset: int16): pointer {.
importc: "_ecs_vector_first", cdecl, impflecsDyn.}
proc ecs_vector_sort*(vector: ptr ecs_vector_t; elem_size: ecs_size_t; offset: int16;
compare_action: ecs_comparator_t) {.
importc: "_ecs_vector_sort", cdecl, impflecsDyn.}
proc ecs_vector_memory*(vector: ptr ecs_vector_t; elem_size: ecs_size_t;
offset: int16; allocd: ptr int32; used: ptr int32) {.
importc: "_ecs_vector_memory", cdecl, impflecsDyn.}
proc ecs_vector_copy*(src: ptr ecs_vector_t; elem_size: ecs_size_t; offset: int16): ptr ecs_vector_t {.
importc: "_ecs_vector_copy", cdecl, impflecsDyn.}
proc ecs_sparse_new*(elem_size: ecs_size_t): ptr ecs_sparse_t {.
importc: "_ecs_sparse_new", cdecl, impflecsDyn.}
proc ecs_sparse_set_id_source*(sparse: ptr ecs_sparse_t; id_source: ptr uint64) {.
importc, cdecl, impflecsDyn.}
proc ecs_sparse_free*(sparse: ptr ecs_sparse_t) {.importc, cdecl, impflecsDyn.}
proc ecs_sparse_clear*(sparse: ptr ecs_sparse_t) {.importc, cdecl, impflecsDyn.}
proc ecs_sparse_add*(sparse: ptr ecs_sparse_t; elem_size: ecs_size_t): pointer {.
importc: "_ecs_sparse_add", cdecl, impflecsDyn.}
proc ecs_sparse_new_id*(sparse: ptr ecs_sparse_t): uint64 {.importc, cdecl, impflecsDyn.}
proc ecs_sparse_new_ids*(sparse: ptr ecs_sparse_t; count: int32): ptr uint64 {.importc,
cdecl, impflecsDyn.}
proc ecs_sparse_remove*(sparse: ptr ecs_sparse_t; index: uint64) {.
importc: "_ecs_sparse_remove", cdecl, impflecsDyn.}
proc ecs_sparse_get*(sparse: ptr ecs_sparse_t; elem_size: ecs_size_t; index: int32): pointer {.
importc: "_ecs_sparse_get", cdecl, impflecsDyn.}
proc ecs_sparse_count*(sparse: ptr ecs_sparse_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_sparse_size*(sparse: ptr ecs_sparse_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_sparse_get_sparse*(sparse: ptr ecs_sparse_t; elem_size: ecs_size_t;
index: uint64): pointer {.
importc: "_ecs_sparse_get_sparse", cdecl, impflecsDyn.}
proc ecs_sparse_get_or_create*(sparse: ptr ecs_sparse_t; elem_size: ecs_size_t;
index: uint64): pointer {.
importc: "_ecs_sparse_get_or_create", cdecl, impflecsDyn.}
proc ecs_sparse_set*(sparse: ptr ecs_sparse_t; elem_size: ecs_size_t; index: uint64;
value: pointer): pointer {.importc: "_ecs_sparse_set", cdecl,
impflecsDyn.}
proc ecs_sparse_ids*(sparse: ptr ecs_sparse_t): ptr uint64 {.importc, cdecl, impflecsDyn.}
proc ecs_sparse_set_size*(sparse: ptr ecs_sparse_t; elem_count: int32) {.importc,
cdecl, impflecsDyn.}
proc ecs_sparse_grow*(sparse: ptr ecs_sparse_t; count: int32) {.importc, cdecl,
impflecsDyn.}
proc ecs_sparse_copy*(src: ptr ecs_sparse_t): ptr ecs_sparse_t {.importc, cdecl,
impflecsDyn.}
proc ecs_sparse_restore*(dst: ptr ecs_sparse_t; src: ptr ecs_sparse_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_sparse_memory*(sparse: ptr ecs_sparse_t; allocd: ptr int32; used: ptr int32) {.
importc, cdecl, impflecsDyn.}
proc ecs_map_new*(elem_size: ecs_size_t; alignment: ecs_size_t; elem_count: int32): ptr ecs_map_t {.
importc: "_ecs_map_new", cdecl, impflecsDyn.}
proc ecs_map_get*(map: ptr ecs_map_t; elem_size: ecs_size_t; key: ecs_map_key_t): pointer {.
importc: "_ecs_map_get", cdecl, impflecsDyn.}
proc ecs_map_has*(map: ptr ecs_map_t; elem_size: ecs_size_t; key: ecs_map_key_t;
payload: pointer): bool {.importc: "_ecs_map_has", cdecl, impflecsDyn.}
proc ecs_map_get_ptr*(map: ptr ecs_map_t; key: ecs_map_key_t): pointer {.
importc: "_ecs_map_get_ptr", cdecl, impflecsDyn.}
proc ecs_map_set*(map: ptr ecs_map_t; elem_size: ecs_size_t; key: ecs_map_key_t;
payload: pointer) {.importc: "_ecs_map_set", cdecl, impflecsDyn.}
proc ecs_map_free*(map: ptr ecs_map_t) {.importc, cdecl, impflecsDyn.}
proc ecs_map_remove*(map: ptr ecs_map_t; key: ecs_map_key_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_map_clear*(map: ptr ecs_map_t) {.importc, cdecl, impflecsDyn.}
proc ecs_map_count*(map: ptr ecs_map_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_map_bucket_count*(map: ptr ecs_map_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_map_iter*(map: ptr ecs_map_t): ecs_map_iter_t {.importc, cdecl, impflecsDyn.}
proc ecs_map_next*(iter: ptr ecs_map_iter_t; elem_size: ecs_size_t;
key: ptr ecs_map_key_t): pointer {.importc: "_ecs_map_next", cdecl,
impflecsDyn.}
proc ecs_map_next_ptr*(iter: ptr ecs_map_iter_t; key: ptr ecs_map_key_t): pointer {.
importc: "_ecs_map_next_ptr", cdecl, impflecsDyn.}
proc ecs_map_grow*(map: ptr ecs_map_t; elem_count: int32) {.importc, cdecl, impflecsDyn.}
proc ecs_map_set_size*(map: ptr ecs_map_t; elem_count: int32) {.importc, cdecl,
impflecsDyn.}
proc ecs_map_memory*(map: ptr ecs_map_t; allocd: ptr int32; used: ptr int32) {.importc,
cdecl, impflecsDyn.}
proc ecs_map_copy*(map: ptr ecs_map_t): ptr ecs_map_t {.importc, cdecl, impflecsDyn.}
proc ecs_switch_new*(min: uint64; max: uint64; elements: int32): ptr ecs_switch_t {.
importc, cdecl, impflecsDyn.}
proc ecs_switch_free*(sw: ptr ecs_switch_t) {.importc, cdecl, impflecsDyn.}
proc ecs_switch_add*(sw: ptr ecs_switch_t) {.importc, cdecl, impflecsDyn.}
proc ecs_switch_set_count*(sw: ptr ecs_switch_t; count: int32) {.importc, cdecl,
impflecsDyn.}
proc ecs_switch_set_min_count*(sw: ptr ecs_switch_t; count: int32) {.importc, cdecl,
impflecsDyn.}
proc ecs_switch_addn*(sw: ptr ecs_switch_t; count: int32) {.importc, cdecl, impflecsDyn.}
proc ecs_switch_set*(sw: ptr ecs_switch_t; element: int32; value: uint64) {.importc,
cdecl, impflecsDyn.}
proc ecs_switch_remove*(sw: ptr ecs_switch_t; element: int32) {.importc, cdecl,
impflecsDyn.}
proc ecs_switch_get*(sw: ptr ecs_switch_t; element: int32): uint64 {.importc, cdecl,
impflecsDyn.}
proc ecs_switch_values*(sw: ptr ecs_switch_t): ptr ecs_vector_t {.importc, cdecl,
impflecsDyn.}
proc ecs_switch_case_count*(sw: ptr ecs_switch_t; value: uint64): int32 {.importc,
cdecl, impflecsDyn.}
proc ecs_switch_first*(sw: ptr ecs_switch_t; value: uint64): int32 {.importc, cdecl,
impflecsDyn.}
proc ecs_switch_next*(sw: ptr ecs_switch_t; elem: int32): int32 {.importc, cdecl,
impflecsDyn.}
proc ecs_strbuf_append*(buffer: ptr ecs_strbuf_t; fmt: cstring): bool {.importc, cdecl,
impflecsDyn, varargs.}
proc ecs_strbuf_vappend*(buffer: ptr ecs_strbuf_t; fmt: cstring; args: va_list): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_strbuf_appendstr*(buffer: ptr ecs_strbuf_t; str: cstring): bool {.importc,
cdecl, impflecsDyn.}
proc ecs_strbuf_mergebuff*(dst_buffer: ptr ecs_strbuf_t;
src_buffer: ptr ecs_strbuf_t): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_strbuf_appendstr_zerocpy*(buffer: ptr ecs_strbuf_t; str: cstring): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_strbuf_appendstr_zerocpy_const*(buffer: ptr ecs_strbuf_t; str: cstring): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_strbuf_appendstrn*(buffer: ptr ecs_strbuf_t; str: cstring; n: int32): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_strbuf_get*(buffer: ptr ecs_strbuf_t): cstring {.importc, cdecl, impflecsDyn.}
proc ecs_strbuf_reset*(buffer: ptr ecs_strbuf_t) {.importc, cdecl, impflecsDyn.}
proc ecs_strbuf_list_push*(buffer: ptr ecs_strbuf_t; list_open: cstring;
separator: cstring) {.importc, cdecl, impflecsDyn.}
proc ecs_strbuf_list_pop*(buffer: ptr ecs_strbuf_t; list_close: cstring) {.importc,
cdecl, impflecsDyn.}
proc ecs_strbuf_list_next*(buffer: ptr ecs_strbuf_t) {.importc, cdecl, impflecsDyn.}
proc ecs_strbuf_list_append*(buffer: ptr ecs_strbuf_t; fmt: cstring): bool {.importc,
cdecl, impflecsDyn, varargs.}
proc ecs_strbuf_list_appendstr*(buffer: ptr ecs_strbuf_t; str: cstring): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_os_init*() {.importc, cdecl, impflecsDyn.}
proc ecs_os_fini*() {.importc, cdecl, impflecsDyn.}
proc ecs_os_set_api*(os_api: ptr ecs_os_api_t) {.importc, cdecl, impflecsDyn.}
proc ecs_os_set_api_defaults*() {.importc, cdecl, impflecsDyn.}
proc ecs_os_log*(fmt: cstring) {.importc, cdecl, impflecsDyn, varargs.}
proc ecs_os_warn*(fmt: cstring) {.importc, cdecl, impflecsDyn, varargs.}
proc ecs_os_err*(fmt: cstring) {.importc, cdecl, impflecsDyn, varargs.}
proc ecs_os_dbg*(fmt: cstring) {.importc, cdecl, impflecsDyn, varargs.}
proc ecs_sleepf*(t: cdouble) {.importc, cdecl, impflecsDyn.}
proc ecs_time_measure*(start: ptr ecs_time_t): cdouble {.importc, cdecl, impflecsDyn.}
proc ecs_time_sub*(t1: ecs_time_t; t2: ecs_time_t): ecs_time_t {.importc, cdecl,
impflecsDyn.}
proc ecs_time_to_double*(t: ecs_time_t): cdouble {.importc, cdecl, impflecsDyn.}
proc ecs_os_memdup*(src: pointer; size: ecs_size_t): pointer {.importc, cdecl,
impflecsDyn.}
proc ecs_os_has_heap*(): bool {.importc, cdecl, impflecsDyn.}
proc ecs_os_has_threading*(): bool {.importc, cdecl, impflecsDyn.}
proc ecs_os_has_time*(): bool {.importc, cdecl, impflecsDyn.}
proc ecs_os_has_logging*(): bool {.importc, cdecl, impflecsDyn.}
proc ecs_os_has_dl*(): bool {.importc, cdecl, impflecsDyn.}
proc ecs_os_has_modules*(): bool {.importc, cdecl, impflecsDyn.}
## ```
## @defgroup api_types Basic API types
## @{
##
## An entity identifier.
## ```
proc ecs_new_entity*(world: ptr ecs_world_t; e: ecs_entity_t; id: cstring;
components: cstring): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_new_component*(world: ptr ecs_world_t; e: ecs_entity_t; id: cstring;
size: uint; alignment: uint): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_new_module*(world: ptr ecs_world_t; e: ecs_entity_t; name: cstring; size: uint;
alignment: uint): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_new_type*(world: ptr ecs_world_t; e: ecs_entity_t; id: cstring;
components: cstring): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_new_prefab*(world: ptr ecs_world_t; e: ecs_entity_t; id: cstring; sig: cstring): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_new_system*(world: ptr ecs_world_t; e: ecs_entity_t; name: cstring;
phase: ecs_entity_t; signature: cstring;
action: ecs_iter_action_t): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_new_trigger*(world: ptr ecs_world_t; e: ecs_entity_t; name: cstring;
kind: ecs_entity_t; component: cstring;
action: ecs_iter_action_t): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_new_pipeline*(world: ptr ecs_world_t; e: ecs_entity_t; name: cstring;
expr: cstring): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_module_path_from_c*(c_name: cstring): cstring {.importc, cdecl, impflecsDyn.}
proc ecs_sig_init*(world: ptr ecs_world_t; name: cstring; expr: cstring;
sig: ptr ecs_sig_t) {.importc, cdecl, impflecsDyn.}
proc ecs_sig_deinit*(sig: ptr ecs_sig_t) {.importc, cdecl, impflecsDyn.}
proc ecs_sig_add*(world: ptr ecs_world_t; sig: ptr ecs_sig_t;
from_kind: ecs_sig_from_kind_t; oper_kind: ecs_sig_oper_kind_t;
access_kind: ecs_sig_inout_kind_t; component: ecs_entity_t;
source: ecs_entity_t; arg_name: cstring): cint {.importc, cdecl,
impflecsDyn.}
proc ecs_query_new_w_sig*(world: ptr ecs_world_t; system: ecs_entity_t;
sig: ptr ecs_sig_t): ptr ecs_query_t {.importc, cdecl,
impflecsDyn.}
proc ecs_trace*(level: cint; file: cstring; line: int32; fmt: cstring) {.
importc: "_ecs_trace", cdecl, impflecsDyn, varargs.}
proc ecs_warn*(file: cstring; line: int32; fmt: cstring) {.importc: "_ecs_warn", cdecl,
impflecsDyn, varargs.}
proc ecs_err*(file: cstring; line: int32; fmt: cstring) {.importc: "_ecs_err", cdecl,
impflecsDyn, varargs.}
proc ecs_log_push*() {.importc, cdecl, impflecsDyn.}
proc ecs_log_pop*() {.importc, cdecl, impflecsDyn.}
proc ecs_strerror*(error_code: int32): cstring {.importc, cdecl, impflecsDyn.}
proc ecs_abort*(error_code: int32; param: cstring; file: cstring; line: int32) {.
importc: "_ecs_abort", cdecl, impflecsDyn.}
proc ecs_assert*(condition: bool; error_code: int32; param: cstring;
condition_str: cstring; file: cstring; line: int32) {.
importc: "_ecs_assert", cdecl, impflecsDyn.}
proc ecs_parser_error*(name: cstring; expr: cstring; column: int64; fmt: cstring) {.
importc: "_ecs_parser_error", cdecl, impflecsDyn, varargs.}
proc ecs_type_from_entity*(world: ptr ecs_world_t; entity: ecs_entity_t): ecs_type_t {.
importc, cdecl, impflecsDyn.}
proc ecs_type_to_entity*(world: ptr ecs_world_t; `type`: ecs_type_t): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_type_str*(world: ptr ecs_world_t; `type`: ecs_type_t): cstring {.importc,
cdecl, impflecsDyn.}
proc ecs_type_from_str*(world: ptr ecs_world_t; expr: cstring): ecs_type_t {.importc,
cdecl, impflecsDyn.}
proc ecs_type_find*(world: ptr ecs_world_t; array: ptr ecs_entity_t; count: int32): ecs_type_t {.
importc, cdecl, impflecsDyn.}
proc ecs_type_merge*(world: ptr ecs_world_t; `type`: ecs_type_t; type_add: ecs_type_t;
type_remove: ecs_type_t): ecs_type_t {.importc, cdecl,
impflecsDyn.}
proc ecs_type_add*(world: ptr ecs_world_t; `type`: ecs_type_t; entity: ecs_entity_t): ecs_type_t {.
importc, cdecl, impflecsDyn.}
proc ecs_type_remove*(world: ptr ecs_world_t; `type`: ecs_type_t; entity: ecs_entity_t): ecs_type_t {.
importc, cdecl, impflecsDyn.}
proc ecs_type_has_entity*(world: ptr ecs_world_t; `type`: ecs_type_t;
entity: ecs_entity_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_type_has_type*(world: ptr ecs_world_t; `type`: ecs_type_t; has: ecs_type_t): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_type_owns_entity*(world: ptr ecs_world_t; `type`: ecs_type_t;
entity: ecs_entity_t; owned: bool): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_type_owns_type*(world: ptr ecs_world_t; `type`: ecs_type_t; has: ecs_type_t;
owned: bool): bool {.importc, cdecl, impflecsDyn.}
proc ecs_type_get_entity_for_xor*(world: ptr ecs_world_t; `type`: ecs_type_t;
xor_tag: ecs_entity_t): ecs_entity_t {.importc,
cdecl, impflecsDyn.}
proc ecs_type_index_of*(`type`: ecs_type_t; component: ecs_entity_t): int32 {.importc,
cdecl, impflecsDyn.}
proc ecs_type_trait_index_of*(`type`: ecs_type_t; start_index: int32;
trait: ecs_entity_t): int32 {.importc, cdecl,
impflecsDyn.}
proc ecs_init*(): ptr ecs_world_t {.importc, cdecl, impflecsDyn.}
proc ecs_mini*(): ptr ecs_world_t {.importc, cdecl, impflecsDyn.}
proc ecs_init_w_args*(argc: cint; argv: UncheckedArray[cstring]): ptr ecs_world_t {.
importc, cdecl, impflecsDyn.}
proc ecs_fini*(world: ptr ecs_world_t): cint {.importc, cdecl, impflecsDyn.}
proc ecs_atfini*(world: ptr ecs_world_t; action: ecs_fini_action_t; ctx: pointer) {.
importc, cdecl, impflecsDyn.}
proc ecs_run_post_frame*(world: ptr ecs_world_t; action: ecs_fini_action_t;
ctx: pointer) {.importc, cdecl, impflecsDyn.}
proc ecs_set_component_actions_w_entity*(world: ptr ecs_world_t;
component: ecs_entity_t;
actions: ptr EcsComponentLifecycle) {.
importc, cdecl, impflecsDyn.}
proc ecs_set_context*(world: ptr ecs_world_t; ctx: pointer) {.importc, cdecl,
impflecsDyn.}
proc ecs_get_context*(world: ptr ecs_world_t): pointer {.importc, cdecl, impflecsDyn.}
proc ecs_get_world_info*(world: ptr ecs_world_t): ptr ecs_world_info_t {.importc,
cdecl, impflecsDyn.}
proc ecs_dim*(world: ptr ecs_world_t; entity_count: int32) {.importc, cdecl, impflecsDyn.}
proc ecs_dim_type*(world: ptr ecs_world_t; `type`: ecs_type_t; entity_count: int32) {.
importc, cdecl, impflecsDyn.}
proc ecs_set_entity_range*(world: ptr ecs_world_t; id_start: ecs_entity_t;
id_end: ecs_entity_t) {.importc, cdecl, impflecsDyn.}
proc ecs_enable_range_check*(world: ptr ecs_world_t; enable: bool): bool {.importc,
cdecl, impflecsDyn.}
proc ecs_enable_locking*(world: ptr ecs_world_t; enable: bool): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_lock*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_unlock*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_begin_wait*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
## ```
## Wait until world becomes available.
## When a non-flecs thread needs to interact with the world, it should invoke
## this function to wait until the world becomes available (as in, it is not
## progressing the frame). Invoking this function guarantees that the thread
## will not starve. (as opposed to simply taking the world lock).
##
## An application will have to invoke ecs_end_wait after this function returns.
##
## @param world The world.
## ```
proc ecs_end_wait*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
## ```
## Release world after calling ecs_begin_wait.
## This operation should be invoked after invoking ecs_begin_wait, and will
## release the world back to the thread running the main loop.
##
## @param world The world.
## ```
proc ecs_tracing_enable*(level: cint) {.importc, cdecl, impflecsDyn.}
proc ecs_new_id*(world: ptr ecs_world_t): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_new_component_id*(world: ptr ecs_world_t): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_new_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_new_w_type*(world: ptr ecs_world_t; `type`: ecs_type_t): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_bulk_new_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t; count: int32): ptr ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_bulk_new_w_type*(world: ptr ecs_world_t; `type`: ecs_type_t; count: int32): ptr ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_bulk_new_w_data*(world: ptr ecs_world_t; count: int32;
component_ids: ptr ecs_entities_t; data: pointer): ptr ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_clone*(world: ptr ecs_world_t; dst: ecs_entity_t; src: ecs_entity_t;
copy_value: bool): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_add_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
entity_add: ecs_entity_t) {.importc, cdecl, impflecsDyn.}
proc ecs_add_type*(world: ptr ecs_world_t; entity: ecs_entity_t; `type`: ecs_type_t) {.
importc, cdecl, impflecsDyn.}
proc ecs_remove_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
entity_remove: ecs_entity_t) {.importc, cdecl, impflecsDyn.}
proc ecs_remove_type*(world: ptr ecs_world_t; entity: ecs_entity_t; `type`: ecs_type_t) {.
importc, cdecl, impflecsDyn.}
proc ecs_add_remove_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
to_add: ecs_entity_t; to_remove: ecs_entity_t) {.importc,
cdecl, impflecsDyn.}
proc ecs_add_remove_type*(world: ptr ecs_world_t; entity: ecs_entity_t;
to_add: ecs_type_t; to_remove: ecs_type_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_get_case*(world: ptr ecs_world_t; e: ecs_entity_t; sw: ecs_entity_t): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_delete*(world: ptr ecs_world_t; entity: ecs_entity_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_get_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
component: ecs_entity_t): pointer {.importc, cdecl, impflecsDyn.}
proc ecs_get_ref_w_entity*(world: ptr ecs_world_t; `ref`: ptr ecs_ref_t;
entity: ecs_entity_t; component: ecs_entity_t): pointer {.
importc, cdecl, impflecsDyn.}
proc ecs_get_mut_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
component: ecs_entity_t; is_added: ptr bool): pointer {.
importc, cdecl, impflecsDyn.}
proc ecs_modified_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
component: ecs_entity_t) {.importc, cdecl, impflecsDyn.}
proc ecs_set_ptr_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
component: ecs_entity_t; size: uint; `ptr`: pointer): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_has_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
to_check: ecs_entity_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_has_type*(world: ptr ecs_world_t; entity: ecs_entity_t; `type`: ecs_type_t): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_get_type*(world: ptr ecs_world_t; entity: ecs_entity_t): ecs_type_t {.importc,
cdecl, impflecsDyn.}
proc ecs_get_name*(world: ptr ecs_world_t; entity: ecs_entity_t): cstring {.importc,
cdecl, impflecsDyn.}
proc ecs_role_str*(entity: ecs_entity_t): cstring {.importc, cdecl, impflecsDyn.}
proc ecs_entity_str*(world: ptr ecs_world_t; entity: ecs_entity_t; buffer: cstring;
buffer_len: uint): uint {.importc, cdecl, impflecsDyn.}
proc ecs_get_parent_w_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
component: ecs_entity_t): ecs_entity_t {.importc,
cdecl, impflecsDyn.}
proc ecs_enable*(world: ptr ecs_world_t; entity: ecs_entity_t; enabled: bool) {.importc,
cdecl, impflecsDyn.}
proc ecs_count_entity*(world: ptr ecs_world_t; entity: ecs_entity_t): int32 {.importc,
cdecl, impflecsDyn.}
proc ecs_count_type*(world: ptr ecs_world_t; `type`: ecs_type_t): int32 {.importc,
cdecl, impflecsDyn.}
proc ecs_count_w_filter*(world: ptr ecs_world_t; filter: ptr ecs_filter_t): int32 {.
importc, cdecl, impflecsDyn.}
proc ecs_lookup*(world: ptr ecs_world_t; name: cstring): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_lookup_child*(world: ptr ecs_world_t; parent: ecs_entity_t; name: cstring): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_lookup_path_w_sep*(world: ptr ecs_world_t; parent: ecs_entity_t;
path: cstring; sep: cstring; prefix: cstring): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_lookup_symbol*(world: ptr ecs_world_t; name: cstring): ecs_entity_t {.importc,
cdecl, impflecsDyn.}
proc ecs_get_path_w_sep*(world: ptr ecs_world_t; parent: ecs_entity_t;
child: ecs_entity_t; component: ecs_entity_t; sep: cstring;
prefix: cstring): cstring {.importc, cdecl, impflecsDyn.}
proc ecs_new_from_path_w_sep*(world: ptr ecs_world_t; parent: ecs_entity_t;
path: cstring; sep: cstring; prefix: cstring): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_add_path_w_sep*(world: ptr ecs_world_t; entity: ecs_entity_t;
parent: ecs_entity_t; path: cstring; sep: cstring;
prefix: cstring): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_get_child_count*(world: ptr ecs_world_t; entity: ecs_entity_t): int32 {.
importc, cdecl, impflecsDyn.}
proc ecs_scope_iter*(world: ptr ecs_world_t; parent: ecs_entity_t): ecs_iter_t {.
importc, cdecl, impflecsDyn.}
proc ecs_scope_iter_w_filter*(world: ptr ecs_world_t; parent: ecs_entity_t;
filter: ptr ecs_filter_t): ecs_iter_t {.importc, cdecl,
impflecsDyn.}
proc ecs_scope_next*(it: ptr ecs_iter_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_set_scope*(world: ptr ecs_world_t; scope: ecs_entity_t): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_get_scope*(world: ptr ecs_world_t): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_set_name_prefix*(world: ptr ecs_world_t; prefix: cstring): cstring {.importc,
cdecl, impflecsDyn.}
proc ecs_filter_iter*(world: ptr ecs_world_t; filter: ptr ecs_filter_t): ecs_iter_t {.
importc, cdecl, impflecsDyn.}
proc ecs_filter_next*(iter: ptr ecs_iter_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_query_new*(world: ptr ecs_world_t; sig: cstring): ptr ecs_query_t {.importc,
cdecl, impflecsDyn.}
proc ecs_subquery_new*(world: ptr ecs_world_t; parent: ptr ecs_query_t; sig: cstring): ptr ecs_query_t {.
importc, cdecl, impflecsDyn.}
proc ecs_query_free*(query: ptr ecs_query_t) {.importc, cdecl, impflecsDyn.}
proc ecs_query_iter*(query: ptr ecs_query_t): ecs_iter_t {.importc, cdecl, impflecsDyn.}
proc ecs_query_iter_page*(query: ptr ecs_query_t; offset: int32; limit: int32): ecs_iter_t {.
importc, cdecl, impflecsDyn.}
proc ecs_query_next*(iter: ptr ecs_iter_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_query_next_w_filter*(iter: ptr ecs_iter_t; filter: ptr ecs_filter_t): bool {.
importc, cdecl, impflecsDyn.}
proc ecs_query_next_worker*(it: ptr ecs_iter_t; current: int32; total: int32): bool {.
importc, cdecl, impflecsDyn.}
## ```
## Progress the query iterator for a worker thread.
## This operation is similar to ecs_query_next, but provides the ability to
## divide entities up across multiple worker threads. The operation accepts a
## current thread id and a total thread id, which is used to determine which
## subset of entities should be assigned to the current thread.
##
## Current should be less than total, and there should be as many as total
## threads. If there are less entities in a table than there are threads, only
## as many threads as there are entities will iterate that table.
##
## @param it The iterator.
## @param current Thread id of current thread.
## @param total Total number of threads.
## @returns True if more data is available, false if not.
## ```
proc ecs_query_order_by*(world: ptr ecs_world_t; query: ptr ecs_query_t;
component: ecs_entity_t; compare: ecs_compare_action_t) {.
importc, cdecl, impflecsDyn.}
proc ecs_query_group_by*(world: ptr ecs_world_t; query: ptr ecs_query_t;
component: ecs_entity_t;
rank_action: ecs_rank_type_action_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_query_changed*(query: ptr ecs_query_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_column_w_size*(it: ptr ecs_iter_t; size: uint; column: int32): pointer {.
importc, cdecl, impflecsDyn.}
proc ecs_column_index_from_name*(it: ptr ecs_iter_t; name: cstring): int32 {.importc,
cdecl, impflecsDyn.}
proc ecs_is_owned*(it: ptr ecs_iter_t; column: int32): bool {.importc, cdecl, impflecsDyn.}
proc ecs_element_w_size*(it: ptr ecs_iter_t; size: uint; column: int32; row: int32): pointer {.
importc, cdecl, impflecsDyn.}
proc ecs_column_source*(it: ptr ecs_iter_t; column: int32): ecs_entity_t {.importc,
cdecl, impflecsDyn.}
proc ecs_column_entity*(it: ptr ecs_iter_t; column: int32): ecs_entity_t {.importc,
cdecl, impflecsDyn.}
proc ecs_column_type*(it: ptr ecs_iter_t; column: int32): ecs_type_t {.importc, cdecl,
impflecsDyn.}
proc ecs_column_size*(it: ptr ecs_iter_t; column: int32): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_is_readonly*(it: ptr ecs_iter_t; column: int32): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_iter_type*(it: ptr ecs_iter_t): ecs_type_t {.importc, cdecl, impflecsDyn.}
proc ecs_table_column*(it: ptr ecs_iter_t; column: int32): pointer {.importc, cdecl,
impflecsDyn.}
proc ecs_table_column_size*(it: ptr ecs_iter_t; column: int32): uint {.importc, cdecl,
impflecsDyn.}
proc ecs_table_component_index*(it: ptr ecs_iter_t; component: ecs_entity_t): int32 {.
importc, cdecl, impflecsDyn.}
proc ecs_staging_begin*(world: ptr ecs_world_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_staging_end*(world: ptr ecs_world_t; is_staged: bool): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_merge*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_set_automerge*(world: ptr ecs_world_t; auto_merge: bool) {.importc, cdecl,
impflecsDyn.}
proc ecs_import*(world: ptr ecs_world_t; module: ecs_module_action_t;
module_name: cstring; handles_out: pointer; handles_size: uint): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_import_from_library*(world: ptr ecs_world_t; library_name: cstring;
module_name: cstring): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_run*(world: ptr ecs_world_t; system: ecs_entity_t; delta_time: cfloat;
param: pointer): ecs_entity_t {.importc, cdecl, impflecsDyn.}
proc ecs_run_w_filter*(world: ptr ecs_world_t; system: ecs_entity_t;
delta_time: cfloat; offset: int32; limit: int32;
filter: ptr ecs_filter_t; param: pointer): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_set_system_status_action*(world: ptr ecs_world_t; system: ecs_entity_t;
action: ecs_system_status_action_t; ctx: pointer) {.
importc, cdecl, impflecsDyn.}
proc ecs_dbg_system*(world: ptr ecs_world_t; system: ecs_entity_t;
dbg_out: ptr ecs_dbg_system_t): cint {.importc, cdecl, impflecsDyn.}
proc ecs_dbg_get_active_table*(world: ptr ecs_world_t; dbg: ptr ecs_dbg_system_t;
index: int32): ptr ecs_table_t {.importc, cdecl,
impflecsDyn.}
proc ecs_dbg_get_inactive_table*(world: ptr ecs_world_t; dbg: ptr ecs_dbg_system_t;
index: int32): ptr ecs_table_t {.importc, cdecl,
impflecsDyn.}
proc ecs_dbg_get_column_type*(world: ptr ecs_world_t; system: ecs_entity_t;
column_index: int32): ecs_type_t {.importc, cdecl,
impflecsDyn.}
proc ecs_dbg_match_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
system: ecs_entity_t;
failure_info_out: ptr ecs_match_failure_t): bool {.
importc, cdecl, impflecsDyn.}
proc FlecsSystemImport*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_set_pipeline*(world: ptr ecs_world_t; pipeline: ecs_entity_t) {.importc,
cdecl, impflecsDyn.}
proc ecs_get_pipeline*(world: ptr ecs_world_t): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_progress*(world: ptr ecs_world_t; delta_time: cfloat): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_set_target_fps*(world: ptr ecs_world_t; fps: cfloat) {.importc, cdecl,
impflecsDyn.}
proc ecs_set_time_scale*(world: ptr ecs_world_t; scale: cfloat) {.importc, cdecl,
impflecsDyn.}
proc ecs_reset_clock*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_quit*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_deactivate_systems*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_set_threads*(world: ptr ecs_world_t; threads: int32) {.importc, cdecl,
impflecsDyn.}
proc ecs_get_threads*(world: ptr ecs_world_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_get_thread_index*(world: ptr ecs_world_t): int32 {.importc, cdecl, impflecsDyn.}
proc FlecsPipelineImport*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_set_timeout*(world: ptr ecs_world_t; timer: ecs_entity_t; timeout: cfloat): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_get_timeout*(world: ptr ecs_world_t; timer: ecs_entity_t): cfloat {.importc,
cdecl, impflecsDyn.}
proc ecs_set_interval*(world: ptr ecs_world_t; timer: ecs_entity_t; interval: cfloat): ecs_entity_t {.
importc, cdecl, impflecsDyn.}
proc ecs_get_interval*(world: ptr ecs_world_t; timer: ecs_entity_t): cfloat {.importc,
cdecl, impflecsDyn.}
proc ecs_start_timer*(world: ptr ecs_world_t; timer: ecs_entity_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_stop_timer*(world: ptr ecs_world_t; timer: ecs_entity_t) {.importc, cdecl,
impflecsDyn.}
proc ecs_set_rate_filter*(world: ptr ecs_world_t; filter: ecs_entity_t; rate: int32;
source: ecs_entity_t): ecs_entity_t {.importc, cdecl,
impflecsDyn.}
proc ecs_set_tick_source*(world: ptr ecs_world_t; system: ecs_entity_t;
tick_source: ecs_entity_t) {.importc, cdecl, impflecsDyn.}
proc FlecsTimerImport*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_bulk_add_entity*(world: ptr ecs_world_t; entity_add: ecs_entity_t;
filter: ptr ecs_filter_t) {.importc, cdecl, impflecsDyn.}
proc ecs_bulk_add_type*(world: ptr ecs_world_t; `type`: ecs_type_t;
filter: ptr ecs_filter_t) {.importc, cdecl, impflecsDyn.}
proc ecs_bulk_remove_entity*(world: ptr ecs_world_t; entity_remove: ecs_entity_t;
filter: ptr ecs_filter_t) {.importc, cdecl, impflecsDyn.}
proc ecs_bulk_remove_type*(world: ptr ecs_world_t; `type`: ecs_type_t;
filter: ptr ecs_filter_t) {.importc, cdecl, impflecsDyn.}
proc ecs_bulk_add_remove_type*(world: ptr ecs_world_t; to_add: ecs_type_t;
to_remove: ecs_type_t; filter: ptr ecs_filter_t) {.
importc, cdecl, impflecsDyn.}
proc ecs_bulk_delete*(world: ptr ecs_world_t; filter: ptr ecs_filter_t) {.importc,
cdecl, impflecsDyn.}
proc FlecsStatsImport*(world: ptr ecs_world_t) {.importc, cdecl, impflecsDyn.}
proc ecs_dbg_entity*(world: ptr ecs_world_t; entity: ecs_entity_t;
dbg_out: ptr ecs_dbg_entity_t) {.importc, cdecl, impflecsDyn.}
proc ecs_dbg_find_table*(world: ptr ecs_world_t; `type`: ecs_type_t): ptr ecs_table_t {.
importc, cdecl, impflecsDyn.}
proc ecs_dbg_get_table*(world: ptr ecs_world_t; index: int32): ptr ecs_table_t {.
importc, cdecl, impflecsDyn.}
proc ecs_dbg_filter_table*(world: ptr ecs_world_t; table: ptr ecs_table_t;
filter: ptr ecs_filter_t): bool {.importc, cdecl,
impflecsDyn.}
proc ecs_dbg_table*(world: ptr ecs_world_t; table: ptr ecs_table_t;
dbg_out: ptr ecs_dbg_table_t) {.importc, cdecl, impflecsDyn.}
proc ecs_queue_new*(elem_size: ecs_size_t; offset: int16; elem_count: int32): ptr ecs_queue_t {.
importc: "_ecs_queue_new", cdecl, impflecsDyn.}
proc ecs_queue_from_array*(elem_size: ecs_size_t; offset: int16; elem_count: int32;
array: pointer): ptr ecs_queue_t {.
importc: "_ecs_queue_from_array", cdecl, impflecsDyn.}
proc ecs_queue_push*(queue: ptr ecs_queue_t; elem_size: ecs_size_t; offset: int16): pointer {.
importc: "_ecs_queue_push", cdecl, impflecsDyn.}
proc ecs_queue_get*(queue: ptr ecs_queue_t; elem_size: ecs_size_t; offset: int16;
index: int32): pointer {.importc: "_ecs_queue_get", cdecl,
impflecsDyn.}
proc ecs_queue_last*(queue: ptr ecs_queue_t; elem_size: ecs_size_t; offset: int16): pointer {.
importc: "_ecs_queue_last", cdecl, impflecsDyn.}
proc ecs_queue_index*(queue: ptr ecs_queue_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_queue_count*(queue: ptr ecs_queue_t): int32 {.importc, cdecl, impflecsDyn.}
proc ecs_queue_free*(queue: ptr ecs_queue_t) {.importc, cdecl, impflecsDyn.}
proc ecs_reader_init*(world: ptr ecs_world_t): ecs_reader_t {.importc, cdecl,
impflecsDyn.}
proc ecs_reader_init_w_iter*(iter: ptr ecs_iter_t; next: ecs_iter_next_action_t): ecs_reader_t {.
importc, cdecl, impflecsDyn.}
proc ecs_reader_read*(buffer: cstring; size: ecs_size_t; reader: ptr ecs_reader_t): ecs_size_t {.
importc, cdecl, impflecsDyn.}
proc ecs_writer_init*(world: ptr ecs_world_t): ecs_writer_t {.importc, cdecl,
impflecsDyn.}
proc ecs_writer_write*(buffer: cstring; size: ecs_size_t; writer: ptr ecs_writer_t): cint {.
importc, cdecl, impflecsDyn.}
proc ecs_snapshot_take*(world: ptr ecs_world_t): ptr ecs_snapshot_t {.importc, cdecl,
impflecsDyn.}
proc ecs_snapshot_take_w_iter*(iter: ptr ecs_iter_t; action: ecs_iter_next_action_t): ptr ecs_snapshot_t {.
importc, cdecl, impflecsDyn.}
proc ecs_snapshot_restore*(world: ptr ecs_world_t; snapshot: ptr ecs_snapshot_t) {.
importc, cdecl, impflecsDyn.}
proc ecs_snapshot_iter*(snapshot: ptr ecs_snapshot_t; filter: ptr ecs_filter_t): ecs_iter_t {.
importc, cdecl, impflecsDyn.}
proc ecs_snapshot_next*(iter: ptr ecs_iter_t): bool {.importc, cdecl, impflecsDyn.}
proc ecs_snapshot_free*(snapshot: ptr ecs_snapshot_t) {.importc, cdecl, impflecsDyn.}
{.pop.}
# Saved to /home/.cache/nim/nimterop/toastCache/nimterop_552430188.nim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment