fix: not initialising TTF module

This commit is contained in:
2025-06-26 11:04:55 +02:00
parent c1d7f71a02
commit 0a0e03a769

View File

@@ -10,6 +10,7 @@
#include "../error.h" #include "../error.h"
#include "../game/game.h" #include "../game/game.h"
#include "../game/time.h" #include "../game/time.h"
#include "SDL_ttf.h"
#include "audio.h" #include "audio.h"
#include "input.h" #include "input.h"
#include "render.h" #include "render.h"
@@ -22,6 +23,8 @@ void window_init(struct gamedata const* gdat) {
assert(!win && !close); assert(!win && !close);
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0)
fatal(ERROR_SDL_INIT, "SDL could not initialize! SDL Error: %s", SDL_GetError()); fatal(ERROR_SDL_INIT, "SDL could not initialize! SDL Error: %s", SDL_GetError());
if (TTF_Init() < 0)
fatal(ERROR_SDL_INIT, "TTF could not initialize! TTF Error: %s", TTF_GetError());
win = SDL_CreateWindow("tetris clone", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN); win = SDL_CreateWindow("tetris clone", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);
if (win == NULL) if (win == NULL)