Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
timer.h File Reference

Timer module. More...

Go to the source code of this file.

Classes

struct  EcsTimer
 Component used for one shot/interval timer functionality. More...
 
struct  EcsRateFilter
 Apply a rate filter to a tick source. More...
 

Typedefs

typedef struct EcsTimer EcsTimer
 Component used for one shot/interval timer functionality.
 
typedef struct EcsRateFilter EcsRateFilter
 Apply a rate filter to a tick source.
 

Functions

FLECS_API ecs_entity_t ecs_set_timeout (ecs_world_t *world, ecs_entity_t tick_source, ecs_ftime_t timeout)
 Set timer timeout.
 
FLECS_API ecs_ftime_t ecs_get_timeout (const ecs_world_t *world, ecs_entity_t tick_source)
 Get current timeout value for the specified timer.
 
FLECS_API ecs_entity_t ecs_set_interval (ecs_world_t *world, ecs_entity_t tick_source, ecs_ftime_t interval)
 Set timer interval.
 
FLECS_API ecs_ftime_t ecs_get_interval (const ecs_world_t *world, ecs_entity_t tick_source)
 Get current interval value for the specified timer.
 
FLECS_API void ecs_start_timer (ecs_world_t *world, ecs_entity_t tick_source)
 Start timer.
 
FLECS_API void ecs_stop_timer (ecs_world_t *world, ecs_entity_t tick_source)
 Stop timer This operation stops a timer from triggering.
 
FLECS_API void ecs_reset_timer (ecs_world_t *world, ecs_entity_t tick_source)
 Reset time value of timer to 0.
 
FLECS_API void ecs_randomize_timers (ecs_world_t *world)
 Enable randomizing initial time value of timers.
 
FLECS_API ecs_entity_t ecs_set_rate (ecs_world_t *world, ecs_entity_t tick_source, int32_t rate, ecs_entity_t source)
 Set rate filter.
 
FLECS_API void ecs_set_tick_source (ecs_world_t *world, ecs_entity_t system, ecs_entity_t tick_source)
 Assign tick source to system.
 
FLECS_API void FlecsTimerImport (ecs_world_t *world)
 Timer module import function.
 

Detailed Description

Timer module.

Timers can be used to trigger actions at periodic or one-shot intervals. They are typically used together with systems and pipelines.

Definition in file timer.h.