diff --git a/sdlpp.hpp b/sdlpp.hpp index 9dc5870..424f013 100644 --- a/sdlpp.hpp +++ b/sdlpp.hpp @@ -102,6 +102,10 @@ public: Font() = delete; Font(const std::string &font, int size) { font_ptr = TTF_OpenFont(font.c_str(), size); + if(font_ptr == NULL) { + std::cerr << "Unable to load font '" << font << "': TTF Error: " << TTF_GetError() << std::endl; + throw "TTF_OpenFont error"; + } } ~Font() { TTF_CloseFont( font_ptr );