Module API addon

Functions

ecs_importImport a module
ecs_import_cSame as ecs_import, but with name to scope conversion
ecs_import_from_library
ecs_module_initRegister a new module.

Defines

Defines (module.h)

ECS_MODULE_DEFINE(world,id)
{
ecs_component_desc_t desc = {0};
desc.entity = ecs_id(id);
ecs_id(id) = ecs_module_init(world, #id, &desc);
ecs_set_scope(world, ecs_id(id));
}

Define module

ECS_MODULE(world,id)
ecs_entity_t ecs_id(id) = 0; ECS_MODULE_DEFINE(world, id)
(void)ecs_id(id);\

Mentioned in:

ECS_IMPORT(world,id)
ecs_import_c(world, id##Import, #id);

Wrapper around ecs_import. This macro provides a convenient way to load a module with the world. It can be used like this:

ECS_IMPORT(world, FlecsSystemsPhysics);

Mentioned in:

Quickstart / Module

Manual / Naming conventions

Manual / Modules

REST API Manual / Enable the REST API