summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index ff51bb3..7c053f8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,4 +1,4 @@
-#include "lzr.h"
+#include "TZR.h"
#include "cfg.h"
#include "game.h"
#include <stdio.h>
@@ -11,10 +11,12 @@ static void deinit(void);
int
main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
{
- if (LZR_Init(cfg)) {
- LZR_Quit();
+ if (TZR_Init(.width = DWIDTH,
+ .height = DHEIGHT,
+ .target_fps = TARGET_FPS,
+ .pixel_perfect = true,
+ .title = "jambase"))
return 1;
- }
if (atexit(deinit)) {
perror("main:atexit");
@@ -28,15 +30,17 @@ main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
}
game_init(game);
- while (!LZR_ShouldQuit()) {
- LZR_CycleEvents();
+ while (!TZR_ShouldQuit()) {
+ TZR_CycleEvents();
game_update(game);
- LZR_DrawBegin();
- LZR_DrawSetColor(0, 0, 0, 0);
- LZR_DrawClear();
+ if (TZR_DrawBegin())
+ return 1;
+ TZR_DrawSetColor(0, 0, 0, 0);
+ TZR_DrawClear();
game_draw(game);
- LZR_DrawEnd();
+ if (TZR_DrawEnd())
+ return 1;
}
return 0;
}
@@ -46,5 +50,5 @@ deinit(void)
{
if (game != NULL)
free(game);
- LZR_Quit();
+ TZR_Quit();
}