aboutsummaryrefslogtreecommitdiff
path: root/hftrss.c
diff options
context:
space:
mode:
Diffstat (limited to 'hftrss.c')
-rw-r--r--hftrss.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/hftrss.c b/hftrss.c
new file mode 100644
index 0000000..1b903c1
--- /dev/null
+++ b/hftrss.c
@@ -0,0 +1,45 @@
+#include "asset.h"
+#include "config.h"
+#include "game.h"
+#include "maths.h"
+#include "memory.h"
+#include "plat.h"
+#include "render.h"
+
+int entrypoint(int argc, const char** argv, Arena* m) {
+ Heap h;
+ App* a;
+ FPS f;
+ Renderer r;
+ Game* game;
+ (void)argc;
+ (void)argv;
+ init_maths();
+ init_heap(
+ &h,
+ arena_alloc(m, app_memory_size),
+ app_memory_size
+ );
+ a = new_app(&h, game_name);
+ init_audio();
+ init_fps(&f, default_mpf);
+ game = arena_alloc(m, sizeof *game);
+ init_game(game, game_state_menu);
+ while (a->o) {
+ fps_begin(&f);
+ while (f.now >= f.next && a->o) {
+ app_begin(a);
+ update_game(game, a);
+ ren_begin(&r, a->fb, viewport_w, viewport_h);
+ ren_clear(&r);
+ ren_game(game, &r);
+ ren_end(&r);
+ app_end(a);
+ fps_update(&f);
+ }
+ fps_end(&f);
+ }
+ deinit_audio();
+ deinit_app(a);
+ return error_none;
+}