aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/facade/SDLContext.cpp')
-rw-r--r--src/crepe/facade/SDLContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp
index 20bb030..274c14a 100644
--- a/src/crepe/facade/SDLContext.cpp
+++ b/src/crepe/facade/SDLContext.cpp
@@ -31,6 +31,9 @@ using namespace std;
SDLContext::SDLContext(Mediator & mediator) {
dbg_trace();
+ if (TTF_Init() == -1) {
+ throw runtime_error(format("SDL_ttf initialization failed: {}", TTF_GetError()));
+ }
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
throw runtime_error(format("SDLContext: SDL_Init error: {}", SDL_GetError()));
}
@@ -73,6 +76,7 @@ SDLContext::~SDLContext() {
// before.
IMG_Quit();
SDL_Quit();
+ TTF_Quit();
}
Keycode SDLContext::sdl_to_keycode(SDL_Keycode sdl_key) {