Flecs v3.2
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
34#ifndef ecs_float_t
35#define ecs_float_t float
36#endif
37
41#ifndef ecs_ftime_t
42#define ecs_ftime_t ecs_float_t
43#endif
44
48// #define FLECS_LEGACY
49
53#define FLECS_NO_DEPRECATED_WARNINGS
54
60// #define FLECS_ACCURATE_COUNTERS
61
62/* Make sure provided configuration is valid */
63#if defined(FLECS_DEBUG) && defined(FLECS_NDEBUG)
64#error "invalid configuration: cannot both define FLECS_DEBUG and FLECS_NDEBUG"
65#endif
66#if defined(FLECS_DEBUG) && defined(NDEBUG)
67#error "invalid configuration: cannot both define FLECS_DEBUG and NDEBUG"
68#endif
69
74#if !defined(FLECS_DEBUG) && !defined(FLECS_NDEBUG)
75#if defined(NDEBUG)
76#define FLECS_NDEBUG
77#else
78#define FLECS_DEBUG
79#endif
80#endif
81
86#ifdef FLECS_SANITIZE
87#define FLECS_DEBUG /* If sanitized mode is enabled, so is debug mode */
88#endif
89
90/* Tip: if you see weird behavior that you think might be a bug, make sure to
91 * test with the FLECS_DEBUG or FLECS_SANITIZE flags enabled. There's a good
92 * chance that this gives you more information about the issue! */
93
107// #define FLECS_SOFT_ASSERT
108
114// #define FLECS_KEEP_ASSERT
115
139// #define FLECS_CUSTOM_BUILD
140
141#ifndef FLECS_CUSTOM_BUILD
142// #define FLECS_C /**< C API convenience macros, always enabled */
143#define FLECS_CPP
144#define FLECS_MODULE
145#define FLECS_PARSER
146#define FLECS_PLECS
147#define FLECS_RULES
148#define FLECS_SNAPSHOT
149#define FLECS_STATS
150#define FLECS_MONITOR
151#define FLECS_METRICS
152#define FLECS_SYSTEM
153#define FLECS_PIPELINE
154#define FLECS_TIMER
155#define FLECS_META
156#define FLECS_META_C
157#define FLECS_UNITS
158#define FLECS_EXPR
159#define FLECS_JSON
160#define FLECS_DOC
161#define FLECS_COREDOC
162#define FLECS_LOG
163#define FLECS_APP
164#define FLECS_OS_API_IMPL
165#define FLECS_HTTP
166#define FLECS_REST
167// #define FLECS_JOURNAL /**< Journaling addon (disabled by default) */
168#endif // ifndef FLECS_CUSTOM_BUILD
169
173// #define FLECS_LOW_FOOTPRINT
174#ifdef FLECS_LOW_FOOTPRINT
175#define FLECS_HI_COMPONENT_ID (16)
176#define FLECS_HI_ID_RECORD_ID (16)
177#define FLECS_SPARSE_PAGE_BITS (6)
178#define FLECS_ENTITY_PAGE_BITS (6)
179#define FLECS_USE_OS_ALLOC
180#endif
181
192#ifndef FLECS_HI_COMPONENT_ID
193#define FLECS_HI_COMPONENT_ID (256)
194#endif
195
202#ifndef FLECS_HI_ID_RECORD_ID
203#define FLECS_HI_ID_RECORD_ID (1024)
204#endif
205
211#ifndef FLECS_SPARSE_PAGE_BITS
212#define FLECS_SPARSE_PAGE_BITS (12)
213#endif
214
217#ifndef FLECS_ENTITY_PAGE_BITS
218#define FLECS_ENTITY_PAGE_BITS (12)
219#endif
220
225// #define FLECS_USE_OS_ALLOC
226
229#ifndef FLECS_ID_DESC_MAX
230#define FLECS_ID_DESC_MAX (32)
231#endif
232
235#define FLECS_TERM_DESC_MAX (16)
236
239#define FLECS_EVENT_DESC_MAX (8)
240
243#define FLECS_VARIABLE_COUNT_MAX (64)
244
247#include "flecs/private/api_defines.h"
248#include "flecs/private/vec.h" /* Vector datatype */
249#include "flecs/private/sparse.h" /* Sparse set */
250#include "flecs/private/block_allocator.h" /* Block allocator */
251#include "flecs/private/map.h" /* Map */
252#include "flecs/private/allocator.h" /* Allocator */
253#include "flecs/private/strbuf.h" /* String builder */
254#include "flecs/os_api.h" /* Abstraction for operating system functions */
255
256#ifdef __cplusplus
257extern "C" {
258#endif
259
274typedef uint64_t ecs_id_t;
275
278
280typedef struct {
281 ecs_id_t *array;
282 int32_t count;
283} ecs_type_t;
284
287
290
292typedef struct ecs_term_t ecs_term_t;
293
296
299
301typedef struct ecs_rule_t ecs_rule_t;
302
305
308
309/* An iterator lets an application iterate entities across tables. */
310typedef struct ecs_iter_t ecs_iter_t;
311
313typedef struct ecs_ref_t ecs_ref_t;
314
317
320
321/* Internal index that stores tables tables for a (component) id */
322typedef struct ecs_id_record_t ecs_id_record_t;
323
324/* Internal table storage record */
325typedef struct ecs_table_record_t ecs_table_record_t;
326
349typedef void ecs_poly_t;
350
353
355typedef struct ecs_header_t {
356 int32_t magic; /* Magic number verifying it's a flecs object */
357 int32_t type; /* Magic number indicating which type of flecs object */
358 ecs_mixins_t *mixins; /* Table with offsets to (optional) mixins */
360
378typedef void (*ecs_run_action_t)(
379 ecs_iter_t *it);
380
387typedef void (*ecs_iter_action_t)(
388 ecs_iter_t *it);
389
402 const ecs_world_t *world,
403 const ecs_poly_t *iterable,
404 ecs_iter_t *it,
405 ecs_term_t *filter);
406
415 ecs_iter_t *it);
416
423 ecs_iter_t *it);
424
427 ecs_entity_t e1,
428 const void *ptr1,
429 ecs_entity_t e2,
430 const void *ptr2);
431
434 ecs_world_t* world,
435 ecs_table_t* table,
436 ecs_entity_t* entities,
437 void* ptr,
438 int32_t size,
439 int32_t lo,
440 int32_t hi,
441 ecs_order_by_action_t order_by);
442
444typedef uint64_t (*ecs_group_by_action_t)(
445 ecs_world_t *world,
446 ecs_table_t *table,
447 ecs_id_t group_id,
448 void *ctx);
449
450/* Callback invoked when a query creates a new group. */
451typedef void* (*ecs_group_create_action_t)(
452 ecs_world_t *world,
453 uint64_t group_id,
454 void *group_by_ctx); /* from ecs_query_desc_t */
455
456/* Callback invoked when a query deletes an existing group. */
457typedef void (*ecs_group_delete_action_t)(
458 ecs_world_t *world,
459 uint64_t group_id,
460 void *group_ctx, /* return value from ecs_group_create_action_t */
461 void *group_by_ctx); /* from ecs_query_desc_t */
462
464typedef void (*ecs_module_action_t)(
465 ecs_world_t *world);
466
468typedef void (*ecs_fini_action_t)(
469 ecs_world_t *world,
470 void *ctx);
471
473typedef void (*ecs_ctx_free_t)(
474 void *ctx);
475
477typedef int (*ecs_compare_action_t)(
478 const void *ptr1,
479 const void *ptr2);
480
482typedef uint64_t (*ecs_hash_value_action_t)(
483 const void *ptr);
484
486typedef void (*ecs_xtor_t)(
487 void *ptr,
488 int32_t count,
489 const ecs_type_info_t *type_info);
490
492typedef void (*ecs_copy_t)(
493 void *dst_ptr,
494 const void *src_ptr,
495 int32_t count,
496 const ecs_type_info_t *type_info);
497
499typedef void (*ecs_move_t)(
500 void *dst_ptr,
501 void *src_ptr,
502 int32_t count,
503 const ecs_type_info_t *type_info);
504
505/* Destructor function for poly objects */
506typedef void (*ecs_poly_dtor_t)(
507 ecs_poly_t *poly);
508
519typedef struct ecs_iterable_t {
522
532typedef enum ecs_inout_kind_t {
539
541typedef enum ecs_oper_kind_t {
550
551/* Term id flags */
552#define EcsSelf (1u << 1)
553#define EcsUp (1u << 2)
554#define EcsDown (1u << 3)
555#define EcsTraverseAll (1u << 4)
556#define EcsCascade (1u << 5)
557#define EcsParent (1u << 6)
558#define EcsIsVariable (1u << 7)
559#define EcsIsEntity (1u << 8)
560#define EcsIsName (1u << 9)
561#define EcsFilter (1u << 10)
562#define EcsTraverseFlags (EcsUp|EcsDown|EcsTraverseAll|EcsSelf|EcsCascade|EcsParent)
563
564/* Term flags discovered & set during filter creation. */
565#define EcsTermMatchAny (1 << 0)
566#define EcsTermMatchAnySrc (1 << 1)
567#define EcsTermSrcFirstEq (1 << 2)
568#define EcsTermSrcSecondEq (1 << 3)
569#define EcsTermTransitive (1 << 4)
570#define EcsTermReflexive (1 << 5)
571#define EcsTermIdInherited (1 << 6)
572
574typedef struct ecs_term_id_t {
581 char *name;
592 ecs_flags32_t flags;
594
610 char *name;
612 int32_t field_index;
613 ecs_id_record_t *idr;
615 ecs_flags16_t flags;
617 bool move;
618};
619
621FLECS_API extern ecs_filter_t ECS_FILTER_INIT;
622
625 ecs_header_t hdr;
626
628 int32_t term_count;
629 int32_t field_count;
631 bool owned;
634 ecs_flags32_t flags;
636 char *variable_names[1];
637 int32_t *sizes;
639 /* Mixins */
642 ecs_poly_dtor_t dtor;
644};
645
646/* An observer reacts to events matching a filter */
648 ecs_header_t hdr;
649
652 /* Observer events */
654 int32_t event_count;
655
659 void *ctx;
667 int32_t *last_event_id;
668 int32_t last_event_id_storage;
669
671 int32_t term_index;
677 bool is_multi;
679 /* Mixins */
680 ecs_poly_dtor_t dtor;
681};
682
697
700
706
712
716
721
726
727 void *ctx;
732};
733
739 ecs_size_t size;
740 ecs_size_t alignment;
743 const char *name;
744};
745
746#include "flecs/private/api_types.h" /* Supporting API types */
747#include "flecs/private/api_support.h" /* Supporting API functions */
748#include "flecs/private/vec.h" /* Vector */
749#include "flecs/private/hashmap.h" /* Hashmap */
750
755typedef struct ecs_entity_desc_t {
756 int32_t _canary;
757
760 const char *name;
765 const char *sep;
769 const char *root_sep;
771 const char *symbol;
787
789 const char *add_expr;
791
796typedef struct ecs_bulk_desc_t {
797 int32_t _canary;
798
804 int32_t count;
808 void **data;
821
826typedef struct ecs_component_desc_t {
827 int32_t _canary;
828
831
835
840typedef struct ecs_filter_desc_t {
841 int32_t _canary;
842
846
849
852
855
862
864 ecs_flags32_t flags;
865
867 const char *expr;
868
872
877typedef struct ecs_query_desc_t {
878 int32_t _canary;
879
882
885
890
894
899
906
909 ecs_group_create_action_t on_group_create;
910
913 ecs_group_delete_action_t on_group_delete;
914
917
920
929
934typedef struct ecs_observer_desc_t {
935 int32_t _canary;
936
939
942
945
950
953
961
963 void *ctx;
964
967
970
973
976
980
982 int32_t term_index;
984
991/* Utility to hold a value of a dynamic type */
992typedef struct ecs_value_t {
993 ecs_entity_t type;
994 void *ptr;
996
998typedef struct ecs_world_info_t {
1027 int32_t id_count;
1033 int32_t table_count;
1040 /* -- Command counts -- */
1041 struct {
1042 int64_t add_count;
1045 int64_t clear_count;
1046 int64_t set_count;
1049 int64_t other_count;
1053 } cmd;
1054
1055 const char *name_prefix;
1060
1063 int32_t match_count;
1064 int32_t table_count;
1065 void *ctx;
1067
1077typedef struct EcsIdentifier {
1078 char *value;
1079 ecs_size_t length;
1080 uint64_t hash;
1081 uint64_t index_hash;
1082 ecs_hashmap_t *index;
1084
1086typedef struct EcsComponent {
1087 ecs_size_t size;
1088 ecs_size_t alignment;
1090
1092typedef struct EcsPoly {
1095
1097typedef struct EcsTarget {
1098 int32_t count;
1099 ecs_record_t *target;
1101
1104
1108/* Only include deprecated definitions if deprecated addon is required */
1109#ifdef FLECS_DEPRECATED
1111#endif
1112
1126#define ECS_ID_FLAG_BIT (1ull << 63)
1127
1129FLECS_API extern const ecs_id_t ECS_PAIR;
1130
1132FLECS_API extern const ecs_id_t ECS_OVERRIDE;
1133
1135FLECS_API extern const ecs_id_t ECS_TOGGLE;
1136
1138FLECS_API extern const ecs_id_t ECS_AND;
1139
1147/* Builtin component ids */
1148FLECS_API extern const ecs_entity_t ecs_id(EcsComponent);
1149FLECS_API extern const ecs_entity_t ecs_id(EcsIdentifier);
1150FLECS_API extern const ecs_entity_t ecs_id(EcsIterable);
1151FLECS_API extern const ecs_entity_t ecs_id(EcsPoly);
1152
1153FLECS_API extern const ecs_entity_t EcsQuery;
1154FLECS_API extern const ecs_entity_t EcsObserver;
1155
1156/* System module component ids */
1157FLECS_API extern const ecs_entity_t EcsSystem;
1158FLECS_API extern const ecs_entity_t ecs_id(EcsTickSource);
1159
1160/* Pipeline module component ids */
1161FLECS_API extern const ecs_entity_t ecs_id(EcsPipelineQuery);
1162
1163/* Timer module component ids */
1164FLECS_API extern const ecs_entity_t ecs_id(EcsTimer);
1165FLECS_API extern const ecs_entity_t ecs_id(EcsRateFilter);
1166
1168FLECS_API extern const ecs_entity_t EcsFlecs;
1169
1171FLECS_API extern const ecs_entity_t EcsFlecsCore;
1172
1174FLECS_API extern const ecs_entity_t EcsWorld;
1175
1177FLECS_API extern const ecs_entity_t EcsWildcard;
1178
1180FLECS_API extern const ecs_entity_t EcsAny;
1181
1183FLECS_API extern const ecs_entity_t EcsThis;
1184
1186FLECS_API extern const ecs_entity_t EcsVariable;
1187
1192FLECS_API extern const ecs_entity_t EcsTransitive;
1193
1198FLECS_API extern const ecs_entity_t EcsReflexive;
1199
1207FLECS_API extern const ecs_entity_t EcsFinal;
1208
1214FLECS_API extern const ecs_entity_t EcsDontInherit;
1215
1221FLECS_API extern const ecs_entity_t EcsAlwaysOverride;
1222
1227FLECS_API extern const ecs_entity_t EcsSymmetric;
1228
1235FLECS_API extern const ecs_entity_t EcsExclusive;
1236
1238FLECS_API extern const ecs_entity_t EcsAcyclic;
1239
1242FLECS_API extern const ecs_entity_t EcsTraversable;
1243
1250FLECS_API extern const ecs_entity_t EcsWith;
1251
1258FLECS_API extern const ecs_entity_t EcsOneOf;
1259
1262FLECS_API extern const ecs_entity_t EcsTag;
1263
1267FLECS_API extern const ecs_entity_t EcsUnion;
1268
1270FLECS_API extern const ecs_entity_t EcsName;
1271
1273FLECS_API extern const ecs_entity_t EcsSymbol;
1274
1276FLECS_API extern const ecs_entity_t EcsAlias;
1277
1279FLECS_API extern const ecs_entity_t EcsChildOf;
1280
1282FLECS_API extern const ecs_entity_t EcsIsA;
1283
1285FLECS_API extern const ecs_entity_t EcsDependsOn;
1286
1288FLECS_API extern const ecs_entity_t EcsSlotOf;
1289
1291FLECS_API extern const ecs_entity_t EcsModule;
1292
1294FLECS_API extern const ecs_entity_t EcsPrivate;
1295
1298FLECS_API extern const ecs_entity_t EcsPrefab;
1299
1301FLECS_API extern const ecs_entity_t EcsDisabled;
1302
1304FLECS_API extern const ecs_entity_t EcsOnAdd;
1305
1307FLECS_API extern const ecs_entity_t EcsOnRemove;
1308
1310FLECS_API extern const ecs_entity_t EcsOnSet;
1311
1313FLECS_API extern const ecs_entity_t EcsUnSet;
1314
1316FLECS_API extern const ecs_entity_t EcsMonitor;
1317
1322FLECS_API extern const ecs_entity_t EcsOnDelete;
1323
1325FLECS_API extern const ecs_entity_t EcsOnTableCreate;
1326
1328FLECS_API extern const ecs_entity_t EcsOnTableDelete;
1329
1331FLECS_API extern const ecs_entity_t EcsOnTableEmpty;
1332
1334FLECS_API extern const ecs_entity_t EcsOnTableFill;
1335
1340FLECS_API extern const ecs_entity_t EcsOnDeleteTarget;
1341
1344FLECS_API extern const ecs_entity_t EcsRemove;
1345
1348FLECS_API extern const ecs_entity_t EcsDelete;
1349
1352FLECS_API extern const ecs_entity_t EcsPanic;
1353
1354FLECS_API extern const ecs_entity_t ecs_id(EcsTarget);
1355FLECS_API extern const ecs_entity_t EcsFlatten;
1356
1362FLECS_API extern const ecs_entity_t EcsDefaultChildComponent;
1363
1364/* Builtin predicates for comparing entity ids in queries. Only supported by rules */
1365FLECS_API extern const ecs_entity_t EcsPredEq;
1366FLECS_API extern const ecs_entity_t EcsPredMatch;
1367FLECS_API extern const ecs_entity_t EcsPredLookup;
1368
1370FLECS_API extern const ecs_entity_t EcsEmpty;
1371
1372/* Pipeline module tags */
1373FLECS_API extern const ecs_entity_t ecs_id(EcsPipeline);
1374FLECS_API extern const ecs_entity_t EcsOnStart;
1375FLECS_API extern const ecs_entity_t EcsPreFrame;
1376FLECS_API extern const ecs_entity_t EcsOnLoad;
1377FLECS_API extern const ecs_entity_t EcsPostLoad;
1378FLECS_API extern const ecs_entity_t EcsPreUpdate;
1379FLECS_API extern const ecs_entity_t EcsOnUpdate;
1380FLECS_API extern const ecs_entity_t EcsOnValidate;
1381FLECS_API extern const ecs_entity_t EcsPostUpdate;
1382FLECS_API extern const ecs_entity_t EcsPreStore;
1383FLECS_API extern const ecs_entity_t EcsOnStore;
1384FLECS_API extern const ecs_entity_t EcsPostFrame;
1385FLECS_API extern const ecs_entity_t EcsPhase;
1386
1389#define EcsLastInternalComponentId (ecs_id(EcsPoly))
1390
1393#define EcsFirstUserComponentId (8)
1394
1397#define EcsFirstUserEntityId (FLECS_HI_COMPONENT_ID + 128)
1398
1422FLECS_API
1424
1429FLECS_API
1431
1439FLECS_API
1441 int argc,
1442 char *argv[]);
1443
1450FLECS_API
1452 ecs_world_t *world);
1453
1459FLECS_API
1461 const ecs_world_t *world);
1462
1470FLECS_API
1472 ecs_world_t *world,
1473 ecs_fini_action_t action,
1474 void *ctx);
1475
1501FLECS_API
1503 ecs_world_t *world,
1504 ecs_ftime_t delta_time);
1505
1512FLECS_API
1514 ecs_world_t *world);
1515
1523FLECS_API
1525 ecs_world_t *world,
1526 ecs_fini_action_t action,
1527 void *ctx);
1528
1535FLECS_API
1537 ecs_world_t *world);
1538
1543FLECS_API
1545 const ecs_world_t *world);
1546
1559 ecs_world_t *world,
1560 bool enable);
1561
1573 ecs_world_t *world,
1574 bool enable);
1575
1591FLECS_API
1593 ecs_world_t *world,
1594 ecs_ftime_t fps);
1595
1632FLECS_API
1634 ecs_world_t *world);
1635
1643FLECS_API
1645 ecs_world_t *world);
1646
1657FLECS_API
1659 ecs_world_t *world);
1660
1670FLECS_API
1672 ecs_world_t *world);
1673
1679FLECS_API
1681 const ecs_world_t *world);
1682
1691FLECS_API
1693 ecs_world_t *world);
1694
1704FLECS_API
1706 ecs_world_t *world);
1707
1713FLECS_API
1715 ecs_world_t *world);
1716
1733FLECS_API
1735 ecs_world_t *world,
1736 bool automerge);
1737
1751FLECS_API
1753 ecs_world_t *world,
1754 int32_t stages);
1755
1762FLECS_API
1764 const ecs_world_t *world);
1765
1773FLECS_API
1775 const ecs_world_t *world);
1776
1792FLECS_API
1794 const ecs_world_t *world,
1795 int32_t stage_id);
1796
1804FLECS_API
1806 const ecs_world_t *world);
1807
1826FLECS_API
1828 ecs_world_t *world);
1829
1836FLECS_API
1838 ecs_world_t *stage);
1839
1846FLECS_API
1848 ecs_world_t *stage);
1849
1864FLECS_API
1866 ecs_world_t *world,
1867 void *ctx);
1868
1876FLECS_API
1878 const ecs_world_t *world);
1879
1886FLECS_API
1888 const ecs_world_t *world);
1889
1898FLECS_API
1900 ecs_world_t *world,
1901 int32_t entity_count);
1902
1918FLECS_API
1920 ecs_world_t *world,
1921 ecs_entity_t id_start,
1922 ecs_entity_t id_end);
1923
1934FLECS_API
1936 ecs_world_t *world,
1937 bool enable);
1938
1939FLECS_API
1940ecs_entity_t ecs_get_max_id(
1941 const ecs_world_t *world);
1942
1956FLECS_API
1958 ecs_world_t *world,
1959 ecs_flags32_t flags);
1960
1994FLECS_API
1996 ecs_world_t *world,
1997 ecs_id_t id,
1998 uint16_t clear_generation,
1999 uint16_t delete_generation,
2000 int32_t min_id_count,
2001 double time_budget_seconds);
2002
2008FLECS_API
2010 const ecs_poly_t *poly);
2011
2017FLECS_API
2019 const ecs_poly_t *poly);
2020
2031FLECS_API
2033 const ecs_poly_t *object,
2034 int32_t type);
2035
2036#define ecs_poly_is(object, type)\
2037 _ecs_poly_is(object, type##_magic)
2038
2046FLECS_API
2048 ecs_entity_t first,
2049 ecs_entity_t second);
2050
2075FLECS_API
2077 ecs_world_t *world);
2078
2096FLECS_API
2098 ecs_world_t *world);
2099
2108FLECS_API
2110 ecs_world_t *world,
2111 ecs_id_t id);
2112
2120FLECS_API
2122 ecs_world_t *world,
2123 ecs_table_t *table);
2124
2143FLECS_API
2145 ecs_world_t *world,
2146 const ecs_entity_desc_t *desc);
2147
2174FLECS_API
2176 ecs_world_t *world,
2177 const ecs_bulk_desc_t *desc);
2178
2188FLECS_API
2190 ecs_world_t *world,
2191 ecs_id_t id,
2192 int32_t count);
2193
2205FLECS_API
2207 ecs_world_t *world,
2208 ecs_entity_t dst,
2209 ecs_entity_t src,
2210 bool copy_value);
2211
2221FLECS_API
2223 ecs_world_t *world,
2224 ecs_entity_t entity);
2225
2233FLECS_API
2235 ecs_world_t *world,
2236 ecs_id_t id);
2237
2254FLECS_API
2256 ecs_world_t *world,
2257 ecs_entity_t entity,
2258 ecs_id_t id);
2259
2268FLECS_API
2270 ecs_world_t *world,
2271 ecs_entity_t entity,
2272 ecs_id_t id);
2273
2296FLECS_API
2298 ecs_world_t *world,
2299 ecs_entity_t entity,
2300 ecs_id_t id);
2301
2310FLECS_API
2312 ecs_world_t *world,
2313 ecs_entity_t entity);
2314
2315
2323FLECS_API
2325 ecs_world_t *world,
2326 ecs_id_t id);
2327
2335FLECS_API
2337 ecs_world_t *world,
2338 ecs_id_t id);
2339
2346FLECS_API
2348 const ecs_world_t *world);
2349
2367FLECS_API
2369 ecs_world_t *world,
2370 ecs_entity_t entity,
2371 bool enabled);
2372
2386FLECS_API
2388 ecs_world_t *world,
2389 ecs_entity_t entity,
2390 ecs_id_t id,
2391 bool enable);
2392
2403FLECS_API
2405 const ecs_world_t *world,
2406 ecs_entity_t entity,
2407 ecs_id_t id);
2408
2426FLECS_API
2427const void* ecs_get_id(
2428 const ecs_world_t *world,
2429 ecs_entity_t entity,
2430 ecs_id_t id);
2431
2442FLECS_API
2444 const ecs_world_t *world,
2445 ecs_entity_t entity,
2446 ecs_id_t id);
2447
2456FLECS_API
2458 const ecs_world_t *world,
2459 ecs_ref_t *ref,
2460 ecs_id_t id);
2461
2469FLECS_API
2471 const ecs_world_t *world,
2472 ecs_ref_t *ref);
2473
2488FLECS_API
2490 ecs_world_t *world,
2491 ecs_entity_t entity,
2492 ecs_id_t id);
2493
2512FLECS_API
2513ecs_record_t* ecs_write_begin(
2514 ecs_world_t *world,
2515 ecs_entity_t entity);
2516
2523FLECS_API
2525 ecs_record_t *record);
2526
2546FLECS_API
2547const ecs_record_t* ecs_read_begin(
2548 ecs_world_t *world,
2549 ecs_entity_t entity);
2550
2556FLECS_API
2558 const ecs_record_t *record);
2559
2565FLECS_API
2567 const ecs_record_t *record);
2568
2582FLECS_API
2584 ecs_world_t *world,
2585 const ecs_record_t *record,
2586 ecs_id_t id);
2587
2596FLECS_API
2598 ecs_world_t *world,
2599 ecs_record_t *record,
2600 ecs_id_t id);
2601
2608FLECS_API
2610 ecs_world_t *world,
2611 const ecs_record_t *record,
2612 ecs_id_t id);
2613
2627FLECS_API
2629 ecs_world_t *world,
2630 ecs_entity_t entity,
2631 ecs_id_t id);
2632
2643FLECS_API
2645 ecs_world_t *world,
2646 ecs_entity_t entity,
2647 ecs_id_t id);
2648
2662FLECS_API
2664 ecs_world_t *world,
2665 ecs_entity_t entity,
2666 ecs_id_t id,
2667 size_t size,
2668 const void *ptr);
2669
2696FLECS_API
2698 const ecs_world_t *world,
2699 ecs_entity_t e);
2700
2709FLECS_API
2711 const ecs_world_t *world,
2712 ecs_entity_t e);
2713
2719FLECS_API
2721 ecs_entity_t e);
2722
2734FLECS_API
2736 ecs_world_t *world,
2737 ecs_entity_t entity);
2738
2755FLECS_API
2757 const ecs_world_t *world,
2758 ecs_entity_t e);
2759
2780FLECS_API
2782 ecs_world_t *world,
2783 ecs_entity_t entity);
2784
2803FLECS_API
2805 ecs_world_t *world,
2806 ecs_id_t id);
2807
2815FLECS_API
2817 const ecs_world_t *world,
2818 ecs_entity_t entity);
2819
2834FLECS_API
2836 const ecs_world_t *world,
2837 ecs_entity_t entity);
2838
2845FLECS_API
2847 const ecs_world_t *world,
2848 ecs_entity_t entity);
2849
2857FLECS_API
2859 const ecs_world_t *world,
2860 const ecs_type_t* type);
2861
2870FLECS_API
2872 const ecs_world_t *world,
2873 const ecs_table_t *table);
2874
2886FLECS_API
2888 const ecs_world_t *world,
2889 ecs_entity_t entity);
2890
2899FLECS_API
2901 const ecs_world_t *world,
2902 ecs_entity_t entity,
2903 ecs_id_t id);
2904
2914FLECS_API
2916 const ecs_world_t *world,
2917 ecs_entity_t entity,
2918 ecs_id_t id);
2919
2934FLECS_API
2936 const ecs_world_t *world,
2937 ecs_entity_t entity,
2938 ecs_entity_t rel,
2939 int32_t index);
2940
2949FLECS_API
2951 const ecs_world_t *world,
2952 ecs_entity_t entity);
2953
2972FLECS_API
2974 const ecs_world_t *world,
2975 ecs_entity_t entity,
2976 ecs_entity_t rel,
2977 ecs_id_t id);
2978
2989FLECS_API
2991 const ecs_world_t *world,
2992 ecs_entity_t entity,
2993 ecs_entity_t rel);
2994
2995typedef struct ecs_flatten_desc_t {
2996 /* When true, the flatten operation will not remove names from entities in
2997 * the flattened tree. This may fail if entities from different subtrees
2998 * have the same name. */
2999 bool keep_names;
3000
3001 /* When true, the flattened tree won't contain information about the
3002 * original depth of the entities. This can reduce fragmentation, but may
3003 * cause existing code, such as cascade queries, to no longer work. */
3004 bool lose_depth;
3006
3031FLECS_API
3033 ecs_world_t *world,
3034 ecs_id_t pair,
3035 const ecs_flatten_desc_t *desc);
3036
3044FLECS_API
3046 const ecs_world_t *world,
3047 ecs_id_t entity);
3048
3065FLECS_API
3066const char* ecs_get_name(
3067 const ecs_world_t *world,
3068 ecs_entity_t entity);
3069
3077FLECS_API
3078const char* ecs_get_symbol(
3079 const ecs_world_t *world,
3080 ecs_entity_t entity);
3081
3093FLECS_API
3095 ecs_world_t *world,
3096 ecs_entity_t entity,
3097 const char *name);
3098
3110FLECS_API
3112 ecs_world_t *world,
3113 ecs_entity_t entity,
3114 const char *symbol);
3115
3127FLECS_API
3129 ecs_world_t *world,
3130 ecs_entity_t entity,
3131 const char *alias);
3132
3141FLECS_API
3143 const ecs_world_t *world,
3144 const char *name);
3145
3155FLECS_API
3157 const ecs_world_t *world,
3158 ecs_entity_t parent,
3159 const char *name);
3160
3179FLECS_API
3181 const ecs_world_t *world,
3182 ecs_entity_t parent,
3183 const char *path,
3184 const char *sep,
3185 const char *prefix,
3186 bool recursive);
3187
3195FLECS_API
3197 const ecs_world_t *world,
3198 const char *symbol,
3199 bool lookup_as_path);
3200
3220FLECS_API
3222 const ecs_world_t *world,
3223 ecs_entity_t parent,
3224 ecs_entity_t child,
3225 const char *sep,
3226 const char *prefix);
3227
3239 const ecs_world_t *world,
3240 ecs_entity_t parent,
3241 ecs_entity_t child,
3242 const char *sep,
3243 const char *prefix,
3244 ecs_strbuf_t *buf);
3245
3261FLECS_API
3263 ecs_world_t *world,
3264 ecs_entity_t parent,
3265 const char *path,
3266 const char *sep,
3267 const char *prefix);
3268
3283FLECS_API
3285 ecs_world_t *world,
3286 ecs_entity_t entity,
3287 ecs_entity_t parent,
3288 const char *path,
3289 const char *sep,
3290 const char *prefix);
3291
3303FLECS_API
3305 ecs_world_t *world,
3306 ecs_entity_t scope);
3307
3315FLECS_API
3317 const ecs_world_t *world);
3318
3328FLECS_API
3330 ecs_world_t *world,
3331 const char *prefix);
3332
3357FLECS_API
3359 ecs_world_t *world,
3360 const ecs_entity_t *lookup_path);
3361
3368FLECS_API
3370 const ecs_world_t *world);
3371
3395FLECS_API
3397 ecs_world_t *world,
3398 const ecs_component_desc_t *desc);
3399
3411FLECS_API
3413 ecs_world_t *world,
3414 ecs_entity_t id,
3415 const ecs_type_hooks_t *hooks);
3416
3423FLECS_API
3425 ecs_world_t *world,
3426 ecs_entity_t id);
3427
3450FLECS_API
3452 const ecs_world_t *world,
3453 ecs_id_t id);
3454
3467FLECS_API
3469 const ecs_world_t *world,
3470 ecs_id_t id);
3471
3480FLECS_API
3482 const ecs_world_t *world,
3483 ecs_id_t id);
3484
3494FLECS_API
3496 const ecs_world_t *world,
3497 ecs_id_t id);
3498
3518FLECS_API
3520 const ecs_world_t *world,
3521 ecs_id_t id);
3522
3530FLECS_API
3532 ecs_id_t id,
3533 ecs_id_t pattern);
3534
3540FLECS_API
3542 ecs_id_t id);
3543
3549FLECS_API
3551 ecs_id_t id);
3552
3566FLECS_API
3568 const ecs_world_t *world,
3569 ecs_id_t id);
3570
3579FLECS_API
3580ecs_flags32_t ecs_id_get_flags(
3581 const ecs_world_t *world,
3582 ecs_id_t id);
3583
3590FLECS_API
3592 ecs_id_t id_flags);
3593
3601FLECS_API
3603 const ecs_world_t *world,
3604 ecs_id_t id);
3605
3613FLECS_API
3615 const ecs_world_t *world,
3616 ecs_id_t id,
3617 ecs_strbuf_t *buf);
3618
3636FLECS_API
3637ecs_iter_t ecs_term_iter(
3638 const ecs_world_t *world,
3639 ecs_term_t *term);
3640
3649FLECS_API
3651 const ecs_iter_t *it,
3652 ecs_term_t *term);
3653
3663FLECS_API
3665 ecs_iter_t *it);
3666
3675FLECS_API
3676ecs_iter_t ecs_children(
3677 const ecs_world_t *world,
3678 ecs_entity_t parent);
3679
3686FLECS_API
3688 ecs_iter_t *it);
3689
3695FLECS_API
3697 const ecs_term_id_t *id);
3698
3710FLECS_API
3712 const ecs_term_t *term);
3713
3714FLECS_API
3715bool ecs_term_match_this(
3716 const ecs_term_t *term);
3717
3718FLECS_API
3719bool ecs_term_match_0(
3720 const ecs_term_t *term);
3721
3740FLECS_API
3742 const ecs_world_t *world,
3743 ecs_term_t *term);
3744
3753FLECS_API
3755 const ecs_term_t *src);
3756
3767FLECS_API
3769 ecs_term_t *src);
3770
3777FLECS_API
3779 ecs_term_t *term);
3780
3804FLECS_API
3806 ecs_world_t *world,
3807 const ecs_filter_desc_t *desc);
3808
3814FLECS_API
3816 ecs_filter_t *filter);
3817
3831FLECS_API
3833 const ecs_world_t *world,
3834 ecs_filter_t *filter);
3835
3847FLECS_API
3849 const ecs_filter_t *filter);
3850
3855FLECS_API
3857 const ecs_world_t *world,
3858 const ecs_term_t *term);
3859
3864FLECS_API
3866 const ecs_world_t *world,
3867 const ecs_filter_t *filter);
3868
3877FLECS_API
3879 const ecs_world_t *world,
3880 const ecs_filter_t *filter);
3881
3890FLECS_API
3892 const ecs_iter_t *it,
3893 const ecs_filter_t *filter);
3894
3914FLECS_API
3916 const ecs_world_t *world,
3917 const ecs_filter_t *filter);
3918
3928FLECS_API
3930 ecs_iter_t *it);
3931
3935FLECS_API
3937 ecs_iter_t *it);
3938
3940FLECS_API
3942 ecs_filter_t *dst,
3943 ecs_filter_t *src);
3944
3946FLECS_API
3948 ecs_filter_t *dst,
3949 const ecs_filter_t *src);
3950
3993FLECS_API
3995 ecs_world_t *world,
3996 const ecs_query_desc_t *desc);
3997
4005FLECS_API
4008
4015FLECS_API
4017 const ecs_query_t *query);
4018
4046FLECS_API
4048 const ecs_world_t *world,
4050
4060FLECS_API
4062 ecs_iter_t *iter);
4063
4067FLECS_API
4069 ecs_iter_t *iter);
4070
4081FLECS_API
4083 ecs_iter_t *iter);
4084
4106FLECS_API
4108 ecs_iter_t *iter,
4109 bool when_changed);
4110
4140FLECS_API
4143 const ecs_iter_t *it);
4144
4155FLECS_API
4157 ecs_iter_t *it);
4158
4181FLECS_API
4183 ecs_iter_t *it,
4184 uint64_t group_id);
4185
4194FLECS_API
4196 const ecs_query_t *query,
4197 uint64_t group_id);
4198
4207FLECS_API
4209 const ecs_query_t *query,
4210 uint64_t group_id);
4211
4220FLECS_API
4222 const ecs_query_t *query);
4223
4229FLECS_API
4231 const ecs_query_t *query);
4232
4238FLECS_API
4240 const ecs_query_t *query);
4241
4247FLECS_API
4249 const ecs_query_t *query);
4250
4258FLECS_API
4260 const ecs_query_t *query);
4261
4270typedef struct ecs_event_desc_t {
4273
4278
4281
4285
4287 int32_t offset;
4288
4292 int32_t count;
4293
4296
4298 const void *param;
4299
4302
4304 ecs_flags32_t flags;
4306
4336FLECS_API
4338 ecs_world_t *world,
4339 ecs_event_desc_t *desc);
4340
4350FLECS_API
4352 ecs_world_t *world,
4353 const ecs_observer_desc_t *desc);
4354
4364FLECS_API
4366 ecs_iter_t *it);
4367
4368FLECS_API
4369void* ecs_get_observer_ctx(
4370 const ecs_world_t *world,
4372
4373FLECS_API
4374void* ecs_get_observer_binding_ctx(
4375 const ecs_world_t *world,
4377
4407FLECS_API
4409 const ecs_world_t *world,
4410 const ecs_poly_t *poly,
4411 ecs_iter_t *iter,
4412 ecs_term_t *filter);
4413
4427FLECS_API
4429 ecs_iter_t *it);
4430
4440FLECS_API
4442 ecs_iter_t *it);
4443
4455FLECS_API
4457 ecs_iter_t *it);
4458
4471FLECS_API
4473 ecs_iter_t *it);
4474
4482FLECS_API
4484 ecs_iter_t *it);
4485
4519FLECS_API
4521 ecs_iter_t *it,
4522 int32_t var_id,
4523 ecs_entity_t entity);
4524
4532FLECS_API
4534 ecs_iter_t *it,
4535 int32_t var_id,
4536 const ecs_table_t *table);
4537
4545FLECS_API
4547 ecs_iter_t *it,
4548 int32_t var_id,
4549 const ecs_table_range_t *range);
4550
4562FLECS_API
4564 ecs_iter_t *it,
4565 int32_t var_id);
4566
4579FLECS_API
4581 ecs_iter_t *it,
4582 int32_t var_id);
4583
4596FLECS_API
4598 ecs_iter_t *it,
4599 int32_t var_id);
4600
4601
4613FLECS_API
4615 ecs_iter_t *it,
4616 int32_t var_id);
4617
4633FLECS_API
4634ecs_iter_t ecs_page_iter(
4635 const ecs_iter_t *it,
4636 int32_t offset,
4637 int32_t limit);
4638
4645FLECS_API
4647 ecs_iter_t *it);
4648
4669FLECS_API
4671 const ecs_iter_t *it,
4672 int32_t index,
4673 int32_t count);
4674
4681FLECS_API
4683 ecs_iter_t *it);
4684
4708FLECS_API
4710 const ecs_iter_t *it,
4711 size_t size,
4712 int32_t index);
4713
4722FLECS_API
4724 const ecs_iter_t *it,
4725 int32_t index);
4726
4737FLECS_API
4739 const ecs_iter_t *it,
4740 int32_t index);
4741
4748FLECS_API
4750 const ecs_iter_t *it,
4751 int32_t index);
4752
4759FLECS_API
4761 const ecs_iter_t *it,
4762 int32_t index);
4763
4772FLECS_API
4774 const ecs_iter_t *it,
4775 int32_t index);
4776
4784FLECS_API
4786 const ecs_iter_t *it,
4787 int32_t index);
4788
4797FLECS_API
4799 const ecs_iter_t *it,
4800 int32_t index);
4801
4815FLECS_API
4817 const ecs_iter_t *it,
4818 int32_t index);
4819
4831FLECS_API
4833 const ecs_iter_t *it);
4834
4835
4849FLECS_API
4851 const ecs_table_t *table);
4852
4861FLECS_API
4863 const ecs_table_t *table,
4864 int32_t index,
4865 int32_t offset);
4866
4874FLECS_API
4876 const ecs_table_t *table,
4877 int32_t index);
4878
4887FLECS_API
4889 const ecs_world_t *world,
4890 const ecs_table_t *table,
4891 ecs_id_t id);
4892
4901FLECS_API
4903 const ecs_world_t *world,
4904 const ecs_table_t *table,
4905 ecs_id_t id);
4906
4915FLECS_API
4917 const ecs_world_t *world,
4918 const ecs_table_t *table,
4919 ecs_id_t id,
4920 int32_t offset);
4921
4932FLECS_API
4934 const ecs_world_t *world,
4935 const ecs_table_t *table,
4936 ecs_entity_t rel);
4937
4943FLECS_API
4945 const ecs_table_t *table);
4946
4948FLECS_API
4950 const ecs_table_t *table,
4951 int32_t index);
4952
4954FLECS_API
4956 const ecs_table_t *table,
4957 int32_t index);
4958
4967FLECS_API
4969 const ecs_table_t *table);
4970
4980FLECS_API
4982 ecs_world_t *world,
4983 ecs_table_t *table,
4984 ecs_id_t id);
4985
4996FLECS_API
4998 ecs_world_t *world,
4999 const ecs_id_t *ids,
5000 int32_t id_count);
5001
5011FLECS_API
5013 ecs_world_t *world,
5014 ecs_table_t *table,
5015 ecs_id_t id);
5016
5032FLECS_API
5034 ecs_world_t *world,
5035 ecs_table_t *table);
5036
5043FLECS_API
5045 ecs_world_t *world,
5046 ecs_table_t *table);
5047
5055FLECS_API
5057 ecs_table_t *table);
5058
5066FLECS_API
5068 ecs_world_t* world,
5069 ecs_table_t* table,
5070 int32_t row_1,
5071 int32_t row_2);
5072
5095FLECS_API
5097 ecs_world_t *world,
5098 ecs_entity_t entity,
5099 ecs_record_t *record,
5100 ecs_table_t *table,
5101 const ecs_type_t *added,
5102 const ecs_type_t *removed);
5103
5105FLECS_API
5106ecs_record_t* ecs_record_find(
5107 const ecs_world_t *world,
5108 ecs_entity_t entity);
5109
5111FLECS_API
5113 const ecs_record_t *r,
5114 int32_t column,
5115 size_t c_size);
5116
5132FLECS_API
5134 const ecs_world_t *world,
5135 const ecs_table_t *table,
5136 ecs_id_t id,
5137 ecs_id_t *id_out);
5138
5169FLECS_API
5171 const ecs_world_t *world,
5172 const ecs_table_t *table,
5173 int32_t offset,
5174 ecs_id_t id,
5175 ecs_id_t *id_out);
5176
5213FLECS_API
5215 const ecs_world_t *world,
5216 const ecs_table_t *table,
5217 int32_t offset,
5218 ecs_id_t id,
5219 ecs_entity_t rel,
5220 ecs_flags32_t flags, /* EcsSelf and/or EcsUp */
5221 ecs_entity_t *subject_out,
5222 ecs_id_t *id_out,
5223 struct ecs_table_record_t **tr_out);
5224
5240FLECS_API
5242 const ecs_world_t *world,
5243 ecs_entity_t type,
5244 void *ptr);
5245
5253FLECS_API
5255 const ecs_world_t *world,
5256 const ecs_type_info_t *ti,
5257 void *ptr);
5258
5265FLECS_API
5267 ecs_world_t *world,
5268 ecs_entity_t type);
5269
5277 ecs_world_t *world,
5278 const ecs_type_info_t *ti);
5279
5288 const ecs_world_t *world,
5289 const ecs_type_info_t *ti,
5290 void *ptr);
5291
5299FLECS_API
5301 const ecs_world_t *world,
5302 ecs_entity_t type,
5303 void* ptr);
5304
5311FLECS_API
5313 ecs_world_t *world,
5314 ecs_entity_t type,
5315 void* ptr);
5316
5325FLECS_API
5327 const ecs_world_t *world,
5328 const ecs_type_info_t *ti,
5329 void* dst,
5330 const void *src);
5331
5340FLECS_API
5342 const ecs_world_t *world,
5343 ecs_entity_t type,
5344 void* dst,
5345 const void *src);
5346
5356 const ecs_world_t *world,
5357 const ecs_type_info_t *ti,
5358 void* dst,
5359 void *src);
5360
5370 const ecs_world_t *world,
5371 ecs_entity_t type,
5372 void* dst,
5373 void *src);
5374
5384 const ecs_world_t *world,
5385 const ecs_type_info_t *ti,
5386 void* dst,
5387 void *src);
5388
5398 const ecs_world_t *world,
5399 ecs_entity_t type,
5400 void* dst,
5401 void *src);
5402
5417#include "flecs/addons/flecs_c.h"
5418
5419#ifdef __cplusplus
5420}
5421#endif
5422
5423#include "flecs/private/addons.h"
5424
5425#endif
The deprecated addon contains deprecated operations.
Extends the core API with convenience macros for C applications.
ecs_entity_t ecs_set_with(ecs_world_t *world, ecs_id_t id)
Set current with id.
void ecs_override_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Add override for (component) id.
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Add a (component) id to an entity.
void ecs_remove_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Remove a (component) id from an entity.
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 current with id.
void ecs_remove_all(ecs_world_t *world, ecs_id_t id)
Remove all instances of the specified id.
ecs_iterable_t EcsIterable
Component for iterable entities.
Definition: flecs.h:1103
const ecs_entity_t EcsOnRemove
Event.
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
Marks a relationship as acyclic.
const ecs_entity_t EcsSymmetric
Marks relationship as commutative.
const ecs_entity_t EcsAlias
Tag to indicate alias identifier.
const ecs_entity_t EcsOnSet
Event.
const ecs_entity_t EcsReflexive
Marks a relatoinship as reflexive.
const ecs_entity_t EcsEmpty
Tag used to indicate query is empty.
const ecs_entity_t EcsOneOf
Ensure that relationship target is child of specified entity.
const ecs_entity_t EcsOnTableDelete
Event.
const ecs_entity_t EcsOnTableCreate
Event.
const ecs_entity_t EcsTraversable
Marks a relationship as traversable.
const ecs_entity_t EcsUnSet
Event.
const ecs_entity_t EcsIsA
Used to express inheritance relationships.
const ecs_entity_t EcsExclusive
Can be added to 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 EcsAlwaysOverride
Ensures a component is always overridden.
const ecs_entity_t EcsTransitive
Marks a relationship as transitive.
const ecs_entity_t EcsDelete
Delete cleanup policy.
const ecs_entity_t EcsOnTableFill
Event.
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.
const ecs_entity_t EcsOnTableEmpty
Event.
const ecs_entity_t EcsWorld
Entity associated with world (used for "attaching" components to world)
const ecs_entity_t EcsPrivate
Tag to indicate an entity/component/system is private to a module.
const ecs_entity_t EcsRemove
Remove cleanup policy.
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 EcsOnAdd
Event.
const ecs_entity_t EcsPrefab
Tag added to prefab entities.
const ecs_entity_t EcsUnion
Tag to indicate that relationship is stored as union.
const ecs_entity_t EcsAny
Any entity ("_").
const ecs_entity_t EcsWith
Ensure that a component always is added together with another component.
const ecs_entity_t EcsTag
Can be added to relationship to indicate that it should never hold data, even when it or the relation...
const ecs_entity_t EcsOnDelete
Event.
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 EcsFlecs
Root scope for builtin flecs entities.
const ecs_entity_t EcsDisabled
When this tag is added to an entity it is skipped by all queries/filters.
const ecs_entity_t EcsDontInherit
Ensures that component is never inherited from an IsA target.
const ecs_entity_t EcsPanic
Panic cleanup policy.
const ecs_entity_t EcsDefaultChildComponent
Used like (EcsDefaultChildComponent, Component).
const ecs_entity_t EcsFinal
Ensures that entity/component cannot be used as target in IsA relationship.
const ecs_entity_t EcsVariable
Variable entity ("$").
bool ecs_defer_end(ecs_world_t *world)
End block of operations to defer.
void ecs_defer_resume(ecs_world_t *world)
Resume deferring.
bool ecs_defer_begin(ecs_world_t *world)
Defer operations until end of 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 current stage.
bool ecs_stage_is_async(ecs_world_t *stage)
Test whether provided stage is asynchronous.
void ecs_merge(ecs_world_t *world)
Merge world or stage.
void ecs_async_stage_free(ecs_world_t *stage)
Free asynchronous stage.
void ecs_set_automerge(ecs_world_t *world, bool automerge)
Enable/disable automerging for world or stage.
ecs_world_t * ecs_async_stage_new(ecs_world_t *world)
Create asynchronous stage.
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 number of configured stages.
bool ecs_readonly_begin(ecs_world_t *world)
Begin readonly mode.
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 world to have N stages.
void ecs_readonly_end(ecs_world_t *world)
End readonly mode.
int32_t ecs_get_stage_id(const ecs_world_t *world)
Get current stage id.
const ecs_type_hooks_t * ecs_get_hooks_id(ecs_world_t *world, ecs_entity_t id)
Get hooks for component.
ecs_entity_t ecs_component_init(ecs_world_t *world, const ecs_component_desc_t *desc)
Find or create a component.
void ecs_set_hooks_id(ecs_world_t *world, ecs_entity_t id, const ecs_type_hooks_t *hooks)
Register hooks for component.
struct ecs_ref_t ecs_ref_t
Refs cache data that lets them access components faster than ecs_get.
Definition: flecs.h:313
ecs_id_t ecs_entity_t
An entity identifier.
Definition: flecs.h:277
struct ecs_rule_t ecs_rule_t
A rule implements a non-trivial filter.
Definition: flecs.h:301
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition: flecs.h:286
struct ecs_mixins_t ecs_mixins_t
Type that stores poly mixins.
Definition: flecs.h:352
uint64_t ecs_id_t
An id.
Definition: flecs.h:274
struct ecs_query_t ecs_query_t
A query allows for cached iteration over ECS data.
Definition: flecs.h:295
struct ecs_observable_t ecs_observable_t
An observable contains lists of triggers for specific events/components.
Definition: flecs.h:307
struct ecs_table_t ecs_table_t
A table is where entities and components are stored.
Definition: flecs.h:289
void ecs_poly_t
A poly object.
Definition: flecs.h:349
ecs_entity_t ecs_new_low_id(ecs_world_t *world)
Create new low id.
ecs_entity_t ecs_new_w_id(ecs_world_t *world, ecs_id_t id)
Create new entity with (component) id.
ecs_entity_t ecs_new_id(ecs_world_t *world)
Create new entity id.
const ecs_entity_t * ecs_bulk_init(ecs_world_t *world, const ecs_bulk_desc_t *desc)
Bulk create/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 This operation clones the components of one entity into another entity.
const ecs_entity_t * ecs_bulk_new_w_id(ecs_world_t *world, ecs_id_t id, int32_t count)
Create N new entities.
ecs_entity_t ecs_entity_init(ecs_world_t *world, const ecs_entity_desc_t *desc)
Find or create an entity.
void ecs_delete_with(ecs_world_t *world, ecs_id_t id)
Delete all entities with the specified id.
void ecs_delete(ecs_world_t *world, ecs_entity_t entity)
Delete an entity.
ecs_entity_t ecs_new_w_table(ecs_world_t *world, ecs_table_t *table)
Create new entity in table.
bool ecs_is_enabled_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Test if component is enabled.
void ecs_enable_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, bool enable)
Enable or disable component.
void ecs_enable(ecs_world_t *world, ecs_entity_t entity, bool enabled)
Enable or disable entity.
char * ecs_entity_str(const ecs_world_t *world, ecs_entity_t entity)
Convert entity to 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 parent (target of ChildOf relationship) for entity.
const ecs_type_t * ecs_get_type(const ecs_world_t *world, ecs_entity_t entity)
Get the type of an entity.
bool ecs_has_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Test if an entity has an id.
char * ecs_type_str(const ecs_world_t *world, const ecs_type_t *type)
Convert type to string.
char * ecs_table_str(const ecs_world_t *world, const ecs_table_t *table)
Convert table to string.
int32_t ecs_count_id(const ecs_world_t *world, ecs_id_t entity)
Count entities that have the specified id.
void ecs_flatten(ecs_world_t *world, ecs_id_t pair, const ecs_flatten_desc_t *desc)
Recursively flatten relationship for target entity (experimental).
bool ecs_owns_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Test if an entity owns an id.
int32_t ecs_get_depth(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel)
Return depth for entity in tree for relationship rel.
ecs_entity_t ecs_get_target_for_id(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, ecs_id_t id)
Get the target of a relationship for a given id.
ecs_table_t * ecs_get_table(const ecs_world_t *world, ecs_entity_t entity)
Get the table of an entity.
bool ecs_children_next(ecs_iter_t *it)
Progress a children iterator.
ecs_term_t ecs_term_copy(const ecs_term_t *src)
Copy resources of a term to another term.
ecs_iter_t ecs_term_chain_iter(const ecs_iter_t *it, ecs_term_t *term)
Return a chained term iterator.
void ecs_term_fini(ecs_term_t *term)
Free resources of term.
ecs_filter_t * ecs_filter_init(ecs_world_t *world, const ecs_filter_desc_t *desc)
Initialize filter A filter is a lightweight object that can be used to query for entities in a world.
bool ecs_filter_next(ecs_iter_t *it)
Iterate tables matched by filter.
ecs_iter_t ecs_filter_iter(const ecs_world_t *world, const ecs_filter_t *filter)
Return a filter iterator.
char * ecs_term_str(const ecs_world_t *world, const ecs_term_t *term)
Convert ter, to string expression.
int ecs_filter_finalize(const ecs_world_t *world, ecs_filter_t *filter)
Finalize filter.
char * ecs_filter_str(const ecs_world_t *world, const ecs_filter_t *filter)
Convert filter to string expression.
void ecs_filter_fini(ecs_filter_t *filter)
Deinitialize filter.
bool ecs_filter_next_instanced(ecs_iter_t *it)
Same as ecs_filter_next, but always instanced.
bool ecs_term_next(ecs_iter_t *it)
Progress a term iterator.
int32_t ecs_filter_pivot_term(const ecs_world_t *world, const ecs_filter_t *filter)
Get pivot term for filter.
ecs_iter_t ecs_children(const ecs_world_t *world, ecs_entity_t parent)
Iterator for a parent's children.
int32_t ecs_filter_find_this_var(const ecs_filter_t *filter)
Find index for This variable.
int ecs_term_finalize(const ecs_world_t *world, ecs_term_t *term)
Finalize term.
bool ecs_term_id_is_set(const ecs_term_id_t *id)
Test whether term id is set.
void ecs_filter_move(ecs_filter_t *dst, ecs_filter_t *src)
Move resources of one filter to another.
bool ecs_term_is_initialized(const ecs_term_t *term)
Test whether a term is set.
ecs_term_t ecs_term_move(ecs_term_t *src)
Move resources of a term to another term.
void ecs_filter_copy(ecs_filter_t *dst, const ecs_filter_t *src)
Copy resources of one filter to another.
ecs_iter_t ecs_filter_chain_iter(const ecs_iter_t *it, const ecs_filter_t *filter)
Return a chained filter iterator.
ecs_iter_t ecs_term_iter(const ecs_world_t *world, ecs_term_t *term)
Iterator for a single (component) id.
void(* ecs_module_action_t)(ecs_world_t *world)
Initialization action for modules.
Definition: flecs.h:464
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:444
uint64_t(* ecs_hash_value_action_t)(const void *ptr)
Callback used for hashing values.
Definition: flecs.h:482
void(* ecs_iter_fini_action_t)(ecs_iter_t *it)
Function prototype for freeing an iterator.
Definition: flecs.h:422
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:433
bool(* ecs_iter_next_action_t)(ecs_iter_t *it)
Function prototype for iterating an iterator.
Definition: flecs.h:414
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
Definition: flecs.h:387
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:492
int(* ecs_compare_action_t)(const void *ptr1, const void *ptr2)
Callback used for sorting values.
Definition: flecs.h:477
void(* ecs_fini_action_t)(ecs_world_t *world, void *ctx)
Action callback on world exit.
Definition: flecs.h:468
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:499
void(* ecs_run_action_t)(ecs_iter_t *it)
Function prototype for runnables (systems, observers).
Definition: flecs.h:378
void(* ecs_ctx_free_t)(void *ctx)
Function to cleanup context data.
Definition: flecs.h:473
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:426
void(* ecs_iter_init_action_t)(const ecs_world_t *world, const ecs_poly_t *iterable, ecs_iter_t *it, ecs_term_t *filter)
Function prototype for creating an iterator from a poly.
Definition: flecs.h:401
void(* ecs_xtor_t)(void *ptr, int32_t count, const ecs_type_info_t *type_info)
Constructor/destructor callback.
Definition: flecs.h:486
void * ecs_emplace_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Emplace a component.
ecs_ref_t ecs_ref_init_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Create a component ref.
void * ecs_record_get_mut_id(ecs_world_t *world, ecs_record_t *record, ecs_id_t id)
Same as ecs_record_get_id, but returns a mutable pointer.
ecs_entity_t ecs_record_get_entity(const ecs_record_t *record)
Get entity corresponding with record.
void ecs_ref_update(const ecs_world_t *world, ecs_ref_t *ref)
Update ref.
void ecs_read_end(const ecs_record_t *record)
End read access to entity.
void ecs_write_end(ecs_record_t *record)
End exclusive write access to entity.
void * ecs_ref_get_id(const ecs_world_t *world, ecs_ref_t *ref, ecs_id_t id)
Get component from ref.
bool ecs_record_has_id(ecs_world_t *world, const ecs_record_t *record, ecs_id_t id)
Test if entity for record has component.
const void * ecs_record_get_id(ecs_world_t *world, const ecs_record_t *record, ecs_id_t id)
Get component from entity record.
ecs_entity_t ecs_set_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, size_t size, const void *ptr)
Set the value of a component.
const void * ecs_get_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Get an immutable pointer to a component.
ecs_record_t * ecs_write_begin(ecs_world_t *world, ecs_entity_t entity)
Begin exclusive write access to entity.
void ecs_modified_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Signal that a component has been modified.
const ecs_record_t * ecs_read_begin(ecs_world_t *world, ecs_entity_t entity)
Begin read access to entity.
void * ecs_get_mut_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Get a mutable pointer to a component.
const ecs_id_t ECS_PAIR
Indicates that the id is a pair.
const ecs_id_t ECS_OVERRIDE
Automatically override component when it is inherited.
const ecs_id_t ECS_AND
Include all components from entity to which AND is applied.
const ecs_id_t ECS_TOGGLE
Adds bitset to storage which allows component to be enabled/disabled.
bool ecs_id_is_union(const ecs_world_t *world, ecs_id_t id)
Return whether represents a union.
bool ecs_id_is_valid(const ecs_world_t *world, ecs_id_t id)
Utility to check if id is valid.
bool ecs_id_is_pair(ecs_id_t id)
Utility to check if id is a pair.
ecs_entity_t ecs_get_typeid(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
bool ecs_id_match(ecs_id_t id, ecs_id_t pattern)
Utility to match an id with a pattern.
const char * ecs_id_flag_str(ecs_id_t id_flags)
Convert id flag to string.
bool ecs_id_in_use(const ecs_world_t *world, ecs_id_t id)
Returns whether specified id is in use.
const ecs_type_info_t * ecs_get_type_info(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
bool ecs_id_is_tag(const ecs_world_t *world, ecs_id_t id)
Returns whether specified id a tag.
void ecs_id_str_buf(const ecs_world_t *world, ecs_id_t id, ecs_strbuf_t *buf)
Write id string to buffer.
char * ecs_id_str(const ecs_world_t *world, ecs_id_t id)
Convert id to string.
bool ecs_id_is_wildcard(ecs_id_t id)
Utility to check if id is a wildcard.
ecs_flags32_t ecs_id_get_flags(const ecs_world_t *world, ecs_id_t id)
Get flags associated with id.
bool ecs_field_is_set(const ecs_iter_t *it, int32_t index)
Test whether field is set.
bool ecs_field_is_writeonly(const ecs_iter_t *it, int32_t index)
Test whether the field is writeonly.
bool ecs_field_is_self(const ecs_iter_t *it, int32_t index)
Test whether the field is matched on self.
void * ecs_field_w_size(const ecs_iter_t *it, size_t size, int32_t index)
Obtain data for a query field.
ecs_iter_t ecs_worker_iter(const ecs_iter_t *it, int32_t index, int32_t count)
Create a worker iterator.
size_t ecs_field_size(const ecs_iter_t *it, int32_t index)
Return field type size.
bool ecs_iter_is_true(ecs_iter_t *it)
Test if iterator is true.
void ecs_iter_fini(ecs_iter_t *it)
Cleanup iterator resources.
char * ecs_iter_str(const ecs_iter_t *it)
Convert iterator to string.
bool ecs_iter_var_is_constrained(ecs_iter_t *it, int32_t var_id)
Returns whether variable is constrained.
ecs_iter_t ecs_page_iter(const ecs_iter_t *it, int32_t offset, int32_t limit)
Create a paged iterator.
void ecs_iter_poly(const ecs_world_t *world, const ecs_poly_t *poly, ecs_iter_t *iter, ecs_term_t *filter)
Create iterator from poly object.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int32_t index)
Return id matched for field.
bool ecs_field_is_readonly(const ecs_iter_t *it, int32_t index)
Test whether the field is readonly.
void ecs_iter_set_var(ecs_iter_t *it, int32_t var_id, ecs_entity_t entity)
Set value for iterator variable.
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 value of iterator variable as entity.
bool ecs_worker_next(ecs_iter_t *it)
Progress a worker iterator.
ecs_entity_t ecs_iter_first(ecs_iter_t *it)
Get first matching entity from iterator.
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 value of iterator variable as table.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int32_t index)
Return field source.
int32_t ecs_iter_count(ecs_iter_t *it)
Count number of matched entities in 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 This constrains the variable to a range of enti...
ecs_table_range_t ecs_iter_get_var_as_range(ecs_iter_t *it, int32_t var_id)
Get value of iterator variable as table range.
int32_t ecs_field_column_index(const ecs_iter_t *it, int32_t index)
Return index of matched table column.
ecs_id_t ecs_strip_generation(ecs_entity_t e)
Remove generation from entity id.
void ecs_ensure(ecs_world_t *world, ecs_entity_t entity)
Ensure id is alive.
bool ecs_is_valid(const ecs_world_t *world, ecs_entity_t e)
Test whether an entity is valid.
void ecs_set_entity_generation(ecs_world_t *world, ecs_entity_t entity)
Override the generation of an entity.
ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)
Get alive identifier.
bool ecs_exists(const ecs_world_t *world, ecs_entity_t entity)
Test whether an entity exists.
void ecs_ensure_id(ecs_world_t *world, ecs_id_t id)
Same as ecs_ensure, but for (component) ids.
bool ecs_is_alive(const ecs_world_t *world, ecs_entity_t e)
Test whether an entity is alive.
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send event.
ecs_entity_t ecs_observer_init(ecs_world_t *world, const ecs_observer_desc_t *desc)
Create observer.
bool ecs_observer_default_run_action(ecs_iter_t *it)
Default run action for observer.
#define FLECS_TERM_DESC_MAX
Maximum number of terms in ecs_filter_desc_t.
Definition: flecs.h:235
#define FLECS_EVENT_DESC_MAX
Maximum number of events in ecs_observer_desc_t.
Definition: flecs.h:239
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition: flecs.h:42
#define FLECS_ID_DESC_MAX
Maximum number of ids to add ecs_entity_desc_t / ecs_bulk_desc_t.
Definition: flecs.h:230
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 entity from path.
ecs_entity_t ecs_lookup(const ecs_world_t *world, const char *name)
Lookup an entity by name.
void ecs_set_alias(ecs_world_t *world, ecs_entity_t entity, const char *alias)
Set alias for entity.
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)
Write path identifier to buffer.
ecs_entity_t ecs_get_scope(const ecs_world_t *world)
Get the current scope.
ecs_entity_t * ecs_set_lookup_path(ecs_world_t *world, const ecs_entity_t *lookup_path)
Set 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.
ecs_entity_t ecs_lookup_symbol(const ecs_world_t *world, const char *symbol, bool lookup_as_path)
Lookup an entity by its symbol name.
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)
Lookup 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)
Lookup 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 specified path to entity.
ecs_entity_t * ecs_get_lookup_path(const ecs_world_t *world)
Get 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.
const ecs_query_group_info_t * ecs_query_get_group_info(const ecs_query_t *query, uint64_t group_id)
Get information about query group.
bool ecs_query_next_instanced(ecs_iter_t *iter)
Same as ecs_query_next, but always instanced.
void ecs_query_fini(ecs_query_t *query)
Destroy a query.
void ecs_query_skip(ecs_iter_t *it)
Skip a table while iterating.
int32_t ecs_query_table_count(const ecs_query_t *query)
Returns number of tables query matched with.
bool ecs_query_next_table(ecs_iter_t *iter)
Fast alternative to ecs_query_next that only returns matched tables.
int32_t ecs_query_entity_count(const ecs_query_t *query)
Returns number of entities query matched with.
char * ecs_query_str(const ecs_query_t *query)
Convert query to string.
ecs_query_t * ecs_query_init(ecs_world_t *world, const ecs_query_desc_t *desc)
Create a query.
void ecs_query_set_group(ecs_iter_t *it, uint64_t group_id)
Set group to iterate for query iterator.
ecs_iter_t ecs_query_iter(const ecs_world_t *world, ecs_query_t *query)
Return a query iterator.
bool ecs_query_next(ecs_iter_t *iter)
Progress the query iterator.
void * ecs_query_get_group_ctx(const ecs_query_t *query, uint64_t group_id)
Get context of query group.
int ecs_query_populate(ecs_iter_t *iter, bool when_changed)
Populate iterator fields.
bool ecs_query_orphaned(const ecs_query_t *query)
Returns whether query is orphaned.
const ecs_filter_t * ecs_query_get_filter(const ecs_query_t *query)
Get filter from a query.
int32_t ecs_query_empty_table_count(const ecs_query_t *query)
Returns number of empty tables query matched with.
bool ecs_query_changed(ecs_query_t *query, const ecs_iter_t *it)
Returns whether the query data changed since the last iteration.
ecs_inout_kind_t
Specify read/write access for term.
Definition: flecs.h:532
ecs_oper_kind_t
Specify operator for term.
Definition: flecs.h:541
ecs_filter_t ECS_FILTER_INIT
Use this variable to initialize user-allocated filter object.
@ EcsOut
Term is only written.
Definition: flecs.h:537
@ EcsInOut
Term is both read and written.
Definition: flecs.h:535
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition: flecs.h:533
@ EcsInOutNone
Term is neither read nor written.
Definition: flecs.h:534
@ EcsIn
Term is only read.
Definition: flecs.h:536
@ EcsNot
The term must not match.
Definition: flecs.h:544
@ EcsOptional
The term may match.
Definition: flecs.h:545
@ EcsOr
One of the terms in an or chain must match.
Definition: flecs.h:543
@ EcsOrFrom
Term must match at least one component from term id.
Definition: flecs.h:547
@ EcsAnd
The term must match.
Definition: flecs.h:542
@ EcsNotFrom
Term must match none of the components from term id.
Definition: flecs.h:548
@ EcsAndFrom
Term must match all components from term id.
Definition: flecs.h:546
int32_t ecs_table_get_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Get column index for id.
ecs_table_t * ecs_table_add_id(ecs_world_t *world, ecs_table_t *table, ecs_id_t id)
Get table that has all components of current table plus the specified id.
int32_t ecs_search(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id, ecs_id_t *id_out)
Search for component id in table type.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get type for table.
int32_t ecs_search_offset(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t id, ecs_id_t *id_out)
Search for component id in table type starting from an offset.
int32_t ecs_table_storage_to_type_index(const ecs_table_t *table, int32_t index)
Convert index in table storage type to index in table type.
int32_t ecs_search_relation(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t id, ecs_entity_t rel, ecs_flags32_t flags, ecs_entity_t *subject_out, ecs_id_t *id_out, struct ecs_table_record_t **tr_out)
Search for component/relationship id in table type starting from an offset.
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) entity to a table.
ecs_table_t * ecs_table_get_storage_table(const ecs_table_t *table)
Get storage type for table.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get column from table.
bool ecs_table_has_id(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Test if table has id.
ecs_table_t * ecs_table_remove_id(ecs_world_t *world, ecs_table_t *table, ecs_id_t id)
Get table that has all components of current table minus the specified id.
int32_t ecs_table_type_to_storage_index(const ecs_table_t *table, int32_t index)
Convert index in table type to index in table storage type.
int32_t ecs_table_count(const ecs_table_t *table)
Returns the number of records in the table.
void ecs_table_unlock(ecs_world_t *world, ecs_table_t *table)
Unlock a table.
bool ecs_table_has_module(ecs_table_t *table)
Returns whether table is a module or contains module contents Returns true for tables that have modul...
int32_t ecs_table_get_depth(const ecs_world_t *world, const ecs_table_t *table, ecs_entity_t rel)
Return depth for table in tree for relationship rel.
void * ecs_table_get_id(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id, int32_t offset)
Get column from table by component id.
void ecs_table_swap_rows(ecs_world_t *world, ecs_table_t *table, int32_t row_1, int32_t row_2)
Swaps two elements inside the table.
void ecs_table_lock(ecs_world_t *world, ecs_table_t *table)
Lock or unlock table.
void * ecs_record_get_column(const ecs_record_t *r, int32_t column, size_t c_size)
Get component pointer from column/record.
ecs_table_t * ecs_table_find(ecs_world_t *world, const ecs_id_t *ids, int32_t id_count)
Find table from id array.
ecs_record_t * ecs_record_find(const ecs_world_t *world, ecs_entity_t entity)
Find record for entity.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get column size from table.
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 value.
int ecs_value_move(const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
Move value.
int ecs_value_move_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
Move 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 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 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, free storage.
int ecs_value_move_ctor(const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
Move construct value.
int ecs_value_init(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Construct a value in existing storage.
void ecs_atfini(ecs_world_t *world, ecs_fini_action_t action, void *ctx)
Register action to be executed when world is destroyed.
bool ecs_is_fini(const ecs_world_t *world)
Returns whether the world is being deleted.
int ecs_fini(ecs_world_t *world)
Delete a world.
ecs_world_t * ecs_mini(void)
Same as ecs_init, but with minimal set of modules loaded.
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.
void ecs_set_target_fps(ecs_world_t *world, float fps)
Set target frames per second (FPS) for 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 action to be executed once after frame.
bool ecs_should_quit(const ecs_world_t *world)
Return whether a quit has been signaled.
void ecs_quit(ecs_world_t *world)
Signal exit This operation signals that the application should quit.
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 entity from poly.
ecs_id_t ecs_make_pair(ecs_entity_t first, ecs_entity_t second)
Make a pair id.
void ecs_set_context(ecs_world_t *world, void *ctx)
Set a world context.
void ecs_run_aperiodic(ecs_world_t *world, ecs_flags32_t flags)
Force aperiodic actions.
void ecs_dim(ecs_world_t *world, int32_t entity_count)
Dimension the world for a specified number of entities.
void ecs_set_entity_range(ecs_world_t *world, ecs_entity_t id_start, ecs_entity_t id_end)
Set a range for issueing new entity ids.
const ecs_world_info_t * ecs_get_world_info(const ecs_world_t *world)
Get world info.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get world from poly.
bool _ecs_poly_is(const ecs_poly_t *object, int32_t type)
Test if pointer is of specified type.
void * ecs_get_context(const ecs_world_t *world)
Get the world context.
int32_t ecs_delete_empty_tables(ecs_world_t *world, ecs_id_t id, uint16_t clear_generation, uint16_t delete_generation, int32_t min_id_count, double time_budget_seconds)
Cleanup empty tables.
bool ecs_enable_range_check(ecs_world_t *world, bool enable)
Enable/disable range limits.
flecs::observer_builder< Components... > observer(Args &&... args) const
Create a new observer.
Operating system abstraction API.
flecs::query< Comps... > query(flecs::query_base &parent, Args &&... args) const
Create a subquery.
Component information.
Definition: flecs.h:1086
ecs_size_t size
Component size.
Definition: flecs.h:1087
ecs_size_t alignment
Component alignment.
Definition: flecs.h:1088
A (string) identifier.
Definition: flecs.h:1077
ecs_size_t length
Length of identifier.
Definition: flecs.h:1079
char * value
Identifier string.
Definition: flecs.h:1078
ecs_hashmap_t * index
Current index.
Definition: flecs.h:1082
uint64_t hash
Hash of current value.
Definition: flecs.h:1080
uint64_t index_hash
Hash of existing record in current index.
Definition: flecs.h:1081
Component for storing a poly object.
Definition: flecs.h:1092
ecs_poly_t * poly
Pointer to poly object.
Definition: flecs.h:1093
Apply a rate filter to a tick source.
Definition: timer.h:45
Target data for flattened relationships.
Definition: flecs.h:1097
Component used to provide a tick source to systems.
Definition: system.h:32
Component used for one shot/interval timer functionality.
Definition: timer.h:35
Used with ecs_bulk_init.
Definition: flecs.h:796
void ** data
Array with component data to insert.
Definition: flecs.h:808
ecs_id_t ids[(32)]
Ids to create the entities with.
Definition: flecs.h:806
int32_t count
Number of entities to create/populate.
Definition: flecs.h:804
ecs_entity_t * entities
Entities to bulk insert.
Definition: flecs.h:799
ecs_table_t * table
Table to insert the entities into.
Definition: flecs.h:815
Used with ecs_component_init.
Definition: flecs.h:826
ecs_type_info_t type
Parameters for type (size, hooks, ...)
Definition: flecs.h:833
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition: flecs.h:830
Used with ecs_entity_init.
Definition: flecs.h:755
const char * sep
Optional custom separator for hierarchical names.
Definition: flecs.h:765
const char * root_sep
Optional, used for identifiers relative to root.
Definition: flecs.h:769
const char * name
Name of the entity.
Definition: flecs.h:760
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:781
ecs_id_t add[(32)]
Array of ids to add to the new or existing entity.
Definition: flecs.h:786
const char * symbol
Optional entity symbol.
Definition: flecs.h:771
const char * add_expr
String expression with components to add.
Definition: flecs.h:789
ecs_entity_t id
Set to modify existing entity (optional)
Definition: flecs.h:758
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
Definition: flecs.h:4295
ecs_table_t * table
The table for which to notify.
Definition: flecs.h:4280
int32_t count
Limit number of notified entities to count.
Definition: flecs.h:4292
ecs_table_t * other_table
Optional 2nd table to notify.
Definition: flecs.h:4284
const void * param
Optional context.
Definition: flecs.h:4298
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
Definition: flecs.h:4287
const ecs_type_t * ids
Component ids.
Definition: flecs.h:4277
ecs_poly_t * observable
Observable (usually the world)
Definition: flecs.h:4301
ecs_entity_t event
The event id.
Definition: flecs.h:4272
ecs_flags32_t flags
Event flags.
Definition: flecs.h:4304
Used with ecs_filter_init.
Definition: flecs.h:840
ecs_term_t * terms_buffer
For filters with lots of terms an outside array can be provided.
Definition: flecs.h:848
bool instanced
When true, terms returned by an iterator may either contain 1 or N elements, where terms with N eleme...
Definition: flecs.h:861
ecs_term_t terms[(16)]
Terms of the filter.
Definition: flecs.h:845
int32_t terms_buffer_count
Number of terms in array provided in terms_buffer.
Definition: flecs.h:851
ecs_entity_t entity
Entity associated with query (optional)
Definition: flecs.h:870
ecs_flags32_t flags
Flags for advanced usage.
Definition: flecs.h:864
ecs_filter_t * storage
External storage to prevent allocation of the filter object.
Definition: flecs.h:854
const char * expr
Filter expression.
Definition: flecs.h:867
Filters alllow for ad-hoc quick filtering of entity tables.
Definition: flecs.h:624
ecs_term_t * terms
Array containing terms for filter.
Definition: flecs.h:627
int32_t * sizes
Field size (same for each result)
Definition: flecs.h:637
bool owned
Is filter object owned by filter.
Definition: flecs.h:631
int32_t field_count
Number of fields in iterator for filter.
Definition: flecs.h:629
int32_t term_count
Number of elements in terms array.
Definition: flecs.h:628
ecs_flags32_t flags
Filter flags.
Definition: flecs.h:634
bool terms_owned
Is terms array owned by filter.
Definition: flecs.h:632
ecs_world_t * world
World mixin.
Definition: flecs.h:643
char * variable_names[1]
Placeholder variable names array.
Definition: flecs.h:636
ecs_poly_dtor_t dtor
Dtor mixin.
Definition: flecs.h:642
ecs_entity_t entity
Entity associated with filter (optional)
Definition: flecs.h:640
ecs_iterable_t iterable
Iterable mixin.
Definition: flecs.h:641
Header for ecs_poly_t objects.
Definition: flecs.h:355
Iterable mixin.
Definition: flecs.h:519
ecs_iter_init_action_t init
Callback that creates iterator.
Definition: flecs.h:520
Used with ecs_observer_init.
Definition: flecs.h:934
void * binding_ctx
Context to be used for language bindings.
Definition: flecs.h:966
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition: flecs.h:969
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition: flecs.h:938
ecs_filter_desc_t filter
Filter for observer.
Definition: flecs.h:941
int32_t term_index
Used for internal purposes.
Definition: flecs.h:982
ecs_entity_t events[(8)]
Events to observe (OnAdd, OnRemove, OnSet, UnSet)
Definition: flecs.h:944
int32_t * last_event_id
Optional shared last event id for multiple observers.
Definition: flecs.h:979
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition: flecs.h:972
void * ctx
User context to pass to callback.
Definition: flecs.h:963
ecs_poly_t * observable
Observable with which to register the observer.
Definition: flecs.h:975
ecs_iter_action_t callback
Callback to invoke on an event, invoked when the observer matches.
Definition: flecs.h:952
bool yield_existing
When observer is created, generate events from existing data.
Definition: flecs.h:949
ecs_run_action_t run
Callback invoked on an event.
Definition: flecs.h:960
ecs_iter_action_t callback
See ecs_observer_desc_t::callback.
Definition: flecs.h:656
int32_t term_index
Index of the term in parent observer (single term observers only)
Definition: flecs.h:671
ecs_observable_t * observable
Observable for observer.
Definition: flecs.h:665
ecs_run_action_t run
See ecs_observer_desc_t::run.
Definition: flecs.h:657
int32_t * last_event_id
Last handled event id.
Definition: flecs.h:667
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition: flecs.h:662
ecs_filter_t filter
Query for observer.
Definition: flecs.h:650
void * ctx
Callback context.
Definition: flecs.h:659
ecs_id_t register_id
Id observer is registered with (single term observers only)
Definition: flecs.h:670
void * binding_ctx
Binding context (for language bindings)
Definition: flecs.h:660
bool is_monitor
If true, the observer only triggers when the filter did not match with the entity before the event ha...
Definition: flecs.h:673
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition: flecs.h:663
bool is_multi
If true, the observer triggers on more than one term.
Definition: flecs.h:677
Used with ecs_query_init.
Definition: flecs.h:877
ecs_order_by_action_t order_by
Callback used for ordering query results.
Definition: flecs.h:889
ecs_id_t group_by_id
Id to be used by group_by.
Definition: flecs.h:898
ecs_group_by_action_t group_by
Callback used for grouping results.
Definition: flecs.h:905
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
Definition: flecs.h:919
void * group_by_ctx
Context to pass to group_by.
Definition: flecs.h:916
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
Definition: flecs.h:909
ecs_query_t * parent
If set, the query will be created as a subquery.
Definition: flecs.h:927
ecs_entity_t order_by_component
Component to be used by order_by.
Definition: flecs.h:884
ecs_filter_desc_t filter
Filter for the query.
Definition: flecs.h:881
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Definition: flecs.h:913
ecs_sort_table_action_t sort_table
Callback used for ordering query results.
Definition: flecs.h:893
Type that contains information about a query group.
Definition: flecs.h:1062
int32_t table_count
Number of tables in group.
Definition: flecs.h:1064
void * ctx
Group context, returned by on_group_create.
Definition: flecs.h:1065
int32_t match_count
How often tables have been matched/unmatched.
Definition: flecs.h:1063
Type that describes a single identifier in a term.
Definition: flecs.h:574
ecs_flags32_t flags
Term flags.
Definition: flecs.h:592
ecs_entity_t trav
Relationship to traverse when looking for the component.
Definition: flecs.h:588
char * name
Name.
Definition: flecs.h:581
ecs_entity_t id
Entity id.
Definition: flecs.h:575
Type that describes a term (single element in a query)
Definition: flecs.h:596
ecs_term_id_t second
Second element of pair.
Definition: flecs.h:604
ecs_id_t id
Component id to be matched by term.
Definition: flecs.h:597
char * name
Name of term.
Definition: flecs.h:610
ecs_term_id_t src
Source of term.
Definition: flecs.h:602
ecs_id_record_t * idr
Cached pointer to internal index.
Definition: flecs.h:613
ecs_term_id_t first
Component or first element of pair.
Definition: flecs.h:603
int32_t field_index
Index of field for term in iterator.
Definition: flecs.h:612
ecs_id_t id_flags
Id flags of term id.
Definition: flecs.h:609
bool move
Used by internals.
Definition: flecs.h:617
ecs_flags16_t flags
Flags that help eval, set by ecs_filter_init.
Definition: flecs.h:615
ecs_inout_kind_t inout
Access to contents matched by term.
Definition: flecs.h:606
ecs_oper_kind_t oper
Operator of term.
Definition: flecs.h:607
Type that contains component lifecycle callbacks.
Definition: flecs.h:689
ecs_copy_t copy_ctor
Ctor + copy.
Definition: flecs.h:696
void * ctx
User defined context.
Definition: flecs.h:727
ecs_iter_action_t on_remove
Callback that is invoked when an instance of the component is removed.
Definition: flecs.h:725
void * binding_ctx
Language binding context.
Definition: flecs.h:728
ecs_move_t move_dtor
Move + dtor.
Definition: flecs.h:711
ecs_copy_t copy
copy assignment
Definition: flecs.h:692
ecs_iter_action_t on_set
Callback that is invoked when an instance of the component is set.
Definition: flecs.h:720
ecs_move_t move
move assignment
Definition: flecs.h:693
ecs_xtor_t ctor
ctor
Definition: flecs.h:690
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition: flecs.h:730
ecs_iter_action_t on_add
Callback that is invoked when an instance of a component is added.
Definition: flecs.h:715
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition: flecs.h:731
ecs_move_t move_ctor
Ctor + move.
Definition: flecs.h:699
ecs_move_t ctor_move_dtor
Ctor + move + dtor (or move_ctor + dtor).
Definition: flecs.h:705
ecs_xtor_t dtor
dtor
Definition: flecs.h:691
Type that contains component information (passed to ctors/dtors/...)
Definition: flecs.h:738
ecs_size_t alignment
Alignment of type.
Definition: flecs.h:740
ecs_size_t size
Size of type.
Definition: flecs.h:739
const char * name
Type name.
Definition: flecs.h:743
ecs_entity_t component
Handle to component (do not set)
Definition: flecs.h:742
ecs_type_hooks_t hooks
Type hooks.
Definition: flecs.h:741
An array with (component) ids.
Definition: flecs.h:280
Type that contains information about the world.
Definition: flecs.h:998
int64_t get_mut_count
get_mut/emplace commands processed
Definition: flecs.h:1047
float delta_time
Time passed to or computed by ecs_progress.
Definition: flecs.h:1004
int32_t id_count
Number of ids in the world (excluding wildcards)
Definition: flecs.h:1027
ecs_entity_t min_id
First allowed entity id.
Definition: flecs.h:1000
int32_t trivial_table_count
Number of tables with trivial components (no lifecycle callbacks)
Definition: flecs.h:1035
int64_t set_count
set commands processed
Definition: flecs.h:1046
float world_time_total
Time elapsed in simulation.
Definition: flecs.h:1011
int32_t tag_id_count
Number of tag (no data) ids in the world.
Definition: flecs.h:1028
int32_t tag_table_count
Number of tag-only tables.
Definition: flecs.h:1034
int32_t component_id_count
Number of component (data) ids in the world.
Definition: flecs.h:1029
int32_t table_record_count
Total number of table records (entries in table caches)
Definition: flecs.h:1037
int64_t pipeline_build_count_total
Total number of pipeline builds.
Definition: flecs.h:1023
int32_t table_count
Number of tables.
Definition: flecs.h:1033
float delta_time_raw
Raw delta time (no time scaling)
Definition: flecs.h:1003
float frame_time_total
Total time spent processing a frame.
Definition: flecs.h:1007
float world_time_total_raw
Time elapsed in simulation (no scaling)
Definition: flecs.h:1012
int64_t table_create_total
Total number of times a table was created.
Definition: flecs.h:1021
int64_t observers_ran_frame
Total number of times observer was invoked.
Definition: flecs.h:1025
float system_time_total
Total time spent in systems.
Definition: flecs.h:1008
int64_t id_delete_total
Total number of times an id was deleted.
Definition: flecs.h:1020
int64_t systems_ran_frame
Total number of systems ran in last frame.
Definition: flecs.h:1024
float merge_time_total
Total time spent in merges.
Definition: flecs.h:1010
int64_t discard_count
commands discarded, happens when entity is no longer alive when running the command
Definition: flecs.h:1050
int64_t clear_count
clear commands processed
Definition: flecs.h:1045
ecs_entity_t last_component_id
Last issued component entity id.
Definition: flecs.h:999
int32_t empty_table_count
Number of tables without entities.
Definition: flecs.h:1036
int64_t frame_count_total
Total number of frames.
Definition: flecs.h:1015
ecs_entity_t max_id
Last allowed entity id.
Definition: flecs.h:1001
int64_t merge_count_total
Total number of merges.
Definition: flecs.h:1016
int64_t other_count
other commands processed
Definition: flecs.h:1049
int64_t batched_command_count
commands batched
Definition: flecs.h:1052
int64_t table_delete_total
Total number of times a table was deleted.
Definition: flecs.h:1022
int64_t delete_count
delete commands processed
Definition: flecs.h:1044
int64_t rematch_count_total
Total number of rematches.
Definition: flecs.h:1017
int64_t id_create_total
Total number of times a new id was created.
Definition: flecs.h:1019
int64_t batched_entity_count
entities for which commands were batched
Definition: flecs.h:1051
float time_scale
Time scale applied to delta_time.
Definition: flecs.h:1005
int32_t pair_id_count
Number of pair ids in the world.
Definition: flecs.h:1030
float rematch_time_total
Time spent on query rematching.
Definition: flecs.h:1013
float target_fps
Target fps.
Definition: flecs.h:1006
int32_t wildcard_id_count
Number of wildcard ids.
Definition: flecs.h:1031
int32_t table_storage_count
Total number of table storages.
Definition: flecs.h:1038
float emit_time_total
Total time spent notifying observers.
Definition: flecs.h:1009
int64_t modified_count
modified commands processed
Definition: flecs.h:1048
const char * name_prefix
Value set by ecs_set_name_prefix.
Definition: flecs.h:1055
int64_t add_count
add commands processed
Definition: flecs.h:1042
int64_t remove_count
remove commands processed
Definition: flecs.h:1043
flecs::term term() const
Create a term for a (component) type.