Function readonly_begin

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

bool readonly_begin()

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_readonly_begin must be followed by a call to ecs_readonly_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_readonly_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.

Returns
Whether world is currently staged.

Source

Lines 246-248 in include/flecs/addons/cpp/world.hpp.

bool readonly_begin() {
    return ecs_readonly_begin(m_world);
}