diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-02-16 21:13:58 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-02-16 21:13:58 -0500 |
| commit | ac6ef66cc8f60ecc9d7ee8691bf7a73fcc24f4b7 (patch) | |
| tree | 43228b509adf544468f4f35747bba8130e2ea133 /main.c | |
| parent | 40b2fc59394a2bedd1097fde107ce54b5773d649 (diff) | |
| download | volute-ac6ef66cc8f60ecc9d7ee8691bf7a73fcc24f4b7.zip | |
renderer: set font size functions on init
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -36,8 +36,6 @@ static const mu_Color COLOR_SCROLLTHUMB = WHITE; /* Function declarations. */ static void set_style(mu_Context *ctx); -static int text_width(mu_Font font, const char *text, int len); -static int text_height(mu_Font font); static void main_loop(mu_Context *ctx, UI *ui); static void process_frame(mu_Context *ctx, UI *ui); static void main_window(mu_Context *ctx, UI *ui); @@ -47,14 +45,10 @@ static void main_window(mu_Context *ctx, UI *ui); int main(void) { - /* Init renderer. */ - r_init(); - /* Init microui. */ static mu_Context ctx; mu_init(&ctx); - ctx.text_width = text_width; - ctx.text_height = text_height; + r_init(&ctx); set_style(&ctx); /* Init data structures. */ @@ -84,19 +78,6 @@ set_style(mu_Context *ctx) { ctx->style->colors[MU_COLOR_SCROLLTHUMB] = COLOR_SCROLLTHUMB; } -static int -text_width(mu_Font font, const char *text, int len) { - if (len < 0) { - len = strlen(text); - } - return r_get_text_width(text, len); -} - -static int -text_height(mu_Font font) { - return r_get_text_height(); -} - static void main_loop(mu_Context *ctx, UI *ui) { for (;;) { |