aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
new file mode 100644
index 0000000..a39bff0
--- /dev/null
+++ b/src/app.c
@@ -0,0 +1,44 @@
1#include "app.h"
2#include "platform.h"
3
4static inline bool
5app_init(AppState *state, PlatformAPI platform) {
6 platform.log("INIT");
7 state->lt_memory = platform.calloc(LT_MEMORY_SIZE, sizeof(u8));
8 state->st_memory = platform.calloc(ST_MEMORY_SIZE, sizeof(u8));
9 return true;
10}
11
12static inline void
13app_destroy(AppState *state, PlatformAPI platform) {
14 (void)state; // Unused parameter.
15 platform.log("DESTROY");
16}
17
18static inline void
19app_reload(AppState *state, PlatformAPI platform) {
20 (void)state; // Unused parameter.
21 platform.log("RELOAD");
22}
23
24static inline void
25app_unload(AppState *state, PlatformAPI platform) {
26 (void)state; // Unused parameter.
27 platform.log("UNLOAD");
28}
29
30static inline bool
31app_step(AppState *state, PlatformAPI platform) {
32 (void)state; // Unused parameter.
33 platform.log("STEP");
34 platform.sleep(100000);
35 return true;
36}
37
38const AppAPI APP_API = {
39 .init = app_init,
40 .destroy = app_destroy,
41 .reload = app_reload,
42 .step = app_step,
43 .unload = app_unload,
44};