Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
app.h
Go to the documentation of this file.
1
11#ifdef FLECS_APP
12
13#ifndef FLECS_PIPELINE
14#define FLECS_PIPELINE
15#endif
16
17#ifndef FLECS_APP_H
18#define FLECS_APP_H
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
34 ecs_world_t *world);
35
51
54 ecs_world_t *world,
55 ecs_app_desc_t *desc);
56
59 ecs_world_t *world,
60 const ecs_app_desc_t *desc);
61
73FLECS_API
75 ecs_world_t *world,
76 ecs_app_desc_t *desc);
77
86FLECS_API
88 ecs_world_t *world,
89 const ecs_app_desc_t *desc);
90
96FLECS_API
98 ecs_app_run_action_t callback);
99
105FLECS_API
107 ecs_app_frame_action_t callback);
108
111#ifdef __cplusplus
112}
113#endif
114
115#endif
116
117#endif // FLECS_APP
int(* ecs_app_init_action_t)(ecs_world_t *world)
Callback type for init action.
Definition app.h:33
int(* ecs_app_frame_action_t)(ecs_world_t *world, const ecs_app_desc_t *desc)
Callback type for frame action.
Definition app.h:58
struct ecs_app_desc_t ecs_app_desc_t
Used with ecs_app_run().
int(* ecs_app_run_action_t)(ecs_world_t *world, ecs_app_desc_t *desc)
Callback type for run action.
Definition app.h:53
FLECS_API int ecs_app_run(ecs_world_t *world, ecs_app_desc_t *desc)
Run application.
FLECS_API int ecs_app_run_frame(ecs_world_t *world, const ecs_app_desc_t *desc)
Default frame callback.
FLECS_API int ecs_app_set_run_action(ecs_app_run_action_t callback)
Set custom run action.
FLECS_API int ecs_app_set_frame_action(ecs_app_frame_action_t callback)
Set custom frame action.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:391
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition flecs.h:59
Used with ecs_app_run().
Definition app.h:37
uint16_t port
HTTP port used by REST API.
Definition app.h:44
bool enable_stats
Periodically collect statistics.
Definition app.h:43
ecs_ftime_t target_fps
Target FPS.
Definition app.h:38
ecs_ftime_t delta_time
Frame time increment (0 for measured values)
Definition app.h:39
ecs_app_init_action_t init
If set, function is ran before starting the main loop.
Definition app.h:46
int32_t frames
Number of frames to run (0 for infinite)
Definition app.h:41
void * ctx
Reserved for custom run/frame actions.
Definition app.h:49
bool enable_rest
Enables ECS access over HTTP, necessary for explorer.
Definition app.h:42
int32_t threads
Number of threads.
Definition app.h:40