#ifndef MIC_APP_H #define MIC_APP_H #include #include #include "shorthand.h" #include "platform.h" typedef struct AppState { // OpenGL GLFWwindow *window; } 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