Flecs v4.0
A fast entity component system (ECS) for C & C++
|
Convenience macro's for creating entities, components and observers More...
Macros | |
#define | ECS_DECLARE(id) ecs_entity_t id, ecs_id(id) |
#define | ECS_ENTITY_DECLARE ECS_DECLARE |
Forward declare an entity. | |
#define | ECS_ENTITY_DEFINE(world, id_, ...) |
Define a forward declared entity. | |
#define | ECS_ENTITY(world, id, ...) |
Declare & define an entity. | |
#define | ECS_TAG_DECLARE ECS_DECLARE |
Forward declare a tag. | |
#define | ECS_TAG_DEFINE(world, id) ECS_ENTITY_DEFINE(world, id, 0) |
Define a forward declared tag. | |
#define | ECS_TAG(world, id) ECS_ENTITY(world, id, 0) |
Declare & define a tag. | |
#define | ECS_PREFAB_DECLARE ECS_DECLARE |
Forward declare a prefab. | |
#define | ECS_PREFAB_DEFINE(world, id, ...) ECS_ENTITY_DEFINE(world, id, Prefab, __VA_ARGS__) |
Define a forward declared prefab. | |
#define | ECS_PREFAB(world, id, ...) ECS_ENTITY(world, id, Prefab, __VA_ARGS__) |
Declare & define a prefab. | |
#define | ECS_COMPONENT_DECLARE(id) ecs_entity_t ecs_id(id) |
Forward declare a component. | |
#define | ECS_COMPONENT_DEFINE(world, id_) |
Define a forward declared component. | |
#define | ECS_COMPONENT(world, id) |
Declare & define a component. | |
#define | ECS_OBSERVER_DECLARE(id) ecs_entity_t ecs_id(id) |
#define | ECS_OBSERVER_DEFINE(world, id_, kind, ...) |
Define a forward declared observer. | |
#define | ECS_OBSERVER(world, id, kind, ...) |
Declare & define an observer. | |
#define | ECS_QUERY_DECLARE(name) ecs_query_t* name |
#define | ECS_QUERY_DEFINE(world, name_, ...) |
Define a forward declared observer. | |
#define | ECS_QUERY(world, name, ...) |
Declare & define an observer. | |
#define | ecs_entity(world, ...) ecs_entity_init(world, &(ecs_entity_desc_t) __VA_ARGS__ ) |
Shorthand for creating an entity with ecs_entity_init(). | |
#define | ecs_component(world, ...) ecs_component_init(world, &(ecs_component_desc_t) __VA_ARGS__ ) |
Shorthand for creating a component with ecs_component_init(). | |
#define | ecs_component_t(world, T) |
Shorthand for creating a component from a type. | |
#define | ecs_query(world, ...) ecs_query_init(world, &(ecs_query_desc_t) __VA_ARGS__ ) |
Shorthand for creating a query with ecs_query_cache_init. | |
#define | ecs_observer(world, ...) ecs_observer_init(world, &(ecs_observer_desc_t) __VA_ARGS__ ) |
Shorthand for creating an observer with ecs_observer_init(). | |
Convenience macro's for creating entities, components and observers
#define ECS_COMPONENT | ( | world, | |
id ) |
Declare & define a component.
Example:
#define ecs_component | ( | world, | |
... ) ecs_component_init(world, &(ecs_component_desc_t) __VA_ARGS__ ) |
Shorthand for creating a component with ecs_component_init().
Example:
#define ECS_COMPONENT_DECLARE | ( | id | ) | ecs_entity_t ecs_id(id) |
#define ECS_COMPONENT_DEFINE | ( | world, | |
id_ ) |
Define a forward declared component.
Example:
#define ecs_component_t | ( | world, | |
T ) |
Shorthand for creating a component from a type.
Example:
#define ECS_DECLARE | ( | id | ) | ecs_entity_t id, ecs_id(id) |
#define ECS_ENTITY | ( | world, | |
id, | |||
... ) |
#define ecs_entity | ( | world, | |
... ) ecs_entity_init(world, &(ecs_entity_desc_t) __VA_ARGS__ ) |
Shorthand for creating an entity with ecs_entity_init().
Example:
#define ECS_ENTITY_DECLARE ECS_DECLARE |
#define ECS_ENTITY_DEFINE | ( | world, | |
id_, | |||
... ) |
Define a forward declared entity.
Example:
#define ECS_OBSERVER | ( | world, | |
id, | |||
kind, | |||
... ) |
Declare & define an observer.
Example:
#define ecs_observer | ( | world, | |
... ) ecs_observer_init(world, &(ecs_observer_desc_t) __VA_ARGS__ ) |
Shorthand for creating an observer with ecs_observer_init().
Example:
#define ECS_OBSERVER_DECLARE | ( | id | ) | ecs_entity_t ecs_id(id) |
#define ECS_OBSERVER_DEFINE | ( | world, | |
id_, | |||
kind, | |||
... ) |
Define a forward declared observer.
Example:
#define ECS_PREFAB | ( | world, | |
id, | |||
... ) ECS_ENTITY(world, id, Prefab, __VA_ARGS__) |
#define ECS_PREFAB_DECLARE ECS_DECLARE |
#define ECS_PREFAB_DEFINE | ( | world, | |
id, | |||
... ) ECS_ENTITY_DEFINE(world, id, Prefab, __VA_ARGS__) |
Define a forward declared prefab.
Example:
#define ECS_QUERY | ( | world, | |
name, | |||
... ) |
Declare & define an observer.
Example:
#define ecs_query | ( | world, | |
... ) ecs_query_init(world, &(ecs_query_desc_t) __VA_ARGS__ ) |
#define ECS_QUERY_DECLARE | ( | name | ) | ecs_query_t* name |
#define ECS_QUERY_DEFINE | ( | world, | |
name_, | |||
... ) |
Define a forward declared observer.
Example:
#define ECS_TAG | ( | world, | |
id ) ECS_ENTITY(world, id, 0) |
#define ECS_TAG_DEFINE | ( | world, | |
id ) ECS_ENTITY_DEFINE(world, id, 0) |
Define a forward declared tag.
Example: