summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-27 06:06:18 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-27 06:06:18 +0200
commitf785ce3106176d56865372de566314952954fe7f (patch)
tree8e2aa0d8aa09e63a58be12e57e1b37642173d7c8 /source
parente02ef4d96d35bbb2e97a7d2334acbf84db650173 (diff)
downloadsaw-f785ce3106176d56865372de566314952954fe7f.zip
fix
Diffstat (limited to 'source')
-rw-r--r--source/saw/main.c10
1 files changed, 10 insertions, 0 deletions
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 <stdio.h>
+#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 },