mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 05:55:46 +01:00
fix: not initialising TTF module
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user