Function frame_begin

Synopsis

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

ecs_ftime_t frame_begin(float delta_time=0)

Description

Begin frame. When an application does not use progress() to control the main loop, it can still use Flecs features such as FPS limiting and time measurements. This operation needs to be invoked whenever a new frame is about to get processed.

Calls to frame_begin must always be followed by frame_end.

The function accepts a delta_time parameter, which will get passed to systems. This value is also used to compute the amount of time the function needs to sleep to ensure it does not exceed the target_fps, when it is set. When 0 is provided for delta_time, the time will be measured.

This function should only be ran from the main thread.

Parameters

delta_time - Time elapsed since the last frame.

Returns
The provided delta_time, or measured time if 0 was provided.

Source

Lines 214-216 in include/flecs/addons/cpp/world.hpp.

ecs_ftime_t frame_begin(float delta_time = 0) {
    return ecs_frame_begin(m_world, delta_time);
}