Skip to content

Commit

Permalink
Add world::run_pipeline<T>(ecs_ftime_t) overload
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroErrors authored and SanderMertens committed Jul 15, 2023
1 parent d24a9e1 commit 6af829d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20134,6 +20134,13 @@ bool progress(ecs_ftime_t delta_time = 0.0) const;
*/
void run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_time = 0.0) const;

/** Run pipeline.
* @tparam Pipeline Type associated with pipeline.
* @see ecs_run_pipeline
*/
template <typename Pipeline, if_not_t< is_enum<Pipeline>::value > = 0>
void run_pipeline(ecs_ftime_t delta_time = 0.0) const;

/** Set timescale.
* @see ecs_set_time_scale
*/
Expand Down Expand Up @@ -28373,6 +28380,11 @@ inline void world::run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_tim
return ecs_run_pipeline(m_world, pip, delta_time);
}

template <typename Pipeline, if_not_t< is_enum<Pipeline>::value >>
inline void world::run_pipeline(ecs_ftime_t delta_time) const {
return ecs_run_pipeline(m_world, _::cpp_type<Pipeline>::id(m_world), delta_time);
}

inline void world::set_time_scale(ecs_ftime_t mul) const {
ecs_set_time_scale(m_world, mul);
}
Expand Down
5 changes: 5 additions & 0 deletions include/flecs/addons/cpp/mixins/pipeline/impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ inline void world::run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_tim
return ecs_run_pipeline(m_world, pip, delta_time);
}

template <typename Pipeline, if_not_t< is_enum<Pipeline>::value >>
inline void world::run_pipeline(ecs_ftime_t delta_time) const {
return ecs_run_pipeline(m_world, _::cpp_type<Pipeline>::id(m_world), delta_time);
}

inline void world::set_time_scale(ecs_ftime_t mul) const {
ecs_set_time_scale(m_world, mul);
}
Expand Down
7 changes: 7 additions & 0 deletions include/flecs/addons/cpp/mixins/pipeline/mixin.inl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ bool progress(ecs_ftime_t delta_time = 0.0) const;
*/
void run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_time = 0.0) const;

/** Run pipeline.
* @tparam Pipeline Type associated with pipeline.
* @see ecs_run_pipeline
*/
template <typename Pipeline, if_not_t< is_enum<Pipeline>::value > = 0>
void run_pipeline(ecs_ftime_t delta_time = 0.0) const;

/** Set timescale.
* @see ecs_set_time_scale
*/
Expand Down

0 comments on commit 6af829d

Please sign in to comment.