From 177c4daea57194d81fd017a1d078efb48d9383d9 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sun, 23 Feb 2025 15:58:29 -0500 Subject: rewrite renderer --- main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 83370f2..847209a 100644 --- a/main.c +++ b/main.c @@ -1,10 +1,10 @@ /* Headers. */ #include +#include -#include -#include "renderer.h" #include "microui.h" +#include "renderer.h" #include "widget.h" #include "ui.h" @@ -12,6 +12,9 @@ /* Constants. */ static const char TITLE[] = "volute"; +enum window { + WIN_OPTS = MU_OPT_NOINTERACT | MU_OPT_NOTITLE | MU_OPT_AUTOSIZE | MU_OPT_NOFRAME, +}; static const mu_Color BLACK = {0, 0, 0, 255}; static const mu_Color WHITE = {255, 255, 255, 255}; @@ -81,7 +84,7 @@ set_style(mu_Context *ctx) { static void main_loop(mu_Context *ctx, UI *ui) { for (;;) { - r_handle_input(ctx); + r_input(ctx); process_frame(ctx, ui); r_render(ctx); } @@ -99,7 +102,7 @@ main_window(mu_Context *ctx, UI *ui) { int w, h; r_get_window_size(&w, &h); - if (!mu_begin_window_ex(ctx, TITLE, mu_rect(0, 0, w, h), MU_OPT_NOINTERACT | MU_OPT_NOTITLE)) { + if (!mu_begin_window_ex(ctx, TITLE, mu_rect(0, 0, w, h), WIN_OPTS)) { exit(EXIT_FAILURE); } /* TODO */ -- cgit v1.2.3