From f785ce3106176d56865372de566314952954fe7f Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Wed, 27 Sep 2023 06:06:18 +0200 Subject: fix --- source/saw/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source') diff --git a/source/saw/main.c b/source/saw/main.c index c614f65..723fa92 100644 --- a/source/saw/main.c +++ b/source/saw/main.c @@ -21,6 +21,8 @@ #include +#include "font.inl.h" + enum { SAW_CHANNEL_COUNT = 2, SAW_SAMPLE_RATE = 44100, @@ -56,6 +58,8 @@ typedef struct { static struct NVGcontext *saw_nvg; static ma_device saw_ma; +static i32 saw_font = -1; + static i32 saw_mouse_x = 0; static i32 saw_mouse_y = 0; static i8 saw_lbutton_click = 0; @@ -449,6 +453,12 @@ static void saw_init(void) { ma_device_start(&saw_ma); + saw_font = nvgCreateFontMem(saw_nvg, "Black Chancery", saw_font_ttf, + SAW_FONT_TTF_SIZE, 0); + + if (saw_font == -1) + printf("nvgCreateFontMem failed.\n"); + for (i32 i = 0; i < ROLL_COUNT; i++) saw_rolls[i] = (saw_roll_t) { .last_index = -1, .turned_off = { 0 }, -- cgit v1.2.3