Flecs v4.1
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
74FLECS_API
76 ecs_world_t *world,
77 ecs_app_desc_t *desc);
78
87FLECS_API
89 ecs_world_t *world,
90 const ecs_app_desc_t *desc);
91
98FLECS_API
100 ecs_app_run_action_t callback);
101
108FLECS_API
110 ecs_app_frame_action_t callback);
111
114#ifdef __cplusplus
115}
116#endif
117
118#endif
119
120#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:429
#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 collects 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, the function is run 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 and frame actions.
Definition app.h:49
bool enable_rest
Enables ECS access over HTTP, necessary for the explorer.
Definition app.h:42
int32_t threads
Number of threads.
Definition app.h:40