app.h (461B)
1 #ifndef APP_H 2 #define APP_H 3 4 #include "types.h" 5 6 #include "glad/glad.h" 7 #include "GLFW/glfw3.h" 8 9 typedef struct { 10 const char *title; 11 u16 width; 12 u16 height; 13 u8 gl_major_version; 14 u8 gl_minor_version; 15 } AppInfo; 16 17 typedef struct App { 18 AppInfo *app_info; 19 GLFWwindow *window; 20 } App; 21 22 App *App_make(const AppInfo *app_info); 23 void App_free(App *app); 24 25 void App_run(const App *app, void (*init_func)(void), void (*loop_func)(void)); 26 27 #endif 28