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_USE_OS_ALLOC
179#endif
180
191#ifndef FLECS_HI_COMPONENT_ID
192#define FLECS_HI_COMPONENT_ID (256)
193#endif
194
201#ifndef FLECS_HI_ID_RECORD_ID
202#define FLECS_HI_ID_RECORD_ID (1024)
203#endif
204
210#ifndef FLECS_SPARSE_PAGE_BITS
211#define FLECS_SPARSE_PAGE_BITS (12)
212#endif
213
218// #define FLECS_USE_OS_ALLOC
219
222#ifndef ECS_ID_CACHE_SIZE
223#define ECS_ID_CACHE_SIZE (32)
224#endif
225
228#define ECS_TERM_DESC_CACHE_SIZE (16)
229
232#define ECS_OBSERVER_DESC_EVENT_COUNT_MAX (8)
233
236#define ECS_VARIABLE_COUNT_MAX (64)
237
240#include "flecs/private/api_defines.h"
241#include "flecs/private/vec.h" /* Vector datatype */
242#include "flecs/private/sparse.h" /* Sparse set */
243#include "flecs/private/block_allocator.h" /* Block allocator */
244#include "flecs/private/map.h" /* Map */
245#include "flecs/private/allocator.h" /* Allocator */
246#include "flecs/private/strbuf.h" /* String builder */
247#include "flecs/os_api.h" /* Abstraction for operating system functions */
248
249#ifdef __cplusplus
250extern "C" {
251#endif
252
267typedef uint64_t ecs_id_t;
268
271
273typedef struct {
274 ecs_id_t *array;
275 int32_t count;
276} ecs_type_t;
277
280
283
285typedef struct ecs_term_t ecs_term_t;
286
289
292
294typedef struct ecs_rule_t ecs_rule_t;
295
298
301
302/* An iterator lets an application iterate entities across tables. */
303typedef struct ecs_iter_t ecs_iter_t;
304
306typedef struct ecs_ref_t ecs_ref_t;
307
310
313
314/* Internal index that stores tables tables for a (component) id */
315typedef struct ecs_id_record_t ecs_id_record_t;
316
317/* Internal table storage record */
318typedef struct ecs_table_record_t ecs_table_record_t;
319
342typedef void ecs_poly_t;
343
346
348typedef struct ecs_header_t {
349 int32_t magic; /* Magic number verifying it's a flecs object */
350 int32_t type; /* Magic number indicating which type of flecs object */
351 ecs_mixins_t *mixins; /* Table with offsets to (optional) mixins */
353
371typedef void (*ecs_run_action_t)(
372 ecs_iter_t *it);
373
380typedef void (*ecs_iter_action_t)(
381 ecs_iter_t *it);
382
395 const ecs_world_t *world,
396 const ecs_poly_t *iterable,
397 ecs_iter_t *it,
398 ecs_term_t *filter);
399
408 ecs_iter_t *it);
409
416 ecs_iter_t *it);
417
420 ecs_entity_t e1,
421 const void *ptr1,
422 ecs_entity_t e2,
423 const void *ptr2);
424
427 ecs_world_t* world,
428 ecs_table_t* table,
429 ecs_entity_t* entities,
430 void* ptr,
431 int32_t size,
432 int32_t lo,
433 int32_t hi,
434 ecs_order_by_action_t order_by);
435
437typedef uint64_t (*ecs_group_by_action_t)(
438 ecs_world_t *world,
439 ecs_table_t *table,
440 ecs_id_t group_id,
441 void *ctx);
442
443/* Callback invoked when a query creates a new group. */
444typedef void* (*ecs_group_create_action_t)(
445 ecs_world_t *world,
446 uint64_t group_id,
447 void *group_by_ctx); /* from ecs_query_desc_t */
448
449/* Callback invoked when a query deletes an existing group. */
450typedef void (*ecs_group_delete_action_t)(
451 ecs_world_t *world,
452 uint64_t group_id,
453 void *group_ctx, /* return value from ecs_group_create_action_t */
454 void *group_by_ctx); /* from ecs_query_desc_t */
455
457typedef void (*ecs_module_action_t)(
458 ecs_world_t *world);
459
461typedef void (*ecs_fini_action_t)(
462 ecs_world_t *world,
463 void *ctx);
464
466typedef void (*ecs_ctx_free_t)(
467 void *ctx);
468
470typedef int (*ecs_compare_action_t)(
471 const void *ptr1,
472 const void *ptr2);
473
475typedef uint64_t (*ecs_hash_value_action_t)(
476 const void *ptr);
477
479typedef void (*ecs_xtor_t)(
480 void *ptr,
481 int32_t count,
482 const ecs_type_info_t *type_info);
483
485typedef void (*ecs_copy_t)(
486 void *dst_ptr,
487 const void *src_ptr,
488 int32_t count,
489 const ecs_type_info_t *type_info);
490
492typedef void (*ecs_move_t)(
493 void *dst_ptr,
494 void *src_ptr,
495 int32_t count,
496 const ecs_type_info_t *type_info);
497
498/* Destructor function for poly objects */
499typedef void (*ecs_poly_dtor_t)(
500 ecs_poly_t *poly);
501
512typedef struct ecs_iterable_t {
515
525typedef enum ecs_inout_kind_t {
532
534typedef enum ecs_oper_kind_t {
543
544/* Term id flags */
545#define EcsSelf (1u << 1)
546#define EcsUp (1u << 2)
547#define EcsDown (1u << 3)
548#define EcsTraverseAll (1u << 4)
549#define EcsCascade (1u << 5)
550#define EcsParent (1u << 6)
551#define EcsIsVariable (1u << 7)
552#define EcsIsEntity (1u << 8)
553#define EcsIsName (1u << 9)
554#define EcsFilter (1u << 10)
555#define EcsTraverseFlags (EcsUp|EcsDown|EcsTraverseAll|EcsSelf|EcsCascade|EcsParent)
556
557/* Term flags discovered & set during filter creation. */
558#define EcsTermMatchAny (1 << 0)
559#define EcsTermMatchAnySrc (1 << 1)
560#define EcsTermSrcFirstEq (1 << 2)
561#define EcsTermSrcSecondEq (1 << 3)
562#define EcsTermTransitive (1 << 4)
563#define EcsTermReflexive (1 << 5)
564#define EcsTermIdInherited (1 << 6)
565
567typedef struct ecs_term_id_t {
574 char *name;
585 ecs_flags32_t flags;
587
603 char *name;
605 int32_t field_index;
606 ecs_id_record_t *idr;
608 ecs_flags16_t flags;
610 bool move;
611};
612
614FLECS_API extern ecs_filter_t ECS_FILTER_INIT;
615
618 ecs_header_t hdr;
619
621 int32_t term_count;
622 int32_t field_count;
624 bool owned;
627 ecs_flags32_t flags;
629 char *variable_names[1];
630 int32_t *sizes;
632 /* Mixins */
635 ecs_poly_dtor_t dtor;
637};
638
639/* An observer reacts to events matching a filter */
641 ecs_header_t hdr;
642
645 /* Observer events */
647 int32_t event_count;
648
652 void *ctx;
660 int32_t *last_event_id;
661 int32_t last_event_id_storage;
662
664 int32_t term_index;
670 bool is_multi;
672 /* Mixins */
673 ecs_poly_dtor_t dtor;
674};
675
690
693
699
705
709
714
719
720 void *ctx;
725};
726
732 ecs_size_t size;
733 ecs_size_t alignment;
736 const char *name;
737};
738
739#include "flecs/private/api_types.h" /* Supporting API types */
740#include "flecs/private/api_support.h" /* Supporting API functions */
741#include "flecs/private/vec.h" /* Vector */
742#include "flecs/private/hashmap.h" /* Hashmap */
743
748typedef struct ecs_entity_desc_t {
749 int32_t _canary;
750
753 const char *name;
758 const char *sep;
762 const char *root_sep;
764 const char *symbol;
780
782 const char *add_expr;
784
789typedef struct ecs_bulk_desc_t {
790 int32_t _canary;
791
797 int32_t count;
801 void **data;
814
819typedef struct ecs_component_desc_t {
820 int32_t _canary;
821
824
828
833typedef struct ecs_filter_desc_t {
834 int32_t _canary;
835
839
842
845
848
855
857 ecs_flags32_t flags;
858
860 const char *expr;
861
865
870typedef struct ecs_query_desc_t {
871 int32_t _canary;
872
875
878
883
887
892
899
902 ecs_group_create_action_t on_group_create;
903
906 ecs_group_delete_action_t on_group_delete;
907
910
913
922
927typedef struct ecs_observer_desc_t {
928 int32_t _canary;
929
932
935
938
943
946
954
956 void *ctx;
957
960
963
966
969
973
975 int32_t term_index;
977
984/* Utility to hold a value of a dynamic type */
985typedef struct ecs_value_t {
986 ecs_entity_t type;
987 void *ptr;
989
991typedef struct ecs_world_info_t {
1021 int32_t id_count;
1027 int32_t table_count;
1034 /* -- Command counts -- */
1035 struct {
1036 int64_t add_count;
1039 int64_t clear_count;
1040 int64_t set_count;
1043 int64_t other_count;
1047 } cmd;
1048
1049 const char *name_prefix;
1054
1057 int32_t match_count;
1058 int32_t table_count;
1059 void *ctx;
1061
1071typedef struct EcsIdentifier {
1072 char *value;
1073 ecs_size_t length;
1074 uint64_t hash;
1075 uint64_t index_hash;
1076 ecs_hashmap_t *index;
1078
1080typedef struct EcsComponent {
1081 ecs_size_t size;
1082 ecs_size_t alignment;
1084
1086typedef struct EcsPoly {
1089
1091typedef struct EcsTarget {
1092 int32_t count;
1093 ecs_record_t *target;
1095
1098
1102/* Only include deprecated definitions if deprecated addon is required */
1103#ifdef FLECS_DEPRECATED
1105#endif
1106
1120#define ECS_ID_FLAG_BIT (1ull << 63)
1121
1123FLECS_API extern const ecs_id_t ECS_PAIR;
1124
1126FLECS_API extern const ecs_id_t ECS_OVERRIDE;
1127
1129FLECS_API extern const ecs_id_t ECS_TOGGLE;
1130
1132FLECS_API extern const ecs_id_t ECS_AND;
1133
1141/* Builtin component ids */
1142FLECS_API extern const ecs_entity_t ecs_id(EcsComponent);
1143FLECS_API extern const ecs_entity_t ecs_id(EcsIdentifier);
1144FLECS_API extern const ecs_entity_t ecs_id(EcsIterable);
1145FLECS_API extern const ecs_entity_t ecs_id(EcsPoly);
1146
1147FLECS_API extern const ecs_entity_t EcsQuery;
1148FLECS_API extern const ecs_entity_t EcsObserver;
1149
1150/* System module component ids */
1151FLECS_API extern const ecs_entity_t EcsSystem;
1152FLECS_API extern const ecs_entity_t ecs_id(EcsTickSource);
1153
1154/* Pipeline module component ids */
1155FLECS_API extern const ecs_entity_t ecs_id(EcsPipelineQuery);
1156
1157/* Timer module component ids */
1158FLECS_API extern const ecs_entity_t ecs_id(EcsTimer);
1159FLECS_API extern const ecs_entity_t ecs_id(EcsRateFilter);
1160
1162FLECS_API extern const ecs_entity_t EcsFlecs;
1163
1165FLECS_API extern const ecs_entity_t EcsFlecsCore;
1166
1168FLECS_API extern const ecs_entity_t EcsWorld;
1169
1171FLECS_API extern const ecs_entity_t EcsWildcard;
1172
1174FLECS_API extern const ecs_entity_t EcsAny;
1175
1177FLECS_API extern const ecs_entity_t EcsThis;
1178
1180FLECS_API extern const ecs_entity_t EcsVariable;
1181
1186FLECS_API extern const ecs_entity_t EcsTransitive;
1187
1192FLECS_API extern const ecs_entity_t EcsReflexive;
1193
1201FLECS_API extern const ecs_entity_t EcsFinal;
1202
1208FLECS_API extern const ecs_entity_t EcsDontInherit;
1209
1215FLECS_API extern const ecs_entity_t EcsAlwaysOverride;
1216
1221FLECS_API extern const ecs_entity_t EcsSymmetric;
1222
1229FLECS_API extern const ecs_entity_t EcsExclusive;
1230
1232FLECS_API extern const ecs_entity_t EcsAcyclic;
1233
1236FLECS_API extern const ecs_entity_t EcsTraversable;
1237
1244FLECS_API extern const ecs_entity_t EcsWith;
1245
1252FLECS_API extern const ecs_entity_t EcsOneOf;
1253
1256FLECS_API extern const ecs_entity_t EcsTag;
1257
1261FLECS_API extern const ecs_entity_t EcsUnion;
1262
1264FLECS_API extern const ecs_entity_t EcsName;
1265
1267FLECS_API extern const ecs_entity_t EcsSymbol;
1268
1270FLECS_API extern const ecs_entity_t EcsAlias;
1271
1273FLECS_API extern const ecs_entity_t EcsChildOf;
1274
1276FLECS_API extern const ecs_entity_t EcsIsA;
1277
1279FLECS_API extern const ecs_entity_t EcsDependsOn;
1280
1282FLECS_API extern const ecs_entity_t EcsSlotOf;
1283
1285FLECS_API extern const ecs_entity_t EcsModule;
1286
1288FLECS_API extern const ecs_entity_t EcsPrivate;
1289
1292FLECS_API extern const ecs_entity_t EcsPrefab;
1293
1295FLECS_API extern const ecs_entity_t EcsDisabled;
1296
1298FLECS_API extern const ecs_entity_t EcsOnAdd;
1299
1301FLECS_API extern const ecs_entity_t EcsOnRemove;
1302
1304FLECS_API extern const ecs_entity_t EcsOnSet;
1305
1307FLECS_API extern const ecs_entity_t EcsUnSet;
1308
1310FLECS_API extern const ecs_entity_t EcsMonitor;
1311
1316FLECS_API extern const ecs_entity_t EcsOnDelete;
1317
1319FLECS_API extern const ecs_entity_t EcsOnTableCreate;
1320
1322FLECS_API extern const ecs_entity_t EcsOnTableDelete;
1323
1325FLECS_API extern const ecs_entity_t EcsOnTableEmpty;
1326
1328FLECS_API extern const ecs_entity_t EcsOnTableFill;
1329
1334FLECS_API extern const ecs_entity_t EcsOnDeleteTarget;
1335
1338FLECS_API extern const ecs_entity_t EcsRemove;
1339
1342FLECS_API extern const ecs_entity_t EcsDelete;
1343
1346FLECS_API extern const ecs_entity_t EcsPanic;
1347
1348FLECS_API extern const ecs_entity_t ecs_id(EcsTarget);
1349FLECS_API extern const ecs_entity_t EcsFlatten;
1350
1356FLECS_API extern const ecs_entity_t EcsDefaultChildComponent;
1357
1358/* Builtin predicates for comparing entity ids in queries. Only supported by rules */
1359FLECS_API extern const ecs_entity_t EcsPredEq;
1360FLECS_API extern const ecs_entity_t EcsPredMatch;
1361FLECS_API extern const ecs_entity_t EcsPredLookup;
1362
1364FLECS_API extern const ecs_entity_t EcsEmpty;
1365
1366/* Pipeline module tags */
1367FLECS_API extern const ecs_entity_t ecs_id(EcsPipeline);
1368FLECS_API extern const ecs_entity_t EcsOnStart;
1369FLECS_API extern const ecs_entity_t EcsPreFrame;
1370FLECS_API extern const ecs_entity_t EcsOnLoad;
1371FLECS_API extern const ecs_entity_t EcsPostLoad;
1372FLECS_API extern const ecs_entity_t EcsPreUpdate;
1373FLECS_API extern const ecs_entity_t EcsOnUpdate;
1374FLECS_API extern const ecs_entity_t EcsOnValidate;
1375FLECS_API extern const ecs_entity_t EcsPostUpdate;
1376FLECS_API extern const ecs_entity_t EcsPreStore;
1377FLECS_API extern const ecs_entity_t EcsOnStore;
1378FLECS_API extern const ecs_entity_t EcsPostFrame;
1379FLECS_API extern const ecs_entity_t EcsPhase;
1380
1383#define EcsLastInternalComponentId (ecs_id(EcsPoly))
1384
1387#define EcsFirstUserComponentId (8)
1388
1391#define EcsFirstUserEntityId (FLECS_HI_COMPONENT_ID + 128)
1392
1416FLECS_API
1418
1423FLECS_API
1425
1433FLECS_API
1435 int argc,
1436 char *argv[]);
1437
1444FLECS_API
1446 ecs_world_t *world);
1447
1453FLECS_API
1455 const ecs_world_t *world);
1456
1464FLECS_API
1466 ecs_world_t *world,
1467 ecs_fini_action_t action,
1468 void *ctx);
1469
1495FLECS_API
1497 ecs_world_t *world,
1498 ecs_ftime_t delta_time);
1499
1506FLECS_API
1508 ecs_world_t *world);
1509
1517FLECS_API
1519 ecs_world_t *world,
1520 ecs_fini_action_t action,
1521 void *ctx);
1522
1529FLECS_API
1531 ecs_world_t *world);
1532
1537FLECS_API
1539 const ecs_world_t *world);
1540
1553 ecs_world_t *world,
1554 bool enable);
1555
1567 ecs_world_t *world,
1568 bool enable);
1569
1585FLECS_API
1587 ecs_world_t *world,
1588 ecs_ftime_t fps);
1589
1626FLECS_API
1628 ecs_world_t *world);
1629
1637FLECS_API
1639 ecs_world_t *world);
1640
1651FLECS_API
1653 ecs_world_t *world);
1654
1664FLECS_API
1666 ecs_world_t *world);
1667
1673FLECS_API
1675 const ecs_world_t *world);
1676
1685FLECS_API
1687 ecs_world_t *world);
1688
1698FLECS_API
1700 ecs_world_t *world);
1701
1707FLECS_API
1709 ecs_world_t *world);
1710
1727FLECS_API
1729 ecs_world_t *world,
1730 bool automerge);
1731
1745FLECS_API
1747 ecs_world_t *world,
1748 int32_t stages);
1749
1756FLECS_API
1758 const ecs_world_t *world);
1759
1767FLECS_API
1769 const ecs_world_t *world);
1770
1786FLECS_API
1788 const ecs_world_t *world,
1789 int32_t stage_id);
1790
1798FLECS_API
1800 const ecs_world_t *world);
1801
1820FLECS_API
1822 ecs_world_t *world);
1823
1830FLECS_API
1832 ecs_world_t *stage);
1833
1840FLECS_API
1842 ecs_world_t *stage);
1843
1858FLECS_API
1860 ecs_world_t *world,
1861 void *ctx);
1862
1870FLECS_API
1872 const ecs_world_t *world);
1873
1880FLECS_API
1882 const ecs_world_t *world);
1883
1892FLECS_API
1894 ecs_world_t *world,
1895 int32_t entity_count);
1896
1912FLECS_API
1914 ecs_world_t *world,
1915 ecs_entity_t id_start,
1916 ecs_entity_t id_end);
1917
1928FLECS_API
1930 ecs_world_t *world,
1931 bool enable);
1932
1946FLECS_API
1948 ecs_world_t *world,
1949 ecs_flags32_t flags);
1950
1984FLECS_API
1986 ecs_world_t *world,
1987 ecs_id_t id,
1988 uint16_t clear_generation,
1989 uint16_t delete_generation,
1990 int32_t min_id_count,
1991 double time_budget_seconds);
1992
1998FLECS_API
2000 const ecs_poly_t *poly);
2001
2007FLECS_API
2009 const ecs_poly_t *poly);
2010
2021FLECS_API
2023 const ecs_poly_t *object,
2024 int32_t type);
2025
2026#define ecs_poly_is(object, type)\
2027 _ecs_poly_is(object, type##_magic)
2028
2036FLECS_API
2038 ecs_entity_t first,
2039 ecs_entity_t second);
2040
2065FLECS_API
2067 ecs_world_t *world);
2068
2086FLECS_API
2088 ecs_world_t *world);
2089
2098FLECS_API
2100 ecs_world_t *world,
2101 ecs_id_t id);
2102
2110FLECS_API
2112 ecs_world_t *world,
2113 ecs_table_t *table);
2114
2133FLECS_API
2135 ecs_world_t *world,
2136 const ecs_entity_desc_t *desc);
2137
2164FLECS_API
2166 ecs_world_t *world,
2167 const ecs_bulk_desc_t *desc);
2168
2178FLECS_API
2180 ecs_world_t *world,
2181 ecs_id_t id,
2182 int32_t count);
2183
2195FLECS_API
2197 ecs_world_t *world,
2198 ecs_entity_t dst,
2199 ecs_entity_t src,
2200 bool copy_value);
2201
2211FLECS_API
2213 ecs_world_t *world,
2214 ecs_entity_t entity);
2215
2223FLECS_API
2225 ecs_world_t *world,
2226 ecs_id_t id);
2227
2244FLECS_API
2246 ecs_world_t *world,
2247 ecs_entity_t entity,
2248 ecs_id_t id);
2249
2258FLECS_API
2260 ecs_world_t *world,
2261 ecs_entity_t entity,
2262 ecs_id_t id);
2263
2286FLECS_API
2288 ecs_world_t *world,
2289 ecs_entity_t entity,
2290 ecs_id_t id);
2291
2300FLECS_API
2302 ecs_world_t *world,
2303 ecs_entity_t entity);
2304
2305
2313FLECS_API
2315 ecs_world_t *world,
2316 ecs_id_t id);
2317
2325FLECS_API
2327 ecs_world_t *world,
2328 ecs_id_t id);
2329
2336FLECS_API
2338 const ecs_world_t *world);
2339
2357FLECS_API
2359 ecs_world_t *world,
2360 ecs_entity_t entity,
2361 bool enabled);
2362
2376FLECS_API
2378 ecs_world_t *world,
2379 ecs_entity_t entity,
2380 ecs_id_t id,
2381 bool enable);
2382
2393FLECS_API
2395 const ecs_world_t *world,
2396 ecs_entity_t entity,
2397 ecs_id_t id);
2398
2416FLECS_API
2417const void* ecs_get_id(
2418 const ecs_world_t *world,
2419 ecs_entity_t entity,
2420 ecs_id_t id);
2421
2432FLECS_API
2434 const ecs_world_t *world,
2435 ecs_entity_t entity,
2436 ecs_id_t id);
2437
2446FLECS_API
2448 const ecs_world_t *world,
2449 ecs_ref_t *ref,
2450 ecs_id_t id);
2451
2459FLECS_API
2461 const ecs_world_t *world,
2462 ecs_ref_t *ref);
2463
2478FLECS_API
2480 ecs_world_t *world,
2481 ecs_entity_t entity,
2482 ecs_id_t id);
2483
2502FLECS_API
2503ecs_record_t* ecs_write_begin(
2504 ecs_world_t *world,
2505 ecs_entity_t entity);
2506
2513FLECS_API
2515 ecs_record_t *record);
2516
2536FLECS_API
2537const ecs_record_t* ecs_read_begin(
2538 ecs_world_t *world,
2539 ecs_entity_t entity);
2540
2546FLECS_API
2548 const ecs_record_t *record);
2549
2555FLECS_API
2557 const ecs_record_t *record);
2558
2572FLECS_API
2574 ecs_world_t *world,
2575 const ecs_record_t *record,
2576 ecs_id_t id);
2577
2586FLECS_API
2588 ecs_world_t *world,
2589 ecs_record_t *record,
2590 ecs_id_t id);
2591
2598FLECS_API
2600 ecs_world_t *world,
2601 const ecs_record_t *record,
2602 ecs_id_t id);
2603
2617FLECS_API
2619 ecs_world_t *world,
2620 ecs_entity_t entity,
2621 ecs_id_t id);
2622
2633FLECS_API
2635 ecs_world_t *world,
2636 ecs_entity_t entity,
2637 ecs_id_t id);
2638
2652FLECS_API
2654 ecs_world_t *world,
2655 ecs_entity_t entity,
2656 ecs_id_t id,
2657 size_t size,
2658 const void *ptr);
2659
2686FLECS_API
2688 const ecs_world_t *world,
2689 ecs_entity_t e);
2690
2699FLECS_API
2701 const ecs_world_t *world,
2702 ecs_entity_t e);
2703
2709FLECS_API
2711 ecs_entity_t e);
2712
2724FLECS_API
2726 ecs_world_t *world,
2727 ecs_entity_t entity);
2728
2745FLECS_API
2747 const ecs_world_t *world,
2748 ecs_entity_t e);
2749
2770FLECS_API
2772 ecs_world_t *world,
2773 ecs_entity_t entity);
2774
2793FLECS_API
2795 ecs_world_t *world,
2796 ecs_id_t id);
2797
2805FLECS_API
2807 const ecs_world_t *world,
2808 ecs_entity_t entity);
2809
2824FLECS_API
2826 const ecs_world_t *world,
2827 ecs_entity_t entity);
2828
2835FLECS_API
2837 const ecs_world_t *world,
2838 ecs_entity_t entity);
2839
2847FLECS_API
2849 const ecs_world_t *world,
2850 const ecs_type_t* type);
2851
2860FLECS_API
2862 const ecs_world_t *world,
2863 const ecs_table_t *table);
2864
2876FLECS_API
2878 const ecs_world_t *world,
2879 ecs_entity_t entity);
2880
2890FLECS_API
2892 const ecs_world_t *world,
2893 ecs_entity_t entity,
2894 ecs_id_t id);
2895
2910FLECS_API
2912 const ecs_world_t *world,
2913 ecs_entity_t entity,
2914 ecs_entity_t rel,
2915 int32_t index);
2916
2925FLECS_API
2927 const ecs_world_t *world,
2928 ecs_entity_t entity);
2929
2948FLECS_API
2950 const ecs_world_t *world,
2951 ecs_entity_t entity,
2952 ecs_entity_t rel,
2953 ecs_id_t id);
2954
2965FLECS_API
2967 const ecs_world_t *world,
2968 ecs_entity_t entity,
2969 ecs_entity_t rel);
2970
2971typedef struct ecs_flatten_desc_t {
2972 /* When true, the flatten operation will not remove names from entities in
2973 * the flattened tree. This may fail if entities from different subtrees
2974 * have the same name. */
2975 bool keep_names;
2976
2977 /* When true, the flattened tree won't contain information about the
2978 * original depth of the entities. This can reduce fragmentation, but may
2979 * cause existing code, such as cascade queries, to no longer work. */
2980 bool lose_depth;
2982
3007FLECS_API
3009 ecs_world_t *world,
3010 ecs_id_t pair,
3011 const ecs_flatten_desc_t *desc);
3012
3020FLECS_API
3022 const ecs_world_t *world,
3023 ecs_id_t entity);
3024
3041FLECS_API
3042const char* ecs_get_name(
3043 const ecs_world_t *world,
3044 ecs_entity_t entity);
3045
3053FLECS_API
3054const char* ecs_get_symbol(
3055 const ecs_world_t *world,
3056 ecs_entity_t entity);
3057
3069FLECS_API
3071 ecs_world_t *world,
3072 ecs_entity_t entity,
3073 const char *name);
3074
3086FLECS_API
3088 ecs_world_t *world,
3089 ecs_entity_t entity,
3090 const char *symbol);
3091
3103FLECS_API
3105 ecs_world_t *world,
3106 ecs_entity_t entity,
3107 const char *alias);
3108
3117FLECS_API
3119 const ecs_world_t *world,
3120 const char *name);
3121
3131FLECS_API
3133 const ecs_world_t *world,
3134 ecs_entity_t parent,
3135 const char *name);
3136
3155FLECS_API
3157 const ecs_world_t *world,
3158 ecs_entity_t parent,
3159 const char *path,
3160 const char *sep,
3161 const char *prefix,
3162 bool recursive);
3163
3171FLECS_API
3173 const ecs_world_t *world,
3174 const char *symbol,
3175 bool lookup_as_path);
3176
3196FLECS_API
3198 const ecs_world_t *world,
3199 ecs_entity_t parent,
3200 ecs_entity_t child,
3201 const char *sep,
3202 const char *prefix);
3203
3215 const ecs_world_t *world,
3216 ecs_entity_t parent,
3217 ecs_entity_t child,
3218 const char *sep,
3219 const char *prefix,
3220 ecs_strbuf_t *buf);
3221
3237FLECS_API
3239 ecs_world_t *world,
3240 ecs_entity_t parent,
3241 const char *path,
3242 const char *sep,
3243 const char *prefix);
3244
3259FLECS_API
3261 ecs_world_t *world,
3262 ecs_entity_t entity,
3263 ecs_entity_t parent,
3264 const char *path,
3265 const char *sep,
3266 const char *prefix);
3267
3279FLECS_API
3281 ecs_world_t *world,
3282 ecs_entity_t scope);
3283
3291FLECS_API
3293 const ecs_world_t *world);
3294
3304FLECS_API
3306 ecs_world_t *world,
3307 const char *prefix);
3308
3333FLECS_API
3335 ecs_world_t *world,
3336 const ecs_entity_t *lookup_path);
3337
3344FLECS_API
3346 const ecs_world_t *world);
3347
3371FLECS_API
3373 ecs_world_t *world,
3374 const ecs_component_desc_t *desc);
3375
3387FLECS_API
3389 ecs_world_t *world,
3390 ecs_entity_t id,
3391 const ecs_type_hooks_t *hooks);
3392
3399FLECS_API
3401 ecs_world_t *world,
3402 ecs_entity_t id);
3403
3426FLECS_API
3428 const ecs_world_t *world,
3429 ecs_id_t id);
3430
3443FLECS_API
3445 const ecs_world_t *world,
3446 ecs_id_t id);
3447
3456FLECS_API
3458 const ecs_world_t *world,
3459 ecs_id_t id);
3460
3470FLECS_API
3472 const ecs_world_t *world,
3473 ecs_id_t id);
3474
3494FLECS_API
3496 const ecs_world_t *world,
3497 ecs_id_t id);
3498
3506FLECS_API
3508 ecs_id_t id,
3509 ecs_id_t pattern);
3510
3516FLECS_API
3518 ecs_id_t id);
3519
3525FLECS_API
3527 ecs_id_t id);
3528
3542FLECS_API
3544 const ecs_world_t *world,
3545 ecs_id_t id);
3546
3555FLECS_API
3556ecs_flags32_t ecs_id_get_flags(
3557 const ecs_world_t *world,
3558 ecs_id_t id);
3559
3566FLECS_API
3568 ecs_id_t id_flags);
3569
3577FLECS_API
3579 const ecs_world_t *world,
3580 ecs_id_t id);
3581
3589FLECS_API
3591 const ecs_world_t *world,
3592 ecs_id_t id,
3593 ecs_strbuf_t *buf);
3594
3612FLECS_API
3613ecs_iter_t ecs_term_iter(
3614 const ecs_world_t *world,
3615 ecs_term_t *term);
3616
3625FLECS_API
3627 const ecs_iter_t *it,
3628 ecs_term_t *term);
3629
3639FLECS_API
3641 ecs_iter_t *it);
3642
3651FLECS_API
3652ecs_iter_t ecs_children(
3653 const ecs_world_t *world,
3654 ecs_entity_t parent);
3655
3662FLECS_API
3664 ecs_iter_t *it);
3665
3671FLECS_API
3673 const ecs_term_id_t *id);
3674
3686FLECS_API
3688 const ecs_term_t *term);
3689
3690FLECS_API
3691bool ecs_term_match_this(
3692 const ecs_term_t *term);
3693
3694FLECS_API
3695bool ecs_term_match_0(
3696 const ecs_term_t *term);
3697
3716FLECS_API
3718 const ecs_world_t *world,
3719 ecs_term_t *term);
3720
3729FLECS_API
3731 const ecs_term_t *src);
3732
3743FLECS_API
3745 ecs_term_t *src);
3746
3753FLECS_API
3755 ecs_term_t *term);
3756
3780FLECS_API
3782 ecs_world_t *world,
3783 const ecs_filter_desc_t *desc);
3784
3790FLECS_API
3792 ecs_filter_t *filter);
3793
3807FLECS_API
3809 const ecs_world_t *world,
3810 ecs_filter_t *filter);
3811
3823FLECS_API
3825 const ecs_filter_t *filter);
3826
3831FLECS_API
3833 const ecs_world_t *world,
3834 const ecs_term_t *term);
3835
3840FLECS_API
3842 const ecs_world_t *world,
3843 const ecs_filter_t *filter);
3844
3853FLECS_API
3855 const ecs_world_t *world,
3856 const ecs_filter_t *filter);
3857
3866FLECS_API
3868 const ecs_iter_t *it,
3869 const ecs_filter_t *filter);
3870
3890FLECS_API
3892 const ecs_world_t *world,
3893 const ecs_filter_t *filter);
3894
3904FLECS_API
3906 ecs_iter_t *it);
3907
3911FLECS_API
3913 ecs_iter_t *it);
3914
3916FLECS_API
3918 ecs_filter_t *dst,
3919 ecs_filter_t *src);
3920
3922FLECS_API
3924 ecs_filter_t *dst,
3925 const ecs_filter_t *src);
3926
3969FLECS_API
3971 ecs_world_t *world,
3972 const ecs_query_desc_t *desc);
3973
3981FLECS_API
3984
3991FLECS_API
3993 const ecs_query_t *query);
3994
4022FLECS_API
4024 const ecs_world_t *world,
4026
4036FLECS_API
4038 ecs_iter_t *iter);
4039
4043FLECS_API
4045 ecs_iter_t *iter);
4046
4057FLECS_API
4059 ecs_iter_t *iter);
4060
4082FLECS_API
4084 ecs_iter_t *iter,
4085 bool when_changed);
4086
4116FLECS_API
4119 const ecs_iter_t *it);
4120
4131FLECS_API
4133 ecs_iter_t *it);
4134
4157FLECS_API
4159 ecs_iter_t *it,
4160 uint64_t group_id);
4161
4170FLECS_API
4172 const ecs_query_t *query,
4173 uint64_t group_id);
4174
4183FLECS_API
4185 const ecs_query_t *query,
4186 uint64_t group_id);
4187
4196FLECS_API
4198 const ecs_query_t *query);
4199
4205FLECS_API
4207 const ecs_query_t *query);
4208
4214FLECS_API
4216 const ecs_query_t *query);
4217
4223FLECS_API
4225 const ecs_query_t *query);
4226
4234FLECS_API
4236 const ecs_query_t *query);
4237
4246typedef struct ecs_event_desc_t {
4249
4254
4257
4261
4263 int32_t offset;
4264
4268 int32_t count;
4269
4272
4274 const void *param;
4275
4278
4280 ecs_flags32_t flags;
4282
4312FLECS_API
4314 ecs_world_t *world,
4315 ecs_event_desc_t *desc);
4316
4326FLECS_API
4328 ecs_world_t *world,
4329 const ecs_observer_desc_t *desc);
4330
4340FLECS_API
4342 ecs_iter_t *it);
4343
4344FLECS_API
4345void* ecs_get_observer_ctx(
4346 const ecs_world_t *world,
4348
4349FLECS_API
4350void* ecs_get_observer_binding_ctx(
4351 const ecs_world_t *world,
4353
4383FLECS_API
4385 const ecs_world_t *world,
4386 const ecs_poly_t *poly,
4387 ecs_iter_t *iter,
4388 ecs_term_t *filter);
4389
4403FLECS_API
4405 ecs_iter_t *it);
4406
4416FLECS_API
4418 ecs_iter_t *it);
4419
4431FLECS_API
4433 ecs_iter_t *it);
4434
4447FLECS_API
4449 ecs_iter_t *it);
4450
4458FLECS_API
4460 ecs_iter_t *it);
4461
4495FLECS_API
4497 ecs_iter_t *it,
4498 int32_t var_id,
4499 ecs_entity_t entity);
4500
4508FLECS_API
4510 ecs_iter_t *it,
4511 int32_t var_id,
4512 const ecs_table_t *table);
4513
4521FLECS_API
4523 ecs_iter_t *it,
4524 int32_t var_id,
4525 const ecs_table_range_t *range);
4526
4538FLECS_API
4540 ecs_iter_t *it,
4541 int32_t var_id);
4542
4555FLECS_API
4557 ecs_iter_t *it,
4558 int32_t var_id);
4559
4572FLECS_API
4574 ecs_iter_t *it,
4575 int32_t var_id);
4576
4577
4589FLECS_API
4591 ecs_iter_t *it,
4592 int32_t var_id);
4593
4609FLECS_API
4610ecs_iter_t ecs_page_iter(
4611 const ecs_iter_t *it,
4612 int32_t offset,
4613 int32_t limit);
4614
4621FLECS_API
4623 ecs_iter_t *it);
4624
4645FLECS_API
4647 const ecs_iter_t *it,
4648 int32_t index,
4649 int32_t count);
4650
4657FLECS_API
4659 ecs_iter_t *it);
4660
4684FLECS_API
4686 const ecs_iter_t *it,
4687 size_t size,
4688 int32_t index);
4689
4698FLECS_API
4700 const ecs_iter_t *it,
4701 int32_t index);
4702
4713FLECS_API
4715 const ecs_iter_t *it,
4716 int32_t index);
4717
4724FLECS_API
4726 const ecs_iter_t *it,
4727 int32_t index);
4728
4735FLECS_API
4737 const ecs_iter_t *it,
4738 int32_t index);
4739
4748FLECS_API
4750 const ecs_iter_t *it,
4751 int32_t index);
4752
4760FLECS_API
4762 const ecs_iter_t *it,
4763 int32_t index);
4764
4773FLECS_API
4775 const ecs_iter_t *it,
4776 int32_t index);
4777
4791FLECS_API
4793 const ecs_iter_t *it,
4794 int32_t index);
4795
4807FLECS_API
4809 const ecs_iter_t *it);
4810
4811
4825FLECS_API
4827 const ecs_table_t *table);
4828
4837FLECS_API
4839 const ecs_table_t *table,
4840 int32_t index,
4841 int32_t offset);
4842
4850FLECS_API
4852 const ecs_table_t *table,
4853 int32_t index);
4854
4863FLECS_API
4865 const ecs_world_t *world,
4866 const ecs_table_t *table,
4867 ecs_id_t id);
4868
4877FLECS_API
4879 const ecs_world_t *world,
4880 const ecs_table_t *table,
4881 ecs_id_t id);
4882
4891FLECS_API
4893 const ecs_world_t *world,
4894 const ecs_table_t *table,
4895 ecs_id_t id,
4896 int32_t offset);
4897
4908FLECS_API
4910 const ecs_world_t *world,
4911 const ecs_table_t *table,
4912 ecs_entity_t rel);
4913
4919FLECS_API
4921 const ecs_table_t *table);
4922
4924FLECS_API
4926 const ecs_table_t *table,
4927 int32_t index);
4928
4930FLECS_API
4932 const ecs_table_t *table,
4933 int32_t index);
4934
4943FLECS_API
4945 const ecs_table_t *table);
4946
4956FLECS_API
4958 ecs_world_t *world,
4959 ecs_table_t *table,
4960 ecs_id_t id);
4961
4972FLECS_API
4974 ecs_world_t *world,
4975 const ecs_id_t *ids,
4976 int32_t id_count);
4977
4987FLECS_API
4989 ecs_world_t *world,
4990 ecs_table_t *table,
4991 ecs_id_t id);
4992
5008FLECS_API
5010 ecs_world_t *world,
5011 ecs_table_t *table);
5012
5019FLECS_API
5021 ecs_world_t *world,
5022 ecs_table_t *table);
5023
5031FLECS_API
5033 ecs_table_t *table);
5034
5042FLECS_API
5044 ecs_world_t* world,
5045 ecs_table_t* table,
5046 int32_t row_1,
5047 int32_t row_2);
5048
5071FLECS_API
5073 ecs_world_t *world,
5074 ecs_entity_t entity,
5075 ecs_record_t *record,
5076 ecs_table_t *table,
5077 const ecs_type_t *added,
5078 const ecs_type_t *removed);
5079
5081FLECS_API
5082ecs_record_t* ecs_record_find(
5083 const ecs_world_t *world,
5084 ecs_entity_t entity);
5085
5087FLECS_API
5089 const ecs_record_t *r,
5090 int32_t column,
5091 size_t c_size);
5092
5108FLECS_API
5110 const ecs_world_t *world,
5111 const ecs_table_t *table,
5112 ecs_id_t id,
5113 ecs_id_t *id_out);
5114
5145FLECS_API
5147 const ecs_world_t *world,
5148 const ecs_table_t *table,
5149 int32_t offset,
5150 ecs_id_t id,
5151 ecs_id_t *id_out);
5152
5189FLECS_API
5191 const ecs_world_t *world,
5192 const ecs_table_t *table,
5193 int32_t offset,
5194 ecs_id_t id,
5195 ecs_entity_t rel,
5196 ecs_flags32_t flags, /* EcsSelf and/or EcsUp */
5197 ecs_entity_t *subject_out,
5198 ecs_id_t *id_out,
5199 struct ecs_table_record_t **tr_out);
5200
5216FLECS_API
5218 const ecs_world_t *world,
5219 ecs_entity_t type,
5220 void *ptr);
5221
5229FLECS_API
5231 const ecs_world_t *world,
5232 const ecs_type_info_t *ti,
5233 void *ptr);
5234
5241FLECS_API
5243 ecs_world_t *world,
5244 ecs_entity_t type);
5245
5253 ecs_world_t *world,
5254 const ecs_type_info_t *ti);
5255
5264 const ecs_world_t *world,
5265 const ecs_type_info_t *ti,
5266 void *ptr);
5267
5275FLECS_API
5277 const ecs_world_t *world,
5278 ecs_entity_t type,
5279 void* ptr);
5280
5287FLECS_API
5289 ecs_world_t *world,
5290 ecs_entity_t type,
5291 void* ptr);
5292
5301FLECS_API
5303 const ecs_world_t *world,
5304 const ecs_type_info_t *ti,
5305 void* dst,
5306 const void *src);
5307
5316FLECS_API
5318 const ecs_world_t *world,
5319 ecs_entity_t type,
5320 void* dst,
5321 const void *src);
5322
5332 const ecs_world_t *world,
5333 const ecs_type_info_t *ti,
5334 void* dst,
5335 void *src);
5336
5346 const ecs_world_t *world,
5347 ecs_entity_t type,
5348 void* dst,
5349 void *src);
5350
5360 const ecs_world_t *world,
5361 const ecs_type_info_t *ti,
5362 void* dst,
5363 void *src);
5364
5374 const ecs_world_t *world,
5375 ecs_entity_t type,
5376 void* dst,
5377 void *src);
5378
5393#include "flecs/addons/flecs_c.h"
5394
5395#ifdef __cplusplus
5396}
5397#endif
5398
5399#include "flecs/private/addons.h"
5400
5401#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:1097
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:306
ecs_id_t ecs_entity_t
An entity identifier.
Definition: flecs.h:270
struct ecs_rule_t ecs_rule_t
A rule implements a non-trivial filter.
Definition: flecs.h:294
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition: flecs.h:279
struct ecs_mixins_t ecs_mixins_t
Type that stores poly mixins.
Definition: flecs.h:345
uint64_t ecs_id_t
An id.
Definition: flecs.h:267
struct ecs_query_t ecs_query_t
A query allows for cached iteration over ECS data.
Definition: flecs.h:288
struct ecs_observable_t ecs_observable_t
An observable contains lists of triggers for specific events/components.
Definition: flecs.h:300
struct ecs_table_t ecs_table_t
A table is where entities and components are stored.
Definition: flecs.h:282
void ecs_poly_t
A poly object.
Definition: flecs.h:342
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 entity.
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).
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:457
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:437
uint64_t(* ecs_hash_value_action_t)(const void *ptr)
Callback used for hashing values.
Definition: flecs.h:475
void(* ecs_iter_fini_action_t)(ecs_iter_t *it)
Function prototype for freeing an iterator.
Definition: flecs.h:415
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:426
bool(* ecs_iter_next_action_t)(ecs_iter_t *it)
Function prototype for iterating an iterator.
Definition: flecs.h:407
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
Definition: flecs.h:380
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:485
int(* ecs_compare_action_t)(const void *ptr1, const void *ptr2)
Callback used for sorting values.
Definition: flecs.h:470
void(* ecs_fini_action_t)(ecs_world_t *world, void *ctx)
Action callback on world exit.
Definition: flecs.h:461
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:492
void(* ecs_run_action_t)(ecs_iter_t *it)
Function prototype for runnables (systems, observers).
Definition: flecs.h:371
void(* ecs_ctx_free_t)(void *ctx)
Function to cleanup context data.
Definition: flecs.h:466
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:419
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:394
void(* ecs_xtor_t)(void *ptr, int32_t count, const ecs_type_info_t *type_info)
Constructor/destructor callback.
Definition: flecs.h:479
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 ECS_TERM_DESC_CACHE_SIZE
Maximum number of terms in desc (larger, as these are temp objects)
Definition: flecs.h:228
#define ECS_ID_CACHE_SIZE
Maximum number of components to add/remove in a single operation.
Definition: flecs.h:223
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition: flecs.h:42
#define ECS_OBSERVER_DESC_EVENT_COUNT_MAX
Maximum number of events to set in static array of observer descriptor.
Definition: flecs.h:232
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:525
ecs_oper_kind_t
Specify operator for term.
Definition: flecs.h:534
ecs_filter_t ECS_FILTER_INIT
Use this variable to initialize user-allocated filter object.
@ EcsOut
Term is only written.
Definition: flecs.h:530
@ EcsInOut
Term is both read and written.
Definition: flecs.h:528
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition: flecs.h:526
@ EcsInOutNone
Term is neither read nor written.
Definition: flecs.h:527
@ EcsIn
Term is only read.
Definition: flecs.h:529
@ EcsNot
The term must not match.
Definition: flecs.h:537
@ EcsOptional
The term may match.
Definition: flecs.h:538
@ EcsOr
One of the terms in an or chain must match.
Definition: flecs.h:536
@ EcsOrFrom
Term must match at least one component from term id.
Definition: flecs.h:540
@ EcsAnd
The term must match.
Definition: flecs.h:535
@ EcsNotFrom
Term must match none of the components from term id.
Definition: flecs.h:541
@ EcsAndFrom
Term must match all components from term id.
Definition: flecs.h:539
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:1080
ecs_size_t size
Component size.
Definition: flecs.h:1081
ecs_size_t alignment
Component alignment.
Definition: flecs.h:1082
A (string) identifier.
Definition: flecs.h:1071
ecs_size_t length
Length of identifier.
Definition: flecs.h:1073
char * value
Identifier string.
Definition: flecs.h:1072
ecs_hashmap_t * index
Current index.
Definition: flecs.h:1076
uint64_t hash
Hash of current value.
Definition: flecs.h:1074
uint64_t index_hash
Hash of existing record in current index.
Definition: flecs.h:1075
Component for storing a poly object.
Definition: flecs.h:1086
ecs_poly_t * poly
Pointer to poly object.
Definition: flecs.h:1087
Apply a rate filter to a tick source.
Definition: timer.h:45
Target data for flattened relationships.
Definition: flecs.h:1091
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:789
void ** data
Array with component data to insert.
Definition: flecs.h:801
ecs_id_t ids[(32)]
Ids to create the entities with.
Definition: flecs.h:799
int32_t count
Number of entities to create/populate.
Definition: flecs.h:797
ecs_entity_t * entities
Entities to bulk insert.
Definition: flecs.h:792
ecs_table_t * table
Table to insert the entities into.
Definition: flecs.h:808
Used with ecs_component_init.
Definition: flecs.h:819
ecs_type_info_t type
Parameters for type (size, hooks, ...)
Definition: flecs.h:826
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition: flecs.h:823
Used with ecs_entity_init.
Definition: flecs.h:748
const char * sep
Optional custom separator for hierarchical names.
Definition: flecs.h:758
const char * root_sep
Optional, used for identifiers relative to root.
Definition: flecs.h:762
const char * name
Name of the entity.
Definition: flecs.h:753
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:774
ecs_id_t add[(32)]
Array of ids to add to the new or existing entity.
Definition: flecs.h:779
const char * symbol
Optional entity symbol.
Definition: flecs.h:764
const char * add_expr
String expression with components to add.
Definition: flecs.h:782
ecs_entity_t id
Set to modify existing entity (optional)
Definition: flecs.h:751
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
Definition: flecs.h:4271
ecs_table_t * table
The table for which to notify.
Definition: flecs.h:4256
int32_t count
Limit number of notified entities to count.
Definition: flecs.h:4268
ecs_table_t * other_table
Optional 2nd table to notify.
Definition: flecs.h:4260
const void * param
Optional context.
Definition: flecs.h:4274
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
Definition: flecs.h:4263
const ecs_type_t * ids
Component ids.
Definition: flecs.h:4253
ecs_poly_t * observable
Observable (usually the world)
Definition: flecs.h:4277
ecs_entity_t event
The event id.
Definition: flecs.h:4248
ecs_flags32_t flags
Event flags.
Definition: flecs.h:4280
Used with ecs_filter_init.
Definition: flecs.h:833
ecs_term_t * terms_buffer
For filters with lots of terms an outside array can be provided.
Definition: flecs.h:841
bool instanced
When true, terms returned by an iterator may either contain 1 or N elements, where terms with N eleme...
Definition: flecs.h:854
ecs_term_t terms[(16)]
Terms of the filter.
Definition: flecs.h:838
int32_t terms_buffer_count
Number of terms in array provided in terms_buffer.
Definition: flecs.h:844
ecs_entity_t entity
Entity associated with query (optional)
Definition: flecs.h:863
ecs_flags32_t flags
Flags for advanced usage.
Definition: flecs.h:857
ecs_filter_t * storage
External storage to prevent allocation of the filter object.
Definition: flecs.h:847
const char * expr
Filter expression.
Definition: flecs.h:860
Filters alllow for ad-hoc quick filtering of entity tables.
Definition: flecs.h:617
ecs_term_t * terms
Array containing terms for filter.
Definition: flecs.h:620
int32_t * sizes
Field size (same for each result)
Definition: flecs.h:630
bool owned
Is filter object owned by filter.
Definition: flecs.h:624
int32_t field_count
Number of fields in iterator for filter.
Definition: flecs.h:622
int32_t term_count
Number of elements in terms array.
Definition: flecs.h:621
ecs_flags32_t flags
Filter flags.
Definition: flecs.h:627
bool terms_owned
Is terms array owned by filter.
Definition: flecs.h:625
ecs_world_t * world
World mixin.
Definition: flecs.h:636
char * variable_names[1]
Placeholder variable names array.
Definition: flecs.h:629
ecs_poly_dtor_t dtor
Dtor mixin.
Definition: flecs.h:635
ecs_entity_t entity
Entity associated with filter (optional)
Definition: flecs.h:633
ecs_iterable_t iterable
Iterable mixin.
Definition: flecs.h:634
Header for ecs_poly_t objects.
Definition: flecs.h:348
Iterable mixin.
Definition: flecs.h:512
ecs_iter_init_action_t init
Callback that creates iterator.
Definition: flecs.h:513
Used with ecs_observer_init.
Definition: flecs.h:927
void * binding_ctx
Context to be used for language bindings.
Definition: flecs.h:959
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition: flecs.h:962
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition: flecs.h:931
ecs_filter_desc_t filter
Filter for observer.
Definition: flecs.h:934
int32_t term_index
Used for internal purposes.
Definition: flecs.h:975
ecs_entity_t events[(8)]
Events to observe (OnAdd, OnRemove, OnSet, UnSet)
Definition: flecs.h:937
int32_t * last_event_id
Optional shared last event id for multiple observers.
Definition: flecs.h:972
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition: flecs.h:965
void * ctx
User context to pass to callback.
Definition: flecs.h:956
ecs_poly_t * observable
Observable with which to register the observer.
Definition: flecs.h:968
ecs_iter_action_t callback
Callback to invoke on an event, invoked when the observer matches.
Definition: flecs.h:945
bool yield_existing
When observer is created, generate events from existing data.
Definition: flecs.h:942
ecs_run_action_t run
Callback invoked on an event.
Definition: flecs.h:953
ecs_iter_action_t callback
See ecs_observer_desc_t::callback.
Definition: flecs.h:649
int32_t term_index
Index of the term in parent observer (single term observers only)
Definition: flecs.h:664
ecs_observable_t * observable
Observable for observer.
Definition: flecs.h:658
ecs_run_action_t run
See ecs_observer_desc_t::run.
Definition: flecs.h:650
int32_t * last_event_id
Last handled event id.
Definition: flecs.h:660
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition: flecs.h:655
ecs_filter_t filter
Query for observer.
Definition: flecs.h:643
void * ctx
Callback context.
Definition: flecs.h:652
ecs_id_t register_id
Id observer is registered with (single term observers only)
Definition: flecs.h:663
void * binding_ctx
Binding context (for language bindings)
Definition: flecs.h:653
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:666
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition: flecs.h:656
bool is_multi
If true, the observer triggers on more than one term.
Definition: flecs.h:670
Used with ecs_query_init.
Definition: flecs.h:870
ecs_order_by_action_t order_by
Callback used for ordering query results.
Definition: flecs.h:882
ecs_id_t group_by_id
Id to be used by group_by.
Definition: flecs.h:891
ecs_group_by_action_t group_by
Callback used for grouping results.
Definition: flecs.h:898
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
Definition: flecs.h:912
void * group_by_ctx
Context to pass to group_by.
Definition: flecs.h:909
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
Definition: flecs.h:902
ecs_query_t * parent
If set, the query will be created as a subquery.
Definition: flecs.h:920
ecs_entity_t order_by_component
Component to be used by order_by.
Definition: flecs.h:877
ecs_filter_desc_t filter
Filter for the query.
Definition: flecs.h:874
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Definition: flecs.h:906
ecs_sort_table_action_t sort_table
Callback used for ordering query results.
Definition: flecs.h:886
Type that contains information about a query group.
Definition: flecs.h:1056
int32_t table_count
Number of tables in group.
Definition: flecs.h:1058
void * ctx
Group context, returned by on_group_create.
Definition: flecs.h:1059
int32_t match_count
How often tables have been matched/unmatched.
Definition: flecs.h:1057
Type that describes a single identifier in a term.
Definition: flecs.h:567
ecs_flags32_t flags
Term flags.
Definition: flecs.h:585
ecs_entity_t trav
Relationship to traverse when looking for the component.
Definition: flecs.h:581
char * name
Name.
Definition: flecs.h:574
ecs_entity_t id
Entity id.
Definition: flecs.h:568
Type that describes a term (single element in a query)
Definition: flecs.h:589
ecs_term_id_t second
Second element of pair.
Definition: flecs.h:597
ecs_id_t id
Component id to be matched by term.
Definition: flecs.h:590
char * name
Name of term.
Definition: flecs.h:603
ecs_term_id_t src
Source of term.
Definition: flecs.h:595
ecs_id_record_t * idr
Cached pointer to internal index.
Definition: flecs.h:606
ecs_term_id_t first
Component or first element of pair.
Definition: flecs.h:596
int32_t field_index
Index of field for term in iterator.
Definition: flecs.h:605
ecs_id_t id_flags
Id flags of term id.
Definition: flecs.h:602
bool move
Used by internals.
Definition: flecs.h:610
ecs_flags16_t flags
Flags that help eval, set by ecs_filter_init.
Definition: flecs.h:608
ecs_inout_kind_t inout
Access to contents matched by term.
Definition: flecs.h:599
ecs_oper_kind_t oper
Operator of term.
Definition: flecs.h:600
Type that contains component lifecycle callbacks.
Definition: flecs.h:682
ecs_copy_t copy_ctor
Ctor + copy.
Definition: flecs.h:689
void * ctx
User defined context.
Definition: flecs.h:720
ecs_iter_action_t on_remove
Callback that is invoked when an instance of the component is removed.
Definition: flecs.h:718
void * binding_ctx
Language binding context.
Definition: flecs.h:721
ecs_move_t move_dtor
Move + dtor.
Definition: flecs.h:704
ecs_copy_t copy
copy assignment
Definition: flecs.h:685
ecs_iter_action_t on_set
Callback that is invoked when an instance of the component is set.
Definition: flecs.h:713
ecs_move_t move
move assignment
Definition: flecs.h:686
ecs_xtor_t ctor
ctor
Definition: flecs.h:683
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition: flecs.h:723
ecs_iter_action_t on_add
Callback that is invoked when an instance of a component is added.
Definition: flecs.h:708
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition: flecs.h:724
ecs_move_t move_ctor
Ctor + move.
Definition: flecs.h:692
ecs_move_t ctor_move_dtor
Ctor + move + dtor (or move_ctor + dtor).
Definition: flecs.h:698
ecs_xtor_t dtor
dtor
Definition: flecs.h:684
Type that contains component information (passed to ctors/dtors/...)
Definition: flecs.h:731
ecs_size_t alignment
Alignment of type.
Definition: flecs.h:733
ecs_size_t size
Size of type.
Definition: flecs.h:732
const char * name
Type name.
Definition: flecs.h:736
ecs_entity_t component
Handle to component (do not set)
Definition: flecs.h:735
ecs_type_hooks_t hooks
Type hooks.
Definition: flecs.h:734
An array with (component) ids.
Definition: flecs.h:273
Type that contains information about the world.
Definition: flecs.h:991
int64_t get_mut_count
get_mut/emplace commands processed
Definition: flecs.h:1041
float delta_time
Time passed to or computed by ecs_progress.
Definition: flecs.h:998
int32_t id_count
Number of ids in the world (excluding wildcards)
Definition: flecs.h:1021
ecs_entity_t min_id
First allowed entity id.
Definition: flecs.h:994
int32_t trivial_table_count
Number of tables with trivial components (no lifecycle callbacks)
Definition: flecs.h:1029
int64_t set_count
set commands processed
Definition: flecs.h:1040
float world_time_total
Time elapsed in simulation.
Definition: flecs.h:1005
int32_t tag_id_count
Number of tag (no data) ids in the world.
Definition: flecs.h:1022
int32_t tag_table_count
Number of tag-only tables.
Definition: flecs.h:1028
int32_t component_id_count
Number of component (data) ids in the world.
Definition: flecs.h:1023
int32_t table_record_count
Total number of table records (entries in table caches)
Definition: flecs.h:1031
int64_t pipeline_build_count_total
Total number of pipeline builds.
Definition: flecs.h:1017
int32_t table_count
Number of tables.
Definition: flecs.h:1027
float delta_time_raw
Raw delta time (no time scaling)
Definition: flecs.h:997
float frame_time_total
Total time spent processing a frame.
Definition: flecs.h:1001
ecs_entity_t last_id
Last issued entity id.
Definition: flecs.h:993
float world_time_total_raw
Time elapsed in simulation (no scaling)
Definition: flecs.h:1006
int64_t table_create_total
Total number of times a table was created.
Definition: flecs.h:1015
int64_t observers_ran_frame
Total number of times observer was invoked.
Definition: flecs.h:1019
float system_time_total
Total time spent in systems.
Definition: flecs.h:1002
int64_t id_delete_total
Total number of times an id was deleted.
Definition: flecs.h:1014
int64_t systems_ran_frame
Total number of systems ran in last frame.
Definition: flecs.h:1018
float merge_time_total
Total time spent in merges.
Definition: flecs.h:1004
int64_t discard_count
commands discarded, happens when entity is no longer alive when running the command
Definition: flecs.h:1044
int64_t clear_count
clear commands processed
Definition: flecs.h:1039
ecs_entity_t last_component_id
Last issued component entity id.
Definition: flecs.h:992
int32_t empty_table_count
Number of tables without entities.
Definition: flecs.h:1030
int64_t frame_count_total
Total number of frames.
Definition: flecs.h:1009
ecs_entity_t max_id
Last allowed entity id.
Definition: flecs.h:995
int64_t merge_count_total
Total number of merges.
Definition: flecs.h:1010
int64_t other_count
other commands processed
Definition: flecs.h:1043
int64_t batched_command_count
commands batched
Definition: flecs.h:1046
int64_t table_delete_total
Total number of times a table was deleted.
Definition: flecs.h:1016
int64_t delete_count
delete commands processed
Definition: flecs.h:1038
int64_t rematch_count_total
Total number of rematches.
Definition: flecs.h:1011
int64_t id_create_total
Total number of times a new id was created.
Definition: flecs.h:1013
int64_t batched_entity_count
entities for which commands were batched
Definition: flecs.h:1045
float time_scale
Time scale applied to delta_time.
Definition: flecs.h:999
int32_t pair_id_count
Number of pair ids in the world.
Definition: flecs.h:1024
float rematch_time_total
Time spent on query rematching.
Definition: flecs.h:1007
float target_fps
Target fps.
Definition: flecs.h:1000
int32_t wildcard_id_count
Number of wildcard ids.
Definition: flecs.h:1025
int32_t table_storage_count
Total number of table storages.
Definition: flecs.h:1032
float emit_time_total
Total time spent notifying observers.
Definition: flecs.h:1003
int64_t modified_count
modified commands processed
Definition: flecs.h:1042
const char * name_prefix
Value set by ecs_set_name_prefix.
Definition: flecs.h:1049
int64_t add_count
add commands processed
Definition: flecs.h:1036
int64_t remove_count
remove commands processed
Definition: flecs.h:1037
flecs::term term() const
Create a term for a (component) type.