From 23ae0898e6378805b37f1b9f9e3b1eb89fb38ed9 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 23 Jan 2018 16:08:59 -0500 Subject: [PATCH] load the font --- src/main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cc b/src/main.cc index f60159f..59044ce 100644 --- a/src/main.cc +++ b/src/main.cc @@ -5,6 +5,7 @@ #include #include "TextShader.h" #include "RectShader.h" +#include "Font.h" using namespace std; @@ -12,6 +13,7 @@ std::shared_ptr text_shader; std::shared_ptr rect_shader; std::shared_ptr rect_array; std::shared_ptr rect_buffer; +Font font; #define WIDTH 800 #define HEIGHT 800 @@ -124,6 +126,12 @@ int main(int argc, char *argv[]) return 2; } + if (!font.load(argv[1], HEIGHT / 10)) + { + fprintf(stderr, "Error loading font from %s\n", argv[1]); + return 2; + } + UpdateEvent.type = SDL_USEREVENT; UpdateEvent.user.code = 0; SDL_AddTimer(25, UpdateCallback, NULL);