diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-17 13:29:58 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-17 13:29:58 +0100 |
commit | bcaee968761c1d2e85c20925b237480c87da9747 (patch) | |
tree | f91ab2c2396a6365eb0696902e63975dc18b5259 /src/crepe/facade/SDLContext.cpp | |
parent | bfc07676707eae2c0161c6b86ccdd1583d96f71b (diff) |
tmp fix
Diffstat (limited to 'src/crepe/facade/SDLContext.cpp')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index a06940d..1befbe5 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -294,7 +294,9 @@ void SDLContext::draw_text(const Text & text, const Font & font){ .b = text.data.text_color.b, .a = text.data.text_color.a, }; + TTF_Font * ttf_font = TTF_OpenFont(font.get_path().c_str(), Config::get_instance().font.size); SDL_Surface * font_surface = TTF_RenderText_Solid(font.get_font(), text.text.c_str(), color); + TTF_CloseFont(ttf_font); SDL_Texture * font_texture = SDL_CreateTextureFromSurface(this->game_renderer.get(), font_surface); SDL_FreeSurface(font_surface); |