aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-17 13:29:58 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-17 13:29:58 +0100
commitbcaee968761c1d2e85c20925b237480c87da9747 (patch)
treef91ab2c2396a6365eb0696902e63975dc18b5259 /src/crepe/facade/SDLContext.cpp
parentbfc07676707eae2c0161c6b86ccdd1583d96f71b (diff)
tmp fix
Diffstat (limited to 'src/crepe/facade/SDLContext.cpp')
-rw-r--r--src/crepe/facade/SDLContext.cpp2
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);