1#include <custom_phases_no_builtin.h>
2#include <stdio.h>
3
4
5
6
7
10}
11
12int main(int argc, char *argv[]) {
14
15
16
17
21
24
25
27 .entity =
ecs_entity(ecs, { .name =
"CollisionSystem" }),
28
29 .phase = Collisions,
30 .callback = Sys
31 });
32
34 .entity =
ecs_entity(ecs, { .name =
"PhysicsSystem" }),
35
36 .phase = Physics,
37 .callback = Sys
38 });
39
41 .entity =
ecs_entity(ecs, { .name =
"GameSystem" }),
42
43 .phase = Update,
44 .callback = Sys
45 });
46
47
49
51
52
53
54
55
56}
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).