Kohi Game Engine
|
Contains logic for the management of various engine systems, which are in turn registered with this manager whose lifecycle is then automatically managed thereafter. More...
Go to the source code of this file.
Data Structures | |
struct | k_system |
Represents a registered system. Function pointers for init, shutdown and (optionally) update are held here, as well as state for the system. More... | |
struct | systems_manager_state |
The state for the systems manager. Holds the allocator used for all systems as well as the instances and states of the registered systems themselves. More... | |
Macros | |
#define | K_SYSTEM_TYPE_MAX_COUNT 512 |
Typedefs | |
typedef b8(* | PFN_system_initialize) (u64 *memory_requirement, void *memory, void *config) |
Typedef for a system initialize function pointer. More... | |
typedef void(* | PFN_system_shutdown) (void *state) |
Typedef for a system shutdown function pointer. More... | |
typedef b8(* | PFN_system_update) (void *state, struct frame_data *p_frame_data) |
Typedef for a update function pointer. More... | |
typedef struct k_system | k_system |
Represents a registered system. Function pointers for init, shutdown and (optionally) update are held here, as well as state for the system. More... | |
typedef enum k_system_type | k_system_type |
Represents the known system types within the engine core up to K_SYSTEM_TYPE_KNOWN_MAX. User enumerations can start off at K_SYSTEM_TYPE_KNOWN_MAX + 1 to register their systems. More... | |
typedef 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 and states of the registered systems themselves. More... | |
Enumerations | |
enum | k_system_type { K_SYSTEM_TYPE_MEMORY = 0 , K_SYSTEM_TYPE_CONSOLE , K_SYSTEM_TYPE_KVAR , K_SYSTEM_TYPE_EVENT , K_SYSTEM_TYPE_LOGGING , K_SYSTEM_TYPE_INPUT , K_SYSTEM_TYPE_PLATFORM , K_SYSTEM_TYPE_RESOURCE , K_SYSTEM_TYPE_SHADER , K_SYSTEM_TYPE_JOB , K_SYSTEM_TYPE_TEXTURE , K_SYSTEM_TYPE_FONT , K_SYSTEM_TYPE_CAMERA , K_SYSTEM_TYPE_RENDERER , K_SYSTEM_TYPE_RENDER_VIEW , K_SYSTEM_TYPE_MATERIAL , K_SYSTEM_TYPE_GEOMETRY , K_SYSTEM_TYPE_LIGHT , K_SYSTEM_TYPE_AUDIO , K_SYSTEM_TYPE_KNOWN_MAX = 255 , K_SYSTEM_TYPE_USER_MAX = K_SYSTEM_TYPE_MAX_COUNT , K_SYSTEM_TYPE_MAX = K_SYSTEM_TYPE_USER_MAX } |
Represents the known system types within the engine core up to K_SYSTEM_TYPE_KNOWN_MAX. User enumerations can start off at K_SYSTEM_TYPE_KNOWN_MAX + 1 to register their systems. More... | |
Functions | |
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 sequence (i.e. events, renderer, etc.). More... | |
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 sequence (i.e. that require the application to configure them, such as fonts, etc.). More... | |
void | systems_manager_shutdown (systems_manager_state *state) |
Shuts the systems manager down. More... | |
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. More... | |
KAPI b8 | systems_manager_register (systems_manager_state *state, u16 type, PFN_system_initialize initialize, PFN_system_shutdown shutdown, PFN_system_update update, void *config) |
Registers a system to be managed. More... | |
KAPI void * | systems_manager_get_state (u16 type) |
Contains logic for the management of various engine systems, which are in turn registered with this manager whose lifecycle is then automatically managed thereafter.
#define K_SYSTEM_TYPE_MAX_COUNT 512 |
Represents a registered system. Function pointers for init, shutdown and (optionally) update are held here, as well as state for the system.
typedef enum k_system_type k_system_type |
Represents the known system types within the engine core up to K_SYSTEM_TYPE_KNOWN_MAX. User enumerations can start off at K_SYSTEM_TYPE_KNOWN_MAX + 1 to register their systems.
Typedef for a system initialize function pointer.
typedef void(* PFN_system_shutdown) (void *state) |
Typedef for a system shutdown function pointer.
typedef b8(* PFN_system_update) (void *state, struct frame_data *p_frame_data) |
Typedef for a update function pointer.
typedef 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 and states of the registered systems themselves.
enum k_system_type |
Represents the known system types within the engine core up to K_SYSTEM_TYPE_KNOWN_MAX. User enumerations can start off at K_SYSTEM_TYPE_KNOWN_MAX + 1 to register their systems.
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 sequence (i.e. events, renderer, etc.).
state | A pointer to the system manager state to be initialized. |
app_config | A pointer to the application configuration. |
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 sequence (i.e. that require the application to configure them, such as fonts, etc.).
state | A pointer to the system manager state to be initialized. |
app_config | A pointer to the application configuration. |
KAPI b8 systems_manager_register | ( | systems_manager_state * | state, |
u16 | type, | ||
PFN_system_initialize | initialize, | ||
PFN_system_shutdown | shutdown, | ||
PFN_system_update | update, | ||
void * | config | ||
) |
Registers a system to be managed.
state | A pointer to the system manager state. |
type | The system type. For known types, a k_system_type. Otherwise a user type. |
initialize | A function pointer for the initialize routine. Required. |
shutdown | A function pointer for the shutdown routine. Required. |
update | A function pointer for the update routine. Optional. |
config | A pointer to the configuration for the system, passed to initialize. |
void systems_manager_shutdown | ( | systems_manager_state * | state | ) |
Shuts the systems manager down.
state | A pointer to the system manager state to be shut down. |
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.
state | A pointer to the systems manager state. |
p_frame_data | A pointer to the data for this frame. |