From bf29ba639dbec647fc347a401cff05ced7e2b22f Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 9 Jan 2025 21:32:05 +1100 Subject: refactor app --- app.hpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'app.hpp') diff --git a/app.hpp b/app.hpp index 9a660cf..a1fb911 100644 --- a/app.hpp +++ b/app.hpp @@ -112,18 +112,7 @@ struct App { uint64_t begin_t, end_t; App_Internal* internal; - template - 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; }; -- cgit v1.2.3-54-g00ecf