Function ecs_staging_begin

Synopsis

#include <include/flecs.h>

FLECS_API bool ecs_staging_begin(ecs_world_t *world)

Description

Begin staging. When an application does not use ecs_progress to control the main loop, it can still use Flecs features such as the defer queue. When an application needs to stage changes, it needs to call this function after ecs_frame_begin. A call to ecs_staging_begin must be followed by a call to ecs_staging_end.

When staging is enabled, modifications to entities are stored to a stage. This ensures that arrays are not modified while iterating. Modifications are merged back to the "main stage" when ecs_staging_end is invoked.

While the world is in staging mode, no structural changes (add/remove/...) can be made to the world itself. Operations must be executed on a stage instead (see ecs_get_stage).

This function should only be ran from the main thread.

Parameters

world - The world

Returns
Whether world is currently staged.

Source

Line 3103 in include/flecs.h.