Flecs v3.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
37typedef struct ecs_app_desc_t {
40 int32_t threads;
41 int32_t frames;
48 void *ctx;
50
53 ecs_world_t *world,
54 ecs_app_desc_t *desc);
55
58 ecs_world_t *world,
59 const ecs_app_desc_t *desc);
60
72FLECS_API
74 ecs_world_t *world,
75 ecs_app_desc_t *desc);
76
85FLECS_API
87 ecs_world_t *world,
88 const ecs_app_desc_t *desc);
89
95FLECS_API
97 ecs_app_run_action_t callback);
98
104FLECS_API
106 ecs_app_frame_action_t callback);
107
110#ifdef __cplusplus
111}
112#endif
113
114#endif
115
116#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:57
int(* ecs_app_run_action_t)(ecs_world_t *world, ecs_app_desc_t *desc)
Callback type for run action.
Definition: app.h:52
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:228
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition: flecs.h:42
Used with ecs_app_run.
Definition: app.h:37
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:45
int32_t frames
Number of frames to run (0 for infinite)
Definition: app.h:41
bool enable_monitor
Periodically collect statistics.
Definition: app.h:43
void * ctx
Reserved for custom run/frame actions.
Definition: app.h:48
bool enable_rest
Allows HTTP clients to access ECS data.
Definition: app.h:42
int32_t threads
Number of threads.
Definition: app.h:40