Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
impl.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include "builder.hpp"
9
10namespace flecs {
11
12template <typename ... Components>
13struct pipeline : entity {
15 : entity(world)
16 {
18
19 if (!id_) {
21 }
22 }
23};
24
27}
28
29template <typename Pipeline, if_not_t< is_enum<Pipeline>::value >>
31 return flecs::pipeline_builder<>(world_, _::type<Pipeline>::id(world_));
32}
33
34inline void world::set_pipeline(const flecs::entity pip) const {
35 return ecs_set_pipeline(world_, pip);
36}
37
38template <typename Pipeline>
39inline void world::set_pipeline() const {
40 return ecs_set_pipeline(world_, _::type<Pipeline>::id(world_));
41}
42
45}
46
47inline bool world::progress(ecs_ftime_t delta_time) const {
49}
50
51inline void world::run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_time) const {
53}
54
55template <typename Pipeline, if_not_t< is_enum<Pipeline>::value >>
56inline void world::run_pipeline(ecs_ftime_t delta_time) const {
57 return ecs_run_pipeline(world_, _::type<Pipeline>::id(world_), delta_time);
58}
59
60inline void world::set_time_scale(ecs_ftime_t mul) const {
62}
63
64inline void world::set_target_fps(ecs_ftime_t target_fps) const {
65 ecs_set_target_fps(world_, target_fps);
66}
67
68inline void world::reset_clock() const {
70}
71
72inline void world::set_threads(int32_t threads) const {
73 ecs_set_threads(world_, threads);
74}
75
76inline int32_t world::get_threads() const {
78}
79
80inline void world::set_task_threads(int32_t task_threads) const {
81 ecs_set_task_threads(world_, task_threads);
82}
83
84inline bool world::using_task_threads() const {
86}
87
88}
#define ECS_INVALID_PARAMETER
Invalid parameter error code.
Definition log.h:661
#define ecs_abort(error_code,...)
Abort.
Definition log.h:464
FLECS_API void ecs_set_threads(ecs_world_t *world, int32_t threads)
Set number of worker threads.
FLECS_API void ecs_set_time_scale(ecs_world_t *world, ecs_ftime_t scale)
Set time scale.
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_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 bool ecs_using_task_threads(ecs_world_t *world)
Return true if task thread use has been requested.
FLECS_API void ecs_set_task_threads(ecs_world_t *world, int32_t task_threads)
Set number of worker task threads.
FLECS_API ecs_entity_t ecs_pipeline_init(ecs_world_t *world, const ecs_pipeline_desc_t *desc)
Create a custom pipeline.
int32_t ecs_get_stage_count(const ecs_world_t *world)
Get the number of configured stages.
ecs_entity_t entity_t
Entity type.
Definition c_types.hpp:21
ecs_world_t world_t
World type.
Definition c_types.hpp:18
void set_target_fps(ecs_ftime_t target_fps) const
Set the target FPS.
flecs::pipeline_builder pipeline() const
Create a new pipeline.
flecs::entity get_pipeline() const
Get the pipeline.
void run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_time=0.0) const
Run a pipeline.
void reset_clock() const
Reset the simulation clock.
void set_threads(int32_t threads) const
Set the number of threads.
void set_pipeline() const
Set the pipeline.
int32_t get_threads() const
Get the number of threads.
void set_time_scale(ecs_ftime_t mul) const
Set the time scale.
void set_task_threads(int32_t task_threads) const
Set the number of task threads.
bool progress(ecs_ftime_t delta_time=0.0) const
Progress the world one tick.
bool using_task_threads() const
Return true if task thread use has been requested.
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition flecs.h:59
void ecs_set_target_fps(ecs_world_t *world, float fps)
Set target frames per second (FPS) for an application.
Pipeline builder.
Pipeline descriptor, used with ecs_pipeline_init().
Definition pipeline.h:88
Entity.
Definition entity.hpp:30
entity()
Default constructor.
Definition entity.hpp:32
flecs::id_t id_
The raw ID value.
Definition decl.hpp:149
Pipeline builder.
Definition builder.hpp:24
Forward declaration for pipeline.
Definition impl.hpp:13
The world.
Definition world.hpp:246
world_t * world_
Pointer to the underlying C world.
Definition world.hpp:1540
ecs_ftime_t delta_time() const
Get delta_time.
Definition world.hpp:1422