49 #define K_SYSTEM_TYPE_MAX_COUNT 512
This file contains global type definitions which are used throughout the entire engine and applicatio...
#define KAPI
Import/export qualifier.
Definition: defines.h:205
_Bool b8
8-bit boolean type
Definition: defines.h:58
unsigned short u16
Unsigned 16-bit integer.
Definition: defines.h:22
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
This file contains the linear allocator implementation.
Represents configuration for the application. The application config is fed to the engine on creation...
Definition: application_config.h:46
Engine-level current frame-specific data.
Definition: frame_data.h:11
Represents a registered system. Function pointers for init, shutdown and (optionally) update are held...
Definition: systems_manager.h:34
PFN_system_update update
A function pointer for the system's update routine, called every frame. Optional.
Definition: systems_manager.h:44
PFN_system_initialize initialize
A function pointer for the initialization routine. Required.
Definition: systems_manager.h:40
void * state
The state for the system.
Definition: systems_manager.h:38
PFN_system_shutdown shutdown
A function pointer for the shutdown routine. Required.
Definition: systems_manager.h:42
PFN_system_render_prepare_frame render_prepare_frame
A function pointer for the system's "prepare frame" routine, called every frame. Optional.
Definition: systems_manager.h:46
u64 state_size
The size of the state for the system.
Definition: systems_manager.h:36
The data structure for a linear allocator.
Definition: linear_allocator.h:25
The state for the systems manager. Holds the allocator used for all systems as well as the instances ...
Definition: systems_manager.h:96
k_system systems[K_SYSTEM_TYPE_MAX_COUNT]
The registered systems array.
Definition: systems_manager.h:100
linear_allocator systems_allocator
The allocator used to obtain state memory for registered systems.
Definition: systems_manager.h:98
KAPI b8 systems_manager_register(systems_manager_state *state, u16 type, PFN_system_initialize initialize, PFN_system_shutdown shutdown, PFN_system_update update, PFN_system_render_prepare_frame prepare_frame, void *config)
Registers a system to be managed. Also calls its initialize() function.
b8(* PFN_system_update)(void *state, struct frame_data *p_frame_data)
Typedef for a update function pointer.
Definition: systems_manager.h:25
b8 systems_manager_post_boot_initialize(systems_manager_state *state, struct application_config *app_config)
Initializes the system manager for all systems which must be setup after the application boot sequenc...
b8 systems_manager_update(systems_manager_state *state, struct frame_data *p_frame_data)
Calls update routines on all systems that opt in to the update. Performed during the main engine loop...
struct systems_manager_state systems_manager_state
The state for the systems manager. Holds the allocator used for all systems as well as the instances ...
void(* PFN_system_render_prepare_frame)(void *state, const struct frame_data *p_frame_data)
Typedef for a render prepare frame function pointer.
Definition: systems_manager.h:27
struct k_system k_system
Represents a registered system. Function pointers for init, shutdown and (optionally) update are held...
void systems_manager_shutdown(systems_manager_state *state)
Shuts the systems manager down.
b8(* PFN_system_initialize)(u64 *memory_requirement, void *memory, void *config)
Typedef for a system initialize function pointer.
Definition: systems_manager.h:21
k_system_type
Represents the known system types within the engine core up to K_SYSTEM_TYPE_KNOWN_MAX....
Definition: systems_manager.h:57
@ K_SYSTEM_TYPE_GEOMETRY
Definition: systems_manager.h:74
@ K_SYSTEM_TYPE_PLATFORM
Definition: systems_manager.h:64
@ K_SYSTEM_TYPE_TIMELINE
Definition: systems_manager.h:77
@ K_SYSTEM_TYPE_MATERIAL
Definition: systems_manager.h:73
@ K_SYSTEM_TYPE_TEXTURE
Definition: systems_manager.h:68
@ K_SYSTEM_TYPE_RENDERER
Definition: systems_manager.h:71
@ K_SYSTEM_TYPE_LIGHT
Definition: systems_manager.h:75
@ K_SYSTEM_TYPE_EVENT
Definition: systems_manager.h:61
@ K_SYSTEM_TYPE_RESOURCE
Definition: systems_manager.h:65
@ K_SYSTEM_TYPE_INPUT
Definition: systems_manager.h:63
@ K_SYSTEM_TYPE_XFORM
Definition: systems_manager.h:72
@ K_SYSTEM_TYPE_KNOWN_MAX
Definition: systems_manager.h:80
@ K_SYSTEM_TYPE_LOGGING
Definition: systems_manager.h:62
@ K_SYSTEM_TYPE_JOB
Definition: systems_manager.h:67
@ K_SYSTEM_TYPE_MEMORY
Definition: systems_manager.h:58
@ K_SYSTEM_TYPE_KVAR
Definition: systems_manager.h:60
@ K_SYSTEM_TYPE_CONSOLE
Definition: systems_manager.h:59
@ K_SYSTEM_TYPE_AUDIO
Definition: systems_manager.h:76
@ K_SYSTEM_TYPE_EXT_MAX
Definition: systems_manager.h:83
@ K_SYSTEM_TYPE_FONT
Definition: systems_manager.h:69
@ K_SYSTEM_TYPE_USER_MAX
Definition: systems_manager.h:86
@ K_SYSTEM_TYPE_CAMERA
Definition: systems_manager.h:70
@ K_SYSTEM_TYPE_MAX
Definition: systems_manager.h:88
@ K_SYSTEM_TYPE_SHADER
Definition: systems_manager.h:66
void(* PFN_system_shutdown)(void *state)
Typedef for a system shutdown function pointer.
Definition: systems_manager.h:23
b8 systems_manager_initialize(systems_manager_state *state, struct application_config *app_config)
Initializes the system manager for all systems which must be setup before the application boot sequen...
void systems_manager_renderer_frame_prepare(systems_manager_state *state, const struct frame_data *p_frame_data)
Calls "frame prepare" routines on all systems that opt in to it. This is generally for systems that n...
KAPI void * systems_manager_get_state(u16 type)
#define K_SYSTEM_TYPE_MAX_COUNT
Definition: systems_manager.h:49