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#ifndef FLECS_DEBUG
88#define FLECS_DEBUG /* If sanitized mode is enabled, so is debug mode */
89#endif
90#endif
91
92/* Tip: if you see weird behavior that you think might be a bug, make sure to
93 * test with the FLECS_DEBUG or FLECS_SANITIZE flags enabled. There's a good
94 * chance that this gives you more information about the issue! */
95
109// #define FLECS_SOFT_ASSERT
110
116// #define FLECS_KEEP_ASSERT
117
141// #define FLECS_CUSTOM_BUILD
142
143#ifndef FLECS_CUSTOM_BUILD
144// #define FLECS_C /**< C API convenience macros, always enabled */
145#define FLECS_CPP
146#define FLECS_MODULE
147#define FLECS_PARSER
148#define FLECS_PLECS
149#define FLECS_RULES
150#define FLECS_SNAPSHOT
151#define FLECS_STATS
152#define FLECS_MONITOR
153#define FLECS_METRICS
154#define FLECS_ALERTS
155#define FLECS_SYSTEM
156#define FLECS_PIPELINE
157#define FLECS_TIMER
158#define FLECS_META
159#define FLECS_META_C
160#define FLECS_UNITS
161#define FLECS_EXPR
162#define FLECS_JSON
163#define FLECS_DOC
164#define FLECS_COREDOC
165#define FLECS_LOG
166#define FLECS_APP
167#define FLECS_OS_API_IMPL
168#define FLECS_HTTP
169#define FLECS_REST
170// #define FLECS_JOURNAL /**< Journaling addon (disabled by default) */
171#endif // ifndef FLECS_CUSTOM_BUILD
172
176// #define FLECS_LOW_FOOTPRINT
177#ifdef FLECS_LOW_FOOTPRINT
178#define FLECS_HI_COMPONENT_ID (16)
179#define FLECS_HI_ID_RECORD_ID (16)
180#define FLECS_SPARSE_PAGE_BITS (6)
181#define FLECS_ENTITY_PAGE_BITS (6)
182#define FLECS_USE_OS_ALLOC
183#endif
184
195#ifndef FLECS_HI_COMPONENT_ID
196#define FLECS_HI_COMPONENT_ID (256)
197#endif
198
205#ifndef FLECS_HI_ID_RECORD_ID
206#define FLECS_HI_ID_RECORD_ID (1024)
207#endif
208
214#ifndef FLECS_SPARSE_PAGE_BITS
215#define FLECS_SPARSE_PAGE_BITS (12)
216#endif
217
220#ifndef FLECS_ENTITY_PAGE_BITS
221#define FLECS_ENTITY_PAGE_BITS (12)
222#endif
223
228// #define FLECS_USE_OS_ALLOC
229
232#ifndef FLECS_ID_DESC_MAX
233#define FLECS_ID_DESC_MAX (32)
234#endif
235
238#define FLECS_TERM_DESC_MAX (16)
239
242#define FLECS_EVENT_DESC_MAX (8)
243
246#define FLECS_VARIABLE_COUNT_MAX (64)
247
250#define FLECS_QUERY_SCOPE_NESTING_MAX (8)
251
254#include "flecs/private/api_defines.h"
255#include "flecs/private/vec.h" /* Vector datatype */
256#include "flecs/private/sparse.h" /* Sparse set */
257#include "flecs/private/block_allocator.h" /* Block allocator */
258#include "flecs/private/map.h" /* Map */
259#include "flecs/private/allocator.h" /* Allocator */
260#include "flecs/private/strbuf.h" /* String builder */
261#include "flecs/os_api.h" /* Abstraction for operating system functions */
262
263#ifdef __cplusplus
264extern "C" {
265#endif
266
281typedef uint64_t ecs_id_t;
282
289
305typedef struct {
306 ecs_id_t *array;
307 int32_t count;
308} ecs_type_t;
309
333
336
338typedef struct ecs_term_t ecs_term_t;
339
345
365
385typedef struct ecs_rule_t ecs_rule_t;
386
404
409
410/* Type used for iterating iterable objects.
411 * Iterators are a common interface across iterable objects (world, filters,
412 * rules, queries, systems, observers) to provide applications with information
413 * about the currently iterated result, and to store any state required for the
414 * iteration. */
415typedef struct ecs_iter_t ecs_iter_t;
416
425typedef struct ecs_ref_t ecs_ref_t;
426
431
436
439
442
445
468typedef void ecs_poly_t;
469
472
474typedef struct ecs_header_t {
475 int32_t magic; /* Magic number verifying it's a flecs object */
476 int32_t type; /* Magic number indicating which type of flecs object */
477 ecs_mixins_t *mixins; /* Table with offsets to (optional) mixins */
479
497typedef void (*ecs_run_action_t)(
498 ecs_iter_t *it);
499
506typedef void (*ecs_iter_action_t)(
507 ecs_iter_t *it);
508
521 const ecs_world_t *world,
522 const ecs_poly_t *iterable,
523 ecs_iter_t *it,
524 ecs_term_t *filter);
525
534 ecs_iter_t *it);
535
542 ecs_iter_t *it);
543
546 ecs_entity_t e1,
547 const void *ptr1,
548 ecs_entity_t e2,
549 const void *ptr2);
550
553 ecs_world_t* world,
554 ecs_table_t* table,
555 ecs_entity_t* entities,
556 void* ptr,
557 int32_t size,
558 int32_t lo,
559 int32_t hi,
560 ecs_order_by_action_t order_by);
561
563typedef uint64_t (*ecs_group_by_action_t)(
564 ecs_world_t *world,
565 ecs_table_t *table,
566 ecs_id_t group_id,
567 void *ctx);
568
569/* Callback invoked when a query creates a new group. */
570typedef void* (*ecs_group_create_action_t)(
571 ecs_world_t *world,
572 uint64_t group_id,
573 void *group_by_ctx); /* from ecs_query_desc_t */
574
575/* Callback invoked when a query deletes an existing group. */
576typedef void (*ecs_group_delete_action_t)(
577 ecs_world_t *world,
578 uint64_t group_id,
579 void *group_ctx, /* return value from ecs_group_create_action_t */
580 void *group_by_ctx); /* from ecs_query_desc_t */
581
583typedef void (*ecs_module_action_t)(
584 ecs_world_t *world);
585
587typedef void (*ecs_fini_action_t)(
588 ecs_world_t *world,
589 void *ctx);
590
592typedef void (*ecs_ctx_free_t)(
593 void *ctx);
594
596typedef int (*ecs_compare_action_t)(
597 const void *ptr1,
598 const void *ptr2);
599
601typedef uint64_t (*ecs_hash_value_action_t)(
602 const void *ptr);
603
605typedef void (*ecs_xtor_t)(
606 void *ptr,
607 int32_t count,
608 const ecs_type_info_t *type_info);
609
611typedef void (*ecs_copy_t)(
612 void *dst_ptr,
613 const void *src_ptr,
614 int32_t count,
615 const ecs_type_info_t *type_info);
616
618typedef void (*ecs_move_t)(
619 void *dst_ptr,
620 void *src_ptr,
621 int32_t count,
622 const ecs_type_info_t *type_info);
623
624/* Destructor function for poly objects */
625typedef void (*ecs_poly_dtor_t)(
626 ecs_poly_t *poly);
627
641
658
669
670/* Term id flags */
671#define EcsSelf (1u << 1)
672#define EcsUp (1u << 2)
673#define EcsDown (1u << 3)
674#define EcsTraverseAll (1u << 4)
675#define EcsCascade (1u << 5)
676#define EcsDesc (1u << 6)
677#define EcsParent (1u << 7)
678#define EcsIsVariable (1u << 8)
679#define EcsIsEntity (1u << 9)
680#define EcsIsName (1u << 10)
681#define EcsFilter (1u << 11)
682#define EcsTraverseFlags (EcsUp|EcsDown|EcsTraverseAll|EcsSelf|EcsCascade|EcsDesc|EcsParent)
683
684/* Term flags discovered & set during filter creation. Mostly used internally to
685 * store information relevant to queries. */
686#define EcsTermMatchAny (1u << 0)
687#define EcsTermMatchAnySrc (1u << 1)
688#define EcsTermSrcFirstEq (1u << 2)
689#define EcsTermSrcSecondEq (1u << 3)
690#define EcsTermTransitive (1u << 4)
691#define EcsTermReflexive (1u << 5)
692#define EcsTermIdInherited (1u << 6)
693#define EcsTermIsTrivial (1u << 7)
694#define EcsTermNoData (1u << 8)
695
696/* Term flags used for term iteration */
697#define EcsTermMatchDisabled (1u << 7)
698#define EcsTermMatchPrefab (1u << 8)
699
720
745
747FLECS_API extern ecs_filter_t ECS_FILTER_INIT;
748
751 ecs_header_t hdr;
752
753 int8_t term_count;
754 int8_t field_count;
755 ecs_flags32_t flags;
756 ecs_flags64_t data_fields;
759 char *variable_names[1];
760 int32_t *sizes;
762 /* Mixins */
765 ecs_poly_dtor_t dtor;
767};
768
769/* An observer reacts to events matching a filter */
771 ecs_header_t hdr;
772
775 /* Observer events */
777 int32_t event_count;
778
782 void *ctx;
790 int32_t *last_event_id;
791 int32_t last_event_id_storage;
792
794 int32_t term_index;
800 bool is_multi;
802 /* Mixins */
803 ecs_poly_dtor_t dtor;
804};
805
856
868
869#include "flecs/private/api_types.h" /* Supporting API types */
870#include "flecs/private/api_support.h" /* Supporting API functions */
871#include "flecs/private/vec.h" /* Vector */
872#include "flecs/private/hashmap.h" /* Hashmap */
873
878typedef struct ecs_entity_desc_t {
879 int32_t _canary;
880
883 const char *name;
888 const char *sep;
892 const char *root_sep;
894 const char *symbol;
910
912 const char *add_expr;
914
944
958
963typedef struct ecs_filter_desc_t {
964 int32_t _canary;
965
969
972
975
978
985
987 ecs_flags32_t flags;
988
990 const char *expr;
991
995
1064
1119
1124typedef struct ecs_event_desc_t {
1127
1132
1135
1139
1141 int32_t offset;
1142
1146 int32_t count;
1147
1150
1155 void *param;
1156
1157 /* Same as param, but with the guarantee that the value won't be modified.
1158 * When an event with a const parameter is enqueued, the value of the param
1159 * is copied to a temporary storage of the event type. */
1160 const void *const_param;
1161
1164
1166 ecs_flags32_t flags;
1168
1169
1176/* Utility to hold a value of a dynamic type */
1177typedef struct ecs_value_t {
1178 ecs_entity_t type;
1179 void *ptr;
1180} ecs_value_t;
1181
1239
1246
1256typedef struct EcsIdentifier {
1257 char *value;
1258 ecs_size_t length;
1259 uint64_t hash;
1260 uint64_t index_hash;
1261 ecs_hashmap_t *index;
1263
1265typedef struct EcsComponent {
1266 ecs_size_t size;
1267 ecs_size_t alignment;
1269
1274
1276typedef struct EcsTarget {
1277 int32_t count;
1278 ecs_record_t *target;
1280
1283
1287/* Only include deprecated definitions if deprecated addon is required */
1288#ifdef FLECS_DEPRECATED
1290#endif
1291
1305FLECS_API extern const ecs_id_t ECS_PAIR;
1306
1308FLECS_API extern const ecs_id_t ECS_OVERRIDE;
1309
1311FLECS_API extern const ecs_id_t ECS_TOGGLE;
1312
1314FLECS_API extern const ecs_id_t ECS_AND;
1315
1323/* Builtin component ids */
1324FLECS_API extern const ecs_entity_t ecs_id(EcsComponent);
1325FLECS_API extern const ecs_entity_t ecs_id(EcsIdentifier);
1326FLECS_API extern const ecs_entity_t ecs_id(EcsIterable);
1327FLECS_API extern const ecs_entity_t ecs_id(EcsPoly);
1328
1329FLECS_API extern const ecs_entity_t EcsQuery;
1330FLECS_API extern const ecs_entity_t EcsObserver;
1331
1332/* System module component ids */
1333FLECS_API extern const ecs_entity_t EcsSystem;
1334FLECS_API extern const ecs_entity_t ecs_id(EcsTickSource);
1335
1336/* Pipeline module component ids */
1337FLECS_API extern const ecs_entity_t ecs_id(EcsPipelineQuery);
1338
1339/* Timer module component ids */
1340FLECS_API extern const ecs_entity_t ecs_id(EcsTimer);
1341FLECS_API extern const ecs_entity_t ecs_id(EcsRateFilter);
1342
1344FLECS_API extern const ecs_entity_t EcsFlecs;
1345
1347FLECS_API extern const ecs_entity_t EcsFlecsCore;
1348
1350FLECS_API extern const ecs_entity_t EcsWorld;
1351
1353FLECS_API extern const ecs_entity_t EcsWildcard;
1354
1356FLECS_API extern const ecs_entity_t EcsAny;
1357
1359FLECS_API extern const ecs_entity_t EcsThis;
1360
1362FLECS_API extern const ecs_entity_t EcsVariable;
1363
1368FLECS_API extern const ecs_entity_t EcsTransitive;
1369
1374FLECS_API extern const ecs_entity_t EcsReflexive;
1375
1383FLECS_API extern const ecs_entity_t EcsFinal;
1384
1390FLECS_API extern const ecs_entity_t EcsDontInherit;
1391
1397FLECS_API extern const ecs_entity_t EcsAlwaysOverride;
1398
1403FLECS_API extern const ecs_entity_t EcsSymmetric;
1404
1411FLECS_API extern const ecs_entity_t EcsExclusive;
1412
1414FLECS_API extern const ecs_entity_t EcsAcyclic;
1415
1418FLECS_API extern const ecs_entity_t EcsTraversable;
1419
1426FLECS_API extern const ecs_entity_t EcsWith;
1427
1434FLECS_API extern const ecs_entity_t EcsOneOf;
1435
1438FLECS_API extern const ecs_entity_t EcsTag;
1439
1443FLECS_API extern const ecs_entity_t EcsUnion;
1444
1446FLECS_API extern const ecs_entity_t EcsName;
1447
1449FLECS_API extern const ecs_entity_t EcsSymbol;
1450
1452FLECS_API extern const ecs_entity_t EcsAlias;
1453
1455FLECS_API extern const ecs_entity_t EcsChildOf;
1456
1458FLECS_API extern const ecs_entity_t EcsIsA;
1459
1461FLECS_API extern const ecs_entity_t EcsDependsOn;
1462
1464FLECS_API extern const ecs_entity_t EcsSlotOf;
1465
1467FLECS_API extern const ecs_entity_t EcsModule;
1468
1470FLECS_API extern const ecs_entity_t EcsPrivate;
1471
1474FLECS_API extern const ecs_entity_t EcsPrefab;
1475
1478FLECS_API extern const ecs_entity_t EcsDisabled;
1479
1481FLECS_API extern const ecs_entity_t EcsOnAdd;
1482
1484FLECS_API extern const ecs_entity_t EcsOnRemove;
1485
1487FLECS_API extern const ecs_entity_t EcsOnSet;
1488
1490FLECS_API extern const ecs_entity_t EcsUnSet;
1491
1493FLECS_API extern const ecs_entity_t EcsMonitor;
1494
1496FLECS_API extern const ecs_entity_t EcsOnTableCreate;
1497
1499FLECS_API extern const ecs_entity_t EcsOnTableDelete;
1500
1502FLECS_API extern const ecs_entity_t EcsOnTableEmpty;
1503
1505FLECS_API extern const ecs_entity_t EcsOnTableFill;
1506
1508FLECS_API extern const ecs_entity_t EcsOnDelete;
1509
1512FLECS_API extern const ecs_entity_t EcsOnDeleteTarget;
1513
1516FLECS_API extern const ecs_entity_t EcsRemove;
1517
1520FLECS_API extern const ecs_entity_t EcsDelete;
1521
1524FLECS_API extern const ecs_entity_t EcsPanic;
1525
1527FLECS_API extern const ecs_entity_t ecs_id(EcsTarget);
1528
1531FLECS_API extern const ecs_entity_t EcsFlatten;
1532
1538FLECS_API extern const ecs_entity_t EcsDefaultChildComponent;
1539
1540/* Builtin predicates for comparing entity ids in queries. Only supported by rules */
1541FLECS_API extern const ecs_entity_t EcsPredEq;
1542FLECS_API extern const ecs_entity_t EcsPredMatch;
1543FLECS_API extern const ecs_entity_t EcsPredLookup;
1544
1545/* Builtin marker entities for opening/closing query scopes */
1546FLECS_API extern const ecs_entity_t EcsScopeOpen;
1547FLECS_API extern const ecs_entity_t EcsScopeClose;
1548
1550FLECS_API extern const ecs_entity_t EcsEmpty;
1551
1552/* Pipeline module tags */
1553FLECS_API extern const ecs_entity_t ecs_id(EcsPipeline);
1554FLECS_API extern const ecs_entity_t EcsOnStart;
1555FLECS_API extern const ecs_entity_t EcsPreFrame;
1556FLECS_API extern const ecs_entity_t EcsOnLoad;
1557FLECS_API extern const ecs_entity_t EcsPostLoad;
1558FLECS_API extern const ecs_entity_t EcsPreUpdate;
1559FLECS_API extern const ecs_entity_t EcsOnUpdate;
1560FLECS_API extern const ecs_entity_t EcsOnValidate;
1561FLECS_API extern const ecs_entity_t EcsPostUpdate;
1562FLECS_API extern const ecs_entity_t EcsPreStore;
1563FLECS_API extern const ecs_entity_t EcsOnStore;
1564FLECS_API extern const ecs_entity_t EcsPostFrame;
1565FLECS_API extern const ecs_entity_t EcsPhase;
1566
1569#define EcsLastInternalComponentId (ecs_id(EcsPoly))
1570
1573#define EcsFirstUserComponentId (8)
1574
1577#define EcsFirstUserEntityId (FLECS_HI_COMPONENT_ID + 128)
1578
1579/* When visualized the reserved id ranges look like this:
1580 * [1..8]: Builtin components
1581 * [9..FLECS_HI_COMPONENT_ID]: Low ids reserved for application components
1582 * [FLECS_HI_COMPONENT_ID + 1..EcsFirstUserEntityId]: Builtin entities
1583 */
1584
1605FLECS_API
1607
1614FLECS_API
1616
1624FLECS_API
1626 int argc,
1627 char *argv[]);
1628
1635FLECS_API
1637 ecs_world_t *world);
1638
1646FLECS_API
1648 const ecs_world_t *world);
1649
1657FLECS_API
1659 ecs_world_t *world,
1660 ecs_fini_action_t action,
1661 void *ctx);
1662
1688FLECS_API
1690 ecs_world_t *world,
1691 ecs_ftime_t delta_time);
1692
1699FLECS_API
1701 ecs_world_t *world);
1702
1710FLECS_API
1712 ecs_world_t *world,
1713 ecs_fini_action_t action,
1714 void *ctx);
1715
1722FLECS_API
1724 ecs_world_t *world);
1725
1730FLECS_API
1732 const ecs_world_t *world);
1733
1746 ecs_world_t *world,
1747 bool enable);
1748
1760 ecs_world_t *world,
1761 bool enable);
1762
1778FLECS_API
1780 ecs_world_t *world,
1781 ecs_ftime_t fps);
1782
1819FLECS_API
1821 ecs_world_t *world);
1822
1830FLECS_API
1832 ecs_world_t *world);
1833
1844FLECS_API
1846 ecs_world_t *world);
1847
1857FLECS_API
1859 ecs_world_t *world);
1860
1866FLECS_API
1868 const ecs_world_t *world);
1869
1878FLECS_API
1880 ecs_world_t *world);
1881
1891FLECS_API
1893 ecs_world_t *world);
1894
1900FLECS_API
1902 ecs_world_t *world);
1903
1920FLECS_API
1922 ecs_world_t *world,
1923 bool automerge);
1924
1938FLECS_API
1940 ecs_world_t *world,
1941 int32_t stages);
1942
1949FLECS_API
1951 const ecs_world_t *world);
1952
1960FLECS_API
1962 const ecs_world_t *world);
1963
1979FLECS_API
1981 const ecs_world_t *world,
1982 int32_t stage_id);
1983
1991FLECS_API
1993 const ecs_world_t *world);
1994
2013FLECS_API
2015 ecs_world_t *world);
2016
2023FLECS_API
2025 ecs_world_t *stage);
2026
2033FLECS_API
2035 ecs_world_t *stage);
2036
2052FLECS_API
2054 ecs_world_t *world,
2055 void *ctx,
2056 ecs_ctx_free_t ctx_free);
2057
2066FLECS_API
2068 ecs_world_t *world,
2069 void *ctx,
2070 ecs_ctx_free_t ctx_free);
2071
2079FLECS_API
2081 const ecs_world_t *world);
2082
2090FLECS_API
2092 const ecs_world_t *world);
2093
2099FLECS_API
2101 const ecs_world_t *world);
2102
2111FLECS_API
2113 ecs_world_t *world,
2114 int32_t entity_count);
2115
2131FLECS_API
2133 ecs_world_t *world,
2134 ecs_entity_t id_start,
2135 ecs_entity_t id_end);
2136
2147FLECS_API
2149 ecs_world_t *world,
2150 bool enable);
2151
2156FLECS_API
2158 const ecs_world_t *world);
2159
2173FLECS_API
2175 ecs_world_t *world,
2176 ecs_flags32_t flags);
2177
2211FLECS_API
2213 ecs_world_t *world,
2214 ecs_id_t id,
2215 uint16_t clear_generation,
2216 uint16_t delete_generation,
2217 int32_t min_id_count,
2218 double time_budget_seconds);
2219
2225FLECS_API
2227 const ecs_poly_t *poly);
2228
2234FLECS_API
2236 const ecs_poly_t *poly);
2237
2248FLECS_API
2250 const ecs_poly_t *object,
2251 int32_t type);
2252
2253#define ecs_poly_is(object, type)\
2254 ecs_poly_is_(object, type##_magic)
2255
2263FLECS_API
2265 ecs_entity_t first,
2266 ecs_entity_t second);
2267
2292FLECS_API
2294 ecs_world_t *world);
2295
2313FLECS_API
2315 ecs_world_t *world);
2316
2325FLECS_API
2327 ecs_world_t *world,
2328 ecs_id_t id);
2329
2337FLECS_API
2339 ecs_world_t *world,
2340 ecs_table_t *table);
2341
2360FLECS_API
2362 ecs_world_t *world,
2363 const ecs_entity_desc_t *desc);
2364
2391FLECS_API
2393 ecs_world_t *world,
2394 const ecs_bulk_desc_t *desc);
2395
2405FLECS_API
2407 ecs_world_t *world,
2408 ecs_id_t id,
2409 int32_t count);
2410
2426FLECS_API
2428 ecs_world_t *world,
2429 ecs_entity_t dst,
2430 ecs_entity_t src,
2431 bool copy_value);
2432
2441FLECS_API
2443 ecs_world_t *world,
2444 ecs_entity_t entity);
2445
2453FLECS_API
2455 ecs_world_t *world,
2456 ecs_id_t id);
2457
2474FLECS_API
2476 ecs_world_t *world,
2477 ecs_entity_t entity,
2478 ecs_id_t id);
2479
2488FLECS_API
2490 ecs_world_t *world,
2491 ecs_entity_t entity,
2492 ecs_id_t id);
2493
2516FLECS_API
2518 ecs_world_t *world,
2519 ecs_entity_t entity,
2520 ecs_id_t id);
2521
2528FLECS_API
2530 ecs_world_t *world,
2531 ecs_entity_t entity);
2532
2540FLECS_API
2542 ecs_world_t *world,
2543 ecs_id_t id);
2544
2552FLECS_API
2554 ecs_world_t *world,
2555 ecs_id_t id);
2556
2563FLECS_API
2565 const ecs_world_t *world);
2566
2584FLECS_API
2586 ecs_world_t *world,
2587 ecs_entity_t entity,
2588 bool enabled);
2589
2603FLECS_API
2605 ecs_world_t *world,
2606 ecs_entity_t entity,
2607 ecs_id_t id,
2608 bool enable);
2609
2620FLECS_API
2622 const ecs_world_t *world,
2623 ecs_entity_t entity,
2624 ecs_id_t id);
2625
2643FLECS_API
2644const void* ecs_get_id(
2645 const ecs_world_t *world,
2646 ecs_entity_t entity,
2647 ecs_id_t id);
2648
2659FLECS_API
2661 const ecs_world_t *world,
2662 ecs_entity_t entity,
2663 ecs_id_t id);
2664
2673FLECS_API
2675 const ecs_world_t *world,
2676 ecs_ref_t *ref,
2677 ecs_id_t id);
2678
2686FLECS_API
2688 const ecs_world_t *world,
2689 ecs_ref_t *ref);
2690
2705FLECS_API
2707 ecs_world_t *world,
2708 ecs_entity_t entity,
2709 ecs_id_t id);
2710
2722FLECS_API
2724 ecs_world_t *world,
2725 ecs_entity_t entity,
2726 ecs_id_t id);
2727
2746FLECS_API
2748 ecs_world_t *world,
2749 ecs_entity_t entity);
2750
2757FLECS_API
2759 ecs_record_t *record);
2760
2780FLECS_API
2782 ecs_world_t *world,
2783 ecs_entity_t entity);
2784
2790FLECS_API
2792 const ecs_record_t *record);
2793
2799FLECS_API
2801 const ecs_record_t *record);
2802
2816FLECS_API
2818 ecs_world_t *world,
2819 const ecs_record_t *record,
2820 ecs_id_t id);
2821
2830FLECS_API
2832 ecs_world_t *world,
2833 ecs_record_t *record,
2834 ecs_id_t id);
2835
2842FLECS_API
2844 ecs_world_t *world,
2845 const ecs_record_t *record,
2846 ecs_id_t id);
2847
2861FLECS_API
2863 ecs_world_t *world,
2864 ecs_entity_t entity,
2865 ecs_id_t id);
2866
2876FLECS_API
2878 ecs_world_t *world,
2879 ecs_entity_t entity,
2880 ecs_id_t id);
2881
2898FLECS_API
2900 ecs_world_t *world,
2901 ecs_entity_t entity,
2902 ecs_id_t id,
2903 size_t size,
2904 const void *ptr);
2905
2932FLECS_API
2934 const ecs_world_t *world,
2935 ecs_entity_t e);
2936
2960FLECS_API
2962 const ecs_world_t *world,
2963 ecs_entity_t e);
2964
2970FLECS_API
2972 ecs_entity_t e);
2973
2985FLECS_API
2987 ecs_world_t *world,
2988 ecs_entity_t entity);
2989
3006FLECS_API
3008 const ecs_world_t *world,
3009 ecs_entity_t e);
3010
3031FLECS_API
3033 ecs_world_t *world,
3034 ecs_entity_t entity);
3035
3054FLECS_API
3056 ecs_world_t *world,
3057 ecs_id_t id);
3058
3066FLECS_API
3068 const ecs_world_t *world,
3069 ecs_entity_t entity);
3070
3085FLECS_API
3087 const ecs_world_t *world,
3088 ecs_entity_t entity);
3089
3096FLECS_API
3098 const ecs_world_t *world,
3099 ecs_entity_t entity);
3100
3108FLECS_API
3110 const ecs_world_t *world,
3111 const ecs_type_t* type);
3112
3121FLECS_API
3123 const ecs_world_t *world,
3124 const ecs_table_t *table);
3125
3137FLECS_API
3139 const ecs_world_t *world,
3140 ecs_entity_t entity);
3141
3150FLECS_API
3152 const ecs_world_t *world,
3153 ecs_entity_t entity,
3154 ecs_id_t id);
3155
3166FLECS_API
3168 const ecs_world_t *world,
3169 ecs_entity_t entity,
3170 ecs_id_t id);
3171
3186FLECS_API
3188 const ecs_world_t *world,
3189 ecs_entity_t entity,
3190 ecs_entity_t rel,
3191 int32_t index);
3192
3201FLECS_API
3203 const ecs_world_t *world,
3204 ecs_entity_t entity);
3205
3224FLECS_API
3226 const ecs_world_t *world,
3227 ecs_entity_t entity,
3228 ecs_entity_t rel,
3229 ecs_id_t id);
3230
3241FLECS_API
3243 const ecs_world_t *world,
3244 ecs_entity_t entity,
3245 ecs_entity_t rel);
3246
3247typedef struct ecs_flatten_desc_t {
3248 /* When true, the flatten operation will not remove names from entities in
3249 * the flattened tree. This may fail if entities from different subtrees
3250 * have the same name. */
3251 bool keep_names;
3252
3253 /* When true, the flattened tree won't contain information about the
3254 * original depth of the entities. This can reduce fragmentation, but may
3255 * cause existing code, such as cascade queries, to no longer work. */
3256 bool lose_depth;
3258
3283FLECS_API
3285 ecs_world_t *world,
3286 ecs_id_t pair,
3287 const ecs_flatten_desc_t *desc);
3288
3296FLECS_API
3298 const ecs_world_t *world,
3299 ecs_id_t entity);
3300
3317FLECS_API
3318const char* ecs_get_name(
3319 const ecs_world_t *world,
3320 ecs_entity_t entity);
3321
3329FLECS_API
3330const char* ecs_get_symbol(
3331 const ecs_world_t *world,
3332 ecs_entity_t entity);
3333
3345FLECS_API
3347 ecs_world_t *world,
3348 ecs_entity_t entity,
3349 const char *name);
3350
3362FLECS_API
3364 ecs_world_t *world,
3365 ecs_entity_t entity,
3366 const char *symbol);
3367
3379FLECS_API
3381 ecs_world_t *world,
3382 ecs_entity_t entity,
3383 const char *alias);
3384
3393FLECS_API
3395 const ecs_world_t *world,
3396 const char *name);
3397
3407FLECS_API
3409 const ecs_world_t *world,
3410 ecs_entity_t parent,
3411 const char *name);
3412
3431FLECS_API
3433 const ecs_world_t *world,
3434 ecs_entity_t parent,
3435 const char *path,
3436 const char *sep,
3437 const char *prefix,
3438 bool recursive);
3439
3453FLECS_API
3455 const ecs_world_t *world,
3456 const char *symbol,
3457 bool lookup_as_path,
3458 bool recursive);
3459
3479FLECS_API
3481 const ecs_world_t *world,
3482 ecs_entity_t parent,
3483 ecs_entity_t child,
3484 const char *sep,
3485 const char *prefix);
3486
3498 const ecs_world_t *world,
3499 ecs_entity_t parent,
3500 ecs_entity_t child,
3501 const char *sep,
3502 const char *prefix,
3503 ecs_strbuf_t *buf);
3504
3520FLECS_API
3522 ecs_world_t *world,
3523 ecs_entity_t parent,
3524 const char *path,
3525 const char *sep,
3526 const char *prefix);
3527
3542FLECS_API
3544 ecs_world_t *world,
3545 ecs_entity_t entity,
3546 ecs_entity_t parent,
3547 const char *path,
3548 const char *sep,
3549 const char *prefix);
3550
3562FLECS_API
3564 ecs_world_t *world,
3565 ecs_entity_t scope);
3566
3574FLECS_API
3576 const ecs_world_t *world);
3577
3587FLECS_API
3589 ecs_world_t *world,
3590 const char *prefix);
3591
3616FLECS_API
3618 ecs_world_t *world,
3619 const ecs_entity_t *lookup_path);
3620
3627FLECS_API
3629 const ecs_world_t *world);
3630
3654FLECS_API
3656 ecs_world_t *world,
3657 const ecs_component_desc_t *desc);
3658
3668FLECS_API
3670 const ecs_world_t *world,
3671 ecs_id_t id);
3672
3684FLECS_API
3686 ecs_world_t *world,
3687 ecs_entity_t id,
3688 const ecs_type_hooks_t *hooks);
3689
3696FLECS_API
3698 ecs_world_t *world,
3699 ecs_entity_t id);
3700
3723FLECS_API
3725 const ecs_world_t *world,
3726 ecs_id_t id);
3727
3740FLECS_API
3742 const ecs_world_t *world,
3743 ecs_id_t id);
3744
3753FLECS_API
3755 const ecs_world_t *world,
3756 ecs_id_t id);
3757
3777FLECS_API
3779 const ecs_world_t *world,
3780 ecs_id_t id);
3781
3789FLECS_API
3791 ecs_id_t id,
3792 ecs_id_t pattern);
3793
3799FLECS_API
3801 ecs_id_t id);
3802
3808FLECS_API
3810 ecs_id_t id);
3811
3825FLECS_API
3827 const ecs_world_t *world,
3828 ecs_id_t id);
3829
3838FLECS_API
3839ecs_flags32_t ecs_id_get_flags(
3840 const ecs_world_t *world,
3841 ecs_id_t id);
3842
3849FLECS_API
3851 ecs_id_t id_flags);
3852
3860FLECS_API
3862 const ecs_world_t *world,
3863 ecs_id_t id);
3864
3872FLECS_API
3874 const ecs_world_t *world,
3875 ecs_id_t id,
3876 ecs_strbuf_t *buf);
3877
3895FLECS_API
3896ecs_iter_t ecs_term_iter(
3897 const ecs_world_t *world,
3898 ecs_term_t *term);
3899
3908FLECS_API
3910 const ecs_iter_t *it,
3911 ecs_term_t *term);
3912
3922FLECS_API
3924 ecs_iter_t *it);
3925
3934FLECS_API
3935ecs_iter_t ecs_children(
3936 const ecs_world_t *world,
3937 ecs_entity_t parent);
3938
3945FLECS_API
3947 ecs_iter_t *it);
3948
3954FLECS_API
3956 const ecs_term_id_t *id);
3957
3969FLECS_API
3971 const ecs_term_t *term);
3972
3987FLECS_API
3989 const ecs_term_t *term);
3990
4003FLECS_API
4005 const ecs_term_t *term);
4006
4025FLECS_API
4027 const ecs_world_t *world,
4028 ecs_term_t *term);
4029
4038FLECS_API
4040 const ecs_term_t *src);
4041
4052FLECS_API
4054 ecs_term_t *src);
4055
4062FLECS_API
4064 ecs_term_t *term);
4065
4089FLECS_API
4091 ecs_world_t *world,
4092 const ecs_filter_desc_t *desc);
4093
4099FLECS_API
4101 ecs_filter_t *filter);
4102
4116FLECS_API
4118 const ecs_world_t *world,
4119 ecs_filter_t *filter);
4120
4132FLECS_API
4134 const ecs_filter_t *filter);
4135
4144FLECS_API
4146 const ecs_world_t *world,
4147 const ecs_term_t *term);
4148
4157FLECS_API
4159 const ecs_world_t *world,
4160 const ecs_filter_t *filter);
4161
4170FLECS_API
4172 const ecs_world_t *world,
4173 const ecs_filter_t *filter);
4174
4183FLECS_API
4185 const ecs_iter_t *it,
4186 const ecs_filter_t *filter);
4187
4207FLECS_API
4209 const ecs_world_t *world,
4210 const ecs_filter_t *filter);
4211
4221FLECS_API
4223 ecs_iter_t *it);
4224
4231FLECS_API
4233 ecs_iter_t *it);
4234
4240FLECS_API
4242 ecs_filter_t *dst,
4243 ecs_filter_t *src);
4244
4250FLECS_API
4252 ecs_filter_t *dst,
4253 const ecs_filter_t *src);
4254
4297FLECS_API
4299 ecs_world_t *world,
4300 const ecs_query_desc_t *desc);
4301
4309FLECS_API
4312
4320FLECS_API
4322 const ecs_query_t *query);
4323
4351FLECS_API
4353 const ecs_world_t *world,
4355
4365FLECS_API
4367 ecs_iter_t *iter);
4368
4375FLECS_API
4377 ecs_iter_t *iter);
4378
4389FLECS_API
4391 ecs_iter_t *iter);
4392
4414FLECS_API
4416 ecs_iter_t *iter,
4417 bool when_changed);
4418
4448FLECS_API
4451 const ecs_iter_t *it);
4452
4463FLECS_API
4465 ecs_iter_t *it);
4466
4489FLECS_API
4491 ecs_iter_t *it,
4492 uint64_t group_id);
4493
4502FLECS_API
4504 const ecs_query_t *query,
4505 uint64_t group_id);
4506
4515FLECS_API
4517 const ecs_query_t *query,
4518 uint64_t group_id);
4519
4528FLECS_API
4530 const ecs_query_t *query);
4531
4537FLECS_API
4539 const ecs_query_t *query);
4540
4546FLECS_API
4548 const ecs_query_t *query);
4549
4555FLECS_API
4557 const ecs_query_t *query);
4558
4566FLECS_API
4568 const ecs_query_t *query);
4569
4576FLECS_API
4578 const ecs_query_t *query);
4579
4586FLECS_API
4588 const ecs_query_t *query);
4589
4615FLECS_API
4617 ecs_world_t *world,
4618 ecs_event_desc_t *desc);
4619
4620FLECS_API
4621void ecs_enqueue(
4622 ecs_world_t *world,
4623 ecs_event_desc_t *desc);
4624
4634FLECS_API
4636 ecs_world_t *world,
4637 const ecs_observer_desc_t *desc);
4638
4648FLECS_API
4650 ecs_iter_t *it);
4651
4659FLECS_API
4661 const ecs_world_t *world,
4663
4671FLECS_API
4673 const ecs_world_t *world,
4675
4705FLECS_API
4707 const ecs_world_t *world,
4708 const ecs_poly_t *poly,
4709 ecs_iter_t *iter,
4710 ecs_term_t *filter);
4711
4725FLECS_API
4727 ecs_iter_t *it);
4728
4738FLECS_API
4740 ecs_iter_t *it);
4741
4753FLECS_API
4755 ecs_iter_t *it);
4756
4769FLECS_API
4771 ecs_iter_t *it);
4772
4780FLECS_API
4782 ecs_iter_t *it);
4783
4817FLECS_API
4819 ecs_iter_t *it,
4820 int32_t var_id,
4821 ecs_entity_t entity);
4822
4830FLECS_API
4832 ecs_iter_t *it,
4833 int32_t var_id,
4834 const ecs_table_t *table);
4835
4843FLECS_API
4845 ecs_iter_t *it,
4846 int32_t var_id,
4847 const ecs_table_range_t *range);
4848
4861FLECS_API
4863 ecs_iter_t *it,
4864 int32_t var_id);
4865
4879FLECS_API
4881 ecs_iter_t *it,
4882 int32_t var_id);
4883
4897FLECS_API
4899 ecs_iter_t *it,
4900 int32_t var_id);
4901
4913FLECS_API
4915 ecs_iter_t *it,
4916 int32_t var_id);
4917
4929FLECS_API
4931 const ecs_iter_t *it);
4932
4948FLECS_API
4949ecs_iter_t ecs_page_iter(
4950 const ecs_iter_t *it,
4951 int32_t offset,
4952 int32_t limit);
4953
4960FLECS_API
4962 ecs_iter_t *it);
4963
4984FLECS_API
4986 const ecs_iter_t *it,
4987 int32_t index,
4988 int32_t count);
4989
4996FLECS_API
4998 ecs_iter_t *it);
4999
5023FLECS_API
5025 const ecs_iter_t *it,
5026 size_t size,
5027 int32_t index);
5028
5037FLECS_API
5039 const ecs_iter_t *it,
5040 int32_t index);
5041
5052FLECS_API
5054 const ecs_iter_t *it,
5055 int32_t index);
5056
5063FLECS_API
5065 const ecs_iter_t *it,
5066 int32_t index);
5067
5074FLECS_API
5076 const ecs_iter_t *it,
5077 int32_t index);
5078
5087FLECS_API
5089 const ecs_iter_t *it,
5090 int32_t index);
5091
5099FLECS_API
5101 const ecs_iter_t *it,
5102 int32_t index);
5103
5111FLECS_API
5113 const ecs_iter_t *it,
5114 int32_t index);
5115
5129FLECS_API
5131 const ecs_iter_t *it,
5132 int32_t index);
5133
5148FLECS_API
5150 const ecs_table_t *table);
5151
5160FLECS_API
5162 const ecs_world_t *world,
5163 const ecs_table_t *table,
5164 ecs_id_t id);
5165
5175FLECS_API
5177 const ecs_world_t *world,
5178 const ecs_table_t *table,
5179 ecs_id_t id);
5180
5188FLECS_API
5190 const ecs_table_t *table);
5191
5203FLECS_API
5205 const ecs_table_t *table,
5206 int32_t index);
5207
5216FLECS_API
5218 const ecs_table_t *table,
5219 int32_t index);
5220
5229FLECS_API
5231 const ecs_table_t *table,
5232 int32_t index,
5233 int32_t offset);
5234
5243FLECS_API
5245 const ecs_world_t *world,
5246 const ecs_table_t *table,
5247 ecs_id_t id,
5248 int32_t offset);
5249
5257FLECS_API
5259 const ecs_table_t *table,
5260 int32_t index);
5261
5270FLECS_API
5272 const ecs_table_t *table);
5273
5282FLECS_API
5284 const ecs_world_t *world,
5285 const ecs_table_t *table,
5286 ecs_id_t id);
5287
5298FLECS_API
5300 const ecs_world_t *world,
5301 const ecs_table_t *table,
5302 ecs_entity_t rel);
5303
5313FLECS_API
5315 ecs_world_t *world,
5316 ecs_table_t *table,
5317 ecs_id_t id);
5318
5329FLECS_API
5331 ecs_world_t *world,
5332 const ecs_id_t *ids,
5333 int32_t id_count);
5334
5344FLECS_API
5346 ecs_world_t *world,
5347 ecs_table_t *table,
5348 ecs_id_t id);
5349
5365FLECS_API
5367 ecs_world_t *world,
5368 ecs_table_t *table);
5369
5376FLECS_API
5378 ecs_world_t *world,
5379 ecs_table_t *table);
5380
5390FLECS_API
5392 ecs_table_t *table,
5393 ecs_flags32_t flags);
5394
5402FLECS_API
5404 ecs_world_t* world,
5405 ecs_table_t* table,
5406 int32_t row_1,
5407 int32_t row_2);
5408
5431FLECS_API
5433 ecs_world_t *world,
5434 ecs_entity_t entity,
5435 ecs_record_t *record,
5436 ecs_table_t *table,
5437 const ecs_type_t *added,
5438 const ecs_type_t *removed);
5439
5441FLECS_API
5443 const ecs_world_t *world,
5444 ecs_entity_t entity);
5445
5447FLECS_API
5449 const ecs_record_t *r,
5450 int32_t column,
5451 size_t c_size);
5452
5468FLECS_API
5470 const ecs_world_t *world,
5471 const ecs_table_t *table,
5472 ecs_id_t id,
5473 ecs_id_t *id_out);
5474
5505FLECS_API
5507 const ecs_world_t *world,
5508 const ecs_table_t *table,
5509 int32_t offset,
5510 ecs_id_t id,
5511 ecs_id_t *id_out);
5512
5549FLECS_API
5551 const ecs_world_t *world,
5552 const ecs_table_t *table,
5553 int32_t offset,
5554 ecs_id_t id,
5555 ecs_entity_t rel,
5556 ecs_flags32_t flags, /* EcsSelf and/or EcsUp */
5557 ecs_entity_t *subject_out,
5558 ecs_id_t *id_out,
5559 struct ecs_table_record_t **tr_out);
5560
5576FLECS_API
5578 const ecs_world_t *world,
5579 ecs_entity_t type,
5580 void *ptr);
5581
5589FLECS_API
5591 const ecs_world_t *world,
5592 const ecs_type_info_t *ti,
5593 void *ptr);
5594
5601FLECS_API
5603 ecs_world_t *world,
5604 ecs_entity_t type);
5605
5613 ecs_world_t *world,
5614 const ecs_type_info_t *ti);
5615
5624 const ecs_world_t *world,
5625 const ecs_type_info_t *ti,
5626 void *ptr);
5627
5635FLECS_API
5637 const ecs_world_t *world,
5638 ecs_entity_t type,
5639 void* ptr);
5640
5647FLECS_API
5649 ecs_world_t *world,
5650 ecs_entity_t type,
5651 void* ptr);
5652
5661FLECS_API
5663 const ecs_world_t *world,
5664 const ecs_type_info_t *ti,
5665 void* dst,
5666 const void *src);
5667
5676FLECS_API
5678 const ecs_world_t *world,
5679 ecs_entity_t type,
5680 void* dst,
5681 const void *src);
5682
5692 const ecs_world_t *world,
5693 const ecs_type_info_t *ti,
5694 void* dst,
5695 void *src);
5696
5706 const ecs_world_t *world,
5707 ecs_entity_t type,
5708 void* dst,
5709 void *src);
5710
5720 const ecs_world_t *world,
5721 const ecs_type_info_t *ti,
5722 void* dst,
5723 void *src);
5724
5734 const ecs_world_t *world,
5735 ecs_entity_t type,
5736 void* dst,
5737 void *src);
5738
5753#include "flecs/addons/flecs_c.h"
5754
5755#ifdef __cplusplus
5756}
5757#endif
5758
5759#include "flecs/private/addons.h"
5760
5761#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 (component) id.
ecs_iterable_t EcsIterable
Component for iterable entities.
Definition flecs.h:1282
const ecs_entity_t EcsOnRemove
Event that triggers when an id is removed from an entity.
const ecs_entity_t EcsThis
This entity.
const ecs_entity_t EcsWildcard
Wildcard entity ("*").
const ecs_entity_t EcsName
Tag to indicate name identifier.
const ecs_entity_t EcsAcyclic
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 that triggers when a component is set for an entity.
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 that triggers when a table is deleted.
const ecs_entity_t EcsOnTableCreate
Event that triggers when a table is created.
const ecs_entity_t EcsTraversable
Marks a relationship as traversable.
const ecs_entity_t EcsUnSet
Event that triggers when a component is unset for an entity.
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 that triggers when a table becomes non-empty.
const ecs_entity_t EcsChildOf
Used to express parent-child relationships.
const ecs_entity_t EcsFlecsCore
Core module scope.
const ecs_entity_t EcsMonitor
Event that triggers observer when an entity starts/stops matching a query.
const ecs_entity_t EcsOnTableEmpty
Event that triggers when a table becomes empty (doesn't emit on creation).
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 that triggers when an id is added to an entity.
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
Relationship used for specifying cleanup behavior.
const ecs_entity_t EcsOnDeleteTarget
Relationship used to define what should happen when a target entity (second element of a pair) is del...
const ecs_entity_t EcsFlecs
Root scope for builtin flecs entities.
const ecs_entity_t EcsDisabled
When this tag is added to an entity it is skipped by queries, unless EcsDisabled is explicitly querie...
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 ("$").
const ecs_entity_t EcsFlatten
Tag added to root entity to indicate its subtree should be flattened.
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.
const ecs_type_info_t * ecs_get_type_info(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
struct ecs_ref_t ecs_ref_t
A ref is a fast way to fetch a component for a specific entity.
Definition flecs.h:425
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:288
struct ecs_rule_t ecs_rule_t
A rule is a query with advanced graph traversal features.
Definition flecs.h:385
struct ecs_table_record_t ecs_table_record_t
Information about where in a table a specific (component) id is stored.
Definition flecs.h:444
struct ecs_id_record_t ecs_id_record_t
Information about a (component) id, such as type info and tables with the id.
Definition flecs.h:441
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:332
struct ecs_mixins_t ecs_mixins_t
Type that stores poly mixins.
Definition flecs.h:471
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
Definition flecs.h:281
struct ecs_query_t ecs_query_t
A query that caches its results.
Definition flecs.h:364
struct ecs_observable_t ecs_observable_t
An observable produces events that can be listened for by an observer.
Definition flecs.h:408
struct ecs_record_t ecs_record_t
Information about an entity, like its table and row.
Definition flecs.h:438
struct ecs_table_t ecs_table_t
A table stores entities and components for a specific type.
Definition flecs.h:335
void ecs_poly_t
A poly object.
Definition flecs.h:468
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 the specified relationship.
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 term 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.
bool ecs_term_match_this(const ecs_term_t *term)
Is term matched on $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.
bool ecs_term_match_0(const ecs_term_t *term)
Is term matched on 0 source.
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:583
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:563
uint64_t(* ecs_hash_value_action_t)(const void *ptr)
Callback used for hashing values.
Definition flecs.h:601
void(* ecs_iter_fini_action_t)(ecs_iter_t *it)
Function prototype for freeing an iterator.
Definition flecs.h:541
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:552
bool(* ecs_iter_next_action_t)(ecs_iter_t *it)
Function prototype for iterating an iterator.
Definition flecs.h:533
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
Definition flecs.h:506
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:611
int(* ecs_compare_action_t)(const void *ptr1, const void *ptr2)
Callback used for sorting values.
Definition flecs.h:596
void(* ecs_fini_action_t)(ecs_world_t *world, void *ctx)
Action callback on world exit.
Definition flecs.h:587
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:618
void(* ecs_run_action_t)(ecs_iter_t *it)
Function prototype for runnables (systems, observers).
Definition flecs.h:497
void(* ecs_ctx_free_t)(void *ctx)
Function to cleanup context data.
Definition flecs.h:592
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:545
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:520
void(* ecs_xtor_t)(void *ptr, int32_t count, const ecs_type_info_t *type_info)
Constructor/destructor callback.
Definition flecs.h:605
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.
void * ecs_get_mut_modified_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Combines get_mut + modifed in single operation.
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.
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.
void * ecs_observer_get_ctx(const ecs_world_t *world, ecs_entity_t observer)
Get observer ctx.
bool ecs_observer_default_run_action(ecs_iter_t *it)
Default run action for observer.
void * ecs_observer_get_binding_ctx(const ecs_world_t *world, ecs_entity_t observer)
Get observer binding ctx.
#define FLECS_TERM_DESC_MAX
Maximum number of terms in ecs_filter_desc_t.
Definition flecs.h:238
#define FLECS_EVENT_DESC_MAX
Maximum number of events in ecs_observer_desc_t.
Definition flecs.h:242
#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:233
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.
ecs_entity_t ecs_lookup_symbol(const ecs_world_t *world, const char *symbol, bool lookup_as_path, bool recursive)
Lookup an entity by its symbol 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.
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.
void * ecs_query_get_ctx(const ecs_query_t *query)
Get query ctx.
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.
void * ecs_query_get_binding_ctx(const ecs_query_t *query)
Get query binding ctx.
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:651
ecs_oper_kind_t
Specify operator for term.
Definition flecs.h:660
ecs_filter_t ECS_FILTER_INIT
Use $this variable to initialize user-allocated filter object.
@ EcsOut
Term is only written.
Definition flecs.h:656
@ EcsInOut
Term is both read and written.
Definition flecs.h:654
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition flecs.h:652
@ EcsInOutNone
Term is neither read nor written.
Definition flecs.h:653
@ EcsIn
Term is only read.
Definition flecs.h:655
@ EcsNot
The term must not match.
Definition flecs.h:663
@ EcsOptional
The term may match.
Definition flecs.h:664
@ EcsOr
One of the terms in an or chain must match.
Definition flecs.h:662
@ EcsOrFrom
Term must match at least one component from term id.
Definition flecs.h:666
@ EcsAnd
The term must match.
Definition flecs.h:661
@ EcsNotFrom
Term must match none of the components from term id.
Definition flecs.h:667
@ EcsAndFrom
Term must match all components from term id.
Definition flecs.h:665
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.
bool ecs_table_has_flags(ecs_table_t *table, ecs_flags32_t flags)
Test table for flags.
int32_t ecs_table_column_to_type_index(const ecs_table_t *table, int32_t index)
Convert column index to type index.
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.
int32_t ecs_table_column_count(const ecs_table_t *table)
Return number of columns in table.
bool ecs_commit(ecs_world_t *world, ecs_entity_t entity, ecs_record_t *record, ecs_table_t *table, const ecs_type_t *added, const ecs_type_t *removed)
Commit (move) entity to a table.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get column from table by column index.
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_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.
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.
int32_t ecs_table_get_column_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Get column index for id.
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.
int32_t ecs_table_get_type_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Get type index for id.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get column size from table.
int32_t ecs_table_type_to_column_index(const ecs_table_t *table, int32_t index)
Convert type index to column index.
int ecs_value_fini_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
Destruct a value.
int ecs_value_fini(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Destruct a value.
int ecs_value_copy(const ecs_world_t *world, ecs_entity_t type, void *dst, const void *src)
Copy 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)
Create a new world with just the core module.
ecs_world_t * ecs_init(void)
Create a new world.
ecs_world_t * ecs_init_w_args(int argc, char *argv[])
Create a new world with arguments.
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.
bool ecs_poly_is_(const ecs_poly_t *object, int32_t type)
Test if pointer is of specified type.
ecs_entity_t ecs_get_max_id(const ecs_world_t *world)
Get the largest issued entity id (not counting generation).
void ecs_run_aperiodic(ecs_world_t *world, ecs_flags32_t flags)
Force aperiodic actions.
void * ecs_get_binding_ctx(const ecs_world_t *world)
Get the world binding context.
void ecs_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.
void ecs_set_ctx(ecs_world_t *world, void *ctx, ecs_ctx_free_t ctx_free)
Set a 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.
void ecs_set_binding_ctx(ecs_world_t *world, void *ctx, ecs_ctx_free_t ctx_free)
Set a world binding context.
bool ecs_enable_range_check(ecs_world_t *world, bool enable)
Enable/disable range limits.
void * ecs_get_ctx(const ecs_world_t *world)
Get the world context.
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:1265
ecs_size_t size
Component size.
Definition flecs.h:1266
ecs_size_t alignment
Component alignment.
Definition flecs.h:1267
A (string) identifier.
Definition flecs.h:1256
ecs_size_t length
Length of identifier.
Definition flecs.h:1258
char * value
Identifier string.
Definition flecs.h:1257
ecs_hashmap_t * index
Current index.
Definition flecs.h:1261
uint64_t hash
Hash of current value.
Definition flecs.h:1259
uint64_t index_hash
Hash of existing record in current index.
Definition flecs.h:1260
Component for storing a poly object.
Definition flecs.h:1271
ecs_poly_t * poly
Pointer to poly object.
Definition flecs.h:1272
Apply a rate filter to a tick source.
Definition timer.h:45
Target data for flattened relationships.
Definition flecs.h:1276
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:919
void ** data
Array with component data to insert.
Definition flecs.h:931
ecs_id_t ids[(32)]
Ids to create the entities with.
Definition flecs.h:929
int32_t count
Number of entities to create/populate.
Definition flecs.h:927
ecs_entity_t * entities
Entities to bulk insert.
Definition flecs.h:922
ecs_table_t * table
Table to insert the entities into.
Definition flecs.h:938
Used with ecs_component_init.
Definition flecs.h:949
ecs_type_info_t type
Parameters for type (size, hooks, ...)
Definition flecs.h:956
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition flecs.h:953
Used with ecs_entity_init.
Definition flecs.h:878
const char * sep
Optional custom separator for hierarchical names.
Definition flecs.h:888
const char * root_sep
Optional, used for identifiers relative to root.
Definition flecs.h:892
const char * name
Name of the entity.
Definition flecs.h:883
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:904
ecs_id_t add[(32)]
Array of ids to add to the new or existing entity.
Definition flecs.h:909
const char * symbol
Optional entity symbol.
Definition flecs.h:894
const char * add_expr
String expression with components to add.
Definition flecs.h:912
ecs_entity_t id
Set to modify existing entity (optional)
Definition flecs.h:881
Used with ecs_emit.
Definition flecs.h:1124
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
Definition flecs.h:1149
ecs_table_t * table
The table for which to notify.
Definition flecs.h:1134
int32_t count
Limit number of notified entities to count.
Definition flecs.h:1146
ecs_table_t * other_table
Optional 2nd table to notify.
Definition flecs.h:1138
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
Definition flecs.h:1141
const ecs_type_t * ids
Component ids.
Definition flecs.h:1131
ecs_poly_t * observable
Observable (usually the world)
Definition flecs.h:1163
ecs_entity_t event
The event id.
Definition flecs.h:1126
ecs_flags32_t flags
Event flags.
Definition flecs.h:1166
void * param
Optional context.
Definition flecs.h:1155
Used with ecs_filter_init.
Definition flecs.h:963
ecs_term_t * terms_buffer
For filters with lots of terms an outside array can be provided.
Definition flecs.h:971
bool instanced
When true, terms returned by an iterator may either contain 1 or N elements, where terms with N eleme...
Definition flecs.h:984
ecs_term_t terms[(16)]
Terms of the filter.
Definition flecs.h:968
int32_t terms_buffer_count
Number of terms in array provided in terms_buffer.
Definition flecs.h:974
ecs_entity_t entity
Entity associated with query (optional)
Definition flecs.h:993
ecs_flags32_t flags
Flags for advanced usage.
Definition flecs.h:987
ecs_filter_t * storage
External storage to prevent allocation of the filter object.
Definition flecs.h:977
const char * expr
Filter expression.
Definition flecs.h:990
Filters alllow for ad-hoc quick filtering of entity tables.
Definition flecs.h:750
ecs_term_t * terms
Array containing terms for filter.
Definition flecs.h:758
int32_t * sizes
Field size (same for each result)
Definition flecs.h:760
int8_t term_count
Number of elements in terms array.
Definition flecs.h:753
ecs_flags64_t data_fields
Bitset with fields that have data.
Definition flecs.h:756
ecs_flags32_t flags
Filter flags.
Definition flecs.h:755
ecs_world_t * world
World mixin.
Definition flecs.h:766
int8_t field_count
Number of fields in iterator for filter.
Definition flecs.h:754
char * variable_names[1]
Placeholder variable names array.
Definition flecs.h:759
ecs_poly_dtor_t dtor
Dtor mixin.
Definition flecs.h:765
ecs_entity_t entity
Entity associated with filter (optional)
Definition flecs.h:763
ecs_iterable_t iterable
Iterable mixin.
Definition flecs.h:764
Header for ecs_poly_t objects.
Definition flecs.h:474
Iterable mixin.
Definition flecs.h:638
ecs_iter_init_action_t init
Callback that creates iterator.
Definition flecs.h:639
Used with ecs_observer_init.
Definition flecs.h:1069
void * binding_ctx
Context to be used for language bindings.
Definition flecs.h:1101
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:1104
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition flecs.h:1073
ecs_filter_desc_t filter
Filter for observer.
Definition flecs.h:1076
int32_t term_index
Used for internal purposes.
Definition flecs.h:1117
ecs_entity_t events[(8)]
Events to observe (OnAdd, OnRemove, OnSet, UnSet)
Definition flecs.h:1079
int32_t * last_event_id
Optional shared last event id for multiple observers.
Definition flecs.h:1114
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:1107
void * ctx
User context to pass to callback.
Definition flecs.h:1098
ecs_poly_t * observable
Observable with which to register the observer.
Definition flecs.h:1110
ecs_iter_action_t callback
Callback to invoke on an event, invoked when the observer matches.
Definition flecs.h:1087
bool yield_existing
When observer is created, generate events from existing data.
Definition flecs.h:1084
ecs_run_action_t run
Callback invoked on an event.
Definition flecs.h:1095
ecs_iter_action_t callback
See ecs_observer_desc_t::callback.
Definition flecs.h:779
int32_t term_index
Index of the term in parent observer (single term observers only)
Definition flecs.h:794
ecs_observable_t * observable
Observable for observer.
Definition flecs.h:788
ecs_run_action_t run
See ecs_observer_desc_t::run.
Definition flecs.h:780
int32_t * last_event_id
Last handled event id.
Definition flecs.h:790
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:785
ecs_filter_t filter
Query for observer.
Definition flecs.h:773
void * ctx
Callback context.
Definition flecs.h:782
ecs_id_t register_id
Id observer is registered with (single term observers only)
Definition flecs.h:793
void * binding_ctx
Binding context (for language bindings)
Definition flecs.h:783
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:796
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:786
bool is_multi
If true, the observer triggers on more than one term.
Definition flecs.h:800
Used with ecs_query_init.
Definition flecs.h:1000
ecs_order_by_action_t order_by
Callback used for ordering query results.
Definition flecs.h:1012
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:1059
ecs_id_t group_by_id
Id to be used by group_by.
Definition flecs.h:1021
ecs_group_by_action_t group_by
Callback used for grouping results.
Definition flecs.h:1028
void * ctx
User context to pass to callback.
Definition flecs.h:1053
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
Definition flecs.h:1042
void * group_by_ctx
Context to pass to group_by.
Definition flecs.h:1039
void * binding_ctx
Context to be used for language bindings.
Definition flecs.h:1056
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
Definition flecs.h:1032
ecs_query_t * parent
If set, the query will be created as a subquery.
Definition flecs.h:1050
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:1062
ecs_entity_t order_by_component
Component to be used by order_by.
Definition flecs.h:1007
ecs_filter_desc_t filter
Filter for the query.
Definition flecs.h:1004
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Definition flecs.h:1036
ecs_sort_table_action_t sort_table
Callback used for ordering query results.
Definition flecs.h:1016
Type that contains information about a query group.
Definition flecs.h:1241
int32_t table_count
Number of tables in group.
Definition flecs.h:1243
void * ctx
Group context, returned by on_group_create.
Definition flecs.h:1244
int32_t match_count
How often tables have been matched/unmatched.
Definition flecs.h:1242
Type that describes a single identifier in a term.
Definition flecs.h:701
ecs_flags32_t flags
Term flags.
Definition flecs.h:718
ecs_entity_t trav
Relationship to traverse when looking for the component.
Definition flecs.h:714
const char * name
Name.
Definition flecs.h:708
ecs_entity_t id
Entity id.
Definition flecs.h:702
Type that describes a term (single element in a query)
Definition flecs.h:722
ecs_term_id_t second
Second element of pair.
Definition flecs.h:730
ecs_id_t id
Component id to be matched by term.
Definition flecs.h:723
char * name
Name of term.
Definition flecs.h:736
ecs_term_id_t src
Source of term.
Definition flecs.h:728
ecs_id_record_t * idr
Cached pointer to internal index.
Definition flecs.h:739
ecs_term_id_t first
Component or first element of pair.
Definition flecs.h:729
int32_t field_index
Index of field for term in iterator.
Definition flecs.h:738
ecs_id_t id_flags
Id flags of term id.
Definition flecs.h:735
bool move
Used by internals.
Definition flecs.h:743
ecs_flags16_t flags
Flags that help eval, set by ecs_filter_init.
Definition flecs.h:741
ecs_inout_kind_t inout
Access to contents matched by term.
Definition flecs.h:732
ecs_oper_kind_t oper
Operator of term.
Definition flecs.h:733
Type that contains component lifecycle callbacks.
Definition flecs.h:812
ecs_copy_t copy_ctor
Ctor + copy.
Definition flecs.h:819
void * ctx
User defined context.
Definition flecs.h:850
ecs_iter_action_t on_remove
Callback that is invoked when an instance of the component is removed.
Definition flecs.h:848
void * binding_ctx
Language binding context.
Definition flecs.h:851
ecs_move_t move_dtor
Move + dtor.
Definition flecs.h:834
ecs_copy_t copy
copy assignment
Definition flecs.h:815
ecs_iter_action_t on_set
Callback that is invoked when an instance of the component is set.
Definition flecs.h:843
ecs_move_t move
move assignment
Definition flecs.h:816
ecs_xtor_t ctor
ctor
Definition flecs.h:813
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:853
ecs_iter_action_t on_add
Callback that is invoked when an instance of a component is added.
Definition flecs.h:838
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:854
ecs_move_t move_ctor
Ctor + move.
Definition flecs.h:822
ecs_move_t ctor_move_dtor
Ctor + move + dtor (or move_ctor + dtor).
Definition flecs.h:828
ecs_xtor_t dtor
dtor
Definition flecs.h:814
Type that contains component information (passed to ctors/dtors/...)
Definition flecs.h:861
ecs_size_t alignment
Alignment of type.
Definition flecs.h:863
ecs_size_t size
Size of type.
Definition flecs.h:862
const char * name
Type name.
Definition flecs.h:866
ecs_entity_t component
Handle to component (do not set)
Definition flecs.h:865
ecs_type_hooks_t hooks
Type hooks.
Definition flecs.h:864
A type is a list of (component) ids.
Definition flecs.h:305
Type that contains information about the world.
Definition flecs.h:1183
int64_t get_mut_count
get_mut/emplace commands processed
Definition flecs.h:1226
float delta_time
Time passed to or computed by ecs_progress.
Definition flecs.h:1189
ecs_entity_t min_id
First allowed entity id.
Definition flecs.h:1185
int64_t set_count
set commands processed
Definition flecs.h:1225
float world_time_total
Time elapsed in simulation.
Definition flecs.h:1196
int32_t tag_id_count
Number of tag (no data) ids in the world.
Definition flecs.h:1212
int32_t component_id_count
Number of component (data) ids in the world.
Definition flecs.h:1213
int64_t pipeline_build_count_total
Total number of pipeline builds.
Definition flecs.h:1208
int32_t table_count
Number of tables.
Definition flecs.h:1216
float delta_time_raw
Raw delta time (no time scaling)
Definition flecs.h:1188
float frame_time_total
Total time spent processing a frame.
Definition flecs.h:1192
float world_time_total_raw
Time elapsed in simulation (no scaling)
Definition flecs.h:1197
int64_t table_create_total
Total number of times a table was created.
Definition flecs.h:1206
int64_t observers_ran_frame
Total number of times observer was invoked.
Definition flecs.h:1210
float system_time_total
Total time spent in systems.
Definition flecs.h:1193
int64_t id_delete_total
Total number of times an id was deleted.
Definition flecs.h:1205
int64_t systems_ran_frame
Total number of systems ran in last frame.
Definition flecs.h:1209
float merge_time_total
Total time spent in merges.
Definition flecs.h:1195
int64_t discard_count
commands discarded, happens when entity is no longer alive when running the command
Definition flecs.h:1229
int64_t clear_count
clear commands processed
Definition flecs.h:1224
ecs_entity_t last_component_id
Last issued component entity id.
Definition flecs.h:1184
int32_t empty_table_count
Number of tables without entities.
Definition flecs.h:1217
int64_t frame_count_total
Total number of frames.
Definition flecs.h:1200
ecs_entity_t max_id
Last allowed entity id.
Definition flecs.h:1186
int64_t merge_count_total
Total number of merges.
Definition flecs.h:1201
int64_t other_count
other commands processed
Definition flecs.h:1228
int64_t batched_command_count
commands batched
Definition flecs.h:1231
int64_t table_delete_total
Total number of times a table was deleted.
Definition flecs.h:1207
int64_t delete_count
delete commands processed
Definition flecs.h:1223
int64_t rematch_count_total
Total number of rematches.
Definition flecs.h:1202
int64_t id_create_total
Total number of times a new id was created.
Definition flecs.h:1204
int64_t batched_entity_count
entities for which commands were batched
Definition flecs.h:1230
float time_scale
Time scale applied to delta_time.
Definition flecs.h:1190
int32_t pair_id_count
Number of pair ids in the world.
Definition flecs.h:1214
float rematch_time_total
Time spent on query rematching.
Definition flecs.h:1198
float target_fps
Target fps.
Definition flecs.h:1191
float emit_time_total
Total time spent notifying observers.
Definition flecs.h:1194
int64_t modified_count
modified commands processed
Definition flecs.h:1227
const char * name_prefix
Value set by ecs_set_name_prefix.
Definition flecs.h:1234
int64_t add_count
add commands processed
Definition flecs.h:1221
int64_t remove_count
remove commands processed
Definition flecs.h:1222
flecs::term term() const
Create a term for a (component) type.