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

Pipeline module. More...

Go to the source code of this file.

Classes

struct  ecs_pipeline_desc_t
 Pipeline descriptor, used with ecs_pipeline_init(). More...
 

Macros

#define FLECS_PIPELINE_H
 
#define ECS_PIPELINE_DEFINE(world, id_, ...)
 Convenience macro to create a predeclared pipeline.
 
#define ECS_PIPELINE(world, id, ...)
 Convenience macro to create a pipeline.
 
#define ecs_pipeline(world, ...)    ecs_pipeline_init(world, &(ecs_pipeline_desc_t) __VA_ARGS__ )
 Convenience macro to create a pipeline.
 

Typedefs

typedef struct ecs_pipeline_desc_t ecs_pipeline_desc_t
 Pipeline descriptor, used with ecs_pipeline_init().
 

Functions

FLECS_API ecs_entity_t ecs_pipeline_init (ecs_world_t *world, const ecs_pipeline_desc_t *desc)
 Create a custom pipeline.
 
FLECS_API void ecs_set_pipeline (ecs_world_t *world, ecs_entity_t pipeline)
 Set a custom pipeline.
 
FLECS_API ecs_entity_t ecs_get_pipeline (const ecs_world_t *world)
 Get the current pipeline.
 
FLECS_API bool ecs_progress (ecs_world_t *world, ecs_ftime_t delta_time)
 Progress a world.
 
FLECS_API void ecs_set_time_scale (ecs_world_t *world, ecs_ftime_t scale)
 Set time scale.
 
FLECS_API void ecs_reset_clock (ecs_world_t *world)
 Reset world clock.
 
FLECS_API void ecs_run_pipeline (ecs_world_t *world, ecs_entity_t pipeline, ecs_ftime_t delta_time)
 Run pipeline.
 
FLECS_API void ecs_set_threads (ecs_world_t *world, int32_t threads)
 Set number of worker threads.
 
FLECS_API void ecs_set_task_threads (ecs_world_t *world, int32_t task_threads)
 Set number of worker task threads.
 
FLECS_API bool ecs_using_task_threads (ecs_world_t *world)
 Returns true if task thread use have been requested.
 
FLECS_API void FlecsPipelineImport (ecs_world_t *world)
 Pipeline module import function.
 

Detailed Description

Pipeline module.

The pipeline module provides support for running systems automatically and on multiple threads. A pipeline is a collection of tags that can be added to systems. When ran, a pipeline will query for all systems that have the tags that belong to a pipeline, and run them.

The module defines a number of builtin tags (EcsPreUpdate, EcsOnUpdate, EcsPostUpdate etc.) that are registered with the builtin pipeline. The builtin pipeline is ran by default when calling ecs_progress(). An application can set a custom pipeline with the ecs_set_pipeline() function.

Definition in file pipeline.h.