1#include <runtime_component.h>
2#include <stdio.h>
3
4int main(int argc, char *argv[]) {
6
7
9 .members = {
12 }
13 });
14
15
17
18
20 void *ptr =
ecs_ensure_id(ecs, ent, Position, (
size_t)ti->size);
21
28
29
31 printf("%s\n", str);
32 ecs_os_free(str);
33
35}
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
FLECS_API char * ecs_ptr_to_expr(const ecs_world_t *world, ecs_entity_t type, const void *data)
Serialize value into expression string.
const ecs_type_info_t * ecs_get_type_info(const ecs_world_t *world, ecs_id_t component)
Get the type info for a component.
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.
#define ecs_entity(world,...)
Shorthand for creating an entity with ecs_entity_init().
void * ecs_ensure_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, size_t size)
Ensure an entity has a component and return a pointer.
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.
Type that contains component information (passed to ctors/dtors/...).