Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Creation & Deletion

Functions

ecs_world_tecs_init (void)
 Create a new world. More...
 
ecs_world_tecs_mini (void)
 Same as ecs_init, but with minimal set of modules loaded. More...
 
ecs_world_tecs_init_w_args (int argc, char *argv[])
 Create a new world with arguments. More...
 
int ecs_fini (ecs_world_t *world)
 Delete a world. More...
 
bool ecs_is_fini (const ecs_world_t *world)
 Returns whether the world is being deleted. More...
 
void ecs_atfini (ecs_world_t *world, ecs_fini_action_t action, void *ctx)
 Register action to be executed when world is destroyed. More...
 

Detailed Description

Function Documentation

◆ ecs_atfini()

void ecs_atfini ( ecs_world_t world,
ecs_fini_action_t  action,
void *  ctx 
)

Register action to be executed when world is destroyed.

Fini actions are typically used when a module needs to clean up before a world shuts down.

Parameters
worldThe world.
actionThe function to execute.
ctxUserdata to pass to the function

◆ ecs_fini()

int ecs_fini ( ecs_world_t world)

Delete a world.

This operation deletes the world, and everything it contains.

Parameters
worldThe world to delete.
Returns
Zero if successful, non-zero if failed.

◆ ecs_init()

ecs_world_t * ecs_init ( void  )

Create a new world.

A world manages all the ECS data and supporting infrastructure. Applications must have at least one world. Entities, component and system handles are local to a world and should not be shared between worlds.

This operation creates a world with all builtin modules loaded.

Returns
A new world

◆ ecs_init_w_args()

ecs_world_t * ecs_init_w_args ( int  argc,
char *  argv[] 
)

Create a new world with arguments.

Same as ecs_init, but allows passing in command line arguments. These can be used to dynamically enable flecs features to an application. Currently these arguments are not used.

Returns
A new world

◆ ecs_is_fini()

bool ecs_is_fini ( const ecs_world_t world)

Returns whether the world is being deleted.

Parameters
worldThe world.
Returns
True if being deleted, false if not.

◆ ecs_mini()

ecs_world_t * ecs_mini ( void  )

Same as ecs_init, but with minimal set of modules loaded.

Returns
A new tiny world