Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs.h
Go to the documentation of this file.
1
8#ifndef FLECS_H
9#define FLECS_H
10
33/* Flecs version macros */
34#define FLECS_VERSION_MAJOR 4
35#define FLECS_VERSION_MINOR 1
36#define FLECS_VERSION_PATCH 6
39#define FLECS_VERSION FLECS_VERSION_IMPL(\
40 FLECS_VERSION_MAJOR, FLECS_VERSION_MINOR, FLECS_VERSION_PATCH)
41
45#ifdef FLECS_CONFIG_HEADER
46#include "flecs_config.h"
47#endif
48
51#ifndef ecs_float_t
52#define ecs_float_t float
53#endif
54
58#ifndef ecs_ftime_t
59#define ecs_ftime_t ecs_float_t
60#endif
61
62
68// #define FLECS_ACCURATE_COUNTERS
69
75// #define FLECS_DISABLE_COUNTERS
76
77/* Make sure provided configuration is valid */
78#if defined(FLECS_DEBUG) && defined(FLECS_NDEBUG)
79#warning "invalid configuration: cannot both define FLECS_DEBUG and FLECS_NDEBUG"
80#endif
81#if defined(FLECS_DEBUG) && defined(NDEBUG)
82#warning "invalid configuration: cannot both define FLECS_DEBUG and NDEBUG"
83#endif
84
89#if !defined(FLECS_DEBUG) && !defined(FLECS_NDEBUG)
90#if defined(NDEBUG)
91#define FLECS_NDEBUG
92#else
93#define FLECS_DEBUG
94#endif
95#endif
96
101#ifdef FLECS_SANITIZE
102#ifndef FLECS_DEBUG
103#define FLECS_DEBUG /* If sanitized mode is enabled, so is debug mode */
104#endif
105#endif
106
111#ifdef FLECS_DEBUG
112#ifndef FLECS_DEBUG_INFO
113#define FLECS_DEBUG_INFO
114#endif
115#ifndef FLECS_EXCLUSIVE_ACCESS
116#define FLECS_EXCLUSIVE_ACCESS /* Enable exclusive access checks in debug mode */
117#endif
118#endif
119
120/* Tip: if you see weird behavior that you think might be a bug, make sure to
121 * test with the FLECS_DEBUG or FLECS_SANITIZE flags enabled. There's a good
122 * chance that this gives you more information about the issue! */
123
137// #define FLECS_SOFT_ASSERT
138
144// #define FLECS_KEEP_ASSERT
145
152// #define FLECS_DEFAULT_TO_UNCACHED_QUERIES
153
166// #define FLECS_CREATE_MEMBER_ENTITIES
167
176// #define FLECS_CPP_NO_AUTO_REGISTRATION
177
185// #define FLECS_CPP_NO_ENUM_REFLECTION
186
191// #define FLECS_NO_ALWAYS_INLINE
192
220// #define FLECS_CUSTOM_BUILD
221
222#ifndef FLECS_CUSTOM_BUILD
223#define FLECS_ALERTS
224#define FLECS_APP
225// #define FLECS_C /**< C API convenience macros, always enabled. */
226#define FLECS_CPP
227#define FLECS_DOC
228// #define FLECS_EXCLUSIVE_ACCESS /**< Enable exclusive world access checks. */
229// #define FLECS_JOURNAL /**< Journaling addon. */
230#define FLECS_JSON
231#define FLECS_HTTP
232#define FLECS_LOG
233#define FLECS_META
234#define FLECS_METRICS
235#define FLECS_MODULE
236#define FLECS_OS_API_IMPL
237// #define FLECS_PERF_TRACE /**< Enable performance tracing. */
238#define FLECS_PIPELINE
239#define FLECS_REST
240#define FLECS_PARSER
241#define FLECS_QUERY_DSL
242#define FLECS_SCRIPT
243// #define FLECS_SCRIPT_MATH /**< Math functions for Flecs script (may require linking with libm). */
244// #define FLECS_SCRIPT_PLATFORM /**< Platform constants for Flecs script. */
245#define FLECS_SYSTEM
246#define FLECS_STATS
247#define FLECS_TIMER
248#define FLECS_UNITS
249#endif // ifndef FLECS_CUSTOM_BUILD
250
254// #define FLECS_LOW_FOOTPRINT
255#ifdef FLECS_LOW_FOOTPRINT
256#define FLECS_HI_COMPONENT_ID 16
257#define FLECS_HI_ID_RECORD_ID 16
258#define FLECS_ENTITY_PAGE_BITS 6
259#define FLECS_USE_OS_ALLOC
260#define FLECS_DEFAULT_TO_UNCACHED_QUERIES
261#endif
262
277#ifndef FLECS_HI_COMPONENT_ID
278#define FLECS_HI_COMPONENT_ID 256
279#endif
280
287#ifndef FLECS_HI_ID_RECORD_ID
288#define FLECS_HI_ID_RECORD_ID 1024
289#endif
290
296#ifndef FLECS_SPARSE_PAGE_BITS
297#define FLECS_SPARSE_PAGE_BITS 6
298#endif
299
302#ifndef FLECS_ENTITY_PAGE_BITS
303#define FLECS_ENTITY_PAGE_BITS 10
304#endif
305
310// #define FLECS_USE_OS_ALLOC
311
314#ifndef FLECS_ID_DESC_MAX
315#define FLECS_ID_DESC_MAX 32
316#endif
317
320#ifndef FLECS_EVENT_DESC_MAX
321#define FLECS_EVENT_DESC_MAX 8
322#endif
323
326#define FLECS_VARIABLE_COUNT_MAX 64
327
330#ifndef FLECS_TERM_COUNT_MAX
331#define FLECS_TERM_COUNT_MAX 32
332#endif
333
336#ifndef FLECS_TERM_ARG_COUNT_MAX
337#define FLECS_TERM_ARG_COUNT_MAX 16
338#endif
339
342#ifndef FLECS_QUERY_VARIABLE_COUNT_MAX
343#define FLECS_QUERY_VARIABLE_COUNT_MAX 64
344#endif
345
348#ifndef FLECS_QUERY_SCOPE_NESTING_MAX
349#define FLECS_QUERY_SCOPE_NESTING_MAX 8
350#endif
351
356#ifndef FLECS_DAG_DEPTH_MAX
357#define FLECS_DAG_DEPTH_MAX 128
358#endif
359
364#define FLECS_TREE_SPAWNER_DEPTH_CACHE_SIZE (6)
365
368#include "flecs/private/api_defines.h"
369
379typedef uint64_t ecs_id_t;
380
387
403typedef struct {
405 int32_t count;
406} ecs_type_t;
407
431
434
437
439typedef struct ecs_term_t ecs_term_t;
440
443
462
467
472typedef struct ecs_iter_t ecs_iter_t;
473
482typedef struct ecs_ref_t ecs_ref_t;
483
488
493
496
499
519typedef void ecs_poly_t;
520
523
530
533
536#include "flecs/datastructures/vec.h" /* Vector datatype */
537#include "flecs/datastructures/sparse.h" /* Sparse set */
538#include "flecs/datastructures/block_allocator.h" /* Block allocator */
539#include "flecs/datastructures/stack_allocator.h" /* Stack allocator */
540#include "flecs/datastructures/map.h" /* Map */
541#include "flecs/datastructures/allocator.h" /* Allocator */
542#include "flecs/datastructures/strbuf.h" /* String builder */
543#include "flecs/os_api.h" /* Abstraction for operating system functions */
544
545#ifdef __cplusplus
546extern "C" {
547#endif
548
573typedef void (*ecs_run_action_t)(
574 ecs_iter_t *it);
575
582typedef void (*ecs_iter_action_t)(
583 ecs_iter_t *it);
584
593 ecs_iter_t *it);
594
601 ecs_iter_t *it);
602
605 ecs_entity_t e1,
606 const void *ptr1,
607 ecs_entity_t e2,
608 const void *ptr2);
609
612 ecs_world_t* world,
613 ecs_table_t* table,
614 ecs_entity_t* entities,
615 void* ptr,
616 int32_t size,
617 int32_t lo,
618 int32_t hi,
619 ecs_order_by_action_t order_by);
620
622typedef uint64_t (*ecs_group_by_action_t)(
623 ecs_world_t *world,
624 ecs_table_t *table,
625 ecs_id_t group_id,
626 void *ctx);
627
629typedef void* (*ecs_group_create_action_t)(
630 ecs_world_t *world,
631 uint64_t group_id,
632 void *group_by_ctx); /* from ecs_query_desc_t */
633
636 ecs_world_t *world,
637 uint64_t group_id,
638 void *group_ctx, /* return value from ecs_group_create_action_t */
639 void *group_by_ctx); /* from ecs_query_desc_t */
640
642typedef void (*ecs_module_action_t)(
643 ecs_world_t *world);
644
646typedef void (*ecs_fini_action_t)(
647 ecs_world_t *world,
648 void *ctx);
649
651typedef void (*ecs_ctx_free_t)(
652 void *ctx);
653
655typedef int (*ecs_compare_action_t)(
656 const void *ptr1,
657 const void *ptr2);
658
660typedef uint64_t (*ecs_hash_value_action_t)(
661 const void *ptr);
662
664typedef void (*ecs_xtor_t)(
665 void *ptr,
666 int32_t count,
667 const ecs_type_info_t *type_info);
668
670typedef void (*ecs_copy_t)(
671 void *dst_ptr,
672 const void *src_ptr,
673 int32_t count,
674 const ecs_type_info_t *type_info);
675
677typedef void (*ecs_move_t)(
678 void *dst_ptr,
679 void *src_ptr,
680 int32_t count,
681 const ecs_type_info_t *type_info);
682
684typedef int (*ecs_cmp_t)(
685 const void *a_ptr,
686 const void *b_ptr,
687 const ecs_type_info_t *type_info);
688
690typedef bool (*ecs_equals_t)(
691 const void *a_ptr,
692 const void *b_ptr,
693 const ecs_type_info_t *type_info);
694
698typedef bool (*ecs_on_validate_t)(
699 ecs_world_t *world,
700 ecs_entity_t entity,
701 void *ptr);
702
704typedef void (*flecs_poly_dtor_t)(
705 ecs_poly_t *poly);
706
725
736
744
751#define EcsSelf (1llu << 63)
752
757#define EcsUp (1llu << 62)
758
763#define EcsTrav (1llu << 61)
764
769#define EcsCascade (1llu << 60)
770
775#define EcsDesc (1llu << 59)
776
781#define EcsIsVariable (1llu << 58)
782
787#define EcsIsEntity (1llu << 57)
788
793#define EcsIsName (1llu << 56)
794
799#define EcsTraverseFlags (EcsSelf|EcsUp|EcsTrav|EcsCascade|EcsDesc)
800
805#define EcsTermRefFlags (EcsTraverseFlags|EcsIsVariable|EcsIsEntity|EcsIsName)
806
821
843
884
913
921/* Flags that can be used to check which hooks a type has set */
922#define ECS_TYPE_HOOK_CTOR ECS_CAST(ecs_flags32_t, 1 << 0)
923#define ECS_TYPE_HOOK_DTOR ECS_CAST(ecs_flags32_t, 1 << 1)
924#define ECS_TYPE_HOOK_COPY ECS_CAST(ecs_flags32_t, 1 << 2)
925#define ECS_TYPE_HOOK_MOVE ECS_CAST(ecs_flags32_t, 1 << 3)
926#define ECS_TYPE_HOOK_COPY_CTOR ECS_CAST(ecs_flags32_t, 1 << 4)
927#define ECS_TYPE_HOOK_MOVE_CTOR ECS_CAST(ecs_flags32_t, 1 << 5)
928#define ECS_TYPE_HOOK_CTOR_MOVE_DTOR ECS_CAST(ecs_flags32_t, 1 << 6)
929#define ECS_TYPE_HOOK_MOVE_DTOR ECS_CAST(ecs_flags32_t, 1 << 7)
930#define ECS_TYPE_HOOK_CMP ECS_CAST(ecs_flags32_t, 1 << 8)
931#define ECS_TYPE_HOOK_EQUALS ECS_CAST(ecs_flags32_t, 1 << 9)
932
933
934/* Flags that can be used to set/check which hooks of a type are invalid */
935#define ECS_TYPE_HOOK_CTOR_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 10)
936#define ECS_TYPE_HOOK_DTOR_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 12)
937#define ECS_TYPE_HOOK_COPY_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 13)
938#define ECS_TYPE_HOOK_MOVE_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 14)
939#define ECS_TYPE_HOOK_COPY_CTOR_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 15)
940#define ECS_TYPE_HOOK_MOVE_CTOR_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 16)
941#define ECS_TYPE_HOOK_CTOR_MOVE_DTOR_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 17)
942#define ECS_TYPE_HOOK_MOVE_DTOR_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 18)
943#define ECS_TYPE_HOOK_CMP_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 19)
944#define ECS_TYPE_HOOK_EQUALS_ILLEGAL ECS_CAST(ecs_flags32_t, 1 << 20)
945
946/* Internal debug flag that indicates type hooks have been invoked */
947#define ECS_TYPE_HOOK_IN_USE ECS_CAST(ecs_flags32_t, 1 << 21)
948
949
950/* All valid hook flags */
951#define ECS_TYPE_HOOKS (ECS_TYPE_HOOK_CTOR|ECS_TYPE_HOOK_DTOR|\
952 ECS_TYPE_HOOK_COPY|ECS_TYPE_HOOK_MOVE|ECS_TYPE_HOOK_COPY_CTOR|\
953 ECS_TYPE_HOOK_MOVE_CTOR|ECS_TYPE_HOOK_CTOR_MOVE_DTOR|\
954 ECS_TYPE_HOOK_MOVE_DTOR|ECS_TYPE_HOOK_CMP|ECS_TYPE_HOOK_EQUALS)
955
956/* All invalid hook flags */
957#define ECS_TYPE_HOOKS_ILLEGAL (ECS_TYPE_HOOK_CTOR_ILLEGAL|\
958 ECS_TYPE_HOOK_DTOR_ILLEGAL|ECS_TYPE_HOOK_COPY_ILLEGAL|\
959 ECS_TYPE_HOOK_MOVE_ILLEGAL|ECS_TYPE_HOOK_COPY_CTOR_ILLEGAL|\
960 ECS_TYPE_HOOK_MOVE_CTOR_ILLEGAL|ECS_TYPE_HOOK_CTOR_MOVE_DTOR_ILLEGAL|\
961 ECS_TYPE_HOOK_MOVE_DTOR_ILLEGAL|ECS_TYPE_HOOK_CMP_ILLEGAL|\
962 ECS_TYPE_HOOK_EQUALS_ILLEGAL)
1032
1044
1045#include "flecs/private/api_types.h" /* Supporting API types */
1046#include "flecs/private/api_support.h" /* Supporting API functions */
1047#include "flecs/datastructures/hashmap.h" /* Hashmap */
1048#include "flecs/private/api_internals.h" /* Supporting API functions */
1049
1055
1060typedef struct ecs_entity_desc_t {
1061 int32_t _canary;
1067 const char *name;
1072 const char *sep;
1076 const char *root_sep;
1078 const char *symbol;
1094
1097
1099 const char *add_expr;
1101
1131
1145
1185 /* World */
1189 /* Matched data */
1190 int32_t offset;
1191 int32_t count;
1193 void **ptrs;
1195 const int16_t *columns;
1196 const ecs_size_t *sizes;
1201 ecs_flags64_t constrained_vars;
1202 ecs_termset_t set_fields;
1203 ecs_termset_t ref_fields;
1204 ecs_termset_t row_fields;
1205 ecs_termset_t up_fields;
1207 /* Input information */
1211 int32_t event_cur;
1213 /* Query information */
1215 int8_t term_index;
1220 /* Context */
1221 void *param;
1222 void *ctx;
1225 void *run_ctx;
1227 /* Time */
1231 /* Iterator counters */
1234 /* Misc */
1235 ecs_flags32_t flags;
1237 ecs_iter_private_t priv_;
1239 /* Chained iterators */
1244};
1245
1246
1251#define EcsQueryMatchPrefab (1u << 1u)
1252
1257#define EcsQueryMatchDisabled (1u << 2u)
1258
1263#define EcsQueryMatchEmptyTables (1u << 3u)
1264
1269#define EcsQueryAllowUnresolvedByName (1u << 6u)
1270
1275#define EcsQueryTableOnly (1u << 7u)
1276
1287#define EcsQueryDetectChanges (1u << 8u)
1288
1297#define EcsQueryGroupByOrdered (1u << 9u)
1298
1308#define EcsQueryGroupByDesc (1u << 10u)
1309
1310
1384
1445
1450typedef struct ecs_event_desc_t {
1453
1458
1461
1465
1467 int32_t offset;
1468
1472 int32_t count;
1473
1476
1481 void *param;
1482
1486 const void *const_param;
1487
1492 void *set_ptr;
1493
1496
1498 ecs_flags32_t flags;
1500
1501
1510typedef struct ecs_build_info_t {
1511 const char *compiler;
1512 const char **addons;
1513 const char **flags;
1514 const char *version;
1518 bool debug;
1522
1582
1590
1594typedef struct ecs_entity_range_t {
1595 uint32_t min;
1596 uint32_t max;
1597 uint32_t cur;
1598 ecs_vec_t recycled;
1600
1611typedef struct EcsIdentifier {
1612 char *value;
1613 ecs_size_t length;
1614 uint64_t hash;
1615 uint64_t index_hash;
1616 ecs_hashmap_t *index;
1618
1620typedef struct EcsComponent {
1621 ecs_size_t size;
1622 ecs_size_t alignment;
1624
1629
1638
1643
1645typedef struct {
1646 const char *child_name;
1648 uint32_t child;
1651
1653typedef struct {
1654 ecs_vec_t children;
1656
1667
1671/* Only include deprecated definitions if deprecated addon is required */
1672#ifdef FLECS_DEPRECATED
1674#endif
1675
1691FLECS_API extern const ecs_id_t ECS_PAIR;
1692
1694FLECS_API extern const ecs_id_t ECS_AUTO_OVERRIDE;
1695
1697FLECS_API extern const ecs_id_t ECS_TOGGLE;
1698
1700FLECS_API extern const ecs_id_t ECS_VALUE_PAIR;
1701
1709/* Built-in component IDs */
1710
1712FLECS_API extern const ecs_entity_t ecs_id(EcsComponent);
1713
1715FLECS_API extern const ecs_entity_t ecs_id(EcsIdentifier);
1716
1718FLECS_API extern const ecs_entity_t ecs_id(EcsPoly);
1719
1721FLECS_API extern const ecs_entity_t ecs_id(EcsParent);
1722
1724FLECS_API extern const ecs_entity_t ecs_id(EcsTreeSpawner);
1725
1727FLECS_API extern const ecs_entity_t ecs_id(EcsDefaultChildComponent);
1728
1730FLECS_API extern const ecs_entity_t EcsParentDepth;
1731
1733FLECS_API extern const ecs_entity_t EcsQuery;
1734
1736FLECS_API extern const ecs_entity_t EcsObserver;
1737
1739FLECS_API extern const ecs_entity_t EcsSystem;
1740
1742FLECS_API extern const ecs_entity_t ecs_id(EcsTickSource);
1743
1745FLECS_API extern const ecs_entity_t ecs_id(EcsPipelineQuery);
1746
1748FLECS_API extern const ecs_entity_t ecs_id(EcsTimer);
1749
1751FLECS_API extern const ecs_entity_t ecs_id(EcsRateFilter);
1752
1754FLECS_API extern const ecs_entity_t EcsFlecs;
1755
1757FLECS_API extern const ecs_entity_t EcsFlecsCore;
1758
1760FLECS_API extern const ecs_entity_t EcsWorld;
1761
1763FLECS_API extern const ecs_entity_t EcsWildcard;
1764
1766FLECS_API extern const ecs_entity_t EcsAny;
1767
1769FLECS_API extern const ecs_entity_t EcsThis;
1770
1772FLECS_API extern const ecs_entity_t EcsVariable;
1773
1781FLECS_API extern const ecs_entity_t EcsTransitive;
1782
1790FLECS_API extern const ecs_entity_t EcsReflexive;
1791
1802FLECS_API extern const ecs_entity_t EcsFinal;
1803
1809FLECS_API extern const ecs_entity_t EcsInheritable;
1810
1812FLECS_API extern const ecs_entity_t EcsOnInstantiate;
1813
1817FLECS_API extern const ecs_entity_t EcsOverride;
1818
1822FLECS_API extern const ecs_entity_t EcsInherit;
1823
1828FLECS_API extern const ecs_entity_t EcsDontInherit;
1829
1837FLECS_API extern const ecs_entity_t EcsSymmetric;
1838
1848FLECS_API extern const ecs_entity_t EcsExclusive;
1849
1851FLECS_API extern const ecs_entity_t EcsAcyclic;
1852
1855FLECS_API extern const ecs_entity_t EcsTraversable;
1856
1866FLECS_API extern const ecs_entity_t EcsWith;
1867
1877FLECS_API extern const ecs_entity_t EcsOneOf;
1878
1880FLECS_API extern const ecs_entity_t EcsCanToggle;
1881
1885FLECS_API extern const ecs_entity_t EcsTrait;
1886
1896FLECS_API extern const ecs_entity_t EcsRelationship;
1897
1907FLECS_API extern const ecs_entity_t EcsTarget;
1908
1911FLECS_API extern const ecs_entity_t EcsPairIsTag;
1912
1914FLECS_API extern const ecs_entity_t EcsName;
1915
1917FLECS_API extern const ecs_entity_t EcsSymbol;
1918
1920FLECS_API extern const ecs_entity_t EcsAlias;
1921
1923FLECS_API extern const ecs_entity_t EcsChildOf;
1924
1926FLECS_API extern const ecs_entity_t EcsIsA;
1927
1929FLECS_API extern const ecs_entity_t EcsDependsOn;
1930
1932FLECS_API extern const ecs_entity_t EcsSlotOf;
1933
1935FLECS_API extern const ecs_entity_t EcsOrderedChildren;
1936
1938FLECS_API extern const ecs_entity_t EcsModule;
1939
1942FLECS_API extern const ecs_entity_t EcsPrefab;
1943
1946FLECS_API extern const ecs_entity_t EcsDisabled;
1947
1951FLECS_API extern const ecs_entity_t EcsNotQueryable;
1952
1954FLECS_API extern const ecs_entity_t EcsOnAdd;
1955
1957FLECS_API extern const ecs_entity_t EcsOnRemove;
1958
1960FLECS_API extern const ecs_entity_t EcsOnSet;
1961
1963FLECS_API extern const ecs_entity_t EcsMonitor;
1964
1966FLECS_API extern const ecs_entity_t EcsOnTableCreate;
1967
1969FLECS_API extern const ecs_entity_t EcsOnTableDelete;
1970
1972FLECS_API extern const ecs_entity_t EcsOnDelete;
1973
1976FLECS_API extern const ecs_entity_t EcsOnDeleteTarget;
1977
1980FLECS_API extern const ecs_entity_t EcsRemove;
1981
1984FLECS_API extern const ecs_entity_t EcsDelete;
1985
1988FLECS_API extern const ecs_entity_t EcsPanic;
1989
1992FLECS_API extern const ecs_entity_t EcsSingleton;
1993
1995FLECS_API extern const ecs_entity_t EcsSparse;
1996
1998FLECS_API extern const ecs_entity_t EcsDontFragment;
1999
2001FLECS_API extern const ecs_entity_t EcsPredEq;
2002
2004FLECS_API extern const ecs_entity_t EcsPredMatch;
2005
2007FLECS_API extern const ecs_entity_t EcsPredLookup;
2008
2010FLECS_API extern const ecs_entity_t EcsScopeOpen;
2011
2013FLECS_API extern const ecs_entity_t EcsScopeClose;
2014
2019FLECS_API extern const ecs_entity_t EcsEmpty;
2020
2021FLECS_API extern const ecs_entity_t ecs_id(EcsPipeline);
2022FLECS_API extern const ecs_entity_t EcsOnStart;
2023FLECS_API extern const ecs_entity_t EcsPreFrame;
2024FLECS_API extern const ecs_entity_t EcsOnLoad;
2025FLECS_API extern const ecs_entity_t EcsPostLoad;
2026FLECS_API extern const ecs_entity_t EcsPreUpdate;
2027FLECS_API extern const ecs_entity_t EcsOnUpdate;
2028FLECS_API extern const ecs_entity_t EcsOnValidate;
2029FLECS_API extern const ecs_entity_t EcsPostUpdate;
2030FLECS_API extern const ecs_entity_t EcsPreStore;
2031FLECS_API extern const ecs_entity_t EcsOnStore;
2032FLECS_API extern const ecs_entity_t EcsPostFrame;
2033FLECS_API extern const ecs_entity_t EcsPhase;
2035FLECS_API extern const ecs_entity_t EcsConstant;
2039#define EcsLastInternalComponentId (ecs_id(EcsTreeSpawner))
2040
2043#define EcsFirstUserComponentId (8)
2044
2047#define EcsFirstUserEntityId (FLECS_HI_COMPONENT_ID + 128)
2048
2049/* When visualized, the reserved ID ranges look like this:
2050 * - [1..8]: Built-in components
2051 * - [9..FLECS_HI_COMPONENT_ID]: Low IDs reserved for application components
2052 * - [FLECS_HI_COMPONENT_ID + 1..EcsFirstUserEntityId]: Built-in entities
2053 */
2054
2076FLECS_API
2078
2085FLECS_API
2087
2097FLECS_API
2099 int argc,
2100 char *argv[]);
2101
2108FLECS_API
2110 ecs_world_t *world);
2111
2119FLECS_API
2121 const ecs_world_t *world);
2122
2131FLECS_API
2133 ecs_world_t *world,
2134 ecs_fini_action_t action,
2135 void *ctx);
2136
2143
2170FLECS_API
2172 const ecs_world_t *world);
2173
2181FLECS_API
2183 const ecs_world_t *world);
2184
2210FLECS_API
2212 ecs_world_t *world,
2213 ecs_ftime_t delta_time);
2214
2221FLECS_API
2223 ecs_world_t *world);
2224
2233FLECS_API
2235 ecs_world_t *world,
2236 ecs_fini_action_t action,
2237 void *ctx);
2238
2245FLECS_API
2247 ecs_world_t *world);
2248
2255FLECS_API
2257 const ecs_world_t *world);
2258
2271 ecs_world_t *world,
2272 bool enable);
2273
2285 ecs_world_t *world,
2286 bool enable);
2287
2303FLECS_API
2305 ecs_world_t *world,
2306 ecs_ftime_t fps);
2307
2321FLECS_API
2323 ecs_world_t *world,
2324 ecs_flags32_t flags);
2325
2402FLECS_API
2404 ecs_world_t *world,
2405 bool multi_threaded);
2406
2414FLECS_API
2416 ecs_world_t *world);
2417
2423FLECS_API
2425 ecs_world_t *stage);
2426
2443FLECS_API
2445 ecs_world_t *world);
2446
2460FLECS_API
2462 ecs_world_t *world);
2463
2478FLECS_API
2480 ecs_world_t *world);
2481
2492FLECS_API
2494 ecs_world_t *world);
2495
2507FLECS_API
2509 const ecs_world_t *world);
2510
2522FLECS_API
2524 const ecs_world_t *world);
2525
2539FLECS_API
2541 ecs_world_t *world,
2542 int32_t stages);
2543
2550FLECS_API
2552 const ecs_world_t *world);
2553
2569FLECS_API
2571 const ecs_world_t *world,
2572 int32_t stage_id);
2573
2581FLECS_API
2583 const ecs_world_t *world);
2584
2592FLECS_API
2594 ecs_world_t *world);
2595
2600FLECS_API
2602 ecs_world_t *stage);
2603
2611FLECS_API
2613 const ecs_world_t *world);
2614
2630FLECS_API
2632 ecs_world_t *world,
2633 void *ctx,
2634 ecs_ctx_free_t ctx_free);
2635
2644FLECS_API
2646 ecs_world_t *world,
2647 void *ctx,
2648 ecs_ctx_free_t ctx_free);
2649
2657FLECS_API
2659 const ecs_world_t *world);
2660
2668FLECS_API
2670 const ecs_world_t *world);
2671
2677FLECS_API
2679
2685FLECS_API
2687 const ecs_world_t *world);
2688
2697FLECS_API
2699 ecs_world_t *world,
2700 int32_t entity_count);
2701
2716FLECS_API
2718 ecs_world_t *world);
2719
2734FLECS_API
2736 ecs_world_t *world,
2737 uint32_t min,
2738 uint32_t max);
2739
2754FLECS_API
2756 ecs_world_t *world,
2757 const ecs_entity_range_t *range);
2758
2766FLECS_API
2768 const ecs_world_t *world);
2769
2775FLECS_API
2777 const ecs_world_t *world);
2778
2792FLECS_API
2794 ecs_world_t *world,
2795 ecs_flags32_t flags);
2796
2812
2848FLECS_API
2850 ecs_world_t *world,
2851 const ecs_delete_empty_tables_desc_t *desc);
2852
2858FLECS_API
2860 const ecs_poly_t *poly);
2861
2867FLECS_API
2869 const ecs_poly_t *poly);
2870
2884FLECS_API
2886 const ecs_poly_t *object,
2887 int32_t type);
2888
2892#define flecs_poly_is(object, type)\
2893 flecs_poly_is_(object, type##_magic)
2894
2903FLECS_API
2905 ecs_entity_t first,
2906 ecs_entity_t second);
2907
2930FLECS_API
2932 ecs_world_t *world,
2933 const char *thread_name);
2934
2957FLECS_API
2959 ecs_world_t *world,
2960 bool lock_world);
2961
2988FLECS_API
2990 ecs_world_t *world);
2991
3009FLECS_API
3011 ecs_world_t *world);
3012
3020FLECS_API
3022 ecs_world_t *world,
3023 ecs_id_t component);
3024
3032FLECS_API
3034 ecs_world_t *world,
3035 ecs_table_t *table);
3036
3055FLECS_API
3057 ecs_world_t *world,
3058 const ecs_entity_desc_t *desc);
3059
3086FLECS_API
3088 ecs_world_t *world,
3089 const ecs_bulk_desc_t *desc);
3090
3100FLECS_API
3102 ecs_world_t *world,
3103 ecs_id_t component,
3104 int32_t count);
3105
3121FLECS_API
3123 ecs_world_t *world,
3124 ecs_entity_t dst,
3125 ecs_entity_t src,
3126 bool copy_value);
3127
3136FLECS_API
3138 ecs_world_t *world,
3139 ecs_entity_t entity);
3140
3148FLECS_API
3150 ecs_world_t *world,
3151 ecs_id_t component);
3152
3170FLECS_API
3172 ecs_world_t *world,
3173 ecs_entity_t parent,
3174 const ecs_entity_t *children,
3175 int32_t child_count);
3176
3186FLECS_API
3188 const ecs_world_t *world,
3189 ecs_entity_t parent);
3190
3208FLECS_API
3210 ecs_world_t *world,
3211 ecs_entity_t entity,
3212 ecs_id_t component);
3213
3222FLECS_API
3224 ecs_world_t *world,
3225 ecs_entity_t entity,
3226 ecs_id_t component);
3227
3279FLECS_API
3281 ecs_world_t *world,
3282 ecs_entity_t entity,
3283 ecs_id_t component);
3284
3291FLECS_API
3293 ecs_world_t *world,
3294 ecs_entity_t entity);
3295
3303FLECS_API
3305 ecs_world_t *world,
3306 ecs_id_t component);
3307
3323FLECS_API
3325 ecs_world_t *world,
3326 ecs_id_t component);
3327
3336FLECS_API
3338 const ecs_world_t *world);
3339
3358FLECS_API
3360 ecs_world_t *world,
3361 ecs_entity_t entity,
3362 bool enabled);
3363
3377FLECS_API
3379 ecs_world_t *world,
3380 ecs_entity_t entity,
3381 ecs_id_t component,
3382 bool enable);
3383
3394FLECS_API
3396 const ecs_world_t *world,
3397 ecs_entity_t entity,
3398 ecs_id_t component);
3399
3423FLECS_API
3424FLECS_ALWAYS_INLINE const void* ecs_get_id(
3425 const ecs_world_t *world,
3426 ecs_entity_t entity,
3427 ecs_id_t component);
3428
3443FLECS_API
3444FLECS_ALWAYS_INLINE void* ecs_get_mut_id(
3445 const ecs_world_t *world,
3446 ecs_entity_t entity,
3447 ecs_id_t component);
3448
3463FLECS_API
3464FLECS_ALWAYS_INLINE void* ecs_get_sparse_id(
3465 const ecs_world_t *world,
3466 ecs_entity_t entity,
3467 ecs_id_t component,
3468 size_t size);
3469
3487FLECS_API
3489 ecs_world_t *world,
3490 ecs_entity_t entity,
3491 ecs_id_t component,
3492 size_t size);
3493
3504FLECS_ALWAYS_INLINE FLECS_API
3506 const ecs_world_t *world,
3507 ecs_entity_t entity,
3508 ecs_id_t component);
3509
3520FLECS_ALWAYS_INLINE FLECS_API
3522 const ecs_world_t *world,
3523 ecs_ref_t *ref,
3524 ecs_id_t component);
3525
3534FLECS_ALWAYS_INLINE FLECS_API
3536 const ecs_world_t *world,
3537 ecs_ref_t *ref,
3538 ecs_id_t component);
3539
3560FLECS_API
3562 ecs_world_t *world,
3563 ecs_entity_t entity,
3564 ecs_id_t component,
3565 size_t size,
3566 bool *is_new);
3567
3577FLECS_API
3579 ecs_world_t *world,
3580 ecs_entity_t entity,
3581 ecs_id_t component);
3582
3598FLECS_API
3600 ecs_world_t *world,
3601 ecs_entity_t entity,
3602 ecs_id_t component,
3603 size_t size,
3604 const void *ptr);
3605
3634FLECS_API
3636 const ecs_world_t *world,
3637 ecs_entity_t e);
3638
3668FLECS_API
3670 const ecs_world_t *world,
3671 ecs_entity_t e);
3672
3678FLECS_API
3680 ecs_entity_t e);
3681
3698FLECS_API
3700 const ecs_world_t *world,
3701 ecs_entity_t e);
3702
3725FLECS_API
3727 ecs_world_t *world,
3728 ecs_entity_t entity);
3729
3748FLECS_API
3750 ecs_world_t *world,
3751 ecs_id_t component);
3752
3760FLECS_API
3762 const ecs_world_t *world,
3763 ecs_entity_t entity);
3764
3779FLECS_API
3781 ecs_world_t *world,
3782 ecs_entity_t entity);
3783
3789FLECS_API
3791 ecs_entity_t entity);
3792
3808FLECS_API
3810 const ecs_world_t *world,
3811 ecs_entity_t entity);
3812
3819FLECS_API
3821 const ecs_world_t *world,
3822 ecs_entity_t entity);
3823
3831FLECS_API
3833 const ecs_world_t *world,
3834 const ecs_type_t* type);
3835
3847FLECS_API
3849 const ecs_world_t *world,
3850 const ecs_table_t *table);
3851
3866FLECS_API
3868 const ecs_world_t *world,
3869 ecs_entity_t entity);
3870
3881FLECS_API
3882FLECS_ALWAYS_INLINE bool ecs_has_id(
3883 const ecs_world_t *world,
3884 ecs_entity_t entity,
3885 ecs_id_t component);
3886
3897FLECS_API
3898FLECS_ALWAYS_INLINE bool ecs_owns_id(
3899 const ecs_world_t *world,
3900 ecs_entity_t entity,
3901 ecs_id_t component);
3902
3917FLECS_API
3919 const ecs_world_t *world,
3920 ecs_entity_t entity,
3921 ecs_entity_t rel,
3922 int32_t index);
3923
3937FLECS_API
3939 const ecs_world_t *world,
3940 ecs_entity_t entity);
3941
3955FLECS_API
3957 ecs_world_t *world,
3958 ecs_entity_t parent,
3959 const char *name);
3960
3981FLECS_API
3983 const ecs_world_t *world,
3984 ecs_entity_t entity,
3985 ecs_entity_t rel,
3986 ecs_id_t component);
3987
3998FLECS_API
4000 const ecs_world_t *world,
4001 ecs_entity_t entity,
4002 ecs_entity_t rel);
4003
4011FLECS_API
4013 const ecs_world_t *world,
4014 ecs_id_t entity);
4015
4035FLECS_API
4036const char* ecs_get_name(
4037 const ecs_world_t *world,
4038 ecs_entity_t entity);
4039
4049FLECS_API
4050const char* ecs_get_symbol(
4051 const ecs_world_t *world,
4052 ecs_entity_t entity);
4053
4067FLECS_API
4069 ecs_world_t *world,
4070 ecs_entity_t entity,
4071 const char *name);
4072
4086FLECS_API
4088 ecs_world_t *world,
4089 ecs_entity_t entity,
4090 const char *symbol);
4091
4103FLECS_API
4105 ecs_world_t *world,
4106 ecs_entity_t entity,
4107 const char *alias);
4108
4124FLECS_API
4126 const ecs_world_t *world,
4127 const char *path);
4128
4143FLECS_API
4145 const ecs_world_t *world,
4146 ecs_entity_t parent,
4147 const char *name);
4148
4171FLECS_API
4173 const ecs_world_t *world,
4174 ecs_entity_t parent,
4175 const char *path,
4176 const char *sep,
4177 const char *prefix,
4178 bool recursive);
4179
4197FLECS_API
4199 const ecs_world_t *world,
4200 const char *symbol,
4201 bool lookup_as_path,
4202 bool recursive);
4203
4225FLECS_API
4227 const ecs_world_t *world,
4228 ecs_entity_t parent,
4229 ecs_entity_t child,
4230 const char *sep,
4231 const char *prefix);
4232
4246FLECS_API
4248 const ecs_world_t *world,
4249 ecs_entity_t parent,
4250 ecs_entity_t child,
4251 const char *sep,
4252 const char *prefix,
4253 ecs_strbuf_t *buf,
4254 bool escape);
4255
4271FLECS_API
4273 ecs_world_t *world,
4274 ecs_entity_t parent,
4275 const char *path,
4276 const char *sep,
4277 const char *prefix);
4278
4293FLECS_API
4295 ecs_world_t *world,
4296 ecs_entity_t entity,
4297 ecs_entity_t parent,
4298 const char *path,
4299 const char *sep,
4300 const char *prefix);
4301
4315FLECS_API
4317 ecs_world_t *world,
4318 ecs_entity_t scope);
4319
4327FLECS_API
4329 const ecs_world_t *world);
4330
4340FLECS_API
4342 ecs_world_t *world,
4343 const char *prefix);
4344
4371FLECS_API
4373 ecs_world_t *world,
4374 const ecs_entity_t *lookup_path);
4375
4382FLECS_API
4384 const ecs_world_t *world);
4385
4410FLECS_API
4412 ecs_world_t *world,
4413 const ecs_component_desc_t *desc);
4414
4424FLECS_API
4426 const ecs_world_t *world,
4427 ecs_id_t component);
4428
4440FLECS_API
4442 ecs_world_t *world,
4443 ecs_entity_t component,
4444 const ecs_type_hooks_t *hooks);
4445
4452FLECS_API
4454 const ecs_world_t *world,
4455 ecs_entity_t component);
4456
4480FLECS_API
4482 const ecs_world_t *world,
4483 ecs_id_t component);
4484
4493FLECS_API
4495 const ecs_world_t *world,
4496 ecs_id_t component);
4497
4517FLECS_API
4519 const ecs_world_t *world,
4520 ecs_id_t component);
4521
4530FLECS_API
4532 ecs_id_t component,
4533 ecs_id_t pattern);
4534
4540FLECS_API
4542 ecs_id_t component);
4543
4549FLECS_API
4551 ecs_id_t component);
4552
4559 ecs_id_t component);
4560
4574FLECS_API
4576 const ecs_world_t *world,
4577 ecs_id_t component);
4578
4587FLECS_API
4588ecs_flags32_t ecs_id_get_flags(
4589 const ecs_world_t *world,
4590 ecs_id_t component);
4591
4602FLECS_API
4604 uint64_t component_flags);
4605
4621FLECS_API
4623 const ecs_world_t *world,
4624 ecs_id_t component);
4625
4633FLECS_API
4635 const ecs_world_t *world,
4636 ecs_id_t component,
4637 ecs_strbuf_t *buf);
4638
4647FLECS_API
4649 const ecs_world_t *world,
4650 const char *expr);
4651
4667FLECS_API
4669 const ecs_term_ref_t *ref);
4670
4682FLECS_API
4684 const ecs_term_t *term);
4685
4700FLECS_API
4702 const ecs_term_t *term);
4703
4716FLECS_API
4718 const ecs_term_t *term);
4719
4728FLECS_API
4730 const ecs_world_t *world,
4731 const ecs_term_t *term);
4732
4740FLECS_API
4742 const ecs_query_t *query);
4743
4784FLECS_API
4786 const ecs_world_t *world,
4787 ecs_id_t component);
4788
4794FLECS_API
4796 ecs_iter_t *it);
4797
4820FLECS_API
4821FLECS_ALWAYS_INLINE ecs_iter_t ecs_children(
4822 const ecs_world_t *world,
4823 ecs_entity_t parent);
4824
4832FLECS_API
4833FLECS_ALWAYS_INLINE ecs_iter_t ecs_children_w_rel(
4834 const ecs_world_t *world,
4835 ecs_entity_t relationship,
4836 ecs_entity_t parent);
4837
4843FLECS_API
4845 ecs_iter_t *it);
4846
4865FLECS_API
4867 ecs_world_t *world,
4868 const ecs_query_desc_t *desc);
4869
4880FLECS_API
4882 ecs_world_t *world,
4883 ecs_entity_t entity,
4884 const ecs_query_desc_t *desc);
4885
4890FLECS_API
4892 ecs_query_t *query);
4893
4902FLECS_API
4904 const ecs_query_t *query,
4905 const char *name);
4906
4914FLECS_API
4916 const ecs_query_t *query,
4917 int32_t var_id);
4918
4929FLECS_API
4931 const ecs_query_t *query,
4932 int32_t var_id);
4933
5002FLECS_API
5004 const ecs_world_t *world,
5005 const ecs_query_t *query);
5006
5014FLECS_API
5016 ecs_iter_t *it);
5017
5036FLECS_API
5038 const ecs_query_t *query,
5039 ecs_entity_t entity,
5040 ecs_iter_t *it);
5041
5060FLECS_API
5062 const ecs_query_t *query,
5063 ecs_table_t *table,
5064 ecs_iter_t *it);
5065
5092FLECS_API
5094 const ecs_query_t *query,
5095 ecs_table_range_t *range,
5096 ecs_iter_t *it);
5097
5105FLECS_API
5107 const ecs_query_t *query);
5108
5118FLECS_API
5120 const ecs_query_t *query);
5121
5136FLECS_API
5138 const ecs_query_t *query,
5139 const ecs_iter_t *it);
5140
5146FLECS_API
5148 const ecs_query_t *query);
5149
5167FLECS_API
5169 ecs_query_t *query,
5170 ecs_iter_t *it,
5171 const char *expr);
5172
5195FLECS_API
5197 ecs_query_t *query);
5198
5207FLECS_API
5209 const ecs_world_t *world,
5210 ecs_entity_t query);
5211
5222FLECS_API
5224 ecs_iter_t *it);
5225
5248FLECS_API
5250 ecs_iter_t *it,
5251 uint64_t group_id);
5252
5278FLECS_API
5279const ecs_map_t* ecs_query_get_groups(
5280 const ecs_query_t *query);
5281
5290FLECS_API
5292 const ecs_query_t *query,
5293 uint64_t group_id);
5294
5303FLECS_API
5305 const ecs_query_t *query,
5306 uint64_t group_id);
5307
5316
5323FLECS_API
5325 const ecs_query_t *query);
5326
5332FLECS_API
5334 const ecs_query_t *query);
5335
5344FLECS_API
5346 const ecs_query_t *query);
5347
5376FLECS_API
5378 ecs_world_t *world,
5379 ecs_event_desc_t *desc);
5380
5391FLECS_API
5393 ecs_world_t *world,
5394 ecs_event_desc_t *desc);
5395
5410FLECS_API
5412 ecs_world_t *world,
5413 const ecs_observer_desc_t *desc);
5414
5430FLECS_API
5432 ecs_world_t *world,
5433 ecs_entity_t observer,
5434 const ecs_observer_desc_t *desc);
5435
5444FLECS_API
5446 const ecs_world_t *world,
5447 ecs_entity_t observer);
5448
5471FLECS_API
5473 ecs_iter_t *it);
5474
5484FLECS_API
5486 ecs_iter_t *it);
5487
5499FLECS_API
5501 ecs_iter_t *it);
5502
5515FLECS_API
5517 ecs_iter_t *it);
5518
5526FLECS_API
5528 ecs_iter_t *it);
5529
5568FLECS_API
5570 ecs_iter_t *it,
5571 int32_t var_id,
5572 ecs_entity_t entity);
5573
5584FLECS_API
5586 ecs_iter_t *it,
5587 int32_t var_id,
5588 const ecs_table_t *table);
5589
5600FLECS_API
5602 ecs_iter_t *it,
5603 int32_t var_id,
5604 const ecs_table_range_t *range);
5605
5618FLECS_API
5620 ecs_iter_t *it,
5621 int32_t var_id);
5622
5629FLECS_API
5631 const ecs_iter_t *it,
5632 int32_t var_id);
5633
5639FLECS_API
5641 const ecs_iter_t *it);
5642
5648FLECS_API
5650 const ecs_iter_t *it);
5651
5665FLECS_API
5667 ecs_iter_t *it,
5668 int32_t var_id);
5669
5683FLECS_API
5685 ecs_iter_t *it,
5686 int32_t var_id);
5687
5699FLECS_API
5701 ecs_iter_t *it,
5702 int32_t var_id);
5703
5715FLECS_API
5717 const ecs_iter_t *it);
5718
5730FLECS_API
5732 ecs_iter_t *it);
5733
5745FLECS_API
5747 const ecs_iter_t *it);
5748
5764FLECS_API
5766 const ecs_iter_t *it,
5767 int32_t offset,
5768 int32_t limit);
5769
5776FLECS_API
5778 ecs_iter_t *it);
5779
5800FLECS_API
5802 const ecs_iter_t *it,
5803 int32_t index,
5804 int32_t count);
5805
5812FLECS_API
5814 ecs_iter_t *it);
5815
5857FLECS_API
5859 const ecs_iter_t *it,
5860 size_t size,
5861 int8_t index);
5862
5885FLECS_API
5887 const ecs_iter_t *it,
5888 size_t size,
5889 int8_t index,
5890 int32_t row);
5891
5900FLECS_API
5902 const ecs_iter_t *it,
5903 int8_t index);
5904
5915FLECS_API
5917 const ecs_iter_t *it,
5918 int8_t index);
5919
5926FLECS_API
5928 const ecs_iter_t *it,
5929 int8_t index);
5930
5937FLECS_API
5939 const ecs_iter_t *it,
5940 int8_t index);
5941
5950FLECS_API
5952 const ecs_iter_t *it,
5953 int8_t index);
5954
5962FLECS_API
5964 const ecs_iter_t *it,
5965 int8_t index);
5966
5974FLECS_API
5976 const ecs_iter_t *it,
5977 int8_t index);
5978
5992FLECS_API
5994 const ecs_iter_t *it,
5995 int8_t index);
5996
6012FLECS_API
6014 const ecs_table_t *table);
6015
6026FLECS_API
6028 const ecs_world_t *world,
6029 const ecs_table_t *table,
6030 ecs_id_t component);
6031
6041FLECS_API
6043 const ecs_world_t *world,
6044 const ecs_table_t *table,
6045 ecs_id_t component);
6046
6054FLECS_API
6056 const ecs_table_t *table);
6057
6071FLECS_API
6073 const ecs_table_t *table,
6074 int32_t index);
6075
6084FLECS_API
6086 const ecs_table_t *table,
6087 int32_t index);
6088
6097FLECS_API
6099 const ecs_table_t *table,
6100 int32_t index,
6101 int32_t offset);
6102
6112FLECS_API
6114 const ecs_world_t *world,
6115 const ecs_table_t *table,
6116 ecs_id_t component,
6117 int32_t offset);
6118
6126FLECS_API
6128 const ecs_table_t *table,
6129 int32_t index);
6130
6137FLECS_API
6139 const ecs_table_t *table);
6140
6148FLECS_API
6150 const ecs_table_t *table);
6151
6158FLECS_API
6160 const ecs_table_t *table);
6161
6172FLECS_API
6174 const ecs_world_t *world,
6175 const ecs_table_t *table,
6176 ecs_id_t component);
6177
6188FLECS_API
6190 const ecs_world_t *world,
6191 const ecs_table_t *table,
6192 ecs_entity_t relationship,
6193 int32_t index);
6194
6205FLECS_API
6207 const ecs_world_t *world,
6208 const ecs_table_t *table,
6209 ecs_entity_t rel);
6210
6220FLECS_API
6222 ecs_world_t *world,
6223 ecs_table_t *table,
6224 ecs_id_t component);
6225
6236FLECS_API
6238 ecs_world_t *world,
6239 const ecs_id_t *ids,
6240 int32_t id_count);
6241
6251FLECS_API
6253 ecs_world_t *world,
6254 ecs_table_t *table,
6255 ecs_id_t component);
6256
6272FLECS_API
6274 ecs_world_t *world,
6275 ecs_table_t *table);
6276
6283FLECS_API
6285 ecs_world_t *world,
6286 ecs_table_t *table);
6287
6297FLECS_API
6299 ecs_table_t *table,
6300 ecs_flags32_t flags);
6301
6309FLECS_API
6311 const ecs_table_t *table);
6312
6322FLECS_API
6324 ecs_world_t* world,
6325 ecs_table_t* table,
6326 int32_t row_1,
6327 int32_t row_2);
6328
6353FLECS_API
6355 ecs_world_t *world,
6356 ecs_entity_t entity,
6357 ecs_record_t *record,
6358 ecs_table_t *table,
6359 const ecs_type_t *added,
6360 const ecs_type_t *removed);
6361
6362
6382FLECS_API
6384 const ecs_world_t *world,
6385 const ecs_table_t *table,
6386 ecs_id_t component,
6387 ecs_id_t *component_out);
6388
6424FLECS_API
6426 const ecs_world_t *world,
6427 const ecs_table_t *table,
6428 int32_t offset,
6429 ecs_id_t component,
6430 ecs_id_t *component_out);
6431
6472FLECS_API
6474 const ecs_world_t *world,
6475 const ecs_table_t *table,
6476 int32_t offset,
6477 ecs_id_t component,
6478 ecs_entity_t rel,
6479 ecs_flags64_t flags, /* EcsSelf and/or EcsUp */
6480 ecs_entity_t *tgt_out,
6481 ecs_id_t *component_out,
6482 struct ecs_table_record_t **tr_out);
6483
6499FLECS_API
6501 const ecs_world_t *world,
6502 ecs_entity_t entity,
6503 ecs_id_t id,
6504 ecs_entity_t rel,
6505 bool self,
6507 ecs_entity_t *tgt_out,
6508 ecs_id_t *id_out,
6509 struct ecs_table_record_t **tr_out);
6510
6518FLECS_API
6520 ecs_world_t* world,
6521 ecs_table_t* table);
6522
6539FLECS_API
6541 const ecs_world_t *world,
6542 ecs_entity_t type,
6543 void *ptr);
6544
6552FLECS_API
6554 const ecs_world_t *world,
6555 const ecs_type_info_t *ti,
6556 void *ptr);
6557
6564FLECS_API
6566 ecs_world_t *world,
6567 ecs_entity_t type);
6568
6576 ecs_world_t *world,
6577 const ecs_type_info_t *ti);
6578
6587 const ecs_world_t *world,
6588 const ecs_type_info_t *ti,
6589 void *ptr);
6590
6598FLECS_API
6600 const ecs_world_t *world,
6601 ecs_entity_t type,
6602 void* ptr);
6603
6611FLECS_API
6613 ecs_world_t *world,
6614 ecs_entity_t type,
6615 void* ptr);
6616
6625FLECS_API
6627 const ecs_world_t *world,
6628 const ecs_type_info_t *ti,
6629 void* dst,
6630 const void *src);
6631
6640FLECS_API
6642 const ecs_world_t *world,
6643 ecs_entity_t type,
6644 void* dst,
6645 const void *src);
6646
6655FLECS_API
6657 const ecs_world_t *world,
6658 const ecs_type_info_t *ti,
6659 void* dst,
6660 void *src);
6661
6670FLECS_API
6672 const ecs_world_t *world,
6673 ecs_entity_t type,
6674 void* dst,
6675 void *src);
6676
6685FLECS_API
6687 const ecs_world_t *world,
6688 const ecs_type_info_t *ti,
6689 void* dst,
6690 void *src);
6691
6700FLECS_API
6702 const ecs_world_t *world,
6703 ecs_entity_t type,
6704 void* dst,
6705 void *src);
6706
6720#include "flecs/addons/flecs_c.h"
6721
6722#ifdef __cplusplus
6723}
6724#endif
6725
6726#include "flecs/private/addons.h"
6727
6728#endif
The deprecated addon contains deprecated operations.
Extends the core API with convenience macros for C applications.
void ecs_remove_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Remove a component from an entity.
void ecs_auto_override_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add an auto override for a component.
void ecs_remove_all(ecs_world_t *world, ecs_id_t component)
Remove all instances of the specified component.
void ecs_clear(ecs_world_t *world, ecs_entity_t entity)
Clear all components.
ecs_id_t ecs_get_with(const ecs_world_t *world)
Get the component set with ecs_set_with().
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add a (component) ID to an entity.
ecs_entity_t ecs_set_with(ecs_world_t *world, ecs_id_t component)
Create new entities with a specified component.
struct ecs_value_t ecs_value_t
Utility to hold a value of a dynamic type.
struct EcsIdentifier EcsIdentifier
A (string) identifier.
struct EcsTreeSpawner EcsTreeSpawner
Tree instantiation cache component.
struct EcsPoly EcsPoly
Component for storing a poly object.
struct EcsDefaultChildComponent EcsDefaultChildComponent
When added to an entity, this informs serialization formats which component to use when a value is as...
struct EcsParent EcsParent
Non-fragmenting ChildOf relationship.
struct EcsComponent EcsComponent
Component information.
const ecs_entity_t EcsScopeClose
Marker used to indicate the end of a scope (}) in queries.
const ecs_entity_t EcsOnRemove
Event that triggers when an ID is removed from an entity.
const ecs_entity_t EcsThis
This entity.
const ecs_entity_t EcsWildcard
Wildcard entity ("*").
const ecs_entity_t EcsName
Tag to indicate name identifier.
const ecs_entity_t EcsAcyclic
Mark a relationship as acyclic.
const ecs_entity_t EcsSymmetric
Mark relationship as commutative.
const ecs_entity_t EcsAlias
Tag to indicate alias identifier.
const ecs_entity_t EcsOnSet
Event that triggers when a component is set for an entity.
const ecs_entity_t EcsReflexive
Mark a relationship as reflexive.
const ecs_entity_t EcsTrait
Can be added to components to indicate it is a trait.
const ecs_entity_t EcsEmpty
Tag used to indicate a query is empty.
const ecs_entity_t EcsOneOf
Ensure that a relationship target is a child of the specified entity.
const ecs_entity_t EcsOnTableDelete
Event that triggers when a table is deleted.
const ecs_entity_t EcsOnTableCreate
Event that triggers when a table is created.
const ecs_entity_t EcsObserver
Tag added to observers.
const ecs_entity_t EcsQuery
Tag added to queries.
const ecs_entity_t EcsRelationship
Ensure that an entity is always used in a pair as a relationship.
const ecs_entity_t EcsSingleton
Mark component as singleton.
const ecs_entity_t EcsOnStart
OnStart pipeline phase.
const ecs_entity_t EcsNotQueryable
Trait added to entities that should never be returned by queries.
const ecs_entity_t EcsOnStore
OnStore pipeline phase.
const ecs_entity_t EcsOrderedChildren
Tag that, when added to a parent, ensures stable order of ecs_children() results.
const ecs_entity_t EcsDontFragment
Mark component as non-fragmenting.
const ecs_entity_t EcsTraversable
Mark a relationship as traversable.
const ecs_entity_t EcsPredLookup
Marker used to indicate $var ~= "pattern" matching in queries.
const ecs_entity_t EcsPreStore
PreStore pipeline phase.
const ecs_entity_t EcsOnLoad
OnLoad pipeline phase.
const ecs_entity_t EcsIsA
Used to express inheritance relationships.
const ecs_entity_t EcsExclusive
Can be added to a relationship to indicate that the relationship can only occur once on an entity.
const ecs_entity_t EcsSymbol
Tag to indicate symbol identifier.
const ecs_entity_t EcsDependsOn
Used to express dependency relationships.
const ecs_entity_t EcsTransitive
Mark a relationship as transitive.
const ecs_entity_t EcsDelete
Delete cleanup policy.
const ecs_entity_t EcsChildOf
Used to express parent-child relationships.
const ecs_entity_t EcsFlecsCore
Core module scope.
const ecs_entity_t EcsMonitor
Event that triggers an observer when an entity starts or stops matching a query.
const ecs_entity_t EcsCanToggle
Mark a component as toggleable with ecs_enable_id().
const ecs_entity_t EcsPredEq
Marker used to indicate $var == ... matching in queries.
const ecs_entity_t EcsPhase
Phase pipeline phase.
const ecs_entity_t EcsWorld
Entity associated with world (used for "attaching" components to world).
const ecs_entity_t EcsScopeOpen
Marker used to indicate the start of a scope ({) in queries.
const ecs_entity_t EcsPostUpdate
PostUpdate pipeline phase.
const ecs_entity_t EcsOnValidate
OnValidate pipeline phase.
const ecs_entity_t EcsRemove
Remove cleanup policy.
const ecs_entity_t EcsOverride
Override component on instantiate.
const ecs_entity_t EcsPredMatch
Marker used to indicate $var == "name" matching in queries.
const ecs_entity_t EcsInherit
Inherit component on instantiate.
const ecs_entity_t EcsSlotOf
Used to express a slot (used with prefab inheritance).
const ecs_entity_t EcsModule
Tag added to module entities.
const ecs_entity_t EcsSparse
Mark component as sparse.
const ecs_entity_t EcsPreUpdate
PreUpdate pipeline phase.
const ecs_entity_t EcsOnAdd
Event that triggers when an ID is added to an entity.
const ecs_entity_t EcsPrefab
Tag added to prefab entities.
const ecs_entity_t EcsOnInstantiate
Relationship that specifies component inheritance behavior.
const ecs_entity_t EcsPostFrame
PostFrame pipeline phase.
const ecs_entity_t EcsInheritable
Mark component as inheritable.
const ecs_entity_t EcsAny
Any entity ("_").
const ecs_entity_t EcsTarget
Ensure that an entity is always used in a pair as a target.
const ecs_entity_t EcsParentDepth
Relationship storing the entity's depth in a non-fragmenting hierarchy.
const ecs_entity_t EcsWith
Ensure that a component is always added together with another component.
const ecs_entity_t EcsPostLoad
PostLoad pipeline phase.
const ecs_entity_t EcsOnDelete
Relationship used for specifying cleanup behavior.
const ecs_entity_t EcsOnDeleteTarget
Relationship used to define what should happen when a target entity (second element of a pair) is del...
const ecs_entity_t EcsPreFrame
PreFrame pipeline phase.
const ecs_entity_t EcsFlecs
Root scope for built-in Flecs entities.
const ecs_entity_t EcsSystem
Tag added to systems.
const ecs_entity_t EcsOnUpdate
OnUpdate pipeline phase.
const ecs_entity_t EcsDisabled
When this tag is added to an entity, it is skipped by queries, unless EcsDisabled is explicitly queri...
const ecs_entity_t EcsDontInherit
Never inherit component on instantiate.
const ecs_entity_t EcsPairIsTag
Can be added to a relationship to indicate that it should never hold data, even when it or the relati...
const ecs_entity_t EcsPanic
Panic cleanup policy.
const ecs_entity_t EcsFinal
Ensure that an entity or component cannot be used as a target in an IsA relationship.
const ecs_entity_t EcsVariable
Variable entity ("$").
const ecs_entity_t EcsConstant
Tag added to enum or bitmask constants.
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
ecs_world_t * ecs_stage_new(ecs_world_t *world)
Create an unmanaged stage.
bool ecs_defer_end(ecs_world_t *world)
End a block of operations to defer.
bool ecs_readonly_begin(ecs_world_t *world, bool multi_threaded)
Begin readonly mode.
void ecs_defer_resume(ecs_world_t *world)
Resume deferring.
bool ecs_defer_begin(ecs_world_t *world)
Defer operations until the end of the frame.
void ecs_defer_suspend(ecs_world_t *world)
Suspend deferring but do not flush queue.
bool ecs_is_deferred(const ecs_world_t *world)
Test if deferring is enabled for the current stage.
void ecs_stage_free(ecs_world_t *stage)
Free an unmanaged stage.
void ecs_merge(ecs_world_t *stage)
Merge a stage.
int32_t ecs_stage_get_id(const ecs_world_t *world)
Get the stage ID.
bool ecs_stage_is_readonly(const ecs_world_t *world)
Test whether the current world is readonly.
int32_t ecs_get_stage_count(const ecs_world_t *world)
Get the number of configured stages.
ecs_world_t * ecs_get_stage(const ecs_world_t *world, int32_t stage_id)
Get stage-specific world pointer.
void ecs_set_stage_count(ecs_world_t *world, int32_t stages)
Configure the world to have N stages.
void ecs_readonly_end(ecs_world_t *world)
End readonly mode.
bool ecs_is_defer_suspended(const ecs_world_t *world)
Test if deferring is suspended for the current stage.
const ecs_type_hooks_t * ecs_get_hooks_id(const ecs_world_t *world, ecs_entity_t component)
Get hooks for a component.
ecs_entity_t ecs_component_init(ecs_world_t *world, const ecs_component_desc_t *desc)
Find or create a component.
const ecs_type_info_t * ecs_get_type_info(const ecs_world_t *world, ecs_id_t component)
Get the type info for a component.
struct ecs_component_desc_t ecs_component_desc_t
Used with ecs_component_init().
void ecs_set_hooks_id(ecs_world_t *world, ecs_entity_t component, const ecs_type_hooks_t *hooks)
Register hooks for a component.
struct ecs_component_record_t ecs_component_record_t
Information about a (component) ID, such as type info and tables with the ID.
Definition flecs.h:498
struct ecs_header_t ecs_header_t
Header for ecs_poly_t objects.
struct ecs_stage_t ecs_stage_t
A stage enables modification while iterating and from multiple threads.
Definition flecs.h:433
struct ecs_ref_t ecs_ref_t
A ref is a fast way to fetch a component for a specific entity.
Definition flecs.h:482
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:386
struct ecs_table_record_t ecs_table_record_t
Opaque type for table record.
Definition flecs.h:532
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:430
struct ecs_mixins_t ecs_mixins_t
Type that stores poly mixins.
Definition flecs.h:522
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
Definition flecs.h:379
struct ecs_observable_t ecs_observable_t
An observable produces events that can be listened for by an observer.
Definition flecs.h:466
struct ecs_record_t ecs_record_t
Information about an entity, like its table and row.
Definition flecs.h:495
struct ecs_table_t ecs_table_t
A table stores entities and components for a specific type.
Definition flecs.h:436
void ecs_poly_t
A poly object.
Definition flecs.h:519
ecs_entity_t ecs_new_low_id(ecs_world_t *world)
Create new low ID.
void ecs_set_child_order(ecs_world_t *world, ecs_entity_t parent, const ecs_entity_t *children, int32_t child_count)
Set child order for parent with OrderedChildren.
const ecs_entity_t * ecs_bulk_init(ecs_world_t *world, const ecs_bulk_desc_t *desc)
Bulk create or populate new entities.
ecs_entity_t ecs_clone(ecs_world_t *world, ecs_entity_t dst, ecs_entity_t src, bool copy_value)
Clone an entity.
ecs_entity_t ecs_new(ecs_world_t *world)
Create new entity ID.
ecs_entity_t ecs_entity_init(ecs_world_t *world, const ecs_entity_desc_t *desc)
Find or create an entity.
void ecs_delete(ecs_world_t *world, ecs_entity_t entity)
Delete an entity.
void ecs_delete_with(ecs_world_t *world, ecs_id_t component)
Delete all entities with the specified component.
ecs_entity_t ecs_new_w_id(ecs_world_t *world, ecs_id_t component)
Create new entity with (component) ID.
ecs_entity_t ecs_new_w_table(ecs_world_t *world, ecs_table_t *table)
Create new entity in table.
const ecs_entity_t * ecs_bulk_new_w_id(ecs_world_t *world, ecs_id_t component, int32_t count)
Create N new entities.
ecs_entities_t ecs_get_ordered_children(const ecs_world_t *world, ecs_entity_t parent)
Get ordered children.
bool ecs_children_next(ecs_iter_t *it)
Progress an iterator created with ecs_children().
ecs_iter_t ecs_each_id(const ecs_world_t *world, ecs_id_t component)
Iterate all entities with a specified (component ID).
bool ecs_each_next(ecs_iter_t *it)
Progress an iterator created with ecs_each_id().
ecs_iter_t ecs_children(const ecs_world_t *world, ecs_entity_t parent)
Iterate children of a parent.
ecs_iter_t ecs_children_w_rel(const ecs_world_t *world, ecs_entity_t relationship, ecs_entity_t parent)
Same as ecs_children(), but with a custom relationship argument.
void ecs_enable_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, bool enable)
Enable or disable a component.
bool ecs_is_enabled_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Test if a component is enabled.
void ecs_enable(ecs_world_t *world, ecs_entity_t entity, bool enabled)
Enable or disable an entity.
struct ecs_bulk_desc_t ecs_bulk_desc_t
Used with ecs_bulk_init().
struct ecs_entity_desc_t ecs_entity_desc_t
Used with ecs_entity_init().
char * ecs_entity_str(const ecs_world_t *world, ecs_entity_t entity)
Convert an entity to a string.
ecs_entity_t ecs_get_target(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, int32_t index)
Get the target of a relationship.
ecs_entity_t ecs_get_parent(const ecs_world_t *world, ecs_entity_t entity)
Get the parent (target of the ChildOf relationship) for an entity.
ecs_entity_t ecs_get_target_for_id(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, ecs_id_t component)
Get the target of a relationship for a given component.
const ecs_type_t * ecs_get_type(const ecs_world_t *world, ecs_entity_t entity)
Get the type of an entity.
bool ecs_owns_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Test if an entity owns a component.
char * ecs_type_str(const ecs_world_t *world, const ecs_type_t *type)
Convert a type to a string.
char * ecs_table_str(const ecs_world_t *world, const ecs_table_t *table)
Convert a table to a string.
int32_t ecs_count_id(const ecs_world_t *world, ecs_id_t entity)
Count entities that have the specified ID.
int32_t ecs_get_depth(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel)
Return the depth for an entity in the tree for the specified relationship.
ecs_table_t * ecs_get_table(const ecs_world_t *world, ecs_entity_t entity)
Get the table of an entity.
ecs_entity_t ecs_new_w_parent(ecs_world_t *world, ecs_entity_t parent, const char *name)
Create child with Parent component.
bool ecs_has_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Test if an entity has a component.
void(* ecs_module_action_t)(ecs_world_t *world)
Initialization action for modules.
Definition flecs.h:642
uint64_t(* ecs_group_by_action_t)(ecs_world_t *world, ecs_table_t *table, ecs_id_t group_id, void *ctx)
Callback used for grouping tables in a query.
Definition flecs.h:622
int(* ecs_cmp_t)(const void *a_ptr, const void *b_ptr, const ecs_type_info_t *type_info)
Compare hook to compare component instances.
Definition flecs.h:684
uint64_t(* ecs_hash_value_action_t)(const void *ptr)
Callback used for hashing values.
Definition flecs.h:660
void(* ecs_group_delete_action_t)(ecs_world_t *world, uint64_t group_id, void *group_ctx, void *group_by_ctx)
Callback invoked when a query deletes an existing group.
Definition flecs.h:635
void(* ecs_iter_fini_action_t)(ecs_iter_t *it)
Function prototype for freeing an iterator.
Definition flecs.h:600
void *(* ecs_group_create_action_t)(ecs_world_t *world, uint64_t group_id, void *group_by_ctx)
Callback invoked when a query creates a new group.
Definition flecs.h:629
bool(* ecs_on_validate_t)(ecs_world_t *world, ecs_entity_t entity, void *ptr)
On validate hook.
Definition flecs.h:698
void(* ecs_sort_table_action_t)(ecs_world_t *world, ecs_table_t *table, ecs_entity_t *entities, void *ptr, int32_t size, int32_t lo, int32_t hi, ecs_order_by_action_t order_by)
Callback used for sorting the entire table of components.
Definition flecs.h:611
bool(* ecs_iter_next_action_t)(ecs_iter_t *it)
Function prototype for iterating an iterator.
Definition flecs.h:592
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
Definition flecs.h:582
void(* ecs_copy_t)(void *dst_ptr, const void *src_ptr, int32_t count, const ecs_type_info_t *type_info)
Copy is invoked when a component is copied into another component.
Definition flecs.h:670
bool(* ecs_equals_t)(const void *a_ptr, const void *b_ptr, const ecs_type_info_t *type_info)
Equals operator hook.
Definition flecs.h:690
int(* ecs_compare_action_t)(const void *ptr1, const void *ptr2)
Callback used for sorting values.
Definition flecs.h:655
void(* ecs_fini_action_t)(ecs_world_t *world, void *ctx)
Action callback on world exit.
Definition flecs.h:646
void(* ecs_move_t)(void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *type_info)
Move is invoked when a component is moved to another component.
Definition flecs.h:677
void(* flecs_poly_dtor_t)(ecs_poly_t *poly)
Destructor function for poly objects.
Definition flecs.h:704
void(* ecs_run_action_t)(ecs_iter_t *it)
Function prototype for runnables (systems, observers).
Definition flecs.h:573
void(* ecs_ctx_free_t)(void *ctx)
Function to clean up context data.
Definition flecs.h:651
int(* ecs_order_by_action_t)(ecs_entity_t e1, const void *ptr1, ecs_entity_t e2, const void *ptr2)
Callback used for comparing components.
Definition flecs.h:604
void(* ecs_xtor_t)(void *ptr, int32_t count, const ecs_type_info_t *type_info)
Constructor/destructor callback.
Definition flecs.h:664
void * ecs_ref_get_id(const ecs_world_t *world, ecs_ref_t *ref, ecs_id_t component)
Get a component from a ref.
void * ecs_emplace_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, size_t size, bool *is_new)
Emplace a component.
void ecs_ref_update(const ecs_world_t *world, ecs_ref_t *ref, ecs_id_t component)
Update a ref.
const void * ecs_get_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Get an immutable pointer to a component.
void ecs_modified_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Signal that a component has been modified.
ecs_ref_t ecs_ref_init_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Create a component ref.
void * ecs_get_mut_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Get a mutable pointer to a component.
void * ecs_ensure_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, size_t size)
Ensure an entity has a component and return a pointer.
void ecs_set_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, size_t size, const void *ptr)
Set the value of a component.
void * ecs_get_sparse_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, size_t size)
Get a pointer to a sparse component.
const ecs_id_t ECS_PAIR
Indicate that the ID is a pair.
const ecs_id_t ECS_AUTO_OVERRIDE
Automatically override component when it is inherited.
const ecs_id_t ECS_TOGGLE
Add a bitset to storage, which allows a component to be enabled or disabled.
const ecs_id_t ECS_VALUE_PAIR
Indicate that the target of a pair is an integer value.
char * ecs_id_str(const ecs_world_t *world, ecs_id_t component)
Convert a component ID to a string.
bool ecs_id_is_tag(const ecs_world_t *world, ecs_id_t component)
Return whether a specified component is a tag.
ecs_flags32_t ecs_id_get_flags(const ecs_world_t *world, ecs_id_t component)
Get flags associated with an ID.
bool ecs_id_is_valid(const ecs_world_t *world, ecs_id_t component)
Utility to check if an ID is valid.
const char * ecs_id_flag_str(uint64_t component_flags)
Convert a component flag to a string.
bool ecs_id_in_use(const ecs_world_t *world, ecs_id_t component)
Return whether a specified component is in use.
bool ecs_id_match(ecs_id_t component, ecs_id_t pattern)
Utility to match a component with a pattern.
void ecs_id_str_buf(const ecs_world_t *world, ecs_id_t component, ecs_strbuf_t *buf)
Write a component string to a buffer.
bool ecs_id_is_pair(ecs_id_t component)
Utility to check if a component is a pair.
ecs_entity_t ecs_get_typeid(const ecs_world_t *world, ecs_id_t component)
Get the type for a component.
ecs_id_t ecs_id_from_str(const ecs_world_t *world, const char *expr)
Convert a string to a component.
bool ecs_id_is_wildcard(ecs_id_t component)
Utility to check if a component is a wildcard.
bool ecs_id_is_any(ecs_id_t component)
Utility to check if a component is an any wildcard.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int8_t index)
Return the field source.
bool ecs_iter_changed(ecs_iter_t *it)
Return whether the current iterator result has changed.
bool ecs_field_is_writeonly(const ecs_iter_t *it, int8_t index)
Test whether the field is write-only.
ecs_var_t * ecs_iter_get_vars(const ecs_iter_t *it)
Get the variable array.
bool ecs_field_is_readonly(const ecs_iter_t *it, int8_t index)
Test whether the field is read-only.
const char * ecs_iter_get_var_name(const ecs_iter_t *it, int32_t var_id)
Get the variable name.
ecs_iter_t ecs_worker_iter(const ecs_iter_t *it, int32_t index, int32_t count)
Create a worker iterator.
bool ecs_iter_is_true(ecs_iter_t *it)
Test if an iterator is true.
void ecs_iter_fini(ecs_iter_t *it)
Clean up iterator resources.
char * ecs_iter_str(const ecs_iter_t *it)
Convert an iterator to a string.
bool ecs_iter_var_is_constrained(ecs_iter_t *it, int32_t var_id)
Return whether a variable is constrained.
ecs_iter_t ecs_page_iter(const ecs_iter_t *it, int32_t offset, int32_t limit)
Create a paged iterator.
int32_t ecs_iter_get_var_count(const ecs_iter_t *it)
Get the number of variables.
void * ecs_field_at_w_size(const ecs_iter_t *it, size_t size, int8_t index, int32_t row)
Get data for a field at a specified row.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int8_t index)
Return the ID matched for a field.
bool ecs_field_is_set(const ecs_iter_t *it, int8_t index)
Test whether a field is set.
void ecs_iter_set_var(ecs_iter_t *it, int32_t var_id, ecs_entity_t entity)
Set the value for an iterator variable.
bool ecs_field_is_self(const ecs_iter_t *it, int8_t index)
Test whether the field is matched on self.
bool ecs_iter_next(ecs_iter_t *it)
Progress any iterator.
ecs_entity_t ecs_iter_get_var(ecs_iter_t *it, int32_t var_id)
Get the value of an iterator variable as an entity.
bool ecs_worker_next(ecs_iter_t *it)
Progress a worker iterator.
ecs_entity_t ecs_iter_first(ecs_iter_t *it)
Get the first matching entity from an iterator.
int32_t ecs_field_column(const ecs_iter_t *it, int8_t index)
Return the index of a matched table column.
uint64_t ecs_iter_get_group(const ecs_iter_t *it)
Return the group ID for the currently iterated result.
void ecs_iter_set_var_as_table(ecs_iter_t *it, int32_t var_id, const ecs_table_t *table)
Same as ecs_iter_set_var(), but for a table.
ecs_table_t * ecs_iter_get_var_as_table(ecs_iter_t *it, int32_t var_id)
Get the value of an iterator variable as a table.
void * ecs_field_w_size(const ecs_iter_t *it, size_t size, int8_t index)
Get data for a field.
int32_t ecs_iter_count(ecs_iter_t *it)
Count the number of matched entities in a query.
bool ecs_page_next(ecs_iter_t *it)
Progress a paged iterator.
void ecs_iter_set_var_as_range(ecs_iter_t *it, int32_t var_id, const ecs_table_range_t *range)
Same as ecs_iter_set_var(), but for a range of entities.
size_t ecs_field_size(const ecs_iter_t *it, int8_t index)
Return the field type size.
ecs_table_range_t ecs_iter_get_var_as_range(ecs_iter_t *it, int32_t var_id)
Get the value of an iterator variable as a table range.
ecs_id_t ecs_strip_generation(ecs_entity_t e)
Remove the generation from an entity ID.
void ecs_make_alive_id(ecs_world_t *world, ecs_id_t component)
Same as ecs_make_alive(), but for components.
bool ecs_is_valid(const ecs_world_t *world, ecs_entity_t e)
Test whether an entity is valid.
void ecs_make_alive(ecs_world_t *world, ecs_entity_t entity)
Ensure an ID is alive.
ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)
Get an alive identifier.
uint32_t ecs_get_version(ecs_entity_t entity)
Get the generation of an entity.
bool ecs_exists(const ecs_world_t *world, ecs_entity_t entity)
Test whether an entity exists.
bool ecs_is_alive(const ecs_world_t *world, ecs_entity_t e)
Test whether an entity is alive.
void ecs_set_version(ecs_world_t *world, ecs_entity_t entity)
Override the generation of an entity.
struct ecs_world_info_t ecs_world_info_t
Type that contains information about the world.
struct ecs_query_group_info_t ecs_query_group_info_t
Type that contains information about a query group.
struct ecs_entity_range_t ecs_entity_range_t
Type that stores an entity id range.
struct ecs_build_info_t ecs_build_info_t
Type with information about the current Flecs build.
ecs_entity_t ecs_observer_update(ecs_world_t *world, ecs_entity_t observer, const ecs_observer_desc_t *desc)
Update an existing observer.
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send an event.
void ecs_enqueue(ecs_world_t *world, ecs_event_desc_t *desc)
Enqueue an event.
ecs_entity_t ecs_observer_init(ecs_world_t *world, const ecs_observer_desc_t *desc)
Create an observer.
const ecs_observer_t * ecs_observer_get(const ecs_world_t *world, ecs_entity_t observer)
Get the observer object.
struct ecs_event_desc_t ecs_event_desc_t
Used with ecs_emit().
struct ecs_observer_desc_t ecs_observer_desc_t
Used with ecs_observer_init().
#define FLECS_EVENT_DESC_MAX
Maximum number of events in ecs_observer_desc_t.
Definition flecs.h:321
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition flecs.h:59
#define FLECS_ID_DESC_MAX
Maximum number of IDs to add in ecs_entity_desc_t / ecs_bulk_desc_t.
Definition flecs.h:315
#define FLECS_TERM_COUNT_MAX
Maximum number of terms in queries.
Definition flecs.h:331
#define FLECS_TREE_SPAWNER_DEPTH_CACHE_SIZE
Size of the depth cache in the tree spawner component.
Definition flecs.h:364
char * ecs_get_path_w_sep(const ecs_world_t *world, ecs_entity_t parent, ecs_entity_t child, const char *sep, const char *prefix)
Get a path identifier for an entity.
ecs_entity_t ecs_new_from_path_w_sep(ecs_world_t *world, ecs_entity_t parent, const char *path, const char *sep, const char *prefix)
Find or create an entity from a path.
ecs_entity_t ecs_lookup_symbol(const ecs_world_t *world, const char *symbol, bool lookup_as_path, bool recursive)
Look up an entity by its symbol name.
void ecs_set_alias(ecs_world_t *world, ecs_entity_t entity, const char *alias)
Set an alias for an entity.
ecs_entity_t ecs_lookup(const ecs_world_t *world, const char *path)
Look up an entity by its path.
ecs_entity_t ecs_get_scope(const ecs_world_t *world)
Get the current scope.
void ecs_get_path_w_sep_buf(const ecs_world_t *world, ecs_entity_t parent, ecs_entity_t child, const char *sep, const char *prefix, ecs_strbuf_t *buf, bool escape)
Write a path identifier to a buffer.
ecs_entity_t * ecs_set_lookup_path(ecs_world_t *world, const ecs_entity_t *lookup_path)
Set the search path for lookup operations.
ecs_entity_t ecs_set_name(ecs_world_t *world, ecs_entity_t entity, const char *name)
Set the name of an entity.
const char * ecs_get_symbol(const ecs_world_t *world, ecs_entity_t entity)
Get the symbol of an entity.
ecs_entity_t ecs_lookup_path_w_sep(const ecs_world_t *world, ecs_entity_t parent, const char *path, const char *sep, const char *prefix, bool recursive)
Look up an entity from a path.
ecs_entity_t ecs_set_symbol(ecs_world_t *world, ecs_entity_t entity, const char *symbol)
Set the symbol of an entity.
ecs_entity_t ecs_lookup_child(const ecs_world_t *world, ecs_entity_t parent, const char *name)
Look up a child entity by name.
const char * ecs_get_name(const ecs_world_t *world, ecs_entity_t entity)
Get the name of an entity.
ecs_entity_t ecs_add_path_w_sep(ecs_world_t *world, ecs_entity_t entity, ecs_entity_t parent, const char *path, const char *sep, const char *prefix)
Add a specified path to an entity.
ecs_entity_t * ecs_get_lookup_path(const ecs_world_t *world)
Get the current lookup path.
ecs_entity_t ecs_set_scope(ecs_world_t *world, ecs_entity_t scope)
Set the current scope.
const char * ecs_set_name_prefix(ecs_world_t *world, const char *prefix)
Set a name prefix for newly created entities.
void ecs_iter_skip(ecs_iter_t *it)
Skip a table while iterating.
bool ecs_query_has_table(const ecs_query_t *query, ecs_table_t *table, ecs_iter_t *it)
Match a table with a query.
void ecs_iter_set_group(ecs_iter_t *it, uint64_t group_id)
Set the group to iterate for a query iterator.
const ecs_query_t * ecs_query_get(const ecs_world_t *world, ecs_entity_t query)
Get the query object.
bool ecs_query_next(ecs_iter_t *it)
Progress a query iterator.
const ecs_query_group_info_t * ecs_query_get_group_info(const ecs_query_t *query, uint64_t group_id)
Get information about a query group.
ecs_query_t * ecs_query_update(ecs_world_t *world, ecs_entity_t entity, const ecs_query_desc_t *desc)
Replace the query on an existing entity.
bool ecs_query_is_true(const ecs_query_t *query)
Test whether a query returns one or more results.
char * ecs_term_str(const ecs_world_t *world, const ecs_term_t *term)
Convert a term to a string expression.
bool ecs_query_has_range(const ecs_query_t *query, ecs_table_range_t *range, ecs_iter_t *it)
Match a range with a query.
int32_t ecs_query_find_var(const ecs_query_t *query, const char *name)
Find a variable index.
void ecs_query_fini(ecs_query_t *query)
Delete a query.
bool ecs_query_has(const ecs_query_t *query, ecs_entity_t entity, ecs_iter_t *it)
Match an entity with a query.
char * ecs_query_plan_w_profile(const ecs_query_t *query, const ecs_iter_t *it)
Convert a query to a string with a profile.
struct ecs_query_desc_t ecs_query_desc_t
Used with ecs_query_init().
const char * ecs_query_args_parse(ecs_query_t *query, ecs_iter_t *it, const char *expr)
Populate variables from a key-value string.
int32_t ecs_query_match_count(const ecs_query_t *query)
Return how often a match event happened for a cached query.
char * ecs_query_plan(const ecs_query_t *query)
Convert a query to a string.
ecs_iter_t ecs_query_iter(const ecs_world_t *world, const ecs_query_t *query)
Create a query iterator.
char * ecs_query_str(const ecs_query_t *query)
Convert a query to a string expression.
bool ecs_query_var_is_entity(const ecs_query_t *query, int32_t var_id)
Test if a variable is an entity.
ecs_query_t * ecs_query_init(ecs_world_t *world, const ecs_query_desc_t *desc)
Create a query.
bool ecs_query_changed(ecs_query_t *query)
Return whether the query data changed since the last iteration.
const char * ecs_query_var_name(const ecs_query_t *query, int32_t var_id)
Get the variable name.
bool ecs_term_match_this(const ecs_term_t *term)
Is a term matched on the $this variable.
char * ecs_query_plans(const ecs_query_t *query)
Same as ecs_query_plan(), but includes the plan for populating the cache (if any).
void * ecs_query_get_group_ctx(const ecs_query_t *query, uint64_t group_id)
Get the context of a query group.
ecs_query_count_t ecs_query_count(const ecs_query_t *query)
Return the number of entities and results the query matches with.
const ecs_map_t * ecs_query_get_groups(const ecs_query_t *query)
Return the map with query groups.
bool ecs_term_is_initialized(const ecs_term_t *term)
Test whether a term is set.
bool ecs_term_ref_is_set(const ecs_term_ref_t *ref)
Test whether a term ref is set.
struct ecs_query_count_t ecs_query_count_t
Struct returned by ecs_query_count().
bool ecs_term_match_0(const ecs_term_t *term)
Is a term matched on a 0 source.
const ecs_query_t * ecs_query_get_cache_query(const ecs_query_t *query)
Get the query used to populate the cache.
struct ecs_term_ref_t ecs_term_ref_t
Type that describes a reference to an entity or variable in a term.
ecs_query_cache_kind_t
Specify cache policy for query.
Definition flecs.h:738
ecs_inout_kind_t
Specify read/write access for term.
Definition flecs.h:717
ecs_oper_kind_t
Specify operator for term.
Definition flecs.h:727
@ EcsQueryCacheAll
Require that all query terms can be cached.
Definition flecs.h:741
@ EcsQueryCacheDefault
Behavior determined by query creation context.
Definition flecs.h:739
@ EcsQueryCacheNone
No caching.
Definition flecs.h:742
@ EcsQueryCacheAuto
Cache query terms that are cacheable.
Definition flecs.h:740
@ EcsOut
Term is only written.
Definition flecs.h:723
@ EcsInOut
Term is both read and written.
Definition flecs.h:721
@ EcsInOutFilter
Same as InOutNone + prevents term from triggering observers.
Definition flecs.h:720
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition flecs.h:718
@ EcsInOutNone
Term is neither read nor written.
Definition flecs.h:719
@ EcsIn
Term is only read.
Definition flecs.h:722
@ EcsNot
The term must not match.
Definition flecs.h:730
@ EcsOptional
The term may match.
Definition flecs.h:731
@ EcsOr
One of the terms in an or chain must match.
Definition flecs.h:729
@ EcsOrFrom
Term must match at least one component from term ID.
Definition flecs.h:733
@ EcsAnd
The term must match.
Definition flecs.h:728
@ EcsNotFrom
Term must match none of the components from term ID.
Definition flecs.h:734
@ EcsAndFrom
Term must match all components from term ID.
Definition flecs.h:732
ecs_table_t * ecs_table_add_id(ecs_world_t *world, ecs_table_t *table, ecs_id_t component)
Get the table that has all components of the current table plus the specified ID.
int32_t ecs_search_offset(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t component, ecs_id_t *component_out)
Search for a component in a table type starting from an offset.
ecs_table_t * ecs_table_remove_id(ecs_world_t *world, ecs_table_t *table, ecs_id_t component)
Get the table that has all components of the current table minus the specified component.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get the type for a table.
int32_t ecs_table_get_column_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component)
Get the column index for a component.
int32_t ecs_search_relation_for_entity(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, ecs_entity_t rel, bool self, ecs_component_record_t *cr, ecs_entity_t *tgt_out, ecs_id_t *id_out, struct ecs_table_record_t **tr_out)
Search for a component ID by following a relationship, starting from an entity.
void * ecs_table_get_id(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component, int32_t offset)
Get a column from a table by component.
int32_t ecs_table_size(const ecs_table_t *table)
Return the allocated size of the table.
bool ecs_table_has_flags(ecs_table_t *table, ecs_flags32_t flags)
Test a table for flags.
int32_t ecs_table_column_to_type_index(const ecs_table_t *table, int32_t index)
Convert a column index to a type index.
int32_t ecs_table_column_count(const ecs_table_t *table)
Return the number of columns in a table.
bool ecs_commit(ecs_world_t *world, ecs_entity_t entity, ecs_record_t *record, ecs_table_t *table, const ecs_type_t *added, const ecs_type_t *removed)
Commit (move) an entity to a table.
int32_t ecs_search_relation(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t component, ecs_entity_t rel, ecs_flags64_t flags, ecs_entity_t *tgt_out, ecs_id_t *component_out, struct ecs_table_record_t **tr_out)
Search for a component or relationship ID in a table type starting from an offset.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get a column from a table by column index.
int32_t ecs_search(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component, ecs_id_t *component_out)
Search for a component in a table type.
ecs_entity_t ecs_table_get_target(const ecs_world_t *world, const ecs_table_t *table, ecs_entity_t relationship, int32_t index)
Get the relationship target for a table.
int32_t ecs_table_count(const ecs_table_t *table)
Return the number of entities in the table.
const ecs_entity_t * ecs_table_entities(const ecs_table_t *table)
Return the array with entity IDs for the table.
void ecs_table_unlock(ecs_world_t *world, ecs_table_t *table)
Unlock a table.
bool ecs_table_has_traversable(const ecs_table_t *table)
Check if a table has traversable entities.
int32_t ecs_table_get_depth(const ecs_world_t *world, const ecs_table_t *table, ecs_entity_t rel)
Return the depth for a table in the tree for the specified relationship.
bool ecs_table_has_id(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component)
Test if a table has a component.
void ecs_table_swap_rows(ecs_world_t *world, ecs_table_t *table, int32_t row_1, int32_t row_2)
Swap two elements inside the table.
void ecs_table_lock(ecs_world_t *world, ecs_table_t *table)
Lock a table.
ecs_table_t * ecs_table_find(ecs_world_t *world, const ecs_id_t *ids, int32_t id_count)
Find a table from an ID array.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get the column size from a table.
int32_t ecs_table_get_type_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component)
Get the type index for a component.
void ecs_table_clear_entities(ecs_world_t *world, ecs_table_t *table)
Remove all entities in a table.
int32_t ecs_table_type_to_column_index(const ecs_table_t *table, int32_t index)
Convert a type index to a column index.
int ecs_value_fini_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
Destruct a value.
int ecs_value_fini(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Destruct a value.
int ecs_value_copy(const ecs_world_t *world, ecs_entity_t type, void *dst, const void *src)
Copy a value.
int ecs_value_move(const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
Move a value.
int ecs_value_move_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
Move a value.
void * ecs_value_new_w_type_info(ecs_world_t *world, const ecs_type_info_t *ti)
Construct a value in new storage.
int ecs_value_move_ctor_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
Move-construct a value.
int ecs_value_copy_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, const void *src)
Copy a value.
int ecs_value_init_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
Construct a value in existing storage.
void * ecs_value_new(ecs_world_t *world, ecs_entity_t type)
Construct a value in new storage.
int ecs_value_free(ecs_world_t *world, ecs_entity_t type, void *ptr)
Destruct a value and free storage.
int ecs_value_move_ctor(const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
Move-construct a value.
int ecs_value_init(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Construct a value in existing storage.
struct ecs_entities_t ecs_entities_t
Type returned by ecs_get_entities().
void ecs_atfini(ecs_world_t *world, ecs_fini_action_t action, void *ctx)
Register an action to be executed when the world is destroyed.
bool ecs_is_fini(const ecs_world_t *world)
Return whether the world is being deleted.
int ecs_fini(ecs_world_t *world)
Delete a world.
ecs_flags32_t ecs_world_get_flags(const ecs_world_t *world)
Get flags set on the world.
ecs_world_t * ecs_mini(void)
Create a new world with just the core module.
ecs_world_t * ecs_init(void)
Create a new world.
ecs_world_t * ecs_init_w_args(int argc, char *argv[])
Create a new world with arguments.
ecs_entities_t ecs_get_entities(const ecs_world_t *world)
Return entity identifiers in the world.
void ecs_set_target_fps(ecs_world_t *world, float fps)
Set target frames per second (FPS) for an application.
void ecs_measure_system_time(ecs_world_t *world, bool enable)
Measure system time.
float ecs_frame_begin(ecs_world_t *world, float delta_time)
Begin frame.
void ecs_run_post_frame(ecs_world_t *world, ecs_fini_action_t action, void *ctx)
Register an action to be executed once after the frame.
bool ecs_should_quit(const ecs_world_t *world)
Return whether a quit has been requested.
void ecs_set_default_query_flags(ecs_world_t *world, ecs_flags32_t flags)
Set the default query flags.
void ecs_quit(ecs_world_t *world)
Signal exit.
void ecs_measure_frame_time(ecs_world_t *world, bool enable)
Measure frame time.
void ecs_frame_end(ecs_world_t *world)
End frame.
ecs_entity_t ecs_get_entity(const ecs_poly_t *poly)
Get the entity from a poly.
ecs_id_t ecs_make_pair(ecs_entity_t first, ecs_entity_t second)
Make a pair ID.
const ecs_build_info_t * ecs_get_build_info(void)
Get build info.
bool flecs_poly_is_(const ecs_poly_t *object, int32_t type)
Test if a pointer is of the specified type.
void ecs_entity_range_set(ecs_world_t *world, const ecs_entity_range_t *range)
Set the active entity range.
const ecs_entity_range_t * ecs_entity_range_new(ecs_world_t *world, uint32_t min, uint32_t max)
Create a new entity range.
ecs_entity_t ecs_get_max_id(const ecs_world_t *world)
Get the largest issued entity ID (not counting generation).
void ecs_run_aperiodic(ecs_world_t *world, ecs_flags32_t flags)
Force aperiodic actions.
void * ecs_get_binding_ctx(const ecs_world_t *world)
Get the world binding context.
void ecs_shrink(ecs_world_t *world)
Free unused memory.
void ecs_dim(ecs_world_t *world, int32_t entity_count)
Dimension the world for a specified number of entities.
const ecs_world_info_t * ecs_get_world_info(const ecs_world_t *world)
Get the world info.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get the world from a poly.
void ecs_set_ctx(ecs_world_t *world, void *ctx, ecs_ctx_free_t ctx_free)
Set a world context.
void ecs_exclusive_access_begin(ecs_world_t *world, const char *thread_name)
Begin exclusive thread access.
int32_t ecs_delete_empty_tables(ecs_world_t *world, const ecs_delete_empty_tables_desc_t *desc)
Clean up empty tables.
const ecs_entity_range_t * ecs_entity_range_get(const ecs_world_t *world)
Get the currently active entity id range.
void ecs_set_binding_ctx(ecs_world_t *world, void *ctx, ecs_ctx_free_t ctx_free)
Set a world binding context.
struct ecs_delete_empty_tables_desc_t ecs_delete_empty_tables_desc_t
Used with ecs_delete_empty_tables().
void ecs_exclusive_access_end(ecs_world_t *world, bool lock_world)
End exclusive thread access.
void * ecs_get_ctx(const ecs_world_t *world)
Get the world context.
Operating system abstraction API.
Component information.
Definition flecs.h:1620
ecs_size_t size
Component size.
Definition flecs.h:1621
ecs_size_t alignment
Component alignment.
Definition flecs.h:1622
When added to an entity, this informs serialization formats which component to use when a value is as...
Definition flecs.h:1635
ecs_id_t component
Default component ID.
Definition flecs.h:1636
A (string) identifier.
Definition flecs.h:1611
ecs_size_t length
Length of identifier.
Definition flecs.h:1613
char * value
Identifier string.
Definition flecs.h:1612
ecs_hashmap_t * index
Current index.
Definition flecs.h:1616
uint64_t hash
Hash of current value.
Definition flecs.h:1614
uint64_t index_hash
Hash of existing record in current index.
Definition flecs.h:1615
Non-fragmenting ChildOf relationship.
Definition flecs.h:1640
ecs_entity_t value
Parent entity.
Definition flecs.h:1641
Component for storing a poly object.
Definition flecs.h:1626
ecs_poly_t * poly
Pointer to poly object.
Definition flecs.h:1627
Apply a rate filter to a tick source.
Definition timer.h:45
Component used to provide a tick source to systems.
Definition system.h:32
Component used for one-shot and interval timer functionality.
Definition timer.h:35
Tree instantiation cache component.
Definition flecs.h:1664
ecs_tree_spawner_t data[(6)]
Cache data indexed by depth.
Definition flecs.h:1665
Type with information about the current Flecs build.
Definition flecs.h:1510
const char ** flags
Compile-time settings.
Definition flecs.h:1513
int16_t version_major
Major Flecs version.
Definition flecs.h:1515
const char ** addons
Addons included in the build.
Definition flecs.h:1512
const char * version
Stringified version.
Definition flecs.h:1514
const char * compiler
Compiler used to compile Flecs.
Definition flecs.h:1511
bool sanitize
Is this a sanitize build?
Definition flecs.h:1519
bool perf_trace
Is this a perf tracing build?
Definition flecs.h:1520
int16_t version_minor
Minor Flecs version.
Definition flecs.h:1516
bool debug
Is this a debug build?
Definition flecs.h:1518
int16_t version_patch
Patch Flecs version.
Definition flecs.h:1517
Used with ecs_bulk_init().
Definition flecs.h:1106
ecs_id_t ids[32]
IDs to create the entities with.
Definition flecs.h:1116
void ** data
Array with component data to insert.
Definition flecs.h:1118
int32_t count
Number of entities to create/populate.
Definition flecs.h:1114
int32_t _canary
Used for validity testing.
Definition flecs.h:1107
ecs_entity_t * entities
Entities to bulk insert.
Definition flecs.h:1109
ecs_table_t * table
Table to insert the entities into.
Definition flecs.h:1125
Used with ecs_component_init().
Definition flecs.h:1136
int32_t _canary
Used for validity testing.
Definition flecs.h:1137
ecs_type_info_t type
Parameters for type (size, hooks, ...).
Definition flecs.h:1143
ecs_entity_t entity
Existing entity to associate with a component (optional).
Definition flecs.h:1140
Used with ecs_delete_empty_tables().
Definition flecs.h:2798
uint16_t delete_generation
Delete table when generation > delete_generation.
Definition flecs.h:2803
double time_budget_seconds
Amount of time operation is allowed to spend.
Definition flecs.h:2806
uint16_t clear_generation
Free table data when generation > clear_generation.
Definition flecs.h:2800
int32_t offset
Table index to start scanning at.
Definition flecs.h:2810
Type returned by ecs_get_entities().
Definition flecs.h:2138
int32_t alive_count
Number of alive entity IDs.
Definition flecs.h:2141
int32_t count
Total number of entity IDs.
Definition flecs.h:2140
const ecs_entity_t * ids
Array with all entity IDs in the world.
Definition flecs.h:2139
Used with ecs_entity_init().
Definition flecs.h:1060
const char * sep
Optional custom separator for hierarchical names.
Definition flecs.h:1072
const char * root_sep
Optional, used for identifiers relative to the root.
Definition flecs.h:1076
const char * name
Name of the entity.
Definition flecs.h:1067
bool use_low_id
When set to true, a low id (typically reserved for components) will be used to create the entity,...
Definition flecs.h:1088
const char * symbol
Optional entity symbol.
Definition flecs.h:1078
int32_t _canary
Used for validity testing.
Definition flecs.h:1061
const ecs_id_t * add
0-terminated array of IDs to add to the entity.
Definition flecs.h:1093
const char * add_expr
String expression with components to add.
Definition flecs.h:1099
const ecs_value_t * set
0-terminated array of values to set on the entity.
Definition flecs.h:1096
ecs_entity_t id
Set to modify existing entity (optional).
Definition flecs.h:1063
ecs_entity_t parent
Parent entity.
Definition flecs.h:1065
Type that stores an entity id range.
Definition flecs.h:1594
uint32_t max
Last id in range (inclusive, 0 = unlimited).
Definition flecs.h:1596
uint32_t cur
Last issued id in range.
Definition flecs.h:1597
ecs_vec_t recycled
Recycled entity ids (vec<entity_t>).
Definition flecs.h:1598
uint32_t min
First id in range (inclusive).
Definition flecs.h:1595
Used with ecs_emit().
Definition flecs.h:1450
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
Definition flecs.h:1475
const void * const_param
Same as param, but with the guarantee that the value won't be modified.
Definition flecs.h:1486
ecs_table_t * table
The table for which to notify.
Definition flecs.h:1460
int32_t count
Limit number of notified entities to count.
Definition flecs.h:1472
ecs_table_t * other_table
Optional second table to notify.
Definition flecs.h:1464
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
Definition flecs.h:1467
const ecs_type_t * ids
Component IDs.
Definition flecs.h:1457
void * set_ptr
Optional pointer to the value of the component for which the event is emitted.
Definition flecs.h:1492
ecs_poly_t * observable
Observable (usually the world).
Definition flecs.h:1495
ecs_entity_t event
The event ID.
Definition flecs.h:1452
ecs_flags32_t flags
Event flags.
Definition flecs.h:1498
void * param
Optional context.
Definition flecs.h:1481
Header for ecs_poly_t objects.
Definition flecs.h:525
int32_t type
Magic number indicating which type of Flecs object.
Definition flecs.h:526
int32_t refcount
Refcount, to enable RAII handles.
Definition flecs.h:527
ecs_mixins_t * mixins
Table with offsets to (optional) mixins.
Definition flecs.h:528
Iterator.
Definition flecs.h:1184
ecs_world_t * real_world
Actual world.
Definition flecs.h:1187
void * param
Param passed to ecs_run().
Definition flecs.h:1221
ecs_entity_t event
The event (if applicable).
Definition flecs.h:1209
int32_t frame_offset
Offset relative to the start of iteration.
Definition flecs.h:1232
ecs_flags32_t ref_fields
Bitset with fields that aren't component arrays.
Definition flecs.h:1203
ecs_entity_t interrupted_by
When set, system execution is interrupted.
Definition flecs.h:1236
ecs_flags32_t flags
Iterator flags.
Definition flecs.h:1235
ecs_iter_t * chain_it
Optional, allows for creating iterator chains.
Definition flecs.h:1243
void * ctx
System context.
Definition flecs.h:1222
void * run_ctx
Run language binding context.
Definition flecs.h:1225
ecs_table_t * table
Current table.
Definition flecs.h:1197
int32_t offset
Offset relative to the current table.
Definition flecs.h:1190
ecs_id_t event_id
The (component) ID for the event.
Definition flecs.h:1210
ecs_iter_fini_action_t fini
Function to clean up iterator resources.
Definition flecs.h:1242
ecs_iter_private_t priv_
Private data.
Definition flecs.h:1237
ecs_world_t * world
The world.
Definition flecs.h:1186
void * callback_ctx
Callback language binding context.
Definition flecs.h:1224
ecs_entity_t * sources
Entity on which the ID was matched (0 if same as entities).
Definition flecs.h:1200
void * binding_ctx
System binding context.
Definition flecs.h:1223
ecs_flags32_t row_fields
Fields that must be obtained with field_at.
Definition flecs.h:1204
float delta_system_time
Time elapsed since last system invocation.
Definition flecs.h:1229
const ecs_query_t * query
Query being evaluated.
Definition flecs.h:1218
int8_t term_index
Index of the term that emitted an event.
Definition flecs.h:1215
ecs_entity_t system
The system (if applicable).
Definition flecs.h:1208
ecs_flags32_t set_fields
Fields that are set.
Definition flecs.h:1202
const ecs_size_t * sizes
Component sizes.
Definition flecs.h:1196
float delta_time
Time elapsed since last frame.
Definition flecs.h:1228
ecs_flags32_t up_fields
Bitset with fields matched through up traversal.
Definition flecs.h:1205
ecs_iter_action_t callback
Callback of system or observer.
Definition flecs.h:1241
int8_t field_count
Number of fields in the iterator.
Definition flecs.h:1214
ecs_table_t * other_table
Previous or next table when adding or removing.
Definition flecs.h:1198
int32_t event_cur
Unique event ID.
Definition flecs.h:1211
const ecs_table_record_t ** trs
Info on where to find the field in the table.
Definition flecs.h:1194
int32_t count
Number of entities to iterate.
Definition flecs.h:1191
void ** ptrs
Component pointers.
Definition flecs.h:1193
ecs_iter_next_action_t next
Function to progress iterator.
Definition flecs.h:1240
const ecs_entity_t * entities
Entity identifiers.
Definition flecs.h:1192
ecs_id_t * ids
(Component) IDs.
Definition flecs.h:1199
ecs_flags64_t constrained_vars
Bitset that marks constrained variables.
Definition flecs.h:1201
Used with ecs_observer_init().
Definition flecs.h:1389
ecs_ctx_free_t run_ctx_free
Callback to free run ctx.
Definition flecs.h:1438
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:1426
void * run_ctx
Context associated with run (for language bindings).
Definition flecs.h:1435
ecs_entity_t entity
Existing entity to associate with an observer (optional).
Definition flecs.h:1394
int32_t * last_event_id
Used for internal purposes.
Definition flecs.h:1441
void * callback_ctx
Context associated with callback (for language bindings).
Definition flecs.h:1429
void * ctx
User context to pass to callback.
Definition flecs.h:1423
ecs_query_desc_t query
Query for observer.
Definition flecs.h:1397
ecs_flags32_t flags_
Used for internal purposes.
Definition flecs.h:1443
ecs_ctx_free_t callback_ctx_free
Callback to free callback ctx.
Definition flecs.h:1432
int8_t term_index_
Used for internal purposes.
Definition flecs.h:1442
bool global_observer
Global observers are tied to the lifespan of the world.
Definition flecs.h:1409
ecs_iter_action_t callback
Callback to invoke on an event, invoked when the observer matches.
Definition flecs.h:1412
bool yield_existing
When an observer is created, generate events from existing data.
Definition flecs.h:1404
ecs_run_action_t run
Callback invoked on an event.
Definition flecs.h:1420
ecs_entity_t events[8]
Events to observe (OnAdd, OnRemove, OnSet).
Definition flecs.h:1400
int32_t _canary
Used for validity testing.
Definition flecs.h:1391
An observer reacts to events matching a query.
Definition flecs.h:888
int32_t event_count
Number of events.
Definition flecs.h:895
ecs_iter_action_t callback
See ecs_observer_desc_t::callback.
Definition flecs.h:897
ecs_entity_t entity
Entity associated with the observer.
Definition flecs.h:911
ecs_observable_t * observable
Observable for the observer.
Definition flecs.h:908
ecs_run_action_t run
See ecs_observer_desc_t::run.
Definition flecs.h:898
ecs_header_t hdr
Object header.
Definition flecs.h:889
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:904
ecs_entity_t events[8]
Observer events.
Definition flecs.h:894
void * run_ctx
Run language binding context.
Definition flecs.h:902
ecs_world_t * world
The world.
Definition flecs.h:910
ecs_ctx_free_t run_ctx_free
Callback to free run_ctx.
Definition flecs.h:906
void * callback_ctx
Callback language binding context.
Definition flecs.h:901
void * ctx
Observer context.
Definition flecs.h:900
ecs_ctx_free_t callback_ctx_free
Callback to free callback_ctx.
Definition flecs.h:905
ecs_query_t * query
Observer query.
Definition flecs.h:891
Struct returned by ecs_query_count().
Definition flecs.h:5309
int32_t entities
Number of entities returned by the query.
Definition flecs.h:5311
int32_t results
Number of results returned by the query.
Definition flecs.h:5310
int32_t tables
Number of tables returned by the query.
Definition flecs.h:5312
Used with ecs_query_init().
Definition flecs.h:1315
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:1376
ecs_id_t group_by
Component ID to be used for grouping.
Definition flecs.h:1346
ecs_term_t terms[32]
Query terms.
Definition flecs.h:1320
int32_t _canary
Used for validity testing.
Definition flecs.h:1317
void * ctx
User context to pass to callback.
Definition flecs.h:1370
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
Definition flecs.h:1367
void * group_by_ctx
Context to pass to group_by.
Definition flecs.h:1364
void * binding_ctx
Context to be used for language bindings.
Definition flecs.h:1373
ecs_entity_t order_by
Component to sort on, used together with order_by_callback or order_by_table_callback.
Definition flecs.h:1342
ecs_order_by_action_t order_by_callback
Callback used for ordering query results.
Definition flecs.h:1334
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
Definition flecs.h:1357
ecs_entity_t entity
Entity associated with query (optional).
Definition flecs.h:1382
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:1379
ecs_group_by_action_t group_by_callback
Callback used for grouping results.
Definition flecs.h:1353
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Definition flecs.h:1361
ecs_sort_table_action_t order_by_table_callback
Callback used for ordering query results.
Definition flecs.h:1338
ecs_flags32_t flags
Flags for enabling query features.
Definition flecs.h:1329
ecs_query_cache_kind_t cache_kind
Caching policy of the query.
Definition flecs.h:1326
const char * expr
Query DSL expression (optional).
Definition flecs.h:1323
Type that contains information about a query group.
Definition flecs.h:1584
int32_t table_count
Number of tables in group.
Definition flecs.h:1587
void * ctx
Group context, returned by on_group_create.
Definition flecs.h:1588
uint64_t id
Group ID.
Definition flecs.h:1585
int32_t match_count
How often tables have been matched or unmatched.
Definition flecs.h:1586
Queries are lists of constraints (terms) that match entities.
Definition flecs.h:847
ecs_flags32_t row_fields
Fields that must be acquired with field_at.
Definition flecs.h:867
ecs_flags32_t data_fields
Fields that have data.
Definition flecs.h:864
ecs_flags32_t read_fields
Fields that read data.
Definition flecs.h:866
ecs_header_t hdr
Object header.
Definition flecs.h:848
int8_t var_count
Number of query variables.
Definition flecs.h:856
ecs_flags32_t fixed_fields
Bitmasks for quick field information lookups.
Definition flecs.h:861
ecs_flags32_t var_fields
Fields with non-$this variable source.
Definition flecs.h:862
ecs_flags32_t write_fields
Fields that write data.
Definition flecs.h:865
int32_t eval_count
Number of times the query is evaluated.
Definition flecs.h:882
ecs_world_t * world
World or stage the query was created with.
Definition flecs.h:880
ecs_flags32_t static_id_fields
Fields with a static (component) id.
Definition flecs.h:863
uint64_t bloom_filter
Bitmask used to quickly discard tables.
Definition flecs.h:854
ecs_world_t * real_world
Actual world.
Definition flecs.h:879
ecs_flags32_t set_fields
Fields that will be set.
Definition flecs.h:869
ecs_entity_t entity
Entity associated with query (optional).
Definition flecs.h:878
void * ctx
User context to pass to callback.
Definition flecs.h:875
int32_t * sizes
Component sizes.
Definition flecs.h:851
ecs_id_t * ids
Component ids.
Definition flecs.h:852
ecs_flags32_t shared_readonly_fields
Fields that don't write shared data.
Definition flecs.h:868
ecs_term_t * terms
Query terms.
Definition flecs.h:850
ecs_query_cache_kind_t cache_kind
Caching policy of the query.
Definition flecs.h:871
int8_t term_count
Number of query terms.
Definition flecs.h:857
char ** vars
Array with variable names for the iterator.
Definition flecs.h:873
int8_t field_count
Number of fields returned by the query.
Definition flecs.h:858
ecs_flags32_t flags
Query flags.
Definition flecs.h:855
void * binding_ctx
Context to be used for language bindings.
Definition flecs.h:876
Type that describes a reference to an entity or variable in a term.
Definition flecs.h:808
const char * name
Name.
Definition flecs.h:815
ecs_entity_t id
Entity ID.
Definition flecs.h:809
Type that describes a term (single element in a query).
Definition flecs.h:823
ecs_term_ref_t src
Source of term.
Definition flecs.h:829
int8_t field_index
Index of the field for the term in the iterator.
Definition flecs.h:840
ecs_id_t id
Component ID to be matched by term.
Definition flecs.h:824
int16_t oper
Operator of term.
Definition flecs.h:838
ecs_term_ref_t second
Second element of pair.
Definition flecs.h:831
ecs_flags16_t flags_
Flags that help evaluation, set by ecs_query_init().
Definition flecs.h:841
ecs_entity_t trav
Relationship to traverse when looking for the component.
Definition flecs.h:833
int16_t inout
Access to contents matched by term.
Definition flecs.h:837
ecs_term_ref_t first
Component or first element of pair.
Definition flecs.h:830
Component with data to instantiate a non-fragmenting tree.
Definition flecs.h:1645
uint32_t child
Prefab child entity (without generation).
Definition flecs.h:1648
int32_t parent_index
Index into the children vector.
Definition flecs.h:1649
const char * child_name
Name of the prefab child.
Definition flecs.h:1646
ecs_table_t * table
Table in which the child will be stored.
Definition flecs.h:1647
Tree spawner data for a single hierarchy depth.
Definition flecs.h:1653
ecs_vec_t children
vector<ecs_tree_spawner_child_t>.
Definition flecs.h:1654
ecs_copy_t copy_ctor
Ctor + copy.
Definition flecs.h:970
void * lifecycle_ctx
Component lifecycle context (see meta addon).
Definition flecs.h:1026
void * ctx
User-defined context.
Definition flecs.h:1024
ecs_iter_action_t on_remove
Callback that is invoked when an instance of the component is removed.
Definition flecs.h:1011
void * binding_ctx
Language binding context.
Definition flecs.h:1025
ecs_move_t move_dtor
Move + dtor.
Definition flecs.h:985
ecs_flags32_t flags
Hook flags.
Definition flecs.h:997
ecs_cmp_t cmp
Compare hook.
Definition flecs.h:988
ecs_copy_t copy
copy assignment.
Definition flecs.h:966
ecs_ctx_free_t lifecycle_ctx_free
Callback to free lifecycle_ctx.
Definition flecs.h:1030
ecs_on_validate_t on_validate
Callback that is invoked before the on_set/OnSet hooks and observers are invoked.
Definition flecs.h:1022
ecs_iter_action_t on_set
Callback that is invoked when an instance of the component is set.
Definition flecs.h:1006
ecs_move_t move
move assignment.
Definition flecs.h:967
ecs_xtor_t ctor
ctor.
Definition flecs.h:964
ecs_iter_action_t on_replace
Callback that is invoked with the existing and new value before the value is assigned.
Definition flecs.h:1017
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:1028
ecs_iter_action_t on_add
Callback that is invoked when an instance of a component is added.
Definition flecs.h:1001
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:1029
ecs_move_t move_ctor
Ctor + move.
Definition flecs.h:973
ecs_equals_t equals
Equals hook.
Definition flecs.h:991
ecs_move_t ctor_move_dtor
Ctor + move + dtor (or move_ctor + dtor).
Definition flecs.h:979
ecs_xtor_t dtor
dtor.
Definition flecs.h:965
Type that contains component information (passed to ctors/dtors/...).
Definition flecs.h:1037
ecs_size_t alignment
Alignment of the type.
Definition flecs.h:1039
ecs_size_t size
Size of the type.
Definition flecs.h:1038
const char * name
Type name.
Definition flecs.h:1042
ecs_entity_t component
Handle to component (do not set).
Definition flecs.h:1041
ecs_type_hooks_t hooks
Type hooks.
Definition flecs.h:1040
A type is a list of (component) IDs.
Definition flecs.h:403
ecs_id_t * array
Array with IDs.
Definition flecs.h:404
int32_t count
Number of elements in array.
Definition flecs.h:405
Utility to hold a value of a dynamic type.
Definition flecs.h:1051
void * ptr
Pointer to value.
Definition flecs.h:1053
ecs_entity_t type
Type of value.
Definition flecs.h:1052
Type that contains information about the world.
Definition flecs.h:1524
int64_t observers_ran_total
Total number of times an observer was invoked.
Definition flecs.h:1550
float delta_time
Time passed to or computed by ecs_progress().
Definition flecs.h:1528
int64_t systems_ran_total
Total number of systems run.
Definition flecs.h:1549
int64_t set_count
Set commands processed.
Definition flecs.h:1567
double world_time_total
Time elapsed in simulation.
Definition flecs.h:1536
int32_t tag_id_count
Number of tag (no data) IDs in the world.
Definition flecs.h:1553
int32_t component_id_count
Number of component (data) IDs in the world.
Definition flecs.h:1554
int64_t pipeline_build_count_total
Total number of pipeline builds.
Definition flecs.h:1548
int64_t eval_comp_monitors_total
Total number of monitor evaluations.
Definition flecs.h:1541
int32_t table_count
Number of tables.
Definition flecs.h:1557
float delta_time_raw
Raw delta time (no time scaling).
Definition flecs.h:1527
float frame_time_total
Total time spent processing a frame.
Definition flecs.h:1531
int64_t table_create_total
Total number of times a table was created.
Definition flecs.h:1546
float system_time_total
Total time spent in systems.
Definition flecs.h:1532
int64_t id_delete_total
Total number of times an ID was deleted.
Definition flecs.h:1545
float merge_time_total
Total time spent in merges.
Definition flecs.h:1534
struct ecs_world_info_t::@0 cmd
Command statistics.
int64_t discard_count
Commands discarded, happens when the entity is no longer alive when running the command.
Definition flecs.h:1570
int64_t clear_count
Clear commands processed.
Definition flecs.h:1566
ecs_entity_t last_component_id
Last issued component entity ID.
Definition flecs.h:1525
int64_t frame_count_total
Total number of frames.
Definition flecs.h:1539
int64_t merge_count_total
Total number of merges.
Definition flecs.h:1540
int64_t other_count
Other commands processed.
Definition flecs.h:1572
int64_t batched_command_count
Commands batched.
Definition flecs.h:1574
int64_t table_delete_total
Total number of times a table was deleted.
Definition flecs.h:1547
int64_t queries_ran_total
Total number of times a query was evaluated.
Definition flecs.h:1551
int64_t delete_count
Delete commands processed.
Definition flecs.h:1565
int64_t rematch_count_total
Total number of rematches.
Definition flecs.h:1542
int64_t id_create_total
Total number of times a new ID was created.
Definition flecs.h:1544
int64_t batched_entity_count
Entities for which commands were batched.
Definition flecs.h:1573
float time_scale
Time scale applied to delta_time.
Definition flecs.h:1529
int32_t pair_id_count
Number of pair IDs in the world.
Definition flecs.h:1555
float rematch_time_total
Time spent on query rematching.
Definition flecs.h:1535
int64_t ensure_count
Ensure or emplace commands processed.
Definition flecs.h:1568
float target_fps
Target FPS.
Definition flecs.h:1530
double world_time_total_raw
Time elapsed in simulation (no scaling).
Definition flecs.h:1537
float emit_time_total
Total time spent notifying observers.
Definition flecs.h:1533
uint32_t creation_time
Time when world was created.
Definition flecs.h:1559
int64_t modified_count
Modified commands processed.
Definition flecs.h:1569
const char * name_prefix
Value set by ecs_set_name_prefix().
Definition flecs.h:1577
int64_t event_count
Enqueued custom events.
Definition flecs.h:1571
int64_t add_count
Add commands processed.
Definition flecs.h:1563
int64_t remove_count
Remove commands processed.
Definition flecs.h:1564