![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Optional addon for running the main application loop. More...
Classes | |
| struct | ecs_app_desc_t |
| Used with ecs_app_run(). More... | |
Typedefs | |
| typedef int(* | ecs_app_init_action_t) (ecs_world_t *world) |
| Callback type for init action. | |
| typedef struct ecs_app_desc_t | ecs_app_desc_t |
| Used with ecs_app_run(). | |
| typedef int(* | ecs_app_run_action_t) (ecs_world_t *world, ecs_app_desc_t *desc) |
| Callback type for run action. | |
| typedef int(* | ecs_app_frame_action_t) (ecs_world_t *world, const ecs_app_desc_t *desc) |
| Callback type for frame action. | |
Functions | |
| 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. | |
Optional addon for running the main application loop.
| typedef int(* ecs_app_frame_action_t) (ecs_world_t *world, const ecs_app_desc_t *desc) |
| typedef int(* ecs_app_init_action_t) (ecs_world_t *world) |
| typedef int(* ecs_app_run_action_t) (ecs_world_t *world, ecs_app_desc_t *desc) |
| FLECS_API int ecs_app_run | ( | ecs_world_t * | world, |
| ecs_app_desc_t * | desc ) |
Run application.
This will run the application with the parameters specified in desc. After the application quits (ecs_quit() is called), the world will be cleaned up.
If a custom run action is set, it will be invoked by this operation. The default run action calls the frame action in a loop until it returns a non-zero value.
| world | The world. |
| desc | Application parameters. |
| FLECS_API int ecs_app_run_frame | ( | ecs_world_t * | world, |
| const ecs_app_desc_t * | desc ) |
Default frame callback.
This operation will run a single frame. By default, this operation will invoke ecs_progress() directly, unless a custom frame action is set.
| world | The world. |
| desc | The desc struct passed to ecs_app_run(). |
| FLECS_API int ecs_app_set_frame_action | ( | ecs_app_frame_action_t | callback | ) |
Set custom frame action.
See ecs_app_run_frame().
| callback | The frame action. |
| FLECS_API int ecs_app_set_run_action | ( | ecs_app_run_action_t | callback | ) |
Set custom run action.
See ecs_app_run().
| callback | The run action. |