Function ecs_frame_begin

Synopsis

#include <include/flecs.h>

FLECS_API FLECS_FLOAT ecs_frame_begin(ecs_world_t *world, FLECS_FLOAT delta_time)

Description

Begin frame. When an application does not use ecs_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 ecs_frame_begin must always be followed by ecs_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

world - The world.

delta_time - Time elapsed since the last frame.

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

Source

Line 2655 in include/flecs.h.