1#include <custom_phases.h>
2#include <stdio.h>
3
4
5
6
7
8
11}
12
13int main(int argc, char *argv[]) {
15
16
17
18
23
24
26 .entity =
ecs_entity(ecs, { .name =
"CollisionSystem" }),
27
28 .phase = Collisions,
29 .callback = Sys
30 });
31
33 .entity =
ecs_entity(ecs, { .name =
"PhysicsSystem" }),
34
35 .phase = Physics,
36 .callback = Sys
37 });
38
40 .entity =
ecs_entity(ecs, { .name =
"GameSystem" }),
41
43 .callback = Sys
44 });
45
46
48
50
51
52
53
54
55}
FLECS_API bool ecs_progress(ecs_world_t *world, ecs_ftime_t delta_time)
Progress a world.
#define ecs_system(world,...)
Shorthand for creating a system with ecs_system_init().
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
ecs_entity_t ecs_new_w_id(ecs_world_t *world, ecs_id_t component)
Create new entity with (component) ID.
#define ecs_add_pair(world, subject, first, second)
Add a pair to an entity.
#define ecs_entity(world,...)
Shorthand for creating an entity with ecs_entity_init().
const char * ecs_get_name(const ecs_world_t *world, ecs_entity_t entity)
Get the name of an entity.
int ecs_fini(ecs_world_t *world)
Delete a world.
ecs_world_t * ecs_init_w_args(int argc, char *argv[])
Create a new world with arguments.
ecs_entity_t system
The system (if applicable).