#ifndef MIC_APP_H #define MIC_APP_H #include "shorthand.h" #include "platform.h" #define LT_MEMORY_SIZE GB(2) #define ST_MEMORY_SIZE MB(100) typedef struct AppState { // Long and short term memory. char *lt_memory; char *st_memory; } AppState; // Function pointers for the AppAPI. typedef struct AppAPI { // Initialization code. Meant to be called exactly once before other API // interactions. Returns the success or failure of the initialization // process. bool (*init)(AppState *state, PlatformAPI platform); // Resource deallocation and cleanup. Meant to be called exactly once at the // end of the app. void (*destroy)(AppState *state, PlatformAPI platform); // In case of hot code reloading, these functions handle the necessary // resource setup and reloading. void (*reload)(AppState *state, PlatformAPI platform); void (*unload)(AppState *state, PlatformAPI platform); // Main update/step function for the app. Returns if the app should keep // running. bool (*step)(AppState *state, PlatformAPI platform); } AppAPI; #endif // MIC_APP_H