diff options
author | quou <quou@disroot.org> | 2025-01-09 21:32:05 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-01-09 21:32:05 +1100 |
commit | bf29ba639dbec647fc347a401cff05ced7e2b22f (patch) | |
tree | 0e2d86f532a1096350bcd963c7fcd8546d527e1e /app.hpp | |
parent | 78321be96d15afaccb3d0a179e91a3e5887d3376 (diff) |
refactor app
Diffstat (limited to 'app.hpp')
-rw-r--r-- | app.hpp | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -112,18 +112,7 @@ struct App { uint64_t begin_t, end_t; App_Internal* internal; - template <typename T> - static T* create(const char* name) { - Arena* arena; - T* app = (T*)alloc(sizeof(T), arena); - app = new(app) T(); - app->arena = arena; - app->running = 0; - app->init(name); - return app; - } - static void* alloc(int size, Arena*& arena); - void init(const char* name); + void init(const char* name, Arena* a); void destroy(); void begin(); @@ -140,6 +129,9 @@ struct App { void get_vk_exts(const char** exts, int& count); + virtual void on_init() = 0; + virtual void on_update() = 0; + virtual void on_destroy() = 0; virtual void on_resize() = 0; }; |