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_ALERTS
153#define FLECS_SYSTEM
154#define FLECS_PIPELINE
155#define FLECS_TIMER
156#define FLECS_META
157#define FLECS_META_C
158#define FLECS_UNITS
159#define FLECS_EXPR
160#define FLECS_JSON
161#define FLECS_DOC
162#define FLECS_COREDOC
163#define FLECS_LOG
164#define FLECS_APP
165#define FLECS_OS_API_IMPL
166#define FLECS_HTTP
167#define FLECS_REST
168// #define FLECS_JOURNAL /**< Journaling addon (disabled by default) */
169#endif // ifndef FLECS_CUSTOM_BUILD
170
174// #define FLECS_LOW_FOOTPRINT
175#ifdef FLECS_LOW_FOOTPRINT
176#define FLECS_HI_COMPONENT_ID (16)
177#define FLECS_HI_ID_RECORD_ID (16)
178#define FLECS_SPARSE_PAGE_BITS (6)
179#define FLECS_ENTITY_PAGE_BITS (6)
180#define FLECS_USE_OS_ALLOC
181#endif
182
193#ifndef FLECS_HI_COMPONENT_ID
194#define FLECS_HI_COMPONENT_ID (256)
195#endif
196
203#ifndef FLECS_HI_ID_RECORD_ID
204#define FLECS_HI_ID_RECORD_ID (1024)
205#endif
206
212#ifndef FLECS_SPARSE_PAGE_BITS
213#define FLECS_SPARSE_PAGE_BITS (12)
214#endif
215
218#ifndef FLECS_ENTITY_PAGE_BITS
219#define FLECS_ENTITY_PAGE_BITS (12)
220#endif
221
226// #define FLECS_USE_OS_ALLOC
227
230#ifndef FLECS_ID_DESC_MAX
231#define FLECS_ID_DESC_MAX (32)
232#endif
233
236#define FLECS_TERM_DESC_MAX (16)
237
240#define FLECS_EVENT_DESC_MAX (8)
241
244#define FLECS_VARIABLE_COUNT_MAX (64)
245
248#define FLECS_QUERY_SCOPE_NESTING_MAX (8)
249
252#include "flecs/private/api_defines.h"
253#include "flecs/private/vec.h" /* Vector datatype */
254#include "flecs/private/sparse.h" /* Sparse set */
255#include "flecs/private/block_allocator.h" /* Block allocator */
256#include "flecs/private/map.h" /* Map */
257#include "flecs/private/allocator.h" /* Allocator */
258#include "flecs/private/strbuf.h" /* String builder */
259#include "flecs/os_api.h" /* Abstraction for operating system functions */
260
261#ifdef __cplusplus
262extern "C" {
263#endif
264
279typedef uint64_t ecs_id_t;
280
283
285typedef struct {
286 ecs_id_t *array;
287 int32_t count;
288} ecs_type_t;
289
292
295
297typedef struct ecs_term_t ecs_term_t;
298
301
304
306typedef struct ecs_rule_t ecs_rule_t;
307
310
313
314/* An iterator lets an application iterate entities across tables. */
315typedef struct ecs_iter_t ecs_iter_t;
316
318typedef struct ecs_ref_t ecs_ref_t;
319
322
325
326/* Internal index that stores tables tables for a (component) id */
327typedef struct ecs_id_record_t ecs_id_record_t;
328
329/* Internal table storage record */
330typedef struct ecs_table_record_t ecs_table_record_t;
331
354typedef void ecs_poly_t;
355
358
360typedef struct ecs_header_t {
361 int32_t magic; /* Magic number verifying it's a flecs object */
362 int32_t type; /* Magic number indicating which type of flecs object */
363 ecs_mixins_t *mixins; /* Table with offsets to (optional) mixins */
365
383typedef void (*ecs_run_action_t)(
384 ecs_iter_t *it);
385
392typedef void (*ecs_iter_action_t)(
393 ecs_iter_t *it);
394
407 const ecs_world_t *world,
408 const ecs_poly_t *iterable,
409 ecs_iter_t *it,
410 ecs_term_t *filter);
411
420 ecs_iter_t *it);
421
428 ecs_iter_t *it);
429
432 ecs_entity_t e1,
433 const void *ptr1,
434 ecs_entity_t e2,
435 const void *ptr2);
436
439 ecs_world_t* world,
440 ecs_table_t* table,
441 ecs_entity_t* entities,
442 void* ptr,
443 int32_t size,
444 int32_t lo,
445 int32_t hi,
446 ecs_order_by_action_t order_by);
447
449typedef uint64_t (*ecs_group_by_action_t)(
450 ecs_world_t *world,
451 ecs_table_t *table,
452 ecs_id_t group_id,
453 void *ctx);
454
455/* Callback invoked when a query creates a new group. */
456typedef void* (*ecs_group_create_action_t)(
457 ecs_world_t *world,
458 uint64_t group_id,
459 void *group_by_ctx); /* from ecs_query_desc_t */
460
461/* Callback invoked when a query deletes an existing group. */
462typedef void (*ecs_group_delete_action_t)(
463 ecs_world_t *world,
464 uint64_t group_id,
465 void *group_ctx, /* return value from ecs_group_create_action_t */
466 void *group_by_ctx); /* from ecs_query_desc_t */
467
469typedef void (*ecs_module_action_t)(
470 ecs_world_t *world);
471
473typedef void (*ecs_fini_action_t)(
474 ecs_world_t *world,
475 void *ctx);
476
478typedef void (*ecs_ctx_free_t)(
479 void *ctx);
480
482typedef int (*ecs_compare_action_t)(
483 const void *ptr1,
484 const void *ptr2);
485
487typedef uint64_t (*ecs_hash_value_action_t)(
488 const void *ptr);
489
491typedef void (*ecs_xtor_t)(
492 void *ptr,
493 int32_t count,
494 const ecs_type_info_t *type_info);
495
497typedef void (*ecs_copy_t)(
498 void *dst_ptr,
499 const void *src_ptr,
500 int32_t count,
501 const ecs_type_info_t *type_info);
502
504typedef void (*ecs_move_t)(
505 void *dst_ptr,
506 void *src_ptr,
507 int32_t count,
508 const ecs_type_info_t *type_info);
509
510/* Destructor function for poly objects */
511typedef void (*ecs_poly_dtor_t)(
512 ecs_poly_t *poly);
513
524typedef struct ecs_iterable_t {
527
537typedef enum ecs_inout_kind_t {
544
546typedef enum ecs_oper_kind_t {
555
556/* Term id flags */
557#define EcsSelf (1u << 1)
558#define EcsUp (1u << 2)
559#define EcsDown (1u << 3)
560#define EcsTraverseAll (1u << 4)
561#define EcsCascade (1u << 5)
562#define EcsParent (1u << 6)
563#define EcsIsVariable (1u << 7)
564#define EcsIsEntity (1u << 8)
565#define EcsIsName (1u << 9)
566#define EcsFilter (1u << 10)
567#define EcsTraverseFlags (EcsUp|EcsDown|EcsTraverseAll|EcsSelf|EcsCascade|EcsParent)
568
569/* Term flags discovered & set during filter creation. */
570#define EcsTermMatchAny (1u << 0)
571#define EcsTermMatchAnySrc (1u << 1)
572#define EcsTermSrcFirstEq (1u << 2)
573#define EcsTermSrcSecondEq (1u << 3)
574#define EcsTermTransitive (1u << 4)
575#define EcsTermReflexive (1u << 5)
576#define EcsTermIdInherited (1u << 6)
577
578/* Term flags used for term iteration */
579#define EcsTermMatchDisabled (1u << 7)
580#define EcsTermMatchPrefab (1u << 8)
581
583typedef struct ecs_term_id_t {
590 const char *name;
600 ecs_flags32_t flags;
602
618 char *name;
620 int32_t field_index;
621 ecs_id_record_t *idr;
623 ecs_flags16_t flags;
625 bool move;
626};
627
629FLECS_API extern ecs_filter_t ECS_FILTER_INIT;
630
633 ecs_header_t hdr;
634
636 int32_t term_count;
637 int32_t field_count;
639 bool owned;
642 ecs_flags32_t flags;
644 char *variable_names[1];
645 int32_t *sizes;
647 /* Mixins */
650 ecs_poly_dtor_t dtor;
652};
653
654/* An observer reacts to events matching a filter */
656 ecs_header_t hdr;
657
660 /* Observer events */
662 int32_t event_count;
663
667 void *ctx;
675 int32_t *last_event_id;
676 int32_t last_event_id_storage;
677
679 int32_t term_index;
685 bool is_multi;
687 /* Mixins */
688 ecs_poly_dtor_t dtor;
689};
690
705
708
714
720
724
729
734
735 void *ctx;
740};
741
747 ecs_size_t size;
748 ecs_size_t alignment;
751 const char *name;
752};
753
754#include "flecs/private/api_types.h" /* Supporting API types */
755#include "flecs/private/api_support.h" /* Supporting API functions */
756#include "flecs/private/vec.h" /* Vector */
757#include "flecs/private/hashmap.h" /* Hashmap */
758
763typedef struct ecs_entity_desc_t {
764 int32_t _canary;
765
768 const char *name;
773 const char *sep;
777 const char *root_sep;
779 const char *symbol;
795
797 const char *add_expr;
799
804typedef struct ecs_bulk_desc_t {
805 int32_t _canary;
806
812 int32_t count;
816 void **data;
829
834typedef struct ecs_component_desc_t {
835 int32_t _canary;
836
839
843
848typedef struct ecs_filter_desc_t {
849 int32_t _canary;
850
854
857
860
863
870
872 ecs_flags32_t flags;
873
875 const char *expr;
876
880
885typedef struct ecs_query_desc_t {
886 int32_t _canary;
887
890
893
898
902
907
914
917 ecs_group_create_action_t on_group_create;
918
921 ecs_group_delete_action_t on_group_delete;
922
925
928
937
942typedef struct ecs_observer_desc_t {
943 int32_t _canary;
944
947
950
953
958
961
969
971 void *ctx;
972
975
978
981
984
988
990 int32_t term_index;
992
999/* Utility to hold a value of a dynamic type */
1000typedef struct ecs_value_t {
1001 ecs_entity_t type;
1002 void *ptr;
1003} ecs_value_t;
1004
1006typedef struct ecs_world_info_t {
1035 int32_t id_count;
1041 int32_t table_count;
1048 /* -- Command counts -- */
1049 struct {
1050 int64_t add_count;
1053 int64_t clear_count;
1054 int64_t set_count;
1057 int64_t other_count;
1061 } cmd;
1062
1063 const char *name_prefix;
1068
1071 int32_t match_count;
1072 int32_t table_count;
1073 void *ctx;
1075
1085typedef struct EcsIdentifier {
1086 char *value;
1087 ecs_size_t length;
1088 uint64_t hash;
1089 uint64_t index_hash;
1090 ecs_hashmap_t *index;
1092
1094typedef struct EcsComponent {
1095 ecs_size_t size;
1096 ecs_size_t alignment;
1098
1100typedef struct EcsPoly {
1103
1105typedef struct EcsTarget {
1106 int32_t count;
1107 ecs_record_t *target;
1109
1112
1116/* Only include deprecated definitions if deprecated addon is required */
1117#ifdef FLECS_DEPRECATED
1119#endif
1120
1134#define ECS_ID_FLAG_BIT (1ull << 63)
1135
1137FLECS_API extern const ecs_id_t ECS_PAIR;
1138
1140FLECS_API extern const ecs_id_t ECS_OVERRIDE;
1141
1143FLECS_API extern const ecs_id_t ECS_TOGGLE;
1144
1146FLECS_API extern const ecs_id_t ECS_AND;
1147
1155/* Builtin component ids */
1156FLECS_API extern const ecs_entity_t ecs_id(EcsComponent);
1157FLECS_API extern const ecs_entity_t ecs_id(EcsIdentifier);
1158FLECS_API extern const ecs_entity_t ecs_id(EcsIterable);
1159FLECS_API extern const ecs_entity_t ecs_id(EcsPoly);
1160
1161FLECS_API extern const ecs_entity_t EcsQuery;
1162FLECS_API extern const ecs_entity_t EcsObserver;
1163
1164/* System module component ids */
1165FLECS_API extern const ecs_entity_t EcsSystem;
1166FLECS_API extern const ecs_entity_t ecs_id(EcsTickSource);
1167
1168/* Pipeline module component ids */
1169FLECS_API extern const ecs_entity_t ecs_id(EcsPipelineQuery);
1170
1171/* Timer module component ids */
1172FLECS_API extern const ecs_entity_t ecs_id(EcsTimer);
1173FLECS_API extern const ecs_entity_t ecs_id(EcsRateFilter);
1174
1176FLECS_API extern const ecs_entity_t EcsFlecs;
1177
1179FLECS_API extern const ecs_entity_t EcsFlecsCore;
1180
1182FLECS_API extern const ecs_entity_t EcsWorld;
1183
1185FLECS_API extern const ecs_entity_t EcsWildcard;
1186
1188FLECS_API extern const ecs_entity_t EcsAny;
1189
1191FLECS_API extern const ecs_entity_t EcsThis;
1192
1194FLECS_API extern const ecs_entity_t EcsVariable;
1195
1200FLECS_API extern const ecs_entity_t EcsTransitive;
1201
1206FLECS_API extern const ecs_entity_t EcsReflexive;
1207
1215FLECS_API extern const ecs_entity_t EcsFinal;
1216
1222FLECS_API extern const ecs_entity_t EcsDontInherit;
1223
1229FLECS_API extern const ecs_entity_t EcsAlwaysOverride;
1230
1235FLECS_API extern const ecs_entity_t EcsSymmetric;
1236
1243FLECS_API extern const ecs_entity_t EcsExclusive;
1244
1246FLECS_API extern const ecs_entity_t EcsAcyclic;
1247
1250FLECS_API extern const ecs_entity_t EcsTraversable;
1251
1258FLECS_API extern const ecs_entity_t EcsWith;
1259
1266FLECS_API extern const ecs_entity_t EcsOneOf;
1267
1270FLECS_API extern const ecs_entity_t EcsTag;
1271
1275FLECS_API extern const ecs_entity_t EcsUnion;
1276
1278FLECS_API extern const ecs_entity_t EcsName;
1279
1281FLECS_API extern const ecs_entity_t EcsSymbol;
1282
1284FLECS_API extern const ecs_entity_t EcsAlias;
1285
1287FLECS_API extern const ecs_entity_t EcsChildOf;
1288
1290FLECS_API extern const ecs_entity_t EcsIsA;
1291
1293FLECS_API extern const ecs_entity_t EcsDependsOn;
1294
1296FLECS_API extern const ecs_entity_t EcsSlotOf;
1297
1299FLECS_API extern const ecs_entity_t EcsModule;
1300
1302FLECS_API extern const ecs_entity_t EcsPrivate;
1303
1306FLECS_API extern const ecs_entity_t EcsPrefab;
1307
1309FLECS_API extern const ecs_entity_t EcsDisabled;
1310
1312FLECS_API extern const ecs_entity_t EcsOnAdd;
1313
1315FLECS_API extern const ecs_entity_t EcsOnRemove;
1316
1318FLECS_API extern const ecs_entity_t EcsOnSet;
1319
1321FLECS_API extern const ecs_entity_t EcsUnSet;
1322
1324FLECS_API extern const ecs_entity_t EcsMonitor;
1325
1330FLECS_API extern const ecs_entity_t EcsOnDelete;
1331
1333FLECS_API extern const ecs_entity_t EcsOnTableCreate;
1334
1336FLECS_API extern const ecs_entity_t EcsOnTableDelete;
1337
1339FLECS_API extern const ecs_entity_t EcsOnTableEmpty;
1340
1342FLECS_API extern const ecs_entity_t EcsOnTableFill;
1343
1348FLECS_API extern const ecs_entity_t EcsOnDeleteTarget;
1349
1352FLECS_API extern const ecs_entity_t EcsRemove;
1353
1356FLECS_API extern const ecs_entity_t EcsDelete;
1357
1360FLECS_API extern const ecs_entity_t EcsPanic;
1361
1362FLECS_API extern const ecs_entity_t ecs_id(EcsTarget);
1363FLECS_API extern const ecs_entity_t EcsFlatten;
1364
1370FLECS_API extern const ecs_entity_t EcsDefaultChildComponent;
1371
1372/* Builtin predicates for comparing entity ids in queries. Only supported by rules */
1373FLECS_API extern const ecs_entity_t EcsPredEq;
1374FLECS_API extern const ecs_entity_t EcsPredMatch;
1375FLECS_API extern const ecs_entity_t EcsPredLookup;
1376
1377/* Builtin marker entities for opening/closing query scopes */
1378FLECS_API extern const ecs_entity_t EcsScopeOpen;
1379FLECS_API extern const ecs_entity_t EcsScopeClose;
1380
1382FLECS_API extern const ecs_entity_t EcsEmpty;
1383
1384/* Pipeline module tags */
1385FLECS_API extern const ecs_entity_t ecs_id(EcsPipeline);
1386FLECS_API extern const ecs_entity_t EcsOnStart;
1387FLECS_API extern const ecs_entity_t EcsPreFrame;
1388FLECS_API extern const ecs_entity_t EcsOnLoad;
1389FLECS_API extern const ecs_entity_t EcsPostLoad;
1390FLECS_API extern const ecs_entity_t EcsPreUpdate;
1391FLECS_API extern const ecs_entity_t EcsOnUpdate;
1392FLECS_API extern const ecs_entity_t EcsOnValidate;
1393FLECS_API extern const ecs_entity_t EcsPostUpdate;
1394FLECS_API extern const ecs_entity_t EcsPreStore;
1395FLECS_API extern const ecs_entity_t EcsOnStore;
1396FLECS_API extern const ecs_entity_t EcsPostFrame;
1397FLECS_API extern const ecs_entity_t EcsPhase;
1398
1401#define EcsLastInternalComponentId (ecs_id(EcsPoly))
1402
1405#define EcsFirstUserComponentId (8)
1406
1409#define EcsFirstUserEntityId (FLECS_HI_COMPONENT_ID + 128)
1410
1434FLECS_API
1436
1441FLECS_API
1443
1451FLECS_API
1453 int argc,
1454 char *argv[]);
1455
1462FLECS_API
1464 ecs_world_t *world);
1465
1471FLECS_API
1473 const ecs_world_t *world);
1474
1482FLECS_API
1484 ecs_world_t *world,
1485 ecs_fini_action_t action,
1486 void *ctx);
1487
1513FLECS_API
1515 ecs_world_t *world,
1516 ecs_ftime_t delta_time);
1517
1524FLECS_API
1526 ecs_world_t *world);
1527
1535FLECS_API
1537 ecs_world_t *world,
1538 ecs_fini_action_t action,
1539 void *ctx);
1540
1547FLECS_API
1549 ecs_world_t *world);
1550
1555FLECS_API
1557 const ecs_world_t *world);
1558
1571 ecs_world_t *world,
1572 bool enable);
1573
1585 ecs_world_t *world,
1586 bool enable);
1587
1603FLECS_API
1605 ecs_world_t *world,
1606 ecs_ftime_t fps);
1607
1644FLECS_API
1646 ecs_world_t *world);
1647
1655FLECS_API
1657 ecs_world_t *world);
1658
1669FLECS_API
1671 ecs_world_t *world);
1672
1682FLECS_API
1684 ecs_world_t *world);
1685
1691FLECS_API
1693 const ecs_world_t *world);
1694
1703FLECS_API
1705 ecs_world_t *world);
1706
1716FLECS_API
1718 ecs_world_t *world);
1719
1725FLECS_API
1727 ecs_world_t *world);
1728
1745FLECS_API
1747 ecs_world_t *world,
1748 bool automerge);
1749
1763FLECS_API
1765 ecs_world_t *world,
1766 int32_t stages);
1767
1774FLECS_API
1776 const ecs_world_t *world);
1777
1785FLECS_API
1787 const ecs_world_t *world);
1788
1804FLECS_API
1806 const ecs_world_t *world,
1807 int32_t stage_id);
1808
1816FLECS_API
1818 const ecs_world_t *world);
1819
1838FLECS_API
1840 ecs_world_t *world);
1841
1848FLECS_API
1850 ecs_world_t *stage);
1851
1858FLECS_API
1860 ecs_world_t *stage);
1861
1876FLECS_API
1878 ecs_world_t *world,
1879 void *ctx);
1880
1888FLECS_API
1890 const ecs_world_t *world);
1891
1898FLECS_API
1900 const ecs_world_t *world);
1901
1910FLECS_API
1912 ecs_world_t *world,
1913 int32_t entity_count);
1914
1930FLECS_API
1932 ecs_world_t *world,
1933 ecs_entity_t id_start,
1934 ecs_entity_t id_end);
1935
1946FLECS_API
1948 ecs_world_t *world,
1949 bool enable);
1950
1955FLECS_API
1957 const ecs_world_t *world);
1958
1972FLECS_API
1974 ecs_world_t *world,
1975 ecs_flags32_t flags);
1976
2010FLECS_API
2012 ecs_world_t *world,
2013 ecs_id_t id,
2014 uint16_t clear_generation,
2015 uint16_t delete_generation,
2016 int32_t min_id_count,
2017 double time_budget_seconds);
2018
2024FLECS_API
2026 const ecs_poly_t *poly);
2027
2033FLECS_API
2035 const ecs_poly_t *poly);
2036
2047FLECS_API
2049 const ecs_poly_t *object,
2050 int32_t type);
2051
2052#define ecs_poly_is(object, type)\
2053 ecs_poly_is_(object, type##_magic)
2054
2062FLECS_API
2064 ecs_entity_t first,
2065 ecs_entity_t second);
2066
2091FLECS_API
2093 ecs_world_t *world);
2094
2112FLECS_API
2114 ecs_world_t *world);
2115
2124FLECS_API
2126 ecs_world_t *world,
2127 ecs_id_t id);
2128
2136FLECS_API
2138 ecs_world_t *world,
2139 ecs_table_t *table);
2140
2159FLECS_API
2161 ecs_world_t *world,
2162 const ecs_entity_desc_t *desc);
2163
2190FLECS_API
2192 ecs_world_t *world,
2193 const ecs_bulk_desc_t *desc);
2194
2204FLECS_API
2206 ecs_world_t *world,
2207 ecs_id_t id,
2208 int32_t count);
2209
2221FLECS_API
2223 ecs_world_t *world,
2224 ecs_entity_t dst,
2225 ecs_entity_t src,
2226 bool copy_value);
2227
2237FLECS_API
2239 ecs_world_t *world,
2240 ecs_entity_t entity);
2241
2249FLECS_API
2251 ecs_world_t *world,
2252 ecs_id_t id);
2253
2270FLECS_API
2272 ecs_world_t *world,
2273 ecs_entity_t entity,
2274 ecs_id_t id);
2275
2284FLECS_API
2286 ecs_world_t *world,
2287 ecs_entity_t entity,
2288 ecs_id_t id);
2289
2312FLECS_API
2314 ecs_world_t *world,
2315 ecs_entity_t entity,
2316 ecs_id_t id);
2317
2326FLECS_API
2328 ecs_world_t *world,
2329 ecs_entity_t entity);
2330
2331
2339FLECS_API
2341 ecs_world_t *world,
2342 ecs_id_t id);
2343
2351FLECS_API
2353 ecs_world_t *world,
2354 ecs_id_t id);
2355
2362FLECS_API
2364 const ecs_world_t *world);
2365
2383FLECS_API
2385 ecs_world_t *world,
2386 ecs_entity_t entity,
2387 bool enabled);
2388
2402FLECS_API
2404 ecs_world_t *world,
2405 ecs_entity_t entity,
2406 ecs_id_t id,
2407 bool enable);
2408
2419FLECS_API
2421 const ecs_world_t *world,
2422 ecs_entity_t entity,
2423 ecs_id_t id);
2424
2442FLECS_API
2443const void* ecs_get_id(
2444 const ecs_world_t *world,
2445 ecs_entity_t entity,
2446 ecs_id_t id);
2447
2458FLECS_API
2460 const ecs_world_t *world,
2461 ecs_entity_t entity,
2462 ecs_id_t id);
2463
2472FLECS_API
2474 const ecs_world_t *world,
2475 ecs_ref_t *ref,
2476 ecs_id_t id);
2477
2485FLECS_API
2487 const ecs_world_t *world,
2488 ecs_ref_t *ref);
2489
2504FLECS_API
2506 ecs_world_t *world,
2507 ecs_entity_t entity,
2508 ecs_id_t id);
2509
2528FLECS_API
2529ecs_record_t* ecs_write_begin(
2530 ecs_world_t *world,
2531 ecs_entity_t entity);
2532
2539FLECS_API
2541 ecs_record_t *record);
2542
2562FLECS_API
2563const ecs_record_t* ecs_read_begin(
2564 ecs_world_t *world,
2565 ecs_entity_t entity);
2566
2572FLECS_API
2574 const ecs_record_t *record);
2575
2581FLECS_API
2583 const ecs_record_t *record);
2584
2598FLECS_API
2600 ecs_world_t *world,
2601 const ecs_record_t *record,
2602 ecs_id_t id);
2603
2612FLECS_API
2614 ecs_world_t *world,
2615 ecs_record_t *record,
2616 ecs_id_t id);
2617
2624FLECS_API
2626 ecs_world_t *world,
2627 const ecs_record_t *record,
2628 ecs_id_t id);
2629
2643FLECS_API
2645 ecs_world_t *world,
2646 ecs_entity_t entity,
2647 ecs_id_t id);
2648
2659FLECS_API
2661 ecs_world_t *world,
2662 ecs_entity_t entity,
2663 ecs_id_t id);
2664
2678FLECS_API
2680 ecs_world_t *world,
2681 ecs_entity_t entity,
2682 ecs_id_t id,
2683 size_t size,
2684 const void *ptr);
2685
2712FLECS_API
2714 const ecs_world_t *world,
2715 ecs_entity_t e);
2716
2725FLECS_API
2727 const ecs_world_t *world,
2728 ecs_entity_t e);
2729
2735FLECS_API
2737 ecs_entity_t e);
2738
2750FLECS_API
2752 ecs_world_t *world,
2753 ecs_entity_t entity);
2754
2771FLECS_API
2773 const ecs_world_t *world,
2774 ecs_entity_t e);
2775
2796FLECS_API
2798 ecs_world_t *world,
2799 ecs_entity_t entity);
2800
2819FLECS_API
2821 ecs_world_t *world,
2822 ecs_id_t id);
2823
2831FLECS_API
2833 const ecs_world_t *world,
2834 ecs_entity_t entity);
2835
2850FLECS_API
2852 const ecs_world_t *world,
2853 ecs_entity_t entity);
2854
2861FLECS_API
2863 const ecs_world_t *world,
2864 ecs_entity_t entity);
2865
2873FLECS_API
2875 const ecs_world_t *world,
2876 const ecs_type_t* type);
2877
2886FLECS_API
2888 const ecs_world_t *world,
2889 const ecs_table_t *table);
2890
2902FLECS_API
2904 const ecs_world_t *world,
2905 ecs_entity_t entity);
2906
2915FLECS_API
2917 const ecs_world_t *world,
2918 ecs_entity_t entity,
2919 ecs_id_t id);
2920
2930FLECS_API
2932 const ecs_world_t *world,
2933 ecs_entity_t entity,
2934 ecs_id_t id);
2935
2950FLECS_API
2952 const ecs_world_t *world,
2953 ecs_entity_t entity,
2954 ecs_entity_t rel,
2955 int32_t index);
2956
2965FLECS_API
2967 const ecs_world_t *world,
2968 ecs_entity_t entity);
2969
2988FLECS_API
2990 const ecs_world_t *world,
2991 ecs_entity_t entity,
2992 ecs_entity_t rel,
2993 ecs_id_t id);
2994
3005FLECS_API
3007 const ecs_world_t *world,
3008 ecs_entity_t entity,
3009 ecs_entity_t rel);
3010
3011typedef struct ecs_flatten_desc_t {
3012 /* When true, the flatten operation will not remove names from entities in
3013 * the flattened tree. This may fail if entities from different subtrees
3014 * have the same name. */
3015 bool keep_names;
3016
3017 /* When true, the flattened tree won't contain information about the
3018 * original depth of the entities. This can reduce fragmentation, but may
3019 * cause existing code, such as cascade queries, to no longer work. */
3020 bool lose_depth;
3022
3047FLECS_API
3049 ecs_world_t *world,
3050 ecs_id_t pair,
3051 const ecs_flatten_desc_t *desc);
3052
3060FLECS_API
3062 const ecs_world_t *world,
3063 ecs_id_t entity);
3064
3081FLECS_API
3082const char* ecs_get_name(
3083 const ecs_world_t *world,
3084 ecs_entity_t entity);
3085
3093FLECS_API
3094const char* ecs_get_symbol(
3095 const ecs_world_t *world,
3096 ecs_entity_t entity);
3097
3109FLECS_API
3111 ecs_world_t *world,
3112 ecs_entity_t entity,
3113 const char *name);
3114
3126FLECS_API
3128 ecs_world_t *world,
3129 ecs_entity_t entity,
3130 const char *symbol);
3131
3143FLECS_API
3145 ecs_world_t *world,
3146 ecs_entity_t entity,
3147 const char *alias);
3148
3157FLECS_API
3159 const ecs_world_t *world,
3160 const char *name);
3161
3171FLECS_API
3173 const ecs_world_t *world,
3174 ecs_entity_t parent,
3175 const char *name);
3176
3195FLECS_API
3197 const ecs_world_t *world,
3198 ecs_entity_t parent,
3199 const char *path,
3200 const char *sep,
3201 const char *prefix,
3202 bool recursive);
3203
3217FLECS_API
3219 const ecs_world_t *world,
3220 const char *symbol,
3221 bool lookup_as_path,
3222 bool recursive);
3223
3243FLECS_API
3245 const ecs_world_t *world,
3246 ecs_entity_t parent,
3247 ecs_entity_t child,
3248 const char *sep,
3249 const char *prefix);
3250
3262 const ecs_world_t *world,
3263 ecs_entity_t parent,
3264 ecs_entity_t child,
3265 const char *sep,
3266 const char *prefix,
3267 ecs_strbuf_t *buf);
3268
3284FLECS_API
3286 ecs_world_t *world,
3287 ecs_entity_t parent,
3288 const char *path,
3289 const char *sep,
3290 const char *prefix);
3291
3306FLECS_API
3308 ecs_world_t *world,
3309 ecs_entity_t entity,
3310 ecs_entity_t parent,
3311 const char *path,
3312 const char *sep,
3313 const char *prefix);
3314
3326FLECS_API
3328 ecs_world_t *world,
3329 ecs_entity_t scope);
3330
3338FLECS_API
3340 const ecs_world_t *world);
3341
3351FLECS_API
3353 ecs_world_t *world,
3354 const char *prefix);
3355
3380FLECS_API
3382 ecs_world_t *world,
3383 const ecs_entity_t *lookup_path);
3384
3391FLECS_API
3393 const ecs_world_t *world);
3394
3418FLECS_API
3420 ecs_world_t *world,
3421 const ecs_component_desc_t *desc);
3422
3434FLECS_API
3436 ecs_world_t *world,
3437 ecs_entity_t id,
3438 const ecs_type_hooks_t *hooks);
3439
3446FLECS_API
3448 ecs_world_t *world,
3449 ecs_entity_t id);
3450
3473FLECS_API
3475 const ecs_world_t *world,
3476 ecs_id_t id);
3477
3490FLECS_API
3492 const ecs_world_t *world,
3493 ecs_id_t id);
3494
3503FLECS_API
3505 const ecs_world_t *world,
3506 ecs_id_t id);
3507
3517FLECS_API
3519 const ecs_world_t *world,
3520 ecs_id_t id);
3521
3541FLECS_API
3543 const ecs_world_t *world,
3544 ecs_id_t id);
3545
3553FLECS_API
3555 ecs_id_t id,
3556 ecs_id_t pattern);
3557
3563FLECS_API
3565 ecs_id_t id);
3566
3572FLECS_API
3574 ecs_id_t id);
3575
3589FLECS_API
3591 const ecs_world_t *world,
3592 ecs_id_t id);
3593
3602FLECS_API
3603ecs_flags32_t ecs_id_get_flags(
3604 const ecs_world_t *world,
3605 ecs_id_t id);
3606
3613FLECS_API
3615 ecs_id_t id_flags);
3616
3624FLECS_API
3626 const ecs_world_t *world,
3627 ecs_id_t id);
3628
3636FLECS_API
3638 const ecs_world_t *world,
3639 ecs_id_t id,
3640 ecs_strbuf_t *buf);
3641
3659FLECS_API
3660ecs_iter_t ecs_term_iter(
3661 const ecs_world_t *world,
3662 ecs_term_t *term);
3663
3672FLECS_API
3674 const ecs_iter_t *it,
3675 ecs_term_t *term);
3676
3686FLECS_API
3688 ecs_iter_t *it);
3689
3698FLECS_API
3699ecs_iter_t ecs_children(
3700 const ecs_world_t *world,
3701 ecs_entity_t parent);
3702
3709FLECS_API
3711 ecs_iter_t *it);
3712
3718FLECS_API
3720 const ecs_term_id_t *id);
3721
3733FLECS_API
3735 const ecs_term_t *term);
3736
3737FLECS_API
3738bool ecs_term_match_this(
3739 const ecs_term_t *term);
3740
3741FLECS_API
3742bool ecs_term_match_0(
3743 const ecs_term_t *term);
3744
3763FLECS_API
3765 const ecs_world_t *world,
3766 ecs_term_t *term);
3767
3776FLECS_API
3778 const ecs_term_t *src);
3779
3790FLECS_API
3792 ecs_term_t *src);
3793
3800FLECS_API
3802 ecs_term_t *term);
3803
3827FLECS_API
3829 ecs_world_t *world,
3830 const ecs_filter_desc_t *desc);
3831
3837FLECS_API
3839 ecs_filter_t *filter);
3840
3854FLECS_API
3856 const ecs_world_t *world,
3857 ecs_filter_t *filter);
3858
3870FLECS_API
3872 const ecs_filter_t *filter);
3873
3878FLECS_API
3880 const ecs_world_t *world,
3881 const ecs_term_t *term);
3882
3887FLECS_API
3889 const ecs_world_t *world,
3890 const ecs_filter_t *filter);
3891
3900FLECS_API
3902 const ecs_world_t *world,
3903 const ecs_filter_t *filter);
3904
3913FLECS_API
3915 const ecs_iter_t *it,
3916 const ecs_filter_t *filter);
3917
3937FLECS_API
3939 const ecs_world_t *world,
3940 const ecs_filter_t *filter);
3941
3951FLECS_API
3953 ecs_iter_t *it);
3954
3958FLECS_API
3960 ecs_iter_t *it);
3961
3963FLECS_API
3965 ecs_filter_t *dst,
3966 ecs_filter_t *src);
3967
3969FLECS_API
3971 ecs_filter_t *dst,
3972 const ecs_filter_t *src);
3973
4016FLECS_API
4018 ecs_world_t *world,
4019 const ecs_query_desc_t *desc);
4020
4028FLECS_API
4031
4038FLECS_API
4040 const ecs_query_t *query);
4041
4069FLECS_API
4071 const ecs_world_t *world,
4073
4083FLECS_API
4085 ecs_iter_t *iter);
4086
4090FLECS_API
4092 ecs_iter_t *iter);
4093
4104FLECS_API
4106 ecs_iter_t *iter);
4107
4129FLECS_API
4131 ecs_iter_t *iter,
4132 bool when_changed);
4133
4163FLECS_API
4166 const ecs_iter_t *it);
4167
4178FLECS_API
4180 ecs_iter_t *it);
4181
4204FLECS_API
4206 ecs_iter_t *it,
4207 uint64_t group_id);
4208
4217FLECS_API
4219 const ecs_query_t *query,
4220 uint64_t group_id);
4221
4230FLECS_API
4232 const ecs_query_t *query,
4233 uint64_t group_id);
4234
4243FLECS_API
4245 const ecs_query_t *query);
4246
4252FLECS_API
4254 const ecs_query_t *query);
4255
4261FLECS_API
4263 const ecs_query_t *query);
4264
4270FLECS_API
4272 const ecs_query_t *query);
4273
4281FLECS_API
4283 const ecs_query_t *query);
4284
4293typedef struct ecs_event_desc_t {
4296
4301
4304
4308
4310 int32_t offset;
4311
4315 int32_t count;
4316
4319
4321 const void *param;
4322
4325
4327 ecs_flags32_t flags;
4329
4359FLECS_API
4361 ecs_world_t *world,
4362 ecs_event_desc_t *desc);
4363
4373FLECS_API
4375 ecs_world_t *world,
4376 const ecs_observer_desc_t *desc);
4377
4387FLECS_API
4389 ecs_iter_t *it);
4390
4391FLECS_API
4392void* ecs_get_observer_ctx(
4393 const ecs_world_t *world,
4395
4396FLECS_API
4397void* ecs_get_observer_binding_ctx(
4398 const ecs_world_t *world,
4400
4430FLECS_API
4432 const ecs_world_t *world,
4433 const ecs_poly_t *poly,
4434 ecs_iter_t *iter,
4435 ecs_term_t *filter);
4436
4450FLECS_API
4452 ecs_iter_t *it);
4453
4463FLECS_API
4465 ecs_iter_t *it);
4466
4478FLECS_API
4480 ecs_iter_t *it);
4481
4494FLECS_API
4496 ecs_iter_t *it);
4497
4505FLECS_API
4507 ecs_iter_t *it);
4508
4542FLECS_API
4544 ecs_iter_t *it,
4545 int32_t var_id,
4546 ecs_entity_t entity);
4547
4555FLECS_API
4557 ecs_iter_t *it,
4558 int32_t var_id,
4559 const ecs_table_t *table);
4560
4568FLECS_API
4570 ecs_iter_t *it,
4571 int32_t var_id,
4572 const ecs_table_range_t *range);
4573
4585FLECS_API
4587 ecs_iter_t *it,
4588 int32_t var_id);
4589
4602FLECS_API
4604 ecs_iter_t *it,
4605 int32_t var_id);
4606
4619FLECS_API
4621 ecs_iter_t *it,
4622 int32_t var_id);
4623
4624
4636FLECS_API
4638 ecs_iter_t *it,
4639 int32_t var_id);
4640
4656FLECS_API
4657ecs_iter_t ecs_page_iter(
4658 const ecs_iter_t *it,
4659 int32_t offset,
4660 int32_t limit);
4661
4668FLECS_API
4670 ecs_iter_t *it);
4671
4692FLECS_API
4694 const ecs_iter_t *it,
4695 int32_t index,
4696 int32_t count);
4697
4704FLECS_API
4706 ecs_iter_t *it);
4707
4731FLECS_API
4733 const ecs_iter_t *it,
4734 size_t size,
4735 int32_t index);
4736
4745FLECS_API
4747 const ecs_iter_t *it,
4748 int32_t index);
4749
4760FLECS_API
4762 const ecs_iter_t *it,
4763 int32_t index);
4764
4771FLECS_API
4773 const ecs_iter_t *it,
4774 int32_t index);
4775
4782FLECS_API
4784 const ecs_iter_t *it,
4785 int32_t index);
4786
4795FLECS_API
4797 const ecs_iter_t *it,
4798 int32_t index);
4799
4807FLECS_API
4809 const ecs_iter_t *it,
4810 int32_t index);
4811
4820FLECS_API
4822 const ecs_iter_t *it,
4823 int32_t index);
4824
4838FLECS_API
4840 const ecs_iter_t *it,
4841 int32_t index);
4842
4854FLECS_API
4856 const ecs_iter_t *it);
4857
4858
4873FLECS_API
4875 const ecs_table_t *table);
4876
4885FLECS_API
4887 const ecs_world_t *world,
4888 const ecs_table_t *table,
4889 ecs_id_t id);
4890
4900FLECS_API
4902 const ecs_world_t *world,
4903 const ecs_table_t *table,
4904 ecs_id_t id);
4905
4913FLECS_API
4915 const ecs_table_t *table);
4916
4928FLECS_API
4930 const ecs_table_t *table,
4931 int32_t index);
4932
4941FLECS_API
4943 const ecs_table_t *table,
4944 int32_t index);
4945
4954FLECS_API
4956 const ecs_table_t *table,
4957 int32_t index,
4958 int32_t offset);
4959
4968FLECS_API
4970 const ecs_world_t *world,
4971 const ecs_table_t *table,
4972 ecs_id_t id,
4973 int32_t offset);
4974
4982FLECS_API
4984 const ecs_table_t *table,
4985 int32_t index);
4986
4995FLECS_API
4997 const ecs_table_t *table);
4998
5007FLECS_API
5009 const ecs_world_t *world,
5010 const ecs_table_t *table,
5011 ecs_id_t id);
5012
5023FLECS_API
5025 const ecs_world_t *world,
5026 const ecs_table_t *table,
5027 ecs_entity_t rel);
5028
5038FLECS_API
5040 ecs_world_t *world,
5041 ecs_table_t *table,
5042 ecs_id_t id);
5043
5054FLECS_API
5056 ecs_world_t *world,
5057 const ecs_id_t *ids,
5058 int32_t id_count);
5059
5069FLECS_API
5071 ecs_world_t *world,
5072 ecs_table_t *table,
5073 ecs_id_t id);
5074
5090FLECS_API
5092 ecs_world_t *world,
5093 ecs_table_t *table);
5094
5101FLECS_API
5103 ecs_world_t *world,
5104 ecs_table_t *table);
5105
5115FLECS_API
5117 ecs_table_t *table,
5118 ecs_flags32_t flags);
5119
5127FLECS_API
5129 ecs_world_t* world,
5130 ecs_table_t* table,
5131 int32_t row_1,
5132 int32_t row_2);
5133
5156FLECS_API
5158 ecs_world_t *world,
5159 ecs_entity_t entity,
5160 ecs_record_t *record,
5161 ecs_table_t *table,
5162 const ecs_type_t *added,
5163 const ecs_type_t *removed);
5164
5166FLECS_API
5167ecs_record_t* ecs_record_find(
5168 const ecs_world_t *world,
5169 ecs_entity_t entity);
5170
5172FLECS_API
5174 const ecs_record_t *r,
5175 int32_t column,
5176 size_t c_size);
5177
5193FLECS_API
5195 const ecs_world_t *world,
5196 const ecs_table_t *table,
5197 ecs_id_t id,
5198 ecs_id_t *id_out);
5199
5230FLECS_API
5232 const ecs_world_t *world,
5233 const ecs_table_t *table,
5234 int32_t offset,
5235 ecs_id_t id,
5236 ecs_id_t *id_out);
5237
5274FLECS_API
5276 const ecs_world_t *world,
5277 const ecs_table_t *table,
5278 int32_t offset,
5279 ecs_id_t id,
5280 ecs_entity_t rel,
5281 ecs_flags32_t flags, /* EcsSelf and/or EcsUp */
5282 ecs_entity_t *subject_out,
5283 ecs_id_t *id_out,
5284 struct ecs_table_record_t **tr_out);
5285
5301FLECS_API
5303 const ecs_world_t *world,
5304 ecs_entity_t type,
5305 void *ptr);
5306
5314FLECS_API
5316 const ecs_world_t *world,
5317 const ecs_type_info_t *ti,
5318 void *ptr);
5319
5326FLECS_API
5328 ecs_world_t *world,
5329 ecs_entity_t type);
5330
5338 ecs_world_t *world,
5339 const ecs_type_info_t *ti);
5340
5349 const ecs_world_t *world,
5350 const ecs_type_info_t *ti,
5351 void *ptr);
5352
5360FLECS_API
5362 const ecs_world_t *world,
5363 ecs_entity_t type,
5364 void* ptr);
5365
5372FLECS_API
5374 ecs_world_t *world,
5375 ecs_entity_t type,
5376 void* ptr);
5377
5386FLECS_API
5388 const ecs_world_t *world,
5389 const ecs_type_info_t *ti,
5390 void* dst,
5391 const void *src);
5392
5401FLECS_API
5403 const ecs_world_t *world,
5404 ecs_entity_t type,
5405 void* dst,
5406 const void *src);
5407
5417 const ecs_world_t *world,
5418 const ecs_type_info_t *ti,
5419 void* dst,
5420 void *src);
5421
5431 const ecs_world_t *world,
5432 ecs_entity_t type,
5433 void* dst,
5434 void *src);
5435
5445 const ecs_world_t *world,
5446 const ecs_type_info_t *ti,
5447 void* dst,
5448 void *src);
5449
5459 const ecs_world_t *world,
5460 ecs_entity_t type,
5461 void* dst,
5462 void *src);
5463
5478#include "flecs/addons/flecs_c.h"
5479
5480#ifdef __cplusplus
5481}
5482#endif
5483
5484#include "flecs/private/addons.h"
5485
5486#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:1111
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:318
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:282
struct ecs_rule_t ecs_rule_t
A rule implements a non-trivial filter.
Definition flecs.h:306
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:291
struct ecs_mixins_t ecs_mixins_t
Type that stores poly mixins.
Definition flecs.h:357
uint64_t ecs_id_t
An id.
Definition flecs.h:279
struct ecs_query_t ecs_query_t
A query allows for cached iteration over ECS data.
Definition flecs.h:300
struct ecs_observable_t ecs_observable_t
An observable contains lists of triggers for specific events/components.
Definition flecs.h:312
struct ecs_table_t ecs_table_t
A table is where entities and components are stored.
Definition flecs.h:294
void ecs_poly_t
A poly object.
Definition flecs.h:354
ecs_entity_t ecs_new_low_id(ecs_world_t *world)
Create new low id.
ecs_entity_t ecs_new_w_id(ecs_world_t *world, ecs_id_t id)
Create new entity with (component) id.
ecs_entity_t ecs_new_id(ecs_world_t *world)
Create new entity id.
const ecs_entity_t * ecs_bulk_init(ecs_world_t *world, const ecs_bulk_desc_t *desc)
Bulk create/populate new entities.
ecs_entity_t ecs_clone(ecs_world_t *world, ecs_entity_t dst, ecs_entity_t src, bool copy_value)
Clone an entity This operation clones the components of one entity into another entity.
const ecs_entity_t * ecs_bulk_new_w_id(ecs_world_t *world, ecs_id_t id, int32_t count)
Create N new entities.
ecs_entity_t ecs_entity_init(ecs_world_t *world, const ecs_entity_desc_t *desc)
Find or create an entity.
void ecs_delete_with(ecs_world_t *world, ecs_id_t id)
Delete all entities with the specified id.
void ecs_delete(ecs_world_t *world, ecs_entity_t entity)
Delete an entity.
ecs_entity_t ecs_new_w_table(ecs_world_t *world, ecs_table_t *table)
Create new entity in table.
bool ecs_is_enabled_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Test if component is enabled.
void ecs_enable_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, bool enable)
Enable or disable component.
void ecs_enable(ecs_world_t *world, ecs_entity_t entity, bool enabled)
Enable or disable entity.
char * ecs_entity_str(const ecs_world_t *world, ecs_entity_t entity)
Convert entity to string.
ecs_entity_t ecs_get_target(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, int32_t index)
Get the target of a relationship.
ecs_entity_t ecs_get_parent(const ecs_world_t *world, ecs_entity_t entity)
Get parent (target of ChildOf relationship) for entity.
const ecs_type_t * ecs_get_type(const ecs_world_t *world, ecs_entity_t entity)
Get the type of an entity.
bool ecs_has_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Test if an entity has an id.
char * ecs_type_str(const ecs_world_t *world, const ecs_type_t *type)
Convert type to string.
char * ecs_table_str(const ecs_world_t *world, const ecs_table_t *table)
Convert table to string.
int32_t ecs_count_id(const ecs_world_t *world, ecs_id_t entity)
Count entities that have the specified id.
void ecs_flatten(ecs_world_t *world, ecs_id_t pair, const ecs_flatten_desc_t *desc)
Recursively flatten relationship for target entity (experimental).
bool ecs_owns_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Test if an entity owns an id.
int32_t ecs_get_depth(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel)
Return depth for entity in tree for relationship rel.
ecs_entity_t ecs_get_target_for_id(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, ecs_id_t id)
Get the target of a relationship for a given id.
ecs_table_t * ecs_get_table(const ecs_world_t *world, ecs_entity_t entity)
Get the table of an entity.
bool ecs_children_next(ecs_iter_t *it)
Progress a children iterator.
ecs_term_t ecs_term_copy(const ecs_term_t *src)
Copy resources of a term to another term.
ecs_iter_t ecs_term_chain_iter(const ecs_iter_t *it, ecs_term_t *term)
Return a chained term iterator.
void ecs_term_fini(ecs_term_t *term)
Free resources of term.
ecs_filter_t * ecs_filter_init(ecs_world_t *world, const ecs_filter_desc_t *desc)
Initialize filter A filter is a lightweight object that can be used to query for entities in a world.
bool ecs_filter_next(ecs_iter_t *it)
Iterate tables matched by filter.
ecs_iter_t ecs_filter_iter(const ecs_world_t *world, const ecs_filter_t *filter)
Return a filter iterator.
char * ecs_term_str(const ecs_world_t *world, const ecs_term_t *term)
Convert ter, to string expression.
int ecs_filter_finalize(const ecs_world_t *world, ecs_filter_t *filter)
Finalize filter.
char * ecs_filter_str(const ecs_world_t *world, const ecs_filter_t *filter)
Convert filter to string expression.
void ecs_filter_fini(ecs_filter_t *filter)
Deinitialize filter.
bool ecs_filter_next_instanced(ecs_iter_t *it)
Same as ecs_filter_next, but always instanced.
bool ecs_term_next(ecs_iter_t *it)
Progress a term iterator.
int32_t ecs_filter_pivot_term(const ecs_world_t *world, const ecs_filter_t *filter)
Get pivot term for filter.
ecs_iter_t ecs_children(const ecs_world_t *world, ecs_entity_t parent)
Iterator for a parent's children.
int32_t ecs_filter_find_this_var(const ecs_filter_t *filter)
Find index for This variable.
int ecs_term_finalize(const ecs_world_t *world, ecs_term_t *term)
Finalize term.
bool ecs_term_id_is_set(const ecs_term_id_t *id)
Test whether term id is set.
void ecs_filter_move(ecs_filter_t *dst, ecs_filter_t *src)
Move resources of one filter to another.
bool ecs_term_is_initialized(const ecs_term_t *term)
Test whether a term is set.
ecs_term_t ecs_term_move(ecs_term_t *src)
Move resources of a term to another term.
void ecs_filter_copy(ecs_filter_t *dst, const ecs_filter_t *src)
Copy resources of one filter to another.
ecs_iter_t ecs_filter_chain_iter(const ecs_iter_t *it, const ecs_filter_t *filter)
Return a chained filter iterator.
ecs_iter_t ecs_term_iter(const ecs_world_t *world, ecs_term_t *term)
Iterator for a single (component) id.
void(* ecs_module_action_t)(ecs_world_t *world)
Initialization action for modules.
Definition flecs.h:469
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:449
uint64_t(* ecs_hash_value_action_t)(const void *ptr)
Callback used for hashing values.
Definition flecs.h:487
void(* ecs_iter_fini_action_t)(ecs_iter_t *it)
Function prototype for freeing an iterator.
Definition flecs.h:427
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:438
bool(* ecs_iter_next_action_t)(ecs_iter_t *it)
Function prototype for iterating an iterator.
Definition flecs.h:419
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
Definition flecs.h:392
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:497
int(* ecs_compare_action_t)(const void *ptr1, const void *ptr2)
Callback used for sorting values.
Definition flecs.h:482
void(* ecs_fini_action_t)(ecs_world_t *world, void *ctx)
Action callback on world exit.
Definition flecs.h:473
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:504
void(* ecs_run_action_t)(ecs_iter_t *it)
Function prototype for runnables (systems, observers).
Definition flecs.h:383
void(* ecs_ctx_free_t)(void *ctx)
Function to cleanup context data.
Definition flecs.h:478
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:431
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:406
void(* ecs_xtor_t)(void *ptr, int32_t count, const ecs_type_info_t *type_info)
Constructor/destructor callback.
Definition flecs.h:491
void * ecs_emplace_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Emplace a component.
ecs_ref_t ecs_ref_init_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Create a component ref.
void * ecs_record_get_mut_id(ecs_world_t *world, ecs_record_t *record, ecs_id_t id)
Same as ecs_record_get_id, but returns a mutable pointer.
ecs_entity_t ecs_record_get_entity(const ecs_record_t *record)
Get entity corresponding with record.
void ecs_ref_update(const ecs_world_t *world, ecs_ref_t *ref)
Update ref.
void ecs_read_end(const ecs_record_t *record)
End read access to entity.
void ecs_write_end(ecs_record_t *record)
End exclusive write access to entity.
void * ecs_ref_get_id(const ecs_world_t *world, ecs_ref_t *ref, ecs_id_t id)
Get component from ref.
bool ecs_record_has_id(ecs_world_t *world, const ecs_record_t *record, ecs_id_t id)
Test if entity for record has component.
const void * ecs_record_get_id(ecs_world_t *world, const ecs_record_t *record, ecs_id_t id)
Get component from entity record.
ecs_entity_t ecs_set_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, size_t size, const void *ptr)
Set the value of a component.
const void * ecs_get_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Get an immutable pointer to a component.
ecs_record_t * ecs_write_begin(ecs_world_t *world, ecs_entity_t entity)
Begin exclusive write access to entity.
void ecs_modified_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Signal that a component has been modified.
const ecs_record_t * ecs_read_begin(ecs_world_t *world, ecs_entity_t entity)
Begin read access to entity.
void * ecs_get_mut_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Get a mutable pointer to a component.
const ecs_id_t ECS_PAIR
Indicates that the id is a pair.
const ecs_id_t ECS_OVERRIDE
Automatically override component when it is inherited.
const ecs_id_t ECS_AND
Include all components from entity to which AND is applied.
const ecs_id_t ECS_TOGGLE
Adds bitset to storage which allows component to be enabled/disabled.
bool ecs_id_is_union(const ecs_world_t *world, ecs_id_t id)
Return whether represents a union.
bool ecs_id_is_valid(const ecs_world_t *world, ecs_id_t id)
Utility to check if id is valid.
bool ecs_id_is_pair(ecs_id_t id)
Utility to check if id is a pair.
ecs_entity_t ecs_get_typeid(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
bool ecs_id_match(ecs_id_t id, ecs_id_t pattern)
Utility to match an id with a pattern.
const char * ecs_id_flag_str(ecs_id_t id_flags)
Convert id flag to string.
bool ecs_id_in_use(const ecs_world_t *world, ecs_id_t id)
Returns whether specified id is in use.
const ecs_type_info_t * ecs_get_type_info(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
bool ecs_id_is_tag(const ecs_world_t *world, ecs_id_t id)
Returns whether specified id a tag.
void ecs_id_str_buf(const ecs_world_t *world, ecs_id_t id, ecs_strbuf_t *buf)
Write id string to buffer.
char * ecs_id_str(const ecs_world_t *world, ecs_id_t id)
Convert id to string.
bool ecs_id_is_wildcard(ecs_id_t id)
Utility to check if id is a wildcard.
ecs_flags32_t ecs_id_get_flags(const ecs_world_t *world, ecs_id_t id)
Get flags associated with id.
bool ecs_field_is_set(const ecs_iter_t *it, int32_t index)
Test whether field is set.
bool ecs_field_is_writeonly(const ecs_iter_t *it, int32_t index)
Test whether the field is writeonly.
bool ecs_field_is_self(const ecs_iter_t *it, int32_t index)
Test whether the field is matched on self.
void * ecs_field_w_size(const ecs_iter_t *it, size_t size, int32_t index)
Obtain data for a query field.
ecs_iter_t ecs_worker_iter(const ecs_iter_t *it, int32_t index, int32_t count)
Create a worker iterator.
size_t ecs_field_size(const ecs_iter_t *it, int32_t index)
Return field type size.
bool ecs_iter_is_true(ecs_iter_t *it)
Test if iterator is true.
void ecs_iter_fini(ecs_iter_t *it)
Cleanup iterator resources.
char * ecs_iter_str(const ecs_iter_t *it)
Convert iterator to string.
bool ecs_iter_var_is_constrained(ecs_iter_t *it, int32_t var_id)
Returns whether variable is constrained.
ecs_iter_t ecs_page_iter(const ecs_iter_t *it, int32_t offset, int32_t limit)
Create a paged iterator.
void ecs_iter_poly(const ecs_world_t *world, const ecs_poly_t *poly, ecs_iter_t *iter, ecs_term_t *filter)
Create iterator from poly object.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int32_t index)
Return id matched for field.
bool ecs_field_is_readonly(const ecs_iter_t *it, int32_t index)
Test whether the field is readonly.
void ecs_iter_set_var(ecs_iter_t *it, int32_t var_id, ecs_entity_t entity)
Set value for iterator variable.
bool ecs_iter_next(ecs_iter_t *it)
Progress any iterator.
ecs_entity_t ecs_iter_get_var(ecs_iter_t *it, int32_t var_id)
Get value of iterator variable as entity.
bool ecs_worker_next(ecs_iter_t *it)
Progress a worker iterator.
ecs_entity_t ecs_iter_first(ecs_iter_t *it)
Get first matching entity from iterator.
void ecs_iter_set_var_as_table(ecs_iter_t *it, int32_t var_id, const ecs_table_t *table)
Same as ecs_iter_set_var, but for a table.
ecs_table_t * ecs_iter_get_var_as_table(ecs_iter_t *it, int32_t var_id)
Get value of iterator variable as table.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int32_t index)
Return field source.
int32_t ecs_iter_count(ecs_iter_t *it)
Count number of matched entities in query.
bool ecs_page_next(ecs_iter_t *it)
Progress a paged iterator.
void ecs_iter_set_var_as_range(ecs_iter_t *it, int32_t var_id, const ecs_table_range_t *range)
Same as ecs_iter_set_var, but for a range of entities This constrains the variable to a range of enti...
ecs_table_range_t ecs_iter_get_var_as_range(ecs_iter_t *it, int32_t var_id)
Get value of iterator variable as table range.
int32_t ecs_field_column_index(const ecs_iter_t *it, int32_t index)
Return index of matched table column.
ecs_id_t ecs_strip_generation(ecs_entity_t e)
Remove generation from entity id.
void ecs_ensure(ecs_world_t *world, ecs_entity_t entity)
Ensure id is alive.
bool ecs_is_valid(const ecs_world_t *world, ecs_entity_t e)
Test whether an entity is valid.
void ecs_set_entity_generation(ecs_world_t *world, ecs_entity_t entity)
Override the generation of an entity.
ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)
Get alive identifier.
bool ecs_exists(const ecs_world_t *world, ecs_entity_t entity)
Test whether an entity exists.
void ecs_ensure_id(ecs_world_t *world, ecs_id_t id)
Same as ecs_ensure, but for (component) ids.
bool ecs_is_alive(const ecs_world_t *world, ecs_entity_t e)
Test whether an entity is alive.
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send event.
ecs_entity_t ecs_observer_init(ecs_world_t *world, const ecs_observer_desc_t *desc)
Create observer.
bool ecs_observer_default_run_action(ecs_iter_t *it)
Default run action for observer.
#define FLECS_TERM_DESC_MAX
Maximum number of terms in ecs_filter_desc_t.
Definition flecs.h:236
#define FLECS_EVENT_DESC_MAX
Maximum number of events in ecs_observer_desc_t.
Definition flecs.h:240
#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:231
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.
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:537
ecs_oper_kind_t
Specify operator for term.
Definition flecs.h:546
ecs_filter_t ECS_FILTER_INIT
Use this variable to initialize user-allocated filter object.
@ EcsOut
Term is only written.
Definition flecs.h:542
@ EcsInOut
Term is both read and written.
Definition flecs.h:540
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition flecs.h:538
@ EcsInOutNone
Term is neither read nor written.
Definition flecs.h:539
@ EcsIn
Term is only read.
Definition flecs.h:541
@ EcsNot
The term must not match.
Definition flecs.h:549
@ EcsOptional
The term may match.
Definition flecs.h:550
@ EcsOr
One of the terms in an or chain must match.
Definition flecs.h:548
@ EcsOrFrom
Term must match at least one component from term id.
Definition flecs.h:552
@ EcsAnd
The term must match.
Definition flecs.h:547
@ EcsNotFrom
Term must match none of the components from term id.
Definition flecs.h:553
@ EcsAndFrom
Term must match all components from term id.
Definition flecs.h:551
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)
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.
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_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_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:1094
ecs_size_t size
Component size.
Definition flecs.h:1095
ecs_size_t alignment
Component alignment.
Definition flecs.h:1096
A (string) identifier.
Definition flecs.h:1085
ecs_size_t length
Length of identifier.
Definition flecs.h:1087
char * value
Identifier string.
Definition flecs.h:1086
ecs_hashmap_t * index
Current index.
Definition flecs.h:1090
uint64_t hash
Hash of current value.
Definition flecs.h:1088
uint64_t index_hash
Hash of existing record in current index.
Definition flecs.h:1089
Component for storing a poly object.
Definition flecs.h:1100
ecs_poly_t * poly
Pointer to poly object.
Definition flecs.h:1101
Apply a rate filter to a tick source.
Definition timer.h:45
Target data for flattened relationships.
Definition flecs.h:1105
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:804
void ** data
Array with component data to insert.
Definition flecs.h:816
ecs_id_t ids[(32)]
Ids to create the entities with.
Definition flecs.h:814
int32_t count
Number of entities to create/populate.
Definition flecs.h:812
ecs_entity_t * entities
Entities to bulk insert.
Definition flecs.h:807
ecs_table_t * table
Table to insert the entities into.
Definition flecs.h:823
Used with ecs_component_init.
Definition flecs.h:834
ecs_type_info_t type
Parameters for type (size, hooks, ...)
Definition flecs.h:841
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition flecs.h:838
Used with ecs_entity_init.
Definition flecs.h:763
const char * sep
Optional custom separator for hierarchical names.
Definition flecs.h:773
const char * root_sep
Optional, used for identifiers relative to root.
Definition flecs.h:777
const char * name
Name of the entity.
Definition flecs.h:768
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:789
ecs_id_t add[(32)]
Array of ids to add to the new or existing entity.
Definition flecs.h:794
const char * symbol
Optional entity symbol.
Definition flecs.h:779
const char * add_expr
String expression with components to add.
Definition flecs.h:797
ecs_entity_t id
Set to modify existing entity (optional)
Definition flecs.h:766
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
Definition flecs.h:4318
ecs_table_t * table
The table for which to notify.
Definition flecs.h:4303
int32_t count
Limit number of notified entities to count.
Definition flecs.h:4315
ecs_table_t * other_table
Optional 2nd table to notify.
Definition flecs.h:4307
const void * param
Optional context.
Definition flecs.h:4321
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
Definition flecs.h:4310
const ecs_type_t * ids
Component ids.
Definition flecs.h:4300
ecs_poly_t * observable
Observable (usually the world)
Definition flecs.h:4324
ecs_entity_t event
The event id.
Definition flecs.h:4295
ecs_flags32_t flags
Event flags.
Definition flecs.h:4327
Used with ecs_filter_init.
Definition flecs.h:848
ecs_term_t * terms_buffer
For filters with lots of terms an outside array can be provided.
Definition flecs.h:856
bool instanced
When true, terms returned by an iterator may either contain 1 or N elements, where terms with N eleme...
Definition flecs.h:869
ecs_term_t terms[(16)]
Terms of the filter.
Definition flecs.h:853
int32_t terms_buffer_count
Number of terms in array provided in terms_buffer.
Definition flecs.h:859
ecs_entity_t entity
Entity associated with query (optional)
Definition flecs.h:878
ecs_flags32_t flags
Flags for advanced usage.
Definition flecs.h:872
ecs_filter_t * storage
External storage to prevent allocation of the filter object.
Definition flecs.h:862
const char * expr
Filter expression.
Definition flecs.h:875
Filters alllow for ad-hoc quick filtering of entity tables.
Definition flecs.h:632
ecs_term_t * terms
Array containing terms for filter.
Definition flecs.h:635
int32_t * sizes
Field size (same for each result)
Definition flecs.h:645
bool owned
Is filter object owned by filter.
Definition flecs.h:639
int32_t field_count
Number of fields in iterator for filter.
Definition flecs.h:637
int32_t term_count
Number of elements in terms array.
Definition flecs.h:636
ecs_flags32_t flags
Filter flags.
Definition flecs.h:642
bool terms_owned
Is terms array owned by filter.
Definition flecs.h:640
ecs_world_t * world
World mixin.
Definition flecs.h:651
char * variable_names[1]
Placeholder variable names array.
Definition flecs.h:644
ecs_poly_dtor_t dtor
Dtor mixin.
Definition flecs.h:650
ecs_entity_t entity
Entity associated with filter (optional)
Definition flecs.h:648
ecs_iterable_t iterable
Iterable mixin.
Definition flecs.h:649
Header for ecs_poly_t objects.
Definition flecs.h:360
Iterable mixin.
Definition flecs.h:524
ecs_iter_init_action_t init
Callback that creates iterator.
Definition flecs.h:525
Used with ecs_observer_init.
Definition flecs.h:942
void * binding_ctx
Context to be used for language bindings.
Definition flecs.h:974
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:977
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition flecs.h:946
ecs_filter_desc_t filter
Filter for observer.
Definition flecs.h:949
int32_t term_index
Used for internal purposes.
Definition flecs.h:990
ecs_entity_t events[(8)]
Events to observe (OnAdd, OnRemove, OnSet, UnSet)
Definition flecs.h:952
int32_t * last_event_id
Optional shared last event id for multiple observers.
Definition flecs.h:987
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:980
void * ctx
User context to pass to callback.
Definition flecs.h:971
ecs_poly_t * observable
Observable with which to register the observer.
Definition flecs.h:983
ecs_iter_action_t callback
Callback to invoke on an event, invoked when the observer matches.
Definition flecs.h:960
bool yield_existing
When observer is created, generate events from existing data.
Definition flecs.h:957
ecs_run_action_t run
Callback invoked on an event.
Definition flecs.h:968
ecs_iter_action_t callback
See ecs_observer_desc_t::callback.
Definition flecs.h:664
int32_t term_index
Index of the term in parent observer (single term observers only)
Definition flecs.h:679
ecs_observable_t * observable
Observable for observer.
Definition flecs.h:673
ecs_run_action_t run
See ecs_observer_desc_t::run.
Definition flecs.h:665
int32_t * last_event_id
Last handled event id.
Definition flecs.h:675
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:670
ecs_filter_t filter
Query for observer.
Definition flecs.h:658
void * ctx
Callback context.
Definition flecs.h:667
ecs_id_t register_id
Id observer is registered with (single term observers only)
Definition flecs.h:678
void * binding_ctx
Binding context (for language bindings)
Definition flecs.h:668
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:681
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:671
bool is_multi
If true, the observer triggers on more than one term.
Definition flecs.h:685
Used with ecs_query_init.
Definition flecs.h:885
ecs_order_by_action_t order_by
Callback used for ordering query results.
Definition flecs.h:897
ecs_id_t group_by_id
Id to be used by group_by.
Definition flecs.h:906
ecs_group_by_action_t group_by
Callback used for grouping results.
Definition flecs.h:913
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
Definition flecs.h:927
void * group_by_ctx
Context to pass to group_by.
Definition flecs.h:924
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
Definition flecs.h:917
ecs_query_t * parent
If set, the query will be created as a subquery.
Definition flecs.h:935
ecs_entity_t order_by_component
Component to be used by order_by.
Definition flecs.h:892
ecs_filter_desc_t filter
Filter for the query.
Definition flecs.h:889
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Definition flecs.h:921
ecs_sort_table_action_t sort_table
Callback used for ordering query results.
Definition flecs.h:901
Type that contains information about a query group.
Definition flecs.h:1070
int32_t table_count
Number of tables in group.
Definition flecs.h:1072
void * ctx
Group context, returned by on_group_create.
Definition flecs.h:1073
int32_t match_count
How often tables have been matched/unmatched.
Definition flecs.h:1071
Type that describes a single identifier in a term.
Definition flecs.h:583
ecs_flags32_t flags
Term flags.
Definition flecs.h:600
ecs_entity_t trav
Relationship to traverse when looking for the component.
Definition flecs.h:596
const char * name
Name.
Definition flecs.h:590
ecs_entity_t id
Entity id.
Definition flecs.h:584
Type that describes a term (single element in a query)
Definition flecs.h:604
ecs_term_id_t second
Second element of pair.
Definition flecs.h:612
ecs_id_t id
Component id to be matched by term.
Definition flecs.h:605
char * name
Name of term.
Definition flecs.h:618
ecs_term_id_t src
Source of term.
Definition flecs.h:610
ecs_id_record_t * idr
Cached pointer to internal index.
Definition flecs.h:621
ecs_term_id_t first
Component or first element of pair.
Definition flecs.h:611
int32_t field_index
Index of field for term in iterator.
Definition flecs.h:620
ecs_id_t id_flags
Id flags of term id.
Definition flecs.h:617
bool move
Used by internals.
Definition flecs.h:625
ecs_flags16_t flags
Flags that help eval, set by ecs_filter_init.
Definition flecs.h:623
ecs_inout_kind_t inout
Access to contents matched by term.
Definition flecs.h:614
ecs_oper_kind_t oper
Operator of term.
Definition flecs.h:615
Type that contains component lifecycle callbacks.
Definition flecs.h:697
ecs_copy_t copy_ctor
Ctor + copy.
Definition flecs.h:704
void * ctx
User defined context.
Definition flecs.h:735
ecs_iter_action_t on_remove
Callback that is invoked when an instance of the component is removed.
Definition flecs.h:733
void * binding_ctx
Language binding context.
Definition flecs.h:736
ecs_move_t move_dtor
Move + dtor.
Definition flecs.h:719
ecs_copy_t copy
copy assignment
Definition flecs.h:700
ecs_iter_action_t on_set
Callback that is invoked when an instance of the component is set.
Definition flecs.h:728
ecs_move_t move
move assignment
Definition flecs.h:701
ecs_xtor_t ctor
ctor
Definition flecs.h:698
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:738
ecs_iter_action_t on_add
Callback that is invoked when an instance of a component is added.
Definition flecs.h:723
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:739
ecs_move_t move_ctor
Ctor + move.
Definition flecs.h:707
ecs_move_t ctor_move_dtor
Ctor + move + dtor (or move_ctor + dtor).
Definition flecs.h:713
ecs_xtor_t dtor
dtor
Definition flecs.h:699
Type that contains component information (passed to ctors/dtors/...)
Definition flecs.h:746
ecs_size_t alignment
Alignment of type.
Definition flecs.h:748
ecs_size_t size
Size of type.
Definition flecs.h:747
const char * name
Type name.
Definition flecs.h:751
ecs_entity_t component
Handle to component (do not set)
Definition flecs.h:750
ecs_type_hooks_t hooks
Type hooks.
Definition flecs.h:749
An array with (component) ids.
Definition flecs.h:285
Type that contains information about the world.
Definition flecs.h:1006
int64_t get_mut_count
get_mut/emplace commands processed
Definition flecs.h:1055
float delta_time
Time passed to or computed by ecs_progress.
Definition flecs.h:1012
int32_t id_count
Number of ids in the world (excluding wildcards)
Definition flecs.h:1035
ecs_entity_t min_id
First allowed entity id.
Definition flecs.h:1008
int32_t trivial_table_count
Number of tables with trivial components (no lifecycle callbacks)
Definition flecs.h:1043
int64_t set_count
set commands processed
Definition flecs.h:1054
float world_time_total
Time elapsed in simulation.
Definition flecs.h:1019
int32_t tag_id_count
Number of tag (no data) ids in the world.
Definition flecs.h:1036
int32_t tag_table_count
Number of tag-only tables.
Definition flecs.h:1042
int32_t component_id_count
Number of component (data) ids in the world.
Definition flecs.h:1037
int32_t table_record_count
Total number of table records (entries in table caches)
Definition flecs.h:1045
int64_t pipeline_build_count_total
Total number of pipeline builds.
Definition flecs.h:1031
int32_t table_count
Number of tables.
Definition flecs.h:1041
float delta_time_raw
Raw delta time (no time scaling)
Definition flecs.h:1011
float frame_time_total
Total time spent processing a frame.
Definition flecs.h:1015
float world_time_total_raw
Time elapsed in simulation (no scaling)
Definition flecs.h:1020
int64_t table_create_total
Total number of times a table was created.
Definition flecs.h:1029
int64_t observers_ran_frame
Total number of times observer was invoked.
Definition flecs.h:1033
float system_time_total
Total time spent in systems.
Definition flecs.h:1016
int64_t id_delete_total
Total number of times an id was deleted.
Definition flecs.h:1028
int64_t systems_ran_frame
Total number of systems ran in last frame.
Definition flecs.h:1032
float merge_time_total
Total time spent in merges.
Definition flecs.h:1018
int64_t discard_count
commands discarded, happens when entity is no longer alive when running the command
Definition flecs.h:1058
int64_t clear_count
clear commands processed
Definition flecs.h:1053
ecs_entity_t last_component_id
Last issued component entity id.
Definition flecs.h:1007
int32_t empty_table_count
Number of tables without entities.
Definition flecs.h:1044
int64_t frame_count_total
Total number of frames.
Definition flecs.h:1023
ecs_entity_t max_id
Last allowed entity id.
Definition flecs.h:1009
int64_t merge_count_total
Total number of merges.
Definition flecs.h:1024
int64_t other_count
other commands processed
Definition flecs.h:1057
int64_t batched_command_count
commands batched
Definition flecs.h:1060
int64_t table_delete_total
Total number of times a table was deleted.
Definition flecs.h:1030
int64_t delete_count
delete commands processed
Definition flecs.h:1052
int64_t rematch_count_total
Total number of rematches.
Definition flecs.h:1025
int64_t id_create_total
Total number of times a new id was created.
Definition flecs.h:1027
int64_t batched_entity_count
entities for which commands were batched
Definition flecs.h:1059
float time_scale
Time scale applied to delta_time.
Definition flecs.h:1013
int32_t pair_id_count
Number of pair ids in the world.
Definition flecs.h:1038
float rematch_time_total
Time spent on query rematching.
Definition flecs.h:1021
float target_fps
Target fps.
Definition flecs.h:1014
int32_t wildcard_id_count
Number of wildcard ids.
Definition flecs.h:1039
int32_t table_storage_count
Total number of table storages.
Definition flecs.h:1046
float emit_time_total
Total time spent notifying observers.
Definition flecs.h:1017
int64_t modified_count
modified commands processed
Definition flecs.h:1056
const char * name_prefix
Value set by ecs_set_name_prefix.
Definition flecs.h:1063
int64_t add_count
add commands processed
Definition flecs.h:1050
int64_t remove_count
remove commands processed
Definition flecs.h:1051
flecs::term term() const
Create a term for a (component) type.