summaryrefslogtreecommitdiff
path: root/app.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-01-09 21:32:05 +1100
committerquou <quou@disroot.org>2025-01-09 21:32:05 +1100
commitbf29ba639dbec647fc347a401cff05ced7e2b22f (patch)
tree0e2d86f532a1096350bcd963c7fcd8546d527e1e /app.hpp
parent78321be96d15afaccb3d0a179e91a3e5887d3376 (diff)
refactor app
Diffstat (limited to 'app.hpp')
-rw-r--r--app.hpp16
1 files changed, 4 insertions, 12 deletions
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 <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;
};