diff --git a/src/Font.cc b/src/Font.cc index 5d7fda5..aaf0312 100644 --- a/src/Font.cc +++ b/src/Font.cc @@ -1,9 +1,29 @@ #include "Font.h" +#include "ruby.h" #include #include +#include +#include FT_FREETYPE_H #define round_up_26_6(val) (((val) + 63) >> 6u) +static FT_Library ft; + +static void Init_FreeType() +{ + static bool initialized = false; + + if (initialized) + return; + + if (FT_Init_FreeType(&ft) != 0) + { + rb_raise(rb_eRuntimeError, "Error initializing FreeType"); + } + + initialized = true; +} + Font::Font() { m_loaded = false; diff --git a/src/Window.cc b/src/Window.cc index 26b3396..2af842c 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -13,7 +13,7 @@ typedef struct static VALUE ruby_class; -static void Init_SDL(void) +static void Init_SDL() { static bool initialized = false;