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);