Skip to content
Flecs v4.1
mixin.inl
Go to the documentation of this file.
1/**
2 * @file addons/cpp/mixins/frame/mixin.inl
3 * @brief Frame world mixin.
4 */
5
6/**
7 * @defgroup cpp_addons_frame Frame
8 * @ingroup cpp_addons
9 * Frame management.
10 *
11 * @{
12 * @}
13 */
14
15/**
16 * @memberof flecs::world
17 * @ingroup cpp_addons_frame
18 *
19 * @{
20 */
21
22/** Begin frame.
23 * Calls to frame_begin() must always be followed by frame_end().
24 *
25 * @param delta_time Time elapsed since the last frame.
26 * @return The provided delta_time, or measured time if 0 was provided.
27 * @see ecs_frame_begin()
28 */
30
31/** End frame.
32 * @see ecs_frame_end()
33 */
34void frame_end() const;
35
36/** Run callback after completing the frame.
37 * @see ecs_run_post_frame()
38 */
39void run_post_frame(ecs_fini_action_t action, void *ctx) const;
40
41/** Signal application should quit.
42 * @see ecs_quit()
43 */
44void quit() const;
45
46/** Test if quit() has been called.
47 * @see ecs_should_quit()
48 */
49bool should_quit() const;
50
51/** Set the time scale.
52 * @see ecs_set_time_scale()
53 */
55
56/** Set the target FPS.
57 * @see ecs_set_target_fps()
58 */
59void set_target_fps(ecs_ftime_t target_fps) const;
60
61/** Reset the simulation clock.
62 * @see ecs_reset_clock()
63 */
64void reset_clock() const;
65
66/** @} */
void(*) ecs_fini_action_t(ecs_world_t *world, void *ctx)
Action callback on world exit.
Definition flecs.h:655
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition flecs.h:59
void set_target_fps(ecs_ftime_t target_fps) const
Set the target FPS.
ecs_ftime_t delta_time() const
Get delta_time.
Definition world.hpp:905
void frame_end() const
End frame.
void reset_clock() const
Reset the simulation clock.
void quit() const
Signal application should quit.
void set_time_scale(ecs_ftime_t mul) const
Set the time scale.
void run_post_frame(ecs_fini_action_t action, void *ctx) const
Run callback after completing the frame.
bool should_quit() const
Test if quit() has been called.
ecs_ftime_t frame_begin(ecs_ftime_t delta_time=0) const
Begin frame.