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 (1 << 0)
571#define EcsTermMatchAnySrc (1 << 1)
572#define EcsTermSrcFirstEq (1 << 2)
573#define EcsTermSrcSecondEq (1 << 3)
574#define EcsTermTransitive (1 << 4)
575#define EcsTermReflexive (1 << 5)
576#define EcsTermIdInherited (1 << 6)
577
579typedef struct ecs_term_id_t {
586 char *name;
597 ecs_flags32_t flags;
599
615 char *name;
617 int32_t field_index;
618 ecs_id_record_t *idr;
620 ecs_flags16_t flags;
622 bool move;
623};
624
626FLECS_API extern ecs_filter_t ECS_FILTER_INIT;
627
630 ecs_header_t hdr;
631
633 int32_t term_count;
634 int32_t field_count;
636 bool owned;
639 ecs_flags32_t flags;
641 char *variable_names[1];
642 int32_t *sizes;
644 /* Mixins */
647 ecs_poly_dtor_t dtor;
649};
650
651/* An observer reacts to events matching a filter */
653 ecs_header_t hdr;
654
657 /* Observer events */
659 int32_t event_count;
660
664 void *ctx;
672 int32_t *last_event_id;
673 int32_t last_event_id_storage;
674
676 int32_t term_index;
682 bool is_multi;
684 /* Mixins */
685 ecs_poly_dtor_t dtor;
686};
687
702
705
711
717
721
726
731
732 void *ctx;
737};
738
744 ecs_size_t size;
745 ecs_size_t alignment;
748 const char *name;
749};
750
751#include "flecs/private/api_types.h" /* Supporting API types */
752#include "flecs/private/api_support.h" /* Supporting API functions */
753#include "flecs/private/vec.h" /* Vector */
754#include "flecs/private/hashmap.h" /* Hashmap */
755
760typedef struct ecs_entity_desc_t {
761 int32_t _canary;
762
765 const char *name;
770 const char *sep;
774 const char *root_sep;
776 const char *symbol;
792
794 const char *add_expr;
796
801typedef struct ecs_bulk_desc_t {
802 int32_t _canary;
803
809 int32_t count;
813 void **data;
826
831typedef struct ecs_component_desc_t {
832 int32_t _canary;
833
836
840
845typedef struct ecs_filter_desc_t {
846 int32_t _canary;
847
851
854
857
860
867
869 ecs_flags32_t flags;
870
872 const char *expr;
873
877
882typedef struct ecs_query_desc_t {
883 int32_t _canary;
884
887
890
895
899
904
911
914 ecs_group_create_action_t on_group_create;
915
918 ecs_group_delete_action_t on_group_delete;
919
922
925
934
939typedef struct ecs_observer_desc_t {
940 int32_t _canary;
941
944
947
950
955
958
966
968 void *ctx;
969
972
975
978
981
985
987 int32_t term_index;
989
996/* Utility to hold a value of a dynamic type */
997typedef struct ecs_value_t {
998 ecs_entity_t type;
999 void *ptr;
1000} ecs_value_t;
1001
1003typedef struct ecs_world_info_t {
1032 int32_t id_count;
1038 int32_t table_count;
1045 /* -- Command counts -- */
1046 struct {
1047 int64_t add_count;
1050 int64_t clear_count;
1051 int64_t set_count;
1054 int64_t other_count;
1058 } cmd;
1059
1060 const char *name_prefix;
1065
1068 int32_t match_count;
1069 int32_t table_count;
1070 void *ctx;
1072
1082typedef struct EcsIdentifier {
1083 char *value;
1084 ecs_size_t length;
1085 uint64_t hash;
1086 uint64_t index_hash;
1087 ecs_hashmap_t *index;
1089
1091typedef struct EcsComponent {
1092 ecs_size_t size;
1093 ecs_size_t alignment;
1095
1097typedef struct EcsPoly {
1100
1102typedef struct EcsTarget {
1103 int32_t count;
1104 ecs_record_t *target;
1106
1109
1113/* Only include deprecated definitions if deprecated addon is required */
1114#ifdef FLECS_DEPRECATED
1116#endif
1117
1131#define ECS_ID_FLAG_BIT (1ull << 63)
1132
1134FLECS_API extern const ecs_id_t ECS_PAIR;
1135
1137FLECS_API extern const ecs_id_t ECS_OVERRIDE;
1138
1140FLECS_API extern const ecs_id_t ECS_TOGGLE;
1141
1143FLECS_API extern const ecs_id_t ECS_AND;
1144
1152/* Builtin component ids */
1153FLECS_API extern const ecs_entity_t ecs_id(EcsComponent);
1154FLECS_API extern const ecs_entity_t ecs_id(EcsIdentifier);
1155FLECS_API extern const ecs_entity_t ecs_id(EcsIterable);
1156FLECS_API extern const ecs_entity_t ecs_id(EcsPoly);
1157
1158FLECS_API extern const ecs_entity_t EcsQuery;
1159FLECS_API extern const ecs_entity_t EcsObserver;
1160
1161/* System module component ids */
1162FLECS_API extern const ecs_entity_t EcsSystem;
1163FLECS_API extern const ecs_entity_t ecs_id(EcsTickSource);
1164
1165/* Pipeline module component ids */
1166FLECS_API extern const ecs_entity_t ecs_id(EcsPipelineQuery);
1167
1168/* Timer module component ids */
1169FLECS_API extern const ecs_entity_t ecs_id(EcsTimer);
1170FLECS_API extern const ecs_entity_t ecs_id(EcsRateFilter);
1171
1173FLECS_API extern const ecs_entity_t EcsFlecs;
1174
1176FLECS_API extern const ecs_entity_t EcsFlecsCore;
1177
1179FLECS_API extern const ecs_entity_t EcsWorld;
1180
1182FLECS_API extern const ecs_entity_t EcsWildcard;
1183
1185FLECS_API extern const ecs_entity_t EcsAny;
1186
1188FLECS_API extern const ecs_entity_t EcsThis;
1189
1191FLECS_API extern const ecs_entity_t EcsVariable;
1192
1197FLECS_API extern const ecs_entity_t EcsTransitive;
1198
1203FLECS_API extern const ecs_entity_t EcsReflexive;
1204
1212FLECS_API extern const ecs_entity_t EcsFinal;
1213
1219FLECS_API extern const ecs_entity_t EcsDontInherit;
1220
1226FLECS_API extern const ecs_entity_t EcsAlwaysOverride;
1227
1232FLECS_API extern const ecs_entity_t EcsSymmetric;
1233
1240FLECS_API extern const ecs_entity_t EcsExclusive;
1241
1243FLECS_API extern const ecs_entity_t EcsAcyclic;
1244
1247FLECS_API extern const ecs_entity_t EcsTraversable;
1248
1255FLECS_API extern const ecs_entity_t EcsWith;
1256
1263FLECS_API extern const ecs_entity_t EcsOneOf;
1264
1267FLECS_API extern const ecs_entity_t EcsTag;
1268
1272FLECS_API extern const ecs_entity_t EcsUnion;
1273
1275FLECS_API extern const ecs_entity_t EcsName;
1276
1278FLECS_API extern const ecs_entity_t EcsSymbol;
1279
1281FLECS_API extern const ecs_entity_t EcsAlias;
1282
1284FLECS_API extern const ecs_entity_t EcsChildOf;
1285
1287FLECS_API extern const ecs_entity_t EcsIsA;
1288
1290FLECS_API extern const ecs_entity_t EcsDependsOn;
1291
1293FLECS_API extern const ecs_entity_t EcsSlotOf;
1294
1296FLECS_API extern const ecs_entity_t EcsModule;
1297
1299FLECS_API extern const ecs_entity_t EcsPrivate;
1300
1303FLECS_API extern const ecs_entity_t EcsPrefab;
1304
1306FLECS_API extern const ecs_entity_t EcsDisabled;
1307
1309FLECS_API extern const ecs_entity_t EcsOnAdd;
1310
1312FLECS_API extern const ecs_entity_t EcsOnRemove;
1313
1315FLECS_API extern const ecs_entity_t EcsOnSet;
1316
1318FLECS_API extern const ecs_entity_t EcsUnSet;
1319
1321FLECS_API extern const ecs_entity_t EcsMonitor;
1322
1327FLECS_API extern const ecs_entity_t EcsOnDelete;
1328
1330FLECS_API extern const ecs_entity_t EcsOnTableCreate;
1331
1333FLECS_API extern const ecs_entity_t EcsOnTableDelete;
1334
1336FLECS_API extern const ecs_entity_t EcsOnTableEmpty;
1337
1339FLECS_API extern const ecs_entity_t EcsOnTableFill;
1340
1345FLECS_API extern const ecs_entity_t EcsOnDeleteTarget;
1346
1349FLECS_API extern const ecs_entity_t EcsRemove;
1350
1353FLECS_API extern const ecs_entity_t EcsDelete;
1354
1357FLECS_API extern const ecs_entity_t EcsPanic;
1358
1359FLECS_API extern const ecs_entity_t ecs_id(EcsTarget);
1360FLECS_API extern const ecs_entity_t EcsFlatten;
1361
1367FLECS_API extern const ecs_entity_t EcsDefaultChildComponent;
1368
1369/* Builtin predicates for comparing entity ids in queries. Only supported by rules */
1370FLECS_API extern const ecs_entity_t EcsPredEq;
1371FLECS_API extern const ecs_entity_t EcsPredMatch;
1372FLECS_API extern const ecs_entity_t EcsPredLookup;
1373
1374/* Builtin marker entities for opening/closing query scopes */
1375FLECS_API extern const ecs_entity_t EcsScopeOpen;
1376FLECS_API extern const ecs_entity_t EcsScopeClose;
1377
1379FLECS_API extern const ecs_entity_t EcsEmpty;
1380
1381/* Pipeline module tags */
1382FLECS_API extern const ecs_entity_t ecs_id(EcsPipeline);
1383FLECS_API extern const ecs_entity_t EcsOnStart;
1384FLECS_API extern const ecs_entity_t EcsPreFrame;
1385FLECS_API extern const ecs_entity_t EcsOnLoad;
1386FLECS_API extern const ecs_entity_t EcsPostLoad;
1387FLECS_API extern const ecs_entity_t EcsPreUpdate;
1388FLECS_API extern const ecs_entity_t EcsOnUpdate;
1389FLECS_API extern const ecs_entity_t EcsOnValidate;
1390FLECS_API extern const ecs_entity_t EcsPostUpdate;
1391FLECS_API extern const ecs_entity_t EcsPreStore;
1392FLECS_API extern const ecs_entity_t EcsOnStore;
1393FLECS_API extern const ecs_entity_t EcsPostFrame;
1394FLECS_API extern const ecs_entity_t EcsPhase;
1395
1398#define EcsLastInternalComponentId (ecs_id(EcsPoly))
1399
1402#define EcsFirstUserComponentId (8)
1403
1406#define EcsFirstUserEntityId (FLECS_HI_COMPONENT_ID + 128)
1407
1431FLECS_API
1433
1438FLECS_API
1440
1448FLECS_API
1450 int argc,
1451 char *argv[]);
1452
1459FLECS_API
1461 ecs_world_t *world);
1462
1468FLECS_API
1470 const ecs_world_t *world);
1471
1479FLECS_API
1481 ecs_world_t *world,
1482 ecs_fini_action_t action,
1483 void *ctx);
1484
1510FLECS_API
1512 ecs_world_t *world,
1513 ecs_ftime_t delta_time);
1514
1521FLECS_API
1523 ecs_world_t *world);
1524
1532FLECS_API
1534 ecs_world_t *world,
1535 ecs_fini_action_t action,
1536 void *ctx);
1537
1544FLECS_API
1546 ecs_world_t *world);
1547
1552FLECS_API
1554 const ecs_world_t *world);
1555
1568 ecs_world_t *world,
1569 bool enable);
1570
1582 ecs_world_t *world,
1583 bool enable);
1584
1600FLECS_API
1602 ecs_world_t *world,
1603 ecs_ftime_t fps);
1604
1641FLECS_API
1643 ecs_world_t *world);
1644
1652FLECS_API
1654 ecs_world_t *world);
1655
1666FLECS_API
1668 ecs_world_t *world);
1669
1679FLECS_API
1681 ecs_world_t *world);
1682
1688FLECS_API
1690 const ecs_world_t *world);
1691
1700FLECS_API
1702 ecs_world_t *world);
1703
1713FLECS_API
1715 ecs_world_t *world);
1716
1722FLECS_API
1724 ecs_world_t *world);
1725
1742FLECS_API
1744 ecs_world_t *world,
1745 bool automerge);
1746
1760FLECS_API
1762 ecs_world_t *world,
1763 int32_t stages);
1764
1771FLECS_API
1773 const ecs_world_t *world);
1774
1782FLECS_API
1784 const ecs_world_t *world);
1785
1801FLECS_API
1803 const ecs_world_t *world,
1804 int32_t stage_id);
1805
1813FLECS_API
1815 const ecs_world_t *world);
1816
1835FLECS_API
1837 ecs_world_t *world);
1838
1845FLECS_API
1847 ecs_world_t *stage);
1848
1855FLECS_API
1857 ecs_world_t *stage);
1858
1873FLECS_API
1875 ecs_world_t *world,
1876 void *ctx);
1877
1885FLECS_API
1887 const ecs_world_t *world);
1888
1895FLECS_API
1897 const ecs_world_t *world);
1898
1907FLECS_API
1909 ecs_world_t *world,
1910 int32_t entity_count);
1911
1927FLECS_API
1929 ecs_world_t *world,
1930 ecs_entity_t id_start,
1931 ecs_entity_t id_end);
1932
1943FLECS_API
1945 ecs_world_t *world,
1946 bool enable);
1947
1952FLECS_API
1954 const ecs_world_t *world);
1955
1969FLECS_API
1971 ecs_world_t *world,
1972 ecs_flags32_t flags);
1973
2007FLECS_API
2009 ecs_world_t *world,
2010 ecs_id_t id,
2011 uint16_t clear_generation,
2012 uint16_t delete_generation,
2013 int32_t min_id_count,
2014 double time_budget_seconds);
2015
2021FLECS_API
2023 const ecs_poly_t *poly);
2024
2030FLECS_API
2032 const ecs_poly_t *poly);
2033
2044FLECS_API
2046 const ecs_poly_t *object,
2047 int32_t type);
2048
2049#define ecs_poly_is(object, type)\
2050 _ecs_poly_is(object, type##_magic)
2051
2059FLECS_API
2061 ecs_entity_t first,
2062 ecs_entity_t second);
2063
2088FLECS_API
2090 ecs_world_t *world);
2091
2109FLECS_API
2111 ecs_world_t *world);
2112
2121FLECS_API
2123 ecs_world_t *world,
2124 ecs_id_t id);
2125
2133FLECS_API
2135 ecs_world_t *world,
2136 ecs_table_t *table);
2137
2156FLECS_API
2158 ecs_world_t *world,
2159 const ecs_entity_desc_t *desc);
2160
2187FLECS_API
2189 ecs_world_t *world,
2190 const ecs_bulk_desc_t *desc);
2191
2201FLECS_API
2203 ecs_world_t *world,
2204 ecs_id_t id,
2205 int32_t count);
2206
2218FLECS_API
2220 ecs_world_t *world,
2221 ecs_entity_t dst,
2222 ecs_entity_t src,
2223 bool copy_value);
2224
2234FLECS_API
2236 ecs_world_t *world,
2237 ecs_entity_t entity);
2238
2246FLECS_API
2248 ecs_world_t *world,
2249 ecs_id_t id);
2250
2267FLECS_API
2269 ecs_world_t *world,
2270 ecs_entity_t entity,
2271 ecs_id_t id);
2272
2281FLECS_API
2283 ecs_world_t *world,
2284 ecs_entity_t entity,
2285 ecs_id_t id);
2286
2309FLECS_API
2311 ecs_world_t *world,
2312 ecs_entity_t entity,
2313 ecs_id_t id);
2314
2323FLECS_API
2325 ecs_world_t *world,
2326 ecs_entity_t entity);
2327
2328
2336FLECS_API
2338 ecs_world_t *world,
2339 ecs_id_t id);
2340
2348FLECS_API
2350 ecs_world_t *world,
2351 ecs_id_t id);
2352
2359FLECS_API
2361 const ecs_world_t *world);
2362
2380FLECS_API
2382 ecs_world_t *world,
2383 ecs_entity_t entity,
2384 bool enabled);
2385
2399FLECS_API
2401 ecs_world_t *world,
2402 ecs_entity_t entity,
2403 ecs_id_t id,
2404 bool enable);
2405
2416FLECS_API
2418 const ecs_world_t *world,
2419 ecs_entity_t entity,
2420 ecs_id_t id);
2421
2439FLECS_API
2440const void* ecs_get_id(
2441 const ecs_world_t *world,
2442 ecs_entity_t entity,
2443 ecs_id_t id);
2444
2455FLECS_API
2457 const ecs_world_t *world,
2458 ecs_entity_t entity,
2459 ecs_id_t id);
2460
2469FLECS_API
2471 const ecs_world_t *world,
2472 ecs_ref_t *ref,
2473 ecs_id_t id);
2474
2482FLECS_API
2484 const ecs_world_t *world,
2485 ecs_ref_t *ref);
2486
2501FLECS_API
2503 ecs_world_t *world,
2504 ecs_entity_t entity,
2505 ecs_id_t id);
2506
2525FLECS_API
2526ecs_record_t* ecs_write_begin(
2527 ecs_world_t *world,
2528 ecs_entity_t entity);
2529
2536FLECS_API
2538 ecs_record_t *record);
2539
2559FLECS_API
2560const ecs_record_t* ecs_read_begin(
2561 ecs_world_t *world,
2562 ecs_entity_t entity);
2563
2569FLECS_API
2571 const ecs_record_t *record);
2572
2578FLECS_API
2580 const ecs_record_t *record);
2581
2595FLECS_API
2597 ecs_world_t *world,
2598 const ecs_record_t *record,
2599 ecs_id_t id);
2600
2609FLECS_API
2611 ecs_world_t *world,
2612 ecs_record_t *record,
2613 ecs_id_t id);
2614
2621FLECS_API
2623 ecs_world_t *world,
2624 const ecs_record_t *record,
2625 ecs_id_t id);
2626
2640FLECS_API
2642 ecs_world_t *world,
2643 ecs_entity_t entity,
2644 ecs_id_t id);
2645
2656FLECS_API
2658 ecs_world_t *world,
2659 ecs_entity_t entity,
2660 ecs_id_t id);
2661
2675FLECS_API
2677 ecs_world_t *world,
2678 ecs_entity_t entity,
2679 ecs_id_t id,
2680 size_t size,
2681 const void *ptr);
2682
2709FLECS_API
2711 const ecs_world_t *world,
2712 ecs_entity_t e);
2713
2722FLECS_API
2724 const ecs_world_t *world,
2725 ecs_entity_t e);
2726
2732FLECS_API
2734 ecs_entity_t e);
2735
2747FLECS_API
2749 ecs_world_t *world,
2750 ecs_entity_t entity);
2751
2768FLECS_API
2770 const ecs_world_t *world,
2771 ecs_entity_t e);
2772
2793FLECS_API
2795 ecs_world_t *world,
2796 ecs_entity_t entity);
2797
2816FLECS_API
2818 ecs_world_t *world,
2819 ecs_id_t id);
2820
2828FLECS_API
2830 const ecs_world_t *world,
2831 ecs_entity_t entity);
2832
2847FLECS_API
2849 const ecs_world_t *world,
2850 ecs_entity_t entity);
2851
2858FLECS_API
2860 const ecs_world_t *world,
2861 ecs_entity_t entity);
2862
2870FLECS_API
2872 const ecs_world_t *world,
2873 const ecs_type_t* type);
2874
2883FLECS_API
2885 const ecs_world_t *world,
2886 const ecs_table_t *table);
2887
2899FLECS_API
2901 const ecs_world_t *world,
2902 ecs_entity_t entity);
2903
2912FLECS_API
2914 const ecs_world_t *world,
2915 ecs_entity_t entity,
2916 ecs_id_t id);
2917
2927FLECS_API
2929 const ecs_world_t *world,
2930 ecs_entity_t entity,
2931 ecs_id_t id);
2932
2947FLECS_API
2949 const ecs_world_t *world,
2950 ecs_entity_t entity,
2951 ecs_entity_t rel,
2952 int32_t index);
2953
2962FLECS_API
2964 const ecs_world_t *world,
2965 ecs_entity_t entity);
2966
2985FLECS_API
2987 const ecs_world_t *world,
2988 ecs_entity_t entity,
2989 ecs_entity_t rel,
2990 ecs_id_t id);
2991
3002FLECS_API
3004 const ecs_world_t *world,
3005 ecs_entity_t entity,
3006 ecs_entity_t rel);
3007
3008typedef struct ecs_flatten_desc_t {
3009 /* When true, the flatten operation will not remove names from entities in
3010 * the flattened tree. This may fail if entities from different subtrees
3011 * have the same name. */
3012 bool keep_names;
3013
3014 /* When true, the flattened tree won't contain information about the
3015 * original depth of the entities. This can reduce fragmentation, but may
3016 * cause existing code, such as cascade queries, to no longer work. */
3017 bool lose_depth;
3019
3044FLECS_API
3046 ecs_world_t *world,
3047 ecs_id_t pair,
3048 const ecs_flatten_desc_t *desc);
3049
3057FLECS_API
3059 const ecs_world_t *world,
3060 ecs_id_t entity);
3061
3078FLECS_API
3079const char* ecs_get_name(
3080 const ecs_world_t *world,
3081 ecs_entity_t entity);
3082
3090FLECS_API
3091const char* ecs_get_symbol(
3092 const ecs_world_t *world,
3093 ecs_entity_t entity);
3094
3106FLECS_API
3108 ecs_world_t *world,
3109 ecs_entity_t entity,
3110 const char *name);
3111
3123FLECS_API
3125 ecs_world_t *world,
3126 ecs_entity_t entity,
3127 const char *symbol);
3128
3140FLECS_API
3142 ecs_world_t *world,
3143 ecs_entity_t entity,
3144 const char *alias);
3145
3154FLECS_API
3156 const ecs_world_t *world,
3157 const char *name);
3158
3168FLECS_API
3170 const ecs_world_t *world,
3171 ecs_entity_t parent,
3172 const char *name);
3173
3192FLECS_API
3194 const ecs_world_t *world,
3195 ecs_entity_t parent,
3196 const char *path,
3197 const char *sep,
3198 const char *prefix,
3199 bool recursive);
3200
3208FLECS_API
3210 const ecs_world_t *world,
3211 const char *symbol,
3212 bool lookup_as_path);
3213
3233FLECS_API
3235 const ecs_world_t *world,
3236 ecs_entity_t parent,
3237 ecs_entity_t child,
3238 const char *sep,
3239 const char *prefix);
3240
3252 const ecs_world_t *world,
3253 ecs_entity_t parent,
3254 ecs_entity_t child,
3255 const char *sep,
3256 const char *prefix,
3257 ecs_strbuf_t *buf);
3258
3274FLECS_API
3276 ecs_world_t *world,
3277 ecs_entity_t parent,
3278 const char *path,
3279 const char *sep,
3280 const char *prefix);
3281
3296FLECS_API
3298 ecs_world_t *world,
3299 ecs_entity_t entity,
3300 ecs_entity_t parent,
3301 const char *path,
3302 const char *sep,
3303 const char *prefix);
3304
3316FLECS_API
3318 ecs_world_t *world,
3319 ecs_entity_t scope);
3320
3328FLECS_API
3330 const ecs_world_t *world);
3331
3341FLECS_API
3343 ecs_world_t *world,
3344 const char *prefix);
3345
3370FLECS_API
3372 ecs_world_t *world,
3373 const ecs_entity_t *lookup_path);
3374
3381FLECS_API
3383 const ecs_world_t *world);
3384
3408FLECS_API
3410 ecs_world_t *world,
3411 const ecs_component_desc_t *desc);
3412
3424FLECS_API
3426 ecs_world_t *world,
3427 ecs_entity_t id,
3428 const ecs_type_hooks_t *hooks);
3429
3436FLECS_API
3438 ecs_world_t *world,
3439 ecs_entity_t id);
3440
3463FLECS_API
3465 const ecs_world_t *world,
3466 ecs_id_t id);
3467
3480FLECS_API
3482 const ecs_world_t *world,
3483 ecs_id_t id);
3484
3493FLECS_API
3495 const ecs_world_t *world,
3496 ecs_id_t id);
3497
3507FLECS_API
3509 const ecs_world_t *world,
3510 ecs_id_t id);
3511
3531FLECS_API
3533 const ecs_world_t *world,
3534 ecs_id_t id);
3535
3543FLECS_API
3545 ecs_id_t id,
3546 ecs_id_t pattern);
3547
3553FLECS_API
3555 ecs_id_t id);
3556
3562FLECS_API
3564 ecs_id_t id);
3565
3579FLECS_API
3581 const ecs_world_t *world,
3582 ecs_id_t id);
3583
3592FLECS_API
3593ecs_flags32_t ecs_id_get_flags(
3594 const ecs_world_t *world,
3595 ecs_id_t id);
3596
3603FLECS_API
3605 ecs_id_t id_flags);
3606
3614FLECS_API
3616 const ecs_world_t *world,
3617 ecs_id_t id);
3618
3626FLECS_API
3628 const ecs_world_t *world,
3629 ecs_id_t id,
3630 ecs_strbuf_t *buf);
3631
3649FLECS_API
3650ecs_iter_t ecs_term_iter(
3651 const ecs_world_t *world,
3652 ecs_term_t *term);
3653
3662FLECS_API
3664 const ecs_iter_t *it,
3665 ecs_term_t *term);
3666
3676FLECS_API
3678 ecs_iter_t *it);
3679
3688FLECS_API
3689ecs_iter_t ecs_children(
3690 const ecs_world_t *world,
3691 ecs_entity_t parent);
3692
3699FLECS_API
3701 ecs_iter_t *it);
3702
3708FLECS_API
3710 const ecs_term_id_t *id);
3711
3723FLECS_API
3725 const ecs_term_t *term);
3726
3727FLECS_API
3728bool ecs_term_match_this(
3729 const ecs_term_t *term);
3730
3731FLECS_API
3732bool ecs_term_match_0(
3733 const ecs_term_t *term);
3734
3753FLECS_API
3755 const ecs_world_t *world,
3756 ecs_term_t *term);
3757
3766FLECS_API
3768 const ecs_term_t *src);
3769
3780FLECS_API
3782 ecs_term_t *src);
3783
3790FLECS_API
3792 ecs_term_t *term);
3793
3817FLECS_API
3819 ecs_world_t *world,
3820 const ecs_filter_desc_t *desc);
3821
3827FLECS_API
3829 ecs_filter_t *filter);
3830
3844FLECS_API
3846 const ecs_world_t *world,
3847 ecs_filter_t *filter);
3848
3860FLECS_API
3862 const ecs_filter_t *filter);
3863
3868FLECS_API
3870 const ecs_world_t *world,
3871 const ecs_term_t *term);
3872
3877FLECS_API
3879 const ecs_world_t *world,
3880 const ecs_filter_t *filter);
3881
3890FLECS_API
3892 const ecs_world_t *world,
3893 const ecs_filter_t *filter);
3894
3903FLECS_API
3905 const ecs_iter_t *it,
3906 const ecs_filter_t *filter);
3907
3927FLECS_API
3929 const ecs_world_t *world,
3930 const ecs_filter_t *filter);
3931
3941FLECS_API
3943 ecs_iter_t *it);
3944
3948FLECS_API
3950 ecs_iter_t *it);
3951
3953FLECS_API
3955 ecs_filter_t *dst,
3956 ecs_filter_t *src);
3957
3959FLECS_API
3961 ecs_filter_t *dst,
3962 const ecs_filter_t *src);
3963
4006FLECS_API
4008 ecs_world_t *world,
4009 const ecs_query_desc_t *desc);
4010
4018FLECS_API
4021
4028FLECS_API
4030 const ecs_query_t *query);
4031
4059FLECS_API
4061 const ecs_world_t *world,
4063
4073FLECS_API
4075 ecs_iter_t *iter);
4076
4080FLECS_API
4082 ecs_iter_t *iter);
4083
4094FLECS_API
4096 ecs_iter_t *iter);
4097
4119FLECS_API
4121 ecs_iter_t *iter,
4122 bool when_changed);
4123
4153FLECS_API
4156 const ecs_iter_t *it);
4157
4168FLECS_API
4170 ecs_iter_t *it);
4171
4194FLECS_API
4196 ecs_iter_t *it,
4197 uint64_t group_id);
4198
4207FLECS_API
4209 const ecs_query_t *query,
4210 uint64_t group_id);
4211
4220FLECS_API
4222 const ecs_query_t *query,
4223 uint64_t group_id);
4224
4233FLECS_API
4235 const ecs_query_t *query);
4236
4242FLECS_API
4244 const ecs_query_t *query);
4245
4251FLECS_API
4253 const ecs_query_t *query);
4254
4260FLECS_API
4262 const ecs_query_t *query);
4263
4271FLECS_API
4273 const ecs_query_t *query);
4274
4283typedef struct ecs_event_desc_t {
4286
4291
4294
4298
4300 int32_t offset;
4301
4305 int32_t count;
4306
4309
4311 const void *param;
4312
4315
4317 ecs_flags32_t flags;
4319
4349FLECS_API
4351 ecs_world_t *world,
4352 ecs_event_desc_t *desc);
4353
4363FLECS_API
4365 ecs_world_t *world,
4366 const ecs_observer_desc_t *desc);
4367
4377FLECS_API
4379 ecs_iter_t *it);
4380
4381FLECS_API
4382void* ecs_get_observer_ctx(
4383 const ecs_world_t *world,
4385
4386FLECS_API
4387void* ecs_get_observer_binding_ctx(
4388 const ecs_world_t *world,
4390
4420FLECS_API
4422 const ecs_world_t *world,
4423 const ecs_poly_t *poly,
4424 ecs_iter_t *iter,
4425 ecs_term_t *filter);
4426
4440FLECS_API
4442 ecs_iter_t *it);
4443
4453FLECS_API
4455 ecs_iter_t *it);
4456
4468FLECS_API
4470 ecs_iter_t *it);
4471
4484FLECS_API
4486 ecs_iter_t *it);
4487
4495FLECS_API
4497 ecs_iter_t *it);
4498
4532FLECS_API
4534 ecs_iter_t *it,
4535 int32_t var_id,
4536 ecs_entity_t entity);
4537
4545FLECS_API
4547 ecs_iter_t *it,
4548 int32_t var_id,
4549 const ecs_table_t *table);
4550
4558FLECS_API
4560 ecs_iter_t *it,
4561 int32_t var_id,
4562 const ecs_table_range_t *range);
4563
4575FLECS_API
4577 ecs_iter_t *it,
4578 int32_t var_id);
4579
4592FLECS_API
4594 ecs_iter_t *it,
4595 int32_t var_id);
4596
4609FLECS_API
4611 ecs_iter_t *it,
4612 int32_t var_id);
4613
4614
4626FLECS_API
4628 ecs_iter_t *it,
4629 int32_t var_id);
4630
4646FLECS_API
4647ecs_iter_t ecs_page_iter(
4648 const ecs_iter_t *it,
4649 int32_t offset,
4650 int32_t limit);
4651
4658FLECS_API
4660 ecs_iter_t *it);
4661
4682FLECS_API
4684 const ecs_iter_t *it,
4685 int32_t index,
4686 int32_t count);
4687
4694FLECS_API
4696 ecs_iter_t *it);
4697
4721FLECS_API
4723 const ecs_iter_t *it,
4724 size_t size,
4725 int32_t index);
4726
4735FLECS_API
4737 const ecs_iter_t *it,
4738 int32_t index);
4739
4750FLECS_API
4752 const ecs_iter_t *it,
4753 int32_t index);
4754
4761FLECS_API
4763 const ecs_iter_t *it,
4764 int32_t index);
4765
4772FLECS_API
4774 const ecs_iter_t *it,
4775 int32_t index);
4776
4785FLECS_API
4787 const ecs_iter_t *it,
4788 int32_t index);
4789
4797FLECS_API
4799 const ecs_iter_t *it,
4800 int32_t index);
4801
4810FLECS_API
4812 const ecs_iter_t *it,
4813 int32_t index);
4814
4828FLECS_API
4830 const ecs_iter_t *it,
4831 int32_t index);
4832
4844FLECS_API
4846 const ecs_iter_t *it);
4847
4848
4862FLECS_API
4864 const ecs_table_t *table);
4865
4874FLECS_API
4876 const ecs_table_t *table,
4877 int32_t index,
4878 int32_t offset);
4879
4887FLECS_API
4889 const ecs_table_t *table,
4890 int32_t index);
4891
4900FLECS_API
4902 const ecs_world_t *world,
4903 const ecs_table_t *table,
4904 ecs_id_t id);
4905
4914FLECS_API
4916 const ecs_world_t *world,
4917 const ecs_table_t *table,
4918 ecs_id_t id);
4919
4928FLECS_API
4930 const ecs_world_t *world,
4931 const ecs_table_t *table,
4932 ecs_id_t id,
4933 int32_t offset);
4934
4945FLECS_API
4947 const ecs_world_t *world,
4948 const ecs_table_t *table,
4949 ecs_entity_t rel);
4950
4956FLECS_API
4958 const ecs_table_t *table);
4959
4961FLECS_API
4963 const ecs_table_t *table,
4964 int32_t index);
4965
4967FLECS_API
4969 const ecs_table_t *table,
4970 int32_t index);
4971
4980FLECS_API
4982 const ecs_table_t *table);
4983
4993FLECS_API
4995 ecs_world_t *world,
4996 ecs_table_t *table,
4997 ecs_id_t id);
4998
5009FLECS_API
5011 ecs_world_t *world,
5012 const ecs_id_t *ids,
5013 int32_t id_count);
5014
5024FLECS_API
5026 ecs_world_t *world,
5027 ecs_table_t *table,
5028 ecs_id_t id);
5029
5045FLECS_API
5047 ecs_world_t *world,
5048 ecs_table_t *table);
5049
5056FLECS_API
5058 ecs_world_t *world,
5059 ecs_table_t *table);
5060
5068FLECS_API
5070 ecs_table_t *table);
5071
5079FLECS_API
5081 ecs_world_t* world,
5082 ecs_table_t* table,
5083 int32_t row_1,
5084 int32_t row_2);
5085
5108FLECS_API
5110 ecs_world_t *world,
5111 ecs_entity_t entity,
5112 ecs_record_t *record,
5113 ecs_table_t *table,
5114 const ecs_type_t *added,
5115 const ecs_type_t *removed);
5116
5118FLECS_API
5119ecs_record_t* ecs_record_find(
5120 const ecs_world_t *world,
5121 ecs_entity_t entity);
5122
5124FLECS_API
5126 const ecs_record_t *r,
5127 int32_t column,
5128 size_t c_size);
5129
5145FLECS_API
5147 const ecs_world_t *world,
5148 const ecs_table_t *table,
5149 ecs_id_t id,
5150 ecs_id_t *id_out);
5151
5182FLECS_API
5184 const ecs_world_t *world,
5185 const ecs_table_t *table,
5186 int32_t offset,
5187 ecs_id_t id,
5188 ecs_id_t *id_out);
5189
5226FLECS_API
5228 const ecs_world_t *world,
5229 const ecs_table_t *table,
5230 int32_t offset,
5231 ecs_id_t id,
5232 ecs_entity_t rel,
5233 ecs_flags32_t flags, /* EcsSelf and/or EcsUp */
5234 ecs_entity_t *subject_out,
5235 ecs_id_t *id_out,
5236 struct ecs_table_record_t **tr_out);
5237
5253FLECS_API
5255 const ecs_world_t *world,
5256 ecs_entity_t type,
5257 void *ptr);
5258
5266FLECS_API
5268 const ecs_world_t *world,
5269 const ecs_type_info_t *ti,
5270 void *ptr);
5271
5278FLECS_API
5280 ecs_world_t *world,
5281 ecs_entity_t type);
5282
5290 ecs_world_t *world,
5291 const ecs_type_info_t *ti);
5292
5301 const ecs_world_t *world,
5302 const ecs_type_info_t *ti,
5303 void *ptr);
5304
5312FLECS_API
5314 const ecs_world_t *world,
5315 ecs_entity_t type,
5316 void* ptr);
5317
5324FLECS_API
5326 ecs_world_t *world,
5327 ecs_entity_t type,
5328 void* ptr);
5329
5338FLECS_API
5340 const ecs_world_t *world,
5341 const ecs_type_info_t *ti,
5342 void* dst,
5343 const void *src);
5344
5353FLECS_API
5355 const ecs_world_t *world,
5356 ecs_entity_t type,
5357 void* dst,
5358 const void *src);
5359
5369 const ecs_world_t *world,
5370 const ecs_type_info_t *ti,
5371 void* dst,
5372 void *src);
5373
5383 const ecs_world_t *world,
5384 ecs_entity_t type,
5385 void* dst,
5386 void *src);
5387
5397 const ecs_world_t *world,
5398 const ecs_type_info_t *ti,
5399 void* dst,
5400 void *src);
5401
5411 const ecs_world_t *world,
5412 ecs_entity_t type,
5413 void* dst,
5414 void *src);
5415
5430#include "flecs/addons/flecs_c.h"
5431
5432#ifdef __cplusplus
5433}
5434#endif
5435
5436#include "flecs/private/addons.h"
5437
5438#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:1108
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.
void ecs_set_alias(ecs_world_t *world, ecs_entity_t entity, const char *alias)
Set alias for entity.
void ecs_get_path_w_sep_buf(const ecs_world_t *world, ecs_entity_t parent, ecs_entity_t child, const char *sep, const char *prefix, ecs_strbuf_t *buf)
Write path identifier to buffer.
ecs_entity_t ecs_get_scope(const ecs_world_t *world)
Get the current scope.
ecs_entity_t * ecs_set_lookup_path(ecs_world_t *world, const ecs_entity_t *lookup_path)
Set search path for lookup operations.
ecs_entity_t ecs_set_name(ecs_world_t *world, ecs_entity_t entity, const char *name)
Set the name of an entity.
ecs_entity_t ecs_lookup_symbol(const ecs_world_t *world, const char *symbol, bool lookup_as_path)
Lookup an entity by its symbol name.
const char * ecs_get_symbol(const ecs_world_t *world, ecs_entity_t entity)
Get the symbol of an entity.
ecs_entity_t ecs_lookup_path_w_sep(const ecs_world_t *world, ecs_entity_t parent, const char *path, const char *sep, const char *prefix, bool recursive)
Lookup an entity from a path.
ecs_entity_t ecs_set_symbol(ecs_world_t *world, ecs_entity_t entity, const char *symbol)
Set the symbol of an entity.
ecs_entity_t ecs_lookup_child(const ecs_world_t *world, ecs_entity_t parent, const char *name)
Lookup a child entity by name.
const char * ecs_get_name(const ecs_world_t *world, ecs_entity_t entity)
Get the name of an entity.
ecs_entity_t ecs_add_path_w_sep(ecs_world_t *world, ecs_entity_t entity, ecs_entity_t parent, const char *path, const char *sep, const char *prefix)
Add specified path to entity.
ecs_entity_t * ecs_get_lookup_path(const ecs_world_t *world)
Get current lookup path.
ecs_entity_t ecs_set_scope(ecs_world_t *world, ecs_entity_t scope)
Set the current scope.
const char * ecs_set_name_prefix(ecs_world_t *world, const char *prefix)
Set a name prefix for newly created entities.
const ecs_query_group_info_t * ecs_query_get_group_info(const ecs_query_t *query, uint64_t group_id)
Get information about query group.
bool ecs_query_next_instanced(ecs_iter_t *iter)
Same as ecs_query_next, but always instanced.
void ecs_query_fini(ecs_query_t *query)
Destroy a query.
void ecs_query_skip(ecs_iter_t *it)
Skip a table while iterating.
int32_t ecs_query_table_count(const ecs_query_t *query)
Returns number of tables query matched with.
bool ecs_query_next_table(ecs_iter_t *iter)
Fast alternative to ecs_query_next that only returns matched tables.
int32_t ecs_query_entity_count(const ecs_query_t *query)
Returns number of entities query matched with.
char * ecs_query_str(const ecs_query_t *query)
Convert query to string.
ecs_query_t * ecs_query_init(ecs_world_t *world, const ecs_query_desc_t *desc)
Create a query.
void ecs_query_set_group(ecs_iter_t *it, uint64_t group_id)
Set group to iterate for query iterator.
ecs_iter_t ecs_query_iter(const ecs_world_t *world, ecs_query_t *query)
Return a query iterator.
bool ecs_query_next(ecs_iter_t *iter)
Progress the query iterator.
void * ecs_query_get_group_ctx(const ecs_query_t *query, uint64_t group_id)
Get context of query group.
int ecs_query_populate(ecs_iter_t *iter, bool when_changed)
Populate iterator fields.
bool ecs_query_orphaned(const ecs_query_t *query)
Returns whether query is orphaned.
const ecs_filter_t * ecs_query_get_filter(const ecs_query_t *query)
Get filter from a query.
int32_t ecs_query_empty_table_count(const ecs_query_t *query)
Returns number of empty tables query matched with.
bool ecs_query_changed(ecs_query_t *query, const ecs_iter_t *it)
Returns whether the query data changed since the last iteration.
ecs_inout_kind_t
Specify read/write access for term.
Definition flecs.h: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
int32_t ecs_table_get_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Get column index for id.
ecs_table_t * ecs_table_add_id(ecs_world_t *world, ecs_table_t *table, ecs_id_t id)
Get table that has all components of current table plus the specified id.
int32_t ecs_search(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id, ecs_id_t *id_out)
Search for component id in table type.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get type for table.
int32_t ecs_search_offset(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t id, ecs_id_t *id_out)
Search for component id in table type starting from an offset.
int32_t ecs_table_storage_to_type_index(const ecs_table_t *table, int32_t index)
Convert index in table storage type to index in table type.
int32_t ecs_search_relation(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t id, ecs_entity_t rel, ecs_flags32_t flags, ecs_entity_t *subject_out, ecs_id_t *id_out, struct ecs_table_record_t **tr_out)
Search for component/relationship id in table type starting from an offset.
bool ecs_commit(ecs_world_t *world, ecs_entity_t entity, ecs_record_t *record, ecs_table_t *table, const ecs_type_t *added, const ecs_type_t *removed)
Commit (move) entity to a table.
ecs_table_t * ecs_table_get_storage_table(const ecs_table_t *table)
Get storage type for table.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get column from table.
bool ecs_table_has_id(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Test if table has id.
ecs_table_t * ecs_table_remove_id(ecs_world_t *world, ecs_table_t *table, ecs_id_t id)
Get table that has all components of current table minus the specified id.
int32_t ecs_table_type_to_storage_index(const ecs_table_t *table, int32_t index)
Convert index in table type to index in table storage type.
int32_t ecs_table_count(const ecs_table_t *table)
Returns the number of records in the table.
void ecs_table_unlock(ecs_world_t *world, ecs_table_t *table)
Unlock a table.
bool ecs_table_has_module(ecs_table_t *table)
Returns whether table is a module or contains module contents Returns true for tables that have modul...
int32_t ecs_table_get_depth(const ecs_world_t *world, const ecs_table_t *table, ecs_entity_t rel)
Return depth for table in tree for relationship rel.
void * ecs_table_get_id(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id, int32_t offset)
Get column from table by component id.
void ecs_table_swap_rows(ecs_world_t *world, ecs_table_t *table, int32_t row_1, int32_t row_2)
Swaps two elements inside the table.
void ecs_table_lock(ecs_world_t *world, ecs_table_t *table)
Lock or unlock table.
void * ecs_record_get_column(const ecs_record_t *r, int32_t column, size_t c_size)
Get component pointer from column/record.
ecs_table_t * ecs_table_find(ecs_world_t *world, const ecs_id_t *ids, int32_t id_count)
Find table from id array.
ecs_record_t * ecs_record_find(const ecs_world_t *world, ecs_entity_t entity)
Find record for entity.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get column size from table.
int ecs_value_fini_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
Destruct a value.
int ecs_value_fini(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Destruct a value.
int ecs_value_copy(const ecs_world_t *world, ecs_entity_t type, void *dst, const void *src)
Copy value.
int ecs_value_move(const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
Move value.
int ecs_value_move_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
Move value.
void * ecs_value_new_w_type_info(ecs_world_t *world, const ecs_type_info_t *ti)
Construct a value in new storage.
int ecs_value_move_ctor_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, void *src)
Move construct value.
int ecs_value_copy_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *dst, const void *src)
Copy value.
int ecs_value_init_w_type_info(const ecs_world_t *world, const ecs_type_info_t *ti, void *ptr)
Construct a value in existing storage.
void * ecs_value_new(ecs_world_t *world, ecs_entity_t type)
Construct a value in new storage.
int ecs_value_free(ecs_world_t *world, ecs_entity_t type, void *ptr)
Destruct a value, free storage.
int ecs_value_move_ctor(const ecs_world_t *world, ecs_entity_t type, void *dst, void *src)
Move construct value.
int ecs_value_init(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Construct a value in existing storage.
void ecs_atfini(ecs_world_t *world, ecs_fini_action_t action, void *ctx)
Register action to be executed when world is destroyed.
bool ecs_is_fini(const ecs_world_t *world)
Returns whether the world is being deleted.
int ecs_fini(ecs_world_t *world)
Delete a world.
ecs_world_t * ecs_mini(void)
Same as ecs_init, but with minimal set of modules loaded.
ecs_world_t * ecs_init(void)
Create a new world.
ecs_world_t * ecs_init_w_args(int argc, char *argv[])
Create a new world with arguments.
void ecs_set_target_fps(ecs_world_t *world, float fps)
Set target frames per second (FPS) for application.
void ecs_measure_system_time(ecs_world_t *world, bool enable)
Measure system time.
float ecs_frame_begin(ecs_world_t *world, float delta_time)
Begin frame.
void ecs_run_post_frame(ecs_world_t *world, ecs_fini_action_t action, void *ctx)
Register action to be executed once after frame.
bool ecs_should_quit(const ecs_world_t *world)
Return whether a quit has been signaled.
void ecs_quit(ecs_world_t *world)
Signal exit This operation signals that the application should quit.
void ecs_measure_frame_time(ecs_world_t *world, bool enable)
Measure frame time.
void ecs_frame_end(ecs_world_t *world)
End frame.
ecs_entity_t ecs_get_entity(const ecs_poly_t *poly)
Get entity from poly.
ecs_id_t ecs_make_pair(ecs_entity_t first, ecs_entity_t second)
Make a pair id.
void ecs_set_context(ecs_world_t *world, void *ctx)
Set a world context.
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.
bool _ecs_poly_is(const ecs_poly_t *object, int32_t type)
Test if pointer is of specified type.
void * ecs_get_context(const ecs_world_t *world)
Get the world context.
int32_t ecs_delete_empty_tables(ecs_world_t *world, ecs_id_t id, uint16_t clear_generation, uint16_t delete_generation, int32_t min_id_count, double time_budget_seconds)
Cleanup empty tables.
bool ecs_enable_range_check(ecs_world_t *world, bool enable)
Enable/disable range limits.
flecs::observer_builder< Components... > observer(Args &&... args) const
Create a new observer.
Operating system abstraction API.
flecs::query< Comps... > query(flecs::query_base &parent, Args &&... args) const
Create a subquery.
Component information.
Definition flecs.h:1091
ecs_size_t size
Component size.
Definition flecs.h:1092
ecs_size_t alignment
Component alignment.
Definition flecs.h:1093
A (string) identifier.
Definition flecs.h:1082
ecs_size_t length
Length of identifier.
Definition flecs.h:1084
char * value
Identifier string.
Definition flecs.h:1083
ecs_hashmap_t * index
Current index.
Definition flecs.h:1087
uint64_t hash
Hash of current value.
Definition flecs.h:1085
uint64_t index_hash
Hash of existing record in current index.
Definition flecs.h:1086
Component for storing a poly object.
Definition flecs.h:1097
ecs_poly_t * poly
Pointer to poly object.
Definition flecs.h:1098
Apply a rate filter to a tick source.
Definition timer.h:45
Target data for flattened relationships.
Definition flecs.h:1102
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:801
void ** data
Array with component data to insert.
Definition flecs.h:813
ecs_id_t ids[(32)]
Ids to create the entities with.
Definition flecs.h:811
int32_t count
Number of entities to create/populate.
Definition flecs.h:809
ecs_entity_t * entities
Entities to bulk insert.
Definition flecs.h:804
ecs_table_t * table
Table to insert the entities into.
Definition flecs.h:820
Used with ecs_component_init.
Definition flecs.h:831
ecs_type_info_t type
Parameters for type (size, hooks, ...)
Definition flecs.h:838
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition flecs.h:835
Used with ecs_entity_init.
Definition flecs.h:760
const char * sep
Optional custom separator for hierarchical names.
Definition flecs.h:770
const char * root_sep
Optional, used for identifiers relative to root.
Definition flecs.h:774
const char * name
Name of the entity.
Definition flecs.h:765
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:786
ecs_id_t add[(32)]
Array of ids to add to the new or existing entity.
Definition flecs.h:791
const char * symbol
Optional entity symbol.
Definition flecs.h:776
const char * add_expr
String expression with components to add.
Definition flecs.h:794
ecs_entity_t id
Set to modify existing entity (optional)
Definition flecs.h:763
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
Definition flecs.h:4308
ecs_table_t * table
The table for which to notify.
Definition flecs.h:4293
int32_t count
Limit number of notified entities to count.
Definition flecs.h:4305
ecs_table_t * other_table
Optional 2nd table to notify.
Definition flecs.h:4297
const void * param
Optional context.
Definition flecs.h:4311
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
Definition flecs.h:4300
const ecs_type_t * ids
Component ids.
Definition flecs.h:4290
ecs_poly_t * observable
Observable (usually the world)
Definition flecs.h:4314
ecs_entity_t event
The event id.
Definition flecs.h:4285
ecs_flags32_t flags
Event flags.
Definition flecs.h:4317
Used with ecs_filter_init.
Definition flecs.h:845
ecs_term_t * terms_buffer
For filters with lots of terms an outside array can be provided.
Definition flecs.h:853
bool instanced
When true, terms returned by an iterator may either contain 1 or N elements, where terms with N eleme...
Definition flecs.h:866
ecs_term_t terms[(16)]
Terms of the filter.
Definition flecs.h:850
int32_t terms_buffer_count
Number of terms in array provided in terms_buffer.
Definition flecs.h:856
ecs_entity_t entity
Entity associated with query (optional)
Definition flecs.h:875
ecs_flags32_t flags
Flags for advanced usage.
Definition flecs.h:869
ecs_filter_t * storage
External storage to prevent allocation of the filter object.
Definition flecs.h:859
const char * expr
Filter expression.
Definition flecs.h:872
Filters alllow for ad-hoc quick filtering of entity tables.
Definition flecs.h:629
ecs_term_t * terms
Array containing terms for filter.
Definition flecs.h:632
int32_t * sizes
Field size (same for each result)
Definition flecs.h:642
bool owned
Is filter object owned by filter.
Definition flecs.h:636
int32_t field_count
Number of fields in iterator for filter.
Definition flecs.h:634
int32_t term_count
Number of elements in terms array.
Definition flecs.h:633
ecs_flags32_t flags
Filter flags.
Definition flecs.h:639
bool terms_owned
Is terms array owned by filter.
Definition flecs.h:637
ecs_world_t * world
World mixin.
Definition flecs.h:648
char * variable_names[1]
Placeholder variable names array.
Definition flecs.h:641
ecs_poly_dtor_t dtor
Dtor mixin.
Definition flecs.h:647
ecs_entity_t entity
Entity associated with filter (optional)
Definition flecs.h:645
ecs_iterable_t iterable
Iterable mixin.
Definition flecs.h:646
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:939
void * binding_ctx
Context to be used for language bindings.
Definition flecs.h:971
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:974
ecs_entity_t entity
Existing entity to associate with observer (optional)
Definition flecs.h:943
ecs_filter_desc_t filter
Filter for observer.
Definition flecs.h:946
int32_t term_index
Used for internal purposes.
Definition flecs.h:987
ecs_entity_t events[(8)]
Events to observe (OnAdd, OnRemove, OnSet, UnSet)
Definition flecs.h:949
int32_t * last_event_id
Optional shared last event id for multiple observers.
Definition flecs.h:984
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:977
void * ctx
User context to pass to callback.
Definition flecs.h:968
ecs_poly_t * observable
Observable with which to register the observer.
Definition flecs.h:980
ecs_iter_action_t callback
Callback to invoke on an event, invoked when the observer matches.
Definition flecs.h:957
bool yield_existing
When observer is created, generate events from existing data.
Definition flecs.h:954
ecs_run_action_t run
Callback invoked on an event.
Definition flecs.h:965
ecs_iter_action_t callback
See ecs_observer_desc_t::callback.
Definition flecs.h:661
int32_t term_index
Index of the term in parent observer (single term observers only)
Definition flecs.h:676
ecs_observable_t * observable
Observable for observer.
Definition flecs.h:670
ecs_run_action_t run
See ecs_observer_desc_t::run.
Definition flecs.h:662
int32_t * last_event_id
Last handled event id.
Definition flecs.h:672
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:667
ecs_filter_t filter
Query for observer.
Definition flecs.h:655
void * ctx
Callback context.
Definition flecs.h:664
ecs_id_t register_id
Id observer is registered with (single term observers only)
Definition flecs.h:675
void * binding_ctx
Binding context (for language bindings)
Definition flecs.h:665
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:678
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:668
bool is_multi
If true, the observer triggers on more than one term.
Definition flecs.h:682
Used with ecs_query_init.
Definition flecs.h:882
ecs_order_by_action_t order_by
Callback used for ordering query results.
Definition flecs.h:894
ecs_id_t group_by_id
Id to be used by group_by.
Definition flecs.h:903
ecs_group_by_action_t group_by
Callback used for grouping results.
Definition flecs.h:910
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
Definition flecs.h:924
void * group_by_ctx
Context to pass to group_by.
Definition flecs.h:921
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
Definition flecs.h:914
ecs_query_t * parent
If set, the query will be created as a subquery.
Definition flecs.h:932
ecs_entity_t order_by_component
Component to be used by order_by.
Definition flecs.h:889
ecs_filter_desc_t filter
Filter for the query.
Definition flecs.h:886
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Definition flecs.h:918
ecs_sort_table_action_t sort_table
Callback used for ordering query results.
Definition flecs.h:898
Type that contains information about a query group.
Definition flecs.h:1067
int32_t table_count
Number of tables in group.
Definition flecs.h:1069
void * ctx
Group context, returned by on_group_create.
Definition flecs.h:1070
int32_t match_count
How often tables have been matched/unmatched.
Definition flecs.h:1068
Type that describes a single identifier in a term.
Definition flecs.h:579
ecs_flags32_t flags
Term flags.
Definition flecs.h:597
ecs_entity_t trav
Relationship to traverse when looking for the component.
Definition flecs.h:593
char * name
Name.
Definition flecs.h:586
ecs_entity_t id
Entity id.
Definition flecs.h:580
Type that describes a term (single element in a query)
Definition flecs.h:601
ecs_term_id_t second
Second element of pair.
Definition flecs.h:609
ecs_id_t id
Component id to be matched by term.
Definition flecs.h:602
char * name
Name of term.
Definition flecs.h:615
ecs_term_id_t src
Source of term.
Definition flecs.h:607
ecs_id_record_t * idr
Cached pointer to internal index.
Definition flecs.h:618
ecs_term_id_t first
Component or first element of pair.
Definition flecs.h:608
int32_t field_index
Index of field for term in iterator.
Definition flecs.h:617
ecs_id_t id_flags
Id flags of term id.
Definition flecs.h:614
bool move
Used by internals.
Definition flecs.h:622
ecs_flags16_t flags
Flags that help eval, set by ecs_filter_init.
Definition flecs.h:620
ecs_inout_kind_t inout
Access to contents matched by term.
Definition flecs.h:611
ecs_oper_kind_t oper
Operator of term.
Definition flecs.h:612
Type that contains component lifecycle callbacks.
Definition flecs.h:694
ecs_copy_t copy_ctor
Ctor + copy.
Definition flecs.h:701
void * ctx
User defined context.
Definition flecs.h:732
ecs_iter_action_t on_remove
Callback that is invoked when an instance of the component is removed.
Definition flecs.h:730
void * binding_ctx
Language binding context.
Definition flecs.h:733
ecs_move_t move_dtor
Move + dtor.
Definition flecs.h:716
ecs_copy_t copy
copy assignment
Definition flecs.h:697
ecs_iter_action_t on_set
Callback that is invoked when an instance of the component is set.
Definition flecs.h:725
ecs_move_t move
move assignment
Definition flecs.h:698
ecs_xtor_t ctor
ctor
Definition flecs.h:695
ecs_ctx_free_t ctx_free
Callback to free ctx.
Definition flecs.h:735
ecs_iter_action_t on_add
Callback that is invoked when an instance of a component is added.
Definition flecs.h:720
ecs_ctx_free_t binding_ctx_free
Callback to free binding_ctx.
Definition flecs.h:736
ecs_move_t move_ctor
Ctor + move.
Definition flecs.h:704
ecs_move_t ctor_move_dtor
Ctor + move + dtor (or move_ctor + dtor).
Definition flecs.h:710
ecs_xtor_t dtor
dtor
Definition flecs.h:696
Type that contains component information (passed to ctors/dtors/...)
Definition flecs.h:743
ecs_size_t alignment
Alignment of type.
Definition flecs.h:745
ecs_size_t size
Size of type.
Definition flecs.h:744
const char * name
Type name.
Definition flecs.h:748
ecs_entity_t component
Handle to component (do not set)
Definition flecs.h:747
ecs_type_hooks_t hooks
Type hooks.
Definition flecs.h:746
An array with (component) ids.
Definition flecs.h:285
Type that contains information about the world.
Definition flecs.h:1003
int64_t get_mut_count
get_mut/emplace commands processed
Definition flecs.h:1052
float delta_time
Time passed to or computed by ecs_progress.
Definition flecs.h:1009
int32_t id_count
Number of ids in the world (excluding wildcards)
Definition flecs.h:1032
ecs_entity_t min_id
First allowed entity id.
Definition flecs.h:1005
int32_t trivial_table_count
Number of tables with trivial components (no lifecycle callbacks)
Definition flecs.h:1040
int64_t set_count
set commands processed
Definition flecs.h:1051
float world_time_total
Time elapsed in simulation.
Definition flecs.h:1016
int32_t tag_id_count
Number of tag (no data) ids in the world.
Definition flecs.h:1033
int32_t tag_table_count
Number of tag-only tables.
Definition flecs.h:1039
int32_t component_id_count
Number of component (data) ids in the world.
Definition flecs.h:1034
int32_t table_record_count
Total number of table records (entries in table caches)
Definition flecs.h:1042
int64_t pipeline_build_count_total
Total number of pipeline builds.
Definition flecs.h:1028
int32_t table_count
Number of tables.
Definition flecs.h:1038
float delta_time_raw
Raw delta time (no time scaling)
Definition flecs.h:1008
float frame_time_total
Total time spent processing a frame.
Definition flecs.h:1012
float world_time_total_raw
Time elapsed in simulation (no scaling)
Definition flecs.h:1017
int64_t table_create_total
Total number of times a table was created.
Definition flecs.h:1026
int64_t observers_ran_frame
Total number of times observer was invoked.
Definition flecs.h:1030
float system_time_total
Total time spent in systems.
Definition flecs.h:1013
int64_t id_delete_total
Total number of times an id was deleted.
Definition flecs.h:1025
int64_t systems_ran_frame
Total number of systems ran in last frame.
Definition flecs.h:1029
float merge_time_total
Total time spent in merges.
Definition flecs.h:1015
int64_t discard_count
commands discarded, happens when entity is no longer alive when running the command
Definition flecs.h:1055
int64_t clear_count
clear commands processed
Definition flecs.h:1050
ecs_entity_t last_component_id
Last issued component entity id.
Definition flecs.h:1004
int32_t empty_table_count
Number of tables without entities.
Definition flecs.h:1041
int64_t frame_count_total
Total number of frames.
Definition flecs.h:1020
ecs_entity_t max_id
Last allowed entity id.
Definition flecs.h:1006
int64_t merge_count_total
Total number of merges.
Definition flecs.h:1021
int64_t other_count
other commands processed
Definition flecs.h:1054
int64_t batched_command_count
commands batched
Definition flecs.h:1057
int64_t table_delete_total
Total number of times a table was deleted.
Definition flecs.h:1027
int64_t delete_count
delete commands processed
Definition flecs.h:1049
int64_t rematch_count_total
Total number of rematches.
Definition flecs.h:1022
int64_t id_create_total
Total number of times a new id was created.
Definition flecs.h:1024
int64_t batched_entity_count
entities for which commands were batched
Definition flecs.h:1056
float time_scale
Time scale applied to delta_time.
Definition flecs.h:1010
int32_t pair_id_count
Number of pair ids in the world.
Definition flecs.h:1035
float rematch_time_total
Time spent on query rematching.
Definition flecs.h:1018
float target_fps
Target fps.
Definition flecs.h:1011
int32_t wildcard_id_count
Number of wildcard ids.
Definition flecs.h:1036
int32_t table_storage_count
Total number of table storages.
Definition flecs.h:1043
float emit_time_total
Total time spent notifying observers.
Definition flecs.h:1014
int64_t modified_count
modified commands processed
Definition flecs.h:1053
const char * name_prefix
Value set by ecs_set_name_prefix.
Definition flecs.h:1060
int64_t add_count
add commands processed
Definition flecs.h:1047
int64_t remove_count
remove commands processed
Definition flecs.h:1048
flecs::term term() const
Create a term for a (component) type.